shoestrap/assets/default/dotfiles/tmux.conf

72 lines
2.6 KiB
Plaintext
Raw Normal View History

2013-08-08 03:23:13 +00:00
# set default shell
set-option -g default-shell $SHELL
# Sets xterm window title
set-option -g set-titles on
set-option -g set-titles-string '[#S:#I] #W'
# look good
2022-09-28 17:28:49 +00:00
set -g default-terminal 'screen-256color'
set -as terminal-overrides ',*256col*:Tc:sitm=\E[3m'
2013-08-08 03:23:13 +00:00
2015-06-03 20:26:27 +00:00
# update prefix
2013-08-08 03:23:13 +00:00
unbind C-b
set -g prefix C-q
# easy splitting
2015-04-08 18:33:58 +00:00
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -c "#{pane_current_path}"
bind _ split-window -c "#{pane_current_path}"
2013-08-08 03:23:13 +00:00
# move between panes
2015-06-03 20:26:27 +00:00
bind C-q select-pane -t :.+
2013-08-08 03:23:13 +00:00
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# swap panes
2015-06-03 20:26:27 +00:00
bind -r J swap-pane -D
bind -r K swap-pane -U
# move panes
bind C-j command-prompt -p "Join pane from:" "join-pane -s '%%'"
bind C-s command-prompt -p "Send pane to:" "join-pane -t '%%'"
bind C-b break-pane
# Enable mouse mode
set -g mouse on
# New keybindings for vi-mode
setw -g mode-keys vi
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind -T copy-mode-vi y send-keys -X copy-selection
bind -T copy-mode-vi H send-keys -X start-of-line
bind -T copy-mode-vi L send-keys -X end-of-line
bind -T choice-mode-vi h send-keys -X tree-collapse
bind -T choice-mode-vi l send-keys -X tree-expand
bind -T choice-mode-vi H send-keys -X tree-collapse-all
bind -T choice-mode-vi L send-keys -X tree-expand-all
bind -T copy-mode-emacs MouseDragEnd1Pane send-keys -X copy-pipe "pbcopy"
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe "pbcopy"
# bind p for put
2017-04-21 20:19:20 +00:00
unbind p
bind p paste-buffer
# rebind previous-window
bind b previous-window
2013-08-08 03:23:13 +00:00
# after copying to a tmux buffer, hit y again to copy to clipboard
unbind y
if-shell 'test "$(uname -s)" = "Darwin"' 'bind y run "tmux show-buffer | pbcopy"'
2015-06-03 20:26:27 +00:00
if-shell 'test "$(uname -s)" = "Linux"' 'bind y run "tmux show-buffer | xclip -sel clip -i"'
2013-08-08 03:23:13 +00:00
# Auto load tmuxline config for themes
if-shell "test -f ~/.tmuxline.conf" "source ~/.tmuxline.conf"
# smart pane switching with awareness of vim splits
2015-06-03 20:26:27 +00:00
# bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
# bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
# bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
# bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
# bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"