nige123 / jmp.nigelhamilton.com

jmp - search files and jump to matching lines in a text editor
Other
13 stars 4 forks source link

Use EDITOR env #7

Open tmtvl opened 5 years ago

tmtvl commented 5 years ago

A number of cli utilities use the EDITOR environment variable to choose an editor to launch (e.g. visudo, sudoedit, systemctl --edit,...). Maybe we can check if it's defined during install and set the initial config accordingly. That should also help prevent jmp config from launching nano if it isn't installed.

nige123 commented 5 years ago

jmp relies on opening an editor at a specific line number. Unfortunately editors don't use consistent command line options to open at a specific line.

tmtvl commented 5 years ago

Yeah, but there are a few predefined, so couldn't we compare %*ENV{'EDITOR'} to the existing declarations and go from there?

nige123 commented 5 years ago

Yes - I'm open to that. Pull requests welcome! ;-)