From 779d37f158548fd6d74d7aea6916bbcb32ee5194 Mon Sep 17 00:00:00 2001 From: rootiest Date: Fri, 8 Nov 2024 12:47:50 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Deploy(tmux):=20initial=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .tmux/plugins/tpm | 1 + plugins/catppuccin/tmux | 1 + plugins/tmux | 1 + plugins/tmux-battery | 1 + plugins/tmux-bitwarden | 1 + plugins/tmux-cpu | 1 + plugins/tmux-cpu-info | 1 + plugins/tmux-resurrect | 1 + plugins/tmux-sensible | 1 + plugins/tmux-weather | 1 + plugins/tpm | 1 + tmux.conf | 122 ++++++++++++++++++++++++++++++++++++++++ 12 files changed, 133 insertions(+) create mode 160000 .tmux/plugins/tpm create mode 160000 plugins/catppuccin/tmux create mode 160000 plugins/tmux create mode 160000 plugins/tmux-battery create mode 160000 plugins/tmux-bitwarden create mode 160000 plugins/tmux-cpu create mode 160000 plugins/tmux-cpu-info create mode 160000 plugins/tmux-resurrect create mode 160000 plugins/tmux-sensible create mode 160000 plugins/tmux-weather create mode 160000 plugins/tpm create mode 100644 tmux.conf diff --git a/.tmux/plugins/tpm b/.tmux/plugins/tpm new file mode 160000 index 0000000..99469c4 --- /dev/null +++ b/.tmux/plugins/tpm @@ -0,0 +1 @@ +Subproject commit 99469c4a9b1ccf77fade25842dc7bafbc8ce9946 diff --git a/plugins/catppuccin/tmux b/plugins/catppuccin/tmux new file mode 160000 index 0000000..5a1748e --- /dev/null +++ b/plugins/catppuccin/tmux @@ -0,0 +1 @@ +Subproject commit 5a1748ebc63db8d69b266a023a5f03ac35e7b256 diff --git a/plugins/tmux b/plugins/tmux new file mode 160000 index 0000000..5a1748e --- /dev/null +++ b/plugins/tmux @@ -0,0 +1 @@ +Subproject commit 5a1748ebc63db8d69b266a023a5f03ac35e7b256 diff --git a/plugins/tmux-battery b/plugins/tmux-battery new file mode 160000 index 0000000..48fae59 --- /dev/null +++ b/plugins/tmux-battery @@ -0,0 +1 @@ +Subproject commit 48fae59ba4503cf345d25e4e66d79685aa3ceb75 diff --git a/plugins/tmux-bitwarden b/plugins/tmux-bitwarden new file mode 160000 index 0000000..5b1b668 --- /dev/null +++ b/plugins/tmux-bitwarden @@ -0,0 +1 @@ +Subproject commit 5b1b668cb38fa1e8f0e320ea013a301cb1090499 diff --git a/plugins/tmux-cpu b/plugins/tmux-cpu new file mode 160000 index 0000000..bcb110d --- /dev/null +++ b/plugins/tmux-cpu @@ -0,0 +1 @@ +Subproject commit bcb110d754ab2417de824c464730c412a3eb2769 diff --git a/plugins/tmux-cpu-info b/plugins/tmux-cpu-info new file mode 160000 index 0000000..349d4ee --- /dev/null +++ b/plugins/tmux-cpu-info @@ -0,0 +1 @@ +Subproject commit 349d4ee2103b24b5393cc179cd174709a5ac6826 diff --git a/plugins/tmux-resurrect b/plugins/tmux-resurrect new file mode 160000 index 0000000..cff343c --- /dev/null +++ b/plugins/tmux-resurrect @@ -0,0 +1 @@ +Subproject commit cff343cf9e81983d3da0c8562b01616f12e8d548 diff --git a/plugins/tmux-sensible b/plugins/tmux-sensible new file mode 160000 index 0000000..25cb91f --- /dev/null +++ b/plugins/tmux-sensible @@ -0,0 +1 @@ +Subproject commit 25cb91f42d020f675bb0a2ce3fbd3a5d96119efa diff --git a/plugins/tmux-weather b/plugins/tmux-weather new file mode 160000 index 0000000..28a5fbe --- /dev/null +++ b/plugins/tmux-weather @@ -0,0 +1 @@ +Subproject commit 28a5fbe75bb25a408193d454304e28ddd75e9338 diff --git a/plugins/tpm b/plugins/tpm new file mode 160000 index 0000000..99469c4 --- /dev/null +++ b/plugins/tpm @@ -0,0 +1 @@ +Subproject commit 99469c4a9b1ccf77fade25842dc7bafbc8ce9946 diff --git a/tmux.conf b/tmux.conf new file mode 100644 index 0000000..24face0 --- /dev/null +++ b/tmux.conf @@ -0,0 +1,122 @@ +# Enable mouse mode +set -g mouse on + +# Smart pane switching with awareness of Vim splits. +# See: https://github.com/christoomey/vim-tmux-navigator + +# decide whether we're in a Vim process +is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ + | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" + +bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L' +bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D' +bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U' +bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R' + +tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")' + +if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \ + "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'" +if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \ + "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'" + +bind-key -n 'C-Space' if-shell "$is_vim" 'send-keys C-Space' 'select-pane -t:.+' + +bind-key -T copy-mode-vi 'C-h' select-pane -L +bind-key -T copy-mode-vi 'C-j' select-pane -D +bind-key -T copy-mode-vi 'C-k' select-pane -U +bind-key -T copy-mode-vi 'C-l' select-pane -R +bind-key -T copy-mode-vi 'C-\' select-pane -l +bind-key -T copy-mode-vi 'C-Space' select-pane -t:.+ + +# List of plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-cpu' +set -g @plugin 'tmux-plugins/tmux-battery' +set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @plugin 'xamut/tmux-weather' +set -g @plugin 'jdx/tmux-cpu-info' +set -g @plugin 'catppuccin/tmux' +set -g @plugin 'Alkindi42/tmux-bitwarden' +set -g @catppuccin_flavour 'mocha' # latte,frappe, macchiato or mocha + +# Options to make tmux more pleasant +set -g mouse on +set -g default-terminal "wezterm" +set -as terminal-features ",wezterm*:RGB" +set -g history-limit 20000 + +# Bitwarden +#set -g @bw-session 'BW_SESSION' +set -g @bw-copy-to-clipboard 'on' + +# Clipboard integration +bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "wl-copy && wl-paste -n | wl-copy -p" +bind-key p run "wl-paste -n | tmux load-buffer - ; tmux paste-buffer" + +# Easy splits +bind-key "|" split-window -h -c "#{pane_current_path}" +bind-key "\\" split-window -fh -c "#{pane_current_path}" + +bind-key "-" split-window -v -c "#{pane_current_path}" +bind-key "_" split-window -fv -c "#{pane_current_path}" + +bind -r "<" swap-window -d -t -1 +bind -r ">" swap-window -d -t +1 + +# Mouse scroll +set -g mouse on +bind -n WheelUpPane { + if -F '#{==:#{window_name},nvim}' { + send-keys -M + } { + copy-mode -e + } +} + +### tmux-resurrect ### +# Restore vim/nvim sessions +set -g @resurrect-strategy-vim 'session' +set -g @resurrect-strategy-nvim 'session' +# Capture pane contents +set -g @resurrect-capture-pane-contents 'on' + +# Apply theme +set -g @catppuccin_window_status_style "rounded" +set -g @catppuccin_window_number_position "right" + +set -g @catppuccin_window_default_fill "all" +set -g @catppuccin_window_default_text "#W" + +set -g @catppuccin_window_current_fill "all" +set -g @catppuccin_window_current_text "#W" + +set -g @catppuccin_status_left_separator " " +set -g @catppuccin_status_right_separator "" +set -g @catppuccin_status_fill "all" +set -g @catppuccin_status_connect_separator "no" + +set -g @catppuccin_directory_text "#{pane_current_path}" + +run '~/.config/tmux/plugins/catppuccin/tmux/catppuccin.tmux' + +set -g status-left-length 420 +set -g status-right-length 420 + +# Run catppuccin plugin manually or through tpm +# ... + +# set -g status-left "" +set -g status-left '#(tmux-cpu-info)' +set -g status-right "#{E:@catppuccin_status_directory}" +set -ag status-right "#{E:@catppuccin_status_user}" +set -ag status-right "#{E:@catppuccin_status_host}" +set -ag status-right "#{E:@catppuccin_status_session}" + +# Allow passthrough for neovim +set-option -g allow-passthrough on + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run '~/.config/tmux/plugins/tpm/tpm' +