Emacs: Principle, Command, Keys
Everything is a Command
In emacs, every keystroke executes a command. For example, when you type a key e, emacs actually runs the command self-insert-command.
Any key or key combination sequence you press ultimately calls a command.
There are over 3 thousand commands in emacs by default.
Most commonly used commands have a keyboard shortcut, such as moving the cursor, opening file, copy paste, close a file, search text.
To run a command by name, type Alt+x followed by the command name.
- Alt+x
execute-extended-command - Execute a command by name
keyboard-quit【Ctrl+g】- Cancel a command in progress, or cancel unfinished keyboard keystroke sequence
Find What a Key Do
- Alt+x
describe-key【Ctrl+h k】 - Prompt to type a key shortcut, then show command name and doc bound to that key.
Find a Command's Key
- Alt+x
describe-function【Ctrl+h f】 - Prompt to type a command name, it'll shows the command's key, if any.
How to find a command
- Alt+x
apropos-command - Search command by name.
View Current Major Mode's Documentation
- Alt+x
describe-mode - Show current major mode's documentation.
Emacs Principle
- Emacs: Principle, Command, Keys
- Emacs: Jargons (Glossary)
- Emacs: Mode Line (Status Bar)
- Emacs: Major Mode
- Emacs: Minor Mode
- Emacs Init: Hook
- Emacs: Minibuffer
- Emacs: Messages Buffer
- Emacs: Universal Argument (C-u prefix arg)
- Emacs: Repeat Last Command
- Emacs: Jump to Previous Position
- Emacs: Narrow to Region