I'm setting up a brand new computer and one quirk that I can't figure out is that neomutt is using nano as its default editor. My default editor is vim. Why wouldn't neomutt respect that?
Asked
Active
Viewed 1,758 times
2
-
1do you have `set editor` or `set visual` somewhere in the `(neo)?mutt` config? – thrig Jul 16 '18 at 23:17
-
How are you setting `vim` as your default editor? what does your shell show with `echo $EDITOR`? – Tim Kennedy Jul 16 '18 at 23:18
-
Sigh. I thought that it was set in `.bashrc` but it wasn't. Not sure why `edit whatever.txt` was defaulting to vim and neomutt to nano, but nothing was set explicitly. – Amanda Jul 17 '18 at 00:45
-
2There's a table of priorities here [1.3. Config Priority](https://neomutt.org/guide/configuration.html#1-3-%C2%A0config-priority); also iirc `$VISUAL` will take priority over `$EDITOR` – steeldriver Jul 17 '18 at 01:07
-
@steeldriver That's helpful. It's still kind of a mystery, as `$VISUAL` wasn't set either and per [the documentation](https://neomutt.org/guide/reference.html#3-71-%C2%A0editor) it should default to `vi`. So I still don't know where it was getting nano from. – Amanda Jul 17 '18 at 01:15
-
1A related question is https://unix.stackexchange.com/questions/410668/ . – JdeBP Jul 17 '18 at 10:32
1 Answers
3
neomutt should follow the table of priorities in their documentation to decide what editor to use.
You can set the editor explicitly by adding export EDITOR="/usr/bin/vim" to your .bashrc.
Alternatively, if you only want to set the editor for neomutt, you can add the following to ~/.neomuttrc:
set editor="/usr/bin/vim"
-
1And to add to that: The `export EDITOR=...` line should go into your shell profile (other programs might use it, too). – dirkt Jul 17 '18 at 06:29
-
-
Setting the editor explicitly in .bashrc worked to change the editor, but I'm still working on figuring out why it was defaulting to nano in the first place. – Amanda Jul 17 '18 at 14:30