使用:st、Ranger、vim、i3
对于大多数文件,当我使用 Ranger 打开它们时,它会在新窗口中打开。但是,当我尝试使用 vim 打开文件时,它会在当前运行 ranger 的当前终端中打开它。
我理解它为什么这样做,我只是没有找到如何在新终端中使用 vim(来自 Ranger)打开文件的预期结果。
您可以为此编辑游侠的步枪配置。Rifle 是 Ranger 的文件开启器。
ranger --copy-config=rifle.conf
Run Code Online (Sandbox Code Playgroud)
将默认步枪配置复制到~/.config/ranger/rifle.conf
然后更改rifle.conf中的行,其中说
mime ^text, label editor = ${VISUAL:-$EDITOR} -- "$@" to
mime ^text, label editor = nohup termite -e "${VISUAL:-$EDITOR} $@" >/dev/null &
Run Code Online (Sandbox Code Playgroud)
我使用白蚁终端模拟器。在您的情况下将其更改为st。
要一次打开多个文件,您可以使用
mime ^text, label editor = OPEN_WITH_TABS="${VISUAL:-$EDITOR} -p $@" && nohup termite -e "${OPEN_WITH_TABS}" >/dev/null &
Run Code Online (Sandbox Code Playgroud)