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
470
ターミナルアプリケーションとしての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
黒画面が最高のしごと道具である3つの理由
lighttiger2505
0
200
Golangで作るSQL Language Server(sqls)
lighttiger2505
1
680
Connect with many developers from the small plugin
lighttiger2505
0
290
作ってわかる現代のVimのAutoComplete ~そしてVimConf2019へ~
lighttiger2505
3
1.5k
自社サービスのDjangoを 1.3から1.11(LTS)に アップグレードするまでの道のり
lighttiger2505
6
3.3k
LSPがもたらしたVimプラグインの変化に思いを馳せる
lighttiger2505
2
1.3k
Go Language Server 使うべし
lighttiger2505
5
1.9k
Goで作るインタラクティブなCLIコマンドとそのデザイン
lighttiger2505
0
720
GUI is not fast enough!! (GUIには速さが足りないっ!!)
lighttiger2505
0
500
Other Decks in Programming
See All in Programming
最新TCAキャッチアップ
0si43
0
210
Missing parts when designing and implementing Android UI
ericksli
0
220
Nurturing OpenJDK distribution: Eclipse Temurin Success History and plan
ivargrimstad
0
1.1k
Modular Monolith Monorepo ~シンプルさを保ちながらmonorepoのメリットを最大化する~
yuisakamoto
9
1.1k
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
CSC509 Lecture 11
javiergs
PRO
0
180
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
350
React CompilerとFine Grained Reactivityと宣言的UIのこれから / The next chapter of declarative UI
ssssota
5
650
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
7
1.8k
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.8k
Djangoの開発環境で工夫したこと - pre-commit / DevContainer
hiroki_yod
1
270
subpath importsで始めるモック生活
10tera
0
340
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Faster Mobile Websites
deanohume
305
30k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
The Cult of Friendly URLs
andyhume
78
6k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
120
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
900
Designing Experiences People Love
moore
138
23k
Six Lessons from altMBA
skipperchong
27
3.5k
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