EX commands from within vi

email to: john@johnmeister.com/jeep/sj

EX Commands:



EX Commands    (from the vi editing mode, press esc, then a colon ( : ), then the ex command

 :r        read  into current text 
 :r !   read output from command  into current text 
 :nr       read in at line number 
 :!        run command, return 
 :sh             goto shell 
 :so       read and execute commands from 
 :x              write and quit 
 :wq             write and quit 
 :l1,l2w   write between lines l1 and l2 to .  If  
                   is not specified, assume current.  If l1,l2 not 
                   specified, assume entire file (making it :w)
 :w >>     append to .  May use line numbers
 :w!             overwrite current file 
 :q              quit
 :q!             quit, forget changes 
 :e        edit  without leaving vi 
 :e!             forget changes since last write
 :n              edit next file 
 :e +n     edit  at line n, if no end, assume end of file 
 :n       specify  as new list of files to edit 
 :e#             edit alternate file (if :e  is used, alternate is
                       the original file)
 :args           show files to be edited 
 :rew            rewind life of files to top 
 :map m n        create a macro (make m do n) 
 :map! m n       create an insert mode macro (make m do n) 
 :unmap m        destroy macro m 
 :unmap! m       destroy insert mode macro m 
 :ab <1> <2>     abbreviate - replace <1> with <2> whenever typed as 
                   a word
 :unab <1>       unabbreviate <1> 
 :set 
http://johnmeister.com/jeep/sj/UNIX/vi/silly.vi.tricks.html
return to john's home page