From 7037ac3cbe99dcaf4b2b0ac1ec14de67fa6198cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Mon, 8 May 2023 19:15:57 +0200 Subject: [PATCH] Update TMUX config --- install.sh | 6 ++--- tmux/.tmux.conf | 48 ---------------------------------- tmux/tmux.conf | 69 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 51 deletions(-) delete mode 100644 tmux/.tmux.conf create mode 100644 tmux/tmux.conf diff --git a/install.sh b/install.sh index c7641a7..9022970 100755 --- a/install.sh +++ b/install.sh @@ -144,7 +144,7 @@ if $TMUX; then apt install -y $dependencies fi - ln -s $PWD/tmux/.tmux.conf $HOME/.tmux.conf - git clone https://github.com/tmux-plugins/tpm $HOME/.tmux/plugins/tpm - $HOME/.tmux/plugins/tpm/bin/install_plugins + ln -s $PWD/tmux $XDG_CONFIG_HOME/tmux + git clone https://github.com/tmux-plugins/tpm $XDG_DATA_HOME/tmux/plugins/tpm + $XDG_DATA_HOME/tmux/plugins/tpm/bin/install_plugins fi diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf deleted file mode 100644 index 3ce0540..0000000 --- a/tmux/.tmux.conf +++ /dev/null @@ -1,48 +0,0 @@ -# Renumber windows of one is closed: 0,1,2 -> 0,1 instead of 0,2 -set-option -g renumber-windows on -# Use vi keybindings in copy mode -set-window-option -g mode-keys vi -bind-key -T copy-mode-vi 'v' send -X begin-selection -bind-key -T copy-mode-vi 'y' send -X copy-selection - -# Use C-a as prefix -unbind C-b -set-option -g prefix C-a -bind-key C-a send-prefix - -# More visual split commands -bind | split-window -h -c "#{pane_current_path}" -bind - split-window -v -c "#{pane_current_path}" -bind c new-window -c "#{pane_current_path}" -unbind '"' -unbind % - -# Allow to use the mouse -set -g mouse on - -# theme -set -g @themepack 'powerline/double/blue' - -# Allow using ctrl + arrow keys -set-option -g xterm-keys on - -# status bar -# set -g status-right '#{net_speed} | #{prefix_highlight} #{battery_icon}#{battery_percentage} | %a %h-%d %H:%M' -set-window-option -g status-left " #S " -set-window-option -g status-right " #{prefix_highlight} \"#(hostname)\" %H:%M %d-%b-%y " -set-window-option -g window-status-format " #I: #W " -set-window-option -g window-status-current-format " #I: #W " - -# Plugins (Keep this last) -set -g @plugin 'tmux-plugins/tpm' -set -g @plugin 'tmux-plugins/tmux-copycat' -set -g @plugin 'tmux-plugins/tmux-open' -set -g @plugin 'tmux-plugins/tmux-prefix-highlight' -set -g @plugin 'tmux-plugins/tmux-sensible' -set -g @plugin 'tmux-plugins/tmux-yank' -set -g @plugin 'laktak/extrakto' -set -g @plugin 'jimeh/tmux-themepack' -set -g @plugin 'christoomey/vim-tmux-navigator' -run '~/.tmux/plugins/tpm/tpm' -#ZSH -set -g default-shell /bin/zsh diff --git a/tmux/tmux.conf b/tmux/tmux.conf new file mode 100644 index 0000000..adddec0 --- /dev/null +++ b/tmux/tmux.conf @@ -0,0 +1,69 @@ +set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.local/share/tmux/plugins' + +# Use vi keybindings in copy mode +set-window-option -g mode-keys vi +bind-key -T copy-mode-vi 'v' send -X begin-selection +bind-key -T copy-mode-vi 'y' send -X copy-selection + +# Use C-a as prefix +unbind C-b +set-option -g prefix C-a +bind-key C-a send-prefix + +# More visual split commands +bind | split-window -h -c "#{pane_current_path}" +bind - split-window -v -c "#{pane_current_path}" +bind c new-window -c "#{pane_current_path}" +unbind '"' +unbind % + +# Allow to use the mouse +set -g mouse on + +# theme +set -g @themepack 'powerline/double/blue' + +# Allow using ctrl + arrow keys +set-option -g xterm-keys on + +# status bar +# set -g status-right '#{net_speed} | #{prefix_highlight} #{battery_icon}#{battery_percentage} | %a %h-%d %H:%M' +set-window-option -g status-left " #S " +set-window-option -g status-right " #{prefix_highlight} \"#(hostname)\" %H:%M %d-%b-%y " +set-window-option -g window-status-format " #I: #W " +set-window-option -g window-status-current-format " #I: #W " + +# Set title suffix to "- TMUX" +# set-option -g set-titles on +# set-option -g set-titles-string '#S: #W - TMUX' +# # Smart pane switching with awareness of vim splits and system windows +# is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" +# bind -n C-Left if-shell "$is_vim" "send-keys C-h" "run-shell 'sh ~/.config/awesome/awesomewm-vim-tmux-navigator/tmux_focus.sh left'" +# bind -n C-Down if-shell "$is_vim" "send-keys C-j" "run-shell 'sh ~/.config/awesome/awesomewm-vim-tmux-navigator/tmux_focus.sh down'" +# bind -n C-Up if-shell "$is_vim" "send-keys C-k" "run-shell 'sh ~/.config/awesome/awesomewm-vim-tmux-navigator/tmux_focus.sh up'" +# bind -n C-Right if-shell "$is_vim" "send-keys C-l" "run-shell 'sh ~/.config/awesome/awesomewm-vim-tmux-navigator/tmux_focus.sh right'" +# bind-key -T copy-mode-vi 'C-Left' "run-shell 'sh ~/.config/awesome/awesomewm-vim-tmux-navigator/tmux_focus.sh left'" +# bind-key -T copy-mode-vi 'C-Down' "run-shell 'sh ~/.config/awesome/awesomewm-vim-tmux-navigator/tmux_focus.sh down'" +# bind-key -T copy-mode-vi 'C-Up' "run-shell 'sh ~/.config/awesome/awesomewm-vim-tmux-navigator/tmux_focus.sh up'" +# bind-key -T copy-mode-vi 'C-Right' "run-shell 'sh ~/.config/awesome/awesomewm-vim-tmux-navigator/tmux_focus.sh right'" + +# Extrakto +# set -g @extrakto_split_direction v +# set -g @extrakto_split_size 15 + +# Plugins (Keep this last) +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'christoomey/vim-tmux-navigator' +# set -g @plugin 'tmux-plugins/tmux-copycat' +# set -g @plugin 'tmux-plugins/tmux-open' +# set -g @plugin 'tmux-plugins/tmux-prefix-highlight' +# set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-yank' +# set -g @plugin 'laktak/extrakto' +set -g @plugin 'jimeh/tmux-themepack' +run '~/.local/share/tmux/plugins/tpm/tpm' +#ZSH +set -g default-shell /bin/zsh + +# colors +set-option -sa terminal-overrides ',screen-256color:RGB'