Difference between revisions of "Emacs Keys"

From Coder Merlin
m (added editorial note: please provide a link)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Overview ==
{{MovedToMoodle|See CS-001 Computer Science Reference: Keys → Emacs}}
{{KeySymbology}}
{{MerlinNoteFromEditor|Please provide a link or explain where this is. I can't find the CS-001 reference or the Keys → Emacs page.}}
 
== Help ==
{| class='wikitable'
! Key Sequence
! Purpose
|-
| {{SpecialKey|CONTROL|h}} {{Key|?}}
| Provide help '''options'''
|-
| {{SpecialKey|CONTROL|h}} {{Key|t}}
| Start the '''tutorial'''
|-
| {{SpecialKey|CONTROL|h}} {{Key|k}}
| Provide details about a '''key sequence'''
|-
| {{SpecialKey|CONTROL|h}} {{Key|c}}
| Provide the name of a specific '''command'''
|-
| {{SpecialKey|CONTROL|h}} {{Key|f}}
| Describes a specific '''function'''
|-
| {{SpecialKey|CONTROL|h}} {{Key|a}}
| Provide a list of '''commands appropriate''' for the specified description
|-
| {{SpecialKey|CONTROL|h}} {{Key|i}}
| '''information''' mode facilities to read included manuals
|-
| {{SpecialKey|CONTROL|h}} {{Key|m}}
| Provide details about the current '''mode'''
|}
 
== Undo and Cancellation ==
{| class='wikitable'
! Key Sequence
! Purpose
|-
| {{Key|F9}}
| '''Undo''' the changes made by a command (Merlin Extension)
|-
| {{VerySpecialKey|CONTROL|SHIFT|_}}
| '''Undo''' the changes made by a command
|-
| {{SpecialKey|CONTROL|g}} {{VerySpecialKey|CONTROL|SHIFT|_}}
| '''Redo''' a previously "undo"
|-
| {{SpecialKey|CONTROL|g}}
| '''Cancel''' a partially typed command or argument prefix
|}
 
== Suspend and Exit ==
{| class='wikitable'
! Key Sequence
! Purpose
|-
| {{SpecialKey|CONTROL|x}} {{SpecialKey|CONTROL|c}}
| '''Exit''' emacs
|-
| {{SpecialKey|CONTROL|z}}
| '''Suspend''' emacs temporarily
|}
 
== Navigation ==
{| class='wikitable'
! Key Sequence
! Purpose
|-
| {{SpecialKey|CONTROL|v}}
| '''Scroll down''' (forwards) one page
|-
| {{SpecialKey|ALT|v}}
| '''Scroll up''' (backwards) one page
|-
| {{SpecialKey|CONTROL|l}} (second character is lowercase 'L')
| Clear screen and '''redisplay''' the text, moving the cursor to the vertical center
|-
| {{SpecialKey|CONTROL|f}}
| Move the cursor '''forward''' one '''character'''
|-
| {{SpecialKey|CONTROL|b}}
| Move the cursor '''backward''' one '''character'''
|-
| {{SpecialKey|CONTROL|p}}
| Move the cursor '''up''' one '''line''' (previous line)
|-
| {{SpecialKey|CONTROL|n}}
| Move the cursor '''down''' one '''line''' (next line)
|-
| {{SpecialKey|ALT|f}}
| Move the cursor '''forward''' one '''word'''
|-
| {{SpecialKey|ALT|b}}
| Move the cursor '''backward''' one '''word'''
|-
| {{SpecialKey|CONTROL|a}}
| Move the cursor to the '''beginning''' of a '''line'''
|-
| {{SpecialKey|CONTROL|e}}
| Move the cursor to the '''end''' of a '''line'''
|-
| {{SpecialKey|ALT|a}}
| Move the cursor to the '''beginning''' of a '''sentence'''
|-
| {{SpecialKey|ALT|e}}
| Move the cursor to the '''end''' of a '''sentence'''
|-
| {{VerySpecialKey|ALT|SHIFT|<}}
| Move the cursor to the '''beginning''' of the '''file'''
|-
| {{VerySpecialKey|ALT|SHIFT|>}}
| Move the cursor to the '''end''' of the '''file'''
|}
 
== Deleting, Killing, and Yanking Text ==
{| class='wikitable'
! Key Sequence
! Purpose
|-
| {{SpecialKey|CONTROL|d}}
| '''Delete character under''' the cursor
|-
| {{Key|DEL}}
| '''Delete character''' to the '''left''' of the cursor
|-
| {{SpecialKey|ALT|d}}
| '''Kill word after''' the cursor
|-
| {{SpecialKey|ALT|DEL}}
| '''Kill word before''' the cursor
|-
| {{SpecialKey|CONTROL|k}}
| '''Kill text''' from the cursor to the '''end of the line'''
|-
| {{SpecialKey|CONTROL|u}} {{Key|0}} {{SpecialKey|CONTROL|k}}
| '''Kill text''' from the cursor to the '''beginning of the line'''
|-
| {{SpecialKey|ALT|k}}
| '''Kill text''' from the cursor to the '''end of the sentence'''
|-
| {{SpecialKey|CONTROL|w}}
| '''Kill selected text''' (in region)
|-
| {{SpecialKey|CONTROL|y}}
| '''Yank text''' from the '''first block''' of the kill ring, and insert it at the current cursor position
|-
| {{SpecialKey|ALT|y}}
| '''Yank text''' from the '''previous block''' of the kill ring, and insert it at the current cursor position
|}
 
== Marking a Region ==
{| class='wikitable'
! Key Sequence
! Purpose
|-
| {{SpecialKey|CONTROL|SPACE}}
| '''Mark''' the beginning of a region
|-
| {{SpecialKey|CONTROL|x}} {{Key|h|}}
| '''Mark''' the entire text
|}
== Registers ==
{| class='wikitable'
! Key Sequence
! Purpose
|-
| {{SpecialKey|CONTROL|x}} {{Key|r}} {{Key|SPACE}} ''n''
| '''Save''' '''position''' of point in register ''n''
|-
| {{SpecialKey|CONTROL|x}} {{Key|r}} {{Key|j}} ''n''
| '''Jump''' to the '''position''' saved in register ''n''
|}
 
== Repeating Commands ==
{| class='wikitable'
! Key Sequence
! Purpose
|-
| {{SpecialKey|CONTROL|u}}&nbsp;<numeric sequence>
| '''Repeat next command''' <numeric sequence> times
|}
 
== Windows ==
{| class='wikitable'
! Key Sequence
! Purpose
|-
| {{SpecialKey|CONTROL|x}}&nbsp;{{Key|1}} (second character is the digit one)
| Return to '''one window''' (closes all other windows)
|-
| {{SpecialKey|CONTROL|x}}&nbsp;{{Key|2}}
| '''Split''' the screen '''horizontally'''
|-
| {{SpecialKey|CONTROL|x}}&nbsp;{{Key|3}}
| '''Split''' the screen '''vertically'''
|-
| {{SpecialKey|CONTROL|x}}&nbsp;{{Key|0}} (the second character is the digit zero)
| '''Close''' the '''current''' window
|-
| {{SpecialKey|CONTROL|x}}&nbsp;{{Key|o}} (the second character is lowercase "O")
| Move the '''cursor''' to the '''other window'''
|-
| {{VerySpecialKey|CONTROL|ALT|v}}
| '''Scroll''' the '''other window'''
|-
| {{SpecialKey|ALT|x}}&nbsp;rotate-frame
| '''Rotate''' frames
|-
| {{SpecialKey|ALT|x}}&nbsp;transpose-frame
| '''Transpose''' frames
|}
 
== Buffers ==
{| class='wikitable'
! Key Sequence
! Purpose
|-
| {{SpecialKey|CONTROL|x}}&nbsp;{{SpecialKey|CONTROL|b}}
| Display a '''list''' of all '''buffers'''
|-
| {{SpecialKey|CONTROL|x}}&nbsp;{{Key|b}}
| '''Switch''' to the specified '''buffer'''
|-
| {{SpecialKey|CONTROL|x}}&nbsp;{{Key|<math>\leftarrow</math>}}
| Select '''previous buffer'''
|-
| {{SpecialKey|CONTROL|x}}&nbsp;{{Key|<math>\rightarrow</math>}}
| Select '''next buffer'''
|}
== Files ==
{| class='wikitable'
! Key Sequence
! Purpose
|-
| {{SpecialKey|CONTROL|x}}&nbsp;{{SpecialKey|CONTROL|f}}
| '''Find''' the specified file
|-
| {{SpecialKey|CONTROL|x}}&nbsp;{{Key|4}}&nbsp;{{SpecialKey|CONTROL|f}}
| '''Find''' the specified file and open in '''other window'''
|-
| {{SpecialKey|CONTROL|x}}&nbsp;{{SpecialKey|CONTROL|s}}
| '''Save''' the '''current file'''
|-
| {{SpecialKey|CONTROL|x}}&nbsp;{{SpecialKey|CONTROL|w}}
| '''Save''' the '''current file''' to a '''new''' path
|-
| {{SpecialKey|CONTROL|x}}&nbsp;{{Key|s}}
| '''Save''' '''changed files''' (prompts for all confirmation)
|}
 
== Find and Replace Strings ==
{| class='wikitable'
! Key Sequence
! Purpose
|-
| {{SpecialKey|CONTROL|s}}
| Incremental '''forward search'''
|-
| {{SpecialKey|CONTROL|r}}
| Incremental '''reverse search'''
|-
| {{SpecialKey|ALT|x}}&nbsp;replace-string&nbsp;{{Key|RET}}
| '''Replace''' the specified '''string''' with another
|}
 
== Formatting ==
{| class='wikitable'
! Key Sequence
! Purpose
|-
| {{SpecialKey|ALT|x}}&nbsp;auto-fill-mode&nbsp;{{Key|RET}}
| Toggle '''auto-fill mode'''
|-
| {{SpecialKey|CONTROL|x}}&nbsp;{{Key|f}}
| Specify '''margin''' in terms of characters
|-
| {{SpecialKey|ALT|q}}
| '''Re-fill''' the paragraph using the current margin
|-
| {{SpecialKey|ALT|x}}&nbsp;set-justification-left{{Key|RET}}
| '''Left justify''' the region
|-
| {{SpecialKey|ALT|x}}&nbsp;set-justification-right{{Key|RET}}
| '''Right justify''' the region
|-
| {{SpecialKey|ALT|x}}&nbsp;set-justification-full{{Key|RET}}
| '''Full justify''' the region
|}
 
 
== Spelling ==
{| class='wikitable'
! Key Sequence
! Purpose
|-
| {{SpecialKey|ALT|x}}&nbsp;flyspell-mode{{Key|RET}}
| Enable '''Flyspell mode''', which highlights all misspelled words.
|-
| {{SpecialKey|ALT|$}}
| Check and correct spelling of the word at point
|-
| {{SpecialKey|ALT|x}}&nbsp;ispell{{Key|RET}}
| Check and correct spelling of the entire buffer (or region)
|}
 
== Special Characters ==
{| class='wikitable'
! Key Sequence
! Purpose
|-
| {{SpecialKey|CONTROL|X}} {{Key|8}} {{Key|RETURN}}
| Insert unicode character
|}
== Version Control: Merge ==
{| class='wikitable'
! Key Sequence
! Purpose
|-
| {{SpecialKey|ALT|x}}&nbsp;smerge-mode{{Key|RET}}
| Enable '''merge mode'''
|-
| {{SpecialKey|CONTROL|C}} {{Key|^}} {{Key|n}}
| Move to '''next''' conflict
|-
| {{SpecialKey|CONTROL|C}} {{Key|^}} {{Key|p}}
| Move to '''previous''' conflict
|-
| {{SpecialKey|CONTROL|C}} {{Key|^}} {{Key|u}}
| Keep '''upper''' version
|-
| {{SpecialKey|CONTROL|C}} {{Key|^}} {{Key|l}}
| Keep '''lower''' version
|-
| {{SpecialKey|CONTROL|C}} {{Key|^}} {{Key|R}}
| '''Refine''' differences (highlight words that are different)
|}
 
== Macros ==
{| class='wikitable'
! Key Sequence
! Purpose
|-
| {{Key|F3}}
| '''Start recording''' macro
|-
| {{Key|F4}}
| '''Finish recording''' macro
|-
| {{Key|F4}}
| '''Use''' previously recorded macro
|-
| {{SpecialKey|ALT|X}} name-last-kbd-macro
| Assign '''name''' to last keyboard macro
|-
| {{SpecialKey|ALT|X}} insert-kbd-macro
| '''Copy''' macro to buffer<br/>
May subsequently be placed in emacs initialization file.<br/>
Assign key to macro in emacs initialization file:<br/>
<code>
(global-set-key (kbd "<f5>") 'save-compile-run)
</code>
|-
| {{SpecialKey|ALT|X}} macro-name
| '''Run''' specified macro
|}
 
== Building and Running (Merlin Extensions) ==
{{EmacsKeysRun}}
 
== Language Services (Merlin Extensions) ==
{{EmacsKeysLanguageServices}}
 
[[Category:Emacs]]

Latest revision as of 08:28, 10 January 2024

Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder
HintIcon.png
Moved to Moodle logo.svg
See CS-001 Computer Science Reference: Keys → Emacs

 This article can be improved by:  Please provide a link or explain where this is. I can't find the CS-001 reference or the Keys → Emacs page.