From 0495c17c21eba580418c35b5ad2141fc98428b35 Mon Sep 17 00:00:00 2001 From: xfy Date: Tue, 8 Apr 2025 08:32:35 +0800 Subject: [PATCH] update tmux config --- kitty/kitty.conf | 4 ++-- rua-scripts/common.sh | 2 +- tmux/tmux.conf | 9 ++++++--- tmux/tmux.server.conf | 23 +++++++++++++++++++++++ zsh/zshrc | 3 ++- 5 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 tmux/tmux.server.conf diff --git a/kitty/kitty.conf b/kitty/kitty.conf index 7538efd..3e98005 100644 --- a/kitty/kitty.conf +++ b/kitty/kitty.conf @@ -18,8 +18,8 @@ tab_bar_style custom tab_powerline_style round tab_title_template "{index}: {title[title.rfind('/')+1:]}" -background_opacity 0.94 -background_blur 66 +background_opacity 0.93 +background_blur 37 macos_option_as_alt true macos_show_window_title_in none diff --git a/rua-scripts/common.sh b/rua-scripts/common.sh index a5ca75a..987707e 100644 --- a/rua-scripts/common.sh +++ b/rua-scripts/common.sh @@ -11,7 +11,7 @@ oha_url() { mac-update() { brew update && brew upgrade && brew cleanup && - rustup update && rustup self update + rustup update && rustup self update && vim-update } arch-update() { diff --git a/tmux/tmux.conf b/tmux/tmux.conf index 6ca790a..d453284 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -72,11 +72,14 @@ bind C-r source-file ~/.tmux.conf \; display "Config reloaded" bind c new-window -c "#{pane_current_path}" # Prompt to rename window right after it's created -set-hook -g after-new-window 'command-prompt -I "#{window_name}" "rename-window '%%'"' +# set-hook -g after-new-window 'command-prompt -I "#{window_name}" "rename-window '%%'"' +set-hook -g after-new-window 'command-prompt -I "" "rename-window '%%'"' # Rename session and window -bind r command-prompt -I "#{window_name}" "rename-window '%%'" -bind R command-prompt -I "#{session_name}" "rename-session '%%'" +# bind r command-prompt -I "#{window_name}" "rename-window '%%'" +# bind R command-prompt -I "#{session_name}" "rename-session '%%'" +bind r command-prompt -I "" "rename-window '%%'" +bind R command-prompt -I "" "rename-session '%%'" # Split panes bind | split-window -h -c "#{pane_current_path}" diff --git a/tmux/tmux.server.conf b/tmux/tmux.server.conf new file mode 100644 index 0000000..fe38d43 --- /dev/null +++ b/tmux/tmux.server.conf @@ -0,0 +1,23 @@ +set -g base-index 1 +setw -g pane-base-index 1 + +setw -g mode-keys vi + +bind p paste-buffer +bind C-p choose-buffer +bind -T copy-mode-vi v send -X begin-selection + +# trigger copy mode by +bind -n C-y copy-mode + +# Scroll up/down by 1 line, half screen, whole screen +# bind -T copy-mode-vi C-k send-keys -X scroll-up +# bind -T copy-mode-vi C-j send-keys -X scroll-down +bind -T copy-mode-vi M-PageUp send-keys -X halfpage-up +bind -T copy-mode-vi M-PageDown send-keys -X halfpage-down +bind -T copy-mode-vi PageDown send-keys -X page-down +bind -T copy-mode-vi PageUp send-keys -X page-up + +# When scrolling with mouse wheel, reduce number of scrolled rows per tick to "2" (default is 5) +bind -T copy-mode-vi WheelUpPane select-pane \; send-keys -X -N 2 scroll-up +bind -T copy-mode-vi WheelDownPane select-pane \; send-keys -X -N 2 scroll-down diff --git a/zsh/zshrc b/zsh/zshrc index c714cd2..d544fb9 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -5,7 +5,8 @@ source $ZSH/oh-my-zsh.sh alias icat="kitty +kitten icat" alias kssh="kitty +kitten ssh" -alias ll="ls -lhtr" +# alias ll="ls -lhtr" +alias ll="lsd -AlhtrF" alias vi="/usr/bin/vim" alias vim="nvim" alias vim-update='nvim --headless "+Lazy! update" +qa'