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.6k
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
Amazon RDS 向けに提供されている MCP Server と仕組みを調べてみた/jawsug-okayama-2025-aurora-mcp
takahashiikki
1
110
MCPとデザインシステムに立脚したデザインと実装の融合
yukukotani
4
1.4k
Processing Gem ベースの、2D レトロゲームエンジンの開発
tokujiros
2
130
テストコードはもう書かない:JetBrains AI Assistantに委ねる非同期処理のテスト自動設計・生成
makun
0
260
ぬるぬる動かせ! Riveでアニメーション実装🐾
kno3a87
1
210
Design Foundational Data Engineering Observability
sucitw
3
190
Laravel Boost 超入門
fire_arlo
3
210
今から始めるClaude Code入門〜AIコーディングエージェントの歴史と導入〜
nokomoro3
0
130
CloudflareのChat Agent Starter Kitで簡単!AIチャットボット構築
syumai
2
480
CJK and Unicode From a PHP Committer
youkidearitai
PRO
0
110
Swift Updates - Learn Languages 2025
koher
2
470
Kiroで始めるAI-DLC
kaonash
2
580
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
520
The Invisible Side of Design
smashingmag
301
51k
Site-Speed That Sticks
csswizardry
10
810
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Making Projects Easy
brettharned
117
6.4k
Typedesign – Prime Four
hannesfritz
42
2.8k
Rebuilding a faster, lazier Slack
samanthasiow
83
9.2k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
Unsuck your backbone
ammeep
671
58k
A Tale of Four Properties
chriscoyier
160
23k
Code Reviewing Like a Champion
maltzj
525
40k
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