Vim commands that I wish I know earlier

Below are some Vim commands that made my life easier.

$ vim -M file.txt
wow! totally cannot enter insert mode. not modifiable!

vim command line options:
–noplugin
-o[N] => start vim with N open windows, split horizontally
-O[N] => split vertically
-v => run in full-screen mode
-y => modeless vi, run vim in insert mode only without command mode

Running vi or vim with ‘-‘ as an argument makes it read the file to edit from standard input
ls | vi –
ps -e | vi –

open files in multiple tabs in vim
vim -p[N]

Break out current window into a new tabview
Ctrl+W T

:set wildmenu

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s