How to display underline on current line?

533 views
Skip to first unread message

robert song

unread,
Apr 26, 2010, 7:58:56 AM4/26/10
to vim...@googlegroups.com
Hello, everyone.
Is there any method to display underline on current line,
I think it's very useful for code review.

Just like following format:
void main() { <- current line
-------------- <- underline
}

Regards,
robert

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

Subscription settings: http://groups.google.com/group/vim_use/subscribe?hl=en

Zhou, Yunqing

unread,
Apr 26, 2010, 8:07:24 AM4/26/10
to vim...@googlegroups.com
you can use :set cursorline

requires vim 7, p.s. you can also try :set cursorcolumn :-)

Frank Blendinger

unread,
Apr 26, 2010, 8:12:34 AM4/26/10
to vim...@googlegroups.com
Hi.

robert song <robertso...@gmail.com> (2010-04-26 20:58 +0900):


> Is there any method to display underline on current line,

I think ':set cursorline' is what you want. It will highlight the line
where there cursor is; I am not sure if the default format is
underlined, but you can change it by setting the hl-CursorLine
highlight. See :help 'cursorline'.


Greetings,
Frank

--
Frank Blendinger | f...@intoxicatedmind.net | GPG: 0BF2FE7A | :(){:|:&};:

signature.asc

Jostein Berntsen

unread,
Apr 26, 2010, 9:15:49 AM4/26/10
to vim...@googlegroups.com
On 26.04.10,20:58, robert song wrote:
> Hello, everyone.
> Is there any method to display underline on current line,
> I think it's very useful for code review.
>
> Just like following format:
> void main() { <- current line
> -------------- <- underline
> }

You might try this:

http://vim.wikia.com/wiki/Underline_using_dashes_automatically

Jostein

robert song

unread,
Apr 26, 2010, 9:53:37 AM4/26/10
to vim...@googlegroups.com
thank you very much.
It works.

Regards,
robert

2010/4/26 Zhou, Yunqing <azur...@gmail.com>:

Tony Mechelynck

unread,
Apr 26, 2010, 10:11:23 AM4/26/10
to vim...@googlegroups.com, robert song
On 26/04/10 13:58, robert song wrote:
> Hello, everyone.
> Is there any method to display underline on current line,
> I think it's very useful for code review.
>
> Just like following format:
> void main() {<- current line
> --------------<- underline
> }
>
> Regards,
> robert
>

I use the following to highlight the current line & column: I use
underline in the console, a very light grey (not very different from
"Normal" white) in the gui but of course you can vary at will.

In my vimrc:

if exists('+cursorline')
set cursorline cursorcolumn
endif

In my home-written colourscheme:

hi CursorLine cterm=NONE,underline guibg=#F4F4F4
hi! link CursorColumn CursorLine


Best regards,
Tony.
--
GUARD #1: What, ridden on a horse?
ARTHUR: Yes!
GUARD #1: You're using coconuts!
ARTHUR: What?
GUARD #1: You've got two empty halves of coconut and you're bangin' 'em
together.
The Quest for the Holy Grail (Monty
Python)

Vladimir Rybas

unread,
Apr 26, 2010, 11:20:37 AM4/26/10
to vim...@googlegroups.com, robert song
I don't know fellas. When I tried underline - it worked slow as hell. At least in GVim. If you'll have big delays - underline is the first thing to switch off.

John Maclean

unread,
Apr 27, 2010, 5:05:10 AM4/27/10
to vim...@googlegroups.com
On 26/04/2010 13:07, Zhou, Yunqing wrote:
> you can use :set cursorline

Added to ~/.vimrc. Thanks!

--
John Maclean
MSc. (DIC) BSc. (Hons)
Linux Systems Engineer
07739 171 531
Reply all
Reply to author
Forward
0 new messages