LoginSignup
6
6

More than 5 years have passed since last update.

iterm2にtmuxを統合するメモ

Last updated at Posted at 2015-07-22

ただのメモです。
とりあえず動いた設定をメモしていますが、各々いい感じに設定するには各自よきようにカスタマイズが必要です。
あしからず。

install

$ brew install tmux

set .tmux.conf

# ----------------- #
# Window #
# ----------------- #

## window number begins with 1
set-option -g base-index 1

# mouse scroll
set-window-option -g mode-mouse on
# これを有効にすると、MacでCommand+Cなどができなくなるが、
# Optionを押しながら範囲選択すると、コピーできる。

# reset window number at closing it
set-option -g renumber-windows on

# ------------------- #
# status bar #
# ------------------- #

# 色コード: http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html

# 256 color
set-option -g default-terminal "xterm"

# status bar color
set -g status-fg colour253
set -g status-bg colour237

# non-active window color
set-window-option -g window-status-fg default
set-window-option -g window-status-bg default

# active window color
set-window-option -g window-status-current-fg colour16
set-window-option -g window-status-current-bg colour178

# position of status bar    
set-option -g status-position bottom

# item of left side of status bar
set -g status-left '#[fg=colour32, bold]#S'

# item of right side of status bar
set -g status-right ''

# kill K k
unbind K
bind K kill-window
unbind k
bind k kill-window

# detach ^D d
unbind ^D
bind ^D detach

set shortcut

iterm2のkey bindに以下を設定

key hex code action
Ctrl Shift ] 0×2 0x6e move to next window
Ctrl Shift [ 0x2 0x70 move to last window
Ctrl n 0x2 0x63 open new window
Ctrl t 0x2 0x63 close window
Ctrl w 0x2 0x6b close window
Ctrl Shift % 0x2 0x25 divide window vertically
Ctrl ] 0×2 0x6f move to next pane

set command alias

~/.zshrc
alias t='tmux'
alias ta='tmux attach'
alias td='tmux detach'

references

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6