2024. 8. 19. 16:49ㆍ카테고리 없음
why? 간지 뒤지잖어 ㅋ
구라고 저도 안 하고 싶습니다. 근데 이 모진 세상이 제게 cli 환경을 강요하네요, 개같은거 우짜겠습니까. 돈 주는데 해야지.
1. tmux 설치
tmux: session 관리 tool
https://github.com/tmux/tmux?tab=readme-ov-file
기본 명령어 모음
tmux: 새 세션 만들기
tmux new -s {name}: 새 세션 만들기 + 이름 붙이기
tmux ls: 세션 리스트
tmux a -t {target session}: 해당 세션에 attach하기
tmux kill-session -t {target session}: 세션 kill 하기
기본 keybinding 모음
<prefix> == CTRL + B
<prefix>, d: 현재 세션에서 dettach
<prefix>, %: split window horizontally
<prefix>, ": split window vertically
<prefix>, arrow: move between panes
<prefix>, X: close pane
<prefix>, C: create new window
<prefix>, N or P: to Next or Previous window
<prefix>, Number: move to according window
<prefix>, ?: view all keybindings
mouse activate하는 법
<prefix>, : 한 뒤 set -g mouse
tmux session안에서 cmd + c로 복사하는 법

iterm은 Preferences/General/Applications in terminal may access clipboard 키면 됨, 나머진 몰루
keybinding 추가하기
tmux config 파일에 bind-key -n ˙ previous-window이런 식으로다가 하면 됨
참고로 저건 원래 alt-h하면 previous window로 가게 하고 싶었던 건데, 개같은 macos가 기본 영문 입력기에서 option키 누르고 h입력하면 ˙같은 듣도 보도 못한 분자 입력해서 걍 저걸로다가 key bind 해놓은 것. mac쓰시는 분들은 참고 바람

2. tmux plugin manager 설치
tmux package manager
https://github.com/tmux-plugins/tpm
필요한 플러그인 깔 것
tmux config(~/.tmux.conf)에 set -g {plugin} 하고 tmux안에 들어와서 <prefix>, I로 install
추천:
christoomey/vim-tmux-navigator: ctrl + hjkl로 pane간 이동 하게 해줌, nvim이랑도 integration 가능해서 개꿀따리 개꿀따
[ref]
tmux setup: https://www.youtube.com/watch?v=DzNmUNvnB04&t=21s