From 7515d6b576fe5f56462c5c2fdcc298c75b8c9dab Mon Sep 17 00:00:00 2001 From: Anton Bobov Date: Sat, 18 May 2024 00:29:17 +0500 Subject: [tmux] Move config into .config --- .gitmodules | 4 +-- files/.config/tmux/plugins/tpm | 1 + files/.config/tmux/tmux.conf | 80 ++++++++++++++++++++++++++++++++++++++++++ files/.tmux.conf | 80 ------------------------------------------ files/.tmux/plugins/tpm | 1 - install.conf.yaml | 7 ++-- 6 files changed, 85 insertions(+), 88 deletions(-) create mode 160000 files/.config/tmux/plugins/tpm create mode 100644 files/.config/tmux/tmux.conf delete mode 100644 files/.tmux.conf delete mode 160000 files/.tmux/plugins/tpm diff --git a/.gitmodules b/.gitmodules index 8927cd3..9cc0bb6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -17,8 +17,8 @@ [submodule "mutt-colors-solarized"] path = files/.mutt/mutt-colors-solarized url = https://github.com/altercation/mutt-colors-solarized -[submodule "files/.tmux/plugins/tpm"] - path = files/.tmux/plugins/tpm +[submodule " files/.config/tmux/plugins/tpm"] + path = files/.config/tmux/plugins/tpm url = https://github.com/tmux-plugins/tpm [submodule "dotbot"] path = dotbot diff --git a/files/.config/tmux/plugins/tpm b/files/.config/tmux/plugins/tpm new file mode 160000 index 0000000..99469c4 --- /dev/null +++ b/files/.config/tmux/plugins/tpm @@ -0,0 +1 @@ +Subproject commit 99469c4a9b1ccf77fade25842dc7bafbc8ce9946 diff --git a/files/.config/tmux/tmux.conf b/files/.config/tmux/tmux.conf new file mode 100644 index 0000000..5ba8335 --- /dev/null +++ b/files/.config/tmux/tmux.conf @@ -0,0 +1,80 @@ +# Inspired by https://github.com/willnorris/dotfiles/blob/main/tmux.conf + +# bind prefix to ^a +unbind C-b +set -g prefix ` +bind-key ` send-prefix + +## make window/pane index start with 1 +set -g base-index 1 +setw -g pane-base-index 1 +set -g renumber-windows on + +set -g set-titles on +set -g set-titles-string "#W @ #H[#S]" + +# disable auto rename of windows +set -g allow-rename off + +# enable mouse support +setw -g mouse on + +# watch background windows for activity and highlight status bar +set -g monitor-activity on + +## set vi mode for copy mode +#setw -g mode-keys vi +#unbind [ +#bind Escape copy-mode +#unbind p +#bind p paste-buffer +#bind -t vi-copy 'v' begin-selection +#bind -t vi-copy 't' copy-selection + +## +## Key bindings +## + +bind Space copy-mode + +# don't pre-fill with window or session original name when renaming +bind '$' command-prompt -p "(rename-session '#S')" "rename-session '%%'" +bind , command-prompt -p "(rename-window '#W')" "rename-window '%%'" + +# Move windows +if-shell -b '[ "$(echo "$TMUX_VERSION < 3.0" | bc)" = 1 ]' " \ + bind P swap-window -t -1; \ + bind N swap-window -t +1" +if-shell -b '[ "$(echo "$TMUX_VERSION >= 3.0" | bc)" = 1 ]' " \ + bind P { swap-window -t -1; select-window -t -1}; \ + bind N { swap-window -t +1; select-window -t +1}" + +#bind \ split-window -h -c '#{pane_current_path}' + +# toggle last 2 windows +bind Tab last-window +bind BTab swap-pane -t - + +# Status bar +set -g status-right "$USER@#h %H:%M" + +set -g @colors-solarized 'light' + +# To Install Plugin: + I +# To Uninstall Plugin: + + U + +if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local' + +# Plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'seebi/tmux-colors-solarized' +set -g @plugin 'christoomey/vim-tmux-navigator' +set -g @plugin 'tmux-plugins/tmux-pain-control' +set -g @plugin 'tmux-plugins/tmux-yank' +set -g @plugin 'tmux-plugins/tmux-copycat' +set -g @plugin 'tmux-plugins/tmux-open' +set -g @plugin 'tmux-plugins/tmux-resurrect' + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run '~/.config/tmux/plugins/tpm/tpm' diff --git a/files/.tmux.conf b/files/.tmux.conf deleted file mode 100644 index 6a3e389..0000000 --- a/files/.tmux.conf +++ /dev/null @@ -1,80 +0,0 @@ -# Inspired by https://github.com/willnorris/dotfiles/blob/main/tmux.conf - -# bind prefix to ^a -unbind C-b -set -g prefix ` -bind-key ` send-prefix - -## make window/pane index start with 1 -set -g base-index 1 -setw -g pane-base-index 1 -set -g renumber-windows on - -set -g set-titles on -set -g set-titles-string "#W @ #H[#S]" - -# disable auto rename of windows -set -g allow-rename off - -# enable mouse support -setw -g mouse on - -# watch background windows for activity and highlight status bar -set -g monitor-activity on - -## set vi mode for copy mode -#setw -g mode-keys vi -#unbind [ -#bind Escape copy-mode -#unbind p -#bind p paste-buffer -#bind -t vi-copy 'v' begin-selection -#bind -t vi-copy 't' copy-selection - -## -## Key bindings -## - -bind Space copy-mode - -# don't pre-fill with window or session original name when renaming -bind '$' command-prompt -p "(rename-session '#S')" "rename-session '%%'" -bind , command-prompt -p "(rename-window '#W')" "rename-window '%%'" - -# Move windows -if-shell -b '[ "$(echo "$TMUX_VERSION < 3.0" | bc)" = 1 ]' " \ - bind P swap-window -t -1; \ - bind N swap-window -t +1" -if-shell -b '[ "$(echo "$TMUX_VERSION >= 3.0" | bc)" = 1 ]' " \ - bind P { swap-window -t -1; select-window -t -1}; \ - bind N { swap-window -t +1; select-window -t +1}" - -#bind \ split-window -h -c '#{pane_current_path}' - -# toggle last 2 windows -bind Tab last-window -bind BTab swap-pane -t - - -# Status bar -set -g status-right "$USER@#h %H:%M" - -set -g @colors-solarized 'light' - -# To Install Plugin: + I -# To Uninstall Plugin: + + U - -if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local' - -# Plugins -set -g @plugin 'tmux-plugins/tpm' -set -g @plugin 'tmux-plugins/tmux-sensible' -set -g @plugin 'seebi/tmux-colors-solarized' -set -g @plugin 'christoomey/vim-tmux-navigator' -set -g @plugin 'tmux-plugins/tmux-pain-control' -set -g @plugin 'tmux-plugins/tmux-yank' -set -g @plugin 'tmux-plugins/tmux-copycat' -set -g @plugin 'tmux-plugins/tmux-open' -set -g @plugin 'tmux-plugins/tmux-resurrect' - -# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) -run '~/.tmux/plugins/tpm/tpm' diff --git a/files/.tmux/plugins/tpm b/files/.tmux/plugins/tpm deleted file mode 160000 index 99469c4..0000000 --- a/files/.tmux/plugins/tpm +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 99469c4a9b1ccf77fade25842dc7bafbc8ce9946 diff --git a/install.conf.yaml b/install.conf.yaml index 698158d..10de0e4 100644 --- a/install.conf.yaml +++ b/install.conf.yaml @@ -29,9 +29,6 @@ # Git ~/.gitconfig: files/.gitconfig ~/.gitignore: files/.gitignore - # Tmux - ~/.tmux.conf: files/.tmux.conf - ~/.tmux: files/.tmux/ # Vim ~/.vim: files/.vim ~/.vimrc: files/.vimrc @@ -50,8 +47,8 @@ - shell: - [git submodule update --init --recursive, Installing submodules] - command: | - ~/.tmux/plugins/tpm/bin/install_plugins - ~/.tmux/plugins/tpm/bin/update_plugins all + ~/.config/tmux/plugins/tpm/bin/install_plugins + ~/.config/tmux/plugins/tpm/bin/update_plugins all description: Installing tmux plugins - command: vim -E +PlugInstall +PlugUpdate +qa description: Install vim plugins -- cgit v1.2.3