Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
118 lines (88 sloc) 3.27 KB
###########################
# tmux configuration
###########################
# http://www.economyofeffort.com/2013/07/29/reattach-to-user-namespace-the-fix-for-your-tmux-in-os-x-woes/
# set-option -g default-command "reattach-to-user-namespace -l zsh"
set-option -g default-command 'reattach-to-user-namespace -l fish'
# bind-key -T copy-mode M-w send-keys -X copy-pipe 'reattach-to-user-namespace pbcopy'
# true colours
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
# increase scroll-back history
set -g history-limit 15000
# use vim key bindings
setw -g mode-keys vi
# decrease command delay (increases vim responsiveness)
set -sg escape-time 1
# increase repeat time for repeatable commands
set -g repeat-time 1000
# start window index at 1
set -g base-index 1
# mouse mode on by default
set -g mouse on
# re-number windows when one is closed
set -g renumber-windows on
###########################
# Key Bindings
###########################
# paste
unbind C-p
bind C-p paste-buffer
# window splitting
unbind %
bind \\ split-window -h -c "#{pane_current_path}" # same key for |
unbind '"'
bind - split-window -v -c "#{pane_current_path}"
# use the current path in the new window
unbind c
bind c new-window -c "#{pane_current_path}"
# bind to enable mouse mode
unbind a
bind a set -g mouse on \; display "Mouse mode!"
# bind to disable mouse mode
unbind s
bind s set -g mouse off \; display "Mouse mode off!"
# bind the w key to hide status bar
unbind w
bind w set -g status off
# bind the e key to show status bar
unbind e
bind e set -g status on
# swap window using Shift + left/right
bind-key -n S-Left swap-window -t -1\; select-window -t -1
bind-key -n S-Right swap-window -t +1\; select-window -t +1
# navigate between windows using Ctrl + h/l
bind-key -n C-h select-window -t -1
bind-key -n C-l select-window -t +1
# force a reload of the config file
unbind r
bind r source ~/.tmux.conf
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n M-h if-shell "$is_vim" "send-keys M-h" "select-pane -L"
bind-key -n M-j if-shell "$is_vim" "send-keys M-j" "select-pane -D"
bind-key -n M-k if-shell "$is_vim" "send-keys M-k" "select-pane -U"
bind-key -n M-l if-shell "$is_vim" "send-keys M-l" "select-pane -R"
bind-key -n M-\\ if-shell "$is_vim" "send-keys M-\\" "select-pane -l"
###########################
# Plugins
###########################
set -g @themepack 'powerline/default/cyan'
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'jimeh/tmux-themepack'
set -g @plugin 'tmux-plugins/tmux-copycat'
# Initialize TMUX plugin manager
run '~/.tmux/plugins/tpm/tpm'
# this is here to overwrite my tmux theme
set -g status-justify left
set -g status-left "#[fg=colour232,bg=colour67,bold] #S "
set -g status-right "#[fg=colour240,bg=black] #I:#P #[fg=colour245,bg=colour233] #(basename #{pane_current_path}) "
set -g window-status-current-format "#[fg=colour81,nobold] #I:#W#F"
set -g status-bg black
# dark gray for split borders
set -g pane-active-border-style bg=black,fg=colour233
set -g pane-border-style fg=colour233
You can’t perform that action at this time.