views:

7961

answers:

16

Hi I mostly do C++, Objective-C programming. And I found Xcode plus an auto completion/macro plugin (Completion Dictionary) quite adequate.

However, all people seem to praise over their pure text editors. I tried Textmate for a bit; liked its simplicity but dislike its files/framework handling.

Am I missing something here? Or, do Vim or Emacs have auto-completion as good as Xcode?

A: 

Xcode is more of an IDE, whereas emacs and vi are for pure text (though they have massive extensions to them). This is preferable if you're on an older system or over an SSH. In addition, they're pretty much on every UNIX based computer, whereas XCode is proprietary Apple software.

samoz
+7  A: 

What you are missing is that Emacs and Vim are actually IDEs.

Svante
You might be able to make a case for Emacs, but not so much for Vim.Unix is the best IDE. Vim or Emacs is just a part of that.
mathepic
+83  A: 

Pull up a chair son, let me speak on this.

Well before the days of Xcode, there was VIM and Emacs. I know it's hard to imagine, but it's true.

Many people got accustomed to VIM/Emacs, and thus continue to use it.

Emacs is extremely customizable, and offers pretty much everything you can imagine (including a built in shrink and the towers of hanoi). You can easily call compilers from Emacs, and create your own extensions as needed.

VIM has incredible regex engine (Emacs does as well) and is very handy because (VI) comes with pretty much every Unix OS, and works fantastically if you don't have arrow keys (yeah yeah, real old school). People are very good with using keys to move around documents, without having to use the mouse.

The same is true with Emacs as well, but for me, I find cursor motion much easier on VIM.

The text editor war is fueled with as much religious zealotry as the Mac vs PC war, and the answer is pick the best that works for you. If you like Xcode, great, continue to use it, however good luck if you're ever forced to work on a PC or Linux machine. Personally, I use Emacs to code, VIM to manipulate text and Firefox to look at lolcats.

Alan
Wouldn't hurt to add fuel to the fire, and add that those of us who use vim/emacs like being able to use that editor on every computer they use, from the NetBSD-powered toaster, to the antique m68k-based machine, and the IBM Power 5, as well as Windows and Mac OS X. But XCode only works on Mac OS X.
Arafangion
@Arafangion -- not to mention that they work incredibly well over an remote connection, even with high latency. (e.g., developing code on a machine on another continent via a laptop with a wifi connection.)
Boojum
+7  A: 

vi is ubiquitous on UNIX systems, and Emacs almost so. AFAIK, Xcode is on one platform.

Having a powerhouse IDE is a great thing, but everyone should have a smattering of skill to keep them functional on any platform they might be dropped into.

dcw
+5  A: 

It's all up to your preference.

Some people like to work with lightweight texteditors like (g)vim, emacs, pico, etc. Others like to work with IDEs like MS Visual Studio, Eclipse, Xcode.

As long as your environment is compatible with the text editing technology, it's all up to you.

By the way, I like working with Eclipse and vim because they are what I used to learn programming ;)

bLee
+1 for calling Emacs a lightweight text editor.
starblue
Yes, because us vim users know Emacs is a lightweight OS. :-)
Greg
Fun fact: most vim sessions use as much RAM as an Emacs session.
Nathon
+3  A: 

No, not really. It's a matter of preference really. I liked working in Visual Studio 6, but nowadays the newer versions are just too bloated. So if I can do something outside VS I usually do it without opening the whole IDE box.

On windows I like notepad2 and gvim. I've customized vim to the point where it suits my needs perfectly, so I don't have to think about what and where.

But, it's good to mention that (you could also figure that out by yourself by reading these kinda posts) a lot of users uses vim/emacs/... 'cause of the heard-its-the-best/cool-factor/actual-usability. So if it doesn't suit you, don't use it. Nobody's gonna look you the wrong way cause of that.

ldigas
+11  A: 

What you're missing is all the microseconds you spend repetitively mousing through the poorly laid out xcode GUI (or any IDE) menus. This adds up to a ton of time if you code for hours per day, per month, etc., and is my main reason for sticking with a highly customized MacVim. With clever macros and a mastery of vim's key commands, going keyboard native allows me to code so much faster. This reason is also why I don't like TextMate (tried it out!). I have xcode configured to open files in vim, now if I could only make the xcode editor disappear entirely! I tried looking into the Vi Input Manager plugin, which apparently embeds vim into xcode, but OSX input manager's got broken in Leopard, and it doesn't appear to work anymore.

korch
so you meant you still use Xcode to manage the project/frameworks all that right?
ivanTheTerrible
Have you filed bugs at http://bugreport.apple.com/ for any aspects of Xcode that you find poorly laid out?
Chris Hanson
+2  A: 

I personally love emacs. I've used vim and a handful of IDEs. Vim and emacs both have great communities where people are willing to code up features for just about any language. I don't know of any IDEs that, say, support Haskell. It all depends on what's important to you. Both have extension languages, though IMO, emacs lisp is the better of the two. The ability to ignore the mouse is the main thing I like as well. So many IDEs also feature emacs and vim compatibilty modes or extensions. They both have a large time investment, but both are worth it. Sooner or later, you will choose which suits you, vim/emacs/IDE, and then stick to improving your skills with it.

+1  A: 

When you are using Emacs, you can install Cedet or Autocomplete package to use name completion for some languages (C++ is pretty good, while Obj-C is still not supported), in addition to rich editor functionality

Alex Ott
+2  A: 

I really don't understand why emacs props up when people talk about text editors. In my experience it's more like eclipse (or one of those other platforms/IDEs) than vi because it is an environment, which happens to be good at text editing.

As an IDE emacs features version controle, live compilation, spell checking, auto completion, debugging, code browsing and lots more for a wide variety of SDKs. For the rest of your computing needs it's an email/news/web/irc/twitter/xmmp client, calendar, organizer, calculator, terminal emulator, remote editing, speadsheets, games etc. etc. etc.

After Dijkstra: "Emacs is no more about text editing than astronomy is about telescopes"

remvee
+1  A: 

For me most the two most important features are:

  • Emacs key bindings, as that is what my fingers are compatible to.

  • Open-source, for the freedom it provides. Being tied to one platform is anathema.

These days I mostly use Eclipse for programming (set to Emacs keybindings) and FSF Emacs for reading mail and some occasional LaTeX.

starblue
+1  A: 

I use Vim mostly for the input model. Once you have become proficient in the input model, going back to an editor where you are forced to use a mouse feels clumsy and ultimately (at least to me) irritating. It is a lot more efficient to type "ci'" to alter all the text between two single quotes, then taking your hands off of the home row, finding and selecting the text with the mouse and finally hitting 'delete'.

I have only used Emacs briefly and while I prefer Vim, I am jealous of some of its features. But I ultimately went with Vim because I find the chord-input model that Emacs uses to put unnecessary strain on my fingers.

Flemish Bee Cycle
+1  A: 

I have Xcode and TextMate and I don't use them although I know they can be very powerful. Instead I use Vim (or MacVim if you prefer). Why ?

Because it's light, fast, addictive, powerful, customizable... I could go on like this for a long time but the most important thing is that I can do all I want with Vim.

Whatever the editor you use, the best editor is the one you master (almost) perfectly.

Taurus Olson
A: 

I don't use vi to do my coding; however, I do, when available, use vi emulation in my editors. When I am doing Java coding in IntelliJ I use the IdeaVIM plugin which gives me vi support in IntelliJ's editor. This means I almost never have to take my fingers off of home row. I navigate with the keyboard (h,j,k,l), cut/paste with yy, dd, etc. And of course when I do need the power of a full feature GUI editor vi emulation doesn't keep me from using those features.

It drives me nuts that XCode doesn't have vi emulation in its editor. Seems like functionality that any decent IDE should have.

+1  A: 

TextMate just feels lighter to me. Off the top of my head:

  1. It has great support for jumping between files and methods within files. Think Quicksilver for files/methods. With a file open for editing, hit command-shift-t to bring up a floating panel listing all the methods in the file. Start typing and the list filters itself down. Select the method you want and hit return to jump to it. Xcode has something like this but the sting matching is more literal.

  2. Lots of built in text expansion. Type a trigger and hit tab to have it expanded. For example, on a new line typing m and then hitting tab creates a method for you. The tab key then intelligently jumps to the various parts of the inserted text so that you can edit them in place. These are such a huge timesaver it's ridiculous.

  3. Nice plugin support for Subversion and Git. Probably other VCSs too.

  4. Completions (like Xcode) and history. TextMate allows you to tab-complete basically any text that exists in the file. So once you type a variable name or method call once, you can use tab to auto-complete it anywhere in that same file.

  5. Smart past board with history, nice built in diffs, theme support, good keyboard support, find in files and across projects (with RegEx) and probably more that I'm forgetting.

Anyway, that's enough from me.

Kevin
+1  A: 

The main reason you seem to think people like Emacs/Vim is for code completion. People like Emacs/Vim cause they are both MADE for editing text. You have control and options available to you that other editors just don't have. Once you get REALLY good at using one of these programs you want these key bindings / commands available everywhere. Macros, regular expressions, moving around by search/word/paragraph/function, interfacing with version control, complicated undo/redo and copy/paste functions and extension options are just a FEW of the things that these editors do really really well.

Code completion is just one of MANY things that can make writing programming easier. Emacs/Vim can handle ALL of them (natively or by exntensions).