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
Search
Toshikazu Ohashi
March 11, 2019
Programming
0
530
ターミナルアプリケーションとしてのVim
ゴリラ.vim #2
https://gorillavim.connpass.com/event/121394/
Toshikazu Ohashi
March 11, 2019
Tweet
Share
More Decks by Toshikazu Ohashi
See All by Toshikazu Ohashi
無自覚にメンバーの心理的安全性を奪っていた経験から得た学び
lighttiger2505
146
190k
黒画面が最高のしごと道具である3つの理由
lighttiger2505
0
1.9k
Golangで作るSQL Language Server(sqls)
lighttiger2505
1
830
Connect with many developers from the small plugin
lighttiger2505
0
340
作ってわかる現代のVimのAutoComplete ~そしてVimConf2019へ~
lighttiger2505
3
1.6k
自社サービスのDjangoを 1.3から1.11(LTS)に アップグレードするまでの道のり
lighttiger2505
6
3.4k
LSPがもたらしたVimプラグインの変化に思いを馳せる
lighttiger2505
2
1.3k
Go Language Server 使うべし
lighttiger2505
5
2k
Goで作るインタラクティブなCLIコマンドとそのデザイン
lighttiger2505
0
780
Other Decks in Programming
See All in Programming
Compose UIテストを使った統合テスト
hiroaki404
0
110
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
130
fs2-io を試してたらバグを見つけて直した話
chencmd
0
260
Jakarta EE meets AI
ivargrimstad
0
340
Recoilを剥がしている話
kirik
5
7.6k
Beyond ORM
77web
10
1.4k
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
590
Effective Signals in Angular 19+: Rules and Helpers
manfredsteyer
PRO
0
180
Findy Team+ Awardを受賞したかった!ベストプラクティス応募内容をふりかえり、開発生産性向上もふりかえる / Findy Team Plus Award BestPractice and DPE Retrospective 2024
honyanya
0
120
Online-Dokumentation, die hilft: Strukturen, Prozesse, Tools
ahus1
0
100
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
160
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.8k
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Writing Fast Ruby
sferik
628
61k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
190
Being A Developer After 40
akosma
89
590k
Transcript
λʔϛφϧ ΞϓϦέʔγϣϯ ͱͯ͠ͷ 7JN ΰϦϥWJN !MJHIUUJHFS
ΠϯτϩμΫγϣϯ
7JNͷྑ͞ͱ͍͑ʁ • λʔϛφϧͷதͰىಈ͢Δ • ϞʔυʹΑΔҠಈ/ฤू͕ͱͬͯศར • VimscriptʹΑΔ֦ுੑͷߴ͞ • ىಈͷ͞ •
େମͷαʔόϚγϯͰΠϯετʔϧࡁΈ
ຊͷςʔϚ • λʔϛφϧͷதͰىಈ͢Δ • ϞʔυʹΑΔҠಈ/ฤू͕ͱͬͯศར • VimscriptʹΑΔ֦ுੑͷߴ͞ • ىಈͷ͞ •
େମͷαʔόϚγϯͰΠϯετʔϧࡁΈ
λʔϛφϧͰىಈ͢Δྑ͞ ͱ͍͑ʁ • αʔόϚγϯͩͱͦͦGUIΤσΟλ͕͑ͳ͍ • ଞͷίϚϯυ͔Βͷ࿈ܞ͕εϜʔζʹߦ͑Δ
ຊ͢༰ • αʔόϚγϯͩͱͦͦGUIΤσΟλ͕͑ͳ͍ • ଞͷίϚϯυ͔Βͷ࿈ܞ͕εϜʔζʹߦ͑Δ
ίϚϯυ͔Β7JNΛίʔϧ ͢Δͱ͍͏͜ͱ
7JNΛίʔϧ͢ΔίϚϯυͱ • crontab -e • git commit • etc... ࣮ߦ͢ΔͱΤσΟλ(Vimͱ͔)Λىಈͯ͠ϑΝΠϧΛ։͘->
อଘͯ͠ดͨ͡ͱ͖ɺฤू݁ՌΛύʔεͯ͠͏ίϚϯυ
%FNP • git commit • SQL client(mysql, psql, etc)
౾ࣝ git commit ͱ͔ git rebase -i Ωϟϯηϧ͍ͨ͠Μ Ͱ͚͢Ͳ •
:cq ͠·͠ΐ͏ • ฤू༰Λഁغͯ͠ΤϥʔίʔυΛฦ͠·͢
ڥม&%*503
7JNͰ͔͠։͔ͳ͍ʁ • ΤσΟλΛ։͘ίϚϯυଟ͘ͷ߹EDITORʹઃఆ͞ Ε͍ͯΔίϚϯυΛ࣮ߦ͢Δ • export EDITOR=vim ͩͱVimΛىಈ͢Δ • ׳शͱͯ͠ͷ͜͏ͳ͍ͬͯΔ͚ͩͳͷͰɺEDITORΛ
༻͠ͳ͍ίϚϯυ͋Δ
74$PEFΛىಈ͍ͨ͠ • ୯७ʹ export EDITOR=code ͩͱବ • ىಈޙϓϩηε͕ৗற͢ΔλΠϓͷΤσΟλͩͱฤू ྃΛͨͳ͍ •
ϑΝΠϧ։͍ͯଈ࠲ʹίϚϯυͱͯ͠ऴΘΔ • export EDITOR='code --wait' • --waitΛ͚ͭΔ͜ͱͰฤूྃ·ͰͭΑ͏ʹͳΔ
%FNP • git commit on vscode
74$PEFͰ͍͍ͷͰʁ • (ྲྀੴʹVimʹൺΔͱ)ىಈ͕͍ • λʔϛφϧʹΔ·Ͱʹϫϯεςοϓඞཁ • VimͳΒ :wq ͰΔ •
VSCodeͳΒ อଘͯ͠ด͡Δ > λʔϛφϧʹΔ
͜͜·Ͱͷ·ͱΊ • λʔϛφϧ্ͰίϚϯυ͔ΒVimΛݺͼग़͢ͷศར • ىಈ૬·ͬͯɺίϚϯυ͔Βίʔϧ͞ΕΔΤσΟ λͱͯ͠VimʹΞυόϯςʔδ͕͋Δͱࢥ͍ͬͯΔ
͖ΈWJNEJ⒎Λ ͍ͬͯ͠Δ͔
WJNEJ⒎ͱ Vimʹଂ͞Ε͍ͯΔࠩදࣔ/Ϛʔδπʔϧ • vimdiff file1 file2 [file3 [file4]] • vim
-d file1 file2 [file3 [file4]]
%FNP • vimdiff
(JU࿈ܞ
(JU WJNEJ⒎ • git difftool ͰࠩใΛ֎෦πʔϧʹ࿈ܞ͢Δ͜ͱ ͕Ͱ͖Δ • GitͷࠩΛVim্ͰݟΔ͜ͱ͕Ͱ͖Δ •
git mergetool ͰίϯϑϦΫτใΛ֎෦πʔϧʹ࿈ ܞ͢Δ͜ͱ͕Ͱ͖Δ • GitͷίϯϑϦΫτΛVimͰղফ͢Δ͜ͱ͕Ͱ͖Δ
(JUͷEJ⒎UPPMʹ7JNΛ͏ • ҎԼͷઃఆΛ~/.gitconfigʹՃ͢Δ͜ͱͰvimdiff ΛGitͷdifftoolͳ͍͠mergetoolͱͯ͠ొͰ͖Δ [diff] tool = vimdiff [merge] tool
= vimdiff
Ԡ༻ฤ5JH࿈ܞ
5JHͱ • λʔϛφϧ্ͰGitΛϦονʹදࣔ͢ΔTUIΞϓϦ • ઃఆϑΝΠϧ(~/.tigrc)ͰڍಈΛΧελϚΠζͰ͖Δ • ҎԼͷઃఆΛೖΕΔ͜ͱͰɺtigͰબͨ͠diffΛ vimdiffͰݟΔ͜ͱ͕Ͱ͖Δ bind main
D !sh -c "git difftool %(commit)~ %(commit)" bind diff D !sh -c "git difftool %(commit)~ %(commit)" bind refs D !sh -c "git difftool %(branch)"
%FNP • tig & git difftool
/FP7JNͷWJNEJ⒎
/FP7JNͷWJNEJ⒎ •vimdiffͱ͍͏ίϚϯυVimͷγϯϘϦοΫϦϯΫ •NeoVimΠϯετʔϧࡁΈͰvimdiffΛୟ͘ͱVim͕ىಈ •NeoVimͷࠩϞʔυΛvimdiffͰ࣮ߦ͢Δ߹ɺҎԼͷ ΤΠϦΞεઃఆ͕ඞཁ alias vimdiff='nvim -d'
/FP7JNͷHJU<EJ⒎NFSHF>UPPM • git [diff/merge]toolΤΠϦΞεΛݟͳ͍ • NeoVimͷvimdiffΛ͏߹ɺ~/.gitconfigʹҎԼ ͷઃఆ͕ඞཁ [difftool "vimdiff"] cmd
= "nvim -R -d -c \"wincmd l\" -d \"$LOCAL\" \"$REMOTE\"" [mergetool "vimdiff"] cmd = "nvim -d -c \"4wincmd w | wincmd J\" \"$LOCAL\" \"$BASE\" \"$REMOTE\" \"$MERGED\""
࠷ޙʹ
ࠓ͔͑ͨͬͨϝοηʔδ • Vim͕ϑΟοτ͢Δൣғ෯͍ • ϝϞॻ͖ͷΑ͏ͳͪΐͬͱͨ͠ฤू • IDEͷΑ͏ͳॏ͍ฤू • VimΛىಈͯ͠Ӡʑ͚ͩͰͳ͘ɺ֎෦͔ΒVimΛىಈ͢Δ ͱͤͳ͜ͱ͕͋Δύλʔϯ͋Δ
7JNͦΕՄೳੑͷ्
ࣗݾհ lighttiger2505 •αʔόαΠυΤϯδχΞ@iRidge •ࣄ:Python •झຯ:Golang࣌ʑVimscript •lab •deoplete-vim-lsp