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

Add a Item to Bookmark
bookmark-set
【Ctrl+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-bookmarks
【Ctrl+x r l】- Open the bookmark list.
Open a Item in Bookmark
bookmark-jump
【Ctrl+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
- Type d to mark the current item for remove.
- Type x to remove all D marked ones.
- Type r to rename current item's title.
- Type s to save the change.
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]
- In emacs 24.x, bookmark file is at
~/.emacs.d/bookmarks
. - In emacs 23.x, bookmark file is at
~/.emacs.bmk
.