mirror of
https://github.com/rydesun/dotfiles.git
synced 2025-12-26 14:44:58 +08:00
Update zsh conf: auto nvim cwd
This commit is contained in:
parent
1f40612d87
commit
33d40faca1
1 changed files with 10 additions and 1 deletions
|
|
@ -226,7 +226,7 @@ alias V='nvim -R -c "nnoremap q :exit<CR>" -c "set signcolumn=no laststatus=0" \
|
|||
-c "silent write! /tmp/pager_buffer" \
|
||||
-c "term cat /tmp/pager_buffer; rm /tmp/pager_buffer; cat"' &&
|
||||
compdef V=nvim # 使用neovim作为pager,支持ANSI code
|
||||
if [[ -e $VIMRUNTIME ]]; then
|
||||
if [[ -e $NVIM_LISTEN_ADDRESS ]]; then
|
||||
alias e='nvr'
|
||||
else
|
||||
alias e='nvim' && compdef e=nvim
|
||||
|
|
@ -240,4 +240,13 @@ alias rg='kitty +kitten hyperlinked_grep'
|
|||
alias mountdisk="mount | grep -E '^(/dev/sd|/dev/nvme|/dev/mmcblk|gvfsd-fuse)' | awk '{print \$1 \"\t\" \$5 \"\t\" \$3 \"\n\t\t\" \$6}'"
|
||||
# >>>-----------------------------------
|
||||
|
||||
# neovim终端中的zsh自动设置neovim的工作目录
|
||||
if [[ -e $NVIM_LISTEN_ADDRESS ]]; then
|
||||
function nvim_lcd() {
|
||||
emulate -L zsh
|
||||
nvr +"lcd $PWD"
|
||||
}
|
||||
chpwd_functions=(${chpwd_functions[@]} "nvim_lcd")
|
||||
fi
|
||||
|
||||
# vim: foldmethod=marker:foldmarker=<<<---,>>>---
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue