Emacs: Hard-Wrap Lines
reformat lines so that lines are not longer than 70 chars

fill-paragraph
Alt+x fill-paragraph
【Alt+q】 to reformat the current block of text your cursor is on.
Alt+x fill-region
to reformat a text selection.
To have emacs automatically insert a newline char when typing reaches the right margin, Alt+x auto-fill-mode
.
The variable fill-column
controls the width used in the above commands.
Alt+x set-variable
, to change value.
Note: these commands insert newline characters into your file. This type of wrapping is called hard-wrap. Hard-wrap convention of 80 chars came from punched card. You should avoid hard-wrap when possible; add newline char only at logical positions. (Rant: The Harm of hard-wrapping Lines.)
make sentence ending by single space
When Alt+x fill-paragraph
etc, emacs will reformat it so that there are 2 spaces after a period.
;; make sentence ending by single space (setq sentence-end-double-space nil )
Emacs Line Wrap
Emacs Init
Init Basics
Keys
Font
Text Editing
- Type Overwrite Selection
- Tab/Space/Indent Setup
- electric-pair-mode
- Isearch Whitespace Setup
- Move Cursor by camelCase
Completion
File
Restore Things
Backup/AutoSave
Line
- Show Line Numbers
- Show Cursor Column Position
- Highlight Current Line
- Setup Soft-Wrap Lines
- Hard-Wrap Lines
- Arrow Key Move by Logical Line
Appearance
- Highlight Brackets
- Set Color Theme
- Show Formfeed as Line
- Line Spacing
- Show lambda as λ
- Default Window Size
Misc
Advanced Init Tips
- What is Major Mode
- What is Minor Mode
- Show Variable Value, List Variables
- M-x customize
- Organize Init File
- Byte Compile Elisp
- What is Hook
- Avoid Lambda in Hook
- Environment Variables in Emacs
- Check OS, Version, Host Name