2

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?

slm
  • 363,520
  • 117
  • 767
  • 871
Amanda
  • 1,709
  • 2
  • 13
  • 26
  • 1
    do 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
  • 2
    There'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
  • 1
    A related question is https://unix.stackexchange.com/questions/410668/ . – JdeBP Jul 17 '18 at 10:32

1 Answers1

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"
Amanda
  • 1,709
  • 2
  • 13
  • 26
slm
  • 363,520
  • 117
  • 767
  • 871
  • 1
    And 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
  • @dirkt let's see if it works for the OP first – slm Jul 17 '18 at 11:14
  • 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