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
LangGraphでのHuman-in-the-Loopの実装
os1ma
3
1.1k
『ドメイン駆動設計をはじめよう』中核の業務領域
masuda220
PRO
5
1k
開発を加速する共有Swift Package実践
elmetal
PRO
0
420
2024 컴포즈 정원사
jisungbin
0
150
Crafting Cross-Platform Adventures: Building a Game Engine with Kotlin Multiplatform
dwursteisen
0
220
【TID2024】模擬講義:プログラマと一緒にゲームをデザインしてみよう!
akatsukigames_tech
0
680
Scala におけるコンパイラエラーとの付き合い方
chencmd
2
430
How to Break into Reading Open Source
kaspth
2
220
Using Livebook to build and deploy internal tools @ ElixirConf 2024
hugobarauna
0
250
GraphQL あるいは React における自律的なデータ取得について
quramy
11
3k
僕が思い描くTypeScriptの未来を勝手に先取りする
yukukotani
9
2.4k
Ebitengineの1vs1ゲーム WebRTCの活用
ponyo877
0
380
Featured
See All Featured
Building an army of robots
kneath
302
42k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
28
1.6k
It's Worth the Effort
3n
182
27k
Designing with Data
zakiwarfel
98
5k
KATA
mclloyd
27
13k
[RailsConf 2023] Rails as a piece of cake
palkan
48
4.6k
GraphQLとの向き合い方2022年版
quramy
43
13k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
How to train your dragon (web standard)
notwaldorf
85
5.6k
Building Applications with DynamoDB
mza
90
6k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
363
22k
A Tale of Four Properties
chriscoyier
155
22k
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