Saturday, December 26, 2009

Re: cursorline/cursorcolumn highlighting

On 2009-12-25, Bee wrote:
> On Dec 24, 9:17 pm, Gary Johnson <garyj...@spocom.com> wrote:
> > You might be interested in
> > :set {option}!
> > :set inv{option}
>
> I know about them, but did not know the 'reset'.
> :se[t] {option}&
>
> I had been using:
> :nmap <silent> <F7> :set cursorline!<cr>
> :nmap <silent> ,<F7> :set cursorcolumn!<cr>
>
> But decided that I wanted to cycle 1-4 with ONE key
> and to learn something new:
> 1) off
> 2) cursorline
> 3) cursorcolumn
> 4) both cursorline and cursorcolumn
>
> How can LiCo() be made buffer local?
>
> let s:lico=0
> function LiCo()
> let s:lico=s:lico>2 ?0 :s:lico+1
> let &cursorline=s:lico % 2
> let &cursorcolumn=s:lico / 2
> endfun
>
> I tried b:lico in place of s:lico, it did not work.

That's odd. I just tried your function with b:lico and it worked
fine for me: each call to LiCo() advanced the state of the cursor
highlights as you described. I only tried it with one buffer.

Regards,
Gary


--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment