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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
aryoung
January 29, 2013
Programming
3.8k
6
Share
Vim London: Custom Motions
An overview of motions and how to create custom motions.
aryoung
January 29, 2013
More Decks by aryoung
See All by aryoung
Vim and the Web
aryoung
0
7.8k
Tern for Vim
aryoung
2
1.7k
Introduction to Node and its Core Modules
aryoung
3
290
Other Decks in Programming
See All in Programming
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
310
JJUG CCC 2026 Spring: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
110
関係性から理解する"同一性"の型用語たち
pvcresin
2
620
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
140
新規プロダクトを高速で生み出すハーネスエンジニアリング
seanchas116
18
7.6k
ECR拡張スキャンでSBOMを収集して サプライチェーン攻撃の影響調査を 爆速で終わらせてみた
akihisaikeda
2
210
RailsTokyo 2026#4: AI様があれば、 Hotwireの弱点は消えるか?
naofumi
5
1k
自動レビューエンジンの実装と運用 ~レビューのない世界へ~
kurukuru1999
2
300
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
320
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
190
権限チェックの一貫性を型で守る TypeScript による多層防御
mnch
4
990
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
1
390
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
187
22k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
150
Faster Mobile Websites
deanohume
310
31k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Navigating Team Friction
lara
192
16k
Making the Leap to Tech Lead
cromwellryan
135
9.9k
Why Our Code Smells
bkeepers
PRO
340
58k
Documentation Writing (for coders)
carmenintech
77
5.4k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
23k
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