Author Topic: How to highlight ALL instances of matched search word in VIM emulator?  (Read 9422 times)

studentpower

  • Community Member
  • Posts: 7
  • Hero Points: 0
Currently, when I use "/" to search a word in VIM, I have to use "n" to explore all matched words one by one, could the editor highlight ALL of them immediately like in real VIM?

Also, how to copy a word in the editor txt area and then use the "/" search command and paste that word into the command line to search it? This is for VIM emulator again. Right now, the paste command "p" cannot work in the command line after I've yanked the word in the txt area, neither could "Ctrl+v".

Thanks!

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: How to highlight ALL instances of matched search word in VIM emulator?
« Reply #1 on: February 12, 2010, 06:04:01 PM »
Hmm...I tried using / in VIM emulation and it highlights all matches. I don't know what version of SlickEdit added this. After copying something to the clipboard, use Shift+Ins to paste the clipboard into the command line. I'm definitely not one of the VI guys here but I hope this helps.

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Re: How to highlight ALL instances of matched search word in VIM emulator?
« Reply #2 on: February 12, 2010, 06:26:44 PM »
Quote
Currently, when I use "/" to search a word in VIM, I have to use "n" to explore all matched words one by one, could the editor highlight ALL of them immediately like in real VIM?

I looked, and it looks like this was added in the 12.x timeframe...so if you are using SlickEdit v12, v13, or v14 this should be on by default.  If you are using one of those versions and it's not working, it's likely the case that the option is turned off.  Go to Macro > Set Macro Variable and enter def_vi_always_highlight_all as the 'Variable'.  The value should be 1...if it's 0, change it to 1 and click OK.

Quote
Also, how to copy a word in the editor txt area and then use the "/" search command and paste that word into the command line to search it? This is for VIM emulator again. Right now, the paste command "p" cannot work in the command line after I've yanked the word in the txt area, neither could "Ctrl+v".

The way Clark mentioned is the way to do this..."p" does not work in the command line, you have to use Shift+Ins.

- Ryan

studentpower

  • Community Member
  • Posts: 7
  • Hero Points: 0
Re: How to highlight ALL instances of matched search word in VIM emulator?
« Reply #3 on: February 12, 2010, 06:46:04 PM »
Bravo!!!

My version is 12.0.xx, I changed the macro to 1 like you mentioned, it works!

I also tried the Shift+ins, it works too!

Thanks again!

studentpower

  • Community Member
  • Posts: 7
  • Hero Points: 0
Re: How to highlight ALL instances of matched search word in VIM emulator?
« Reply #4 on: February 12, 2010, 06:47:11 PM »
It works! Thanks!

Quote
Currently, when I use "/" to search a word in VIM, I have to use "n" to explore all matched words one by one, could the editor highlight ALL of them immediately like in real VIM?

I looked, and it looks like this was added in the 12.x timeframe...so if you are using SlickEdit v12, v13, or v14 this should be on by default.  If you are using one of those versions and it's not working, it's likely the case that the option is turned off.  Go to Macro > Set Macro Variable and enter def_vi_always_highlight_all as the 'Variable'.  The value should be 1...if it's 0, change it to 1 and click OK.

Quote
Also, how to copy a word in the editor txt area and then use the "/" search command and paste that word into the command line to search it? This is for VIM emulator again. Right now, the paste command "p" cannot work in the command line after I've yanked the word in the txt area, neither could "Ctrl+v".

The way Clark mentioned is the way to do this..."p" does not work in the command line, you have to use Shift+Ins.

- Ryan

studentpower

  • Community Member
  • Posts: 7
  • Hero Points: 0
Re: How to highlight ALL instances of matched search word in VIM emulator?
« Reply #5 on: February 12, 2010, 06:47:42 PM »
Shift+ins is the king! thanks!
Hmm...I tried using / in VIM emulation and it highlights all matches. I don't know what version of SlickEdit added this. After copying something to the clipboard, use Shift+Ins to paste the clipboard into the command line. I'm definitely not one of the VI guys here but I hope this helps.