Lab #3 Processes, the vim Editor and Footprinting in LinuxThis is a featured page



Rick_Mathieu
Rick_Mathieu
Latest page update: made by Rick_Mathieu , Jan 30 2008, 10:27 PM EST (about this update About This Update Rick_Mathieu Edited by Rick_Mathieu

4 words added

view changes

- complete history)
Keyword tags: None
More Info: links to this page
Started By Thread Subject Replies Last Post
mhogan Useful vi Commands 0 Jan 17 2008, 5:25 PM EST by mhogan
Thread started: Jan 17 2008, 5:25 PM EST  Watch
The most useful vi (or vim) command: ZZ
This exits the file after saving. It would be the same as ":w!" (write), then ":q!" (quit). Much easier.

Other useful commands:
cw (change word)
/ (search) - when searching: "n" next occurance forward, "N" next occurance back.
i (insert before cursor)
a (insert after cursor
r (replace single character)
R (replace mode - overtype)
0 (zero - go to beginning of line)
$ (go to end of line)
C (erase from cursor to end of line)
u (VERY IMPORTANT - undo)

A bit more complicated:
Search and replace
:g/s1/s//s2/g
(s1 is the string to be replaced with s2)

Do you find this valuable?    
Keyword tags: None
Showing 1 of 1 threads for this page