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.6k
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
階層化自動テストで開発に機動力を
ickx
1
410
Caude codeで爆速開発
codelynx
0
100
NEWT Backend Evolution
xpromx
1
150
AI Ramen Fight
yusukebe
0
110
「テストは愚直&&網羅的に書くほどよい」という誤解 / Test Smarter, Not Harder
munetoshi
1
220
TypeScriptでDXを上げろ! Hono編
yusukebe
3
860
MCPで実現できる、Webサービス利用体験について
syumai
6
1.8k
Jakarta EE Meets AI
ivargrimstad
0
270
顧客の画像データをテラバイト単位で配信する 画像サーバを WebP にした際に起こった課題と その対応策 ~継続的な取り組みを添えて~
takutakahashi
4
1.4k
The Modern View Layer Rails Deserves: A Vision For 2025 And Beyond @ RailsConf 2025, Philadelphia, PA
marcoroth
2
780
Git Sync を超える!OSS で実現する CDK Pull 型デプロイ / Deploying CDK with PipeCD in Pull-style
tkikuc
4
450
コーディングエージェント概観(2025/07)
itsuki_t88
0
130
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Designing for Performance
lara
610
69k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
47
9.6k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
22k
Making the Leap to Tech Lead
cromwellryan
134
9.4k
Building an army of robots
kneath
306
45k
How GitHub (no longer) Works
holman
314
140k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
760
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
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