๐งท Tmux ์ค์ & ํ๋ฌ๊ทธ์ธ ์ค๋ช (Markdown Version)
์๋๋ TPM(Tmux Plugin Manager)๊ณผ ํจ๊ป ์ฌ์ฉํ๋ ๋ํ ํ๋ฌ๊ทธ์ธ๋ค์ ์ค๋ช ์ ํฌํจํ `.tmux.conf` ์ค์ ์์์ด๋ค.
๐ฆ TPM (Tmux Plugin Manager)
1
set -g @plugin 'tmux-plugins/tpm'
๐ ์ญํ
Tmux ํ๋ฌ๊ทธ์ธ์ ์ค์น, ์ ๋ฐ์ดํธ, ์ญ์ ํ ์ ์๋ ํ๋ฌ๊ทธ์ธ ๊ด๋ฆฌ์. tmux ํ๋ฌ๊ทธ์ธ ์ํ๊ณ๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด ๋ฐ๋์ ํ์ํจ.
๐ ํ๋ฌ๊ทธ์ธ ๋ชฉ๋ก
1. tmux-plugins/tmux-sensible
1
set -g @plugin 'tmux-plugins/tmux-sensible'
โ ์ญํ
tmux์ ๊ธฐ๋ณธ๊ฐ์ ๋ ํฉ๋ฆฌ์ ์ธ ์ค์ (sane defaults) ๋ก ๋ณ๊ฒฝํด์ฃผ๋ ํ๋ฌ๊ทธ์ธ. ๊ธฐ๋ณธ ํค ์ค์ , ํจ๋ ๋์, ๊ธฐํ ๋น์ง๊ด์ ์ค์ ๋ค์ ๊ฐ์ ํด ์ฃผ๊ธฐ ๋๋ฌธ์ ํ์ ํ๋ฌ๊ทธ์ธ์ผ๋ก ๋๋ฆฌ ์ฌ์ฉ๋จ.
2. christoomey/vim-tmux-navigator
1
set -g @plugin 'christoomey/vim-tmux-navigator'
โ ์ญํ
Vim/Neovim ํจ๋๊ณผ Tmux ํจ๋ ์ฌ์ด๋ฅผ Ctrl+h/j/k/l ๋ก ์์ฐ์ค๋ฝ๊ฒ ์ด๋ํ ์ ์๊ฒ ํด์ค.
โ ํจ๊ณผ
- Vim ์ฐฝ โ tmux pane ์ด๋์ด ์ง๊ด์
- Vim ์ฌ์ฉ์์ ํ์ ํ๋ฌ๊ทธ์ธ
3. jimeh/tmux-themepack
1
2
set -g @plugin 'jimeh/tmux-themepack'
set -g @themepack 'powerline/default/cyan'
โ ์ญํ
๋ค์ํ ์ํ๋ฐ(theme) ๋ฅผ ์ ๊ณตํ๋ ํ ๋ง ํ๋ฌ๊ทธ์ธ.
โ ํจ๊ณผ
- Powerline ์คํ์ผ ์ ์ฉ ๊ฐ๋ฅ
- ์์ ์กฐํฉ์ ์ฝ๊ฒ ๋ณ๊ฒฝ
- ํ ๋ง ํ์ผ์ ์ง์ ์์ ํ ํ์ ์์
4. tmux-plugins/tmux-resurrect
1
2
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @resurrect-capture-pane-contents 'on'
โ ์ญํ
tmux ์ธ์ ์ โ๋ถํ(resurrect)โ ์์ผ์ฃผ๋ ํ๋ฌ๊ทธ์ธ. ์ ์ฅ๋ ์์ ์ ์ธ์ , ์๋์ฐ, ํจ๋ ๋ ์ด์์, ์คํ ์ค ๋ช ๋ น ๋ฑ์ ๋ณต์ํด์ค.
โ ๊ธฐ๋ฅ
prefix + Ctrl-sโ ์ธ์ ์ํ ์ ์ฅprefix + Ctrl-rโ ์ธ์ ๋ณต์- ํจ๋ ๋ด์ฉ๊น์ง ์ ์ฅํ๋ ค๋ฉด
@resurrect-capture-pane-contents='on'ํ์
5. tmux-plugins/tmux-continuum
1
2
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-restore 'on'
โ ์ญํ
tmux-resurrect๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์๋ ๋ฐฑ์
+ ์๋ ๋ณต์ ๊ธฐ๋ฅ์ ์ ๊ณต.
โ ๊ธฐ๋ฅ
- ์๋ ์ ์ฅ (๊ธฐ๋ณธ 15๋ถ ๊ฐ๊ฒฉ)
- ์์คํ ์ฌ๋ถํ ํ tmux ์๋ ๋ณต์
- ๊ฐ๋ฐ ํ๊ฒฝ ๊ทธ๋๋ก ๋ณต๊ตฌ ๊ฐ๋ฅ
๐ tmux-resurrect์ ์์ ํ์ฅ ํ๋ฌ๊ทธ์ธ
โ ๊ธฐํ tmux ์ค์
๊ธฐ๋ณธ ํฐ๋ฏธ๋ ๋ฐ ๋ง์ฐ์ค ํ์ฑํ
1
2
set -g default-terminal "screen-256color"
set -g mouse on
์ค๋ช
screen-256color: 256์์ ์ง์ํ๋๋ก ์ค์ (ํ ๋ง์ ํธํ์ฑโ)mouse on: ๋ง์ฐ์ค๋ก ํจ๋ ํฌ๊ธฐ ์กฐ์ , ์ ํ, ์คํฌ๋กค ๊ฐ๋ฅ
๐ TPM ์ด๊ธฐํ
1
run '~/.tmux/plugins/tpm/tpm'
tmux conf ๋งจ ๋ง์ง๋ง ์ค์ ์์นํด์ผ ํจ.
๐งฉ ์ต์ข
.tmux.conf (ํ๋ฌ๊ทธ์ธ ์ค๋ช
ํฌํจ)
# --- TPM ---
set -g @plugin 'tmux-plugins/tpm'
# --- Plugin list ---
set -g @plugin 'tmux-plugins/tmux-sensible' # sane tmux defaults
set -g @plugin 'christoomey/vim-tmux-navigator' # navigate between vim <-> tmux with Ctrl-hjkl
set -g @plugin 'jimeh/tmux-themepack' # tmux status bar themes
set -g @plugin 'tmux-plugins/tmux-resurrect' # save & restore tmux sessions
set -g @plugin 'tmux-plugins/tmux-continuum' # auto-save & auto-restore
# --- Theme config ---
set -g @themepack 'powerline/default/cyan'
# --- Resurrect settings ---
set -g @resurrect-capture-pane-contents 'on'
set -g @continuum-restore 'on'
# --- Tmux settings ---
set -g default-terminal "screen-256color"
set -g mouse on
# --- Initialize TPM (must be last) ---
run '~/.tmux/plugins/tpm/tpm'