line counts in the vi editor

Most people dislike vi. But vi is actually one of the most powerful text editors in *nix. Unfortunately, it’s tough by default to know which line you’re on and what you’re doing if you’re trying to search for that one bugger syntax error that you can find in a diff, but can’t find in the editor.
No problem.
In vi, to set line numbers:
: set number
That’s it. Line numbers should show up. If you add this line to your .exrc file, then you’ll always have line numbers showing.

  • Edwin

    It is hardly tough to know what line you are on.
    ctrl-g will tell you what line you are on.
    123G will go to line 123

  • Edwin

    It is hardly tough to know what line you are on.
    ctrl-g will tell you what line you are on.
    123G will go to line 123