Emacs notes
From Reboil
This page contains notes for using Emacs.
Stats
Commands
- fill-paragraph
- (Shortcut:
M-q
) Depending on mode, reduces column width of text to that set byset-fill-column
- query-replace
- Search and replace, prompting (i.e. querying) for each replacement.
- query-replace-regexp
- Search and replace with regular expressions[cmt 1], prompting (i.e. querying) for each replacement.
- quoted-insert TAB
- (Shortcut:
C-q TAB
) Inserts aTAB
character.
- revert-buffer
- Reload file to buffer, discarding changes.
- set-fill-column
- Prompts setting the paragraph width produced by commands such as
fill-paragraph
- toggle-truncate-lines
- Make long lines wrap around to stay within view in a window.
- text-scale-adjust
- (Shortcut:
C-x C-+
,C-x C-=
, orC-x C--
) Increase or decrease size of text, pressing+
,-
or0
to adjust. Note: only effective on GUI.
Modes
hs-minor-mode
Shortcuts:
- Hide current block (
M-x hs-hide-block
) - Show current block (
M-x hs-show-block
)C-c @ C-s
- Hide all
C-c @ C-M-h
C-c @ C-t
- Show all
C-c @ C-M-s
C-c @ C-a
visual-line-mode
Wraps lines at word boundaries.[1]
M-x visual-line-mode
Useful techniques
Reformat footnote numbers with query-replace-regexp
in Mediawiki wikicode. (e.g. link to a corresponding #c4n{n}
anchor in a subpage at [[../Notes]]
.)
M-x query-replace-regexp \([0-9]+\) <sup>[[../Notes#c4n\1|\1]]</sup> ENTER M-x query-replace-regexp \([0-9]+\)$ <sup>[[../Notes#c4n\1|\1]]</sup> ENTER
History
See also
External links
References
Footnotes
Comments
- ↑ Baltakatei: 2025-01-20: For more on Emacs's particular flavor of regular expressions, see the manual.