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
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
開発に寄りそう自動テストの実現
goyoki
2
1.7k
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
150
組み合わせ爆発にのまれない - 責務分割 x テスト
halhorn
1
180
SQL Server 2025 LT
odashinsuke
0
120
AtCoder Conference 2025
shindannin
0
880
Denoのセキュリティに関する仕組みの紹介 (toranoana.deno #23)
uki00a
0
210
re:Invent 2025 のイケてるサービスを紹介する
maroon1st
0
160
クラウドに依存しないS3を使った開発術
simesaba80
0
210
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
310
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
6
1.5k
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
900
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
1
210
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
340
58k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
2
270
Music & Morning Musume
bryan
46
7k
Discover your Explorer Soul
emna__ayadi
2
1k
Mobile First: as difficult as doing things right
swwweet
225
10k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
2
3.8k
Darren the Foodie - Storyboard
khoart
PRO
0
2.1k
The Curse of the Amulet
leimatthew05
0
6.6k
Rails Girls Zürich Keynote
gr2m
95
14k
AI: The stuff that nobody shows you
jnunemaker
PRO
1
130
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