sysid blog

vimania-uri

Double-click->Open. But for VIM. No mouse.

Key Features

  1. Open URIs, html, docx, pptx, jpg, png, mp3, …
  2. Handle almost any URI
  3. Paste URLs with human-friendly description

vimania-uri

Why?

One magic power of OS UI is the capability of opening URIs by just double-clicking. As CLI worker using a mouse does not cut it.

Markdown Plugin

To deal with markdown a plugin is helpful, e.g. plasticboy’s plugin.

It allows to create new files by adding a link [topic](topic) and then jump to it by typing ge while the cursor is on the link.

Very convenient, but to remember: No .md-suffix in the link specification.

Builtin URI Handling

Vim’s builtin netrw opens files via the gx-mapping. Add link [topic](file.ext) and netrw uses the OS’s native open command to handle the file link. This means it can handle URLs, file paths, Microsoft Office Documents, etc…

A productivity booster which mimics the behavior of just double-clicking a file in a GUI file-manager. Only, this time the suffix must not be missed in the filename.

Both ways are limited in which links they can handle and how they handle it.

There should be only ONE way and it should cover all link types.


Meet vimania-uri

Simple user interface

Position cursor anywhere on URI and just say go.

go

Paste human-readable links:

<leader>vl

Optional: Bookmark Manager Integration

Save URI in CLI based bookmark manager: twbm.

goo (open and save to bookmark DB)

To remove an URI from the bookmark database the `dd` VIM command has been hooked into, so that whenever an URI gets `dd`-ed, it also gets deleted from the bookmark database.
dd (delete URI containing line from markdown and DB)

Summary

Handle URI in VIM text files as you would expect it from your OS GUI.

No need to memorize different key shortcuts or commands.

An additional benefit is the bookmark manager integration, which allows to open and manage URIs from the command line.


#python #work #vim