Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Vim London: Custom Motions
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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.7k
Introduction to Node and its Core Modules
aryoung
3
280
Other Decks in Programming
See All in Programming
組織で育むオブザーバビリティ
ryota_hnk
0
180
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
180
Patterns of Patterns
denyspoltorak
0
1.4k
Fluid Templating in TYPO3 14
s2b
0
130
ノイジーネイバー問題を解決する 公平なキューイング
occhi
0
110
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
CSC307 Lecture 08
javiergs
PRO
0
670
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
2.6k
AWS re:Invent 2025参加 直前 Seattle-Tacoma Airport(SEA)におけるハードウェア紛失インシデントLT
tetutetu214
2
120
CSC307 Lecture 06
javiergs
PRO
0
690
Raku Raku Notion 20260128
hareyakayuruyaka
0
340
Claude Codeと2つの巻き戻し戦略 / Two Rewind Strategies with Claude Code
fruitriin
0
140
Featured
See All Featured
Making Projects Easy
brettharned
120
6.6k
Code Review Best Practice
trishagee
74
20k
Side Projects
sachag
455
43k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.7k
My Coaching Mixtape
mlcsv
0
48
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Balancing Empowerment & Direction
lara
5
890
Mobile First: as difficult as doing things right
swwweet
225
10k
Fireside Chat
paigeccino
41
3.8k
Designing Experiences People Love
moore
144
24k
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
BBQ
matthewcrist
89
10k
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