Emacs: Bookmark

By Xah Lee. Date: . Last updated: .

Emacs's Bookmarks is similar to browser's bookmark. It lets you easily open frequently needed files.

emacs bookmark 2021-07-19
Emacs Bookmark.

Add a Item to Bookmark

bookmark-setCtrl+x r m
Add current buffer to bookmark. It will prompt you for a name. Bookmark can be a file or a directory.

List Bookmark Items

list-bookmarksCtrl+x r l
Open the bookmark list.

Open a Item in Bookmark

bookmark-jumpCtrl+x r b
Open a bookmarked file. Be sure to turn on fido-vertical-mode for flex matching. [see Emacs: icomplete mode, fido mode]

Remove/Rename a Bookmark Item

First, Alt+x list-bookmarks to go into bookmark-bmenu-mode , then

Save Bookmark File

Alt+x bookmark-save to save the bookmark file. (Press s while in bookmark file)

Bookmarks are automatically saved when emacs quit. (Emacs 24.4 (released 2014-10))

You can control bookmark auto save behavior by bookmark-save-flag.

put this in your Emacs Init File:

;; when bookmark is changed, automatically save it
(setq bookmark-save-flag 1)

Open Bookmark File on Emacs Start

put this in your Emacs Init File:

(setq inhibit-splash-screen t)
(require 'bookmark)
(list-bookmarks)
(switch-to-buffer "*Bookmark List*")

Bookmark File Location

bookmark-default-file
variable. Value is Bookmark file path. [see Emacs: Show Variable Value]

video tutorial

xah talk show 2022-05-12 emacs, most efficient ways to open file
ErgoEmacs mascot-s276x226
Buy Xah Emacs Tutorial

Emacs Tutorial

Quick Start

Manage Windows

File

Buffer

Find Replace

Copy/Paste

Unicode

Whitespace

Rectangle Edit

Line Wrap

Shell

View Special File

Editing Brackets

Org Mode

HTML

Emacs Efficiency

Misc