iTerm2+NeoVimã«å®ä½ããããã«ãã£ããã¨
æè¿ããããNeoVimç°å¢ããããããã«ã¾ã¨ã¾ã£ã¦ããã®ã§ãæ¯ãè¿ãã¤ãã§ã«è¨äºãæ¸ãã¦ã¿ã¾ãã ã¿ã¼ããã«éçºç°å¢ãæ´ããããã®Tipséã¨ãã¦èªãã§é ããã¨å¹¸ãã§ãã
GitHubãªãã¸ããªã§dotfilesãå ¬éãã¦ããã®ã§ãè¨äºã®ä¸ã§ããã®è¨å®ã©ããã£ã¦ããã®ï¼ãã¨ããé¨åãããã°åç §ãã¦ã¿ã¦ãã ããã
ãã¨ããã£ã¨ãããã¼ã«ã¨ãããããè¨å®ãããï¼ãã¨ããã®ãããã°ãã²æãã¦ä¸ããï¼ï¼
éçºç°å¢ã®æ¦è¦
ãã®è¨äºã§ã¯ãMacã使ããã¨ãåæã¨ãã¦ãã¾ãã ç´¹ä»ããç°å¢ã®æ¦è¦ã¯ä»¥ä¸ã®ã¨ããã§ãã
- ããæ¸ãã³ã¼ã : ã³ã³ãã¥ã¼ã¿ãã¸ã§ã³ç³», ç»åå¦çç³», æ°å¤è¨ç®ç³»
- ã¡ã¤ã³ã®éçºè¨èª : C++ (CMake), CUDA, Python
- ãã·ã³ : MacBookPro (USé å) + GPUæè¼ã®Ubuntuãµã¼ãã¼
- ã¿ã¼ããã« : iTerm2
- Shell : zsh + bash
ç´¹ä»ããå 容ã¯ãå ¨ã¦2019å¹´8æç¾å¨ã®ææ°ãªãªã¼ã¹ã«å¾ã£ã¦æ¸ãã¦ãã¾ãã
ã¹ãã³ãµã¼ãªã³ã¯
ããã
1. Macæ¬ä½
1.1. è±åé åãã¼ãã¼ãã®MacBookãè²·ã
ã¾ãã¯ãè±åé åã®ãã¼ãã¼ãã«ããã¨ããããã¹ã¿ã¼ãã§ãã
å人çã«ã¯ãã³ã¼ãã£ã³ã°ããããªãJISé
åããUSé
åã®ã»ããæå©ã ã¨æã£ã¦ãã¾ãã
USé
åã¯JISé
åã«æ¯ã¹ã¦"
ãæ¼ãããããã¨ã[
, ]
ã横並ã³ã«ãªã£ã¦ãããã¨ãå³æå°æããEnter
ã¾ã§ã®è·é¢ãè¿ããã¨ãªã©ãçç±ã§ãã
å®ã¯ãæ¥æ¬å½å ã§è³¼å ¥ã§ããUSé åã®ãã¼ããã½ã³ã³ã¯ãã¾ãå¤ããªãã®ã§ãããããããããã¨ã«MacBookã¯è³¼å ¥æã«ãã¼ãã¼ãé åãæå®ã§ãã¾ãã
ã¾ã次ã®ç¯ã§èª¬æãã¾ãããMacã§ã¯ã¹ãã¼ã¹ã®å·¦å³ã«ããcommand
ãã¼ãæ¥æ¬èª/è±æ°å
¥åã®åãæ¿ããã¼ã«ã«ã¹ã¿ã ã§ããã®ã§ãUSé
åã§ãæ¥æ¬èªå
¥åæã®ã¹ãã¬ã¹ã¯ã»ã¨ãã©ããã¾ããã
ç§ã®å ´åã¯ãWindowsã®å¤ä»ããã¼ãã¼ãããå¾ã ã«USé åã«æ £ãã¦ãããMacBookãè²·ãæããã¿ã¤ãã³ã°ã§USé åã«å®å ¨ç§»è¡ãã¾ããã Elecomã1000åãããã§USé åã®ãã¼ãã¼ãã販売ãã¦ãããããã®ã§ãæ°ã«ãªãæ¹ã¯ä¸åº¦è©¦ãã¦ã¿ãã®ãããã¨æãã¾ãã
1.2. ãã¼ãã¼ãé åãã«ã¹ã¿ãã¤ãºãã
ä¸ã®ã»ã¨ãã©ã®ããã°ã©ãã¯caps lock
ã¨control/command
ãå
¥ãæ¿ãã¦ä½¿ã£ã¦ãããã¨ã¨æãã¾ããï¼åè¦ï¼ãç§ãå¤åã«ãããcaps lock
, control
, command
ãä¸ã¤å·´ã§å
¥ãæ¿ãã¦ãã¾ãã
2019å¹´ç¾å¨ãMacã§ãã¼ãã¼ãé åãããããªãKarabiner-Elementsä¸æã ã¨æãã¾ãã å ¬å¼ãµã¤ãã¯ãã¡ãã
Karabiner-Elementsã§ã¯ãåç´ãªãã¼ã¹ã¯ãããè¨å®ã§ããSimple Modifications
ã¨ãè¤éãªæ¡ä»¶ãè¤æ°ãã¼å
¥åã«é¢ããå¤æã«ã¼ã«ãè¨å®ã§ããComplex Modifications
ã®2種é¡ã®è¨å®ãããã¾ãã
ç§ã¯ãComplex Modifications
ã使ã£ã¦ä»¥ä¸ã®ãããªè¨å®ãçµãã§ãã¾ãã
- ã¿ã¼ããã«ãVimãã¼ãã¤ã³ããå©ç¨ããã¢ããªï¼Terminal, iTerm2, VSCodeãªã©ï¼ã§ã¯
caps lock
ã¨control
ãå ¥ãæ¿ãã - ãã以å¤ã®ã¢ããªã§ã¯
caps lock
ãã¼ãcommand
ã«ã両æ¹ã®command
ãã¼ãcontrol
ã«ãcontrol
ãã¼ãcaps lock
ã«ãã - å³ã®
command
ãã¼ãåä½ã§æ¼ããã¦æ¾ããããæ¥æ¬èªå ¥åã«ãå·¦ã®command
ãã¼ãåä½ã§æ¼ããã¦æ¾ããããè±æ°å ¥åã«ï¼è±åé åãã¼ãã¼ãåãã®è¨å®ï¼
Macã§ã¯ä¸»ã«command
ãã¼ãWindowsã§ããã¨ããã®Control
ãã¼ã®å½¹å²ãæããã¦ããã®ã§ãA
ã®å·¦é£ã«ã¯command
ãé
ç½®ãã¦ãã¾ãã
ãã ããã¿ã¼ããã«ã®ã·ã§ã¼ãã«ãããVimã³ãã³ãã§ä½¿ãã®ã¯control
ã®æ¹ãªã®ã§ãã¿ã¼ããã«ãVimãã¼ãã¤ã³ããæå¹ã«ããã¢ããªãéãã¦ããã¨ãã¯caps lock
ã¨control
ã ãå
¥ãæ¿ãã¦ãA
ã®å·¦é£ãcontrol
ã«ãã¦ãã¾ãã
ãã®è¨å®ã ã¨ãã³ãã¼&ãã¼ã¹ããã¢ã¯ãã£ãã¦ã£ã³ãã¦ã®åãæ¿ãã®ã¨ãã«
- ã¿ã¼ããã«ã½ãã : ã¹ãã¼ã¹ã®é£ã®ãã¼ +
c
,v
,tab
- ãã®ä»ï¼ãã©ã¦ã¶ãFinderï¼:
A
ã®å·¦é£ã®ãã¼ +c
,v
,tab
ã¨ãã使ãåããçãã¾ãããæ
£ãã§ã«ãã¼ãã¦ãã¾ãã
ãããããã¿ã¼ããã«ä¸ã§ã¯Vimã®ã¤ã³ã¯æ©è½ãpbcopy
ã使ãã®ã§ã³ããããæ©ä¼ã¯ãããªã«å¤ããªãã§ãããã¢ã¯ãã£ãã¦ã£ã³ãã¦ã®åãæ¿ãã¯Mission Controlï¼F3
or 3æ¬æã§ä¸ã«ã¹ã¯ãããããã¤ï¼ããè¡ã£ã¦ããã®ã§ä¸ä¾¿ã¯æãã¦ãã¾ããã
ã¹ãã³ãµã¼ãªã³ã¯
2. shellé¢é£
次ã«ãshellã«é¢é£ããè¨å®ã§ãã
èªåã使ã£ã¦ããã®ã¯zsh
ã§ããã以ä¸ã§ç´¹ä»ããè¨å®ã«ã¤ãã¦ã¯bash
ã§ãã ãããåããã¨ãã§ãã¾ãã
2.1. shellã®ã·ã§ã¼ãã«ãããè¦ãã
shellã«ã¯ã«ã¼ã½ã«ç§»åãªã©ã«ä½¿ããã·ã§ã¼ãã«ãããããã¾ãã ãã®ã·ã§ã¼ãã«ããã¯ãEmacsããã¼ã¹ã«ãªã£ã¦ããã®ã§Vimæ´¾ã®äººéã¨ãã¦ã¯è¦ãã«ãã代ç©ãªã®ã§ãããä¸åº¦è¦ããã°ã¿ã¼ããã«å ¥åã®ã¹ãã¬ã¹ãããªã軽æ¸ããã¾ãã
èªåããã使ãã®ã¯ã以ä¸ã®ã·ã§ã¼ãã«ããã§ãã
Ctrl + a
: ã«ã¼ã½ã«ãå é ã«Ctrl + e
: ã«ã¼ã½ã«ãè¡æ«ã« [End]Ctrl + f
: ã«ã¼ã½ã«ã1ã¤å³ã« [Forward]Ctrl + b
: ã«ã¼ã½ã«ã1ã¤å·¦ã« [Back]Ctrl + c
: ã³ãã³ãå ¥åãä¸æï¼æã¡ãããã³ãã³ããç¡è¦ãã¦æ¹è¡ï¼Ctrl + h
: Backspaceã¨åãCtrl + d
: ã«ã¼ã½ã«ãå½ãã£ã¦ããæåãæ¶ã [Delete]- ä½ãå ¥åãã¦ããªãç¶æ ã§æ¼ãã¨shellãçµäºãã
Ctrl + p
: ã³ãã³ãå±¥æ´ãæ»ã [Previous]Ctrl + n
: ã³ãã³ãå±¥æ´ãé²ã [Next]Ctrl + r
: éå»ã«å®è¡ããã³ãã³ãããæ¤ç´¢ãã- ããã©ã«ãã®æ¤ç´¢æ©è½ã¯ä½¿ãã«ããã®ã§ãå¾è¿°ã®peco+historyã«ç½®ãæããã®ããããã
Ctrl + l
: ç¾å¨ã®è¡ãä¸çªä¸ã«æ¥ãããã«ã¹ã¯ãã¼ã«Ctrl + u
: æã¡ãããã³ãã³ããåãåãCtrl + w
: ã«ã¼ã½ã«ä½ç½®ããåã®åèªãåãåã [Word]Ctrl + k
: ã«ã¼ã½ã«ä½ç½®ããå¾ãåãåãCtrl + y
: åãåã£ãæååãè²¼ãä»ã [Yank]
ä¸å¿ããããã®ã·ã§ã¼ãã«ããã¯~/.zshrc
ã~/.bashrc
ã§å¤æ´ãããã¨ãã§ãã¾ãããä»ã®ç°å¢ã触ãã¨ãã«æ··ä¹±ããã®ãå«ãªã®ã§ãããã©ã«ãã®ã¾ã¾ä½¿ã£ã¦ãã¾ãã
2.2. ããã³ãããã«ã¹ã¿ãã¤ãºãã
ããã³ããã¨ã¯ãã·ã§ã«ã®å
¥ååã«è¡¨ç¤ºãããuser@user-ubuntu:Documents$
ã¨ãã®ãã¨ã§ãã
zshã§ã¯ãè¨å®ãã¡ã¤ã«~/.zshrc
ã®ä¸ã§PROMPT
ç°å¢å¤æ°ãä¸æ¸ããããã¨ã§å¤æ´ã§ãã¾ãã
PROMPT='%n@%m %d %?$ '
%n
ã¯ãã°ã¤ã³ä¸ã®ã¦ã¼ã¶ã¼åã%m
ã¯ãã¹ãåã%d
ã¯ã«ã¬ã³ããã£ã¬ã¯ããªã®ãã«ãã¹ã%?
ã¯ç´åã®ã³ãã³ãã®çµäºã³ã¼ããæå³ãã¾ããä¸ã®è¨å®ã§ã¯user@users-MacBook-Pro /Users/user 0$
ã¿ãããªããã³ããã表示ãããã¯ãã§ãã
å人çã«ã¯ã%?
ã§ç´åã®ã³ãã³ãã®çµäºã³ã¼ãã表示ãã¦ããã®ãããããã§ãã
é·ã
ã¨ã¡ãã»ã¼ã¸ã表示ãããã³ãã³ããå®è¡ããã¨ããçµå±æåããã®ã失æããã®ããã²ã¨ç®ã§å¤å¥ã§ããããã§ãã
ä»ã«ãããã¤ãã®ç¹æ®è¨å·ãããã®ã§ãæ°ã«ãªãæ¹ã¯å ¬å¼ããã¥ã¡ã³ããèªãã§ã¿ã¦ãã ããã
ã¡ãªã¿ã«bashã®ä¾ã¯ãã¡ãã§ãã
export PS1="\u@\h \w $ "
詳細ã¯bashã®å ¬å¼ããã¥ã¡ã³ãã確èªãã¦ãã ããã æ®å¿µãªããbashã§ã¯ç¹æ®è¨å·ã§çµäºã³ã¼ããåããã¨ãã§ãã¾ããã ã©ããã¦ãã¨ããå ´åã¯èªåã§å¦çãæ¸ãå¿ è¦ãããã®ã§ããã¡ãã®stackoverflowã®åçãåç §ãã¦ã¿ã¦ãã ããã
2.3. ãã¼ãé³ãæ¶ã
shellã«ã¯ãç¡å¹ãªãã¼æä½ãããã¨ããä½ããã®éç¥ãè¡ãããã«ãã¼ãé³ãé³´ããæ©è½ãããã¾ãããéªéãªã®ã§ç¡å¹ã«ãã¦ãã¾ãã
zshã®å ´åã¯~/.zshrc
ã«ä»¥ä¸ã®ã³ãã³ãã追å ããã°ããã§ãã
setopt no_beep
bashã®å ´åã¯~/.inputrc
ã«ä»¥ä¸ã®ã³ãã³ãã追å ããã°ããã§ãã
set bell-style none
2.4. peco+historyãæ§ç¯ãã
å
ã»ã©Ctrl + r
ã¯ã³ãã³ãå±¥æ´ã®æ¤ç´¢ã®ã·ã§ã¼ãã«ããã ã¨æ¸ãã¾ããããããã©ã«ãã®æ¤ç´¢æ©è½ã¯å²ã¨ä½¿ãã¥ããã§ãã
ããã§ãpeco
ã¨ãããã¼ã«ãå©ç¨ãã¦ç¬èªã«æ¤ç´¢æ©è½ãä½ãã¾ãã
pecoã¯ã³ãã³ãã©ã¤ã³ã§æ¤ç´¢ã»é¸æãã§ããããã«ãããã¼ã«ã§ãããããã¨å±¥æ´ã表示ããhistory
ã³ãã³ããçµã¿åããããã¨ã§è¦æ ãã®è¯ãå±¥æ´æ¤ç´¢æ©è½ãä½ãã¾ãã
brew
ã使ã£ã¦ãããªãpecoã¯ä»¥ä¸ã®ã³ãã³ãã§ã¤ã³ã¹ãã¼ã«ã§ãã¾ãã
ã¾ããå
¬å¼ãªãã¸ããªãããã«ãæ¸ã¿ãã¤ããªãã¤ã³ã¹ãã¼ã«ããæ¹æ³ãããã¾ãã
brew install peco
pecoãã¤ã³ã¹ãã¼ã«ããä¸ã§~/.zshrc
ã«ä»¥ä¸ã®ã³ãã³ãã追å ããã¨ãCtrl + r
ã§å±¥æ´æ¤ç´¢æ©è½ãèµ·åããããã«ãªãã¾ãã
function peco-history-selection() { BUFFER=`history -n 1 | tail -r | awk '!a[$0]++' | peco` CURSOR=$#BUFFER zle reset-prompt } zle -N peco-history-selection bindkey '^R' peco-history-selection
ã³ãã³ãã®ä¸é¨ãæã£ã¦æ¤ç´¢ãCtrl + n
, Ctrl + p
ã§åè£ã®ä¸ããé¸æãEnter
ã§æ±ºå®ãCtrl + c
ã§ä¸æã§ãã¾ãã
bash
ã®å ´åã¯ä»¥ä¸ã®ã³ãã³ãã~/.bashrc
ã«è¿½å ãã¾ãããã
ãã¡ãã¯æ¾ãç©ãªã®ã§ããã¶ãä¸ã®ã³ãã³ãã¨è¥å¹²æåãéãã®ã§ãããç§ã¯æ°ã«ãã使ã£ã¦ãã¾ã()ã
peco-select-history() { declare l=$(HISTTIMEFORMAT= history | sort -k1,1nr | perl -ne 'BEGIN { my @lines = (); } s/^\s*\d+\s*//; $in=$_; if (!(grep {$in eq $_} @lines)) { push(@lines, $in); print $in; }' | peco --query "$READLINE_LINE") READLINE_LINE="$l" READLINE_POINT=${#l} } bind -x '"\C-r": peco-select-history'
ã¾ããpecoã¯Mac以å¤ã®OSã§ãåãã®ã§ããªã¢ã¼ãã®Linuxãµã¼ãã¼ã§ãåãè¦é ã§å±¥æ´æ¤ç´¢æ©è½ãçµããã¨ãã§ãã¾ãã
ã¹ãã³ãµã¼ãªã³ã¯
3. iTerm2é¢é£
Macã«ã¯ããã©ã«ãã§Terminal
ã¨ããã¿ã¼ããã«ã½ãããå
¥ã£ã¦ãã¾ããããã以ä¸ã«iTerm2
ã¨ãããªã¼ãã³ã½ã¼ã¹ã®ã¿ã¼ããã«ã½ãããããªãåªç§ãªã®ã§ãããå°å
¥ãã¦ãã¾ãã
iTerm2ã¯ãã¡ãã®å
¬å¼ãµã¤ãããã¤ã³ã¹ãã¼ã«ã§ãã¾ãã
3.1. iTerm2ã®ã·ã§ã¼ãã«ãããè¨å®ãã
iTerm2ã®ã·ã§ã¼ãã«ããã¯Preferences > Keysããã«ã¹ã¿ãã¤ãºã§ãã¾ãã ç§ã¯ãã»ã¼ããã©ã«ãã®ã¾ã¾ãWindow/Tab/Paneé¢ä¿ã®ã·ã§ã¼ãã«ããã ãã以ä¸ã®ããã«å¤æ´ãã¦ãã¾ãã
ãã使ãã·ã§ã¼ãã«ããã¯ä»¥ä¸ã®ã¨ããã§ãã
command + n
: æ°ããwindowãä½ãcommand + t
: æ°ããtabãä½ãcommand + w
: ä»ã®tabãéããcommand + Enter
: ãã«ã¹ã¯ãªã¼ã³ãåãæ¿ããcommand + q
: iTerm2ãçµäºããcommand + (Number)
: tabãåãæ¿ããï¼ãããã«çªå·ã表示ããã¦ããã¯ãï¼option + command + (Number)
: windowãåãæ¿ããï¼ãããã«çªå·ã表示ããã¦ããã¯ãï¼
ç´°ããç»é¢åå²ã¯NeoVimå´ã®å½¹ç®ã¨å²ãåã£ã¦ããã®ã§ãiTerm2ã®Paneæ©è½ã¯ä½¿ã£ã¦ãã¾ããã
ã¾ããoption
ã®double-tapã§Hotkey Windowãåºã¦ããããã«è¨å®ãã¦ãã¾ãã
Preferences > Keys > HotkeyããCreate a Dedicated Hotkey Window
ã§Hotkey Windowã®ãããã¡ã¤ã«ãä½æãã¾ãã
以éã®è¨å®å¤æ´ã¯Preferences > Profiles > Hotkey Windowããè¡ãã¾ãã
ãã®è¨å®ããã¦ããã°ãoption
ã®ããã«ã¿ããã§ãã¤ã§ãHotkey Windowãä¸ããéãã¦ããããã«ãªãã¾ãã
Hotkey Windowã¯ã¡ãã£ã¨ãããã¡ã¤ã«æä½ãping
ãæã¤ã¨ããªã©ã«ä½¿ã£ã¦ãã¾ãã
3.2. ãã¼ãé³ãæ¶ã
zshã§æ¶é³è¨å®ããã¦ãã¦ããsshã§ãªã¢ã¼ãã®bashãèµ·åããã¨ããªã©ã¯ãã¼ãé³ãé³´ã£ã¦ãã¾ãã®ã§ããããæ¶ãããã«iTerm2å´ã§ãæ¶é³è¨å®ããã¦ãã¾ãã
Preferences > Profiles > Terminalã®Silence bell
ã«ãã§ãã¯ãå
¥ããã°OKã§ãã
é³ã®ä»£ããã«è¦è¦çã«ç¥ããã¦ãããæ©è½ã¨ãã¦Flash visual bell
ã¨Show bell icon in tabs
ãããã¾ãããç§ã¯ã©ã¡ããå¿
è¦ãªãã®ã§OFFã«ãã¦ãã¾ãã
3.3. Status Barã®è¨å®
Status Barã¯iTerm2 ver.3.3ãã追å ãããæ©è½ã§ãã tmuxã«ã¯å種æ å ±ã表示ã§ããStatus Barãããã®ã§ãããããã¨åãæ©è½ãiTerm2ã«ç§»æ¤ããããã®ã§ãã
Status Barã®è¨å®ã¯Preferences > Profiles > Default > Session > Configure Status Barããå¤æ´ã§ãã¾ãã
ç§ã®å ´åã¯ãã¹ãå, ã«ã¬ã³ããã£ã¬ã¯ããªã®ãã«ãã¹, Gitãã©ã³ã, CPU使ç¨ç, ã¡ã¢ãªä½¿ç¨çã®5ã¤ã表示ããã¦ãã¾ãã
ããã«æè¿ã®ã¢ãããã¼ãã§ãåã³ã³ãã¼ãã³ããã¯ãªãã¯ããã¨GUIããè²ã
æä½ã§ããããã«ãªã£ãããã§ããã
ãã¨ãã°ã«ã¬ã³ããã£ã¬ã¯ããªã®ã³ã³ãã¼ãã³ããã¯ãªãã¯ããã¨ãæè¿è¨ªãããã£ã¬ã¯ããªã¸ã®cd
ã³ãã³ããçºè¡ã§ãã¾ãã
ã¾ãGitã®ã³ã³ãã¼ãã³ããã¯ãªãã¯ããã¨ãCommitãLogãªã©ã®æä½ãã§ããããã«ãªã£ã¦ãã¾ãã
3.4. Shell Integrationã使ãããªã
iTerm2 Shell Integrationã¯ãiTerm2ä¸ã®shellã«æ¡å¼µæ©è½ã追å ããããã®ããã±ã¼ã¸ã§ãã æå ã®Macã®ä»ã«ããsshãã°ã¤ã³å ã®ãµã¼ãã¼ã§ãå©ç¨ã§ãã¾ãã
ã¤ã³ã¹ãã¼ã«ã¯ç°¡åã§ãiTerm2ã§ã¤ã³ã¹ãã¼ã«å
ã®shellãéããç¶æ
ã§ç»é¢å·¦ä¸ã®iTerm2 > Install Shell Integration
ãã¯ãªãã¯ããã¨ã¤ã³ã¹ãã¼ã«ã³ãã³ããå®è¡ãã¦ããã¾ãã
ãã®ã¨ãã«Utilitiesãã¤ã³ã¹ãã¼ã«ãããã©ããèãããã®ã§ãä¸ç·ã«ã¤ã³ã¹ãã¼ã«ãã¦ããã¾ãã
åºæ¬æ©è½
Shell Integrationã®æ©è½ã®è©³ç´°ã¯å ¬å¼ããã¥ã¡ã³ãã§ç´¹ä»ããã¦ãã¾ãã
ç§ããã使ã£ã¦ããã®ã¯ä»¥ä¸ã®æ©è½ã§ãã
- éå»ã®ã³ãã³ãå
¥åã®è¡ã辿ã£ã¦ã¹ã¯ãã¼ã«ãã
command + shift + Up/Down
- ã³ãã³ãçµäºæã«ãã¹ã¯ãããéç¥ãåºã
option + command + a
- éå»ã«å®è¡ããã³ãã³ãã®çµäºã³ã¼ããå®è¡æéã確èªãã
- ããã³ããã®å·¦ã«åºãç¢å°ãå³ã¯ãªãã¯
- åçã«ãããã¡ã¤ã«ï¼iTerm2ã®è¨å®ï¼ãåãæ¿ãã
- ãªã¢ã¼ãã®ãã¹ãå, ã¦ã¼ã¶ã¼å, ã«ã¬ã³ããã£ã¬ã¯ããªã®æ å ±ãiTerm2ã®Status Barãªã©ã«åæ ããã
ä»ã«ãã³ãã³ãå±¥æ´ã表示ããããã£ã¬ã¯ããªå±¥æ´ã表示ãããã§ããã®ã§ãããå ã»ã©ç´¹ä»ããpeco+historyã®æ¹ã便å©ãªã®ã§ãã¾ã使ã£ã¦ãã¾ããã
Utilities
ä¸æ¹ãShell Integration Utilitiesã§ã¯~/.iterm2
以ä¸ã«ããã¤ãã®ä¾¿å©ãªã³ãã³ãã追å ããã¾ãã
åã³ãã³ãã®æ©è½ã®è©³ç´°ã¯ãã¡ãã®å
¬å¼ããã¥ã¡ã³ããåç
§ãã¦ãã ããã
èªåããã使ãã®ã¯ä»¥ä¸ã®ã³ãã³ãã§ãã
imgcat <filename>
: ã¿ã¼ããã«ä¸ã«ç»åã表示ããimgls <filenames>
: æå®ããããã¡ã¤ã«ã®ä¸è¦§ããµã ãã¤ã«ä»ãã§è¡¨ç¤ºããit2copy
: ãã¤ãã§æ¸¡ãããæ å ±ãMacã®ã¯ãªãããã¼ãã«ã³ãã¼ãã- ã¤ã¾ããªã¢ã¼ãã§ã使ãã
pbcopy
- Preferences > General > Selection >
Applications in terminal may access clipboard
ã«ãã§ãã¯ãå ¥ãã¦ããå¿ è¦ããã
- ã¤ã¾ããªã¢ã¼ãã§ã使ãã
it2dl <filenames>
: ï¼ãªã¢ã¼ãã§å®è¡ï¼æå®ããããã¡ã¤ã«ãMacã«ãã¦ã³ãã¼ãããit2ul
: ï¼ãªã¢ã¼ãã§å®è¡ï¼Finderãéããããã§æå®ããããã¡ã¤ã«ãã¢ãããã¼ããã
ã¹ãã³ãµã¼ãªã³ã¯
4. NeoVimé¢é£
NeoVimã¯å¾æ¥ã®Vimã®æ¡å¼µæ§ã使ãããããåä¸ãããããã«æ°ãã«éçºããã¦ããã¨ãã£ã¿ã§ãã å ¬å¼ãã¼ã¸ã¯ãã¡ãã
Vimãç¾å½¹ã§ä½¿ã£ã¦ãã人ãããã¨ã¯æãã®ã§ãããç§ã¯NeoVimã§ããåããªããã©ã°ã¤ã³ããå¾è¿°ã®Terminal emulatorã¨neovim-remoteã使ãç®çã§NeoVimãé¸ã³ã¾ããã
4.1. åºæ¬è¨å®ã決ãã
Vimã®è¨å®ãã¡ã¤ã«ã¯~/.vimrc
ã§ãããNeoVimã®è¨å®ãã¡ã¤ã«ã¯~/.config/nvim/init.vim
ã§ãã
è¨å®ãã¡ã¤ã«ã®ææ³ã¯ã»ã¨ãã©ä¸ç·ã§ãããç´°ããè¨å®é
ç®ãå¤ãã£ã¦ããã®ã§èª¿ã¹ãªããæ¸ãã¦ããå¿
è¦ãããã¾ãã
ç§ã使ã£ã¦ããåºæ¬çãªè¨å®ã¯ä»¥ä¸ã®ã¨ããã§ãã
" è¡çªå·ã表示ãã set number " ã¿ãã¯ã¹ãã¼ã¹4ã¤åã®å¹ ã§è¡¨ç¤º set tabstop=4 " 空ç½é¨åã§tabãã¼ãbackspaceãæ¼ããã¨ãã«ã«ã¼ã½ã«ç§»åããå¹ set softtabstop=4 " èªåã¤ã³ãã³ãã®å¹ set shiftwidth=4 " ã¿ããå ¥åããã¨ãã¹ãã¼ã¹ÃNã«ç½®ãæãã set expandtab " æ¹è¡æã«åã®è¡ã®ã¤ã³ãã³ããç¶æ¿ãã set autoindent " Cç³»ã®ææ³ã«å¾ã£ã¦èªåã¤ã³ãã³ãã{}ã¨ãã«åå¿ãã set smartindent " tabã¨è¡æ«ã®ä½è¨ãªç©ºç½ãå¯è¦åãã set list set listchars=tab:»-,trail:- " ãã¼ãé³ãé³´ãããªããå¯è¦åãããªã set visualbell set t_vb=
4.2. ãã¼ãã¤ã³ããã«ã¹ã¿ãã¤ãºãã
次ã«ãVimãã¼ãã¤ã³ãã®ã«ã¹ã¿ãã¤ãºã§ãã ç§ã¯ããã©ã«ãããããé¢ããè¨å®ãããã®ãå«ãªã®ã§ããã使ããã®ã ãæ¢åã®ã³ãã³ããéªéããªãããã«ç½®ãæãã¦ãã¾ãã
ã¾ããVimã§ã¯ãã¼ãã«ã¢ã¼ãã§:
ãæã¤ã¨ã³ãã³ãã¢ã¼ãã«ãªãããã§ãããè±åé
åãã¼ãã¼ãã§ã¯:
ãå
¥åããããã«shift
ãæ¼ãå¿
è¦ãããã¾ãã
:w
ã¨ã:q
ã¨ãæã¤åº¦ã«shift
ãã¼ãæ¼ãã®ã¯é¢åã§ãã
ããã§;
ã§ã³ãã³ãã¢ã¼ãã«å
¥ãããã«ãã¦ãã¾ãã
" [ãã¼ãã«ã¢ã¼ã] ;ã§ã³ãã³ãå ¥å noremap ; :
ãã¼ãã«ã¢ã¼ãã§f <letter>
ãshift+f <letter>
ãå
¥åããã¨ããã®è¡å
ã§æåãæ¤ç´¢ãã¦ã«ã¼ã½ã«ã移åããããã¨ãã§ããè¤æ°ãããããã¨ãã¯ç¶ãã¦,
ã:
ãå
¥åããã°å·¦å³ã«ç§»åã§ãã¾ãã
ãã®å·¦å³ç§»åã¯,
ã¨.
ã«ããã»ããç´è¦³çã«ããããããã¨æãã.
ã;
ã«ç½®æãã¦ãã¾ãã
" [ãã¼ãã«ã¢ã¼ã] .ã§fãFã§æ¤ç´¢ãç¹°ãè¿ã noremap . ;
ããã¦ãä¸è¨ã®å¤æ´ã§ãã¶ãã.
ï¼ç´åã®åä½ãç¹°ãè¿ãï¼ã®æ©è½ã;
ã«å²ãå½ã¦ã¦ãã¾ãã
" [ãã¼ãã«ã¢ã¼ã] :ã§åã®æä½ãç¹°ãè¿ã noremap : .
次ã«ãNeoVimå
é¨ã®ã¿ããå·¦å³ã«ç§»åããããã®ã³ãã³ãã¯gT
, gt
ãªã®ã§ããããã®æä½ã¯ãã使ãã®ã§Ctrl + h
, Ctrl + l
ã§ã移åã§ããããã«ãã¦ãã¾ãã
" [ãã¼ãã«ã¢ã¼ã] Ctrl + hã§å·¦ã®ã¿ãã«ç§»å nnoremap <C-h> gT " [ãã¼ãã«ã¢ã¼ã] Ctrl + lã§å³ã®ã¿ãã«ç§»å nnoremap <C-l> gt
ã¾ããè¡é , è¡æ«ã«ç§»åããããã®ã³ãã³ãã¯^
, $
ã§ããããããshift
ãã¼ãå¿
è¦ãªä¸ãä¸çªä¸ã®æ®µã®ãã¼ãæ¼ãå¿
è¦ãããã®ã§ä½¿ãã¥ããã§ãã
ããã§space, h
, space, l
ã§ã移åã§ããããã«ãã¦ãã¾ãã
" [ãã¼ãã«ã¢ã¼ã] space, hã§è¡é ã«ã«ã¼ã½ã«ç§»å noremap <Space>h ^ " [ãã¼ãã«ã¢ã¼ã] space, lã§è¡æ«ã«ã«ã¼ã½ã«ç§»å noremap <Space>l $
NeoVimã«ã¯ã¿ãã®ä¸ã§shellãèµ·åããTerminal emulatorãæè¼ããã¦ããã®ã§ãããæ°ããã¿ããéãã«ã¯:tabnew
ããããã§ã¿ã¼ããã«ãèµ·åããã«ã¯:te
ãå
¥åããå¿
è¦ãããã¾ãã
ãããä¸çºã§å®è¡ããããã«space, t
ãæ°ããã¿ã¼ããã«ã¿ããéãããã®ã·ã§ã¼ãã«ããã¨ãã¦ç»é²ãã¦ãã¾ãã
" [ãã¼ãã«ã¢ã¼ã] space, tã§æ°ããã¿ã¼ããã«ã¿ããéã noremap <Space>t :tabnew<CR>:te<CR>
æå¾ã«ãã¿ã¼ããã«ãããã¼ãã«ã¢ã¼ãã«æ»ãã¨ãã®ã³ãã³ãã¯ããã©ã«ãã§ã¯ãªããCtrl + \, Ctrl + n
ãããã¯escape
ã«ãªã£ã¦ããã®ã§ãããæ®æ®µãã¼ãã«ã¢ã¼ãã«æ»ãã¨ãã«Ctrl + [
ã使ã£ã¦ããã®ã§ãããã«åãããããã®è¨å®ããã¦ãã¾ãã
" [ã¿ã¼ããã«ã¢ã¼ã] Ctrl + [ã§ãã¼ãã«ã¢ã¼ãã«æ»ã tnoremap <C-[> <C-\><C-n>
以ä¸ã®ãã¼è¨å®ã§ä»ã®ã¨ããã¯å¹³åã«æ®ããã¦ãã¾ãã
4.3. Vimãã¼ãã¤ã³ããè¦ãã
èªåãªãã®ãã¼ãã¤ã³ãã決ãããããã¨ã¯ã²ããã使ãè¾¼ãã§è¦ãã¦ããã ãã ã¨æãã¾ããå£ç´ããã¼ã表ã«ãã¦ã¿ããããã¾ãããçµå±è¦ããã¨ã¯ãªãã£ãã®ã§ãæ¯æ¥Vimã使ã£ã¦å°ããã¤æ°ããã³ãã³ãã«ãã£ã¬ã³ã¸ããã®ãããã¨æãã¾ãã
èªåã®å ´åã¯ãªãã¨ãªã以ä¸ã®é çªã§è¦ãã¦ãã£ããããªæ°ããã¾ãã
i
,I
,a
,A
,o
,O
,s
,S
ï¼ã¤ã³ãµã¼ãã¢ã¼ãã«ï¼escape
,Ctrl + [
ï¼ãã¼ãã«ã¢ã¼ãã«ï¼k
,j
,h
,l
ï¼ä¸ä¸å·¦å³ï¼ ,gg
,G
ï¼å é ã»æ«å°¾ï¼ ,<number>G
ï¼Nè¡ç®ã¸ç§»åï¼0
,^
,$
ï¼è¡é ã»ã¤ã³ãã³ãã®è¡é ã»è¡æ«ï¼Ctrl + u
,Ctrl + d
ï¼åãã¼ã¸ã¹ã¯ãã¼ã«ï¼,Ctrl + e
,Ctrl + y
ï¼1è¡ã¹ã¯ãã¼ã«ï¼x
,dd
,yy
,p
,P
ï¼1æåã«ããã»ã«ããã»ã³ãã¼ã»ãã¼ã¹ãï¼<number>j
,d<number>j
ãªã©ï¼è¤æ°è¡ç§»åã»è¤æ°è¡ã«ããï¼u
,Ctrl + R
ï¼Undo, Redoï¼>>
,<<
ï¼ã¤ã³ãã³ãæä½ï¼v
ï¼ç¯å²é¸æï¼ããã®d
,y
,s
ï¼ã«ããã»ã³ãã¼ã»åé¤ãã¦ã¤ã³ãµã¼ãã¢ã¼ãã«ï¼Ctrl + v
ï¼ç©å½¢é¸æï¼ããã®d
,y
,I
,A
,s
ï¼è¤æ°è¡ã«åãç·¨éãæ½ããï¼b
,B
,w
,W
,e
,E
ï¼åèªåºåãã§ã«ã¼ã½ã«ç§»åï¼/<string>
ï¼æååæ¤ç´¢ï¼ããã®n
,N
ï¼æ¤ç´¢çµæã移åï¼f<letter>
,F<letter>
ï¼è¡å ã§ãã®æåãè¦ã¤ãã£ãå ´æã¸ç§»åï¼ããã®,
,;
ï¼ããã«ç§»åï¼:%s/<before>/<after>/gl
ï¼æååç½®æï¼H
,M
,L
ï¼ç»é¢å ã®ä¸æ®µã»ä¸æ®µã»ä¸æ®µã¸ç§»åï¼,zt
,zz
,zb
ï¼ç¾å¨è¡ãä¸æ®µã»ä¸æ®µã»ä¸æ®µã«æ¥ãããã«ã¹ã¯ãã¼ã«ï¼q<letter>
,@<letter>
ï¼ãã¯ãï¼
4.4. ãã©ã°ã¤ã³ãå ¥ãã
Vimã®ééå³ã¨è¨ãã°ãã©ã°ã¤ã³ã§ãããã ããã©ã«ãã®ã¾ã¾ã§ã¯è²ã ã¨ä¸ä¾¿ãªã®ã§ãã©ã°ã¤ã³ã追å ãã¦ããã¾ãã Vimãã©ã°ã¤ã³é¢ä¿ã®è¨äºã¯ããããããã®ã§ããã®è¨äºã§ã¯ãã£ãããã説æã ããã¦ããã¾ãã
Vimãã©ã°ã¤ã³ãã¤ã³ã¹ãã¼ã«ããããã®è£å©ãã¼ã«ã«ã¯ããã¤ã種é¡ãããã¾ãããç§ã¯dein.vim
ãå©ç¨ãã¦ãã¾ãã
å°å
¥ãã¦ãããã©ã°ã¤ã³ã¯ä»¥ä¸ã®ã¨ããã§ãã
- tomasr/molokai
- ã«ã©ã¼ã¹ãã¼ã
molokai
ã追å ãããã©ã°ã¤ã³
- ã«ã©ã¼ã¹ãã¼ã
- vim-airline/vim-airline
- ä¸ã«Status Barãåºããã©ã°ã¤ã³
- myusuf3/numbers.vim
- ãã¼ãã«ã¢ã¼ãã§ç¸å¯¾è¡çªå·ãã¤ã³ãµã¼ãã¢ã¼ãã§ã¯ãã®ã¾ã¾ã®è¡çªå·ã表示ãããã©ã°ã¤ã³
- ç¸å¯¾è¡çªå·ã®æ¹ã
d<number>j
ã¨ãã使ããããã®ã§
- scrooloose/nerdtree
- Vimå ã§ä½¿ããã¨ã¯ã¹ããã¼ã©ã¼
- jistr/vim-nerdtree-tabs
- NERDTreeãã¿ãéã§ï¼æ¬ä¼¼çã«ï¼åä¸ã®ãã®ã«ããããã®ãã©ã°ã¤ã³
- Shougo/deoplete.nvim
- ã³ã¼ãã®èªåè£å®ã®ããã®ãã¬ã¼ã ã¯ã¼ã¯
- autozimu/LanguageClient-neovim
- Language Server Protocolã«åã£ãè¨èªéçºãµãã¼ããå ¥ããããã®ãã¬ã¼ã ã¯ã¼ã¯
- 使ç¨ããè¨èªã«å¿ããLanguage Serverã®å®è¡ãã¡ã¤ã«ï¼C++ã¯
clangd
ãPythonã¯pyls
ãRustã¯rls
ï¼ãæå®ããã°åæã«é£åãã¦ããã
- rhysd/vim-clang-format
clang_format
ãVimãã使ãããã®ãã©ã°ã¤ã³
- tell-k/vim-autopep8
autopep8
ãVimãã使ãããã®ãã©ã°ã¤ã³
ã¾ã 調æ´ä¸è¶³æã¯ããã¾ãããã¨ãããããã®æ§æã§éç¨ãã¦ãã¾ãã
è¨èªéçºé¢ä¿ã¯Language Server Protocolãå©ç¨ããã®ãéæ¿ã ã¨æãã¾ãã Language Serverã®å®è¡ãã¡ã¤ã«ãã¤ã³ã¹ãã¼ã«ãã¦LanguageClient-neovimã«æ å ±ãç»é²ãã¦ããã°ãã¨ã©ã¼è¡¨ç¤ºã»ã³ã¼ãè£å®ãªã©ããã£ã¦ããã¾ãã ãã ãã³ã¼ãã®ãªãã©ã¼ãããã¯ãã£ã¦ãããªããã®ãå¤ãã®ã§ãè¨èªå¥ã«ãªã¼ããã©ã¼ãããç¨ã®ãã©ã°ã¤ã³ãå ¥ãã¦ãã¾ãã
以ä¸ã®ãã©ã°ã¤ã³ã®ãã¡vimèµ·åæã«å¿
ããã¼ããããã®ã®æ
å ±ã~/.config/dein/plugins.toml
ã«æ¸ãã¦ãããæå®ããæ¡ä»¶ï¼on_ft
ãon_if
ãªã©ï¼ãæºãããã¨ãã«é
延ãã¼ããããããã©ã°ã¤ã³ã®æ
å ±ã¯~/.config/dein/plugins_lazy.toml
ã«æ¸ãã¦ããã¾ãã
ãã©ã°ã¤ã³ãã¡ã¤ã«ã®ææ³ã®è©³ç´°ã¯:help dein
ãèªãããä»ã®è¨äºãåç
§ãã¦ãã ããã
ä¸å¿ãç§ã使ã£ã¦ãããã©ã°ã¤ã³ãã¡ã¤ã«ã¯GitHubã«ã¢ãããã¼ããã¦ããã¾ãï¼https://github.com/kamino410/dotfiles/tree/master/.config/deinï¼ã
ãã¨ã¯init.vim
ã«ä»¥ä¸ã®ãããªã¹ã¯ãªãããæ¸ãã¦ããNeoVimãèµ·åããã°ãdein.vimèªä½ã®ã¤ã³ã¹ãã¼ã«ã®å¾ã«ä»ã®ãã©ã°ã¤ã³ãã¤ã³ã¹ãã¼ã«ãã¦ããã¾ãã
以ä¸ã®ã¹ã¯ãªããã§ã¯ãã¤ã³ã¹ãã¼ã«å
ã¯~/.cache/dein/
ã«ãªã£ã¦ãã¾ãã
let g:cache_home = empty($XDG_CACHE_HOME) ? expand('$HOME/.cache') : $XDG_CACHE_HOME let g:config_home = empty($XDG_CONFIG_HOME) ? expand('$HOME/.config') : $XDG_CONFIG_HOME let s:dein_cache_dir = g:cache_home . '/dein' if &runtimepath !~# '/dein.vim' let s:dein_repo_dir = s:dein_cache_dir . '/repos/github.com/Shougo/dein.vim' if !isdirectory(s:dein_repo_dir) call system('git clone https://github.com/Shougo/dein.vim ' . shellescape(s:dein_repo_dir)) endif execute 'set runtimepath^=' . s:dein_repo_dir endif let g:dein#install_max_processes = 16 let g:dein#install_progress_type = 'title' let g:dein#enable_notification = 1 if dein#load_state(s:dein_cache_dir) call dein#begin(s:dein_cache_dir) let s:toml_dir = g:config_home . '/dein' call dein#load_toml(s:toml_dir . '/plugins.toml' , {'lazy': 0}) call dein#load_toml(s:toml_dir . '/plugins_lazy.toml' , {'lazy': 1}) call dein#end() call dein#save_state() endif if dein#check_install() call dein#install() endif
4.5. neovim-remoteãå ¥ãã
NeoVimå
ã§ã¿ã¼ããã«ãéãã¦ãã¡ã¤ã«æä½ããã¦ããã¨ããããããã¡ã¤ã«ãéããããªããã¨ãããã¾ãããnvim <filename>
ã¨æã£ã¦ãã¾ãã¨NeoVimå
ã§å¥ã®NeoVimãèµ·åãã¦ãã¾ãã¾ãã
ããã§neovim-remoteã¨ãããã¼ã«ã使ãã¾ãï¼å
¬å¼ãªãã¸ããªï¼ã
neovim-remoteãã¤ã³ã¹ãã¼ã«ããã¨nvr
ã¨ããã³ãã³ãã使ããããã«ãªãã¾ãã
ãããæã¤ã¨NeoVimãèªåã§ç«ã¦ã¦ãããµã¼ãã¼ã«ãªã¯ã¨ã¹ããæãããããããåããNeoVimãæå®ããããã¡ã¤ã«ãéãã¦ããã¾ãã
ç§ã¯æ°ããã¿ãã§éãããã«nvr --remote-tab
ã¨æã¤ãã¨ãå¤ãã®ã§ã~/.zshrc
ã«ã¨ã¤ãªã¢ã¹nvrr
ãç»é²ãã¦ãã¾ãã
alias nvrr='nvr --remote-tab'
ã¾ãNeoVimå
ã®ã¿ã¼ããã«ããgit commit
ããã¨ãã«ã³ãããã¡ãã»ã¼ã¸ãå
¥åããã¦ã£ã³ãã¦ãpaneã¨ãã¦éãããããã~/.config/nvim/init.vim
ã«ä»¥ä¸ã®è¨å®ã追å ãã¦ãã¾ãã
let $GIT_EDITOR = 'nvr -cc split --remote-wait' autocmd FileType gitcommit set bufhidden=delete
4.6. ã¤ã³ã¹ãã¼ã«ç¨ã¹ã¯ãªãããä½ã
æ°ãããµã¼ãã¼ãçµãã ã¨ããDockerã§ã³ã³ãããä½æããã¨ãã«æ¯åShellãNeoVimã®ç°å¢ãæ§ç¯ããã®ã¯é¢åã§ãã ããã§ãããç¨åº¦èªåã®ç´å¾ã§ããè¨å®ã決ã¾ã£ããç°å¢æ§ç¯ç¨ã®ã¹ã¯ãªãããæ¸ãã¦ãã¾ããã¨ããããããã¾ãã
ç§ã¯Ubuntu18.04ç¨ã«ä»¥ä¸ã®ãããªã¹ã¯ãªããã使ã£ã¦ãã¾ãã
cat <<EOF2 >> install.sh apt update apt install -y software-properties-common add-apt-repository -y ppa:neovim-ppa/unstable apt update apt install -y python3 neovim python3-pip git clang clang-tools curl clang-format peco python3 -m pip install pynvim neovim neovim-remote autopep8 mkdir -p ~/.config mkdir -p ~/.config/dein mkdir -p ~/.config/nvim mkdir -p ~/.config/nvim/ftplugin mkdir -p ~/github cd ~/github git clone https://github.com/kamino410/dotfiles.git cd ./dotfiles git pull cp ./.config/nvim/init.vim ~/.config/nvim cp ./.config/nvim/ftplugin/cpp.vim ~/.config/nvim/ftplugin cp ./.config/dein/plugins.toml ~/.config/dein cd ~ cat <<EOF >> ~/.bashrc export LC_ALL=en_US.UTF-8 alias nvrr='nvr --remote-tab' peco-select-history() { declare l= READLINE_LINE="" READLINE_POINT=0 } bind -x '"\C-r": peco-select-history' EOF EOF2 sh install.sh
ã¹ãã³ãµã¼ãªã³ã¯
5. ãã®ä»
5.1. Gitã®è¨å®
git status
ã¯ãã使ãã®ã§git st
ã§ã¨ã¤ãªã¢ã¹ãç»é²ãã¦ãã¾ãã
ã¾ãã³ããããã°ããããã¯ã¼ã¯å³ã§ç¢ºèªããããã®ã³ãã³ããgit glog
ã¨ãã¦ç»é²ãã¦ãã¾ãã
æ®éã®ã¿ã¼ããã«ããã³ãããããã¨ãã®ããã«ãgitã®ã¨ãã£ã¿ãNeoVimã«å¤æ´ãã¦ããã¾ãã
git config --global alias.st status git config --global alias.glog "log --all --graph --date=short --decorate=short --pretty=format:'%Cgreen%h %Creset%cd %Cblue%cn %Creset%s'" git config --global core.editor nvim
5.2. Dockerã³ã³ããå ã§Ctrl+pã使ããããã«ãã
Dockerã§ã¯ã³ã³ãããé¢è±ããããã®ã·ã§ã¼ãã«ããã¨ãã¦Ctrl + p, Ctrl + q
ãè¨ãããã¦ããã®ã§ããããããshellã®ã·ã§ã¼ãã«ããCtrl + p
ã¨ä¸é¨éè¤ãã¦ããããã§ãDockerã³ã³ããå
ã®shellã§Ctrl + p
ããã¾ãåä½ããªãã¨ããäºæ
ãèµ·ããã¾ãã
ãããåé¿ããããã·ã§ã¼ãã«ãããCtrl + \
ã«å¤æ´ããè¨å®ã~/.docker/config.json
ã«è¿½å ãã¦ãã¾ãã
ã¡ãªã¿ã«è¨å®ã®åæ ã«ã¯dockerãã¼ã¢ã³ã®åèµ·åãå¿
è¦ã§ãã
{ "auths" : { "https://index.docker.io/v1/" : { } }, "detachKeys" : "ctrl-\\" }
5.3. CMakeã¨clangdãé£åããã
NeoVimä¸ã§C/C++ãæ¸ãã¨ãã¯LanguageClient-neovimã§clangd
ããæ
å ±ãåãåãããã§ãããclangdã¯ããã©ã«ãã§ã¯æ¨æºã©ã¤ãã©ãªã®æ
å ±ããèªã¿åããªãã®ã§ã©ã¤ãã©ãªã®ã³ã¼ãã®è£å®ãªã©ã¯ã§ãã¾ããã
ããã§ãCMakeãfind_packageã§èªã¿è¾¼ãã ã©ã¤ãã©ãªã®æ å ±ãclangdã«èªã¿è¾¼ã¾ãã¾ãã LanguageClient-neovimã«clangdã®æ å ±ãç»é²ããã¨ãã«ä»¥ä¸ã®ããã«ãªãã·ã§ã³ã追å ãããããã«ãã¦ããã¾ãã
let g:LanguageClient_serverCommands = { 'cpp': ['clangd', '-compile-commands-dir=' . getcwd() . '/build'] }
ãã®ä¸ã§CMakeLists.txt
ãæ¸ãã¨ãã«ä»¥ä¸ã®è¡ã追å ããããã«ãã¦ãã¾ãã
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
ããã¨./build/compile_commands.json
ã¨ãããã¡ã¤ã«ã«ã³ã³ãã¤ã«ã³ãã³ãã®æ
å ±ãè¨é²ããã¾ãããããclangd
ãåæã«èªã¿åããã©ã¤ãã©ãªã®æ
å ±ãªã©ãåæ ãã¦ãããããã«ãªãã¾ãã
以ä¸ããã ãã èªåã®ç°å¢ã«ã¤ãã¦èªããã¨ã è¨äºããå±ããã¾ããã