Vim Tricks

by damonp on September 9, 2005

in Snippets,SysAdmin

View a diff of two files:

vim -d fileone filetwo

Recompare the files and update the diff view:

:diffupdate

Set both views to scroll in unison:

:set scrollbind

Split the window and open a new file:

:split filetwo

Turn on line numbering:

:set number

Turn off line numbering:

:set nonumber

Open Vim’s internal file browser:

:edit path

Open an included file. Place the cursor under the filename

include(‘stdlib.php’);

and type:

gf

Vim will search for the file in the path and open it

Popularity: 1%

Most Popular Posts

Damon Parker is a freelance sysadmin and web developer in Texas. He specializes in server setup, server security and high performance server configurations. Need help setting up a web server or getting a server back online after a crash or hack? Email Damon

Leave a Comment

Previous post:

Next post: