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.6k
Introduction to Node and its Core Modules
aryoung
3
270
Other Decks in Programming
See All in Programming
NIKKEI Tech Talk#38
cipepser
0
350
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
470
Software Architecture
hschwentner
6
2.4k
Amazon ECS Managed Instances が リリースされた!キャッチアップしよう!! / Let's catch up Amazon ECS Managed Instances
cocoeyes02
0
120
Register is more than clipboard
satorunooshie
1
330
CSC509 Lecture 08
javiergs
PRO
0
270
AIと人間の共創開発!OSSで試行錯誤した開発スタイル
mae616
2
860
CSC305 Lecture 11
javiergs
PRO
0
320
Ktorで簡単AIアプリケーション
tsukakei
0
120
AI時代に必須!状況言語化スキル / ai-context-verbalization
minodriven
2
280
iOSでSVG画像を扱う
kishikawakatsumi
0
180
モテるデスク環境
mozumasu
3
1.4k
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
412
23k
Designing for Performance
lara
610
69k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
658
61k
Designing for humans not robots
tammielis
254
26k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
2.9k
Raft: Consensus for Rubyists
vanstee
140
7.2k
Code Review Best Practice
trishagee
72
19k
Rails Girls Zürich Keynote
gr2m
95
14k
Building an army of robots
kneath
306
46k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
116
20k
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