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.5k
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
260
Other Decks in Programming
See All in Programming
Vitest Browser Mode への期待 / Vitest Browser Mode
odanado
PRO
1
1.2k
メルカリ ハロ アプリの技術スタック
atsumo
2
880
いかにして不足・不整合なくデータ移行したか
tjmtmmnk
1
910
Why I Choose NetBeans for Jakarta EE
ivargrimstad
0
850
Workflow automationによるインシデント原因調査の自動化
showwin
1
110
GPU Hash Table | レイトレ合宿10
yknishidate
0
330
CSC305 Lecture 09
javiergs
PRO
0
120
Vue SFCのtemplateでTypeScriptの型を活用しよう
tsukkee
3
920
テスト駆動開発✅️
akitoshiga
1
170
sqlcを利用してsqlに型付けを
kamiyam
0
250
本編では話さない Zig の話
andpad
2
120
(Deep|Web) Link support with expo-router
mrtry
0
190
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
39
2.4k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
Making the Leap to Tech Lead
cromwellryan
131
8.9k
YesSQL, Process and Tooling at Scale
rocio
167
14k
[RailsConf 2023] Rails as a piece of cake
palkan
49
4.8k
Automating Front-end Workflow
addyosmani
1365
200k
Done Done
chrislema
181
16k
Designing for Performance
lara
604
68k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9k
Designing the Hi-DPI Web
ddemaree
280
34k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Code Review Best Practice
trishagee
64
17k
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