Is there a way to show the current row and column position in vi? In vim, I know there is the
set ruler command, but what are my options when using vi?
You can do
There is a way to at least position the cursor at a specific column. Do
You can press Ctrl+G to temporarily display some useful information in the bottom left corner, including line- and column number of the cursor, the name of the file and more.
Original vi had nothing like the
In original vi (such as AIX, HPUX, Solaris), pressing controlG shows which line you are on, but not the column, e.g.,
The ruler mode was first introduced in
It was added to vim in version 1.18 (undated) between 1.17 (April 20, 1992) and 1.24 (January 10, 1993):
VIM 1.18 - Screen was not updated when all lines deleted. Readfile() now puts cursor on first new line. Catch strange disk label. Endless "undo line missing" loop removed. With empty file 'O' would cause this. Added window size reset in windexit(). Flush .vim file only when buffer has been changed. Added the nice things from Elvis 1.5: Added "equalprg" and "ruler" option. Added quoting.
nvi started as a fork of elvis, and inherited this code. Some people see nvi running and suppose it to be original vi.
vile added a ruler mode in changes for version 3.57 (August 5, 1993). So all four of the common vi-clones provide a
Using the vertical bar to get to a particular column is a workaround (which in a quick check does account for tab-stops).
Further reading: vi like emacs - FAQ
OK so this is from memory, from years ago.
Vi has a status bar line - and I've seen it setup to report the column number of the cursor in the status bar... just don't remember how that was accomplished.
Yes, this was vi not vim - on solaris, or sunos maybe.