From b98eaae996503c202bb18c0e6ce5cfededb7e5b8 Mon Sep 17 00:00:00 2001 From: ignuki Date: Sat, 15 Feb 2025 11:31:51 +0100 Subject: [PATCH] fixes and tmux config structure --- tmux/.tmux.conf | 69 ++++++++++++++++++++++++++++++++----------------- zsh/.zshrc | 3 +++ 2 files changed, 49 insertions(+), 23 deletions(-) diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 2d52ca4..6256e8e 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -1,10 +1,13 @@ # List of plugins set -g @plugin 'tmux-plugins/tpm' -set -g @plugin 'tmux-plugins/tmux-sensible' -set -g @plugin 'tmux-plugins/tmux-resurrect' -set -g @plugin 'tmux-plugins/tmux-continuum' -set -g @plugin 'tmux-plugins/tmux-open' +############################################################################### +############################################################################### +### general config ### +############################################################################### +############################################################################### + +set -g @plugin 'tmux-plugins/tmux-sensible' bind r source-file ~/.tmux.conf \; display "Reloaded!" # Reload with ctrl-r set -sg escape-time 1 # quicker responses @@ -18,7 +21,6 @@ set-option -gw xterm-keys on bind-key -n C-t new-window bind-key -n C-S-t new-window -c '#{pane_current_path}' -# Pane splits should open to the same path as the current pane bind '"' split-window -v -c "#{pane_current_path}" bind % split-window -h -c "#{pane_current_path}" @@ -27,9 +29,6 @@ bind-key -n C-S-Up previous-window bind-key -n C-S-Left swap-window -t -1\; select-window -t -1 bind-key -n C-S-Right swap-window -t +1\; select-window -t +1 -# Smart pane switching with awareness of Vim splits. -# See: https://github.com/christoomey/vim-tmux-navigator - setw -g mode-keys vi set-option -g default-shell $SHELL @@ -40,14 +39,48 @@ set-option -ga terminal-features ",alacritty:usstyle" set-option -ga terminal-overrides ',alacritty:Tc' set -g default-terminal "alacritty" +############################################################################### +############################################################################### +### theme and misc plugins ### +############################################################################### +############################################################################### + set -g @plugin 'dracula/tmux' +set -g @dracula-plugins "git weather time continuum battery" +set -g @dracula-show-fahrenheit false +set -g @dracula-fixed-location "Madrid" +set -g @dracula-show-powerline false +set -g @dracula-transparent-powerline-bg true +set -g @dracula-military-time true +set -g @dracula-day-month true + +set -g @plugin 'ofirgall/tmux-window-name' + +set -g @tmux_window_name_substitute_sets "[('.+bash', 'bash'), ('cbonsai.+', 'cbonsai')]" +set -g @tmux_window_name_shells "['bash', 'fish', 'sh', 'zsh']" +set -g @tmux_window_dir_programs "['nvim', 'vim', 'vi', 'git', 'cbonsai']" +set -g @tmux_window_name_use_tilde "True" +set -g @tmux_window_name_max_name_len "100" + +set -g @plugin 'tmux-plugins/tmux-open' + +############################################################################### +############################################################################### +### tmux-continuum ### +############################################################################### +############################################################################### + +set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @plugin 'tmux-plugins/tmux-continuum' + set -g @resurrect-capture-pane-contents 'on' set -g @resurrect-dir '~/.tmux/resurrect/' set -g @continuum-save-interval '15' set -g @continuum-restore 'on' set -g @continuum-boot 'on' +set -g @dracula-continuum-mode countdown ### tmux-resurrect set -g @resurrect-save 'S' # prefix + Shift-s - save @@ -57,25 +90,15 @@ set -g @resurrect-strategy-nvim 'session' set -g @continuum-boot-options 'alacritty,fullscreen' -set -g @dracula-plugins "git weather time battery" -set -g @dracula-show-fahrenheit false -set -g @dracula-fixed-location "Madrid" -set -g @dracula-show-powerline false -set -g @dracula-transparent-powerline-bg true -set -g @dracula-military-time true -set -g @dracula-day-month true - -set -g @plugin 'ofirgall/tmux-window-name' -set -g @tmux_window_name_substitute_sets "[('.+bash', 'bash'), ('cbonsai.+', 'cbonsai')]" -set -g @tmux_window_name_shells "['bash', 'fish', 'sh', 'zsh']" -set -g @tmux_window_dir_programs "['nvim', 'vim', 'vi', 'git', 'cbonsai']" -set -g @tmux_window_name_use_tilde "True" -set -g @tmux_window_name_max_name_len "100" +############################################################################### +############################################################################### +### Nvim-tmux-navigation setup ### +############################################################################### +############################################################################### # decide whether we're in a Vim process is_vim="~/.is_vim.sh '#{pane_tty}'" - bind-key -n 'S-Left' if-shell "$is_vim" 'send-keys S-Left' 'select-pane -L' bind-key -n 'S-Down' if-shell "$is_vim" 'send-keys S-Down' 'select-pane -D' bind-key -n 'S-Up' if-shell "$is_vim" 'send-keys S-Up' 'select-pane -U' diff --git a/zsh/.zshrc b/zsh/.zshrc index facd212..be063f0 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -9,6 +9,9 @@ unsetopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the histo setopt SHARE_HISTORY # Share history between all sessions. bindkey '^R' history-incremental-search-backward +bindkey '^A' beginning-of-line +bindkey '^E' end-of-line +bindkey '^K' kill-line setopt AUTO_PUSHD # Push the current directory visited on the stack. setopt PUSHD_IGNORE_DUPS # Do not store duplicates in the stack.