views:

1283

answers:

6

First of all, I love vim. I have been using vim for a few years now and it has changed my perceptions of what an editor is capable of. I also love modes.

However I am thinking of switching and here is why:

I really like Xcode and it has emacs bindings. I use Mac OS X and it has emacs functionality in all text input fields. I hate using the mouse, and I think switching would make sense.

I'm also kind of tired of doing all my work in terminal windows: with Xcode I would have access to a great IDE, and a great rat-free editor (emacs).

Having said all this, I find emacs Meta keys approach a little uncomfortable, and a little daunting, plus I have spent a lot of time learning to do things in vim.

Should I switch? And if so has anyone else made this switch or used both vim and emacs and have an opinion about which they prefer and why?

Also for emacs users out there who have used Xcode, how good is the emacs implementation in Xcode? Worth the switch?

+1  A: 

No. Once vimer is forever vimer.

Vladimir Dyuzhev
+2  A: 

This may be easier: Vi Input Manager Plugin (works in Xcode)

Chad Birch
+6  A: 

Keep in mind emacs has viper-mode which allows you to continue to use your current vi key bindings. As for the meta-key thing, I mapped my caps-lock to ctrl and my right-shift to alt and have been pretty happy with it.

mletterle
Unfortunately, viper-mode is not VIM. It's just vi key bindings. There's another addon for emacs vimpulse that supposedly is closer to VIM than vi.
projecktzero
+1  A: 

The only reason I would switch to emacs (and I try every once in a while) is for the wonderful elisp packages -- specifically all the special editing modes and console/debugger modes.

I have never used Xcode but I assume from your question that these are emacs key-bindings only. I.e., you can't use any emacs package with Xcode.

So no. I'd say don't switch to emacs. If you want to use Xcode either learn the key bindings or use some Xcode vi mode (as has been suggested by others).

nimrodm
+15  A: 

Why can't you use both? Using Emacs doesn't mean you have to stop using Vim.

Benefits of learning and using both:

  • Sometimes one editor is better than the other for some particular language. Better syntax highlighting, better indentation rules, better macros, better integration with external tools, or whatever. You will always be using the best editor for the job if you're able to choose between Vim and Emacs.
  • Sometimes a community gravitates toward one editor or the other. You can participate in the community no matter which is used.
  • You can learn neat tricks from one editor and port them to the other. Both editors have features that you'd never think of if you stuck to one exclusively.
  • If some computer only has one or the other set up, you can still use it effectively.
  • Learning is fun.
  • Geek cred.

Disadvantages:

  • Learning takes time and effort.
  • Fragmentation and duplication of effort (all of your favorite tricks and keymappings have to be written twice, in Vim script and elisp).

I see the advantages outweighing the disadvantages.

I use Emacs for Lisp code, and because I use Lisp for web development, I also stay in Emacs for CSS and Javascript and such. I use Vim for Ruby, Python, Perl, PHP, BASH, plaintext, and almost everything else. Both editors have strengths and weaknesses, but mostly both have strengths.

The only way to know if you like Vim or Emacs better is to invest time in both, so you can make an informed decision. Maybe you'll find that Emacs fits the way you think and work better, or maybe not. It's such a subjective thing that the only way to know is by trying.

Text editors aren't religions, and the free disk space in your brain is for all intents and purposes unlimited. So use both and enjoy.

Brian Carper
+3  A: 

There is not much Emacs support in Mac OS X and Xcode. It is mostly a few keystrokes.

Mac OS X comes with a terminal version of Emacs. A very good Emacs for Mac OS X is Aquamacs.

Rainer Joswig