VIM-1.6 More VIM Shortcuts and Tips

Support by clicking on youtube ads and make sure to subscribe to my channel for more videos on UNIX, Perl and SQL.

twitter: @fuzicast

:v/^Binary/d – delete all lines that does not start with Binary
ctrl+w gf with cursor on a filename will open that file in a new tab
gf with cursor on a filename will close current file and open that file
press * with cursor on a word will search for that word in file
vim -p file1 file2 file3 file4 # opens these files in tabs
:tabonly – closes all other tabs except current one
vimdiff – when you press ‘do’, obtain any differences from the other window. ‘dp’ will put any differences to the other window
:sort u – sort unique in vim
:sort – regular sort in vim
vim scp://username@host/PATH – open remote files
ctrl+p – autocomplete
:’t,. !awk ‘{print $3 ” ” $2 ” ” $1}’ – execute awk on current opening file
:Explore – execute, delete, rename file system easily with vim
:earlier 2h – undo up to 2hours
:later 2h – redo up to 2hours
:set spell – turn on spell check for strings within quotes
:set nospell
shift + k – with cursor on a command, press that and see man page
!% – will execute current script

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s