15 Commands List
All of the previous commands, and some additional ones are listed below. From the GNU Emacs Survival Card.
Running Emacs:
| Command | Function |
|---|---|
| C-x C-c | Quit Emacs |
| C-x C-f | Edit file; this command uses the mini buffer to read the file name; use this to create new files by entering the name of the new file |
| C-x C-s | Save file |
| C-x k | Kill a buffer |
| C-g | In most contexts: cancel, stop, abort partially types or executing command |
| C-x u | Undo |
Moving About:
| Command | Function |
|---|---|
| C-l | Scroll current line to center of window |
| C-x b | Switch to another buffer |
| M-< | Move to beginning of the buffer |
| M-> | Move to the end of the buffer |
| M-g M-g | Go to a given line number |
Multiple Windows:
| Command | Function |
|---|---|
| C-x 0 | Remove the current window from the display |
| C-x 1 | Make active window the only window |
| C-x 2 | Split window horizontally |
| C-x 3 | Split window vertically |
| C-x o | Move to other window |
Regions:
| Command | Function |
|---|---|
| C-space | Set a mark |
| M-h | Mark entire paragraph |
| C-x h | Mark entire buffer |
Killing, Yanking, Copying and Pasting
| Command | Function |
|---|---|
| C-w | Kill region |
| M-w | Copy region to kill-ring |
| C-k | Kill from the cursor all the way to the end of the line |
| M-DEL | Kill word |
| C-y | Yank back the last kill (C-w C-y combination could be used to move text around) |
| M-y | Replace last yank with previous kill |
| Cmd-C | Copy |
| Cmd-V | Paste |
Searching:
| Command | Function |
|---|---|
| C-s | Search for a string (forwards) |
| C-r | Search for a string (backwards) |
| RET | Quit searching |
| M-C-s | Regular expression search |
| M-C-r | Reverse regular expression search |
Tags
| Command | Function |
|---|---|
| M-. | Find a definition |
| M-* | Pop back to where M-. was last invoked |
Compiling:
| Command | Function |
|---|---|
| C-c C-c | Compile the file |
Getting Help:
| Command | Function |
|---|---|
| C-h | Emacs help |
| C-h t | Run the Emacs tutorial |
| C-h i | Enter Info, the documentation browser |
| C-h a | Show commands matching a string |
| C-h k | Display documentation of the function invoked by a keystroke |
| C-h m | Get mode-specific information |
Copilot:
| Command | Function |
|---|---|
| M-x copilot-mode | Toggle on/off copilot mode. |
| M-C-RET | Accept a completion. |
| C-<right> | Accept by word. |