Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Vim London: Custom Motions
Search
aryoung
January 29, 2013
Programming
6
3.7k
Vim London: Custom Motions
An overview of motions and how to create custom motions.
aryoung
January 29, 2013
Tweet
Share
More Decks by aryoung
See All by aryoung
Vim and the Web
aryoung
0
7.8k
Tern for Vim
aryoung
2
1.6k
Introduction to Node and its Core Modules
aryoung
3
270
Other Decks in Programming
See All in Programming
2025 컴포즈 마법사
jisungbin
0
160
レイトレZ世代に捧ぐ、今からレイトレを始めるための小径
ichi_raven
0
480
CSC305 Lecture 15
javiergs
PRO
0
210
GraalVM Native Image トラブルシューティング機能の最新状況(2025年版)
ntt_dsol_java
0
170
無秩序からの脱却 / Emergence from chaos
nrslib
2
10k
なあ兄弟、 余白の意味を考えてから UI実装してくれ!
ktcryomm
10
9.4k
関数の挙動書き換える
takatofukui
4
750
チーム開発の “地ならし"
konifar
8
6.4k
TypeScriptで設計する 堅牢さとUXを両立した非同期ワークフローの実現
moeka__c
5
2.7k
分散DBって何者なんだ... Spannerから学ぶRDBとの違い
iwashi623
0
140
モダンJSフレームワークのビルドプロセス 〜なぜReactは503行、Svelteは12行なのか〜
fuuki12
0
150
[SF Ruby Conf 2025] Rails X
palkan
0
380
Featured
See All Featured
A designer walks into a library…
pauljervisheath
210
24k
The Language of Interfaces
destraynor
162
25k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
118
20k
How to Ace a Technical Interview
jacobian
280
24k
A better future with KSS
kneath
239
18k
Navigating Team Friction
lara
190
16k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.4k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3k
Typedesign – Prime Four
hannesfritz
42
2.9k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
Transcript
Custom Motions in Vim Alex
Goals ‣ Revise
Motions move the cursor What
Custom Motions ‣ Motions
Vim’s Grammar [operator][count][motion] Change
Vim’s Grammar [operator][count][motion] d 2 w delete 2 words Wednesday,
30 January 13
Vim’s Grammar [operator][count][motion] Operator- Pending
Operator-Pending Mode ‣ Map
Mappings ‣ Example:
Mappings " From: learnvimscriptthehardway.stevelosh.com/chapters/51.html function! s:NextSection(type, backwards) endfunction noremap <script>
<buffer> <silent> ]] :call <SID>NextSection(1, 0)<cr> noremap <script> <buffer> <silent> [[ :call <SID>NextSection(1, 1)<cr> noremap <script> <buffer> <silent> ][ :call <SID>NextSection(2, 0)<cr> noremap <script> <buffer> <silent> [] :call <SID>NextSection(2, 1)<cr> Wednesday, 30 January 13
Mappings function! s:NextSection(type, backwards) if a:type == 1 let pattern
= ... elseif a:type == 2 let pattern = ... endif if a:backwards let dir = '?' else let dir = '/' endif execute 'silent normal! ' . dir . pattern . "\r" endfunction Wednesday, 30 January 13
In the Wild ‣ Functions ‣ search() ‣ Keys
search() ‣ Regular
Another Example ‣ New! ‣ Like
The End omap search() noremap Wednesday, 30 January 13