epwalsh / epwalsh/obsidian.nvim

Search/Tags to respect current workspace

Open
#689 0 comments 0 reactions 0 assignees View on GitHub
feature request
Dominant language
Lua
Stars
6.2k
Forks
250
PR merge metrics
No merged PRs in 30d

Description

### 🚀 The feature, motivation and pitch

If I have multiple workspaces, I was expecting that :ObsidianSearch and :ObsidianTags use only files from currently selected workspace. However, it currently searches the main workspace (or all, not sure).
I have a main vault for my general notes, but for every project I work on, I create _wiki folder in the root of it. I'm using dynamic workspaces which finds project_wiki_root and puts it in the path (with curr_dir fallback):
```
{
name = "project-vault",
path = function()
local project_wiki_path = GetProjectWikiPath()
if project_wiki_path then
return project_wiki_path
else
return assert(vim.fs.dirname(vim.api.nvim_buf_get_name(0)))
end
end,
overrides = {
notes_subdir = vim.NIL, -- have to use 'vim.NIL' instead of 'nil'
new_notes_location = "current_dir",
templates = {
folder = vim.NIL,
},
disable_frontmatter = true,
},
},
```
That works ok, but I fail to see any advantages of multiple (and/or dynamic) workspaces without some more functionality.

### Alternatives

Only alternative I can think of is to write custom Telescope search which will search only inside project_wiki_root directory.

### Additional context

I'm just trying obsidian.nvim for the first time, so I might be terribly wrong how all this works.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the :ObsidianSearch and :ObsidianTags entry points and how they select files for a workspace. Reproduce the behavior with multiple static or dynamic workspaces, then determine whether both commands restrict results to the currently selected workspace. Done means searches and tag results exclude files from other workspaces.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
search, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.