From 4566314b111ce08f3e47b5488bf3f502e518bf21 Mon Sep 17 00:00:00 2001 From: Erystasius Date: Thu, 2 Apr 2026 00:38:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20fish=20=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=20SUDO=5FEDITOR=20=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=BB=A5=E6=94=AF=E6=8C=81=E4=BD=BF=E7=94=A8=20vim=20?= =?UTF-8?q?=E6=88=96=20vi=20=E8=BF=9B=E8=A1=8C=20sudo=20=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dot_config/fish/config.fish | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dot_config/fish/config.fish b/dot_config/fish/config.fish index f0fd699..3b229d0 100644 --- a/dot_config/fish/config.fish +++ b/dot_config/fish/config.fish @@ -27,12 +27,15 @@ if status is-interactive type -q zoxide; and zoxide init --cmd=cd fish | source # ========= 编辑器/查看器(优先 vim,否则 vi)========= + # SUDO_EDITOR:供 visudo / sudoedit 等使用;若仍打开 nano,需在 sudoers 中加 Defaults env_keep += "SUDO_EDITOR" if type -q vim set -gx EDITOR vim set -gx VISUAL vim + set -gx SUDO_EDITOR vim else if type -q vi set -gx EDITOR vi set -gx VISUAL vi + set -gx SUDO_EDITOR vi end # ========= fastfetch:启动信息显示 =========