tmux: Clean up configuration
This commit is contained in:
parent
a665eb3ca7
commit
83d8398265
1 changed files with 26 additions and 70 deletions
|
@ -1,46 +1,15 @@
|
|||
# change the prefix from 'C-b' to 'M-a'
|
||||
unbind C-b
|
||||
set-option -g prefix M-a
|
||||
bind-key M-a send-prefix
|
||||
|
||||
# start with window 1 (instead of 0)
|
||||
set -g base-index 1
|
||||
|
||||
# start with pane 1
|
||||
set -g pane-base-index 1
|
||||
|
||||
# split panes using | and -, make sure they open in the same path
|
||||
bind | split-window -h -c "#{pane_current_path}"
|
||||
bind - split-window -v -c "#{pane_current_path}"
|
||||
|
||||
unbind '"'
|
||||
unbind %
|
||||
|
||||
# open new windows in the current path
|
||||
bind | split-window -h -c "#{pane_current_path}"
|
||||
bind - split-window -v -c "#{pane_current_path}"
|
||||
bind c new-window -c "#{pane_current_path}"
|
||||
|
||||
# reload config file
|
||||
bind r source-file ~/.config/tmux/tmux.conf \; display "Reloaded tmux.conf!"
|
||||
|
||||
# shorten command delay
|
||||
set -sg escape-time 1
|
||||
|
||||
# Increase scrollback buffer size
|
||||
set -g history-limit 131072
|
||||
|
||||
# don't rename windows automatically
|
||||
set-option -g allow-rename off
|
||||
|
||||
# mouse control (clickable windows, panes, resizable panes)
|
||||
set -g mouse on
|
||||
set -g focus-events on
|
||||
|
||||
# For clipboard
|
||||
set -g allow-passthrough on
|
||||
set -g set-clipboard on
|
||||
|
||||
# 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)?$'"
|
||||
|
||||
|
@ -60,13 +29,11 @@ bind-key -T copy-mode-vi 'C-Down' select-pane -D
|
|||
bind-key -T copy-mode-vi 'C-Up' select-pane -U
|
||||
bind-key -T copy-mode-vi 'C-Right' select-pane -R
|
||||
|
||||
# Pane resizing with arrow keys
|
||||
bind Left resize-pane -L 10
|
||||
bind Down resize-pane -D 10
|
||||
bind Up resize-pane -U 10
|
||||
bind Right resize-pane -R 10
|
||||
|
||||
# Move windows back/forward
|
||||
bind -n S-left swap-window -t -1
|
||||
bind -n S-right swap-window -t +1
|
||||
bind m command-prompt -p "Merge pane to:" "join-pane -t '%%'"
|
||||
|
@ -102,62 +69,51 @@ bind -T copy-mode-vi v send-keys -X begin-selection
|
|||
bind -T copy-mode-vi y send-keys -X copy-selection
|
||||
bind -T copy-mode-vi r send-keys -X rectangle-toggle
|
||||
|
||||
# Save scrollback buffer to a file
|
||||
bind S command-prompt -p 'Save history to filename:' -I '/tmp/tmux.history' 'capture-pane -S - -E -; save-buffer %1 ; delete-buffer'
|
||||
|
||||
# Session selector
|
||||
bind T display-popup -E "tmux switch-client -t (tmux list-sessions | fzf --exact | awk -F':' '{print $1}')"
|
||||
|
||||
# Last command output
|
||||
set -g base-index 1
|
||||
set -g pane-base-index 1
|
||||
set -g history-limit 131072
|
||||
set -g allow-rename off
|
||||
set -g mouse on
|
||||
set -g focus-events on
|
||||
set -g allow-passthrough on
|
||||
set -g set-clipboard on
|
||||
set -g default-terminal "tmux-256color"
|
||||
set -sg escape-time 1
|
||||
|
||||
set -g @command-capture-key t
|
||||
set -g @command-capture-prompt-pattern '] % '
|
||||
set -g @command-capture-editor-cmd 'nvim -R'
|
||||
|
||||
# Fuzzback
|
||||
set -g @fuzzback-popup 1
|
||||
set -g @fuzzback-popup-size '90%'
|
||||
|
||||
# This effects color rendering and typing on terminal.
|
||||
set-option -g default-terminal "tmux-256color"
|
||||
|
||||
## Status Bar settings
|
||||
# Gruvbox dark color scheme
|
||||
set-option -g status "on"
|
||||
# Default statusbar color
|
||||
set-option -g status-style bg=colour237,fg=colour223 # bg=bg1, fg=fg1
|
||||
# Default window title colors
|
||||
set-window-option -g window-status-style bg=colour214,fg=colour237 # bg=yellow, fg=bg1
|
||||
# Default window with an activity alert
|
||||
set-window-option -g window-status-activity-style bg=colour237,fg=colour248 # bg=bg1, fg=fg3
|
||||
# Active window title colors
|
||||
set-window-option -g window-status-current-style bg=red,fg=colour237 # fg=bg1
|
||||
# Pane border
|
||||
set-option -g pane-active-border-style fg=colour250 #fg2
|
||||
set-option -g pane-border-style fg=colour237 #bg1
|
||||
# Message infos
|
||||
set-option -g message-style bg=colour239,fg=colour223 # bg=bg2, fg=fg1
|
||||
# Writing commands inactive
|
||||
set-option -g message-command-style bg=colour239,fg=colour223 # bg=fg3, fg=bg1
|
||||
# Pane number display
|
||||
set-option -g display-panes-active-colour colour250 #fg2
|
||||
set-option -g display-panes-colour colour237 #bg1
|
||||
# Clock
|
||||
set-window-option -g clock-mode-colour colour109 #blue
|
||||
# Bell
|
||||
set-window-option -g window-status-bell-style bg=colour167,fg=colour235 # bg=red, fg=bg
|
||||
# Theme settings mixed with colors (unfortunately, but there is no cleaner way)
|
||||
set-option -g status-style bg=colour237,fg=colour223
|
||||
set-option -g pane-active-border-style fg=colour250
|
||||
set-option -g pane-border-style fg=colour237
|
||||
set-option -g message-style bg=colour239,fg=colour223
|
||||
set-option -g message-command-style bg=colour239,fg=colour223
|
||||
set-option -g display-panes-active-colour colour250
|
||||
set-option -g display-panes-colour colour237
|
||||
set-option -g status-justify "centre"
|
||||
set-option -g status-left-style none
|
||||
set-option -g status-left-length "80"
|
||||
set-option -g status-right-style none
|
||||
set-option -g status-right-length "80"
|
||||
set-window-option -g window-status-separator ""
|
||||
set-option -g status-left "#[bg=colour248,fg=colour237] #S #[bg=colour237,fg=colour241,nobold,noitalics,nounderscore]"
|
||||
set-option -g status-right "#[bg=colour248,fg=colour237] %H:%M "
|
||||
set-window-option -g window-status-style bg=colour214,fg=colour237
|
||||
set-window-option -g window-status-activity-style bg=colour237,fg=colour248
|
||||
set-window-option -g window-status-current-style bg=red,fg=colour237
|
||||
set-window-option -g clock-mode-colour colour109
|
||||
set-window-option -g window-status-bell-style bg=colour167,fg=colour235
|
||||
set-window-option -g window-status-separator ""
|
||||
set-window-option -g window-status-current-format "#[bg=colour214,fg=colour237,nobold,noitalics,nounderscore]#[bg=colour214,fg=colour239] #I #[bg=colour214,fg=colour239,bold] #W #[bg=colour237,fg=colour214,nobold,noitalics,nounderscore]"
|
||||
set-window-option -g window-status-format "#[bg=colour239,fg=colour237,noitalics]#[bg=colour239,fg=colour223] #I #[bg=colour239,fg=colour223] #W #[bg=colour237,fg=colour239,noitalics]"
|
||||
|
||||
# Plugins
|
||||
run-shell '~/.tmux/plugins/tmux-yank/yank.tmux'
|
||||
run-shell '~/.tmux/plugins/tmux-open/open.tmux'
|
||||
run-shell '~/.tmux/plugins/tmux-butler/tmux-butler.tmux'
|
||||
|
|
Loading…
Reference in a new issue