dotfiles/.config/tmux/tmux.conf

160 lines
5.9 KiB
Text
Raw Normal View History

# Layout of this conf file:
# 1. Global Settings
# 2. Keybinds
# 3. Keybinds
# 4. Theme
# For rapid change prototyping, disabled normally:
# bind-key r source-file ~/.config/tmux/tmux.conf \; display-message "config reloaded."
######################
### 1. GLOBAL SETTINGS
######################
2019-02-04 12:12:59 +00:00
# show that activity happens but don't display a huge 'activity happening' notification
setw -g monitor-activity on
set -g visual-activity off
# Start counting windows and panes at 1
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
2019-02-04 12:12:59 +00:00
# Terminal improvements
set -g terminal-overrides "xterm*:XT:smcup@:rmcup@"
set-window-option -g automatic-rename on
set-option -g set-titles on
set -g mouse on
set -g default-terminal xterm-256color
2019-02-04 12:12:59 +00:00
set -g status-keys vi
set -g history-limit 10000
# Screen size is based on the smallest client looking at the current windows, not the smallest
# client connected to the overall session. If two clients are connected to the same session but not
# looking at the same window, why would they care about each others screen size?
setw -g aggressive-resize on
2019-02-04 12:12:59 +00:00
# No delay for escape key press
set -sg escape-time 0
# Set Cursor terminal override, so nvim can change cursor style when changing modes
# more info see nvim, :help tui-cursor-shape
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
2019-02-04 12:12:59 +00:00
####################
## 2. PLUGINS ##
####################
2019-02-04 12:12:59 +00:00
2019-02-04 14:41:57 +00:00
# Plugins -- TO INITALLY SET UP THE PLUGINS PRESS bind-key I (that is shift i)
# -- a message will appear after a second saying succes
2019-02-04 14:27:49 +00:00
#run-shell ~/.tmux-plugins/resurrect/resurrect.tmux
2019-02-04 14:41:57 +00:00
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'Morantron/tmux-fingers'
2019-03-15 15:26:57 +00:00
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-resurrect'
if "test ! -d ${TMUX_PLUGIN_MANAGER_PATH}/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm {TMUX_PLUGIN_MANAGER_PATH}/tpm && {TMUX_PLUGIN_MANAGER_PATH}/tpm/bin/install_plugins'"
2019-03-13 16:19:27 +00:00
run -b "${TMUX_PLUGIN_MANAGER_PATH}/tpm/tpm"
#####################
## 3. KEYBINDINGS ##
#####################
# Unbind some defaults
unbind '"'
unbind %
# Custom modifier key
set -g prefix C-a
unbind-key C-b
bind-key -r C-a send-prefix
# Pane Navigation - Vim Keys
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
# Window Navigation - Prefix + Vim Keys
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# Resize Panes
bind-key -r H resize-pane -L 3
bind-key -r J resize-pane -D 1
bind-key -r K resize-pane -U 1
bind-key -r L resize-pane -R 3
bind-key -r C-H resize-pane -L 10
bind-key -r C-J resize-pane -D 5
bind-key -r C-K resize-pane -U 5
bind-key -r C-L resize-pane -R 10
# Send Pane to a new window (but stay on current window), join it back into the current window
bind-key B break-pane -d
bind-key C-b command-prompt -p "join pane from: " "join-pane -h -s '%%'"
# Swap panes within the current window (swaps pane # entered with currently selected pane)
bind-key b display-panes\; command-prompt -p "pane #: " "swap-pane -t '%%'"
# Kill tabs quicker
bind-key x kill-pane
bind-key C-x kill-window
# Split Window into panes - automatically handled by plugin
bind-key \ split-window -h -c '#{pane_current_path}'
bind-key - split-window -v -c '#{pane_current_path}'
# Open a sessions chooser
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"
# Quick-View Panes
bind-key h split-window -h 'glances'
bind-key t split-window -h 'vim ~/todo.md'
#####################
## 4. THEME ##
#####################
## theme from github.com/jimeh/tmux-themepack, the powerline/default/blue theme.
## It is integrated with prefix highlight for this tmux conf
# Status update interval
set -g status-interval 1
2019-03-13 16:19:27 +00:00
# Clock mode
set -g clock-mode-colour colour24
set -g clock-mode-style 24
# Sets both Prefix mode and Copy mode to be highlighted in the status bar.
set -g @prefix_highlight_show_copy_mode 'on'
set -g @prefix_highlight_copy_mode_attr 'fg=black,bg=yellow,bold' # default is 'fg=default,bg=yellow'
set -g @prefix_highlight_prefix_prompt 'Command'
set -g @prefix_highlight_copy_prompt 'Copy'
2019-03-13 16:19:27 +00:00
# This tmux statusbar config was created by tmuxline.vim
# on Wed, 13 Mar 2019
set -g message-command-style bg="#2e2e2e",fg="#c8c8c8"
set -g message-style bg="#2e2e2e",fg="#c8c8c8"
set -g pane-active-border-style fg="#2e2e2e"
set -g pane-border-style fg="#2e2e2e"
2019-03-13 16:19:27 +00:00
set -g status-justify "centre"
set -g status "on"
set -g status-style "none"
set -g status-style "none"
2019-03-13 16:19:27 +00:00
set -g status-left-length "100"
set -g status-bg "#2e2e2e"
set -g status-right-length "100"
setw -g window-status-style fg="#c8c8c8",bg="#2e2e2e","none"
setw -g window-status-activity-style bg="#2e2e2e",fg="#c8c8c8","underscore"
2019-03-13 16:19:27 +00:00
setw -g window-status-separator ""
set -g status-left "#[fg=#c8c8c8,bg=#2e2e2e] #S #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #(whoami) #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #I:#P #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]"
2019-03-15 15:26:57 +00:00
set -g status-right "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#{prefix_highlight} #[fg=#c8c8c8,bg=#2e2e2e] %H:%M:%S #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] %d-%b-%y #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #H "
2019-03-13 16:19:27 +00:00
setw -g window-status-format "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[default] #I #W #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]"
setw -g window-status-current-format "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e]  #I #W #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]"