NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » Linux C editor recommendation

June 06, 2009
by DonNYC
DonNYC's Avatar

I have been programing on the Mac with xtools and have been happy with it. I like the way it auto color codes the text to make it easier to read.

I am starting to use Ubuntu and would like recommendation for a C editor in Linux.

Any suggestions?

Don

June 06, 2009
by mcai8sh4
mcai8sh4's Avatar

For me it has to be Vim - syntax highlight, autoindent, line numbering, customizable, and more powerful text editor than anything else I've tried.

You wouldn't realise it just by looking, but it just works.... and well.

The downside is is a bit confusing initially - but I forced myself to use it for a week or two then I was quite comfortable with it.

I run it within a yakuake terminal session (if you use the cli alot - yakuake is very useful) - if you prefere the graphical type programs use Gvim.

If you fancy trying it (and you're using Ubuntu) - you probably already have a lightweight version (vim-tiny), but the full one's better.

Windows users can also try it!!

If you want to learn how to use it type vimtutor in a shell, that will get you on your way - and a cheat sheet is always handy.

Just my opinion, others dispise it - but thats because it's confusing initially.

There are IDE's you could use I guess, Code::Blocks for example. And there's Kate... nah Vim FTW

:wq

June 06, 2009
by wayward
wayward's Avatar

disclaimer: this post does not intend to oppose mcai8sh4's in any manner

I've been using GNU Emacs for a couple of years now and have set it up pretty comfortably. It's very well suited for IDE-like development of C programs; all the things you'd expect from a self-respecting editor (syntax highlighting, autointentation, snippets, word completion, tags, parsing compiler/make output, etc.), and once you become friends with it, everything seems just a keystroke away.

There's a host of modes for other things, too, like Tramp: remote editing via ssh etc.; org-mode for keeping track of your notes and hierarchically-organized stuff; GPG support to quickly peek inside your passwords.txt.gpg file; version control support; etc, etc, etc. Vim, to the best of my knowledge, has all or most of that as well, either as built-ins or as plugins.

The difference is, I think, mostly in what you prefer: a big, "all-in-one-everything-is-an-Elisp-function-you'll-feel-like-playing-the-piano-and-yes-you-will-have-to" Emacs, or lean, mean, small and fast "type-seemingly-incongruous-but-utterly-powerful-sequences-while-switching-between-command-and-entry-mode" Vi(m).

Here's a screenshot for your viewing (dis)pleasure.

I can't think of any editor for *NIX platforms that even remotely approaches Emacs or Vim. Both can be extremely comfortable to use and both have the propensity to make you feel like you've discovered the One True Editor.

Final word of caution: Google Trends shows that Emacs is ever so slowly being less talked about. It wont go away anywhere in a hurry, but smart money is probably on Vim.

June 06, 2009
by TBNK
TBNK's Avatar

I like Notepad++. It has all the expected features: shortcuts, auto-completion, plugins, themes, context menus, command line arguments, the ability to run external tools (make, etc.), syntax highlighting (if you have a color printer, print your source code [or whatever you want] in color), syntax folding (compress FOR/WHILE/IF etc. to one display line), auto-completion, multi-document tabs, multi-view (you can edit two views of the same file at same time), regular expression search/replace, full drag 'n' drop, dynamic position of views (the splitter can be set horizontally or vertically), file status auto-detection (if you use another app to modify or delete a file which is open in Notepad++, you will be notified to update your document [reload the file or remove the file in Notepad++]), zoom in and zoom out, bookmarks, brace and indent guidelines/highlighting, macro recording and playback, to name some.

Very little learning curve. http://notepad-plus.sourceforge.net

June 06, 2009
by TBNK
TBNK's Avatar

Oops! Can't believe Notepad++ doesn't have a Linux distro! Source code available, but no direct executables. I should have checked first. Sorry about that.

June 06, 2009
by mcai8sh4
mcai8sh4's Avatar

TBNK - I've heard a lot of good things about notepad++, I haven't used it myself, in windows I tend to use (yep, you guessed) Gvim.

But I might give it a go next time I'm in Win.

Wayward - haha, I knew there'd be a Emacs vs Vim here :D. And I'm liking the screenshot. There is, and never will be a 'winner' in that argument. It's just what you're used to. Emacs scares me, Vi comforts me. Perhaps, one day, when I'm feeling brave, I'll give it a go. It does seem a little heavy (not really a bad thing with todays computing power), massively powerful, but it is intimidating (although so is Vim initially).

Vim also has folding, and auto-complete. I think Emacs may be the best 'all rounder' (from what I've read) but the learning curve seems like too much of a challenge for me.

I think the easiest for a newcomer would be something like gedit, although I've never really used it. Another option is nano (dead easy).

So I think the advise is try everything... one of them will just seem right for you.

June 06, 2009
by DonNYC
DonNYC's Avatar

Thanks for all your input!

I think I will give Gvim a try. I know a little Vi from years ago when I was screwing around with openbsd.

I should have realized it come down to Vi/Emacs:)

June 07, 2009
by mcai8sh4
mcai8sh4's Avatar

I've installed code::blocks - looks like quite a full featured IDE. I must admit, I haven't tried using it for any Nerdkit programs but it seems to be able to use avr-gcc - so, with a bit of monkeying around, it could be pretty good.

(I think it's just a case of sudo apt-get install codeblocks - might be worth a look)

September 18, 2009
by pbfy0
pbfy0's Avatar

i like Xemacs a lot. here it is. alot like gnu emacs I like it more.

September 19, 2009
by tech20
tech20's Avatar

or you an go the simple route, also this way enforces better typing practices, Text Editor FTW, i actually never use IDEs or the other text editors(emacs, vim, etc.), it has basic syntax highlighting and a few other features, and the syntax highlighting works for many languages

September 19, 2009
by wayward
wayward's Avatar

Ah, gedit, sure, actually it's pretty powerful for such an unadorned application. It comes with a few useful plugins but there are many more to be found on its development page:

http://live.gnome.org/Gedit/Plugins

Post a Reply

Please log in to post a reply.

Did you know that two resistors can be used to make a voltage divider? Learn more...