Extend gx
to use it beyond just URLs!
Note: this plugin is still under development a lot of things may change!
- 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
gx
command if all handlers fail - Implement your own handlers
Install using vim-plug.
Put this in your init.vim
/.vimrc
.
Plug 'stsewd/gx-extended.vim'
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 with the global
file type work across all file types.
Opens links with/without an explicit protocol. Examples:
- A cursor under
google.com
will openhttps://google.com
Mimics the original gx
command.
Opens an issue/PR from a git commit message. Examples:
- A cursor under
Fixes #23
will openhttps://github.com/user/repo/issues/23
Note:
You need to have installed hub
(recommended),
or tpope/vim-fugitive
.
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.
Opens the GitHub page of the plugin under the cursor. Examples:
- A cursor under
Plug stsewd/fzf-checkout.vim
will openhttps://github.com/stsewd/fzf-checkout.vim
- ReStructuredText?
- requirements.txt?
- Write more tests