Live data from Hacker News

Efficient Editing With vim

jmcpherson.org

61–70 of 125 posts

Re: Efficient Editing With vim

#61
post #26
post #8

Nooooo all of the secrets of our vim cult revealed in one easy-to-read document! Vim is hard, people! Trust me. You're not smart enough to use it. :-P

Actually, I find that Emacs has a steeper learning curve than Vi/Vim. I had an easier time learning to switch between command/insert modes than to try and get comfortable with all of the Meta-/Control- sequences in Emacs. {edit} not to start a flame war.. to each their own {/edit}

I find that Vim's learning "curve" is almost vertical at first, but Emacs' gets worse as it goes while Vim's gets better. There's an image here that illustrates the phenomenon pretty well:

http://sob.apotheon.org/?p=981

It's sort of a "ha ha only serious" moment.

Re: Efficient Editing With vim

#62
This is one of the best articles to speed up vim proficiency. When I read it a long while ago it really made a difference in my speed and typing joy.

If you guys love these kind of vim related posts, a while ago I had collected some good articles with brilliant tips:

http://durdn.com/blog/2008/11/26/vim-mind-share-soaring-roun...

Re: Efficient Editing With vim

#63
post #26
post #8

Nooooo all of the secrets of our vim cult revealed in one easy-to-read document! Vim is hard, people! Trust me. You're not smart enough to use it. :-P

Actually, I find that Emacs has a steeper learning curve than Vi/Vim. I had an easier time learning to switch between command/insert modes than to try and get comfortable with all of the Meta-/Control- sequences in Emacs. {edit} not to start a flame war.. to each their own {/edit}

You can use a text editor for your whole working life, so what doesn't matter is the learning curve. What matters is what you can do once you're an expert.

Re: Efficient Editing With vim

#64
post #6

I feel silly for only recently discovering tabs in vim. :tabnew file Opens up a new tab, :tabn Goes to the next tab, and :tabp Goes to the previous tab. Works great in both gui and non-gui mode.

I never got the hang of tabs. I got comfortable with buffers before tabs were out, and I didn't see anything that tabs could offer that buffers don't. I probably have my screen split between two buffers 60% of the time. Once in a while I have my screen split with screen AND with vim :D

Re: Efficient Editing With vim

#65
post #14

Warning: learning Vim makes you look for Vim like commands in any program you interact with using the keyboard. Everything else will be frustrating.

You can always get vim keys in any readline-enabled terminal program (like bash) by creating ~/.inputrc and putting this in it:

set editing-mode vi set keymap vi

http://vim.wikia.com/wiki/Use_vi_shortcuts_in_terminal

Re: Efficient Editing With vim

#66
post #6

I feel silly for only recently discovering tabs in vim. :tabnew file Opens up a new tab, :tabn Goes to the next tab, and :tabp Goes to the previous tab. Works great in both gui and non-gui mode.

You can always open files as tabs at startup too with -p, like this: vim -p foo.c foo.h

Re: Efficient Editing With vim

#67
post #7

Amazingly, this is the first I've heard of fx/tx/Fx. How ridiculously awesome.

This is especially powerful when trying to move small chunks of code around. Say you have something like document.getElementById('asweetid') and you want to grab just the id for use elsewhere. In command mode pressing f' will move your cursor to the quote, yf' will put 'asweetid' into your yank register and a p anywhere else will paste it. I also make heavy use of ctx where x is a character on a line that I want to r…

yi' will also work in this example.

Re: Efficient Editing With vim

#68
post #22

I find it amusing that he asserts "blockwise selection mode. Extremely powerful and available in very few other editors". Blockwise selection mode is available in almost every Windows editor I use - from the Delphi IDE, Visual Studio, even to Notepad2, Shift+Alt does block selection, or alternatively Alt + mouse selection.

I'm not familiar with most Windows editors, but — at least on OS X — although blockwise selection is available in most editors, blockwise insertion like vim has is usually left out.

E.g., in vim say I have a list like this that I wanted to append a period to on each line (a simple example, but you can see its uses):

    foo
    bar
    baz
I would just type block-wise select it ($jj) and then type A.

I use this feature all the time.

Re: Efficient Editing With vim

#69
post #6

I feel silly for only recently discovering tabs in vim. :tabnew file Opens up a new tab, :tabn Goes to the next tab, and :tabp Goes to the previous tab. Works great in both gui and non-gui mode.

I never got the hang of tabs. I got comfortable with buffers before tabs were out, and I didn't see anything that tabs could offer that buffers don't. I probably have my screen split between two buffers 60% of the time. Once in a while I have my screen split with screen AND with vim :D

tabs are pretty cool, but I like split and a set of macros I use for easily switching. The main reason I prefer split screen to tabs is that I often want to see code in the other buffer while I work.

Open up a file, :split a new one, and then try these:

map j80+ " up one window, maximized map k80+ " down one window, maximized map 80+ " maximize current window map = " all windows equal height

Re: Efficient Editing With vim

#70
post #6

I feel silly for only recently discovering tabs in vim. :tabnew file Opens up a new tab, :tabn Goes to the next tab, and :tabp Goes to the previous tab. Works great in both gui and non-gui mode.

I never got the hang of tabs. I got comfortable with buffers before tabs were out, and I didn't see anything that tabs could offer that buffers don't. I probably have my screen split between two buffers 60% of the time. Once in a while I have my screen split with screen AND with vim :D

tabs are pretty cool, but I like split and a set of macros I use for easily switching. The main reason I prefer split screen to tabs is that I often want to see code in the other buffer while I work.

Open up a file, :split a new one, and then try these:

map j80+ " up one window, maximized map k80+ " down one window, maximized map 80+ " maximize current window map = " all windows equal height

Post reply on HN