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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

vimania_uri_rs-2.0.1-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.1-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.1-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5861f2797bbf522d67a64c2545faceff0eccd4ffdcbbeeded64ab6ddb39c2020
MD5 ba9dffff3631f9cbfbf08bc2fdddf8b9
BLAKE2b-256 646703ec7e79cfc6443bb1698662664e51530084ff28d8ff369cbbc87ff271af

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 05bc2fa1858792dfd58cde1c740541f56c628e0cee63b6cf825186ceec8e1a1d
MD5 c8e46a99840af62fec868e64796195b0
BLAKE2b-256 d3175b2b005d80c103aa630e2acf6ef4f385bb0f783bbd99ad04ad87820fda64

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.1-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6deaebb7ad767cac6b235ed469787efe977dbffacd604f23f1a923778b6750de
MD5 173f621e69eefb34e24fa792eae2d692
BLAKE2b-256 a6976a2a4dbe00f868ed839b8e4342e3bb57042bc4bc62e2e0064e706f9b0603

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7f5a852edf4ecfef0c31bd5169b89cf4a81ec267448f0b358d9b9fbd5b13f2e7
MD5 26f6351f62a336170172f4be12b808dd
BLAKE2b-256 9efd03faf968f344ff114d59fd26b7bb97c8d83e96f6b2d4a006c508aef4ebb0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c89c0aab2eca2e75973acb9277dfee1259c082b55aa4a2ba6cabff106eec82fa
MD5 ae2e817bed02f0014abdbeafd6435dde
BLAKE2b-256 da4caa386ecfe57fa66585ead93d8b3e8c0dd337b51d6b86e753a2c6a5b02015

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.1-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f10d4eb68e62d380093ab8f11277101525e163c081332bd48a26330f371e8875
MD5 00793482569ba45b83afaac719314672
BLAKE2b-256 23dba9abd87486fd421e032d5dcd60b6f24a02ed51d21dfe979d5982118d2674

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1212869ac62f58bb366c8595ab30b76feaa384791dda05a118e14da8cb97f9db
MD5 15fc33b499659867d75d29856ffc7b2a
BLAKE2b-256 2caebe96c5ba6dea60270b9b025cadfae21b91f7f14633499bc899d21aa66c38

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f6cb5a82b53f33ade45f42ba0af42e268a354de6ce508fd56757dc0ae1de36ef
MD5 324cf3fc45d9c70e5cf0251f4206b5dd
BLAKE2b-256 b288accc960177516a4967280d54862905f633909df5d359ea9267b92c90551a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.1-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6de05287b5a37063caf04eb36a8d3d49abc1bd3e2fc2705db41c95398d9d2b61
MD5 e00046ec9c1f27a578c948140abc2402
BLAKE2b-256 695f97bca714d006502fc5fbfe339cec573ae777d86640083d177d48087901d2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 27950762fb5876f7428e70f4a552125c784ac689ddb6db4cc00cd6986442c027
MD5 253495cbc26c950fc1c851123f4e4efb
BLAKE2b-256 6fb4222ed5839f4d2801e274a6ac71647205b22bc3edc5c050bd51b07f9547bd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dfc3304a7365d7bf6ffbb47d738c834a8d8865bb9355ea18e18d0fbb93644398
MD5 74fde3155e951a3b37571573509d5bc9
BLAKE2b-256 2a236f07d43f5b46d02efe76c3e123c327b9a49f78c73fa9177c84a763e6ec35

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-2.0.1-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4ffe3c6ba693808d81359be824e32462b12db7f4983039d2bc66e8dc499223b9
MD5 6279c9ce93b846e3f8a564b9c36cebe3
BLAKE2b-256 f66a1c0d18f8ee6bcdad4410a79902541d3452a8e2b2a142e813fa0ea93ea3a3

See more details on using hashes here.

Provenance

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