Tuesday, September 27, 2011

Re: Highlight current line number when using "set number"



On Wed, Sep 28, 2011 at 7:53 AM, Tony Mechelynck <antoine.mechelynck@gmail.com> wrote:
On 26/09/11 16:03, Francesc Salvat-Pujol wrote:
On Mon, Sep 26, 2011 at 2:07 PM, Ben Fritz <fritzophrenic@gmail.com
<mailto:fritzophrenic@gmail.com>> wrote:



   On Sep 25, 4:04 am, Francesc Salvat-Pujol <f.sal...@gmail.com
   <mailto:f.sal...@gmail.com>> wrote:
    > Hi,
    >
    > When using the option "set number", is there a way of
   highlighting the
    > current line number with a color other than LineNr? Using "set
   cuc cul"
    > is too much.
    >
    > I am aware that the question has been asked before, i.e.
    >
    >
   http://groups.google.com/group/vim_use/browse_thread/thread/90adce932...
    >
    > or with slightly different approach:
    >
    >
   http://groups.google.com/group/vim_use/browse_thread/thread/83fa20161...
    >
    > Unfortunately, none of these threads really offer a solution in the
    > sense described at the beginning of the mail.
    >
    > Any ideas?
    >

   That second thread offers a method which will get you closer, but even
   using the signs feature, I don't think Vim can highlight a specific
   line number in the line number column, and only the line number column
   (i.e. not the line text).

   Probably your best bet is to just set a cursorline highlight which is
   not too distracting and use that.


Uhum... Well, too bad.

Thanks for the replies though.

Cheers,

Cesc

In gvim (where the Normal background is white) (and in 256-color consoles with the CSApprox.vim plugin) I use the following in my "almost-default" colorscheme, http://users.skynet.be/antoine.mechelynck/vim/almost-default.vim

       hi clear CursorLine
       hi CursorLine guibg=#F4F4F4
       hi clear CursorColumn
       hi link CursorColumn CursorLine

which give me crosshairs in very light grey (95.7% grey), just enough to be visible, not enough to be distracting.


Best regards,
Tony.
--
"APL is a write-only language.  I can write programs in APL, but I
can't read any of them."
               -- Roy Keir

I'm actually using the terminal vim, but thx anyway. One day with some time and courage I might try to checkout the vim source and see if it's really that hard for a newbie to add a CurrentLineNr highlight group and print the current line number in the corresponding color.

Thx for the tips,

Cesc

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