Tony Mechelynck schrieb: > On 15/04/09 10:00, Andy Wokula wrote: >> Tony Mechelynck schrieb: >>> On 12/04/09 21:29, Matt Wozniski wrote: >>>> On Sun, Apr 12, 2009 at 2:15 PM, Tony Mechelynck wrote: >>>>> On 12/04/09 14:10, Dennis Benzinger wrote: >>>>>> Hi! >>>>>> >>>>>> How can I check if there is no search highlighting because of >>>>>> :nohlsearch opposed to :set nohlsearch ? >>>>>> >>>>>> I can check the hlsearch option with :set hlsearch? or echo&hlsearch . >>>>>> Is there a similar variable for :nohlsearch ? >>>>> I don't think you can. However you can turn it back on by using e.g. >>>>> >>>>> / >>>>> Ctrl-O >>>>> >>>>> (There is no :hlsearch command.) >>>> No, but IIRC, >>>> >>>> :let @/ = @/ >>>> >>>> should do the trick as well. >>>> >>>> ~Matt >>> I tried it before sending that post, and it doesn't. >>> >>> >>> Best regards, >>> Tony. >> The usual way is >> :let&hls =&hls >> >> but I just tried this and it seems to work as well: >> :set hls< >> >> (although it's tricky: "<" is for local options) >> > > Tt, tt. As has already been said, the OP didn't want to know whether the > 'hlsearch' _option_ had been set or cleared, but whether the > :noh[lsearch] _command_ had been used since the latest search. The > command has no effect when the option is unset, but otherwise they are > different things.
The OP is very silent about the actual problem he wants to solve. This branch of the thread assumes (AIUI) he wants to turn highlighting back on after :noh . And I just posted the well-known way how to do it and a slightly new one. I don't know the answer to the OP's original problem. @Dennis: what is the _actual_ problem you want to solve? > Best regards, > Tony. -- Andy --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
