Programming
Below is one of our free research papers on Programming. If the term paper below is not exactly what you're looking for, you can search our essay database for other topics or order a custom essay.
Programming
Starting Vi
:/pattern/ /pattern/ :?pattern? ?pattern? :/pat1/d
Vi Reference Card
Text entering commands Search Commands
edit an empty bu er edit a le
vi vi filename
Leaving Vi Text deletion commands Global parameter Addresses
substitute pat2 for pat1 delete all occurrences of pat1 print all occurrences of pat1
N
append text at end of line A append text after cursor a insert text at beginning of line I insert text before cursor i open a new line above cursor O open a new line below cursor o All commands must be terminated with an after the text has been entered. search forward for pattern search forward for pattern search backward for pattern search backward for pattern delete the next line containing pat1 substitute the next occurance of pat1 with pat2 repeat the last search repeat the last search in opposite direction
:/pat1/s/pat1/pat2 n
write bu er to le write bu er to le lename quit quit discarding changes write changes and quit write changes and quit delete character left of cursor X delete character under cursor x delete rest of word dw delete rest of sentence d) delete rest of paragraph d} delete to beginning of current line d^ delete to end of current line d$ delete line containing cursor dd delete the current line upto and including c dfc delete the current line upto c dtc All commands can be preceeded by and integer to indicate the number of characters, words, lines etc. to be deleted.
:w :w filename :q :q! :wq ZZ
Special Notes
:g/pat1/s/pat1/pat2 :g/pat1/d :g/pat1/p
Use the escape key, , to leave insert mode or to cancel an incomplete command. If a command doesn't work, try hitting and entering the command again.
Motion commands Text alteration commands
the nth line lines n through k the current line the last line n lines after the current line n lines before the current line the last n+1 lines
n n,k . $ +n -n $-n,$
Instructions
:n,k d :n,k co j :n,k mo j :$-8,$ s/pat1/pat2/
delete lines n through...
- Submitted by: santhy20a
- Date Submitted: 10/07/2009 10:36 AM
- Category: Technology
- Words: 868
- Pages: 4
- Views: 26
- Rank: 78344