Tmux Plugins (202605)

Tmux 시리즈:

  1. Tmux Start (202605)
  2. Tmux Cheatsheet (202605)
  3. Tmux Plugins (202605)

Plugin manager

Tmux Pluin Manager 를 설치하고, tmux 기능을 확장할 수 있다.

tpm 설치

먼저 사용자 홈 디렉토리에 저장한다.

1
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

다음 설정을 tmux.conf 에 저장한다.

1
2
3
4
5
6
7
8
9
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'

# other plugins ...

# Initialize TMUX plugin manager
# (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

그리고 tmux 환경설정을 다시 탑재한다.

1
tmux source ~/.tmux.conf

plugin 설치와 키 바인딩

새 플러그인을 .tmux.confset -g @plugin 로 입력한다.

  1. 플러그인 설치를 위해서 C-I (대문자) 를 실행
  2. 플러그인 업그레이드를 위해서 C-U (대문자) 를 실행
  3. 플러그인 삭제:
    • .tmux.conf 에서 플러그인 삭제
    • C-M-u (소문자)

tpm 으로 해당 플러그인은 ~/.tmux/plugins/ 디렉토리에 패치된다.


주요 plugins

https://github.com/tmux-plugins/list

몇가지 플러그인을 설치해서 사용해 보자

tmux-sidebar

tmux 화면에 sidebar 로 tree 형식의 디렉토리 구조를 보여준다.

  1. .tmux.conf 에 플러그인을 추가한다.
1
set -g @plugin 'tmux-plugins/tmux-sidebar'
  1. tmux sourceC-r 로 설정을 재 탑재한다.

  2. C-I 로 플러그인 설치를 시작한다.

1
2
3
4
5
6
7
8
9
Already installed "tpm"
Installing "tmux-sensible"
"tmux-sensible" download success
Installing "tmux-sidebar"
"tmux-sidebar" download success

TMUX environment reloaded.

Done, press ESCAPE to continue.
  1. side-bar 키 바인딩
  • prefix + Tab - toggle sidebar with a directory tree
  • prefix + Backspace - toggle sidebar and move cursor to it (focus it)

plugin 삭제

  1. .tmux.conf 에서 해당 플러그인을 삭제한다.
  2. C-M-u 로 플러그인을 삭제한다.

여기서는 tmux-cpu 를 삭제하고 있다.

1
2
3
4
5
6
Removing "tmux-cpu"
"tmux-cpu" clean success

TMUX environment reloaded.

Done, press ESCAPE to continue.

Tmux-Resurrection

_tmux-resurrect_는 tmux 세션을 백업/복구 할 수 있는 플러그인이다. tmux.conf에 다음을 추가

1
set -g @plugin 'tmux-plugins/tmux-resurrect'

플러그인 설치를 위해서 C-I 를 실행하면 설치를 시작한다.

Resurrection 플러그인으로 백업/복구하는 키는 다음 같이 지정되어 있다:

  • C-s : save
  • C-r : restore

Tmux-continuum

tmux-continuum은 tmux-resurrect 플러그인과 연동하여 tmux 세션 상태를 주기적으로 자동 저장하고, 시스템 부팅 시 복원해주는 플러그인입니다.

tmux-continuum 의 주요 기능은:

  • tmux 환경을 15분 마다 자동 저장
  • 컴퓨터/서버 시작시 tmux 자동 시작 가능
  • tmux 시작시 자동 복구 가능
  • tmux 1.9 이상, bash, tmux-resurrect plugin

설치

  1. 설치는 .tmux.conf 파일에 mux-resurrecttmux-continuum 플러그인을 추가:
1
2
3
4
5
6
7
8
9
10
11
12
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'

# (continuum) tmux 시작 시 마지막 세션 자동 복원
set -g @continuum-restore 'on'

# (continuum) 자동 저장 간격 변경 (기본값: 15분)
set -g @continuum-save-interval '15'

# (continuum) continuum 상태표시
set -g status-right 'Continuum status: #{continuum_status}'
  1. tmux sourceC-r 로 설정을 재 탑재한다.

  2. C-I 로 플러그인 설치를 시작한다.

1
2
3
4
5
6
7
8
9
10
11
Already installed "tpm"
Already installed "tmux-sensible"
Already installed "tmux-sidebar"
Installing "tmux-resurrect"
"tmux-resurrect" download success
Installing "tmux-continuum"
"tmux-continuum" download success

TMUX environment reloaded.

Done, press ESCAPE to continue

이제부터 15분 마다 자동 저장하고 서버를 재시작한 후에 tmux를 다시 시작하면 저장한 환경을 자동으로 복구해 준다.

  1. 키 바인딩
  • 세션 수동 저장: Ctrl + b 누른 후 Ctrl + s (Resurrect 기능)
  • 세션 수동 복원: Ctrl + b 누른 후 Ctrl + r (Resurrect 기능)

tmux 세션을 모두 나와서 tmux 서버를 모두 kill-session 같은 명령으로 종료시킨후 tmux를 다시 시작하면 .tmux/resurrect 에 저장된 마지막 세션이 복구되는 것을 확인할 수 있다.


CLI 로 플러그인 관리

https://github.com/tmux-plugins/tpm/blob/master/docs/managing_plugins_via_cmd_line.md

Author

Gangtai Goh

Posted on

2026-05-26

Updated on

2026-05-29

Licensed under