# Highlight all occurrence of selected word (toggle througt settings)

**URL:** https://discourse.joplinapp.org/t/highlight-all-occurrence-of-selected-word-toggle-througt-settings/23728
**Category:** Features
**Created:** [14 February 2022 15:36 UTC](https://discourse.joplinapp.org/t/highlight-all-occurrence-of-selected-word-toggle-througt-settings/23728 "2022-02-14T15:36:03Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![4wk](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/4wk/32/12723_2.png) [@4wk](https://discourse.joplinapp.org/u/4wk)
#### Post date: [14 February 2022 15:36 UTC](https://discourse.joplinapp.org/t/highlight-all-occurrence-of-selected-word-toggle-througt-settings/23728/1 "2022-02-14T15:36:03Z")

</div>

Hello,

I'm using Joplin as my daily driver on notes and todo for now more than a year, exclusively in the standard text editor (no rich text editor, no preview, only "markdown code" like).

One feature we really like on some modern IDE or advanced writing software like N++, is the ability to **highlight all occurrences of the word currently selected**. For instance, if I double-left-click on the word "foobar", it highlight it (of course), but it also highlight all the other occurrences on the opened note as well!

That's super useful when writing stuff like technical data, command lines, reports, etc.

I suppose it could be toggled ON or OFF through a new settings, OFF by default of course.

I **did** search for this feature request, but I didn't find it exactly: [Search results for '#features highlight same word' - Joplin Forum](https://discourse.joplinapp.org/search?q=%23features%20highlight%20same%20word)

What do you think? 😉

Cheers,

---

<div class="post-metadata">

### Author: ![Daeraxa](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/daeraxa/32/6172_2.png) [@Daeraxa](https://discourse.joplinapp.org/u/Daeraxa)
#### Post date: [14 February 2022 15:49 UTC](https://discourse.joplinapp.org/t/highlight-all-occurrence-of-selected-word-toggle-througt-settings/23728/2 "2022-02-14T15:49:39Z")

</div>

Whilst I subscribe to the fact the Markdown is code, I think that that is possibly getting a bit too "IDE"-y than a note taking app should need.

For when I want do do that kind of work with a note I just open it in an actual IDE/text editor with lofty aspirations (specifically atom).

---

<div class="post-metadata">

### Author: ![4wk](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/4wk/32/12723_2.png) [@4wk](https://discourse.joplinapp.org/u/4wk)
#### Post date: [14 February 2022 15:54 UTC](https://discourse.joplinapp.org/t/highlight-all-occurrence-of-selected-word-toggle-througt-settings/23728/3 "2022-02-14T15:54:06Z")

</div>

Hi @Daeraxa , thanks for your reply.  
I do agree that Joplin is not suppose to be an IDE, sorry I expressed myself badly. As a matter of fact, I did talk about Notepadd++, and it's not an IDE to be faire ☺  
But anyway, as this behaviour would be enabling through a setting, would it be so bad?

---

<div class="post-metadata">

### Author: ![Daeraxa](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/daeraxa/32/6172_2.png) [@Daeraxa](https://discourse.joplinapp.org/u/Daeraxa)
#### Post date: [14 February 2022 16:01 UTC](https://discourse.joplinapp.org/t/highlight-all-occurrence-of-selected-word-toggle-througt-settings/23728/4 "2022-02-14T16:01:16Z")

</div>

N++ belongs to the same class of "text editors with lofty aspirations" that I amended my post to; Atom, Sublime text, VS Code etc - i.e. really are meant for monospaced handling of code including syntax highlighting and lots of tools to handle more hardcore text editing etc.

To be clear, I don't think it is a bad idea, I can see the use for it (hence why I open notes in Atom when I want to use more powerful features available in a proper text editor) but I just don't really see it as necessary in a notes app.

Having a quick look through other note apps, this doesn't seem to be a common feature (at least not by default).

I think it would be entirely possible via a plugin as I assume it is handled natively in CM for other areas.

---

<div class="post-metadata">

### Author: ![Daeraxa](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/daeraxa/32/6172_2.png) [@Daeraxa](https://discourse.joplinapp.org/u/Daeraxa)
#### Post date: [14 February 2022 16:49 UTC](https://discourse.joplinapp.org/t/highlight-all-occurrence-of-selected-word-toggle-througt-settings/23728/5 "2022-02-14T16:49:38Z")

</div>

Huh, turns out the basic code was already sitting in the codebase (app-cli/tests) just not being used.  
I adapted it into a plugin. I would need to play with it a bit more but could potentially release it if people are interested. (ignore that it is red, it was the first non black or white hex code that I could remember).

![image](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/2X/1/121007b3a122a61c69c15ef0ff042b8e3b4b57f2.png)

---

<div class="post-metadata">

### Author: ![4wk](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/4wk/32/12723_2.png) [@4wk](https://discourse.joplinapp.org/u/4wk)
#### Post date: [15 February 2022 08:53 UTC](https://discourse.joplinapp.org/t/highlight-all-occurrence-of-selected-word-toggle-througt-settings/23728/6 "2022-02-15T08:53:50Z")

</div>

Neat, that look promising! Let me know if you need help to test it on a longer run.

---

<div class="post-metadata">

### Author: ![Daeraxa](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/daeraxa/32/6172_2.png) [@Daeraxa](https://discourse.joplinapp.org/u/Daeraxa)
#### Post date: [15 February 2022 13:40 UTC](https://discourse.joplinapp.org/t/highlight-all-occurrence-of-selected-word-toggle-througt-settings/23728/7 "2022-02-15T13:40:45Z")

</div>

I've published a plugin for it:

> [@Highlight Matching Plugin](https://discourse.joplinapp.org/t/highlight-matching-plugin/23747):
>
> Highlight Matching Plugin This plugin highlights words that match what the user has highlighted in the editor. Usage Simply toggle the plugin on and highlight a word, matching strings will also be highlighted. The plugin activates the CodeMirror addon [search/match-highlighter](https://codemirror.net/addon/search/match-highlighter.js) with the default options set. The background highlighting is provided by CSS matching the new CSS class of .cm-matchhighlight. This can be overridden using CSS in userchrome.css with the !important option. C…

Its still a very basic version so you might need to manually set the CSS to make it suit whatever theme you are using. The readme/topic explains more.

---

<div class="post-metadata">

### Author: ![4wk](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/4wk/32/12723_2.png) [@4wk](https://discourse.joplinapp.org/u/4wk)
#### Post date: [15 February 2022 14:32 UTC](https://discourse.joplinapp.org/t/highlight-all-occurrence-of-selected-word-toggle-througt-settings/23728/8 "2022-02-15T14:32:43Z")

</div>

Thank you @Daeraxa. That will suit my needs!  
I will give feedback in the other thread.  
Cheers!

---

<div class="post-metadata">

### Author: ![ntaubman](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/ntaubman/32/14959_2.png) [@ntaubman](https://discourse.joplinapp.org/u/ntaubman)
#### Post date: [8 August 2022 21:07 UTC](https://discourse.joplinapp.org/t/highlight-all-occurrence-of-selected-word-toggle-througt-settings/23728/9 "2022-08-08T21:07:30Z")

</div>

Hey there -- such a great idea and am so glad you worked on this!  
For whatever reason, when in the non-markdown view, I am not getting the search term to highlight. Any ideas why?

---

<div class="post-metadata">

### Author: ![Daeraxa](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/daeraxa/32/6172_2.png) [@Daeraxa](https://discourse.joplinapp.org/u/Daeraxa)
#### Post date: [8 August 2022 21:16 UTC](https://discourse.joplinapp.org/t/highlight-all-occurrence-of-selected-word-toggle-througt-settings/23728/10 "2022-08-08T21:16:53Z")

</div>

It is only a very simple plugin that simply activates a mode already built into codemirror (the editor used for the markdown editor) so therefore doesn't do anything in the richtext or rendered views which would take a lot more work to implement (not out of the question in theory but its a whole different animal).
