Zettelkasten Forum


[Feature Request] ability to turn off highlights in searched text after search

I would like the ability to not have whatever text I have in my search bar highlighted in the note I'm currently working on. By way of visual example:

I am aware that the word "the" is in this file, and do not need to be reminded of that every time I stop typing :)

In vim terms, I basically want :noh, if that helps.

Comments

  • This has been requested before. [Request] Expose "Highlight search terms in editor" as a hotkey. — Zettelkasten Forum.

    In the interim, I've created a Keyboard Maestro macro that toggles the "Highlight search terms in the editor" setting. It is clunky. It's not my best work. It is pretty lousy because it requires a page reload, which is not easy in The Archive. It can be done and is worth it when the highlighting is like the contrived example below. I use a custom dark mode theme based on Bear's "Panic Mode" theme to make the two apps appear similar. When a search fills the editor with distracting highlights, the editor is unusable in the mode, and I stop and reset the "Highlight search terms in the editor" and search again.

    Will Simpson
    My zettelkasten is for my ideas, not the ideas of others. I will try to remember this. I must keep doing my best even though I'm a failure. My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
    kestrelcreek.com

  • Try matching against a string that doesn't (usually) match anything, such as 0TK.

    GitHub. Erdős #2. CC BY-SA 4.0. Problems worthy of attack / prove their worth by hitting back. -- Piet Hein.

  • @mediapathic To clarify: So you want the highlight at first, but then :noh clear it, or do you want to disable highlights altogether? (That can be toggled via the prefs: "Editing" pane, "Highlight search terms in the editor" at the bottom)

    Author at Zettelkasten.de • https://christiantietze.de/

  • @ctietze said:
    To clarify: So you want the highlight at first, but then :noh clear it, or do you want to disable highlights altogether?

    The former. I want the highlight, but then be able to clear it.

    My workaround at the moment is to hit esc to clear the search, then navigate back, which reloads whatever I was working on without the highlight.

  • @mediapathic said:
    My workaround at the moment is to hit esc to clear the search, then navigate back, which reloads whatever I was working on without the highlight.

    I do the same thing and I don't love it.

    @ctietze said:
    (That can be toggled via the prefs: "Editing" pane, "Highlight search terms in the editor" at the bottom)

    I didn't realize this was a preference. I'm going to try this out for now. But, I would prefer the highlight, then clear without esc.

  • edited July 2023

    The ESC-trick is horrible :D Sorry folks.

    I guess it would make sense to add a "clear highlights" menu item to the main menu (for shortcuts) and the context menu (for shorter mouse travel for mouse users). Since I don't have any GUI app in mind to look towards for inspiration to steal their shortcut, this will have to remain chiefly user-bindable, I think. (The command palette would also be nice to have, but it's not yet on the roadmap)

    By the way: Highlights also go away as you type, so tab+space+⌘Z could be less jarring than the ESC trick. Even then, the occasional (annoying) re-highlighting stems from the file changing on disk, so The Archive displays the new content + applies highlights.

    Author at Zettelkasten.de • https://christiantietze.de/

Sign In or Register to comment.