consolodate with develop

This commit is contained in:
psox 2021-11-04 15:11:58 +00:00
parent 29a95ec965
commit b6adf06830
3 changed files with 45 additions and 46 deletions

View file

@ -1,32 +1,12 @@
# Plugins # Plugins
set-environment -g TMUX_PLUGIN_MANAGER_PATH "$TMUX_PLUGINS" set-environment -g TMUX_PLUGIN_MANAGER_PATH "$TMUX_PLUGINS"
set -g @plugin 'tmux-plugins/tpm' if "test -f ~/.config/tmux/plugins.conf" {
set -g @plugin 'tmux-plugins/tmux-prefix-highlight' source-file ~/.config/tmux/plugins.conf
set -g @prefix_highlight_prefix_prompt 'Pre' }
set -g @prefix_highlight_fg 'yellow'
set -g @prefix_highlight_bg 'default'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-yank'
# Integration with vim-tmux-navigator & fzf if "test -f ~/.config/tmux/early.conf" {
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ source-file ~/.config/tmux/early.conf
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" }
is_fzf="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?fzf$'"
bind -n C-M-Left run "($is_vim && tmux send-keys C-h) \
|| tmux select-pane -L"
bind -n C-M-Down run "($is_vim && tmux send-keys C-j) \
|| ($is_fzf && tmux send-keys C-j) \
|| tmux select-pane -D"
bind -n C-M-Up run "($is_vim && tmux send-keys C-k) \
|| ($is_fzf && tmux send-keys C-k) \
|| tmux select-pane -U"
bind -n C-M-Right run "($is_vim && tmux send-keys C-l) \
|| tmux select-pane -R"
bind-key -T copy-mode-vi 'C-M-Left' select-pane -L
bind-key -T copy-mode-vi 'C-M-Down' select-pane -D
bind-key -T copy-mode-vi 'C-M-Up' select-pane -U
bind-key -T copy-mode-vi 'C-M-Right' select-pane -R
set-option -g prefix C-a set-option -g prefix C-a
set-option -g set-titles on set-option -g set-titles on
@ -69,5 +49,9 @@ bind - last-window \; swap-pane -s tmux-zoom.0 \; kill-window -t tmux-zoom
# prefix + / to search # prefix + / to search
bind-key / copy-mode \; send-key ? bind-key / copy-mode \; send-key ?
if "test -f ~/.config/tmux/late.conf" {
source-file ~/.config/tmux/late.conf
}
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b "$TMUX_PLUGINS/tpm/tpm" run -b "$TMUX_PLUGINS/tpm/tpm"

22
vimrc
View file

@ -289,10 +289,10 @@ if has_key(plugs, 'coc.nvim') && executable("node")
xmap <silent> <leader>/ <Plug>(coc-codeaction-selected) xmap <silent> <leader>/ <Plug>(coc-codeaction-selected)
" rename symbol " rename symbol
nnoremap <silent> <leader>rn <Plug>(coc-rename) nmap <silent> <leader>rn <Plug>(coc-rename)
" goto definition / references " goto definition / references
nnoremap <silent> <leader>gd <Plug>(coc-definition) nmap <silent> <leader>gd <Plug>(coc-definition)
nnoremap <silent> <leader>gr <Plug>(coc-references) nmap <silent> <leader>gr <Plug>(coc-references)
" Use tab for trigger completion with characters ahead and navigate. " Use tab for trigger completion with characters ahead and navigate.
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by " NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
@ -367,11 +367,21 @@ if has_key(plugs, 'fzf.vim')
\ fzf#vim#files(<q-args>, fzf#vim#with_preview({'source': 'rg --files --hidden --glob "!**/.git/**" ' }), <bang>0) \ fzf#vim#files(<q-args>, fzf#vim#with_preview({'source': 'rg --files --hidden --glob "!**/.git/**" ' }), <bang>0)
endif endif
nnoremap <silent> <A-g> :Rg<CR> nnoremap <A-g> :Rg
nnoremap <leader><A-g> :Rg!
nnoremap <silent> <A-S-g> :Rg<CR>
nnoremap <silent> <leader><A-S-g> :Rg!<CR>
endif endif
nnoremap <silent> <A-f> :Files<CR> nnoremap <A-f> :Files
nnoremap <silent> <A-b> :Buffers<CR> nnoremap <leader><A-f> :Files!
nnoremap <silent> <A-S-f> :Files<CR>
nnoremap <silent> <leader><A-S-f> :Files!<CR>
nnoremap <A-b> :Buffers
nnoremap <leader><A-b> :Buffers!
nnoremap <silent> <A-S-b> :Buffers<CR>
nnoremap <silent> <leader><A-S-b> :Buffers!<CR>
endif endif
" Vim Tmux unified movement " Vim Tmux unified movement

33
zshrc
View file

@ -15,7 +15,10 @@ typeset -U PATH path fpath
path=( /bin /sbin /usr/bin /usr/sbin $path ) path=( /bin /sbin /usr/bin /usr/sbin $path )
[[ -d ~/bin ]] && path=( ~/bin $path ) [[ -d ~/bin ]] && path=( ~/bin $path )
# sdkman support
[[ -f ~/.sdkman/bin/sdkman-init.sh ]] && source ~/.sdkman/bin/sdkman-init.sh [[ -f ~/.sdkman/bin/sdkman-init.sh ]] && source ~/.sdkman/bin/sdkman-init.sh
# nvm
[[ -f /usr/share/nvm/init-nvm.sh ]] && source /usr/share/nvm/init-nvm.sh [[ -f /usr/share/nvm/init-nvm.sh ]] && source /usr/share/nvm/init-nvm.sh
# jaesve support # jaesve support
@ -148,25 +151,26 @@ source $PSOXIZSH/zsh-custom/zshnip/zshnip.zsh
( which nvim &>/dev/null ) && export EDITOR='nvim' ( which nvim &>/dev/null ) && export EDITOR='nvim'
# Set zsh tmux config path # Set zsh tmux config path
if which tmux &>/dev/null; then if which tmux &>/dev/null
for tmux_config in {~/.config/tmux,~/.tmux,/etc/tmux}; do then
if [ -d "$tmux_config" ]; then
TMUX_PATH="$tmux_config"
break
fi
done
[ -z "$TMUX_PATH" ] && TMUX_PATH=~/.config/tmux [ -z "$TMUX_PATH" ] && TMUX_PATH=~/.config/tmux
export TMUX_PATH=$TMUX_PATH
[ -d "$TMUX_PATH" ] && [ -d "$TMUX_PATH/plugins" ] || { mkdir -vp $TMUX_PATH && cp -r $PSOXIZSH/tmux/. $TMUX_PATH } # Bootstrap the user's plugin directory, if required
# If a .conf is detected override the default zsh tmux path [ -d "$TMUX_PATH/plugins" ] || { mkdir -vp "$TMUX_PATH/plugins" && cp -r "$PSOXIZSH/tmux/plugins" "$TMUX_PATH/plugins" }
[ -f "$TMUX_PATH/tmux.conf" ] && export ZSH_TMUX_CONFIG="$TMUX_PATH/tmux.conf"
export TMUX_PLUGINS="$TMUX_PATH/plugins" # Both tmux and TPM are very opininated about where configs must live,
# and TPM will only expand one layer of source-file directives, so we
# symlink the base config to the user local config file, if it doesn't
# exist.
[ ! -f ~/.tmux.conf ] && ln -s $PSOXIZSH/tmux/tmux.conf ~/.tmux.conf
[ ! -f "$TMUX_PATH/plugins.conf" ] && ln -s "$PSOXIZSH/tmux/fragment/plugins.conf" "$TMUX_PATH/plugins.conf"
export TMUX_PATH=$TMUX_PATH TMUX_PLUGINS="$TMUX_PATH/plugins" TMUX_CONFIG=~/.tmux.conf
fi fi
if which fzf &>/dev/null; then if which fzf &>/dev/null
then
# Press ? inside a C-r search to get a preview window, useful for long commands # Press ? inside a C-r search to get a preview window, useful for long commands
export FZF_CTRL_R_OPTS="--preview 'echo {}' --preview-window down:3:hidden:wrap --bind '?:toggle-preview'" export FZF_CTRL_R_OPTS="--preview 'echo {}' --preview-window down:3:hidden:wrap --bind '?:toggle-preview'"
which tmux &> /dev/null && export FZF_TMUX=1 which tmux &> /dev/null && export FZF_TMUX=1
@ -203,7 +207,8 @@ setopt no_bang_hist cdable_vars auto_name_dirs
# Finally, make sure the terminal is in application mode, when zle is # Finally, make sure the terminal is in application mode, when zle is
# active. Only then are the values from $terminfo valid. # active. Only then are the values from $terminfo valid.
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} ))
then
function zle-line-init () { function zle-line-init () {
echoti smkx echoti smkx
} }