Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
126 lines (96 sloc)
3.98 KB
This file contains 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
########################### | |
# 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 fish' | |
# make clipboard work for Alacritty | |
# copied from https://gist.github.com/sijad/771426b3995eb05faeb6d78926645e56#file-tmux-conf | |
bind-key -T edit-mode-vi Up send-keys -X history-up | |
bind-key -T edit-mode-vi Down send-keys -X history-down | |
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" | |
unbind-key -T copy-mode-vi Space ; bind-key -T copy-mode-vi v send-keys -X begin-selection | |
unbind-key -T copy-mode-vi Enter ; bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" | |
unbind-key -T copy-mode-vi C-v ; bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle | |
unbind-key -T copy-mode-vi [ ; bind-key -T copy-mode-vi [ send-keys -X begin-selection | |
unbind-key -T copy-mode-vi ] ; bind-key -T copy-mode-vi ] send-keys -X copy-selection | |
# 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=colour214,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=colour214,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 | |