Vim

Install my vimrc

http://sys.cuquejo.org/wp-content/uploads/2016/01/vimrc.txt -O ~/.vimrc

Force sudo on save

:w !sudo tee %

or if you have my .vimrc just use

:W

Editing multiples columns using visual mode

Press CTRL+v to select multiples columns or lines.

Then press I and type what you want to insert in all selection then press ESC.

Search and Replace

To search just press / and type what you want to find

To replace all:

:%s/foo/bar/

If you wanna to replace only a block of lines:

:set nu

Then get the first line you want to replace and the last line then:

:10,30 s/foo/bar/g

The /g is to replace multiple times.

Ex.

:%s/foo/bar/

Will replace "foo foo foo"  to "bar foo foo"

Using /g will replace it all.

:%s/foo/bar/g

Will replace "foo foo foo"  to "bar bar bar"

Protected: Cisco Tips

This content is password protected. To view it please enter your password below: