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
570
ターミナルアプリケーションとしての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
159
210k
黒画面が最高のしごと道具である3つの理由
lighttiger2505
0
2.1k
Golangで作るSQL Language Server(sqls)
lighttiger2505
1
910
Connect with many developers from the small plugin
lighttiger2505
0
400
作ってわかる現代のVimのAutoComplete ~そしてVimConf2019へ~
lighttiger2505
3
1.7k
自社サービスのDjangoを 1.3から1.11(LTS)に アップグレードするまでの道のり
lighttiger2505
6
3.6k
LSPがもたらしたVimプラグインの変化に思いを馳せる
lighttiger2505
2
1.5k
Go Language Server 使うべし
lighttiger2505
5
2.1k
Goで作るインタラクティブなCLIコマンドとそのデザイン
lighttiger2505
0
880
Other Decks in Programming
See All in Programming
Jakarta EE Meets AI
ivargrimstad
0
620
Reactの歴史を振り返る
tutinoko
1
170
CEDEC 2025 『ゲームにおけるリアルタイム通信への QUIC導入事例の紹介』
segadevtech
3
790
0から始めるモジュラーモノリス-クリーンなモノリスを目指して
sushi0120
0
250
AIコーディングエージェント全社導入とセキュリティ対策
hikaruegashira
16
9.5k
DynamoDBは怖くない!〜テーブル設計の勘所とテスト戦略〜
hyamazaki
0
190
実践!App Intents対応
yuukiw00w
1
220
[DevinMeetupTokyo2025] コード書かせないDevinの使い方
takumiyoshikawa
2
270
202507_ADKで始めるエージェント開発の基本 〜デモを通じて紹介〜(奥田りさ)The Basics of Agent Development with ADK — A Demo-Focused Introduction
risatube
PRO
6
1.4k
Scale out your Claude Code ~自社専用Agentで10xする開発プロセス~
yukukotani
8
1.6k
リッチエディターを安全に開発・運用するために
unachang113
1
360
技術的負債で信頼性が限界だったWordPress運用をShifterで完全復活させた話
rvirus0817
0
450
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Faster Mobile Websites
deanohume
308
31k
The Cult of Friendly URLs
andyhume
79
6.5k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Gamification - CAS2011
davidbonilla
81
5.4k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
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