Editor for C programming

Hi,
I used to write C programs in Vi, but here in my Suse 11.2, Vi is not as good as it used to be, some features are not in it, like coloring functions, and automatic spacing after “{”, is that a problem of version ? or i should install something else ?

Mmm i always get confused with the differences vi vs vim and I’m a real vim novice I use gvim for a reason :wink: any way…

I suspect it is a configuration or plugin problem any way I did set my vim environment for python coding and a quick google found this Tutorial: Make Vim as Your C/C++ IDE Using c.vim Plugin then combined with http://www.vim.org/ I’m pretty sure you can get the environment you want.

Hopefully that helps. I believe eclipse has some bindings but not exactly sure what and code:blocks is another, none are my recommendations but just a couple I see favourably mentioned.

FeatherMonkey wrote:

>
> Mmm i always get confused with the differences vi vs vim and I’m a real
> vim novice I use gvim for a reason :wink: any way…
>
> I suspect it is a configuration or plugin problem any way I did set my
> vim environment for python coding and a quick google found this
> ‘Tutorial: Make Vim as Your C/C++ IDE Using c.vim Plugin’
> (http://tinyurl.com/cwnh4h) then combined with http://www.vim.org/ I’m
> pretty sure you can get the environment you want.
>
> Hopefully that helps. I believe eclipse has some bindings but not
> exactly sure what and code:blocks is another, none are my
> recommendations but just a couple I see favourably mentioned.
>
>
@elaich
I never used vi/vim for programming, so please ignore my ignorance. And if
you hate emacs (it can be a religious question which editor one prefers)
ignore the rest of my post.

If you prefer an editor for programming instead of an IDE and if the
suggestion from FetherMonkey for vim does not what you expect (I have no
idea) than maybe emacs is another option for you.

I use emacs for the following languages and I am really satisfied
SBCL, gambit-c, plt scheme, gnu octave, gnu R, fortran 95

Its C support seems to be very good. I do no C programming myself (only
C++), but know some people which use emacs exclusively for C on linux.

@FeatherMonkey
The plugin for eclipse for C/C++ programming is CDT and it is not bad for
C++ (but I do not know how good it is for C), there was heavy development on
improving it during the last years, I use it sometimes but not that often.

cvim plugin is great, thanks !!

Emacs is a powerful editor for programming i used it for Nasm, but cvim it’s all i need now !!

I guess you don’t think about using Netbeans or Eclipse?

I also have OpenSUSE 11.2 and VI is fine. I have a vimrc in /etc/ and $HOME.

For additional info/configuration:
===> locate vimrc
===> man vim

VI is a symbolic link to VIM (VI Improved).
===> ls -l /bin/vi

Other options: Kate or KDevelop

HTH

i think that’s because i installed my Suse from live cd.

Why you sould not use Eclipse or Anjuta ? both good for c/c++.
I use eclipse for c++. it works well for me. Recently experimented with Anjuta. It also a good tool. :wink:

VIM have always worked for me but as an alternative, try Eclipse or NetBeans - both pretty good IDE’s with quite lots of enchantments ( plugins ).

Ok I can’t resist. A better editor than vi for openSUSE is Emacs, because Emacs is a better editor than vi for any purpose whatever, wherever. ducks

Just Kidding. Sort of.
Malcolm.

:slight_smile: After reading this thread I actually Googled “best of vi vs. emacs” to find the best flame war on this ever recorded. Couldn’t find a really funny one, though.

Here’s an old joke from the Unix days. Some of the tools are rather dated and only make sense to people who were there. Some of them carry over well.

NAME            DESCRIPTION AND FEATURES

beginner        - insecure with the concept of a terminal
                - has yet to learn the basics of vi
                - has not figured out how to get a directory
                - still has trouble with typing <RETURN>
                  after each line of input

novice          - knows that "ls" will produce a directory
                - uses the editor, but calls it "vye"
                - has heard of "C" but never used it
                - has had a bad experience with rm
                - is wondering how to read mail
                - is wondering why the person next door
                  seems to like Unix so very much

user            - uses vi and nroff, but inexpertly
                - has heard of regular expressions but never seen one.
                - has figured out that '-' precedes options
                - has attempted to write a C program but decided
                  to stick with Pascal
                - is wondering how to move a directory
                - thinks that dbx is a brand of stereo component
                - knows how to read mail and is wondering how
                  to read the news

knowledgeable   - uses nroff with no trouble, and is beginning
user              to learn tbl and eqn
                - uses grep to search for fixed strings
                - has figured out that mv(1) will move directories
                - has learned that "learn" doesn't help
                - somebody has shown her how to write C programs
                - once used sed but checked the file afterward
                - watched somebody use dbx once
                - tried "make" but used spaces instead of tabs

expert          - uses sed when necessary
                - uses macros in vi, uses ex when necessary
                - posts news at every possible opportunity
                - is still wondering how to successfully reply to mail
                - writes csh scripts occasionally
                - writes C programs using vi and compiles with make
                - has figured out what && and || are for
                - uses fgrep because somebody said it was faster

hacker          - uses sed and awk with comfort
                - uses undocumented features of vi
                - writes C code with "cat >" and compiles with "!cc"
                - uses adb because she doesn't trust source debuggers
                - figured out how environment variables are propagated
                - writes her own nroff macros to supplement the standard
                  ones
                - writes Bourne shell scripts
                - installs bug fixes from the net
                - uses egrep because she timed it

guru            - uses m4 and lex with comfort
                - writes assembler code with "cat >"
                - uses adb on the kernel while the system is loaded
                - customizes Unix utilities by patching the source
                - reads device driver source with breakfast
                - uses "ed" because "ex" is a Berkeleyism
                - can answer any unix question after a little thought
                - uses make for anything that requires two or more commands
                - has learned how to breach security but no longer
                  needs to try
                - is putting James Woods/Henry Spencer egrep into her
                  next Unix release

wizard          - writes device drivers with "cat >"
                - fixes bugs by patching the binaries
                - posts her changes to Unix utilities to the net --
                  and they work
                - can tell what question you are about to ask, and answer it
                - writes her own troff macro packages
                - is on a first-name basis with Dennis, Bill, and Ken

PS: That Ken is Ken Thompson, not me. :wink: