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
AI Agents with JavaScript
slobodan
0
180
PHPのガベージコレクションを深掘りしよう
rinchoku
0
250
複雑なフォームと複雑な状態管理にどう向き合うか / #newt_techtalk vol. 15
izumin5210
4
3.6k
Django for Data Science (Boston Python Meetup, March 2025)
wsvincent
0
260
本当だってば!俺もTRICK 2022に入賞してたんだってば!
jinroq
0
260
マルチアカウント環境での、そこまでがんばらない RI/SP 運用設計
wa6sn
0
640
リアクティブシステムの変遷から理解するalien-signals / Learning alien-signals from the evolution of reactive systems
yamanoku
2
1.1k
JavaOne 2025: Advancing Java Profiling
jbachorik
1
320
体得しよう!RSA暗号の原理と解読
laysakura
3
540
gen_statem - OTP's Unsung Hero
whatyouhide
1
160
データベースエンジニアの仕事を楽にする。PgAssistantの紹介
nnaka2992
9
4.3k
Day0 初心者向けワークショップ実践!ソフトウェアテストの第一歩
satohiroyuki
0
490
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
46
2.4k
What's in a price? How to price your products and services
michaelherold
245
12k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
Site-Speed That Sticks
csswizardry
4
460
Become a Pro
speakerdeck
PRO
27
5.2k
How to Think Like a Performance Engineer
csswizardry
22
1.5k
Large-scale JavaScript Application Architecture
addyosmani
511
110k
Why Our Code Smells
bkeepers
PRO
336
57k
Into the Great Unknown - MozCon
thekraken
36
1.7k
GraphQLの誤解/rethinking-graphql
sonatard
70
10k
A Modern Web Designer's Workflow
chriscoyier
693
190k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
12
1.4k
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