Skip to content

Instantly share code, notes, and snippets.

@flada-auxv
Created November 10, 2012 05:37
Show Gist options
  • Save flada-auxv/4050038 to your computer and use it in GitHub Desktop.
Save flada-auxv/4050038 to your computer and use it in GitHub Desktop.
tmuxの設定関連
# 一部抜粋
# emacsのエイリアス
alias e='emacsclient -t'
alias kille="emacsclient -e '(kill-emacs)'"
if pgrep emacs >/dev/null 2>&1; then
echo "Emacs server is already running..."
else
`emacs --daemon`
fi
# tmux自動起動
if [ -z "$TMUX" -a -z "$STY" ]; then
if type tmux >/dev/null 2>&1; then
if tmux has-session && tmux list-sessions | /usr/bin/grep -qE '.*]$'; then
tmux attach && echo "tmux attached session "
else
tmux new-session && echo "tmux created new session"
fi
fi
fi
# prefixの変更
unbind-key C-b
set-option -g prefix C-t
bind-key C-t send-prefix
# ウィンドウ・ペインの最初の番号を指定を1に。デフォルトだと0から
set -g base-index 1
set -g pane-base-index 1
# C-gをキャンセルコマンドとして利用する
unbind C-g
# 256色表示
set -g default-terminal "screen-256color"
# tmuxの設定を再読み込み
unbind r
bind C-r source-file ~/.tmux.conf ; display-message " tmux Reloaded!!"
# コピーモードでemacs風の操作(終了時はC-x c)
setw -g mode-key emacs
# 必要ない?
setw -g utf8 on
# ディスプレイ番号を表示 表示された番号を入力して移動
bind i display-panes
set display-panes-time 10000
# clock-mode入ってしまったら C-? qで戻ってくる
# clock-modeはunbindしちゃいましょ
unbind t
unbind h
set repeat-time 1000
bind C-q confirm-before "kill-window"
bind q confirm-before "kill-pane"
bind c new-window
bind C-p previous-window
bind C-n next-window
bind t confirm-before "last-window"
bind o rotate-window
bind -r h select-pane -L
bind -r j select-pane -D
bind -r k select-pane -U
bind -r l select-pane -R
bind -r Left resize-pane -L 5
bind -r Down resize-pane -D 5
bind -r Up resize-pane -U 5
bind -r Right resize-pane -R 5
bind C-s split-window -v
bind C-v split-window -h
bind C-w choose-window
bind d confirm-before "detach-client"
bind C-[ copy-mode
bind C-] paste-buffer
# tmux-powerline
set -g status on
set -g status-interval 2
set -g status-utf8 on
set -g status-justify "centre"
set -g status-left-length 60
set -g status-right-length 300
set -g status-left "#(~/dotfiles/tmux-powerline/status-left.sh)"
set -g status-right "#(~/dotfiles/tmux-powerline/status-right.sh)"
bind [ run '~/dotfiles/tmux-powerline/mute_statusbar.sh left' # Mute left statusbar.
bind ] run '~/dotfiles/tmux-powerline/mute_statusbar.sh right' # Mute right statusbar.
# tmux-colors-solarized
# dark light 256 の3種類
source ~/dotfiles/tmux-colors-solarized/tmuxcolors-dark.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment