DOC PREVIEW
DREXEL PHYS 113 - emacs_sheet

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Miscellaneous Useful CommandsSplitting the ScreenOn-line Help with EmacsLeaving EmacsInvoking EmacsEmacs CommandsSummary of Commonly Used CommandsMoving Around and SearchingMacrosReading Files, Saving your Work and QuittingOperating on RegionsSubstitutionMiscellaneous Useful Commands <Ctrl G> keyboard-quit (aborts current command) <Ctrl L> re-center (refreshes the screen) <Esc>L down-case word (turns current word to lower case) <Esc>U up-case word (turns current word to upper case) <Esc>C capitalise-word (turns first letter of word to capital) <Ctrl U> multiplier (if no number specified, default is *4) <Esc> number multiplier by number (Note <Ctrl U> 7 <Ctrl N> and <Esc> 7 <Ctrl N> would do the same thing) <Esc>Xname run command name Splitting the Screen <Ctrl X>2 split-window-vertically <Ctrl X>1 delete-other-windows <Ctrl X>0 delete-window <Ctrl X>O other-window <Ctrl X>^ enlarge-window On-line Help with Emacs Online help is available in Emacs by typing the following commands: <Ctrl H>A command-apropos (Emacs prompts for a string and then lists all commands containing string) <Ctrl H>I info (enter Emacs info system) <Ctrl H>T help-with-tutorial (run Emacs tutorial program) Leaving Emacs To leave Emacs you should give the following commands: <Ctrl X> <CtrlC> save-buffers-kill-emacs (Quit Emacs) <Ctrl Z> suspend-emacs (Return to Emacs with the fg command) University of Leeds Information Systems Services GNU EMACS FACTS SHEET DATE March 2000 EDITION 1.2 DOCUMENT FAC 4 This document contains a summary of useful GNU Emacs commands. Invoking Emacs To invoke the Emacs editor use the command: % emacs[filename] e.g. % emacs test.file The following screen will then be displayed. If you are editing an existing file, the first 20 lines or so will be diplayed. == Emacs ================================= A status line is displayed near the bottom of the screen. Beneath the status line is the command line which is used to input information, such as the file name when you are reading a file. Emacs Commands Emacs employs commands which are executed by typing one or two keys. The commands also have a name, usually consisting of a number of words, separated by hyphens. For example: <Ctrl K> consists of a single keystroke, <Ctrl> and K simultaneously. The command is called kill-line. <Esc>F consists of two separate keystrokes, <Esc> followed by F. The command is called forward-word. Typing <Esc> X name enables you to run the command name using the name given in this document. For example <Esc> X kill-line FAC 4 / March 2000Summary of Commonly Used Commands The following list summarises Emacs commands which will enable you to carry out screen editing in a simple and efficient manner. Characters <Ctrl B> or ← backward-char <Ctrl F> or → forward-char <Ctrl D> delete-char <Del> backward-delete (or <Ctrl H>) Words <Esc>B backward-word <Esc>F forward-word <Esc> D kill-word <Esc> <Del> backward-kill-word Lines <Ctrl A> beginning-of-line <Ctrl E> end-of-line <Ctrl K> kill-line <Ctrl N> or ↓ next-line <Ctrl P> or ↑ previous-line <Enter> new-line Moving Around and Searching <Ctrl V> scroll-up <Esc>V scroll-down <Esc> < beginning-of-buffer <Esc> > end-of-buffer <Ctrl S> isearch-forward <Ctrl R> isearch-backward Macros Emacs allows you to record a sequence of commands, (for example, to strip out a number of spaces after each occurrence of a certain string). This is called a macro. <Ctrl X>( start-keyboard-macro <Ctrl X>) end-keyboard-macro <Ctrl X>E call-last-keyboard-macro Reading Files, Saving your Work and Quitting <Ctrl X> <Ctrl R> find-file-read-only <Ctrl X> I insert-file (Emacs prompts for file name) <Ctrl X> <Ctrl W> write-file (Emacs prompts for file name) <Ctrl X> <Ctrl S> save-buffer (write file in current buffer) <Ctrl X> <Ctrl C> save-buffers-kill-emacs (Used to quit Emacs. If modified buffers exist, Emacs will ask for confirmation to quit) Operating on Regions Operations such as indentations, deletion, movement and so on may be carried out on regions of text. This is done by setting a mark to define the beginning of the areas, moving the cursor to the end of the text to be modified and then issuing the required command. This facility can be used for moving and/or copying. <Ctrl @> set-mark-command (sets the mark). Note use <Alt> <Esc> if you are using the Telnet software on a PC. <Ctrl W>kill-region (moves text into the kill ring) <Ctrl Y>yank (retrieves text from the kill ring) <Esc> Wcopy-region-as-kill (copies region into the kill ring) <Esc> W leaves the original text in place, whereas <Ctrl W> deletes it. After either command the cursor may be moved and <Ctrl Y> will place the retrieved text at that position. Substitution <Esc>% query-replace (Emacs prompts for old string and new string) Emacs moves to the first occurrence of the old string. The following commands can then be given: <space> or y replace this occurrence and go to next <Del> or n leave this occurrence and go to next <Ctrl G> terminate query-replace !global-replace from current position


View Full Document

DREXEL PHYS 113 - emacs_sheet

Download emacs_sheet
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view emacs_sheet and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view emacs_sheet 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?