tmux config improvements
This commit is contained in:
+34
-14
@@ -3,9 +3,10 @@
|
|||||||
set -g escape-time 0
|
set -g escape-time 0
|
||||||
set -g default-terminal "screen-256color"
|
set -g default-terminal "screen-256color"
|
||||||
set -ag terminal-overrides ",xterm-256color:RGB"
|
set -ag terminal-overrides ",xterm-256color:RGB"
|
||||||
set -g history-limit 50000
|
set -g history-limit 150000
|
||||||
set -g display-time 3000
|
set -g display-time 3000
|
||||||
set -g status-interval 5
|
set -g status-interval 5
|
||||||
|
set -g focus-events on
|
||||||
|
|
||||||
# Start indexes at 1 instead of 0
|
# Start indexes at 1 instead of 0
|
||||||
set -g base-index 1
|
set -g base-index 1
|
||||||
@@ -20,31 +21,39 @@ set -g prefix C-a
|
|||||||
unbind C-b
|
unbind C-b
|
||||||
bind-key C-a send-prefix
|
bind-key C-a send-prefix
|
||||||
|
|
||||||
# Ctrl+A, then Ctrl+C, p/n to cycle windows (faster, can just hold ctrl)
|
|
||||||
bind C-p previous-window
|
|
||||||
bind C-n next-window
|
|
||||||
|
|
||||||
# Split windows with | and -
|
# Split windows with | and -
|
||||||
unbind %
|
unbind %
|
||||||
bind | split-window -h
|
bind | split-window -h -c "#{pane_current_path}"
|
||||||
|
|
||||||
unbind '"'
|
unbind '"'
|
||||||
bind - split-window -v
|
bind - split-window -v -c "#{pane_current_path}"
|
||||||
|
|
||||||
# Reload config
|
# Reload config
|
||||||
unbind r
|
unbind R
|
||||||
bind r source-file ~/.config/tmux/tmux.conf \; display "Config reloaded."
|
bind R source-file ~/.config/tmux/tmux.conf \; display "Config reloaded."
|
||||||
|
|
||||||
|
# Pane navigation
|
||||||
|
bind -n C-h select-pane -L
|
||||||
|
bind -n C-j select-pane -D
|
||||||
|
bind -n C-k select-pane -U
|
||||||
|
bind -n C-l select-pane -R
|
||||||
|
|
||||||
|
# Resize panes
|
||||||
|
bind -r h resize-pane -L 5
|
||||||
bind -r j resize-pane -D 5
|
bind -r j resize-pane -D 5
|
||||||
bind -r k resize-pane -U 5
|
bind -r k resize-pane -U 5
|
||||||
bind -r l resize-pane -R 5
|
bind -r l resize-pane -R 5
|
||||||
bind -r h resize-pane -L 5
|
|
||||||
|
|
||||||
|
# Fullscreen current pane
|
||||||
bind -r m resize-pane -Z
|
bind -r m resize-pane -Z
|
||||||
|
|
||||||
# create new windows in the same cwd
|
# create new windows in the same cwd
|
||||||
bind c new-window -c "#{pane_current_path}"
|
bind c new-window -c "#{pane_current_path}"
|
||||||
|
|
||||||
|
# Window navigation
|
||||||
|
bind -n C-p previous-window
|
||||||
|
bind -n C-n next-window
|
||||||
|
|
||||||
# Prompt to rename new windows on creation
|
# Prompt to rename new windows on creation
|
||||||
set-hook -g after-new-window 'command-prompt -I "#{window_pane}" "rename-window '%%'"'
|
set-hook -g after-new-window 'command-prompt -I "#{window_pane}" "rename-window '%%'"'
|
||||||
|
|
||||||
@@ -52,25 +61,36 @@ set -g mouse on
|
|||||||
|
|
||||||
set-window-option -g mode-keys vi
|
set-window-option -g mode-keys vi
|
||||||
|
|
||||||
|
unbind -T copy-mode-vi Space;
|
||||||
|
unbind -T copy-mode-vi Enter;
|
||||||
|
|
||||||
bind-key -T copy-mode-vi 'v' send -X begin-selection
|
bind-key -T copy-mode-vi 'v' send -X begin-selection
|
||||||
bind-key -T copy-mode-vi 'y' send -X copy-selection
|
bind-key -T copy-mode-vi 'y' send -X copy-selection
|
||||||
|
|
||||||
unbind -T copy-mode-vi MouseDragEnd1Pane
|
unbind -T copy-mode-vi MouseDragEnd1Pane
|
||||||
|
|
||||||
|
##########################
|
||||||
|
# Plugins
|
||||||
|
##########################
|
||||||
|
|
||||||
set -g @plugin 'tmux-plugins/tpm'
|
set -g @plugin 'tmux-plugins/tpm'
|
||||||
|
|
||||||
set -g @plugin 'christoomey/vim-tmux-navigator'
|
set -g @plugin 'christoomey/vim-tmux-navigator'
|
||||||
#set -g @plugin 'jimeh/tmux-themepack'
|
|
||||||
set -g @plugin 'nordtheme/tmux'
|
set -g @plugin 'nordtheme/tmux'
|
||||||
set -g @plugin 'thewtex/tmux-mem-cpu-load'
|
set -g @plugin 'thewtex/tmux-mem-cpu-load'
|
||||||
set -g @plugin 'tmux-plugins/tmux-yank'
|
set -g @plugin 'tmux-plugins/tmux-yank'
|
||||||
set -g @plugin 'tmux-plugins/tmux-resurrect' # persist tmux sessions across reboot
|
set -g @plugin 'tmux-plugins/tmux-resurrect' # persist tmux sessions across reboot
|
||||||
set -g @plugin 'tmux-plugins/tmux-continuum' # automatically saves session every 15 mins
|
set -g @plugin 'tmux-plugins/tmux-continuum' # automatically saves session every 15 mins
|
||||||
|
set -g @plugin 'laktak/extrakto' # fzf search in tmux (prefix+tab)
|
||||||
|
set -g @plugin 'sainnhe/tmux-fzf' # <prefix> F
|
||||||
|
set -g @plugin 'alexwforsythe/tmux-which-key' # <prefix><space>
|
||||||
|
|
||||||
#set -g @themepack 'powerline/default/cyan'
|
# Session restore options
|
||||||
|
set -g @continuum-boot 'on' # automatically start tmux session on boot
|
||||||
|
set -g @continuum-boot-options 'alacritty,fullscreen' # start tmux in fullscreen alacritty on macOS
|
||||||
set -g @continuum-restore 'on'
|
set -g @continuum-restore 'on'
|
||||||
set -g @resurrect-strategy-nvim 'session'
|
set -g @resurrect-strategy-nvim 'session'
|
||||||
set -g @resurrect-capture-pan-contents 'on'
|
set -g @resurrect-capture-pane-contents 'on'
|
||||||
set -g @resurrect-processes 'ssh' # space separated list of programs to restore
|
set -g @resurrect-processes 'ssh nvim man less tail btop htop vi vim' # space separated list of programs to restore
|
||||||
|
|
||||||
run '~/.config/tmux/plugins/tpm/tpm'
|
run '~/.config/tmux/plugins/tpm/tpm'
|
||||||
|
|||||||
Reference in New Issue
Block a user