Live data from Hacker News

Ask HN: Power of VIM?

news.ycombinator.com

1–10 of 21 posts

Ask HN: Power of VIM?

#1
Right now, I use Notepad++. I've been thinking of switching to vim. I'd like to know ... why? what's the power of vim? how can it increase your productivity?

Re: Ask HN: Power of VIM?

#2
Why not Emacs? Just kidding.

vimtutor will answer a lot of your questions.

The kernel of the matter is the ability to do everything from the keyboard. You never have to use the mouse. That allows things to be much faster. That is a gross oversimplification, but I hope it helps.

Re: Ask HN: Power of VIM?

#3
Someone steal this idea: A site with screencasts of people writing software in the editor of their choice. Let people browse videos by editor, programming language, whatever else.

Re: Ask HN: Power of VIM?

#4
I think it ultimately depends on your personal working style. Some advantages to vim are:

+ it's simple UI (all text-based)

+ it's lightweight

+ it is modal (which can be easier if you're a touch typist)

+ you never have to use the mouse (just like what lukeqsee said)

+ lots of plugins exist to enhance the functionality

Hope this helps!

Re: Ask HN: Power of VIM?

#5
I use vim over other editors because I feel vim is a good tool. I know it's a good tool because it gets out of my way and lets me interact with text without having to trick an editor into doing it, which is how I felt with editors like Notepad++ and others like it.

It took me a while to get to this point, but I feel the investment was worth it. Just take a week and force yourself to use nothing but vim (and try learning as many features as you can) and see if it jives with how you think. If it doesn't, try emacs.

edit: Best way to see the power of vim is to watch someone edit text who's proficient with it; some people are so good with it you'd be convinced they mmap()'ed the file to their head and are just interacting with it in real time.

Re: Ask HN: Power of VIM?

#6

I think it ultimately depends on your personal working style. Some advantages to vim are: + it's simple UI (all text-based) + it's lightweight + it is modal (which can be easier if you're a touch typist) + you never have to use the mouse (just like what lukeqsee said) + lots of plugins exist to enhance the functionality Hope this helps!

+ it's much more dynamic with integration of compiler than any other editor (I know) and supports even integration plugins for gdb

+ it will help you prevent mistypings during other actions (thanks to insert mode) and sometimes I think it even helps to write better code.

Re: Ask HN: Power of VIM?

#7
for me it's about speed. you can do almost every task you need as a programmer way faster with vim, than with a conventional editor. if you have some programming experience you can change its behaviour to exactly the way you like it. http://vim.wikia.com/wiki/Best_Vim_Tips if you really like doing things with the keyboard, vim will be the right thing for you...

Re: Ask HN: Power of VIM?

#8
post #3

Someone steal this idea: A site with screencasts of people writing software in the editor of their choice. Let people browse videos by editor, programming language, whatever else.

There is a great collection of Vim screencasts at: http://vimcasts.org/

Peeepcode has a "Meet Emacs" screencast available for about $9 as well here: https://peepcode.com/products/meet-emacs

It's not quite the site you describe, but I've learned quite a bit watching Vimcasts.

Re: Ask HN: Power of VIM?

#9
post #8
post #3

Someone steal this idea: A site with screencasts of people writing software in the editor of their choice. Let people browse videos by editor, programming language, whatever else.

There is a great collection of Vim screencasts at: http://vimcasts.org/ Peeepcode has a "Meet Emacs" screencast available for about $9 as well here: https://peepcode.com/products/meet-emacs It's not quite the site you describe, but I've learned quite a bit watching Vimcasts.

[deleted]

Re: Ask HN: Power of VIM?

#10
Probably just a few things contribute to most of the "productivity" you can get from vim:

1. Commands to move around the screen and file under edit: with at most 2 keystrokes you can (a) move to next word (b) move to previous word (c) move to start of line (d) move to end of line (e) move to start of file (f) move to end of file (g) move 1 character in any direction (h) move to the end of next word (i) move to end of previous word (j) move to the next word like the one under the cursor (k) move to the previous word like the one under the cursor. Other commands exist to make moving around really efficient: you rarely take your hands off the keyboard to do mousing.

2. Use of regular expressions for searching for text, and as a way of distinguishing edits. You can do things like change all tabs to 4 spaces with a single command, or change the tabs at the beginning of the line to 4 spaces. This is an astoundingly powerful idea, rarely exploited however.

3. Vim, improving on vi, has the "visual" modes, where you can use movement keys (see item 1) to choose a hunk of a file, then apply edits or change commands to that block.

4. Vim isn't really modal like all the propaganda has you believe. Sure, 'i' or 'a' or 'I' or 'O' will put you in what you can naively interpret as "literal typing mode". But you should really think of those as commands, followed by text, as you can do 5Ax and append 5 'x' characters to the end of the line. If you think about what most people call "modes" correctly, you can pull off a lot of interesting and fast edits.

5. It's fast and has very few built-in limits (line length, file size, window size etc etc).

Post reply on HN