VIM-1.3 More VIM Editor Commands Tutorial


Make sure to subscribe to my channel for more videos on UNIX, Perl and SQL.
facebook: http://www.facebook.com/fuzicast
twitter: @fuzicast

:tabdo %s/pattern/replacement/g – execute commands on all open tabs
:command1 | command2 – run multiple commands
:help
vim file1 file2 file3 – open multiple files
:n – go to next file
:only – when in split screen, close all other screens and keep current screen
. – repeats last action
:g/pattern/ – returns you all the lines that contains the pattern
:g/pattern/d – delete all lines that contains this pattern
:v/pattern/ – return all lines that don’t contain this pattern
:v/pattern/d – delete all lines that don’t contain this pattern
ctrl + o – the same as ‘.
: + up/down key – view history of : commands
/ + up/down key – view history of / searches
ctrl + w + (hyphen) – maximize the windows
ctrl + w + = – restore original windows
== – aligns line to same position as previous line
select block; :fold – compress lines, zo to expand, zc to compress again
:%s/pattern/replacement/gc – search and replace
ctrl + v ctrl + m – get special characters
:%d
:diffget – sync current screen with the other screen
]c – get to next diff

Advertisements

2 thoughts on “VIM-1.3 More VIM Editor Commands Tutorial

  1. Thanks, learned some things. BTW, another helpful option when doing a substitution with “c” switch (for “confirm”), the “a” option will apply changes to all remaining finds. The :help s_flags will show all options.

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 )

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