gvim windows netrw filehandler html elinks配置 [英] gvim windows netrw filehandler html elinks configuration

查看:162
本文介绍了gvim windows netrw filehandler html elinks配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用gvim 7.3,支持OLE的MS-Windows 32位GUI版本。我试图配置netrw文件处理程序来打开本地保存的文件。使用elinks浏览器而不是firefox浏览器的
文件。 netrw的帮助文件是指可以放置在.vimrc文件中的一个设置:

 :let g:netrw_browsex_viewer = 

它也表示

'对于Windows 32或64,使用了url和FileProtocolHandler dll。'



我试过在引号之间的elinks可执行文件中输入文件路径,但没有结果。到目前为止,我的网络搜索没有透露任何有关如何在vim中使用url和FileProtocolHandler dll的实例。



我会非常感谢任何帮助。 p>

GilF

解决方案

这允许您为所有类型启动正确的文件查看器的文件:( PPT,excel xls,铬html,视频vlc)和任何Windows资源管理器有关联。在windows7上,将批处理文件 expl2.cmd 放入您的vim路径中。



在vimrc中放入

 :let netrw_browsex_viewer ='expl2.cmd '

在gvim中, cfile 使用 gx 要启动 explorer.exe ,它将启动正确的查看器,例如PowerPoint中,火狐,Chrome。注:第二行将正斜杠转换为反斜杠。如果您的文件名中有空格,vim不会扩展cfile。



c:> cat expl2.cmd

  set file =%1 
set file =%file:/ = \%
start explorer.exe / n,/ e,/ root,%file%

我也在 gvim Windows 7 netrw在文本光标下打开url ,因为它出现首先在谷歌。


I'm using gvim 7.3, MS-Windows 32-bit GUI version with OLE support

I'm attempting to configure the netrw filehandler to open locally saved .html files in with the elinks browser, rather than the firefox browser. The help file for netrw refers to a setting that can be placed in the .vimrc file:

:let g:netrw_browsex_viewer= "  "

it also says that

'for Windows 32 or 64 the url and FileProtocolHandler dlls are used'.

I've tried entering the filepath to the elinks executable between the quotes, but no result. My internet searches so far haven't revealed any practical examples of how to work with url and FileProtocolHandler dlls in vim.

I would be very grateful for any help.

GilF

解决方案

This allows you to launch correct file viewer for all kinds of files: (powerpoint ppt, excel xls, chrome html, vlc on video) and whatever windows explorer has association for. On windows7, put the batch file expl2.cmd in your vim path.

In vimrc put

:let netrw_browsex_viewer='expl2.cmd'

In gvim use gx on cfile to launch explorer.exe, it will launch correct viewer, e.g. powerpoint,firefox,chrome. Notes: The second line converts forward slashes to backslashes. If you have spaces in your filename, vim won't expand cfile.

c:> cat expl2.cmd

set file=%1
set file=%file:/=\%
start explorer.exe /n,/e,/root,%file%

I also wrote this answer in gvim Windows 7 netrw open url under text cursor as it comes up first in google.

这篇关于gvim windows netrw filehandler html elinks配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆