Created
August 29, 2017 03:46
-
-
Save zillou/ac5ca9b95e214bec6f538779742f6206 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unbind C-b | |
set -g prefix C-s | |
bind-key -r C-s send-prefix | |
set -sg escape-time 0 | |
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded" | |
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 | |
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" | |
set-option -g status-keys "emacs" | |
set-option -g status-left-length 50 | |
set-option -g status-right "" | |
bind-key - split-window -v -c '#{pane_current_path}' | |
bind-key \ split-window -h -c '#{pane_current_path}' | |
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 | |
bind -n C-Left resize-pane -L 10 | |
bind -n C-Right resize-pane -R 10 | |
bind -n C-Down resize-pane -D 5 | |
bind -n C-Up resize-pane -U 5 | |
bind c new-window -c '#{pane_current_path}' | |
set-option -g base-index 1 | |
set-option -g renumber-windows on | |
bind-key b break-pane -d | |
bind-key C-j choose-tree | |
# Use vim keybindings in copy mode | |
setw -g mode-keys vi | |
# Setup 'v' to begin selection as in Vim | |
# bind-key -t vi-copy v begin-selection | |
bind-key -T copy-mode-vi v send-keys -X begin-selection | |
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" | |
# Update default binding of `Enter` to also use copy-pipe | |
# unbind -T copy-mode-vi Enter | |
# bind-key -T copy-mode-vi Enter copy-pipe "reattach-to-user-namespace pbcopy" | |
bind C-j split-window -v "tmux list-sessions | sed -E 's/:.*$//' | grep -v \"^$(tmux display-message -p '#S')\$\" | fzf --reverse | xargs tmux switch-client -t" | |
# Prompted join-pane | |
bind-key j command-prompt -p "join pane from: " "join-pane -h -s '%%'" | |
# Easily swap a pane (targeted by pane number) with the current pane | |
bind-key s display-panes\; command-prompt -p "pane #: " "swap-pane -t '%%'" | |
bind-key C-b send-keys 'tat && exit' 'C-m' | |
bind-key K run-shell 'tmux switch-client -n \; kill-session -t "$(tmux display-message -p "#S")" || tmux kill-session' | |
set-option -g default-command "reattach-to-user-namespace -l zsh" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment