Hacker News new | past | comments | ask | show | jobs | submit login
Interactive Vim tutorial (openvim.com)
122 points by wyclif on Nov 3, 2011 | hide | past | favorite | 22 comments



This is OK if you don't have vim installed, but the best way to learn vim is to use vim, and the best way to use vim to learn vim is:

vimtutor

which comes with vim and is basically a file that you edit, with progressive instructions on the basics of vim.

:help vimtutor

...

On Unix, if Vim has been properly installed, you can start it from the shell: > vimtutor

On MS-Windows you can find it in the Program/Vim menu. Or execute vimtutor.bat in the $VIMRUNTIME directory.

...


It is true, but the learning curve of Vim is (a bit?) step. This tutorial is quick and reduces some of the frustration that you can experience when it takes 1 minute to insert a word.


Ok Ok, I'll give Vim another try. I've been starting to learn and use Vim in its full potential for at least 4 years. I always start with a fresh install, nothing fancy. But for some reason muscle memory never kicks in, and continue to use until it gets in my way, then I go back running to Textmate. I'm going to give this tut a try and see how it goes. Maybe I'll finally be able to jump into the Vim train, or just jump ship.


Be sure you grab a cheat-sheet http://devcheatsheet.com/tag/vim/

You'll probably have one cheat-sheet when you start, then graduate to another as you get better, and so on. They'll make your vim-life much better.


These kind of interactive tutorial are really very good for introducing a new language or environment. Another one http://codecademy.com/ is also great.


I agree wholeheartedly. Another good one is http://learn.knockoutjs.com/


I am also keen on those interactive tutorials. In my opinion it is the most effective way to learn basics in some topic.


I don't think that this is a good way. I recommend just starting up the vim and using it. When you find that some task annoys you and is too repetitive find a way how to do it better. I don't really use vim so I know only a few commands but this worked for me for other things. No need to read manual or a tutorial beforehand.


I have to admit I understood why everyone likes vim so much, but never found the time to learn it. mcedit was good enough for me. This tutorial teached me the minimal important stuff to finally be able to use visudo :)


I got to section 19, Visual Block Mode. Ctrl-v didn't work (in Vista/Chrome).


ctrl-q will give you Visual Block mode.

If you modify your .vimrc and remove the 'Windows friendly' settings, the ctrl-v binding should work, I think.


Same here, Vista / Chrome as well.



To all the vim people I have one question: how do you deal with multiple buffers?

I'm so attached to the emacs way of buffer handling that I just can't get comfortable with vim. It's really the one thing that I just don't get in vim.


I find these two options a must (they're in my .vimrc):

set hidden

set switchbuf=useopen

Beyond that I just use the basic commands to navigate buffers: :ls, :b, :bl, and ctrl-^

Ctrl-^ (switch to the "alternate" (previous) file) is the one a I use the most really. Especially since windows each have their own alternate file.

Generally, I find remembering buffer numbers in a long-running session no more difficult than remembering inventory letters in Angband ;-)


I map H and L to custom functions that navigate to the next or previous tab or buffer, depending on what's open.

https://github.com/mcantor/dotfiles/blob/master/vim/.vimrc#L...


I have F5 bound to :bn , it let me roll buffers, then I use :bd to remove a buffer. I open new files with :Explore.


The problem I have it that C-x-b defaults to jumping back to the previous buffer. So I can just bang C-x-b<RET> and be back to where I was before. I can't find the same thing with vim.

It's a very rare use case for me to want to roll through all the open buffers.


You can use :ls to view all buffers, and if you do :b and start typing the filename of a buffer, you can get completion suggestions with tab, or just hit enter to jump to the first file that matches what you've typed so far.

Use Ctrl-6 (also referred to as Ctrl-^, C-6 or C-^) to swap between your current buffer and the "alternate" buffer, which is usually the last buffer you were looking at.

Use Ctrl-o and Ctrl-i to track up and down the "jump list". C-o is another good way to get back to the buffer you were just looking at, like C-6.


There is also a wealth of plugins for buffer switching; I like FuzzyFinder's :FufBuffer command. Invoke it and the most recent buffer will be at the top, so you can hit enter immediately.


I never really saw the utility of the plugins. The functionality you described in your post, for example, is already implemented by C-6.


This website is really good for vim beginners http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressiv...




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

Search: