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.8k
Vimrc読書会のすすめ
monaqa
2
920
Other Decks in Programming
See All in Programming
LLMは4年分のCompose移行を再現できるのか?実プロダクト279件のXMLで探る自動化の境界線
makun
0
500
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
120
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
6
3.5k
What We Talk About When We Talk About XP
m_seki
2
450
App Intentsのビルドプロセスを支える技術
kntkymt
0
180
新卒PdEのリアル
ryu1013
1
480
20260828_品質と開発生産性を両立させる、AI時代のE2Eテストの考え方
magicpod
0
180
AIは賢い。でも実行環境は? CLIおじさんがAI時代に伝えたいこと ~ CLIおじさんがAI時代に伝えたいこと ~
curekoshimizu
1
220
Deep dive into the select statement (GopherCon UK)
jespino
0
170
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
1
490
「AI時代、配布するPythonコードをどう守るか: 難読化の実験と判断軸」 #PyconJP2026
pkshadeck
PRO
2
190
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
2
270
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
100
6.3k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
510
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
520
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
410
The Curse of the Amulet
leimatthew05
2
14k
How to build a perfect <img>
jonoalderson
1
6k
What does AI have to do with Human Rights?
axbom
PRO
1
2.4k
The browser strikes back
jonoalderson
0
1.7k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
570
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
710
Darren the Foodie - Storyboard
khoart
PRO
3
3.9k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
500
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