natecraddock / workspaces.nvim

a simple plugin to manage workspace directories in neovim
MIT License
309 stars 15 forks source link

Consider not changing directories #16

Closed stellarhoof closed 1 year ago

stellarhoof commented 1 year ago

I have :tcd as a use-case instead of :cd or :lcd. The way this plugin is structured, it'd need to add something like a cd_cmd to the options to accommodate the three cd commands. However, at that point, it would simplify the API to simply let the user cd themselves on a hook. Thoughts?

natecraddock commented 1 year ago

Hi! Sorry for the delay in replying.

I'm thinking to perhaps add a new option cd_command that defaults to :cd, but can also be set to :lcd or :tcd. I wouldn't remove the current global_cd option to preserve backwards compatibility.

If cd_command is set, then global_cd would be ignored. If global_cd is set, then true maps to :cd and false maps to :lcd.

I think this would be enough, though I am open to adding a hook. If you still think a hook would be better, could you explain more what it would be used for? Thanks!

stellarhoof commented 1 year ago

No new hook, the user can leverage the existing open hook for this (https://github.com/natecraddock/workspaces.nvim/blob/master/lua/workspaces/init.lua#L333-L341)

natecraddock commented 1 year ago

@stellarhoof I just pushed an update that adds a new cd_type config option that may be set to "tab". Let me know if that doesn't resolve the issue!

stellarhoof commented 1 year ago

That works. Thanks :)