VI_and_Emacs

Reviews
Shared by: Honey Singh
Categories
Tags
Stats
views:
188
rating:
not rated
reviews:
0
posted:
11/12/2007
language:
pages:
0
vi editor • vi stands for “visual editor”. • vi enter command mode when start. • after entered insert command(i,I,a,A,o,O,R) you can enter text-entry mode. vi editor commands • • • • cursor movement delete, replace, paste search, search/replace save/load,edit other file,quit vi editor commands • cursor movement forward word: w back word: start of line: end of line: start of file: end of file: b ^,0 $ gg,:1,1G G ~ ~ ~ ~ Ctrl-D ~ ~ ~ ~ Ctrl-F Ctrl-B end of word: e h j k l go to line nn: :nn,nnG Ctrl-U vi editor commands • delete text x dw,db,d$,d0, dh,dj,dk,dl dd :d D delete a character delete characters placed in cursor movement range delete a line delete lines in such as 1,5 .,$ same as d$ • replace(change) text – r,R, cw,cc vi editor commands • copy(yank) and paste text yw,yb,y$,y0, yh,yj,yk,yl yy :y p,:pu,P yank characters placed in cursor movement range yank a line yank lines in paste(put) contents in paste buffer after(p) or before(P) current position(line or character position)paste buffer contains previously deleted or yanked text. paste after line nn :nnpu vi editor commands • search, search/replace text /text ?text n N /, ? search forward from current position search backward from current position repeat search repeat search in opposite direction repeat search forward or backward :s/sss/ttt/ replace first occurrence of sss on each line with ttt :s/sss/ttt/greplace every occurrence of sss on each line with ttt vi editor commands • save/load :w :w : w :r :e :n save file as save file with current name save lines in as append contents of file at current position edit other file edit next file given on initial command line vi editor commands • miscellaneous :! :r! :q :q! execute execute and read output into buffer at current position exit vi if file is saved exit vi even if file is not saved emacs commands • emacs does not distinguish text-mode and comma nd mode. • emacs’s editing commands are control-sequences or meta-sequences. you should make keystroke wi th Control key or Esc key or Meta key emacs commands Ctrl-h t : get tutorial of emacs Ctrl-g : abort command Ctrl-x Ctrl-c : exit emacs Ctrl-x Ctrl-s : save Ctrl-x Ctrl-w : save to different file Ctrl-x Ctrl-f : edit other file Ctrl-x Ctrl-b : list buffers Ctrl-x Ctrl-k : kill a buffer emacs commands Search Ctrl-s str : search forward for str Ctrl-r str : search backward for str Ctrl-s : repeat last search forward Ctrl-r : repeat last search backward Esc : leave search mode Ctrl-k : delete to end of line. Ctrl-a Ctrl-k Ctrl-k : delete current line. Ctrl-x u or Ctrl-_ : undo previous edit action. emacs commands Region Command Ctrl-Spacebar or Ctrl-@ : Set Mark.(use mouse to set mark...) Ctrl-w : Cut Region. Meta-w : Copy Region. Ctrl-y : yank Cut(Copied) Region. Window Command C-x 0 : delete window C-x 1 : delete other windows C-x 2 : split window vertical C-x 3 : split window horizontal emacs commands Meta-x command executes extended-command(you can execute all command) Ctrl-h f : describe function Ctrl-h k : describe key Ctrl-h b :list key bindings M-x goto-line n : goto line n M-x kill-buffer : kill buffer (C-x C-k) M-x kill-region : cut region (C-w) M-x kill-ring-save : copy region (M-w) M-x delete-window : delete window (C-x 0) emacs commands M-x shell : load a shell in emacs M-x compile : compile current buffer (by default run ‘make’) M-x gdb : load a debugger in emacs M-x gud-break : set break point on current cursor position. Define Key-Bindings M-x global-set-key emacs commands Configure your envioronment emacs load ~/.emacs file and interpret the file with emacs-LISP interpr eter on start. setup key-bindings in ~/.emacs file. (global-set-key [f10] ‘gdb) (global-set-key [f12] ‘shell) (global-set-key “\M-g” ‘goto-line)

Shared by: Honey Singh
About
Honey is a zealous web and graphics designer (currently working with media redefined ) having a creative and devouring gumption with an experience of over 3 years in Interactive Designing , Blogging and Web technologies.
Other docs by Honey Singh
What Mr.Buffett learned from Graham
Views: 1290  |  Downloads: 135
Warren Buffett_27s Invisible Empire
Views: 1123  |  Downloads: 91
Under Warren Buffett_27s Big Top
Views: 734  |  Downloads: 48
The Warren Buffett You Don_27t Know
Views: 992  |  Downloads: 104
The Best Advice I ever Got
Views: 6494  |  Downloads: 376
9 investing secrets of Warren Buffett[2]
Views: 1132  |  Downloads: 149
UNIX[3]
Views: 909  |  Downloads: 44
Thinking in java 2nd edition
Views: 1286  |  Downloads: 69
network programming
Views: 709  |  Downloads: 38
Kevs-php-mysql[1]
Views: 13265  |  Downloads: 65
Googles Backdoor
Views: 452  |  Downloads: 19
Google Hacking 101
Views: 14641  |  Downloads: 338
Google Hackers Guide
Views: 8473  |  Downloads: 261
Google Anatomy
Views: 1584  |  Downloads: 195
Beej_27s Guide to Network Programming
Views: 509  |  Downloads: 19
Related docs
Basic UNIX commands_1_
Views: 0  |  Downloads: 0
IDE ( Integrated Development Environment
Views: 0  |  Downloads: 0
Worksheet 1 Unix
Views: 0  |  Downloads: 0
Worksheet 1 Unixxmacs
Views: 0  |  Downloads: 0
Linux简介
Views: 5  |  Downloads: 0
iocConsole quick reference
Views: 4  |  Downloads: 0
GNU / Linux Tutorial
Views: 193  |  Downloads: 40
Guide To UNIX Using Linux Third Edition
Views: 76  |  Downloads: 9
Introduction to UNIXTM
Views: 0  |  Downloads: 0