annotate runtime/autoload/netrwFileHandlers.vim @ 1396:3e0f9984e98e v7.1.111

updated for version 7.1-111
author vimboss
date Sun, 16 Sep 2007 11:27:42 +0000
parents 96cd8222a819
children 7bc41231fbc7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
1 " netrwFileHandlers: contains various extension-based file handlers for
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
2 " netrw's browsers' x command ("eXecute launcher")
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
3 " Author: Charles E. Campbell, Jr.
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
4 " Date: May 30, 2006
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
5 " Version: 9
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
6 " Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
7 " Permission is hereby granted to use and distribute this code,
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
8 " with or without modifications, provided that this copyright
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
9 " notice is copied with it. Like anything else that's free,
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
10 " netrwFileHandlers.vim is provided *as is* and comes with no
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
11 " warranty of any kind, either expressed or implied. In no
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
12 " event will the copyright holder be liable for any damages
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
13 " resulting from the use of this software.
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
14 "
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
15 " Rom 6:23 (WEB) For the wages of sin is death, but the free gift of God {{{1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
16 " is eternal life in Christ Jesus our Lord.
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
17
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
18 " ---------------------------------------------------------------------
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
19 " Load Once: {{{1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
20 if exists("g:loaded_netrwFileHandlers") || &cp
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
21 finish
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
22 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
23 let s:keepcpo= &cpo
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
24 set cpo&vim
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
25 let g:loaded_netrwFileHandlers= "v9"
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
26
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
27 " ---------------------------------------------------------------------
857
b933657f7c9d updated for version 7.0g01
vimboss
parents: 798
diff changeset
28 " netrwFileHandlers#Invoke: {{{1
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
29 fun! netrwFileHandlers#Invoke(exten,fname)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
30 " call Dfunc("netrwFileHandlers#Invoke(exten<".a:exten."> fname<".a:fname.">)")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
31 let fname= a:fname
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
32 " list of supported special characters. Consider rcs,v --- that can be
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
33 " supported with a NFH_rcsCOMMAv() handler
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
34 if a:fname =~ '[@:,$!=\-+%?;~]'
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
35 let specials= {
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
36 \ '@' : 'AT',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
37 \ ':' : 'COLON',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
38 \ ',' : 'COMMA',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
39 \ '$' : 'DOLLAR',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
40 \ '!' : 'EXCLAMATION',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
41 \ '=' : 'EQUAL',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
42 \ '-' : 'MINUS',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
43 \ '+' : 'PLUS',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
44 \ '%' : 'PERCENT',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
45 \ '?' : 'QUESTION',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
46 \ ';' : 'SEMICOLON',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
47 \ '~' : 'TILDE'}
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
48 let fname= substitute(a:fname,'[@:,$!=\-+%?;~]','\=specials[submatch(0)]','ge')
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
49 " call Decho('fname<'.fname.'> done with dictionary')
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
50 endif
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
51
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
52 if a:exten != "" && exists("*NFH_".a:exten)
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
53 " support user NFH_*() functions
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
54 " call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")')
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
55 exe "let ret= NFH_".a:exten.'("'.fname.'")'
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
56 elseif a:exten != "" && exists("*s:NFH_".a:exten)
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
57 " use builtin-NFH_*() functions
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
58 " call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")')
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
59 exe "let ret= s:NFH_".a:exten.'("'.fname.'")'
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
60 endif
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
61
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
62 " call Dret("netrwFileHandlers#Invoke 0 : ret=".ret)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
63 return 0
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
64 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
65
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
66 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
67 " s:NFH_html: handles html when the user hits "x" when the {{{1
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
68 " cursor is atop a *.html file
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
69 fun! s:NFH_html(pagefile)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
70 " call Dfunc("s:NFH_html(".a:pagefile.")")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
71
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
72 let page= substitute(a:pagefile,'^','file://','')
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
73
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
74 if executable("mozilla")
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
75 " call Decho("executing !mozilla ".page)
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
76 exe "!mozilla ".g:netrw_shq.page.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
77 elseif executable("netscape")
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
78 " call Decho("executing !netscape ".page)
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
79 exe "!netscape ".g:netrw_shq..page.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
80 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
81 " call Dret("s:NFH_html 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
82 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
83 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
84
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
85 " call Dret("s:NFH_html 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
86 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
87 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
88
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
89 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
90 " s:NFH_htm: handles html when the user hits "x" when the {{{1
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
91 " cursor is atop a *.htm file
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
92 fun! s:NFH_htm(pagefile)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
93 " call Dfunc("s:NFH_htm(".a:pagefile.")")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
94
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
95 let page= substitute(a:pagefile,'^','file://','')
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
96
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
97 if executable("mozilla")
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
98 " call Decho("executing !mozilla ".page)
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
99 exe "!mozilla ".g:netrw_shq.page.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
100 elseif executable("netscape")
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
101 " call Decho("executing !netscape ".page)
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
102 exe "!netscape ".g:netrw_shq.page.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
103 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
104 " call Dret("s:NFH_htm 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
105 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
106 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
107
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
108 " call Dret("s:NFH_htm 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
109 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
110 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
111
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
112 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
113 " s:NFH_jpg: {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
114 fun! s:NFH_jpg(jpgfile)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
115 " call Dfunc("s:NFH_jpg(jpgfile<".a:jpgfile.">)")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
116
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
117 if executable("gimp")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
118 exe "silent! !gimp -s ".g:netrw_shq.a:jpgfile.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
119 elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
120 " call Decho("silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".escape(a:jpgfile," []|'"))
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
121 exe "!".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".g:netrw_shq.a:jpgfile.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
122 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
123 " call Dret("s:NFH_jpg 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
124 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
125 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
126
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
127 " call Dret("s:NFH_jpg 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
128 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
129 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
130
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
131 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
132 " s:NFH_gif: {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
133 fun! s:NFH_gif(giffile)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
134 " call Dfunc("s:NFH_gif(giffile<".a:giffile.">)")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
135
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
136 if executable("gimp")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
137 exe "silent! !gimp -s ".g:netrw_shq.a:giffile.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
138 elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
139 exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".g:netrw_shq.a:giffile.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
140 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
141 " call Dret("s:NFH_gif 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
142 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
143 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
144
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
145 " call Dret("s:NFH_gif 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
146 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
147 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
148
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
149 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
150 " s:NFH_png: {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
151 fun! s:NFH_png(pngfile)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
152 " call Dfunc("s:NFH_png(pngfile<".a:pngfile.">)")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
153
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
154 if executable("gimp")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
155 exe "silent! !gimp -s ".g:netrw_shq.a:pngfile.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
156 elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
157 exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".g:netrw_shq.a:pngfile.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
158 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
159 " call Dret("s:NFH_png 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
160 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
161 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
162
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
163 " call Dret("s:NFH_png 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
164 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
165 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
166
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
167 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
168 " s:NFH_pnm: {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
169 fun! s:NFH_pnm(pnmfile)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
170 " call Dfunc("s:NFH_pnm(pnmfile<".a:pnmfile.">)")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
171
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
172 if executable("gimp")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
173 exe "silent! !gimp -s ".g:netrw_shq.a:pnmfile.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
174 elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
175 exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".g:netrw_shq.a:pnmfile.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
176 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
177 " call Dret("s:NFH_pnm 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
178 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
179 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
180
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
181 " call Dret("s:NFH_pnm 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
182 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
183 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
184
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
185 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
186 " s:NFH_bmp: visualize bmp files {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
187 fun! s:NFH_bmp(bmpfile)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
188 " call Dfunc("s:NFH_bmp(bmpfile<".a:bmpfile.">)")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
189
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
190 if executable("gimp")
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
191 exe "silent! !gimp -s ".a:bmpfile
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
192 elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
193 exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".g:netrw_shq.a:bmpfile.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
194 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
195 " call Dret("s:NFH_bmp 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
196 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
197 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
198
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
199 " call Dret("s:NFH_bmp 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
200 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
201 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
202
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
203 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
204 " s:NFH_pdf: visualize pdf files {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
205 fun! s:NFH_pdf(pdf)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
206 " call Dfunc("s:NFH_pdf(pdf<".a:pdf.">)")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
207 if executable("gs")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
208 exe 'silent! !gs '.g:netrw_shq.a:pdf.g:netrw_shq
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
209 elseif executable("pdftotext")
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
210 exe 'silent! pdftotext -nopgbrk '.g:netrw_shq.a:pdf.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
211 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
212 " call Dret("s:NFH_pdf 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
213 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
214 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
215
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
216 " call Dret("s:NFH_pdf 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
217 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
218 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
219
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
220 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
221 " s:NFH_doc: visualize doc files {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
222 fun! s:NFH_doc(doc)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
223 " call Dfunc("s:NFH_doc(doc<".a:doc.">)")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
224
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
225 if executable("oowriter")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
226 exe 'silent! !oowriter '.g:netrw_shq.a:doc.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
227 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
228 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
229 " call Dret("s:NFH_doc 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
230 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
231 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
232
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
233 " call Dret("s:NFH_doc 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
234 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
235 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
236
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
237 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
238 " s:NFH_sxw: visualize sxw files {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
239 fun! s:NFH_sxw(sxw)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
240 " call Dfunc("s:NFH_sxw(sxw<".a:sxw.">)")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
241
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
242 if executable("oowriter")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
243 exe 'silent! !oowriter '.g:netrw_shq.a:sxw.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
244 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
245 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
246 " call Dret("s:NFH_sxw 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
247 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
248 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
249
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
250 " call Dret("s:NFH_sxw 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
251 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
252 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
253
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
254 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
255 " s:NFH_xls: visualize xls files {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
256 fun! s:NFH_xls(xls)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
257 " call Dfunc("s:NFH_xls(xls<".a:xls.">)")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
258
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
259 if executable("oocalc")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
260 exe 'silent! !oocalc '.g:netrw_shq.a:xls.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
261 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
262 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
263 " call Dret("s:NFH_xls 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
264 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
265 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
266
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
267 " call Dret("s:NFH_xls 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
268 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
269 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
270
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
271 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
272 " s:NFH_ps: handles PostScript files {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
273 fun! s:NFH_ps(ps)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
274 " call Dfunc("s:NFH_ps(ps<".a:ps.">)")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
275 if executable("gs")
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
276 " call Decho("exe silent! !gs ".a:ps)
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
277 exe "silent! !gs ".g:netrw_shq.a:ps.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
278 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
279 elseif executable("ghostscript")
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
280 " call Decho("exe silent! !ghostscript ".a:ps)
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
281 exe "silent! !ghostscript ".g:netrw_shq.a:ps.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
282 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
283 elseif executable("gswin32")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
284 " call Decho("exe silent! !gswin32 ".g:netrw_shq.a:ps.g:netrw_shq)
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
285 exe "silent! !gswin32 ".g:netrw_shq.a:ps.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
286 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
287 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
288 " call Dret("s:NFH_ps 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
289 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
290 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
291
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
292 " call Dret("s:NFH_ps 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
293 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
294 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
295
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
296 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
297 " s:NFH_eps: handles encapsulated PostScript files {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
298 fun! s:NFH_eps(eps)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
299 " call Dfunc("s:NFH_eps()")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
300 if executable("gs")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
301 exe "silent! !gs ".g:netrw_shq.a:eps.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
302 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
303 elseif executable("ghostscript")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
304 exe "silent! !ghostscript ".g:netrw_shq.a:eps.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
305 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
306 elseif executable("ghostscript")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
307 exe "silent! !ghostscript ".g:netrw_shq.a:eps.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
308 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
309 elseif executable("gswin32")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
310 exe "silent! !gswin32 ".g:netrw_shq.a:eps.g:netrw_shq
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
311 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
312 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
313 " call Dret("s:NFH_eps 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
314 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
315 endif
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
316 " call Dret("s:NFH_eps 0")
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
317 return 1
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
318 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
319
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
320 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
321 " s:NFH_fig: handles xfig files {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
322 fun! s:NFH_fig(fig)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
323 " call Dfunc("s:NFH_fig()")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
324 if executable("xfig")
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
325 exe "silent! !xfig ".a:fig
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
326 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
327 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
328 " call Dret("s:NFH_fig 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
329 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
330 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
331
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
332 " call Dret("s:NFH_fig 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
333 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
334 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
335
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
336 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
337 " s:NFH_obj: handles tgif's obj files {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
338 fun! s:NFH_obj(obj)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
339 " call Dfunc("s:NFH_obj()")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
340 if has("unix") && executable("tgif")
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
341 exe "silent! !tgif ".a:obj
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
342 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
343 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
344 " call Dret("s:NFH_obj 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
345 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
346 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
347
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
348 " call Dret("s:NFH_obj 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
349 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
350 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
351
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
352 let &cpo= s:keepcpo
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
353 " ---------------------------------------------------------------------
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
354 " Modelines: {{{1
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
355 " vim: fdm=marker