From 2579d9ff17c40bbec33de73b9720a5cffb51ee19 Mon Sep 17 00:00:00 2001 From: Jedrzej Orbik Date: Fri, 25 Oct 2024 15:29:41 +0200 Subject: [PATCH] Set mouse and right status to host in tmux --- scripts/debian/install_min.sh | 13 +++++++++---- stow/common/dot-tmux.conf | 9 +++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/scripts/debian/install_min.sh b/scripts/debian/install_min.sh index 188c142..353e915 100755 --- a/scripts/debian/install_min.sh +++ b/scripts/debian/install_min.sh @@ -69,7 +69,7 @@ function install_node() { [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm # add nvm to .zshrc with string does not exists after the installation if ! grep -Fxq 'export NVM_DIR="$HOME/.nvm"' $HOME/.zshrc; then - sudo tee -a $HOME/.zshrc >/dev/null <<'EOT' + tee -a $HOME/.zshrc >/dev/null <<'EOT' # Load nvm export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm @@ -169,7 +169,7 @@ function install_yazi_source() { cd .. && rm -rf yazi if ! grep -Fxq 'function ya() {' $HOME/.zshrc; then - sudo tee -a $HOME/.zshrc >/dev/null <<'EOT' + tee -a $HOME/.zshrc >/dev/null <<'EOT' function ya() { tmp="$(mktemp -t "yazi-cwd.XXXXX")" yazi "$@" --cwd-file="$tmp" @@ -259,7 +259,7 @@ sudo apt install ripgrep -y || true "$SCRIPT_DIR/../set_up_common.sh" if ! grep -q "unsetopt BEEP" $HOME/.zshrc; then - sudo tee -a $HOME/.zshrc >/dev/null <<'EOT' + tee -a $HOME/.zshrc >/dev/null <<'EOT' if command -v nvim &> /dev/null; then alias vim=nvim export EDITOR=nvim @@ -297,7 +297,12 @@ sudo locale-gen en_US sudo locale-gen en_US.UTF-8 # .tmux.conf -grep -qxF 'set-option -g default-shell /bin/zsh' $HOME/.tmux.conf || echo "set-option -g history-limit 125000\nset-option -g default-shell /bin/zsh" >>$HOME/.tmux.conf +grep -qF 'default-shell /bin/zsh' "$HOME/.tmux.conf" || cat << EOF >> "$HOME/.tmux.conf" +set -g history-limit 125000 +set -g default-shell /bin/zsh +set -g mouse on +set -g status-right " \"#{=21:host}\" %H:%M %d-%b-%y" +EOF # set up thefuck if ! command -v thefuck &>/dev/null; then diff --git a/stow/common/dot-tmux.conf b/stow/common/dot-tmux.conf index dac75a9..2c7672f 100644 --- a/stow/common/dot-tmux.conf +++ b/stow/common/dot-tmux.conf @@ -1,5 +1,5 @@ -set-option -g history-limit 125000 -set-option -g default-shell /bin/zsh +set -g history-limit 125000 +set -g default-shell /bin/zsh bind-key "T" run-shell "sesh connect \"$( sesh list | fzf-tmux -p 55%,60% \ @@ -31,6 +31,7 @@ setw -g automatic-rename on # rename window to reflect current program set -g renumber-windows on # renumber windows when a window is closed set -g status-left-length 20 set -g status-style 'bg=#333333 fg=#5eacd3' +set -g status-right " \"#{=21:host}\" %H:%M %d-%b-%y" # vim-like pane switching bind -r ^ last-window @@ -54,7 +55,7 @@ bind-key @ choose-window 'join-pane -h -s "%%"' bind-key C-@ choose-window 'join-pane -s "%%"' bind-key ! break-pane -t : set -g repeat-time 300 -set-option -g default-terminal "tmux-256color" +set -g default-terminal "tmux-256color" set -sa terminal-overrides ",*:RGB" # utf8/color hack set -sa terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support set -sa terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colors - needs tmux-3.0 @@ -72,7 +73,7 @@ bind-key D switch -t default bind -n C-l send-keys C-l \; run-shell "sleep .2s" \; clear-history if-shell -b '[ `tmux -V | cut -d" " -f2 | tr -d " |\-|.|[:alpha:]"` -ge 33 ]' \ - 'set-option -g allow-passthrough on' + 'set -g allow-passthrough on' # seamless navigation between nvim and tmux based on https://www.reddit.com/r/vim/comments/c11cad/comment/eran9h5/ is_vim="ps -o state= -o comm= -t '#{pane_tty}' \