130 lines
		
	
	
	
		
			4.1 KiB
		
	
	
	
		
			Cheetah
		
	
	
	
	
	
			
		
		
	
	
			130 lines
		
	
	
	
		
			4.1 KiB
		
	
	
	
		
			Cheetah
		
	
	
	
	
	
# Core options (https://github.com/tmux-plugins/tmux-sensible)
 | 
						|
#
 | 
						|
 | 
						|
# address vim mode switching delay (http://superuser.com/a/252717/65504)
 | 
						|
set -s escape-time 50
 | 
						|
 | 
						|
# increase scrollback buffer size
 | 
						|
set -g history-limit 50000
 | 
						|
 | 
						|
# tmux messages are displayed for 4 seconds
 | 
						|
set -g display-time 4000
 | 
						|
 | 
						|
 | 
						|
# screen-256 true color
 | 
						|
set -g default-terminal "screen-256color"
 | 
						|
set -ga terminal-overrides ",xterm-256color:Tc"
 | 
						|
 | 
						|
# focus events enabled for terminals that support them
 | 
						|
set -g focus-events on
 | 
						|
 | 
						|
# super useful when using "grouped sessions" and multi-monitor setup
 | 
						|
setw -g aggressive-resize on
 | 
						|
 | 
						|
# ===========================================================================
 | 
						|
# Other options
 | 
						|
 | 
						|
set -q -g status-utf8 on                  # expect UTF-8 (tmux lower than 2.2)
 | 
						|
setw -q -g utf8 on
 | 
						|
 | 
						|
set -g status on
 | 
						|
# refresh 'status-left' and 'status-right' more often
 | 
						|
set -g status-interval 5
 | 
						|
set -g status-justify left
 | 
						|
set -g status-position bottom
 | 
						|
set -g status-keys vi
 | 
						|
 | 
						|
# C-b is not acceptable -- Vim uses it
 | 
						|
set-option -g prefix C-a
 | 
						|
bind-key C-a last-window
 | 
						|
unbind-key C-b
 | 
						|
 | 
						|
set -g base-index 1         # start windows numbering at 1
 | 
						|
setw -g pane-base-index 1   # make pane numbering consistent with windows
 | 
						|
 | 
						|
set -g renumber-windows on # renumber windows when a window is closed
 | 
						|
 | 
						|
set -g set-titles on                        # set terminal title
 | 
						|
set -g set-titles-string '□ #S ● #I #W'
 | 
						|
 | 
						|
set -g display-panes-time 500 # slightly longer pane indicators display time
 | 
						|
 | 
						|
# Notifications
 | 
						|
setw -g monitor-activity on
 | 
						|
setw -g visual-activity on
 | 
						|
 | 
						|
# Auto rename
 | 
						|
set-option -g automatic-rename on 
 | 
						|
set-option -g automatic-rename-format '#{b;s/{{ .username }}/~/:pane_current_path}'
 | 
						|
 | 
						|
# Allows us to use C-a a [command] to send commands to a TMUX session inside 
 | 
						|
# another TMUX session
 | 
						|
bind-key a send-prefix
 | 
						|
 | 
						|
# Activity monitoring
 | 
						|
setw -g monitor-activity on
 | 
						|
set -g visual-activity on
 | 
						|
 | 
						|
# Split windows into panes: CTRL-A + h or v
 | 
						|
bind-key h split-window -v -c '#{pane_current_path}'
 | 
						|
bind-key v split-window -h -c '#{pane_current_path}'
 | 
						|
 | 
						|
# Set up resize-pane keys: ALT + left - right - down - up
 | 
						|
bind-key -n M-Left resize-pane -L 1
 | 
						|
bind-key -n M-Right resize-pane -R 1
 | 
						|
bind-key -n M-Down resize-pane -D 1
 | 
						|
bind-key -n M-Up resize-pane -U 1
 | 
						|
 | 
						|
# Switch windows: CTRL-ALT + left or right arrows
 | 
						|
bind-key -n C-M-Left previous-window
 | 
						|
bind-key -n C-M-Right next-window
 | 
						|
 | 
						|
set-window-option -g mode-keys vi
 | 
						|
 | 
						|
# -- copy mode -----------------------------------------------------------------
 | 
						|
 | 
						|
bind Enter copy-mode # enter copy mode
 | 
						|
 | 
						|
run -b 'tmux bind -t vi-copy v begin-selection 2> /dev/null || true'
 | 
						|
run -b 'tmux bind -T copy-mode-vi v send -X begin-selection 2> /dev/null || true'
 | 
						|
run -b 'tmux bind -t vi-copy C-v rectangle-toggle 2> /dev/null || true'
 | 
						|
run -b 'tmux bind -T copy-mode-vi C-v send -X rectangle-toggle 2> /dev/null || true'
 | 
						|
run -b 'tmux bind -t vi-copy y copy-selection 2> /dev/null || true'
 | 
						|
run -b 'tmux bind -T copy-mode-vi y send -X copy-selection-and-cancel 2> /dev/null || true'
 | 
						|
run -b 'tmux bind -t vi-copy Escape cancel 2> /dev/null || true'
 | 
						|
run -b 'tmux bind -T copy-mode-vi Escape send -X cancel 2> /dev/null || true'
 | 
						|
run -b 'tmux bind -t vi-copy H start-of-line 2> /dev/null || true'
 | 
						|
run -b 'tmux bind -T copy-mode-vi L send -X end-of-line 2> /dev/null || true'
 | 
						|
 | 
						|
# Move windows on the left (/) or on the right (*)
 | 
						|
bind-key / swap-window -t -1
 | 
						|
bind-key * swap-window -t +1
 | 
						|
 | 
						|
# define keystrokes to send favorite commands defined as env var
 | 
						|
# ALT-SHIFT-[number]
 | 
						|
bind-key M-1 send-keys "$FAVORITE_COMMAND1"
 | 
						|
bind-key M-2 send-keys "$FAVORITE_COMMAND2"
 | 
						|
bind-key M-3 send-keys "$FAVORITE_COMMAND3"
 | 
						|
bind-key M-4 send-keys "$FAVORITE_COMMAND4"
 | 
						|
 | 
						|
# sshm popup
 | 
						|
bind-key C-s display-popup -E -w 80% -d "#{pane_current_path}" "sshm"
 | 
						|
 | 
						|
# Reload tmux config
 | 
						|
unbind r
 | 
						|
bind r source-file ~/.tmux.conf \; display-message "tmux config reloaded!"
 | 
						|
 | 
						|
# plugin zap
 | 
						|
set -g @zap_key 's'              # default: 'z'
 | 
						|
set -g @zap_width '50%'          # default: '60%'
 | 
						|
set -g @zap_height '40%'         # default: '60%'
 | 
						|
 | 
						|
# Plugins
 | 
						|
set -g @plugin 'tmux-plugins/tpm'
 | 
						|
set -g @plugin 'articicestudio/nord-tmux'
 | 
						|
set -g @plugin 'AleckAstan/tmux-zap'
 | 
						|
 | 
						|
# run tpm
 | 
						|
run -b '~/.tmux/plugins/tpm/tpm'
 | 
						|
 | 
						|
# =========================== END OF FILE ===================================
 |