Skip to main content

Add your description here

Project description

Advanced URI Handling for the Modern Vim User

Downloads PyPI Version Build Status

Background: Rewriting a Vim Plugin in Rust

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.

demo

vimania-uri-rs demo - YouTube

Works best in combination with vim-markdown, but is not limited to markdown files.

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 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

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 OS default (open on OSX and xdg-open on linux).

    Default: ['.md','.txt','.rst','.py','.conf','.sh','.json','.yaml','.yml'].

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

    Default: 0.


Installation

1. 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 must be compiled with +python3 support.
  • pip must be in PATH for installation of dependencies in vimania/pythonx.
  • tested on Linux/MacOS
  • sometimes you need to refresh vim help: :helptags ALL

2. If you want to compile it yourself:

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

3. Manual installation:

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

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-1.1.7-cp313-cp313-manylinux_2_34_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

vimania_uri_rs-1.1.7-cp313-cp313-macosx_11_0_arm64.whl (2.4 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

vimania_uri_rs-1.1.7-cp313-cp313-macosx_10_12_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

vimania_uri_rs-1.1.7-cp312-cp312-manylinux_2_34_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

vimania_uri_rs-1.1.7-cp311-cp311-manylinux_2_34_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 10.12+ x86-64

vimania_uri_rs-1.1.7-cp310-cp310-manylinux_2_34_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.10macOS 10.12+ x86-64

File details

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

File metadata

File hashes

Hashes for vimania_uri_rs-1.1.7-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c1b1dc8b6a75235675c049a7772e8adcceaaffabe9048b19682d359648e89898
MD5 738e413e16916545a8bf884d09552ced
BLAKE2b-256 5332a4308c4b12c701ce4d4652e1f4b3a31680d6607a103bd70e85e217aab0fb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-1.1.7-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 388954f696fd80b156b81d9a7634b27a5b634f3bd97227c2554d67343deb7f99
MD5 d810792ec3297e784eee0d2170a8255b
BLAKE2b-256 8c8c1bb9454da0f13c4aede2e0a4785c874cadeddc6fa628c6fb29aebbb6a2f6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-1.1.7-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ba4b756780c08517edb6320a5849a6b350cd159c7c0e6d4719f8d526c04cb11a
MD5 151038d6b4a7f07ae060b8de392267a0
BLAKE2b-256 2cd0f4255964fd2d97195f4fa0245d907736a3b92862ec15358774a31caa0f3b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-1.1.7-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f105f186067d708d826dfab979d75b6b48a65b603ddb9dc42ef4d9f27f20cde0
MD5 db227f3204a8e782d0c6d17506e53cd1
BLAKE2b-256 1053656ccb225bcc076c41e46117ace489cbb06dd7d2b389e9dfe70522dcb521

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-1.1.7-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 92aed597e92d231aa229747fd7b907aaef950590e1d6c78d738c9f882034f216
MD5 66e3ace1283a8c686555b542b7032a1a
BLAKE2b-256 fa2842b3ca912907afc06caabc120b8d81f39b5bbfc5062c4e529883a0aaac36

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-1.1.7-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ca6daf9a5e55efb1677e45156c56ed7a5dfa01066ee2542fa7bc57213bf8b834
MD5 7aafc0376cec7c31773849408c1851e9
BLAKE2b-256 9bb10f921ac313541d57d371186369257c2076d3cbaf21eee5df2f391be2a147

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-1.1.7-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 aaf55e0e49681869f8a133490174a1ee69042c62d691ce59905f4920b5c4493a
MD5 f13b41259fad90637ae1708b6f6c0a85
BLAKE2b-256 f08e13450874e7ec0073d53fd9a884b05f113a8ef92a3616ed451f4e79189e98

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-1.1.7-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 38969c5b20a565f5526165e565bac05507df84cab203c39865048596c0894667
MD5 4a49487f94a8871530b9c51133fb4846
BLAKE2b-256 72364f6720a267bfdbe96fcf07c69f60bc58064e8de4f471c4b45aed3dfd53e6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-1.1.7-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 71ee87803d1e1ce3600bfdc4747c36ddfb409584178de2a2f5a73e5696ae9452
MD5 a384097c7a3de900c0b61611e150f973
BLAKE2b-256 1f9da3bd41e994d882dde427409ce0b2f70394c35082df574c888aa6b7dfd31d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-1.1.7-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3a52d1d271da3d82e5a9d7d203ac04c4c22b3a2266545861925a41ae281c66ef
MD5 a074d879335f76d2e9b28045e01c613a
BLAKE2b-256 0eb8b2a9073666be6f7144a06dbf87b56e8bed30f966aa0bc4c57da49f1bd8c8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-1.1.7-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f9130c2ba136d28b565ae1ad5fd2f1565d6509504b941ddcfba138aa98f97384
MD5 5c51b96f7033fb75ba49d0062c0fd566
BLAKE2b-256 c020a93391aa51ae6dd77e9fa733f1cd1b6f08694193c42fff271364b77664a4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vimania_uri_rs-1.1.7-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 51dff20eef8f5af41dd811b98afe8a6ebb0b93ea691f0862e0abf18e038a92ac
MD5 847ad1b8c3ec0ea128836857a19eae51
BLAKE2b-256 9fa7d9d1907e3e8fb3df55e10cc97fdaa9f21623895cee1c7135225475d5e15f

See more details on using hashes here.

Provenance

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