Page 1 of 2

How to make Far3 editor to highlight a specific word?

Posted: Mon 24 Dec, 2012 11:35
by kamil
I used to have this nice editor plugin, that was highlighting all the visible occurrences of a specific word when I just pressed "Alt" having a cursor on it.
It was also drawing a crossed lines while pressed ctrl+shift (so I could easily find the cursor).
The plugin was called CRest: http://plugring.farmanager.com/plugin.php?pid=311&l=en

Unfortunately this plugin does not seem to be quite compatible with the recent version of Far, to which I switched some time ago because it has some other great features...

But the highlight word function was very useful for me and I really miss it, so do you maybe know any other way to have such a functionality with the recent Far3?

Re: How to make Far3 editor to highlight a specific word?

Posted: Mon 24 Dec, 2012 12:16
by Max Rusov
You can try EdtFind

Re: How to make Far3 editor to highlight a specific word?

Posted: Mon 24 Dec, 2012 13:32
by kamil
Perfect - thank you very much!

How to make Far3 editor to highlight a specific word?

Posted: Wed 07 Sep, 2022 19:34
by kamil
Hello again :)

I was using a lot the "Pick Word" function of EdtFind plugin

Unfortunately it does not work anymore with the latest builds of Far (x64)
Now it only highlights the word that the cursor is at, but never the other occurrences of it.

I checked that it stopped working in Far.x64.3.0.5821.2250.278be7df57b43fa31263715b84f65b5fc6d07c1e.7z (Jun 14, 2021)
It was still working in Far.x64.3.0.5820.2249.956e9deb51627996b6cf7e115ecd7a0914b505af.7z (Jun 12, 2021)

I am not sure what is the problem.
Can anyone please help me to get this function working again?
Or do you know another Plugin that can do it?

How to make Far3 editor to highlight a specific word?

Posted: Wed 07 Sep, 2022 19:53
by Shmuel
Try any/both of the following:
  1. %FARHOME%\Addons\Macros\Editor.ColorWord.moon - copy it to %FARPROFILE%\Macros\scripts and restart Far.
  2. Plugin LF Search.

How to make Far3 editor to highlight a specific word?

Posted: Thu 08 Sep, 2022 07:13
by citRiks
kamil,
for reference, you may try this as well:
https://github.com/dr-dba/far-lua-editor-color-word
It has some dependencies on other Lua modules, thus being less easy to install for a newcomer.
though, as the author of it, i may help you if needed

How to make Far3 editor to highlight a specific word?

Posted: Thu 08 Sep, 2022 08:42
by kamil
Shmuel wrote: Wed 07 Sep, 2022 19:53 Try any/both of the following:
  1. %FARHOME%\Addons\Macros\Editor.ColorWord.moon - copy it to %FARPROFILE%\Macros\scripts and restart Far.
  2. Plugin LF Search.
Thanks, but:
  1. This macro does not seem to be doing anything for me. Is it supposed to highlight word under cursor, when I press F5? It does nothing. I can see it installed in my Macro Browser plugin (can even execute it from there, but also does nothing).
  2. How do I highlight the word under cursor using LF Search?

How to make Far3 editor to highlight a specific word?

Posted: Thu 08 Sep, 2022 08:54
by kamil
citRiks wrote: Thu 08 Sep, 2022 07:13 kamil,
for reference, you may try this as well:
https://github.com/dr-dba/far-lua-editor-color-word
It has some dependencies on other Lua modules, thus being less easy to install for a newcomer.
though, as the author of it, i may help you if needed
OK, thanks - I will be happy to try.

I see it has 3 dependencies.
How do I install them?

How to make Far3 editor to highlight a specific word?

Posted: Thu 08 Sep, 2022 09:30
by Shmuel
kamil wrote: Thu 08 Sep, 2022 08:42 This macro does not seem to be doing anything for me. Is it supposed to highlight word under cursor, when I press F5?
Yes. and it must work out of the box. Probably you either didn't copy the file to the right location or didn't restart Far.
kamil wrote: Thu 08 Sep, 2022 08:42 How do I highlight the word under cursor using LF Search?
There is a "Highlight all" checkbox in the "Find" dialog.
One could write a macro that would invoke the dialog, activate the checkbox and press Enter.

How to make Far3 editor to highlight a specific word?

Posted: Thu 08 Sep, 2022 10:54
by kamil
Shmuel wrote: Thu 08 Sep, 2022 09:30 Yes. and it must work out of the box. Probably you either didn't copy the file to the right location or didn't restart Far.
No, it does not work with a new Far.

Funny thing though - it works with build 5820, but not with 5821
It seems like the same problem EdtFind has (except it does not even highlight the word under cursor)

How to make Far3 editor to highlight a specific word?

Posted: Thu 08 Sep, 2022 10:58
by kamil
kamil wrote: Thu 08 Sep, 2022 08:54
citRiks wrote: Thu 08 Sep, 2022 07:13 kamil,
for reference, you may try this as well:
https://github.com/dr-dba/far-lua-editor-color-word
It has some dependencies on other Lua modules, thus being less easy to install for a newcomer.
though, as the author of it, i may help you if needed
OK, thanks - I will be happy to try.

I see it has 3 dependencies.
How do I install them?
OK, I managed to install it, but it has the same problem as the others:
  • On build 5820 it works fine
  • On build 5821 it only highlights one word (under the cursor), but not the others visible on the screen.

How to make Far3 editor to highlight a specific word?

Posted: Thu 08 Sep, 2022 11:04
by Shmuel
kamil wrote: Thu 08 Sep, 2022 10:54
Shmuel wrote: Thu 08 Sep, 2022 09:30 Yes. and it must work out of the box. Probably you either didn't copy the file to the right location or didn't restart Far.
No, it does not work with a new Far.
Funny thing though - it works with build 5820, but not with 5821
It seems like the same problem EdtFind has (except it does not even highlight the word under cursor)
I tested it today with Far3.0.6003 x64 with a new profile. It worked OK.

How to make Far3 editor to highlight a specific word?

Posted: Thu 08 Sep, 2022 11:04
by kamil
I see there was this change in 5821:

Code: Select all

drkns 14.06.2021 19:10:39 +0100 - build 5821

1. Removed the workaround for plugins that erroneously add transparent editor highlighting.
   Transparency is now taken into account.
   If your plugin/script suddenly stopped working - fill the colors properly.

So how do I modify Editor.ColorWord.moon script to fill the colors properly?

How to make Far3 editor to highlight a specific word?

Posted: Thu 08 Sep, 2022 11:08
by kamil
Shmuel wrote: Thu 08 Sep, 2022 11:04 I tested it today with Far3.0.6003 x64 with a new profile. It worked OK.
I have just tried with Far.x64.3.0.6003.2853.85a28204fd6c62960664e4e2cc55047c3701a571.7z - still not working.

Maybe it has something to do with the windows console, that it works in some systems, but not the others?

How to make Far3 editor to highlight a specific word?

Posted: Thu 08 Sep, 2022 11:15
by Shmuel
In your 6003 installation rename Far.exe.example.ini to Far.exe.ini then change the line
;UseSystemProfiles=1 to UseSystemProfiles=0 then run the Far.