On Wed, July 13, 2011 1:19 am, Benjamin R. Haskell wrote:
> On Tue, 12 Jul 2011, Ben Fritz wrote:
>
>> On Jul 12, 8:38 am, stardiviner wrote:
>>> how to add a colored line behind line number.
>>> here is the
>>> example:http://blog.nguyenvq.com/2011/06/29/some-custom-emacs-keybindings-for...
>>>
>>
>> Are you asking for every other line to be highlighted in a different
>> color as shown in the screen shot?
>
> I assumed the request was for the red, vertical bar after (= "behind")
> the line number.
>
> I couldn't see a straightforward way to do it.  My first attempt was to
> subvert the 'signs' columns, but I couldn't figure out a nice way to
> activate the column without actually adding signs.  And after doing so I
> discovered that it appears to the left of the numbers anyway.

You could possibly hack something like this:
1) Add a space at the beginning:
   :%s/^/ /
2) Match the first column
   call matchadd('Conceal', '^ ')
3) change syntax highlighting for the conceal highlighting group
   hi Conceal ctermbg=Red ctermfg=Red

You need to adjust the color to your taste and depending on whether
you use terminal vim or gvim, you need to use cterm(bg,fg) (for the former)
or gui(bg,fg) for the latter.

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