update tmux config

This commit is contained in:
xfy
2025-04-08 08:32:35 +08:00
parent c9a8899588
commit 0495c17c21
5 changed files with 34 additions and 7 deletions

View File

@ -18,8 +18,8 @@ tab_bar_style custom
tab_powerline_style round tab_powerline_style round
tab_title_template "{index}: {title[title.rfind('/')+1:]}" tab_title_template "{index}: {title[title.rfind('/')+1:]}"
background_opacity 0.94 background_opacity 0.93
background_blur 66 background_blur 37
macos_option_as_alt true macos_option_as_alt true
macos_show_window_title_in none macos_show_window_title_in none

View File

@ -11,7 +11,7 @@ oha_url() {
mac-update() { mac-update() {
brew update && brew upgrade && brew cleanup && brew update && brew upgrade && brew cleanup &&
rustup update && rustup self update rustup update && rustup self update && vim-update
} }
arch-update() { arch-update() {

View File

@ -72,11 +72,14 @@ bind C-r source-file ~/.tmux.conf \; display "Config reloaded"
bind c new-window -c "#{pane_current_path}" bind c new-window -c "#{pane_current_path}"
# Prompt to rename window right after it's created # 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 # Rename session and window
bind r command-prompt -I "#{window_name}" "rename-window '%%'" # bind r command-prompt -I "#{window_name}" "rename-window '%%'"
bind R command-prompt -I "#{session_name}" "rename-session '%%'" # 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 # Split panes
bind | split-window -h -c "#{pane_current_path}" bind | split-window -h -c "#{pane_current_path}"

23
tmux/tmux.server.conf Normal file
View File

@ -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

View File

@ -5,7 +5,8 @@ source $ZSH/oh-my-zsh.sh
alias icat="kitty +kitten icat" alias icat="kitty +kitten icat"
alias kssh="kitty +kitten ssh" alias kssh="kitty +kitten ssh"
alias ll="ls -lhtr" # alias ll="ls -lhtr"
alias ll="lsd -AlhtrF"
alias vi="/usr/bin/vim" alias vi="/usr/bin/vim"
alias vim="nvim" alias vim="nvim"
alias vim-update='nvim --headless "+Lazy! update" +qa' alias vim-update='nvim --headless "+Lazy! update" +qa'