Vimmage

This is where I put vim tips I want to remember.

Help

Help search with regex: :helpgr
Show help topics with beginning foo: :he foo

Must have plugins

minibuf
tlist
visinc.vim
surround
snippetsEmu

Replacing each line in a block select

Pressing s while in a block selection (ctrl-v) will let you write something in place of your selection, which will repeated for every line in the block selection when you press escape. Like pasting while in a block selection will do in ultraedit.

I and A act the same, but inserts or appends the text instead.

Search/replace

Global search/replace:%s/find/replace/g
Landing the cursor on offsets from the search result: :he search-offset

Handy shorthands

^ instead of .* in regex
% instead of 1,$ in ranges

Filenames

Open filename under cursor: gf
Split window and open filename under cursor in new window: ctrl-w f
Complete filename (insert mode): ctrl-x ctrl-f

Numbers

Increment numbers: ctrl-a
Turning off vims idea that the number is octal: setnrformats -= octal

The vim regex guide

Completion

Complete from previous/next matching text in the same document: Ctrl-p/n
Include dictionary in completion loop: :set complete-=k complete+=k

Command line

Pipe output into vim: ls -l | vim – (notice the -)
Read output from external command: :r!ls -lA
Paste clipboard into commandline: ctrl-r + or ctrl-r * (depending on the register)
Paste word under cursor into commandline: ctrl-r ctrl-w

For complete command line ctrl-r command list: :he c_CTRL-R

Other vim tip pages

http://rayninfo.co.uk/vimtips.html

Causes problems over slow connections (like VPN):
matchparen.vim
netrwPlugin.vim
vimballPlugin.vim

One Response to Vimmage

  1. His favorite hobby, would be to criticize and pass judgments on everything.
    Looking at the continued success and the obvious signs in the language used and
    merchandise affecting our society depicting the Simpsons, a broad acceptance is reached how the Simpsons has touched our society and made it
    impact, regardless of whether one thinks it can be for the good
    or for the bad. You can also catch their hands on 25 HD channels and only pay $29.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>