Thread: Line Numbers in VI and/or Visual C++ :: C++

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348

    Line Numbers in VI and/or Visual C++ :: C++

    Hi.

    I always find myself counting the number of lines in my code when GNU C++ gives me errors with line numbers. However, counting is a slow and tedious in Linux C++ editors such as VI. I saw someone use a Linux C++ editor with line numbers on the left. I am not sure what editor he was using, but I believe it was VI.

    How do you enable line numbers inside VI C++ editor? Is it possible to view line numbers in Visual C++ as well? Microsoft makes Visual C++ extremely user friend as it directly focuses to the error line when the user double-click on the error. Nonetheless, since Linux C++ editors such as VI do not have that feature, I would like to try and practice debugging using line numbers.

    Thanks,
    Kuphryn

  2. #2
    Fingerstyle Guitarist taylorguitarman's Avatar
    Join Date
    Aug 2001
    Posts
    564
    In MSVC the line number and column numbers are in the status bar. Lower right corner.
    I use emacs so I can't help you much with vi. I only used it for a very short time.

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Okay. Thanks.

    I believe in VI, you enable line number like this:

    :set nu

    or

    :set number

    and turn it off like this:

    :set nonu

    or

    :set nonumber

    Kuphryn

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help displaying line numbers of a text document
    By Japatron in forum C Programming
    Replies: 4
    Last Post: 05-04-2006, 01:34 PM
  2. Could somebody please help me with this C program
    By brett73 in forum C Programming
    Replies: 6
    Last Post: 11-25-2004, 02:19 AM
  3. line numbers?
    By anomaly in forum Tech Board
    Replies: 5
    Last Post: 12-11-2003, 01:24 PM
  4. Showing Line Numbers in MSVC++
    By drdroid in forum Windows Programming
    Replies: 1
    Last Post: 01-09-2003, 03:23 PM
  5. Specifying Line Numbers
    By drdroid in forum C++ Programming
    Replies: 1
    Last Post: 05-25-2002, 11:00 AM