~ $ echo $EDITOR
/usr/bin/kak
~ $ sudo echo $EDITOR
/usr/bin/kak
~ $ su
Password:
/home/myusername $ echo $EDITOR
/usr/bin/kak
/home/myusername $ cat ~/.profile
# nvim editor config
# export EDITOR='/usr/bin/nvim'
# kakoune editor config
export EDITOR='/usr/bin/kak'
export PAGER=$HOME/.bin/kakpager
export MANPAGER=$HOME/.bin/kakmanpager
/home/myusername cat ~/.zshenv
# nvim editor config
# export EDITOR='/usr/bin/nvim'
# kakoune editor config
export EDITOR='/usr/bin/kak'
export PAGER=$HOME/.bin/kakpager
export MANPAGER=$HOME/.bin/kakmanpager
...
/home/myusername $
but it still nano
答案1
维苏多和
Defaults env_keep += "EDITOR"
感谢 Sato Katsura 指出我