tmux refactor

This commit is contained in:
thek4n 2024-03-27 00:54:29 +03:00
parent 70c7563638
commit 790e2a871a
4 changed files with 126 additions and 91 deletions

View File

@ -0,0 +1,67 @@
# vim: ft=tmux
set -g prefix C-b
# Zoom pane
bind -n M-f resize-pane -Z
# Panes navigation
bind -n M-h select-pane -L
bind -n M-l select-pane -R
bind -n M-j select-pane -D
bind -n M-k select-pane -U
# Windows navigation
bind -n C-M-h previous-window
bind -n C-M-l next-window
bind -n M-Tab last-window
bind -n M-1 new-window -n 1 -S
bind -n M-2 new-window -n 2 -S
bind -n M-3 new-window -n 3 -S
bind -n M-4 new-window -n 4 -S
bind -n M-5 new-window -n 5 -S
bind -n M-6 new-window -n 6 -S
bind -n M-7 new-window -n 7 -S
bind -n M-8 new-window -n 8 -S
bind -n M-9 new-window -n 9 -S
bind -n M-0 new-window -n 10 -S
# Windows splitting
bind -n M-Enter split-window -h -c "#{pane_current_path}"
bind | split-window -h -c "#{pane_current_path}"
bind \\ split-window -v -c "#{pane_current_path}"
# Copy mode
setw -g mode-keys vi
bind-key C-v copy-mod
bind p paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi c send-keys -X clear-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
bind-key -T copy-mode-vi V send-keys -X rectangle-toggle
# Lock screen
bind-key -T prefix C-x confirm-before -p "lock tmux? (y/n)" lock-session
# Reload config
bind r source-file ~/.config/tmux/tmux.conf \; display-message "Config reloaded..."
# Session managment
bind 1 source-file ~/.tmux/01.conf
bind 2 source-file ~/.tmux/02.conf
bind 3 source-file ~/.tmux/03.conf
bind 4 source-file ~/.tmux/04.conf
bind 5 source-file ~/.tmux/05.conf
bind 6 source-file ~/.tmux/06.conf
bind 7 source-file ~/.tmux/07.conf
bind 8 source-file ~/.tmux/08.conf
bind 9 source-file ~/.tmux/09.conf
bind 0 source-file ~/.tmux/10.conf

View File

@ -0,0 +1,27 @@
# vim: ft=tmux
set -s exit-empty off # Server will not exit if no active sessions
set -s exit-unattached off # Server will not exit if no attached clients
set -g mouse on # Enable mouse support
set -s escape-time 0 # Delay after escape
set -g repeat-time 0 # Disable multiple commands after prefix-key
set -g base-index 1 # Window numbering starts at 1
set -g pane-base-index 1 # Pane numbering starts at 1
set -g renumber-windows on # Make windows auto renumber
set -g history-limit 10000 # Scroll back history
setw -g aggressive-resize on # Resize windows on diff clients
set -g display-panes-time 4000 # Increase show pane time
set -g lock-command vlock # Shell command to lock client
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
set -g default-command 'tmux rename-window -t 1 1; $SHELL'

View File

@ -0,0 +1,28 @@
# vim: ft=tmux
set -g status-justify centre # center windows in statusline
set -g status-left-length 40
set -g status-left "[#S@#H]"
set -g status-right '%d.%m.%Y %H:%M'
set -g status-style 'bg=default,fg=white'
set -g window-status-style 'bg=default'
set -g window-status-current-style 'bg=white,fg=black bold'
set -g window-status-format '#W#{?window_flags,#{window_flags}, }'
set -g window-status-current-format '#W#{?window_flags,#{window_flags}, }'
set -g message-style 'fg=black bg=white bold'
set -g set-titles on
set -g set-titles-string '#S:#I.#P #W'
# clock style
setw -g clock-mode-colour green
setw -g clock-mode-style 24
set -g bell-action none
set -ga update-environment 'DISPLAY' # Maybe fix DISPLAY?

View File

@ -1,92 +1,5 @@
set -g prefix C-b
# vim: ft=tmux
set -s exit-empty off
set -s exit-unattached off
# pane navigation
bind | split-window -h -c "#{pane_current_path}"
bind \\ split-window -v -c "#{pane_current_path}"
bind -n M-Enter split-window -h -c "#{pane_current_path}"
bind -n M-h select-pane -L
bind -n M-l select-pane -R
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n C-M-h previous-window
bind -n C-M-l next-window
bind -n M-1 new-window -n 1 -S
bind -n M-2 new-window -n 2 -S
bind -n M-3 new-window -n 3 -S
bind -n M-4 new-window -n 4 -S
bind -n M-5 new-window -n 5 -S
bind -n M-6 new-window -n 6 -S
bind -n M-7 new-window -n 7 -S
bind -n M-8 new-window -n 8 -S
bind -n M-9 new-window -n 9 -S
bind -n M-0 new-window -n 10 -S
bind -n M-f resize-pane -Z
bind -n M-Tab last-window
set-option -ga terminal-overrides ",xterm-256color:Tc"
set -g status-justify centre
set -g status-left-length 40
set -g status-left "[#S@#H]"
set -g status-right '%d.%m.%Y %H:%M'
set -g status-style 'bg=default,fg=white'
set -g window-status-style 'bg=default'
set -g window-status-current-style 'bg=white,fg=black bold'
set -g window-status-format '#W#{?window_flags,#{window_flags}, }'
set -g window-status-current-format '#W#{?window_flags,#{window_flags}, }'
set -s escape-time 0
set -g message-style 'fg=black bg=white bold'
set-option -g bell-action none
set -g mouse on
set-option -g repeat-time 0
set -ga update-environment 'DISPLAY' # Maybe fix DISPLAY?
set -g base-index 1 ## Window numbering starts at 1
set -g pane-base-index 1 ## Pane numbering starts at 1
setw -g aggressive-resize on ## Aggressive windows: For screen size, of diff connections, on diff windows
set -g default-terminal "tmux-256color"
set -g history-limit 10000 ## Scroll back history
set -g display-panes-time 4000 ## Increase show pane time
set -g renumber-windows on ## Make windows auto renumber
set -g lock-command vlock
set -g default-command 'tmux rename-window -t 1 1; $SHELL'
bind r source-file ~/.config/tmux/tmux.conf \; display-message "Config reloaded..."
## Lock screen
bind-key -T prefix C-x confirm-before -p "lock tmux? (y/n)" lock-session
bind-key C-v copy-mod
setw -g mode-keys vi
bind p paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi c send-keys -X clear-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
bind-key -T copy-mode-vi V send-keys -X rectangle-toggle
set -g set-titles on
set -g set-titles-string '#S:#I.#P #W'
setw -g clock-mode-colour green
setw -g clock-mode-style 24
bind 1 source-file ~/.tmux/01.conf
bind 2 source-file ~/.tmux/02.conf
bind 3 source-file ~/.tmux/03.conf
bind 4 source-file ~/.tmux/04.conf
bind 5 source-file ~/.tmux/05.conf
bind 6 source-file ~/.tmux/06.conf
bind 7 source-file ~/.tmux/07.conf
bind 8 source-file ~/.tmux/08.conf
bind 9 source-file ~/.tmux/09.conf
bind 0 source-file ~/.tmux/10.conf
source-file "$XDG_CONFIG_HOME/tmux/mappings.conf"
source-file "$XDG_CONFIG_HOME/tmux/options.conf"
source-file "$XDG_CONFIG_HOME/tmux/style.conf"