ahmedkhalf / project.nvim

The superior project management solution for neovim.
Apache License 2.0
1.35k stars 131 forks source link

autochdir (nor any other global vim opt) should not be set by this plugin #110

Open myarcana opened 1 year ago

myarcana commented 1 year ago

https://github.com/ahmedkhalf/project.nvim/blob/628de7e433dd503e782831fe150bb750e56e55d6/lua/project_nvim/config.lua#L60

There should at least be a config option to allow the user to turn this on or off, just like manual_mode

ahmedkhalf commented 1 year ago

Why?

pillmuncher commented 1 year ago

Because some people like autochdir. Is there technical reason that project.nvim must disable autochdir?

javalsai commented 3 months ago

Because some people like autochdir. Is there technical reason that project.nvim must disable autochdir?

Just had an issue in which this plugin didn't work due to enabling autochdir after the plug. It basically overwrites the project root set by the plugin each time you open a file, making the default automatic mode basically useless.

I think that the only case in which you might want to have autochdir active along with this plugin is if you're just going to use the plugin manually or if the plugin doesn't find a project root automatically. But I think this isn't the case for most users of the plugin.

ekorchmar commented 2 months ago

I think that the only case in which you might want to have autochdir active along with this plugin is if you're just going to use the plugin manually or if the plugin doesn't find a project root automatically. But I think this isn't the case for most users of the plugin.

This is absolutely the case for the most users of plugin. Not all files we edit belong to projects, nor should they. Sometimes it is a bunch of config files in an unusual location; this plugin silently setting noautochdir causes breaking behavior.

javalsai commented 2 months ago

I think that the only case in which you might want to have autochdir active along with this plugin is if you're just going to use the plugin manually or if the plugin doesn't find a project root automatically. But I think this isn't the case for most users of the plugin.

This is absolutely the case for the most users of plugin. Not all files we edit belong to projects, nor should they. Sometimes it is a bunch of config files in an unusual location; this plugin silently setting noautochdir causes breaking behavior.

Not gonna argue if it's the most popular case or not anyways, I still believe so. But you can just re-set it after loading the plugin?