I'd like to add nvim (a snap) to update-alternatives. The problem is that snap seems to work in mysterious ways when determining which program to run:
$ sudo update-alternatives --install /usr/bin/vim vim /snap/bin/nvim 60
$ vim # works
$ vim hello.txt
error: unknown command "hello.txt", see 'snap help'.
If I look at /snap/bin/nvim it is a link to /usr/bin/snap:
$ ls -lah /snap/bin/nvim
lrwxrwxrwx 1 root root 13 Jan 25 15:02 /snap/bin/nvim -> /usr/bin/snap
But how does the snap executable determine it needs to run nvim