Hi Bill!

On Mo, 02 Aug 2010, Bill wrote:

> I toggle line numbers off and on by simply changing the guifg color.
> 
> ;hide line column
> map  {{ :hi LineNr guifg=white<cr>
> ;reveal line column
> map  }} :hi LineNr guifg=black<cr>
> 
> Seems like a ternary should work here. The following one is not good.
> map {{ :LineNr guifg==white ? (:hi LineNr guifg=black<cr>):(:hi LineNr
> guifg=white<cr>)
> 
> I think I am getting the boolean part wrong and google is no help.
> Thanks in advance. Bill

try this:

map <expr> {{ synIDattr(hlID('LineNR'), 'fg')=="white" ? ':hi LineNr 
guifg=black<cr>' : ':hi LineNr guifg=white<cr>'

(one line)

regards,
Christian

-- 
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

Reply via email to