1836462 Members
2432 Online
110101 Solutions
New Discussion

vi

 
Simon Randon
New Member

vi

Is it possible to tell which column you are in when vi'ing a file?
12 REPLIES 12
Ravi_8
Honored Contributor

Re: vi

Hi,

no
never give up
Nick Wickens
Respected Contributor

Re: vi

You can take a guess using "n |" This will move the cursor to column "n" of the current line.
Hats ? We don't need no stinkin' hats !!
Kent Ostby
Honored Contributor

Re: vi

Also starting from the begining of the line you can do:

20 l

to go to the 20th column

"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Jose Mosquera
Honored Contributor

Re: vi

Hi,

Are you using an emulator? In this case the emulator would display you x,y (row, column) coordinates.

Rgds.
Sanjay Kumar Suri
Honored Contributor

Re: vi

l and h move cursor 1 character right or left from the current cursor postion and it can be appended by n where n is a number to move n characters left or right.

Apart from above there is no way to tell the column postion.

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
James V. Ryan
Occasional Advisor

Re: vi

Download and install VIM from the Liverpool archive, it gives you that information, syntax coloring, multiple undo's and much more.
Steve Post
Trusted Contributor

Re: vi

oh there's always a way.

It may be lame. I may be silly. But it works. So why not?
What I do:

Add these two lines.
0 1 2 3....
123456789012345678901234567890....

You get the idea right?
Then, when you're done. Get rid of the two lines.


Steve
Steve Post
Trusted Contributor

Re: vi

oh darn that formating. The line is like this....

000000000100000000020000000003....
123456789012345678901234567890....
Bruno Ganino
Honored Contributor

Re: vi

Don't possible with standard vi command.
Bruno
Torino (Turin) +2H
Steve Post
Trusted Contributor

Re: vi

Yep. You would never know that the word ONE is in columns 21, 22, and 23 of this forum.
It was just a luck on my part.
000000000100000000020000000003......
123456789012345678901234567890......
ONE

I Guess the "Guess" starts on 7.(and20).

Steve (columns 11-15).





Steve Post
Trusted Contributor

Re: vi

Darn that fact that the "spaces" go away. It looked a lot better in the "reply to message."