Skip to main content

Advanced URI handling for Vim with Rust performance

Project description

vimania-uri-rs

Advanced URI Handling for the Modern Vim User

Downloads PyPI Version Build Status Security Audit

Background: Rewriting a Vim Plugin in Rust

A high-performance Rust reimplementation of the vimania-uri Vim plugin, delivering 10x faster startup times with advanced URI handling capabilities.

✨ Key Features

  • 🚀 Lightning Fast: 10x faster startup than pure Python implementations
  • 🔗 Universal URI Support: Handle web URLs, local files, internal links, and more
  • 📝 Smart Markdown Integration: Auto-fetch page titles for reference-style links
  • 🎯 Precise Navigation: Jump to specific headings, line numbers, or anchors
  • 🛡️ Security First: Built-in SSRF protection and comprehensive security auditing
  • 🔧 Extensive Format Support: Open HTML, DOCX, PPTX, images, audio, and more
  • 💎 Modern Architecture: Rust core with Python integration for optimal performance

🎯 Why vimania-uri-rs?

While Vim's native gx command and existing plugins provide basic URI handling, they often fall short in terms of:

  • Performance: Slow startup times and laggy URL processing
  • Features: Limited format support and navigation capabilities
  • Security: No protection against malicious URLs

vimania-uri-rs addresses all these limitations with a modern, high-performance solution.

📹 Demo

Demo

📺 Watch the full demo on YouTube

Best paired with: vim-markdown, but works excellently with any file type.

🚀 Quick Start

It's simple: Position your cursor on any URI and press go.

go

That's it! The plugin intelligently determines how to handle the URI based on its type and context.

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 VIM normal mode in a Markdown document, type go while curser is on markdown-link. 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 open command (.e.g Web-Broser, Microsoft Office, ...).

The following links will be handled (the possible cursor positions are indicated by ^):

Local text links: [link](foo.md) will be opened inside vim. 
                  ^^^^^^^^^^^^^^
If target contains line number as in [link](foo.md:30), the line will be jumped to. 
Also anchors are supported, for example [link](foo.md#anchor)

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

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

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

[link](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

⚙️ Configuration

Core Settings

" File extensions to open in Vim (others use OS default)
let g:vimania_uri_extensions = ['.md', '.txt', '.rst', '.py', '.conf', '.sh', '.json', '.yaml', '.yml']


" Custom key mapping (default: 'go')
nmap <leader>u <Plug>vimania_uri_go

Advanced Configuration

" Log level for debugging (DEBUG, INFO, WARNING, ERROR)
let g:vimania_uri_log_level = 'INFO'

" Timeout for URL requests (milliseconds)
let g:vimania_uri_timeout = 3000

" Custom browser command (optional)
let g:vimania_uri_browser_cmd = 'firefox'

Environment Variables

  • LOG_LEVEL: Override log level (DEBUG, INFO, WARNING, ERROR)
  • VIMANIA_URI_TIMEOUT: Request timeout in seconds

📦 Installation

Prerequisites

  • Vim compiled with +python3 support
  • Python 3.10 or higher
  • pip in your PATH

Method 1: vim-plug (Recommended)

" Add to your .vimrc
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'
  \ }

" Configuration
let g:vimania_uri_extensions = ['.md', '.txt', '.rst', '.py', '.json', '.yaml']

Method 2: Build from Source

For developers or if you want the latest features:

" Requires: rust, maturin in PATH
Plug 'https://github.com/sysid/vimania-uri-rs.git', {
  \ 'do': 'python3 build.py',
  \ 'branch': 'main'
  \ }

Method 3: Manual Installation

cd ~/.vim/plugged
git clone https://github.com/sysid/vimania-uri-rs.git
cd vimania-uri-rs
python3 build.py

Post-Installation

  1. Restart Vim
  2. Run :helptags ALL to refresh help documentation
  3. Test with :echo has('python3') (should return 1)

Supported Platforms

  • ✅ Linux (x86_64, ARM64)
  • ✅ macOS (Intel, Apple Silicon)
  • ⚠️ Windows (experimental support)

Credits

  • inspired by UltiSnips.
  • URI handling is based on work of Christopher Prohm: mdnav

Similar work

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

If you're not sure about the file name format, learn more about wheel file names.

vimania_uri_rs-2.0.0-cp313-cp313-manylinux_2_34_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

vimania_uri_rs-2.0.0-cp313-cp313-macosx_11_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

vimania_uri_rs-2.0.0-cp313-cp313-macosx_10_12_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

vimania_uri_rs-2.0.0-cp312-cp312-manylinux_2_34_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

vimania_uri_rs-2.0.0-cp312-cp312-macosx_11_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

vimania_uri_rs-2.0.0-cp312-cp312-macosx_10_12_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

vimania_uri_rs-2.0.0-cp311-cp311-manylinux_2_34_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

vimania_uri_rs-2.0.0-cp311-cp311-macosx_11_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

vimania_uri_rs-2.0.0-cp311-cp311-macosx_10_12_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

vimania_uri_rs-2.0.0-cp310-cp310-manylinux_2_34_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

vimania_uri_rs-2.0.0-cp310-cp310-macosx_11_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

vimania_uri_rs-2.0.0-cp310-cp310-macosx_10_12_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

File details

Details for the file vimania_uri_rs-2.0.0-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e06caeab48102c1459144e9601236a4398b35194a27bb1bb1fdcdbe877f04d75
MD5 d265964b3886906f607915cd330468e8
BLAKE2b-256 3276c54312a0650b30061b8cad32c99dff14c0718bba8637979c452cb6f4f03c

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.0-cp313-cp313-manylinux_2_34_x86_64.whl:

Publisher: release.yml on sysid/vimania-uri-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vimania_uri_rs-2.0.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4a53d17393e9390e12823cf247593be136c45d848b32c2783cd507596a0391ea
MD5 ed317a263fe4bdd5a906fe1d450b2843
BLAKE2b-256 4a377a9cf609241421a9ac4d459f4fdc7283518afbb8bd3f8acc0b29fe085e8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on sysid/vimania-uri-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vimania_uri_rs-2.0.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5a9946246c4cba6e3b14d2d459a0f319b025c09c1fb0fad655b8269318c89888
MD5 4ba090d403e27d8e5985874c5485e0b8
BLAKE2b-256 cdc59ef7da239b008d6529fb94c0dc8ea2524091edcc601a76f2261ee6fa9c15

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.0-cp313-cp313-macosx_10_12_x86_64.whl:

Publisher: release.yml on sysid/vimania-uri-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ee455848bd3ae24b6065b1fe6a21f639bf37a6402085ccf7bc3be55947a20191
MD5 e3713147eb72a3a9b3b01766813bd6a8
BLAKE2b-256 c38a46b3d18e6443c9e41620844272686d08ec337f78ce8dbb9a08f37576a5d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.0-cp312-cp312-manylinux_2_34_x86_64.whl:

Publisher: release.yml on sysid/vimania-uri-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 617180788f98b439e5f603fe77753262099eb232500e0c0882222b4b0eeab91c
MD5 70a6177dce3c89d8f08255997961db7c
BLAKE2b-256 5f4ddd5b2268af41079ffe43191ad0926b602c1158107ce45e2040d6d87dc410

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on sysid/vimania-uri-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0918a8fae1acdcb36e8d4537c75b99c36b1090c4bdb168940602a5d5feb499ba
MD5 2d94366cb717b924820a6709c7e7fa45
BLAKE2b-256 79510ab08806516cabb417989ccfd5a0ba8b9d01a9331f1257a0f56cc1013a9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.0-cp312-cp312-macosx_10_12_x86_64.whl:

Publisher: release.yml on sysid/vimania-uri-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f5e51273c954a1881d96698cbe9d152691a69e506c7f946547d8268ef4680508
MD5 b3bb80fac00e9a02eceb8e9ac9cad2cc
BLAKE2b-256 0626228dfb4ae8161e82a698f265b0ca1045e3da24d088d0a0115ed707b0cb09

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.0-cp311-cp311-manylinux_2_34_x86_64.whl:

Publisher: release.yml on sysid/vimania-uri-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7cf3f126965bb1fa420e97a6a3edb9a69f1ddae8b96be2e0ae1ea3b2ee646c4b
MD5 e717a5d8a571bb6313dab31f7032aeec
BLAKE2b-256 949a338118506041a92c81a66837fb13e72a3d9ced2b7730e7f4416db93d91ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on sysid/vimania-uri-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2094aad85865ad8f076438ce892ac09a240a7e4b913c68a689cc779efdc7e082
MD5 09d24ada78e7275478eac86117393dd4
BLAKE2b-256 e6fd6db1e94efd3112d6f17e940e1895a636ba32f7a20547be01910a0c0891f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.0-cp311-cp311-macosx_10_12_x86_64.whl:

Publisher: release.yml on sysid/vimania-uri-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 05ed93e322094abb1281500a3762f11a6e92d8350bfcf2327aa6bd07370e3d7d
MD5 9b4347dbdb795e7220f551140bb112ff
BLAKE2b-256 d3f0ba65372518fe300c4f7f153988f841d5bb610c73cc49954b368d56bdac29

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.0-cp310-cp310-manylinux_2_34_x86_64.whl:

Publisher: release.yml on sysid/vimania-uri-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 29b6c55fbaa82a2df495a72bebdf8c21a11da297dc8d43ccc9ea84304e32deac
MD5 91e54e340b337a0571e7517f26d2fe8f
BLAKE2b-256 7708f9390faef288f836ad7ca0843b4e4a202d4b2723d2455eba878f313610eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: release.yml on sysid/vimania-uri-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 520e8892b304eeb1668423672834b53e62f163c9accb130f4a8164cd02fed981
MD5 de2f8db45426256775a5952391b1c1c1
BLAKE2b-256 d276d3fac0a820bc9c2a00ba4563a7e1251634efa7b8f1305ddbdbb384718e54

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.0-cp310-cp310-macosx_10_12_x86_64.whl:

Publisher: release.yml on sysid/vimania-uri-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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