Learning Vim

I know the basics of Vim. Like how to move around and stuff. But, I never try as my main editor. But, in the past few days, I wanted to try Vim as my main editor. [ yep this happened when my MacBook pro was so heated when I run the unit tests and I just want to code in the server, in order to achieve it I must use vim or emacs.] I chose Vim because of learning resources and I am quite familiar with the basic movements.

I attend a course from Laracasts call Vim Mastery. And the following will be notes of mine. Maybe after reading what I am learning, you might want to learn your own?

Good Places to Learn

$ vimtutor
vim-adventures.com

Ctags with Vim

,f for the quick search #Custom mapping
:tn for the next match
:tp for the previous match
:ts for the list
control + ] go to the method and control + ^ will back to the previous.

The following is the other interesting article about the subject when I am browsing via the internet.

https://andrew.stwrt.ca/posts/vim-ctags

VIM Snippets

I am using https://github.com/garbas/vim-snipmate for my snippets.

I added ,sdp to show what are the snippets that I added to the list. The long meaning of it will be snippet documentation of PHP. It will show something like the following…

The snippet that I created and the meaning of those.

vim-surround

Another plugin that the course teaches me is vim-surround plugin. That’s pretty neat to change surround, mapping for this one is change surround what_you_want_to_replace what_you_want_to_change.

Other useful commands ds' delete surround ‘. dst delete surround tag. cst change surround tag. Select the world and Shift + Swill add the surrounding.

Mark

Shift + m + (keyword) will mark the different files to return to that mark stage. ` + m + (mark keyword) will go to the mark stage with the exact column. You can go back to the last file when you open up the vim by '0 .

Other stuff?

I am switching caps lock key to esc key and I am still failing with going through the escape key.

Random Resources that I browse on the internet

Vim Meetups Playlist by thoughtbot

Learn Vim by upcase.

Thought…

It might be funny, but I will write it anyhow. After learning vim for 3/4 days constantly, I feel like Vim is all about learning. Every single day, you need to learn. Vim is just a reminder for me to learn something new every single day. Thanks, Vim and I love it!

Leave a Reply