Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
f モーションで縦横無尽に移動しよう
Search
monaqa
December 17, 2019
Programming
990
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
f モーションで縦横無尽に移動しよう
Vim の f モーションは最高というお話です.
* f モーションとは
* f モーションのコツ
* f/t モーション+オペレータ
* 縦方向 f モーション
monaqa
December 17, 2019
More Decks by monaqa
See All by monaqa
Lua製プラグインdial.nvimの紹介
monaqa
1
350
SATySFi Language Server の現状と今後
monaqa
0
630
satysfi-easytable: SATySFi で簡易な表組版
monaqa
1
2.9k
Vimrc読書会のすすめ
monaqa
2
930
Other Decks in Programming
See All in Programming
自サークルのIdPからログアウトできるようになるまで
taiseiue
0
110
Security issues being discussed on Web Platforms
petamoriken
0
1.4k
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
230
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
710
contenteditable と日本語入力に向き合う
colorful12
0
150
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
140
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
140
最近”作らせてる” ローカルAIアプリの話
akit37
0
110
Are APIs Still Relevant in the AI Era?
soyuka
0
420
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
630
CodeRabbitの効果検証と過ごしてみた3ヶ月
armondando
0
150
Featured
See All Featured
Designing Powerful Visuals for Engaging Learning
tmiket
1
590
Typedesign – Prime Four
hannesfritz
42
3.2k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
690
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
790
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Deep Space Network (abreviated)
tonyrice
0
360
YesSQL, Process and Tooling at Scale
rocio
174
15k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
450
Into the Great Unknown - MozCon
thekraken
41
2.8k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
310
BBQ
matthewcrist
89
10k
Transcript
f モーションで 縦横無尽に移動しよう monaqa 2019 年 12 月 17 日
1/16
自己紹介 名前: monaqa (モナカ) Qiita/GitHub アカウント: monaqa Twitter: @mo_naqa 好きなエディタ:
Vim (普段は Neovim を使用) Vim 歴: 1 年 2 ヶ月 好きな Vim のキーマップ: NORMAL モードの f 2/16
f モーションとは :help f f :カーソル行で,文字 が次に現れる場所に移動 (Find) Hello, world!
Hello, world! fo 派生コマンド t:カーソル行で,文字 が次に現れる直前の文字に移動 (Till) Hello, world! Hello, world! to その他: F, T, ;, , など 3/16
f モーションのコツ 記号を使おう return self.request('nvim_buf_get_lines', i, i + 1, True)[0]
この文字列に飛びたい 記号は目立つため,一発で飛べない場合も事前に察知できる 数字やアルファベット大文字も使いやすい 4/16
f モーションのコツ 記号を使おう fn n n この文字列に飛びたい ←アルファベット小文字は一発で飛びにくい return self.request('nvim_buf_get_lines',
i, i + 1, True)[0] この文字列に飛びたい 記号は目立つため,一発で飛べない場合も事前に察知できる 数字やアルファベット大文字も使いやすい 5/16
f モーションのコツ 記号を使おう f' fn n n ' この文字列に飛びたい ←アルファベット小文字は一発で飛びにくい
return self.request('nvim_buf_get_lines', i, i + 1, True)[0] この文字列に飛びたい 記号は目立つため,一発で飛べない場合も事前に察知できる 数字やアルファベット大文字も使いやすい 6/16
f モーションのコツ 記号を使おう f( return self.request('nvim_buf_get_lines', i, i + 1,
True)[0] f. f[ f' f+ (この例だと) 一発で色んな場所に行ける! 記号は目立つため,一発で飛べない場合も事前に察知できる 数字やアルファベット大文字も使いやすい 7/16
f/t モーション+オペレータ f/t は motion のため,d/c/y などのオペレータと組み合わせ可能 self.get_name(foo, bar) +
1 self.get_name(foo, bar) + 1 self. + 1 self.name + 1 例:メソッドを一旦消してフィールドに書き換えたい cf) f) name c:移動場所までの範囲を消して 挿入モードになる 8/16
f/t モーション+オペレータ f/t は motion のため,d/c/y などのオペレータと組み合わせ可能 'tekitou na mojiretsu'
'tekitou ' 2. 文字列の途中(カーソル位置) から最後まで消したいとき dt'
[email protected]
@gmail.com 1. メールアドレスの @ の手前 から書き直したいとき ct@ 9/16
f/t モーション+オペレータ f/t は motion のため,d/c/y などのオペレータと組み合わせ可能 int tekito_kari_counter; int
tekito_counter; 4. snake_case 変数の途中の 文字を削除したいとき df_ String tekitoCamelStr; String tekitoStr; 3. camelCase 変数の途中の 文字を変更したいとき ctS 本当はもっともっとたくさんの応用例がある(特に t) 10/16
f モーションの良いところ / 悪いところ 良いところ 省エネ・高効率 汎用性が高い (良い目印を選べば)直感的に移動可能 「一発で」所望の場所に飛んだ時の快感 オペレータと組み合わせたときの破壊力
悪いところ 横にしか移動できない 11/16
f モーションの良いところ / 悪いところ 良いところ 省エネ・高効率 汎用性が高い (良い目印を選べば)直感的に移動可能 「一発で」所望の場所に飛んだ時の快感 オペレータと組み合わせたときの破壊力
悪いところ 横にしか移動できない あれ?この発表のタイトルは「縦横無尽」じゃなかったっけ?? 12/16
縦方向 f モーション こんな記事を書きました(Vim その 2 Advent Calendar 2018 の
3 日目) 13/16
まとめと宣伝 f モーションは最高!! f モーションには記号を使おう f モーション + オペレータで幸せになれる 縦の移動は縦方向
f モーションが便利 興味がある方は是非記事をご覧ください https://qiita.com/monaqa/items/9764e957523ad0b56aec :qa! 14/16
補遺 15/16
縦方向 f モーションについて ## はじめに 最近,コーディングをしたり 学会の原稿を書いたりすると きに vim を使おうと試みて
います. 今⽇は⾃分が実装した(ちょ っと)便利なコマンドを紹介 します. (... 中略 ...) ## f 移動とは? example.md ␣f#↩ <Space>f<CR> と押せば, から 始まる行に移動できる 利点 .vimrc に数行追加するだけで使える 先頭さえ覚えていれば画面外の場所 でも移動できる / とは違い行頭しか見ないため, 把 握すべき範囲が狭くて済む オペレータとも組み合わせられる 16/16