sponsor Vim development Vim logo go to HTTPS page Vim Book Ad

xdg_open.vim : Run xdg-open from Vim; re-implements netrw's gx.

 script karma  Rating 0/0, Downloaded by 49    Comments, bugs, improvements  Vim wiki

created by
Martin Tournoij
 
script type
utility
 
description
Homepage: https://arp242.net/code/xdg_open.vim/

---------------------

Re-implements netrw's `gx` command with a call to `xdg-open` (or a similar
tool of your choosing).

This is especially useful if you're using dirvish or some other file-manager
other than netrw.

Is this fully compatible with netrw?
------------------------------------

It should be for most purposes, but feature-for-feature (or bug-for-bug)
compatibility was not a primary goal. Notable changes are:

- We just try to run `xdg-open`. No tricks and complicated fallbacks if that
  fails.

- The default is to get the `<cWORD>` instead of `<cfile>`. This works better
  with urls which have query parameters.

- The shell command is run in the background. This is much more sane.

Can I disable netrw completely?
-------------------------------

- To only disable gx-related functionality:

let g:netrw_nogx = 1

- To disable all of netrw:

let g:loaded_netrw = 1

- To disable the netrw doc files you need to remove the doc file at
  `$VIMRUNTIME/doc/pi_netrw.txt` and rebuild the help tags with:

:helptags $VIMRUNTIME/doc

  This has the advantage of not cluttering `:helpgrep` or tab completion.

  You will need write permissions here (e.g. run it as root). Unfortunately
  you will nee to re-run this after every upgrade.

See `:help xdg_open` for the full documentation.
 
install details
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
download-from-homepage.tar.gz 1.0 2016-10-31 7.0 Martin Tournoij Initial upload
ip used for rating: 54.167.135.61

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
SourceForge.net Logo