gx-extended.vim
gx-extended.vim copied to clipboard
Extend gx to use it beyond just URLs!
gx-extended.vim
Extend gx to use it beyond just URLs!
Note: this plugin is still under development a lot of things may change!
Features
- Open anything under your cursor with several handlers per file type
- Normal and visual mode support
- Handlers that work together across all file types
- Fall back to the original
gxcommand if all handlers fail - Implement your own handlers
Installation
Install using vim-plug.
Put this in your init.vim/.vimrc.
Plug 'stsewd/gx-extended.vim'
Usage
Press gx on normal or visual mode,
the text under the cursor or the selected text will be handled by a handler.
See :h gx-extended
for more information about settings and how to write your own handler.
Handlers
Handlers with the global file type work across all file types.
global#urls
Opens links with/without an explicit protocol. Examples:
- A cursor under
google.comwill openhttps://google.com
global#gx
Mimics the original gx command.
gitcommit#github
Opens an issue/PR from a git commit message. Examples:
- A cursor under
Fixes #23will openhttps://github.com/user/repo/issues/23
Note:
You need to have installed hub (recommended),
or tpope/vim-fugitive.
markdown#link
Opens Markdown links. Examples:
- A cursor under
[link](https://google.com)will openhttps://google.com
Note:
If you have plasticboy/vim-markdown installed
(it's included in sheerun/vim-polyglot)
you'll need to disable the default key mappings,
since that plugin remaps gx by default.
vim#plugin
Opens the GitHub page of the plugin under the cursor. Examples:
- A cursor under
Plug stsewd/fzf-checkout.vimwill openhttps://github.com/stsewd/fzf-checkout.vim
TODO
- ReStructuredText?
- requirements.txt?
- Write more tests