Live data from Hacker News

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

news.ycombinator.com

41–50 of 75 posts

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

#41
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.

It was a little more complex than that because the new stored procedure was indeed new and contained different structure, as far as I remember. ;) but yeah, copy pasting definitely takes a bit of the elegance out of it.

Most of what was demonstrated was Vim's superior capacity for jumping around to the correct place in your file precisely and quickly, which doing with a mouse is a nightmare.

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

#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 would `das`. Guess what you would use to delete a paragraph? Once you "grock" vim logic you can perform more complex actions without much cognitive overhead and with your fingers on the home row. Writing in Vim gives me a feeling of mastery and fluidity with the machine I have not felt since my competitive gaming days.

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

#43
post #35
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…

this: https://github.com/henrikpersson/rsub changed my life, now when I'm in ssh I can just "rsub this.txt" and it pops up in my currently running sublime window !

Neat—I've always known in the back of my mind something like this is possible but I just never looked around.

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

#44
> Can you show me how fast coding is in vim?

The tongue in cheek answer: My ability to code quickly is held back by my ability to create code structures in my mind, not type code into an editor.

I appreciate vim not because it's faster, but because I don't have to think about using a mouse, and I can just have a conversation with the editor.

"Correct inside these parenthesis" ci(

"Insert the text 'func Something() error {'"

"Delete three lines and paste them above the current line" 3ddP

"Goto the definition" gd

"Go back" C-o

"Write to disk and quit" :wq

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

#45
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…

> For example `daw` will delete a word. To delete a sentence you would `das`.

Huh. I use 'dw' and 'dl'. Why the extra key?

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

#47
post #45
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…

> For example `daw` will delete a word. To delete a sentence you would `das`. Huh. I use 'dw' and 'dl'. Why the extra key?

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.

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

#48
post #45
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…

> For example `daw` will delete a word. To delete a sentence you would `das`. Huh. I use 'dw' and 'dl'. Why the extra key?

I'd imagine it's because delete a word is easier to remember. Just sticks in the mind better, if that makes sense.

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

#49
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…

Fully agree. Each type of editor excels at different use-cases.

vim/emacs. Once you get up to speed, you can type or move around faster than with other editors. The main reason to use these are because you're already spending most of your time in the terminal because you're a) working in an ecosystem like rails where most of the tooling is run from the terminal b) doing sysadmin tasks like editing config files, running ansible or otherwise writing code over ssh. That's the sweet spot. Once you become comfortable there are ways to extend the editors to basically give them ide-like functionality.

Gui-based text editors like Atom, Notepad++, etc. These are the simplest editors to get up and running and have a low level of bloat. You usually don't need to spend time waiting for it to load whereas most IDEs take 1-5 minutes to load up fully. The main reason to use these is ease of use. If you don't need the complexity of vim or an ide, use this.

IDEs work best when you are dealing with large codebases, especially if you're not familiar with the codebase or the available functions. I personally maintain ~600k lines of mostly undocumented code at work. It uses a custom framework and was contributed to by dozens of developers. There an IDE is probably the best choice because it will catch errors (made by you or past developers), it will autocomplete function names and best of all, there is a jump to definition feature so you can quickly trace through code paths. After two years of working here I can use vim without too much of a dropoff

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

#50
post #45

Earlier quoted context omitted.

> For example `daw` will delete a word. To delete a sentence you would `das`. Huh. I use 'dw' and 'dl'. Why the extra key?

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.
Post reply on HN