:sort Sort selected text.

:%sort Sort the whole file.

:1,10sort Sort the first ten lines of the file.

:!sort -n Sort selected text using the external Unix sort command with the -n option.

:%!uniq Run the whole file through the external uniq command.

vimdiff [file1] [file2] Diff [file1] and [file2] using synchronized split windows.

]c In vimdiff mode, move to next line with differences.

[c In vimdiff mode, move to previous line with differences.

vim + [file] Open [file] in Vim and jump to the end of the file.

vim +21 [file] Open [file] in Vim and jump to line 21.

[i Show (in the status line) the first line containing the word under the cursor.

[I Show (in the status line) all lines containing the word under the cursor.

:g/pattern/ Show (in the status line) all lines that match the regex /pattern/ .

:e scp://username@server//path/to/file Open a remote file over SSH.

:au! BufNewFile,BufRead *.php set filetype=php.html.javascript.css When you open or create a .php file, set the filetype to include HTML, JS, and CSS (for good syntax highlighting).