I thought about writing a short post on how I tend to capture bookmarks using org-mode1 these days.
;; Capture template ("l" "Daily Bookmarks" entry (file+headline (lambda () (personal-note 'daily)) "Bookmarks") "** %(org-cliplink-capture)%?\n" :unnarrowed t) ;; Utility function (defun personal-note (ntype) (cond ((string= 'daily ntype) (concat org-directory (format-time-string "/%Y/%B_%-e.org"))) ((string= 'work ntype) (concat org-directory (format-time-string "/work/%Y/note_%m_%d.org"))) (t (error "Invalid personal note type: " ntype))))
Most important time saver in this capture template is the use of
org-cliplink-capture functionality which is provided by the
I tend to capture bookmarks on daily notes file, as can be seen from the above
template. As an example, notes for today will be captured in a dedicated file
$ORG_DIR is the root directory for notes.
With this approach, bookmarks will be scattered on multiple note files. Using
file+olp+datetree capture method, one can maintain a single note
dedicated to bookmarks, say
I have set
F9 as the org-capture shortcut with following key binding,
(global-set-key [f9] 'org-capture)
Thus, capturing a bookmark link into the notes buffer is just two key presses:
F9 + l.
Following is how a sample bookmarked link looks like in my current setup.
Since bookmarks captured in this method are simply org-mode text nodes, you can embellish entries in the same way as any other org-mode entry node.
Following are some of the advantages of bookmarking in this manner instead of using an online service, such as pinboard5.
Bookmarks with org-mode allow you to add context and accompanying notes to a bookmarking link (as can be seen in above example), which I find very valuable. Sometimes, I find peripheral things I learn from web resources are even more important than the links themselves. Org mode bookmarks, as captured via following template allows me to easily do just that.
I add a bit of a background on things while I bookmark because it is so easy to do that, with Emacs, being a full fledged text editor. In fact, the capture template as I’ve defined above, gets me right into a prompt to add more details after inserting the link to the Emacs buffer.
Org-mode supports tags6 and they are quite powerful. It is pretty easy
to set tags while capturing a new bookmark via Emacs. Tags can be used to filter
bookmarks on based on topics. For example, all bookmarks links with the tag
agda can be searched quite easily with org-mode.
Notes in org-mode is just plain text. Thus bookmark data is portable across operating systems with almost no risk of getting locked into a proprietary data format.
Fast local search
Emacs can filter and find bookamrked links very quickly using tools such as
helm7 or ivy8. Also one can classic POSIX tools such as
other text processing tools to locate and filter bookmarks.
Going a one step further, one can setup indexed local search for org-mode note files for even faster and more precise search experience. I have used recoll9 on Linux for such a setup in the past.
Limitations of this approach
Just as the advantages of this bookmarking approach is parallel to the advantages of using org-mode in general, the disadvantages are pretty much the same as general limitations of org-mode ecosystem.
- Lack of good mobile support10 - after not finding a good mobile org-mode solution, what I tend to do is to capture one off links while browsing from phone to a temporary note on Google Keep.
- Separate synchronisation solution - I use Dropbox to sync notes between computers. With Emacs and org-mode, syncing is something separate you have to think about.
- Lack of sharabilty - online bookmarking tools often provides a way to share your bookmarks within the service itself, i.e. without the need to export to a different format. But with the method I’m describing here, you cannot easily share your bookmarks without exporting only parts of your notes you might want to share.
I wanted to write more on making a case for using offline bookmarks, but then I realised that the case for this is same as making a case for why I’m using org-mode for note taking - and there are many other posts around the internet making that case. So, in the end I decided to keep the post very short just describing the capture template which I find very useful.
In the past when I looked at using org-mode on the phone, none of the apps I tried could handle the large notes repository I had. Things might have gotten better in the meantime. ↩