Best features for text-editing in emacs

Table of Contents

img

There has been recent discussion about emacs for text editing and it got me thinking; I use emacs for a lot of non-code text editing and here are some features I use all the time that lead me to consider emacs good at text-editing. I’ll separate them into built-in and external library categories. What would you add to this list for things that help with raw text-editing (not IDE-like programming features)?

Text Editing features

Built In

besides the regular cursor navigation stuff (I make heavy use of C-a, C-e, M-f, M-b, M-e, M-S->, M-S-<, C-k)

  • Undo; not special, but something that is a must-have at easy key-distance. I’ve bound it to C-/ and reach for the command instinctively all the time. Likewise, C-l (recenter-top-bottom)as the non-destructive command that will reset undo (allowing me to re-do). ALL. THE. TIME.
  • buffer splitting and multiple views. Not to be forgotten; I am constantly using multiple buffers, both in the same file and in different ones, and my muscle-memory knows C-x 2 and C-x 3 and closing them with C-x 0 or C-x 1.
  • C-t transpose-chars and its companion M-t transpose word
  • C-x i (insert-file) to stick stuff straight into my document
  • M-q (fill-paragraph) since my “paragraphs” have unlimited line length, this removes line breaks
  • M-/ (dabbrev-expand) which replaces the word at point with the nearest thing in some open buffer. Repeating it cycles through replacement options. Great as a super-quick spell-check or completion when you’ve just started some annoyingly long word. Great for code variables as well as natural language prefixes.
  • ispell and its family for spell-checking, which can be super-powered by extra libs
  • Multiple kill-ring, meaning you can copy three chunks of text from somewhere and paste them in the places you want, instead of having to go back to copy the second, then paste, then third, then paste, you’ve got it all in one go. I frequently wish for a kill ring when I’m in my browser or libre calc.
  • replace-regexp which, along with plain old regexp replacement, lets you replace with the results of a function. I’ve used this to implement transliterations, to fix mis-sectioned documents when line-breaks were mistaken for new sections, etc.
  • word casing with M-l downcase-dwim, M-c capitalize-dwim, and M-u upcase-dwim
  • Registers, which can contain points, words, or other things that you might want to paste in at some unknown time in the future, some undefined number of times
  • follow-mode so that in two columns I can span twice the vertical length and paging up/down one moves the other to stay in line.
  • clone-indirect-buffer makes a copy of a section of a buffer which can take buffer-state changes that won’t effect the whole buffer (e.g. text-size, collapsed content, highlights) without effecting the main buffer view, while content changes will be visible in both places.
  • Indentation-control. Select some lines, then do C-x TAB (indent-rigidly)and press left/right until your spacing is what you want.
  • just-one-space, included in simple.el with emacs: press once to remove all but one space at cursor spot; twice two remove all at once, three times to start over.

Library functions

Notable Mention

The emacs reddit community had some excellent recommendations, some of which I haven’t tried

Resources

Tory Anderson avatar
Tory Anderson
Full-time Web App Engineer, Digital Humanist, Researcher, Computer Psychologist