Click to See Complete Forum and Search --> : Got a "vi" question..


Alan Cole
04-16-2001, 06:29 PM
I'm sure there is a way to do this, but I'm not having luck finding it on my own. I'm hoping some vi guru out there can help me out...

As you prolly know you can delete large numbers of lines from files with ## dd - (100 dd will delete 100 lines from cursor onward)

What I need to do is be able to go to a place in the file and find the line number I'm currently at... that way I can return to the begining of the file and delete that many lines forward -- thereby deleting all the lines from begining to that point I was at.

So, my main question is - how do I get vi to tell me what line number the cursor is at?

Thanks for any help on this

Alan

quandary
04-16-2001, 06:58 PM
ctrl-G should do it.

Alan Cole
04-16-2001, 07:01 PM
ahhhh

so simple...

Thanks a lot :)

Alan

X_console
04-17-2001, 01:27 AM
By the way, if you type ":set nu" you get numbers beside each line. ""set nonu" switches it off.

Alan Cole
04-17-2001, 08:47 AM
Oh that's awsome...

is there a way to set that "set nu" to be the 'default' way it launches? or do you have to type "set nu" each time you run it?

Alan

FORTRAN gy
04-17-2001, 11:24 AM
If you think that's awesome, you might like this:Customizing vim NHF (http://www.linuxnewbie.org/nhf/intel/tools/customize_vim1.html)

Okay, it's vim. Like there's a difference. ;)