Skip to content

Commit

Permalink
Set mouse and right status to host in tmux
Browse files Browse the repository at this point in the history
  • Loading branch information
Jendker committed Oct 25, 2024
1 parent 3ed5680 commit 2579d9f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
13 changes: 9 additions & 4 deletions scripts/debian/install_min.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions stow/common/dot-tmux.conf
Original file line number Diff line number Diff line change
@@ -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% \
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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}' \
Expand Down

0 comments on commit 2579d9f

Please sign in to comment.