Results 1 to 7 of 7

Thread: vi editor Ctrl-g does not display cursor line number

  1. #1
    Join Date
    May 2010
    Location
    East Bay, CA
    Posts
    32

    Default vi editor Ctrl-g does not display cursor line number

    Hello All,

    On Solaris UNIX, pressing Ctrl-g displays the line number for the cursor position.

    i.e. line 1 0f n* --0%--

    But, on suse Ctrl-g on displays the percentage only, not the hard line number

    i.e. n* lines --8%--

    Anyway I can make vi display hard line just like Solaris?

    Thanks!

  2. #2
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: vi editor Ctrl-g does not display cursor line number

    I found a VI tutorial at:

    VI and VIM editor: Tutorial and advanced features

    When in the command mode, using a . refers to the line where the cursor is located. I have not used the command to which you refer and don't see it in the tutorial.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  3. #3
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: vi editor Ctrl-g does not display cursor line number

    The current line number is displayed all the the time for me. It looks like this in my window:

    Code:
    "/etc/passwd" [readonly] 33L, 1837C                           15,1          All
    I'm on line 15 in this file. The number after the comma is the column I'm at. If you don't see this status line you may have :set compatible which turns off the ruler feature. Or maybe you changed rulerformat. See here:

    Vim documentation: options'

    The vi in Linux is actually vim, which is a superset of vi, but you have to be aware of any .vimrc settings that may affect operation.

  4. #4
    Join Date
    May 2010
    Location
    East Bay, CA
    Posts
    32

    Default Re: vi editor Ctrl-g does not display cursor line number

    Hi Ken,

    Thanks for the help, compatible did the trick.

    Solution:
    *******
    - edit /etc/vimrc
    - Changed set nocompatible ---> set compatible
    - Ctrl-g now displays cursor line number

  5. #5
    Join Date
    Dec 2008
    Location
    GMT-7
    Posts
    382

    Default Re: vi editor Ctrl-g does not display cursor line number

    Wow - nobody afflicted with the Emacs religion piped up here. I guess that battle was lost to vi finally.



    Just kidding.
    Desk: AMD Phenom II X4 945 8GB RAM Radeon HD 3300 Arch Linux Xfce 4.8
    Lap: Intel 2.13GHz Core i3 M330 8GB RAM nVidia GeForce 310M Arch Linux KDE 4.7.3

  6. #6
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: vi editor Ctrl-g does not display cursor line number

    twelveeighty wrote:

    >
    > Wow - nobody afflicted with the Emacs religion piped up here. I guess
    > that battle was lost to vi finally.
    >
    >
    >
    > Just kidding.
    >
    >

    The fact that no emacs user commented here does not mean that we do not
    exist or that we gave up.
    We are watching you vi people, take care.

    (Also just kidding) ;-)

  7. #7
    Join Date
    May 2010
    Location
    East Bay, CA
    Posts
    32

    Default Re: vi editor Ctrl-g does not display cursor line number

    a big to both funny comments.

    I actually use emacs as well; but, for my programming aspect of things vi seems to fit better. Just makes it a bit faster for me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •