Post

๐Ÿงท tmux ์œ ์šฉํ•œ ์„ค์ • ์ •๋ฆฌ (.tmux.conf ๊ธฐ์ค€)

๋‚ด tmux ์„ค์ •์—์„œ ๋ฐ”๋กœ ์ฒด๊ฐ๋˜๋Š” ์˜ต์…˜๋งŒ ๋ฝ‘์•„ ํ•ต์‹ฌ ๋™์ž‘, ํŒจ๋„, ์„ธ์…˜ ํŠธ๋ฆฌ, ํ”Œ๋Ÿฌ๊ทธ์ธ๊นŒ์ง€ ํ•œ ๋ฒˆ์— ์ •๋ฆฌ.

๐Ÿงท tmux ์œ ์šฉํ•œ ์„ค์ • ์ •๋ฆฌ (.tmux.conf ๊ธฐ์ค€)

๐Ÿงท tmux ์œ ์šฉํ•œ ์„ค์ • ์ •๋ฆฌ (.tmux.conf ๊ธฐ์ค€)

์‹ค์ œ๋กœ ์“ฐ๋Š” .tmux.conf์—์„œ ์ฒด๊ฐ์ด ํฐ ์˜ต์…˜๋งŒ ๋”ฐ๋กœ ๋ชจ์•˜๋‹ค. ๋ชฉ์ ์€ โ€œ์™œ ์ด ์˜ต์…˜์„ ๋‘๋Š”์ง€โ€๋ฅผ ์žŠ์ง€ ์•Š๊ฒŒ ๊ธฐ๋กํ•˜๋Š” ๊ฒƒ.


1. ๊ธฐ๋ณธ ๋™์ž‘

1) ESC ์ง€์—ฐ ์ œ๊ฑฐ

set -sg escape-time 0

Vim/Neovim์—์„œ ESC ๋ฐ˜์‘์ด ์ฆ‰๊ฐ์ ์œผ๋กœ ๋А๊ปด์ ธ์„œ ์ž…๋ ฅ ๋ฆฌ๋“ฌ์ด ๋ถ€๋“œ๋Ÿฝ๋‹ค.

2) True Color ํ™œ์„ฑํ™”

set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*256col*:Tc"

tmux ์•ˆ์—์„œ๋„ ํ…Œ๋งˆ ์ƒ‰์ด ํ๋ ค์ง€์ง€ ์•Š๊ฒŒ ๋ณด์ธ๋‹ค.

3) ๋งˆ์šฐ์Šค ํ™œ์„ฑํ™”

set -g mouse on

ํŒจ๋„ ํฌ๊ธฐ ์กฐ์ ˆ์ด๋‚˜ ์Šคํฌ๋กค์ด ๋ฐ”๋กœ ๊ฐ€๋Šฅํ•ด์„œ ์ƒํ™ฉ์— ๋”ฐ๋ผ ํŽธํ•˜๋‹ค.


2. ํŒจ๋„/ํ‚ค๋ฐ”์ธ๋”ฉ

1) ๋ถ„ํ•  ์‹œ ํ˜„์žฌ ๊ฒฝ๋กœ ์œ ์ง€

bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"

๋ถ„ํ•  ํ›„์—๋„ ํ˜„์žฌ ์ž‘์—… ๋””๋ ‰ํ„ฐ๋ฆฌ๋ฅผ ์ด์–ด๊ฐ€์„œ ํ๋ฆ„์ด ๋Š๊ธฐ์ง€ ์•Š๋Š”๋‹ค.

2) ํŒจ๋„ ์ •๋ณด ํ‘œ์‹œ

set -g pane-border-status bottom
set -g pane-border-format " #P #{pane_current_command} "

ํŒจ๋„ ๋ฒˆํ˜ธ์™€ ํ˜„์žฌ ๋ช…๋ น์–ด๋ฅผ ๋ฐ”๋กœ ํ™•์ธํ•  ์ˆ˜ ์žˆ์–ด ์ „ํ™˜์ด ๋น ๋ฅด๋‹ค.

3) ๋ณต์‚ฌ ๋ชจ๋“œ vi ํ‚ค

setw -g mode-keys vi

vi ํ‚ค๋กœ ๋ณต์‚ฌ ๋ชจ๋“œ๋ฅผ ๋‹ค๋ฃจ๋ฉด ์†์ด ๋œ ํ—ท๊ฐˆ๋ฆฐ๋‹ค.


3. ์„ธ์…˜ ํŠธ๋ฆฌ ์ •๋ ฌ

1) ์ด๋ฆ„ ๊ธฐ์ค€ ์ •๋ ฌ

bind s choose-tree -Zs -O name

์„ธ์…˜/์œˆ๋„์šฐ ๋ชฉ๋ก์„ ์ด๋ฆ„ ๊ธฐ์ค€์œผ๋กœ ์ •๋ ฌํ•ด์„œ ๋น ๋ฅด๊ฒŒ ์ฐพ๋Š”๋‹ค.


4. TPM ํ”Œ๋Ÿฌ๊ทธ์ธ ๊ตฌ์„ฑ

1) ํ”Œ๋Ÿฌ๊ทธ์ธ ๋ชฉ๋ก

set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'jimeh/tmux-themepack'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
  • tmux-sensible: ๊ธฐ๋ณธ๊ฐ’์„ sane default๋กœ ์ •๋ฆฌ
  • vim-tmux-navigator: Ctrl+h/j/k/l๋กœ vim โ†” tmux ์ด๋™
  • tmux-themepack: ์ƒํƒœ๋ฐ” ํ…Œ๋งˆ๋ฅผ ๊ฐ„๋‹จํžˆ ์ ์šฉ
  • tmux-resurrect: ์„ธ์…˜/ํŒจ๋„ ์ƒํƒœ ์ €์žฅ & ๋ณต์›
  • tmux-continuum: ์ž๋™ ์ €์žฅ/์ž๋™ ๋ณต์›

2) ํ…Œ๋งˆ ์„ ํƒ

set -g @themepack 'powerline/default/cyan'

3) ๋ณต์› ์˜ต์…˜

set -g @resurrect-capture-pane-contents 'on'
set -g @continuum-restore 'on'

5. ์ ์šฉ/๋ฆฌ๋กœ๋“œ

1) TPM ์ดˆ๊ธฐํ™” (ํ•ญ์ƒ ๋งˆ์ง€๋ง‰ ์ค„)

run '~/.tmux/plugins/tpm/tpm'

2) ์„ค์ • ๋ฆฌ๋กœ๋“œ

1
tmux source-file ~/.tmux.conf
This post is licensed under CC BY 4.0 by the author.