mlsamuelson.com

Topic “Vim”

Edit Multiple Files in Vim

vi one.txt two.txt three.txt
open Vim with one.txt, two.txt and three.txt queued

:ar
see files. current file will be in brackets ([ ])

:n
advance to next file in the queue

:rew
rewind queue back to the first file

:e filename.php
edit filename.php in a new buffer

Indent in Vim

V
# select lines to indent using j or k
=

auto-magically indents selected code

5>>

indents 5 lines once, starting with the line the cursor is on

V
# select lines to indent using j or k
3<

unindent the selected code 3 times

Bookmarking in Vim

ma
set a mark location named 'a'

`a
jump to mark location 'a'. note: ` is the backtick

Syndicate content

Find Me Around

User login