18

So, I am primarily a .Net developer who does some stuff in Java, Python and a few others from time to time. I have heard a lot of people praise Vim and Emacs for greatly increasing efficiency once the basics are nailed down. I can definitely see how many of the features could be very useful with sufficient practice, and even believe the learning curve is probably worth the effort. However...it seems that you would really have to be some sort of wizard of macros and hotkeys to be as efficient in Vim or Emacs as the average developer is in Visual Studio, Netbeans, Eclipse, or other platforms. I have been starting to learn to use Vim and think some of its features are awesome (column editing for example), but it seems that many of the tools provided by the heavy weight IDEs simply could not be replaced buy even the most juiced up text editor. A few processes I would be skeptical anyone could ever be more efficient at in Vim include (I know VS best, so I will stick to those):

  • generating dbml files for Linq-to-SQL
  • Automated testing
  • designing UIs
  • Creating/organizing projects and solutions

I know Vim and Emacs can do a lot of the same things very powerfully that VS can (like intellisense, refactoring, etc.) and it may be able to do some or all of the examples that I provided, but is it realistic to say that someone working on these platforms would actually benefit from Vim or Emacs?

Morgan Herlocker
  • 12,722
  • 8
  • 47
  • 78
  • 2
    We work in Eclipse at my shop, but there's a guy here that uses Vim as his pimary editor and Eclipse just for compiling and code management type tasks. – Michael K Mar 25 '11 at 16:56

5 Answers5

14

You've got a mix of concepts going on there, which is maybe not surprising since VS combines a lot of rather disparate features together. One quote (from this site) suggests that Emacs isn't a good IDE, Unix is a good IDE. The idea being that in the Linux/Unix world, you rely on multiple specialized tools that play well together rather than one monolithic tool that does it all.

Now, I primarily program in C#, and I use VS to do that. I also really love Emacs and use it for basically everything else. Now, as you say, what you can do in Emacs and what is better to do in Emacs are distinct. But in many cases it isn't a 1-to-1 mapping and there are different ways to reach the same goals using a text editor and/or other tools.

I originally was going to address each of your points, but the answer always boiled down to "yes, you could" in some form. Typically you'd rely on either: 1) an outside tool (like a UI designer) to generate code for you, the import it; 2) automation support from inside the editor (like Elisp code in Emacs) to automate repetitive tasks; or 3) you'd adjust to using text-based tools instead of visual ones (like using MSBuild and writing your own project files instead of relying on VS's set up).

In the Emacs world, you don't have a tool that does it all, you have lots of tools and the ability to grow more tools as you need them. I don't yet know it well enough to do all that, so I use VS and I'm happy with the tools it gives me. VS is a really powerful, really good IDE. Now if I was doing Java, I'd have to debate which tool I'd use because I don't know Eclipse or IntelliJ very well. For any other language, Emacs pretty much wins because it's going to do a lot more for me than any other text editor or half-done IDE that those languages might use. (Except maybe Smalltalk, but that's a unique case.)

CodexArcanum
  • 3,421
  • 21
  • 23
6

but is it realistic to say that someone working on these platforms would actually benefit from Vim or Emacs?

Let me give you my example: I work on a system that is largely (but not 100%) coded with C#. The system cannot be built from Visual Studio - it is way too complex. Therefore, I don't have a sln file (some people tried maintaining one even though we don't build the product with it, but that turned out to be an impossible task) and don't have benefits of intellisense, code browsing, class diagrams, etc. The tool that works for me is vim + ctags. Even that is not perfect (ctags are easy to get confused), but way better than using an inferior code editor with no code browsing support.

Now, I understand that most .NET or Java developers are not in the same position as I am and they are probably better off using an IDE if it has a good code editor or at least an add-in that improves the default one. For Visual Studio there are add-ons like VsVim that can make the coding experience more enjoyable. Same for Eclipse AFAIK.

Nemanja Trifunovic
  • 6,815
  • 1
  • 26
  • 34
3

I doubt there are many who use VIM or Emacs exclusively any more. But I've yet to find a developer who doesn't use a text editor (be it one of those or something else) in lue of a full blown IDE for some things, often many things.

Remember that there's far more to your job than writing Java, C#, or C++ code. There's ANT scripts, makefiles, XML files, configuration files of many sorts. And for many small duties, the startup time of that IDE may simply be too long. Eclipse can take minutes to start, VS similar. To quickly change something in a single source, or to just check something in a known file, that's too long. Loading the file in VIM takes only seconds.

jwenting
  • 9,783
  • 3
  • 28
  • 45
2

I find that using an IDE and vim (my personal favorite editor) are not mutually exclusive concepts. When doing .NET development, I usually set up a hot-key combo that will open the current file I'm working on in the IDE in vim and put the cursor in the same place. This way if I want to do the sort of thing that vim is great at, (like using macros, vertical editing, re-indenting, diffing, etc), then I hit the key combo and bang I have my favorite editor up, do my changes, save the file and quit, and then I'm back into the IDE again (you can set it up so the file reloads automatically when it's been edited outside the IDE in VS). This way I get the best of both worlds.

I used to use scripting languages to manipulate text files in complicated ways. Once I discovered the power of using vim's macros (and some other features as well) I discovered that I can do these kinds of edits/manipulations far more quickly and efficiently than I could with a scripting language.

It's very common for me to generate one off shell scripts to do some complicated things using vim, execute the shell script I built and then throw it away.

my 2 cents :)

  • Yeah, I toyed around with a few plugins for VS to either jump me into emacs, use emacs as the "code editor window", or just using the emacs keybindings. Haven't loved any of those. A macro to pop-open emacs and jump to the same cursor spot sounds like a pretty cool idea though. I might have to try that. I mostly just copy-paste between the two when I need to do some heavy text manipulation. – CodexArcanum Feb 10 '12 at 23:04
0

Take a look at the OpenIDE and Continous Tests projects. First one focuses on adding .NET project support to any editor including VIM and Emacs. The other one is a continous test runner similar to ruby's AutoTest/ pythons Sniffer/Autonose. It can run as a VS plugin or standalone.

sumek
  • 101
  • 1