Live data from Hacker News

Ask HN: Can you show me how fast coding is in vim?

news.ycombinator.com

61–70 of 75 posts

Re: Ask HN: Can you show me how fast coding is in vim?

#61
post #14

You first need to learn the differences between these editors, and determine what you expect from an editor. It's pointless to compare vim, atom, and eclipse in the same thought process because they're completely different tools for different tasks. > ... as to why vim is superior Vim is not superior categorically. If you expect your editor to autocomplete Java code for you and fill in imports and look up methods for…

Just pointing out... autocomplete of Java code is completely doable in Vim. As are file trees and many things that IDEs offer.

With that said, there are also plugins for many editors that make vim commands work in them. Which is a nice compromise if you like GUIs.

Re: Ask HN: Can you show me how fast coding is in vim?

#62
post #20

Earlier quoted context omitted.

Now, all that said, I do have a story about speed with Vim: When I was in high school, I bragged to my dad about typing something like 110 words per minute. He said… that's nice; I can type 1100 words per minute. Incredulously, I asked him to show me. He fired up his vim setup, opened a few files, started a new one, and sure enough in under 60 seconds he had a ~1100 "word" Sybase stored procedure (or something) writt…

With a ctrl-a, ctrl-c, ctrl-v loop you can "type" exponentially fast in any editor, I guess.

Vim has a lot of key commands to quickly working with blocks of text so it is a bit more nuanced than that.

For example, to copy 3 lines from the cursor position and paste them 5 lines earlier:

3Y :-5 p

(and there are faster ways, some people are wizards)

I also do relative numbering in my vim (I have the current line labelled as 0, the line above it -1, etc) so that I can move around relative to the cursor without having to count lines. You can also do absolute numbering but I find that tedious when you have large files.

Re: Ask HN: Can you show me how fast coding is in vim?

#63

I've seen a lot of comments saying this answer on stackoverflow opened their eyes to using Vim: http://stackoverflow.com/questions/1218390/what-is-your-most...

That article is incredible. I use vim pretty much exclusively and this reminded me of some stuff I don't use enough.

Re: Ask HN: Can you show me how fast coding is in vim?

#64
post #55
post #42

I would suggest that Vim is about more than speed, it is about flow. Think about the difference between ctrl-c and navigating to the menu to copy with your mouse. One just feels more fluid and requires less thinking. Games use extensive keybindings for the same reason. Vim in particular is a philosophy of keybindings. It has a syntax and a logic to it. For example `daw` will delete a word. To delete a sentence you wo…

`daw` will delete a word The equivalent in any Mac OS X text editor is: alt-left-shift-right-backspace.

It is not quite the same, as per above comment. `daw` will delete the word regardless of the cursor position. Vim has the idea of text objects beyond "end of the word."

Re: Ask HN: Can you show me how fast coding is in vim?

#65
post #50

Earlier quoted context omitted.

Using 'dw' deletes from the cursor until the end of the word. Using 'daw' deletes the whole word "around" the cursor (hence 'a' command) - meaning you don't have to pay attention to the cursor position, it could be on the start/middle/end of the word and the result would be the same.

Ah. Now I look like I'm vim-dumb.

No worries. There's always more to learn. `dw` is a motion command as in "delete to the end of the word. `daw` is a text object command as in "delete a word." There is also a difference between `daw` and `diw`, which is delete inner word, and `daW` which is delete a WORD.

See http://vimdoc.sourceforge.net/htmldoc/motion.html#object-mot...

and

http://vimdoc.sourceforge.net/htmldoc/motion.html#word

Re: Ask HN: Can you show me how fast coding is in vim?

#66
post #14

You first need to learn the differences between these editors, and determine what you expect from an editor. It's pointless to compare vim, atom, and eclipse in the same thought process because they're completely different tools for different tasks. > ... as to why vim is superior Vim is not superior categorically. If you expect your editor to autocomplete Java code for you and fill in imports and look up methods for…

Just pointing out... autocomplete of Java code is completely doable in Vim. As are file trees and many things that IDEs offer. With that said, there are also plugins for many editors that make vim commands work in them. Which is a nice compromise if you like GUIs.

It's just not the same as with Eclipse. I'm not sure what it's called or if it has a name, but the Eclipse equivalent to VS Pro's IntelliSense, in which it's actually aware of code that you've previously written in other files or third party libraries, and it pops up as a little list next to what you're typing--is it possible to have that level of functionality in Vim?

It's the actual awareness of code you've previously written, the detection of possible issues before you compile--IDEs tend to read your code with you and help out a lot in many more ways... I suppose it's not "autocompletion" but I was hoping to successfully use that as an umbrella term.

Re: Ask HN: Can you show me how fast coding is in vim?

#67
post #66

Earlier quoted context omitted.

Just pointing out... autocomplete of Java code is completely doable in Vim. As are file trees and many things that IDEs offer. With that said, there are also plugins for many editors that make vim commands work in them. Which is a nice compromise if you like GUIs.

It's just not the same as with Eclipse. I'm not sure what it's called or if it has a name, but the Eclipse equivalent to VS Pro's IntelliSense, in which it's actually aware of code that you've previously written in other files or third party libraries, and it pops up as a little list next to what you're typing--is it possible to have that level of functionality in Vim? It's the actual awareness of code you've previou…

Yeah, it's probably not as good but AFIAK it does know about your other class files and things like that so for most people it will get the job done.

Take it with a grain of salt, though. There are 3 (that I can find) Java auto-complete plugins for Vim and I have no idea if any of them are good. (I don't develop in Java often and when I do it's trivial code so I haven't had a chance to try them)

Re: Ask HN: Can you show me how fast coding is in vim?

#68
post #59
post #58

Earlier quoted context omitted.

Where is the pun?

I think it's the fact that it's a training for shortcuts and the training in itself is a shortcut (i.e. short, concise etc.)

I'm not sure if the pun jury would agree that that's actually a pun.

Re: Ask HN: Can you show me how fast coding is in vim?

#69

Earlier quoted context omitted.

With a ctrl-a, ctrl-c, ctrl-v loop you can "type" exponentially fast in any editor, I guess.

Vim has a lot of key commands to quickly working with blocks of text so it is a bit more nuanced than that. For example, to copy 3 lines from the cursor position and paste them 5 lines earlier: 3Y :-5 p (and there are faster ways, some people are wizards) I also do relative numbering in my vim (I have the current line labelled as 0, the line above it -1, etc) so that I can move around relative to the cursor without h…

I know, I've been using vim pretty exclusively for the last 15 years or so.

Re: Ask HN: Can you show me how fast coding is in vim?

#70
post #68
post #59

Earlier quoted context omitted.

I think it's the fact that it's a training for shortcuts and the training in itself is a shortcut (i.e. short, concise etc.)

I'm not sure if the pun jury would agree that that's actually a pun.

Indeed. But fingers crossed until they reach a Virdict. (I'll show myself out hehe)
Post reply on HN