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?
Original vi had nothing like the
ruler mode which you see in
In original vi (such as AIX, HPUX, Solaris), pressing controlG shows which line you are on, but not the column, e.g.,
"shlib" [Read only] line 137 of 140 --97%--
The ruler mode was first introduced in
elvis (see how to draw a line in vi at 80 columns):
google shows me that elvis added this in version 1.5 (April 2, 1992), and for reference, version 1.4 was August 4, 1991.
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