Skip to main content

Add your description here

Project description

Advanced URI Handling for the Modern Vim User

Intuitive, Fast, and Powerful

Background: https://sysid.github.io/vimania-uri-rs/

This Rust re-implementation of VIM plugin vimania-uri with 10x faster VIM startup time and bkmr integration.

Key Features

  1. Open URIs and Various File Types: Seamlessly open URIs, HTML files, DOCX, PPTX, JPG, PNG, MP3, and more.
  2. Handle Almost Any URI: Manage a wide range of URI formats, ensuring maximum compatibility and flexibility.
  3. Paste URLs as Markdown Links: Automatically fetch the title and create reference-style Markdown links for easy documentation.
  4. Jump to Headings or Line Numbers: Navigate directly to specific headings or line numbers within files for quick access.
  5. Bookmark Manager Integration: Load your URIs into Rust based CLI Bookmark Manager bkmr.

Why?

Vim's native gx is effective but limited. Same is true for other plugins I am aware of. I wanted more powerful URI handling in my markdown files.

demo

User Interface

Position cursor on URI and type go.

go

Handled Link Types

  • local text links: [foo](second.md) will be opened inside vim. If the target contains line number as in [foo](second.md:30), the line will be jumped to. Also anchors are supported, for example [foo](second.md#custom-id).
  • URL links: [google](https://google.com) will be opened with the OS browser.
  • non text files: if the option g:vimania-uri#Extensions is set, non text files will be opened via the operating system. This behavior is handy when linking to binary documents, for example PDFs.
  • internal links: [Link Text](#Target), will link to the heading # Target. Following the link will jump to the heading inside vim. Currently both github style anchors, all words lowercased and hyphenated, and jupyter style anchros, all words hyphenated, are supported.
  • reference style links: for links of the form [foo][label], vimania-uri will lookup the corresponding label and open the target referenced there.
  • implicit name links: for links of the form [foo][] will use foo as the label and then follow the logic of reference style links.
  • custom ids via attribute lists: the id a link target can be defined via [attribute lists][attr-lists] of the form {: #someid ...}. This way fixed name references can be defined to prevent links from going stale after headings have been changed.
  • local link format of pelican: vimania-uri handles |filename| ... and {filename} ... links as expected, for example [link](|filename|./second.md) and [link]({filename}../posts/second.md).

Usage

In normal model within a Markdown document, press go on a markdown-link to open it. If the link is a local file it will be opened in vim (C-o will get you back). Otherwise, it will be opened via OS (.e.g Web-Broser, Microsoft Office, ...).

The following links can be used (the possible cursor positions are indicated by ^):

This [link](https://example.com) will be opened inside the browser.
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^

This [link](./foo.md) will open `./foo.md` inside vim.
     ^^^^^^^^^^^^^^^^

This [link](|filename|./foo.md) will open `./foo.md` inside vim.
     ^^^^^^^^^^^^^^^^^^^^^^^^^^

This $HOME/dir will be opened inside file browser
     ^^^^^^^^^

This $HOME/dir/present.pptx will open in Powerpoint
     ^^^^^^^^^^^^^^^^^^^^^^


If `g:vimania-uri_Extensions` is set to `.md, .MD`

[link](|filename|./example.pdf) will be opened in pdf reader
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Document internal linking works, too: to link to the heading Usage, use
this [link](#usage).
     ^^^^^^^^^^^^^^

Reference style [links][ref-style-link] will open http://example.com in browser
                ^^^^^^^^^^^^^^^^^^^^^^^
[ref-style-link]: http://example.com

The behavior can be configured via the following options:

  • g:vimania_uri_extensions: a comma separated list of file extensions. Only files with the given extensions will be opened in vim, all other files will be opened via the configured application (using open on OSX and xdg-open on linux).

  • g:vimania_uri_twbm_integration: Boolean flag to configure bkmr integration (see below)


Installation

Using vim-plug:

Plug 'https://github.com/sysid/vimania-uri-rs.git', {'do': 'pip install vimania-uri-rs --upgrade --target ~/.vim/plugged/vimania-uri-rs/pythonx', 'branch': 'main'}
  let g:vimania_uri_extensions=['.md','.txt','.rst','.py']
  let g:vimania_uri_twbm_integration=1  # if bkmr is installed else 0
  • vim needs to be configured with python support
  • pip must be in path to install required dependencies into vimania/pythonx (no pollution of system python).
  • tested on Linux/MacOS

Alternatively if you want to compile it yourself:

Plug 'https://github.com/sysid/vimania-uri-rs.git', {'do': 'python3 build.py', 'branch': 'main'}
  • rust, maturin must be installed (on PATH) to build the plugin

Credits

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

vimania_uri_rs-1.0.0-cp312-cp312-manylinux_2_34_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.34+ x86-64

vimania_uri_rs-1.0.0-cp312-cp312-macosx_11_0_arm64.whl (2.4 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

vimania_uri_rs-1.0.0-cp312-cp312-macosx_10_12_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.12 macOS 10.12+ x86-64

vimania_uri_rs-1.0.0-cp311-cp311-manylinux_2_34_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.34+ x86-64

vimania_uri_rs-1.0.0-cp311-cp311-macosx_11_0_arm64.whl (2.4 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

vimania_uri_rs-1.0.0-cp311-cp311-macosx_10_12_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.11 macOS 10.12+ x86-64

vimania_uri_rs-1.0.0-cp310-cp310-manylinux_2_34_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.34+ x86-64

vimania_uri_rs-1.0.0-cp310-cp310-macosx_11_0_arm64.whl (2.4 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

vimania_uri_rs-1.0.0-cp310-cp310-macosx_10_12_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.10 macOS 10.12+ x86-64

File details

Details for the file vimania_uri_rs-1.0.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-1.0.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 664891074782475b7a8e92916f590e9b1035ee80da9ac77dc149be6e055acfb4
MD5 eb7a53d46c4781b2e678819ee1c06364
BLAKE2b-256 450a03886fdc9696f91c56486875b0ad48d5e1dc09a9f56d568e3f865a65c431

See more details on using hashes here.

File details

Details for the file vimania_uri_rs-1.0.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3b38ce6aeb01cc7502e9b33814cac2bbe08516062fb8c62757333373fc5b1c56
MD5 a33594b26ba0de0478db472aba45dee8
BLAKE2b-256 67df41a2f432a71635bc89ab4cffc6ded4428d0673efa9452d08454cf04462b3

See more details on using hashes here.

File details

Details for the file vimania_uri_rs-1.0.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-1.0.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 349d503e8eb6017a23188e69e20679f0bea443064b96b4150e1c2477e1fd97c2
MD5 16792886d31b62d93e4bfd25f1cdb353
BLAKE2b-256 d775ecc913d2f6a37425288bc38c8ca933c4ab0f9baeee77799988371642fd27

See more details on using hashes here.

File details

Details for the file vimania_uri_rs-1.0.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-1.0.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 de70f24be978b3a0ff0011b354752722b318cfbde4d9aec2eb548db7a3f978a5
MD5 2e01beefe81ac5d9c79b3bef1332e755
BLAKE2b-256 4b005409cd2f873ef02c84e05a7af6c18fc3ce8e45d29a0f5158c4393996177f

See more details on using hashes here.

File details

Details for the file vimania_uri_rs-1.0.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bbedf92d7b2d4e41f95a84f48b3f6cc1253760bde78cb1687b755c158102f747
MD5 7b13232acbb9d942c3f1e62859d35f61
BLAKE2b-256 ef527b3a8072a640ca12283b08455fadd14d45e53c7ca3b8fc6001a4a81d6237

See more details on using hashes here.

File details

Details for the file vimania_uri_rs-1.0.0-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-1.0.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f86247b8d8efe6dea016735ff92f81263ba422c03965c94fbaad43f5231cfc0a
MD5 69d86d7404e3e9953d09e9182a90894a
BLAKE2b-256 ab76289b198adbd604924e4cb50cdaedd9b5eab1e30ca1e5172e6fcf388ba6fb

See more details on using hashes here.

File details

Details for the file vimania_uri_rs-1.0.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-1.0.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c2089624c67a027e452e1ce6921c05cb79cad5c33dbf928c4b588fbb4e11afb8
MD5 03c8de3d210501edc7276cadce16407a
BLAKE2b-256 5ce7ad50a2b43b6ea7609841e4f4b3d8816ba3d59cdc5011c65504699d1d0d2b

See more details on using hashes here.

File details

Details for the file vimania_uri_rs-1.0.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-1.0.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 72334ed99aa04865abc16b0993303c2b804a17ebeeeea072d44faae338ac4a4b
MD5 40734a62f650defcec40b35f0886b9da
BLAKE2b-256 972a597cfb8121444d88f10fc355a3e7d940372da1bb6799ec9e77d1f5de947c

See more details on using hashes here.

File details

Details for the file vimania_uri_rs-1.0.0-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-1.0.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5ab1d24e70cdf6ace8baf555a3a8ba33e3657a77f86d10465f5e6402cb64248c
MD5 c5479cb7d05a5a254a0819d5bfc0ccea
BLAKE2b-256 ab4ebbb76320bc7616ea9134802d06d82ac5536a64fb81a78c300b4b06560f7d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page