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.7k
Introduction to Node and its Core Modules
aryoung
3
290
Other Decks in Programming
See All in Programming
Codex の「自走力」を高める
yorifuji
0
1.1k
Railsの気持ちを考えながらコントローラとビューを整頓する/tidying-rails-controllers-and-views-as-rails-think
moro
5
390
The Ralph Wiggum Loop: First Principles of Autonomous Development
sembayui
0
3.7k
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
4
640
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
480
文字コードの話
qnighy
44
17k
15年目のiOSアプリを1から作り直す技術
teakun
1
620
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
360
技術検証結果の整理と解析をAIに任せよう!
keisukeikeda
0
110
今更考える「単一責任原則」 / Thinking about the Single Responsibility Principle
tooppoo
3
1.6k
受け入れテスト駆動開発(ATDD)×AI駆動開発 AI時代のATDDの取り組み方を考える
kztakasaki
2
550
RubyとGoでゼロから作る証券システム: 高信頼性が求められるシステムのコードの外側にある設計と運用のリアル
free_world21
0
260
Featured
See All Featured
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
450
Designing for humans not robots
tammielis
254
26k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Between Models and Reality
mayunak
2
230
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Mobile First: as difficult as doing things right
swwweet
225
10k
A Tale of Four Properties
chriscoyier
163
24k
Tell your own story through comics
letsgokoyo
1
840
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
68
KATA
mclloyd
PRO
35
15k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.4k
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