Create base-level comfortable tmux config

This commit is contained in:
Marty Oehme 2019-02-27 14:42:45 +01:00
parent 39ca1b4d5c
commit 126328dc5c

View file

@ -1,8 +1,15 @@
# Status Bar Appearance customization # Layout of this conf file:
#set -g status-bg black # 1. Global Settings
#set -g status-fg white # 2. Keybinds
set -g status-bg green # 3. Keybinds
set -g window-status-current-bg blue # 4. Theme
# For rapid change prototyping, disabled normally:
# bind-key r source-file ~/.config/tmux/tmux.conf \; display-message "config reloaded."
######################
### 1. GLOBAL SETTINGS
######################
# show that activity happens but don't display a huge 'activity happening' notification # show that activity happens but don't display a huge 'activity happening' notification
setw -g monitor-activity on setw -g monitor-activity on
@ -11,68 +18,107 @@ set -g visual-activity off
# Start counting windows and panes at 1 # Start counting windows and panes at 1
set -g base-index 1 set -g base-index 1
setw -g pane-base-index 1 setw -g pane-base-index 1
set -g renumber-windows on
# Custom modifier key
set -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
# Terminal improvements # Terminal improvements
set -g terminal-overrides "xterm*:XT:smcup@:rmcup@" set -g terminal-overrides "xterm*:XT:smcup@:rmcup@"
set-window-option -g automatic-rename on set-window-option -g automatic-rename on
set -g renumber-windows on
set-option -g set-titles on set-option -g set-titles on
set -g mouse on set -g mouse on
set -g default-terminal screen-256color set -g default-terminal screen-256color
set -g status-keys vi set -g status-keys vi
set -g history-limit 10000 set -g history-limit 10000
# Clear scrollback buffer # Screen size is based on the smallest client looking at the current windows, not the smallest
bind l clear-history # 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?
# Custom key bindings to split the window setw -g aggressive-resize on
# split it using modifier key + v or s
#bind-key h split-window -h
#bind-key v split-window -v
# split it w/o modifier key using - or _
#bind - split-window -v
#bind _ split-window -h
# No delay for escape key press # No delay for escape key press
set -sg escape-time 0 set -sg escape-time 0
# WINDOW SWITCHING # Set Cursor terminal override, so nvim can change cursor style when changing modes
# Easier window navigation # more info see nvim, :help tui-cursor-shape
bind -n C-Tab next-window set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
bind -n C-S-Tab previous-window
#bind -n C-S-Left previous-window
#bind -n C-S-Right next-window
# Copy to cygwin clipboard ####################
bind -n C-t run "tmux save-buffer - > /dev/clipboard" ## 2. PLUGINS ##
####################
# PANE & WINDOW DESTRUCTION
# Kill tabs quicker
bind-key x kill-pane
bind-key C-x kill-window
# Plugins -- TO INITALLY SET UP THE PLUGINS PRESS bind-key I (that is shift i) # Plugins -- TO INITALLY SET UP THE PLUGINS PRESS bind-key I (that is shift i)
# -- a message will appear after a second saying succes # -- a message will appear after a second saying succes
#run-shell ~/.tmux-plugins/resurrect/resurrect.tmux #run-shell ~/.tmux-plugins/resurrect/resurrect.tmux
set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-pain-control' # Recently removed due to causing too many incompatibilities with how I want it set up
#set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-yank' set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight' set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'Morantron/tmux-fingers' set -g @plugin 'Morantron/tmux-fingers'
run -b "${TMUX_PLUGIN_MANAGER_PATH}/tpm/tpm" run -b "${TMUX_PLUGIN_MANAGER_PATH}/tpm/tpm"
# Set Cursor terminal override, so nvim can change cursor style when changing modes #####################
# more info see nvim, :help tui-cursor-shape ## 3. KEYBINDINGS ##
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q' #####################
## Begin theming > theme from github.com/jimeh/tmux-themepack, the powerline/default/blue theme. # 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 'top'
bind-key t split-window -h 'vim ~/Documents/ROADMAP.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 ## It is integrated with prefix highlight for this tmux conf
# Status update interval # Status update interval