Advertisement

vim/emacs vs ide(s)

Started by May 15, 2004 09:49 PM
29 comments, last by varanid 20 years, 7 months ago
Quote:

There are a million emacs scripts that allow you to flip buffers with one key-binding. They're really convenient and useful. Search for bubble buffers or something like that.

Thanks for the recommendation, it is really helpful :)
Quote:
Original post by Arild Fines
Quote:
Original post by crupp
but the coolest feature is (IMHO) that you can use those thousands of vim-features without using the mouse ever. That way your hands stay on the keyboard, and if you are able to type fast you'll always be faster then if you switch from keyboard to mouse, make some clicks, then switch back to the keyboard etc. It's faster, and better for your forearms.

However, actually typing code is a very small part of the development process. Debugging, refactoring, navigating the code(which vi is really bad at) takes up way more time.


You are right that typing the code is the easy part, and that debugging, refactoring & navigating takes way more time.

But I totally disagree with that next thing, I think that what Vim is really GOOD at is the navigating and refactoring. The whole point of having a split between command mode and insert mode, is so when you are in command mode, all of the tasks not related to typing (as in, navigating & editing) are super easy and quick to do. Sure, it takes a while to *learn* all the command-mode keys, but that is more of a problem with Vim's harsh learning curve.

As far as debugging.. yeah Vim sucks for debugging.
Advertisement
Quote:
Original post by pinacolada
Quote:
Original post by Arild Fines
Quote:
Original post by crupp
but the coolest feature is (IMHO) that you can use those thousands of vim-features without using the mouse ever. That way your hands stay on the keyboard, and if you are able to type fast you'll always be faster then if you switch from keyboard to mouse, make some clicks, then switch back to the keyboard etc. It's faster, and better for your forearms.

However, actually typing code is a very small part of the development process. Debugging, refactoring, navigating the code(which vi is really bad at) takes up way more time.


You are right that typing the code is the easy part, and that debugging, refactoring & navigating takes way more time.

But I totally disagree with that next thing, I think that what Vim is really GOOD at is the navigating and refactoring.

Then we have a complete disagreement of what navigation and refactoring actually means. For my needs, those two things cannot be accomplished unless the editor has access to some kind of parse tree for the source code being edited. vim is totally stupid that way - it only sees and understands raw text. It has no way of understanding the real semantics of the code. IDEs like Eclipse and Visual Studio .NET actually compiles the code in the background, generating a parse tree which they use to provide navigation, on-the-fly error reporting, intelligent renaming, flow analysis and so on. vim doesn't even come close to providing such services.
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
Quote:
Original post by Arild Fines
Quote:
Original post by pinacolada
Quote:
Original post by Arild Fines
Quote:
Original post by crupp
but the coolest feature is (IMHO) that you can use those thousands of vim-features without using the mouse ever. That way your hands stay on the keyboard, and if you are able to type fast you'll always be faster then if you switch from keyboard to mouse, make some clicks, then switch back to the keyboard etc. It's faster, and better for your forearms.

However, actually typing code is a very small part of the development process. Debugging, refactoring, navigating the code(which vi is really bad at) takes up way more time.


You are right that typing the code is the easy part, and that debugging, refactoring & navigating takes way more time.

But I totally disagree with that next thing, I think that what Vim is really GOOD at is the navigating and refactoring.

Then we have a complete disagreement of what navigation and refactoring actually means. For my needs, those two things cannot be accomplished unless the editor has access to some kind of parse tree for the source code being edited. vim is totally stupid that way - it only sees and understands raw text. It has no way of understanding the real semantics of the code. IDEs like Eclipse and Visual Studio .NET actually compiles the code in the background, generating a parse tree which they use to provide navigation, on-the-fly error reporting, intelligent renaming, flow analysis and so on. vim doesn't even come close to providing such services.


I don't think an editor needs to deeply parse the source code in order to provide enough useful features.. you can get pretty far with an editor that's ignorant of such things.

Vim has ctags, makes it really easy to "follow" function calls downward. The tag thing even keeps a stack, so when you are done exploring tags downward, you can pop back up. The only major shortcoming to ctags is that it can't figure out the difference between two functions/variables with the same name, so it will prompt for clarification.

I have a script called taglist.vim, which creates a window that looks and behaves just like the "ClassView" browser in VS.

Vim has folding. I also have a script that does function-wise folding, so if I am looking for a certain place in code, the typical sequence of actions is this: activate the function-wise folding (so now the implementation of each function is hidden, only the function names are shown, and the entire file is only 1 or 2 screens high), navigate the cursor to the function I want, then un-fold only that function. I could also use the taglist to navigate like this, but I prefer navigating in the file itself.

I don't think on-the-fly error reporting is that great, it only takes a few seconds to run the compiler. This is probably more valuable when you're working on very large projects.

I don't know what you mean by "intelligent renaming", but it doesn't sound all that useful.

The only feature from VS that I truely miss is the pop-up list of object members (intellisense).
Quote:
Original post by pinacolada
I don't think an editor needs to deeply parse the source code in order to provide enough useful features.. you can get pretty far with an editor that's ignorant of such things.

Vim has ctags, makes it really easy to "follow" function calls downward. The tag thing even keeps a stack, so when you are done exploring tags downward, you can pop back up. The only major shortcoming to ctags is that it can't figure out the difference between two functions/variables with the same name, so it will prompt for clarification.

I'm familiar with ctags. I find the feature woefully inadequate.

Quote:

I don't think on-the-fly error reporting is that great, it only takes a few seconds to run the compiler.

Yes, if you're writing "Hello world".
Quote:

I don't know what you mean by "intelligent renaming", but it doesn't sound all that useful.

I'm referring to renaming a member of a type and have all references to that member renamed as well. It *is* very useful, especially when performing refactorings.
Quote:

The only feature from VS that I truely miss is the pop-up list of object members (intellisense).

No disagreement here.
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
Quote:
Original post by bytecoder
Quote:

XEmacs has tabs.

Really? I didn't know that. Oh well, all I really need is just to enlarge my XEmacs window and keep the buffer list on the bottom so I remember what the names are. I'm starting to like this no-mouse interface :)
p.s. You wouldn't happen to know how to disable the toolbar in XEmacs, do you? I tried putting a "(set-specifier default-toolbar-visible-p nil)" in .emacs, but it gives me an error message saying:
Symbol's function definition is void: set-specifier


to disable the toolbar, at least in emacs: "M-x tool-bar-mode"
that is, press the Meta-key and x then type tool-bar-mode
Advertisement
Quote:

Quote:

I don't think on-the-fly error reporting is that great, it only takes a few seconds to run the compiler.

Yes, if you're writing "Hello world".


What kind of system are you using to compile, a TI-82? The projects I work on average 10k lines and they compile in a few seconds. I know 10k is considered pretty small for software, but even for a huge project, you only have to recompile the changed files anyway.

Quote:

Quote:

I don't know what you mean by "intelligent renaming", but it doesn't sound all that useful.

I'm referring to renaming a member of a type and have all references to that member renamed as well. It *is* very useful, especially when performing refactorings.

That does sound kind of cool, but it's a rare occasion that simple search-and-replace doesn't do a fine job.

Anyway let me clarify that earlier claim: when I said that "vim is really good at refactoring", I meant "refactoring" as in "text editing and manipulation". In those visual IDEs, the way to manipulate text is always the same: left hand on the Control, X, C, V keys, and right hand on the mouse. Manipulating text is several times easier & more efficient in Vim- I'm not going to start to list all the great tricks you can do, because that would be a long list. I'll just say that if you have ever watched a Vim pro rearrange a piece of code, you'll agree that it looks like magic.
Win32
-----
Java - IntelliJ -- By far the best, but is a memory hog
C++/ASM - Visual Studio Ent Arch
Emeditor - VBScript/Batch files etc..

Unix
----
VI - Unix - Cannot beat this beauty

Mac
---
I dont give a f*** about Mac's (only kidding) ;)
Quote:
Original post by pinacolada
Anyway let me clarify that earlier claim: when I said that "vim is really good at refactoring", I meant "refactoring" as in "text editing and manipulation".

http://www.refactoring.com. There's a whole market of tools for this.
Quote:

In those visual IDEs, the way to manipulate text is always the same: left hand on the Control, X, C, V keys, and right hand on the mouse.

I have a hard time coming up with anything I can't do in VS.NET using only the keyboard. It comes with an incredible range of keybindings out of the box, and you can of course create your own for the ones that are omitted. All the functionality in VS.NET can be accessed through the Command Window - f.ex, I usually open solutions and files by pressing Ctrl-Alt-A(Open command window) then entering of \path\to\solution.sln on the command line.
VS also has a great macro facility, and regardless of what you think of VB as a macro language, at least VS macros don't look like line noise.
Quote:

Manipulating text is several times easier & more efficient in Vim

Manipulating text isn't very interesting. I am writing code - I want an editor that understands code.
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
I think you don't know Vim very well if you're saying that the VS key bindings are nearly as cool as Vim's. And as for macros, macros are only useful to me if 1) I can define them quickly, and 2) I have quick access to flexible actions like: word-wise movement, word-wise selection, blockwise movement/selection, and multiple copy/paste buffers. VS might have 1 but it doesn't have 2.

Here's a question. Say you have to type a bunch of lines in a row, and they are all really similar and they follow a pattern. How many lines long does the thing have to be before you do the extra work to write a macro? If it was 100 similar lines, would you write a macro? 20? 10?

For me, I would probably record a macro in as few as 5 lines. Lets say I had to write this block:

  case AVK_0: ch = '0'; break;  case AVK_1: ch = '1'; break;  case AVK_2: ch = '2'; break;  case AVK_3: ch = '3'; break;  case AVK_4: ch = '4'; break;  case AVK_5: ch = '5'; break;


The exact sequence of keystrokes I would use in Vim is:
acase AVK_0: ch = '0'; break;<escape>q1yypee<control-a>eeee<control-a>q4@1

So yeah, I know that looks like junk, I only wrote it out as an example of how quickly you can do certain routine actions. And this isn't a special case, there are lots of common programming actions that are made easier.

This topic is closed to new replies.

Advertisement