Ubuntu – `update-alternatives –list editor` does not show editors installed via `snap`

snapupdate-alternatives

$ update-alternatives --list editor
/bin/nano
/usr/bin/code
/usr/bin/vim.tiny

update-alternatives --list editor does not show nvim which I installed using snap. Even though my PATH variable contains /snap/bin. How do I fix this?

Best Answer

Not all packages register themselves as an alternative. You can manually add nvim as an alternative for editor using update-alternatives.

sudo update-alternatives --install /usr/bin/editor editor /snap/bin/nvim 1111