This is a simple encrypted bookmark manager for Emacs that stores bookmarks in an encrypted file suitable for syncing via Git. It uses GPG encryption to keep your bookmarks secure while allowing you to store them in public repositories.
This README has become quite extensive, but I hope it addresses most of the doubts that may arise regarding its usage or potential issues that may occur. Nonetheless, please do not hesitate to open an issue if you encounter any problems. Pull requests are always welcome as well.
- Encrypted bookmark storage using GPG (with plain text option)
- Simple JSON format
- Git-friendly
- Built-in Emacs integration
- Tag support
- Filtering by tags
- No external dependencies beyond GPG (you probably already have that)
gpg --version
If GPG is not installed… Install it!
gpg --full-generate-key
Choose the following options:
- RSA and RSA (default)
- 4096 bits (recommended for long-term use)
- Key validity (0 = no expiration, or set as preferred)
- Enter name and email address
- Set a strong passphrase
gpg --list-secret-keys --keyid-format LONG
Add to your Emacs configuration:
;; Load esb.el (if not installing via package manager)
(load-file "~/path/to/esb.el")
;; Optional: customize bookmark file location
(setq esb-bookmarks-file "~/bookmarks/bookmarks.gpg")
;; Optional: use plain text instead of GPG encryption
;; (setq esb-storage-backend 'plain)
ESB doesn’t define any global key bindings by default to avoid conflicts. You need to define your own key bindings.
(global-set-key (kbd "C-c C-b s") 'esb-select-bookmark)
(global-set-key (kbd "C-c C-b a") 'esb-add-bookmark)
(global-set-key (kbd "C-c C-b d") 'esb-delete-bookmark)
(global-set-key (kbd "C-c C-b l") 'esb-list-bookmarks)
(global-set-key (kbd "C-c C-b e") 'esb-edit-bookmark)
(global-set-key (kbd "C-c C-b t") 'esb-list-tags)
(global-set-key (kbd "C-c C-b r") 'esb-reload-bookmarks)
(global-set-key (kbd "C-c C-b i") 'esb-initialize)
# Create directory for bookmarks
mkdir ~/bookmarks
cd ~/bookmarks
# Initialize git repository
git init
# Create .gitignore (optional - exclude temporary files)
echo "*~" > .gitignore
echo "*.bak" >> .gitignore
# Initial commit
git add .gitignore
git commit -m "your commit message"
# Create repository on GitHub (or any provider you prefer) first, then:
git remote add origin git@github.com:yourusername/bookmarks.git
# Push initial commit
git push -u origin master
Update your Emacs config to point to the git repository:
(setq esb-bookmarks-file "~/bookmarks/bookmarks.gpg")
All functions are autoloaded and can be called via M-x
:
esb-select-bookmark
- Select bookmark and copy URL to clipboard (prefix arg to filter by tag)esb-add-bookmark
- Add new bookmark with URL, description and tags are optionalesb-delete-bookmark
- Delete bookmark by selectionesb-list-bookmarks
- Display all bookmarks in a buffer (prefix arg to filter by tag)esb-edit-bookmark
- Edit bookmark description and tagsesb-list-tags
- Display all available tags with bookmark countsesb-reload-bookmarks
- Reload bookmarks from file (after git pull)esb-initialize
- Initialize empty bookmark file
When adding bookmarks, you can specify tags as comma-separated values:
- Single tag:
work
- Multiple tags:
work, api, reference
- Tags with spaces:
machine learning, data science
Use prefix argument (C-u) with list and select functions:
C-u C-c C-b l
- List bookmarks filtered by tagC-u C-c C-b s
- Select bookmark filtered by tag
M-x esb-initialize
- Create empty encrypted bookmark fileM-x esb-add-bookmark
- Add your first bookmark with tags- Commit and push to GitHub
M-x esb-add-bookmark Bookmark URL: https://api.github.com Description (optional): GitHub API Documentation Tags (comma-separated, optional): work, api, reference
# Pull latest bookmarks
git pull
# In Emacs: reload bookmarks
M-x esb-reload-bookmarks
# After making changes: commit and push
git add bookmarks.gpg
git commit -m "your message"
git push
# After adding bookmarks in Emacs
git add bookmarks.gpg
git commit -m "add new bookmarks, etc..."
git push
# Pull latest changes
git pull
# Reload in Emacs
M-x esb-reload-bookmarks
Note: GPG files can’t be automatically merged, so avoid simultaneous edits when possible.
- Keep your private key secure and backed up (VERY IMPORTANT!)
- Use a strong passphrase for your GPG key (you can cache it)
- The same GPG key must be available on all machines where you use bookmarks
- Your encrypted bookmark file is safe to store in public repositories
- The repository only contains the encrypted file, not plaintext bookmarks
- Never commit your GPG private key to the repository (ALSO VERY IMPORTANT!)
- Regularly backup your GPG keys! (ALSO VERY IMPORTANT!)
;; Bookmark file location
(setq esb-bookmarks-file "~/path/to/bookmarks.gpg")
;; Storage backend (gpg, plain, or custom function)
(setq esb-storage-backend 'gpg) ; default: GPG encrypted
;; (setq esb-storage-backend 'plain) ; plain text
;; GPG program path (if needed)
(setq epg-gpg-program "/usr/local/bin/gpg")
;; Cache passphrase
(setq epa-file-cache-passphrase-for-symmetric-encryption t)
Stores bookmarks in GPG-encrypted files, suitable for public repositories like Github.
Stores bookmarks in plain JSON files. Useful for local-only usage or when GPG is not available.
(setq esb-storage-backend 'plain)
(setq esb-bookmarks-file "~/bookmarks/bookmarks.json")
The encrypted file is just a simple JSON array:
[
{
"url": "https://example.com",
"description": "Example website",
"tags": ["work", "reference"]
},
{
"url": "https://github.com",
"description": null,
"tags": ["code", "git"]
},
{
"url": "https://api.example.com",
"description": "API docs",
"tags": null
}
]
If you encounter key binding conflicts:
- Check what’s currently bound:
C-h k [key-sequence]
- Choose different keys for ESB functions
- Use
global-set-key
to define exactly what you want
- Ensure GPG is properly configured and your key is available
- Check that
epa-file
is working: try opening any.gpg
file - Verify GPG agent is running if using GUI Emacs
ESB now validates bookmarks and will skip invalid entries:
- URLs must start with http:// or https://
- Tags must be strings if present
- Use
M-x esb-reload-bookmarks
if you manually edit the file (NOT RECOMMENDED!)
This is a simple encrypted bookmark manager for Emacs that stores bookmarks in an encrypted file suitable for syncing via Git. It uses GPG encryption to keep your bookmarks secure while allowing you to store them in public repositories.
Copyright (C) 2025 0xhenrique
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.