VIM Snippets and Resources

Sometimes you have to get yourself to use VIM. It is a good tool, but when you are starting out, it can be frustrating. Come here for some links to resources and useful snippets; it’s cheaper than a therapist. I need these for myself also.


Clear Last Search Pattern

:let @/=””



Repeat Character N Times

:norm 79i=

Stop Recording
Sometimes I don’t know how I got here but I gotta get out!!!


Open File Under Cursor
I found out about this at


Export File To Syntax Highlighted HTML

:runtime! syntax/2html.vim

Reformat XML File
I got this from:

I just put this here to make it easy to get do. First and foremost:

:set indentexpr=XmlIndentGet(v:lnum,1)

If you have a 1-line file:


Then a gg=G does the magic.

Useful Links

Nothing like going to the source itself:
A good source for tips:

Cheat Sheets

Nice and clean, not a lot of cryptic graphics:
Some good notes:
vim and Tabs

Useful .vimrc settings

set backupdir = ~/tmp # annoying ~ files in ~/tmp
set noswapfile #no swap files
#set nobackup #uncomment out for no backups, period
#set nowritebackup #no backup files while editing

This entry was posted in Snippets and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *