Tuesday, July 31, 2012

Re: Enable option / disable option

On Tue, Jul 31, 2012 at 3:24 PM, Benjamin R. Haskell <vim@benizi.com> wrote:
> " <Leader>h toggles the under-cursor highlighting
> :map <Leader>h let g:under_cursor_hl = 1 - get(g:, 'under_cursor_hl', 1)
>
> " Use it in the CursorMoved autocmd
> :autocmd CursorMoved * if get(g:, 'under_cursor_hl', 1) | exe printf('match
> IncSearch /\V\<%s\>/', escape(expand('<cword>'), '/\')) | end
>
> Or am I missing something?
>

Thanks, Ben. The problem is that I cannot turn the feature off! That
was the question in the OP, with a different method of achieving the
same effect.

My ultimate goal is to be able to set specific words to be
highlighted, say toggling them with \hw (highlight word), and _also_
to have the ablility to toggle highlight-word-under-cursor, say with
\hh.

--
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment