logo
Jiff Slater
🤔 About
✍️ Contact
📚Knowledge
30 Jul 2021
These articles have been archived. You may find them useful but I am no longer offering support for them. Check out my latest articles on plkt.io.
Elinks advanced URI management
1 June 2009

In the process of whipping elinks into a tame beast, I discovered several options that I wasn’t aware of.

URI rewriting: allows me to execute Google searches, dictionary lookups, and imdb queries within the ‘Goto URL’ dialog box. It should be enabled by default but if not, go to the Option manager -> Protocols -> URI rewriting and select either Dumb or Smart Prefixes. Once enabled, you can type ‘g search_term’ in the search box to quickly search Google for search_term. Look at the other prefixes to determine your options.

I wasn’t satisfied with having to use a prefix every time I wanted to search, so I modified the default template (Option manager -> Protocols -> URI rewriting -> Default template) to ‘http://www.google.com/search?q=%s’. This means that any entry in the ‘Goto URL’ dialog box that doesn’t look like a URL, a file, or an existing prefix will result in a Google search with that string!

Sessions: It turns out that elinks is a beast with many abilities, I wasn’t aware that it supported session saving/restoring (Option manager -> User interface -> Sessions).

URI passing: Often, when on the console, I’ll want to share a link with someone but I’ll be restricted by the atrocious lack of copy/paste. To solve the issue while using elinks, I enabled the link-external-command and tab-external-command options to save the highlighted link and current link, respectively, to a file.

To enable it, first go into the keybinding manager, toggle the display, and choose a keybinding for ‘main -> link-external-command’. This will be the keybinding you will press when you want to save the highlighted URL to a file. Likewise, choose a keybinding for ‘main -> tab-external-command.’ This is the keybinding you will press when you want to save the URL of the current tab to a file. After setting those shortcuts, go to ‘Option manager -> Document -> URI passing’ and create an entry with the contents ‘echo -n %c > ~/url’ (modify as you see fit). From now on, when you use (link|tab)-external-command the URL will be saved in ~/url.

For my inspiration, have a look at .