Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # set <prefix> to Ctrl-s
- unbind C-b
- set -g prefix C-s
- # remove esc delay
- set -s escape-time 0
- set -g repeat-time 0
- # reload conf file on "r"
- bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
- # Smart pane switching with awareness of vim splits
- # (depends on: https://github.com/christoomey/vim-tmux-navigator)
- 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 bindings for pane resizing
- 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
- # window splitting including current dir path
- bind-key - split-window -v -c '#{pane_current_path}'
- bind-key \ split-window -h -c '#{pane_current_path}'
- # switching sessions (choose-tree)
- bind-key C-j choose-tree
- # Use vim keybindings in copy mode
- setw -g mode-keys vi
- # Setup vim scroll + copy mode
- # (depends on: https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard)
- # 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"
- # create new windows including current dir path
- bind c new-window -c '#{pane_current_path}'
- # start window indexing from 1 (instead of 0)
- set -g base-index 1
- set -g renumber-windows on
- # break pane to new window
- bind-key b break-pane -d
- # set terminal to 256 colors
- set -g default-terminal "screen-256color"
- # use standard shell commands
- set -g status-keys "emacs"
- # set status bar bg and fg colors
- set -g status-bg '#1d2021'
- set -g status-fg '#fabd2f'
- # extend number of characters in status bar
- set -g status-left-length 50
- # add battery level and nicely formatted date to the right side of status bar
- set -g status-right "#{?pane_synchronized,--SYNCED--,} #(battery -t -g black) #(date '+%a, %b %d - %I:%M') "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement