Thread: Help on Vi for the C programming

  1. #1
    Registered User
    Join Date
    Jun 2002
    Posts
    19

    Help on Vi for the C programming

    Dear Friends,

    I am working on C in the Vi editor [ Unix ] I want to know how do we keep track of the opening and closing braces. There is a SET command there called "set match" which shows the opening and closing braces.

    But I do not know if that is correct ....is not working ... I tried a lot .... if anyone knows and can help me resolving that ... In case some other SET command is there ...... I checked with the "man vi" in the UNIX prompt .....As I am debugging one program it has become difficult to check that out...

    Please Help !!!

    with best regards & Thanks
    Mehul Doshi

  2. #2
    Registered User moonwalker's Avatar
    Join Date
    Jul 2002
    Posts
    282

    here...

    go to the opening/closing brace and hit %

    this will take you to the corresponding closing/opening brace.

    if there isn't one, it won't go anywhere.

  3. #3
    Registered User
    Join Date
    Jun 2002
    Posts
    19

    Thank You my friend

    Dear Friend,

    Thank You very much. One more help if you can do for me .....one more favor .... how do u do beautification in the C programming via Vi editor .... like we do in the FoxPro etc...

    with best regards
    Mehul DoshiFoxpro

  4. #4
    Registered User moonwalker's Avatar
    Join Date
    Jul 2002
    Posts
    282

    beautification ?

    I don't know what you mean by beautification..

    xemacs is a very good editor.. you might want to try that..

    if you are talking about making the code look neat,
    etc., I believe there are software that allow you to
    do that... try searching in google..

  5. #5
    Registered User
    Join Date
    Jul 2002
    Posts
    9
    Do you mean something like indent(1) ?

    Try man indent

  6. #6
    Registered User
    Join Date
    Jun 2002
    Posts
    19

    Beautification !!!

    Dear Friend,

    Yes beautification I mean is indentation. I am trying indent command in UNIX let me see if it does what I want ....

    Thank You for your support ....

    with best regards
    Mehul Doshi

  7. #7
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231

    Re: Beautification !!!

    Originally posted by mehuldoshi
    Yes beautification I mean is indentation. I am trying indent command in UNIX let me see if it does what I want ....
    Also, you might have the cb command available to you. Here's a man page link.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  8. #8
    Registered User
    Join Date
    Jun 2002
    Posts
    19

    Thumbs up Thank You my friend

    To all my Dear Friend,

    I found it and it is very helpful for me. As the debugging of the program has become very easy now ....

    Hope to get similar kind of support again. Thank You all of you once Again.

    with best regards
    Mehul Doshi

  9. #9
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >Hope to get similar kind of support again.
    I'm sure you will, most polite people do! Have fun programming
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  10. #10
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    GNU Emacs is nice to work with. It does the opening/closing brace hilighting automatically. It also indents your code automatically. You just have to hit enter and start typing the next line of code from the beginning of the line, than then Emacs suddenly indents it the proper number of spaces.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. VI trouble
    By afreedboy in forum Linux Programming
    Replies: 8
    Last Post: 09-26-2004, 02:47 PM
  2. Line Numbers in VI and/or Visual C++ :: C++
    By kuphryn in forum C++ Programming
    Replies: 2
    Last Post: 02-10-2002, 10:54 PM
  3. Question on Vi Editor
    By pritesh in forum Linux Programming
    Replies: 4
    Last Post: 12-10-2001, 12:49 PM
  4. Using VI, and red hat networking
    By Koshare in forum Linux Programming
    Replies: 4
    Last Post: 09-14-2001, 06:21 AM