Hacker News new | past | comments | ask | show | jobs | submit login
Weekly Vim Focus (phonons.wordpress.com)
46 points by phreeza on Feb 10, 2012 | hide | past | web | favorite | 24 comments

For those wishing to ingrain Vim keys into their muscle memory, and improve their browsing experience, I recommend the Vimium[1] extension to Chrome. Additionally, Firefox has Vimperator[2] and Opera has VimOperate[3] (not as many features on the latter unfortunately).

[1]https://chrome.google.com/webstore/detail/dbepggeogbaibhgnhh... [2]https://addons.mozilla.org/en-US/firefox/addon/vimperator/?s... [3]https://addons.opera.com/en/addons/extensions/details/vimope...

pentadactyl is the best vim keybinding plugin for firefox now. It used to be vimperator though. Check it out http://dactyl.sourceforge.net/pentadactyl/

whats better about pentadactyl

From the Pentadactyl home page:

"Pentadactyl was once called Vimperator, initially written by Martin Stubenschrott, then developed and maintained by Doug Kearns, Kris Maglione, and several other invaluable contributors. Doug and Kris, the primary Vimperator developers for several years, have left the Vimperator project and now develop and maintain Pentadactyl in its stead."

So it's essentially the successor to Vimperator, or at least a well-maintained fork by the original authors.

Doesn't take a long time after you remap the arrow keys to be broken of that habit. I love not having to move my hands for the small navigation things now. Highly suggested.

noremap <Up> <nop>

noremap <Down> <nop>

noremap <Left> <nop>

noremap <Right> <nop>

Isn't that annoying in insert mode?

I'd recommend against navigating while in insert mode.

You shouldn't be navigating in insert mode. If you mess up a word it's easier to ctrl-w to delete the last word and retype it.

Just as a datapoint: I've been using vim for >12 years and I still use the arrow keys. Don't sweat the dogmas too much, try out what works best for you and stick with it.

I don't want to come across as a dick, but as another data point my boss has typed on keyboards for longer than I have been using computers and he still types with two fingers. Just because he is not crippling himself too much doesn't mean that he is getting anywhere near the same utility out of it that a touch typist would.

There's little correlation between finger count and utility.

I use only 4-5 fingers most of the time and go faster than most touch typists.

'noremap' has no effect on insert mode.

  :help noremap

When starting with Vim I completely changed all of the software that I interact with. That means: mutt for email, vimperator, vimprobable or vim plugin for chrome, mocp with vim keybindings, newsbeuter and dwm with simple keybindings.

After getting comfortable with this setup, I find it is now a pain to drop down to use the arrow keys. This type of setup really helped me 'convert' to a vi way of thinking. I am still learning, but am liking the minimal setup.

Learning how to use "t" was a game-changer for me. Before that, I used "f", which cost me a fair bit of time when deleting things since the extra character was deleted. (c/d)t<space> is a great sequence that I use a lot.

I suggest VimGolf as a way to learn new commands, especially how to use them efficiently. It was how I learned to use "w" and "b", as well as macros.

I didn't use the hjkl keys until two things happened, about the same time. The first was getting a job as an SA, where on older (and less GNU) operating systems would NOT support the key mappings.

The second was once my job was automated, I got to play a bit of nethack. A text based game that uses that style of navigation did help a bit.

One thing that bothers me and I couldn't find an answer for vi/vim is how do you undo one character at a time? Command u always undo all the text typed since the last insert. Something like ctrl-Z would be great.

You can modify undo to chunk based on words with the following:

:inoremap <Space> <Space><C-g>u

<C-R> to paste in insert mode?? That doesn't work for me.

followed by the register you want to paste. " is the default register you get when usually pasting.

oh. Thanks.

Upvote for teaching me about <C-R> to paste in insert mode.

For a long time user, usage of up/down/left/right should be punished!

I bow my head in shame and promise to mend my ways.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact