mirror of
https://github.com/DictXiong/dotfiles.git
synced 2025-12-19 04:07:49 +08:00
tmux customization; tpm auto install; zsh key binding for HOME and END; .gitignore .zwc
This commit is contained in:
parent
41827d6955
commit
c52d8e2e50
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
*.zwc
|
||||
37
.tmux.conf2
37
.tmux.conf2
@ -1,4 +1,10 @@
|
||||
set -g prefix ^a
|
||||
set -g default-terminal "xterm-256color"
|
||||
|
||||
# plugins
|
||||
set -g @plugin 'https://hub.fastgit.xyz/thewtex/tmux-mem-cpu-load'
|
||||
set -g @plugin 'https://hub.fastgit.xyz/tmux-plugins/tmux-resurrect'
|
||||
run '~/.tmux/plugins/tpm/tpm'
|
||||
|
||||
# Use Alt-arrow keys to switch panes
|
||||
bind -n M-Left select-pane -L
|
||||
@ -10,4 +16,33 @@ bind -n M-Down select-pane -D
|
||||
bind -n S-Left previous-window
|
||||
bind -n S-Right next-window
|
||||
|
||||
bind-key r source-file ~/.tmux.conf \; display-message "tmux.conf reloaded"
|
||||
# '-' and '|' to split
|
||||
bind - split-window -v -c "#{pane_current_path}"
|
||||
bind | split-window -h -c "#{pane_current_path}"
|
||||
|
||||
# other key bindings
|
||||
bind r source-file ~/.tmux.conf \; display-message "tmux.conf reloaded"
|
||||
bind m run 'old=$(tmux show -gv mouse); new="off"; if [ "$old" = "off" ]; then new="on"; fi; tmux set -g mouse $new && tmux display-message toggle\ mouse\ mode\ $new'
|
||||
|
||||
# styles
|
||||
# status bar
|
||||
set -g monitor-activity on
|
||||
set -g bell-action any
|
||||
set -g status-position top
|
||||
set -g status-style fg=white,bg=colour241
|
||||
set -g status-interval 1
|
||||
set -g status-justify centre
|
||||
set -g status-left-length 23
|
||||
set -g status-left "#[fg=#f9f1a5]#(whoami)#[default]@#(hostname | sed 's/-ibd-ink//g')[#S]"
|
||||
set -g status-right-length 60
|
||||
set -g status-right "#[default]#(~/.tmux/plugins/tmux-mem-cpu-load/tmux-mem-cpu-load --averages-count 1 --interval 2)#[default] "
|
||||
set -ag status-right "#[default]#(uptime | cut -f 4-5 -d ' ' | cut -f 1 -d ',' | sed 's/ //g')"
|
||||
set -ag status-right " #[fg=white,bg=default]%H:%M:%S"
|
||||
set -g window-status-style fg=colour248
|
||||
set -g window-status-current-style fg=#f9f1a5,bg=colour237
|
||||
set -g window-status-activity-style fg=colour237,bg=colour248
|
||||
set -g window-status-bell-style fg=colour237,bg=colour214
|
||||
# panes and windows
|
||||
set -g pane-active-border-style fg=brightblue
|
||||
set -g window-style fg=colour248
|
||||
set -g window-active-style fg=white
|
||||
19
.zshrc2
19
.zshrc2
@ -61,6 +61,15 @@ antigen theme ${ZSH_THEME:-ys}
|
||||
antigen apply
|
||||
# end of antigen config
|
||||
|
||||
# install tmux tpm
|
||||
TMUX_TPM="$HOME/.tmux/plugins/tpm"
|
||||
command -v tmux > /dev/null 2>&1
|
||||
if [[ $? == 0 && ! -d "$TMUX_TPM" ]]; then
|
||||
git clone https://hub.fastgit.xyz/tmux-plugins/tpm "$TMUX_TPM"
|
||||
fi
|
||||
# end of tpm
|
||||
|
||||
|
||||
# functions
|
||||
export DOTFILES=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
|
||||
dfs()
|
||||
@ -86,3 +95,13 @@ alias "se"='sudo -sE'
|
||||
alias "pbd"='ping baidu.com'
|
||||
alias "p114"='ping 114.114.114.114'
|
||||
alias "p666"='ping6 2001:da8::666'
|
||||
|
||||
# key bindings
|
||||
bindkey "^b" beginning-of-line
|
||||
bindkey "^e" end-of-line
|
||||
bindkey "^[[H" beginning-of-line
|
||||
bindkey "^[[F" end-of-line
|
||||
bindkey "^[[1~" beginning-of-line
|
||||
bindkey "^[[4~" end-of-line
|
||||
bindkey "^[OH" beginning-of-line
|
||||
bindkey "^[OF" end-of-line
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user