JMU JMU - Department of Computer Science
Help Tools
VIM: Tips and Tricks


1 Appearance

:set ruler Show the current line and column number.
:set showmode Show the current mode (e.g., insert mode, replace mode, and command mode).
:syntax on Enable color syntax highlighting.

2 Editing

:s/old/new Substitute the next occurence of "old" with "new".
:s/old/new/g Substitute all occurence of "old" on the current line with "new".
:%s/old/new/g Substitute all occurence of "old" with "new".
:set autoindent Automatically indent lines.
r Replace the highlighted character.
x Delete the highlighted character.

3 Files

:set writebackup Automatically create a backup of the file before saving. (The backup will have the same name as the original file but with a ~ character appended.)

Copyright 2019