While using Ranger file manager, I tried to open any config file and for a little moment, the Terminal blinked saying:

bin/sh/ nano not found

But in the .bashrc file, nvim is defined as $EDITOR. Where can I configure shell default editors in sh?

1 Answer 1


You can try using update-alternatives to change your default Editor. Here is the command you need.

sudo update-alternatives --config editor

Here is the expected output:

There are 5 choices for the alternative editor (providing /usr/bin/editor).

  Selection    Path                Priority   Status
* 0            /bin/nano            40        auto mode
  1            /bin/ed             -100       manual mode
  2            /bin/nano            40        manual mode
  3            /usr/bin/code        0         manual mode
  4            /usr/bin/vim.basic   30        manual mode
  5            /usr/bin/vim.tiny    15        manual mode

Press <enter> to keep the current choice[*], or type selection number: 

Just enter the selection number of nvim and it should work.

  • thanks for your respons but my cli says: update-alternatives error: no alternatives for editor. In addition i can say that i launch ranger trough hotkey using alacritty -e ranger. When i using ranger like this the error described above appears, but when i launch ranger by myself trough alacritty everything works and nvim launches
    – byena
    Commented Apr 26 at 8:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .