简体   繁体   中英

How to set default text editor in ranger? My shell is fish

When I'm trying open some text document using ranger and having this error:

/bin/sh: line 1: vim: command not found

I have this strokes in config.fish:

set EDITOR "nvim"
set VISUAL "nvim"

I'm using fish as my shell. How can I set up default editor in ranger without changing rifle.conf?

Without any options the set command only sets variable locally and doesn't export it.

For global variables that should be exported (like the EDITOR variable should be) then use the -g and -x options:

set -gx EDITOR "nvim"
set -gx VISUAL "nvim"

The most important option is the -x option. From the previously linked reference:

Causes the specified shell variable to be exported to child processes ( making it an “environment variable” )

[Emphasis mine]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM