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.4k
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
Folding Cheat Sheet #3
philipschwarz
PRO
0
110
⼤規模⾔語モデルの拡張(RAG)が 終わったかも知れない件について
nearme_tech
22
15k
HUIT新歓2024「競技プログラミング、やってみませんか?」
slephy2784
1
250
スクラムチームと認知負荷 - ニフティのスクラムトーク Vol2. / NIFTY Tech Talk #18
niftycorp
PRO
1
120
Folding Cheat Sheet #1
philipschwarz
PRO
0
210
Folding Cheat Sheet #2
philipschwarz
PRO
0
110
単体テストを書かない技術 #phpcon_odawara
o0h
PRO
24
7.5k
せっかくモデル図描くのなら、嬉しいことが多い方がいいよね!
kuboaki
1
3k
Rubyでたのしむクリエイティブコーディング/Enjoy Creative coding with Ruby
chobishiba
1
160
DMMプラットフォームがTiDB Cloudを採用した背景
pospome
4
1.1k
Designing for tomorrow's programming workflows
honnibal
PRO
2
110
甘い香りに誘われてVanilla Extractを1年間運用してみた
miyahkun
1
110
Featured
See All Featured
Designing for humans not robots
tammielis
247
25k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
12
1.5k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
153
14k
How to name files
jennybc
64
92k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
272
12k
4 Signs Your Business is Dying
shpigford
175
21k
It's Worth the Effort
3n
180
27k
Building a Scalable Design System with Sketch
lauravandoore
455
32k
WebSockets: Embracing the real-time Web
robhawkes
59
7k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
19
1.9k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
74
41k
The Power of CSS Pseudo Elements
geoffreycrofte
58
5k
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