From 960495c8f1b0f8bec5c430eecd4d2992e02fc392 Mon Sep 17 00:00:00 2001 From: Florian Schmitt Date: Sat, 30 Dec 2023 12:23:49 +0300 Subject: [PATCH] feat : tmux config --- configs/tmux/plugins/tpm | 1 + configs/tmux/tmux.conf | 60 ++++++++++++++++++++++++++++++++++++ configs/tmux/tmux.reset.conf | 38 +++++++++++++++++++++++ modules/console.nix | 1 + modules/home-config.nix | 5 +++ 5 files changed, 105 insertions(+) create mode 160000 configs/tmux/plugins/tpm create mode 100644 configs/tmux/tmux.conf create mode 100644 configs/tmux/tmux.reset.conf diff --git a/configs/tmux/plugins/tpm b/configs/tmux/plugins/tpm new file mode 160000 index 0000000..99469c4 --- /dev/null +++ b/configs/tmux/plugins/tpm @@ -0,0 +1 @@ +Subproject commit 99469c4a9b1ccf77fade25842dc7bafbc8ce9946 diff --git a/configs/tmux/tmux.conf b/configs/tmux/tmux.conf new file mode 100644 index 0000000..629dd48 --- /dev/null +++ b/configs/tmux/tmux.conf @@ -0,0 +1,60 @@ +source-file ~/.config/tmux/tmux.reset.conf +set-option -g default-terminal 'screen-254color' +set-option -g terminal-overrides ',xterm-256color:RGB' + +set -g prefix ^A +set -g base-index 1 # start indexing windows at 1 instead of 0 +set -g detach-on-destroy off # don't exit from tmux when closing a session +set -g escape-time 0 # zero-out escape time delay +set -g history-limit 1000000 # increase history size (from 2,000) +set -g renumber-windows on # renumber all windows when any window is closed +set -g set-clipboard on # use system clipboard +set -g status-position top # macOS / darwin style +set -g default-terminal "${TERM}" +setw -g mode-keys vi +set -g pane-active-border-style 'fg=magenta,bg=default' +set -g pane-border-style 'fg=brightblack,bg=default' + +#bind-key -r B run-shell "~/.config/tmux/scripts/sessionizer.sh ~/omerxx/omerxx.com" + +set -g @fzf-url-fzf-options '-p 60%,30% --prompt=" " --border-label=" Open URL "' +set -g @fzf-url-history-limit '2000' + +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-yank' +set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @plugin 'tmux-plugins/tmux-continuum' +set -g @plugin 'fcsonline/tmux-thumbs' +set -g @plugin 'sainnhe/tmux-fzf' +set -g @plugin 'wfxr/tmux-fzf-url' +set -g @plugin 'omerxx/catppuccin-tmux' # My fork that holds the meetings script bc I'm lazy af +set -g @plugin 'omerxx/tmux-sessionx' + +set -g @sessionx-bind 'o' +set -g @sessionx-x-path '~/dotfiles' +set -g @sessionx-window-height '85%' +set -g @sessionx-window-width '75%' +set -g @sessionx-zoxide-mode 'on' +set -g @continuum-restore 'on' +set -g @resurrect-strategy-nvim 'session' +set -g @catppuccin_window_left_separator "" +set -g @catppuccin_window_right_separator " " +set -g @catppuccin_window_middle_separator " █" +set -g @catppuccin_window_number_position "right" +set -g @catppuccin_window_default_fill "number" +set -g @catppuccin_window_default_text "#W" +set -g @catppuccin_window_current_fill "number" +set -g @catppuccin_window_current_text "#W#{?window_zoomed_flag,(),}" +set -g @catppuccin_status_modules_right "directory meetings date_time" +set -g @catppuccin_status_modules_left "session" +set -g @catppuccin_status_left_separator " " +set -g @catppuccin_status_right_separator " " +set -g @catppuccin_status_right_separator_inverse "no" +set -g @catppuccin_status_fill "icon" +set -g @catppuccin_status_connect_separator "no" +set -g @catppuccin_directory_text "#{b:pane_current_path}" +set -g @catppuccin_meetings_text "#($HOME/.config/tmux/scripts/cal.sh)" +set -g @catppuccin_date_time_text "%H:%M" + +run '~/.config/tmux/plugins/tpm/tpm' diff --git a/configs/tmux/tmux.reset.conf b/configs/tmux/tmux.reset.conf new file mode 100644 index 0000000..596454c --- /dev/null +++ b/configs/tmux/tmux.reset.conf @@ -0,0 +1,38 @@ +# First remove *all* keybindings +# unbind-key -a +# Now reinsert all the regular tmux keys +bind ^X lock-server +bind ^C new-window -c "$HOME" +bind ^D detach +bind * list-clients + +bind H previous-window +bind L next-window + +bind r command-prompt "rename-window %%" +bind R source-file ~/.config/tmux/tmux.conf +bind ^A last-window +bind ^W list-windows +bind w list-windows +bind z resize-pane -Z +bind ^L refresh-client +bind l refresh-client +bind | split-window +bind s split-window -v -c "#{pane_current_path}" +bind v split-window -h -c "#{pane_current_path}" +bind '"' choose-window +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R +bind -r -T prefix , resize-pane -L 20 +bind -r -T prefix . resize-pane -R 20 +bind -r -T prefix - resize-pane -D 7 +bind -r -T prefix = resize-pane -U 7 +bind : command-prompt +bind * setw synchronize-panes +bind P set pane-border-status +bind c kill-pane +bind x swap-pane -D +bind S choose-session +bind-key -T copy-mode-vi v send-keys -X begin-selection diff --git a/modules/console.nix b/modules/console.nix index e53c572..c2422d5 100644 --- a/modules/console.nix +++ b/modules/console.nix @@ -32,6 +32,7 @@ enable = true; autosuggestions.enable = true; shellAliases = { + tmux = "tmux -f ~/.config/tmux/tmux.conf"; ls = "lsd --hyperlink=auto"; icat = "kitty +kitten icat"; nixedit = "vi /etc/nixos"; diff --git a/modules/home-config.nix b/modules/home-config.nix index bc9e580..1f7a681 100644 --- a/modules/home-config.nix +++ b/modules/home-config.nix @@ -74,6 +74,11 @@ in { recursive = true; }; + "./.config/tmux/" = { + source = ../configs/tmux; + recursive = true; + }; + # Treesitter is configured as a locally developed module in lazy.nvim # we hardcode a symlink here so that we can refer to it in our lazy config "./.local/share/nvim/nix/nvim-treesitter/" = {