Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # switch to C-s
- set -g prefix C-s
- unbind C-b
- # use r for reloading
- unbind r
- bind r source-file ~/.tmux.conf
- # Prefer hjkl for moving about the panes
- bind-key -n C-h select-pane -L
- bind-key -n C-j select-pane -D
- bind-key -n C-k select-pane -U
- bind-key -n C-l select-pane -R
- bind-key - split-window -v -c '#{pane_current_path}'
- bind-key \ split-window -h -c '#{pane_current_path}'
- bind c new-window -c "#{pane_current_path}"
- bind-key b break-pane -d
- # Fine adjustment (1 or 2 cursor cells per bump)
- bind -n S-Left resize-pane -L 2
- bind -n S-Right resize-pane -R 2
- bind -n S-Down resize-pane -D 1
- bind -n S-Up resize-pane -U 1
- set-option -g default-terminal "screen-256color"
- setw -g mode-keys vi
- # Setup 'v' to begin selection as in Vim
- bind-key -t vi-copy v begin-selection
- bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
- # Update default binding of `Enter` to also use copy-pipe
- unbind -t vi-copy Enter
- bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
- # Setup 'v' to begin selection as in Vim
- bind-key -t vi-copy v begin-selection
- bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
- # Update default binding of `Enter` to also use copy-pipe
- unbind -t vi-copy Enter
- bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
- bind-key j choose-tree
- set-option -g status-right " #(date '+%b %d - %I:%M') "
- set-option -g status-bg '#666666'
- set-option -g status-fg '#aaaaaa'
- # Smart pane switching with awareness of vim splits
- is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
- bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
- bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
- bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
- bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
- bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
- # Secondary binding for C-l to retain redraw
- bind C-l send-keys 'C-l'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement