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
AsyncSequenceとAsyncStreamのプロポーザルを全部読む!!
s_shimotori
1
220
実践Claude Code:20の失敗から学ぶAIペアプログラミング
takedatakashi
18
9.4k
CSC509 Lecture 10
javiergs
PRO
0
160
Software Architecture
hschwentner
6
2.4k
20251016_Rails News ~Rails 8.1の足音を聴く~
morimorihoge
3
910
O Que É e Como Funciona o PHP-FPM?
marcelgsantos
0
250
TransformerからMCPまで(現代AIを理解するための羅針盤)
mickey_kubo
7
5.9k
pnpm に provenance のダウングレード を検出する PR を出してみた
ryo_manba
1
170
When Dependencies Fail: Building Antifragile Applications in a Fragile World
selcukusta
0
120
Migration to Signals, Resource API, and NgRx Signal Store
manfredsteyer
PRO
0
140
Vueのバリデーション、結局どれを選べばいい? ― 自作バリデーションの限界と、脱却までの道のり ― / Which Vue Validation Library Should We Really Use? The Limits of Self-Made Validation and How I Finally Moved On
neginasu
3
1.8k
AI時代に必須!状況言語化スキル / ai-context-verbalization
minodriven
2
290
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
697
190k
BBQ
matthewcrist
89
9.9k
Scaling GitHub
holman
463
140k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
2.9k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
34
2.3k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.2k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.7k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Documentation Writing (for coders)
carmenintech
76
5.1k
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