epwalsh / epwalsh/obsidian.nvim
Config option for avoiding setup unless current working directory matches a vault path
- Dominant language
- Lua
- Stars
- 6.2k
- Forks
- 250
- PR merge metrics
- No merged PRs in 30d
Description
### 🚀 The feature, motivation and pitch
I love this plugin but I only want it to run when the current working directory matches a vault path when neovim is starting up. I don't want any of the completion, highlighting, or commands to be available when I'm looking through a README.md for some coding project, for example. I looked at the `setup` function and I think this could be achieved without any major refactoring. I'm willing to take a stab at a PR if this sounds like a welcome addition.
### Alternatives
I could take the vault table and assign it to a local variable outside of the setup function, then check if the working directory matches a vault path and conditionally call the `setup` function based on that. But I imagine that other users will want to contain this plugin's functionality to only their obsidian vaults as well.
### Additional context
_No response_
Contributor guide
Research direction
Start by reading the plugin's setup function and the startup path where it is called. Trace how vault paths and the current working directory are available, then define the configuration behavior for matching and non-matching directories. Done means completion, highlighting, and commands are unavailable outside configured vault paths while existing setup behavior remains unchanged inside them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100