DOC PREVIEW
Berkeley COMPSCI 61C - EMACS Quick Reference

This preview shows page 1 out of 4 pages.

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

Unformatted text preview:

47GNU EmacsQuick Reference Guidefor CS61BBullets (•) mark a suggested starting set of commands.Daggers (†) denote key bindings that are not standard inGNU Emacs. ARG denotes the prefix numeric argument(entered with C-u or M-digit).Cursor motion.C-f Forward character.•M-f Forward word.•C-e Forward t o en d of line.•C-b Backward character.•M-b Backward word.•C-a Backward to start of line.•M-e Forward sentence.M-[ Forward paragraph.M-a Backward sentence.M-] Backward paragraph.C-n Next line.•C-p Previous line.•M-< Beginning of buffer.•M-> End of buffer.•C-v Scroll tex t up one screen (or ARG lines).•M-v Scroll tex t down (or ARG lines).•M-g Go to line number ARG.†M-x what-line Display line number.C-M-v Scroll other window up one screen (or ARGlines).Marking regions of textC-@ Set mark at point.•C-x C-x Exchange mark and point.•C-SPC Same as [email protected]@ Set mark after end of next word.M-h Set mark and point around currentparagraph.C-x h Set mark and point around current buffer.Deletion and yankingDEL Delete character before cursor.•M-DEL Delete word before cursor and add to killbuffer.•C-d Delete character at cursor.•M-d Delete word at and after cursor and add tokill buffer.•C-k Delete to end of line and add to kill buffer.•M-W Delete current region, and add to killbuffer.†•M-\ Delete su rrounding blanks and tabs.M-SPC Delete all bu t one surrounding blank.C-x C-o Delete all but one surrounding blank line.C-M-w Cause next command, if a kill, to append toprevious kill buff er, instead of new one.C-y Insert text from kill buffer at point.•C-u C-y Insert text from kill buffer at point withoutmoving point.M-y Replace preceding C-y text with next mostrecent kill buffer.M-w Copy region to kill buffer, no deletion.IndentationTAB Indent according to mode.•LF Same as RET TAB.M-; Indent and start comment.M-LF Continue comment on n ext line.C-x TAB Indent region rigidly by ARG.C-M-\ Indent region according to mod e.•SearchC-s Search forward.•C-s C-s Same as C-s with last string.•C-r Search backward.•C-r C-r Same as C-r with last string.•C-u C-s Search forward for regular expression.M-x occur Display lines matching a regular expression.M-x grep Display results of UNIX grep utility.M-x count-matchesThe following subcommands are valid during a search.RET End search.•DEL Undo effect of last search character typed.•C-g Abort search.•C-s Search for next match forward.•C-r Search for next match backward.•C-q Quote n ext character.C-w Extend search string with next word.LFD Extend search string with rest of line.48ReplacementM-q Query replace.•†M-Q Query replace regular expression.†M-x delete-matching-linesM-x delete-non-matching-linesDuring a query-replacement, the following are valid re-sponses to prompts.SPC Make replacement and go to next.•DEL Skip replacement and go to next.•RET End rep lacement.•! Replace all remaining instances withoutasking.•C-r Enter recursive edit; return with C-M-c.Regular expressions. Match any character.•^ Match at start of line.•$ Match at end of line.•[...] Match any character in the ‘...’.•[^...] Match any character except those in ‘...’.•* Match 0 or more of pattern to left.•+ Match 1 or more of pattern to left.? Match 0 or 1 of pattern to left.\c Quotes c, except for the following.\b Match at beginning or end of word.\B Match except at beginning or end of word.\| Match either pattern to left or right.\(...\) Grouping.\n Match copy of whatever matched nthgroup.Miscellaneous editingC-o Insert newline after cursor.C-t Transpose characters.M-t Transpose words.C-x C-t Transpose lines.M-u Convert whole word to upper case.M-l Convert whole word to lower case.M-c Capitalize word.FilesC-x C-f Find file; load if needed.•C-x 4 C-f Find fi le in other window.•C-x C-s Save file.•C-x C-w Write to explicitly-named file.C-x i Insert file at cu rsor.M-x recover-file Recover file after disaster from auto-save file.M-x revert-buffer Throw away changes to buffer and re-store from file.Buffers and windowsC-x o Put cursor in other window.•C-x 1 Grow current window to full screen.•C-x 2 Split current window vertically.•C-x b Put named buffer in window.•C-x 0 Remove current window.C-x 3 Split current window horizontally.C-x C-b List all buffers.C-x k Delete buffer.ShellsM-x shell Run UNIX shell in a buffer.•M-| Execute single shell command on region.With ARG, replaces region.Commands active in shell buffers:RET Send current line to shell.•TAB Complete preceding file n ame.•C-c C-c Send interrupt t o shell.•C-c C-u Erase current input line.•C-c C-z Send stop signal to shell.•C-c C-d Send EOF to shell.Compilation, debugging, and tagsM-x compile Execute command (by default, make)asynchronously.•C-x ‘ Position to next error or next line found byM-x grep command.•M-x kill-compiler Stop active compile.M-x visit-tags-table Specify file containing tags pro-duced by etags.•M-. Display source for given tag.•49C-u M-. Find next alternate definition for last tag.•C-x 4 . Display source for tag in other window.M-x tags-searchM-x tags-query-replace Look for pattern in all filesnamed in t ags table.M-x tags-apropos Display matching tags.M-x gdb Run GN U d ebugger on file.M-x gjdb Run Java debugger on class.Commands valid in gdb and gjdb modes.C-c C-s Step.•C-c C-n Next.•C-c < Up stack.•C-c > Down stack.•C-c C-r Finish.•C-x SPC In any source file, sets a break point.•C-c C-i Stepi (gdb only).Help and documentationM-x manual-entry UNIX man page for given topic.C-h a Look up names of matching commands.•C-h b Display key bindings.•C-h f Help for M-x function.•C-h C-h Help for C-h.•C-h i Run info browser.•C-h k Help for key.•C-h m Help for current mode.C-h t Tutorial.C-h w Key containing function.Inside an *info* b uffer (result of C-h i), the following aredefined.m Select menu item.•l Go to last-visited node.•? Get help for browser.•u Go to node’s parent.•n Go to next nod e in sequence.•q Leave browser.•. Go to t op of node.d Go to t op-level node.Mouse commandsLeft, midd le, and right buttons are LB, MB, and RB.LB Put cursor at mouse. Dragging marks region.MB Paste text from window-system cut buffer atmouse.RB Extend region to pointer and copy into cutand kill buffers. Clicking twice deletes region.C-LB Select a


View Full Document

Berkeley COMPSCI 61C - EMACS Quick Reference

Documents in this Course
SIMD II

SIMD II

8 pages

Midterm

Midterm

7 pages

Lecture 7

Lecture 7

31 pages

Caches

Caches

7 pages

Lecture 9

Lecture 9

24 pages

Lecture 1

Lecture 1

28 pages

Lecture 2

Lecture 2

25 pages

VM II

VM II

4 pages

Midterm

Midterm

10 pages

Load more
Download EMACS Quick Reference
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 Quick Reference 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 Quick Reference 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?