Overview Link to heading
This is a small post that describes how I made authoring markdown, org-mode etc easier by using snippets that help me handle links like a pro.
Prologue Link to heading
I am a heavy user of org-mode. I use it for taking notes, writing blogs, presentations and so on. As a software developer I often use markdown too. In both cases at some point I have to deal with links.
Embarrassingly enough, I used to rely on my browsers bookmarks to handle links, so my workflow looked a little like:
- open the browser
- search for the url of interest in bookmarks
- copy the url
- jump to the editor
- use the special syntax for adding links
- paste the copied url
- add a text to appear on the link
I find this so counter-intuitive that is hands down the most boring thing for me when it comes to writing.
Quickmarks Link to heading
All the cool kids should try… Link to heading
A year back (maybe) more I came across a video for linux geeks, according to which all the cool kids should try qutebrowser. And so I did.
Among other a feature of this browser I liked was quickmarks.
What are quickmarks? Link to heading
Quickmarks are just labeled bookmarks.
And what so special about them? Link to heading
It makes it easy to search for bookmarks, since the `open` action does not just search in history and bookmarks it also allows you to search by label. It might not sound much, but it did add a lot to my browsing experience.
What does it have to do with writing docs, blogs and presentations? Link to heading
I’d like my editor to support quickmarks, so that I don’t have to jump back and forth to my browser.
As an emacs user adding quickmarks is as easy as adding the following code to my config:
|
|
And then to easily access those links I can use a function as follows:
|
|
Creating quickmark aware snippets Link to heading
For writing snippets I use yasnippets. yasnippets allow users to integrate code into the snippet and that will help us look up our quickmarks from within the snippet.
So for markdown documents the snippet looks like:
|
|
and for org-mode:
|
|
Using the snippet in action Link to heading
Epilogue Link to heading
All of the code used in this post can also be found in my dotfiles repository.
I hope you found it useful!