I’ve been rewatching some of Tim Visher’s VimGolf for Emacs videos (where are you Timmy?) and one of the things that struck me the second time through was his demonstration of Emacs bookmarks. I remembered my old post on opening frequently accessed Emacs files in which I wrote about storing frequently accessed files in registers so that you could jump to them with【Ctrl+x r j】. Many of the commenters on that post told me that I really should be using bookmarks for that sort of thing. For unfathomable reasons I have resisted using bookmarks but Visher’s videos spurred me to give them a try. Serendipitously, Xah Lee’s blog had a short piece on bookmarks with a pointer to his bookmarks tutorial so I was able to get started quickly.
At first, I used them as Visher did in his videos: to jump to parts of the Emacs manual. How much easier to just type【Ctrl+x r b】
registers to bring up the documentation on registers than to bring up Info with 【Ctrl+h i】 and navigate to the register node. Then I remembered the reason I wrote that post on opening frequently accessed Emacs files to begin with so I added bookmarks for my tax file, my
steps.org file, and my
I keep my bookmarks file in a git repository so that it gets synced between my machines. I noticed that this can be a bit tricky because even if git updates your bookmark file, Emacs will overwrite it the next time you save your bookmarks. For that reason, I added the following line to my sync-repos function
(bookmark-load bookmark-default-file t)
That means that when I pull in changes from the other machines my bookmarks will be updated at the same time. It can be hard to get this right because
bookmark-load and its siblings will, by default, add to the current bookmarks rather than replacing them. The second argument to
bookmark-load says to overwrite the bookmarks rather than add to them.