MordechaiHadad / bob

A version manager for neovim
MIT License
1.41k stars 36 forks source link

Q: is it possible to use `update-alternatives` with bob? #150

Closed rsb177 closed 1 year ago

rsb177 commented 1 year ago

Normally, i change my default editor via update-alternatives to neovim. I decided to try using bob to manage neovim for me, but when I tried setting vi to the nvim executable from bob, it acts like I just ran bob instead. Is there a way to do this via update-alternatives, or should i just alias instead?

MordechaiHadad commented 1 year ago

I have no idea what's update-alternatives

rsb177 commented 1 year ago

basically, a way to manage things like which editor I want to use when I type vi. Man Page Overview

MordechaiHadad commented 1 year ago

I see, can you show me how you set it up? Bob uses a proxy executable, if you rename bob to nvim it will execute neovim rather than bob.

rsb177 commented 1 year ago

I just ran sudo update-alternatives --install /usr/bin/vi vi /home/rsb177/.local/share/bob/nvim-bin/nvim 100. It looks like since it's a proxy executable, if I set up a symbolic link to it (as any name other than nvim), it'll always run bob. Was able to replicate this by just using simple symbolic links. So it looks like I'll need to stick with just using aliases if I want to use nvim for commands like vi, view, etc.

MordechaiHadad commented 1 year ago

@rsb177 what name does the update-alternatives gives the executable?

rsb177 commented 1 year ago

in the case of the command above, it shows up as vi

MordechaiHadad commented 1 year ago

oh, I guess you will have to alias it as you suggested :( due to bob using proxy to execute nvim.