Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] User can create search command with predefined condition #19

Closed
jiamingz42 opened this issue Jan 31, 2022 · 11 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@jiamingz42
Copy link

Use Case

My vault contains personal and work-related notes. I place all work-related notes under the same folder or tag them with #work

When I am at work, I want to only search notes related to work. I can start each query with "#work" but it becomes very tedious.

If I am actively working on project-a, I may need to start each query with #work #project-a.

Solution

In the plugin's settings page, users can add a custom search command. Users can specify predefined conditions and other options (e.g. ignore normal path patterns).

For example, I will add a custom search command. Name it "work search". And set the predefined conditions to "#work". As for the options, we can narrow the search to a specific folder.

The plugins will register this command with Obsidian. Then the user can either access it through the command palette or assign a shortcut.

@tadashi-aikawa
Copy link
Owner

Hi, @jzhang-brex.

I agree with your use case and solution.

The plugins will register this command with Obsidian

I will try it as well as I can.

Users can specify predefined conditions and other options (e.g. ignore normal path patterns).

I will consider the predefined conditions (obviously), but I will not consider the options.

@tadashi-aikawa
Copy link
Owner

@jzhang-brex
I have released this feature in v6.0.0-beta4 🚀

If you use BRAT, please confirm whether it works as you expected. Of course, It would be great to have feedback or bug reports :)

@rapatel0
Copy link

rapatel0 commented Aug 10, 2022

Not sure if I'm doing something wrong

The hotkey command for a specific search works beautifly but the :p doesn't seem to be working with the recommended search

Config:
Custom command: Projects
Default input: #T/Projects
Command Prefix: :p
Priorities:

  • Tag match
  • Prefix name match
  • Name match
  • Header match
  • Link match
  • Last opened
  • Last modified

Hotkey trigger (works perfectly)

image

Recommended search trigger (doesn't seem to be working)

image

@tadashi-aikawa
Copy link
Owner

Thank you for your report, @rapatel0 :)

That is a good point out. But unfortunately, the search using Command Prefix don't consider Default Input and Ignore prefix path patterns for now.

I'll consider them by modifying the UI of the dialog. Please wait for the next beta release 👍

tadashi-aikawa added a commit that referenced this issue Aug 11, 2022
…doesn't consider "Default Input" and "Ignore prefix path patterns" (#19)
@tadashi-aikawa
Copy link
Owner

@rapatel0
Released in v6.0.0-beta8 🚀

2022-08-11_20h41_38.mp4

@rapatel0
Copy link

Beautiful This is awesome

tadashi-aikawa added a commit that referenced this issue Aug 12, 2022
@rapatel0
Copy link

rapatel0 commented Aug 12, 2022

I assume that you're still working on it but. It's not clear how to indicate ignore prefixs. I used newlines to sepearte them but they don't seem to filter correctly,

Target folder: Areas/
(implemented by ignoring everything else)

Areas with (:a)

image

:a Not working

image

@tadashi-aikawa
Copy link
Owner

@rapatel0
As far as I saw your images, it seems that you didn't set / and Binary Files/ in "Ignore prefix path patterns.

@tadashi-aikawa
Copy link
Owner

tadashi-aikawa commented Aug 13, 2022

Ah.. it is not easy to ignore /. So please wait to implement Includes prefix path patterns.

#78 (comment)

tadashi-aikawa added a commit that referenced this issue Aug 13, 2022
… options for each "Search command" (#19)

- Remove Ignore prefix path patterns
tadashi-aikawa added a commit that referenced this issue Aug 13, 2022
@tadashi-aikawa
Copy link
Owner

tadashi-aikawa commented Aug 13, 2022

I have released v6.0.0-beta10 🚀

@rapatel0
The new beta version enables you to set Includes prefix path patterns. Please try it :)

@tadashi-aikawa
Copy link
Owner

Released in v6.0.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

3 participants