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.2-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.2-cp313-cp313-macosx_11_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

vimania_uri_rs-2.0.2-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.2-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.2-cp312-cp312-macosx_11_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

vimania_uri_rs-2.0.2-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.2-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.2-cp311-cp311-macosx_11_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

vimania_uri_rs-2.0.2-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.2-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.2-cp310-cp310-macosx_11_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

vimania_uri_rs-2.0.2-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.2-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.2-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 fd509225df43ea90b1d02829559c08ec6031146545ada8338c26ea9ebad952aa
MD5 62611aa525eeaf2ce3360b7e3cf514b3
BLAKE2b-256 665c018789d8267b03924e8bef5b8a7abd3ef69d982a63e8f94744fd8ebb4c3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.2-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.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 36b691e10f7ff2ac78bf9192d104213456b91e2eb57a7ee768dcfea9fc000faf
MD5 7a01c0609627970fd108a242ae470ec5
BLAKE2b-256 caec83f53194a5b788c4a7fe0dcbff87876f13ea7ebad288d9100cf0fd712250

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.2-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.2-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.2-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 775c2479c97d1d35923a914bc7c347d4c1a602812e61474fd2ad363a9d7184c4
MD5 0d38b7ad870e57534e0e70bdb8d5c9de
BLAKE2b-256 4087a01e0f8e653e42f8cae669e3147d9cce53c984bc16fa116a052a873b57af

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.2-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.2-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.2-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 064b7078554a35bfbab7bcf0c9930db60c944917478b59677fc684f5d6d40ba3
MD5 ff7ed1a6b4d323c51b15ef596513598a
BLAKE2b-256 5293c6cf58ff9dd5d2470f57213940192874343046d50f63202c30057c38d4e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.2-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.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fb3b5487550e28a33d31a09c301143c16f89669ee72c6f6e4de599413f01824a
MD5 4cb2c180fbad6aa507736c8fea63b30d
BLAKE2b-256 101fd3f1a02210a326c26379473e8b17df0a554e8c9360ff7694090a69788208

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.2-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.2-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.2-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2812e5e6af5e415918dd7bcd4d7ea447233f98a25ee0777a3472b020e17f8f83
MD5 280e3373187a0bd2f4715bd7a9c1a300
BLAKE2b-256 ec25a9ef7aa7e934274acf02de31e0ba83abd676a050c3e7b75f1bb6c7ff67bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.2-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.2-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.2-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8a3d54310b9846bdd7fd79d5408a3821d9657a0a4efc7b2ead548d55b22245a8
MD5 438839dc14173bf91b5f4cf8583fefc2
BLAKE2b-256 57f431fe5e39ccb3ced0db5cdf153c16638c8693b2cb347984e22f22cdb0655a

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.2-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.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 04c87bc8cb647a53fe88679b37fb808634608433c5387737d8d0434f09472dd4
MD5 87a57107a4021e2bc93e14b8d4bdbea9
BLAKE2b-256 70f357f48ff7b23662a68ac9117aed46ddef894b40bfbe606d642322e479e5e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.2-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.2-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.2-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5d5978cb50a22292e74207e0205a22364413a731c7173b1808104bd1d3600bd2
MD5 6c4080c6c1c22fed5d9edbb093c300a1
BLAKE2b-256 5f9137169c6b72165000b38ca88866eb3e5345d5d1e7b1640624e98aa5dfc553

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.2-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.2-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.2-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e1a217af86ab1bff1e196190158168852032cc13def01c53ef776b1245bb4186
MD5 1a2e070b1f72fe8fef39b2b8775950f1
BLAKE2b-256 43c2f53c062e7eb20f08b34acd580fdba52ec7c93b6e2940f70ae245d55fbda4

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.2-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.2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c5bd2fba1b700eea1f827520a119ecb9513d05b79ed5bfde73c0369632a4751f
MD5 82dabdd66f159a7e8dfe198254e546cf
BLAKE2b-256 d524432b3b4e14eba02d85d87894bb2420937874cc049492079ce12f74b0a007

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.2-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.2-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.2-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 59bd29898b40ec3e3e655592c890313bde668edc359fa125eba2e775be35bb9e
MD5 f210cf701c5c0110b4c32a9d361ca1b4
BLAKE2b-256 f276887749116bd8a2f94983ddd3a350ba465cd55d586587c9a2eedb50b19302

See more details on using hashes here.

Provenance

The following attestation bundles were made for vimania_uri_rs-2.0.2-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