Emacs Basics Tips

By Xah Lee. Date: . Last updated: .

Here's answer to most frequently asked questions.

How to search text?

How to find replace?

How to find replace for all files in a dir?

How to Comment, Uncomment

How to add a prefix to every line? (such as # or //)

How to delete the first few n chars of every line?

How to Insert a Literal Tab or Newline

How to change file line endings between Windows/Linux/Mac?

How to record keystrokes?

How to move thru camelCaseWords?

How to have spell-checker turned on?

How to find a command?

How to List Lines

How to Highlight Words

How to Sort Lines

Delete Trailing White Spaces

Make Spaces and Tabs Visible

Multiple Clipboards

No restarting emacs when add to init file

Just select the new emacs lisp code, then Alt+x eval-region.

[see Emacs: Init File Tutorial]

Start a second shell

Ctrl+u Alt+x shell.

[see Emacs: Run Shell in Emacs]

Revert/Refresh File from Last Saved

Open File as Hexadecimal

Alt+x hexl-find-file. If the file is already opened, Alt+x hexl-mode. [see also Emacs: Set Default Major Mode]

Set background color

ErgoEmacs mascot-s276x226
Buy Xah Emacs Tutorial

Emacs Tutorial

Quick Start

Font

Split Window

File

Buffer

Find Replace

Copy/Paste

Unicode

Whitespace

Rectangle Edit

Line Wrap

Shell

View Special File

Editing Brackets

Org Mode

HTML

Emacs Efficiency

Misc