Ⅰ. 插件描述
Run xdg-open from Vim; re-implements netrw's gx.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'carpetsmoker/xdg-open-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'carpetsmoker/xdg-open-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'carpetsmoker/xdg-open-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/carpetsmoker/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.txtand 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 need to re-run this after every upgrade.
See :help xdg_open for the full documentation.