mlsamuelson.com

Topic “Vim”

Comments in Vim

Prerequisite: install the comments plugin available at http://www.vim.org/scripts/script.php?script_id=1528

CTRL+c

comment a single line or multiple selected lines* of code

CTRL+x

uncomment a single line or multiple selected lines* of code

* Select multiple lines by entering visual line mode with V and then using j or k to make the selection.

Split windows in Vim

vim -O filename1 filename2 filename3

from command line, open files in vertical windows.

vim -o filename1 filename2 filename3

from command line, open files in horizontal windows.

:split filename.php

inside Vim, open filename.php in a new buffer and split window horizontally. use :vsplit filename.php to split vertically. additionally, you can use the short forms :sp and :vsp.

CTRL+w v

Drop to command line, then return to Vim

In Vim, CTRL-z drops you to the command line. After you're done, fg will return you to Vim.

If you only need to run one command, enter :e.

Syndicate content

Find Me Around

User login