Post

๐Ÿงท Tmux ์„ค์ • & ํ”Œ๋Ÿฌ๊ทธ์ธ ์„ค๋ช… (Markdown Version)

์•„๋ž˜๋Š” TPM(Tmux Plugin Manager)๊ณผ ํ•จ๊ป˜ ์‚ฌ์šฉํ•˜๋Š” ๋Œ€ํ‘œ ํ”Œ๋Ÿฌ๊ทธ์ธ๋“ค์˜ ์„ค๋ช…์„ ํฌํ•จํ•œ `.tmux.conf` ์„ค์ • ์˜ˆ์‹œ์ด๋‹ค.

๐Ÿงท Tmux ์„ค์ • & ํ”Œ๋Ÿฌ๊ทธ์ธ ์„ค๋ช… (Markdown Version)

๐Ÿ“ฆ 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'
This post is licensed under CC BY 4.0 by the author.