557
|
1 " netrwSettings.vim: makes netrw settings simpler
|
1214
|
2 " Date: Mar 26, 2007
|
557
|
3 " Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
|
1214
|
4 " Version: 9
|
1122
|
5 " Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
|
557
|
6 " Permission is hereby granted to use and distribute this code,
|
|
7 " with or without modifications, provided that this copyright
|
|
8 " notice is copied with it. Like anything else that's free,
|
|
9 " netrwSettings.vim is provided *as is* and comes with no
|
|
10 " warranty of any kind, either expressed or implied. By using
|
|
11 " this plugin, you agree that in no event will the copyright
|
|
12 " holder be liable for any damages resulting from the use
|
|
13 " of this software.
|
|
14 "
|
|
15 " Mat 4:23 (WEB) Jesus went about in all Galilee, teaching in their {{{1
|
|
16 " synagogues, preaching the gospel of the kingdom, and healing
|
|
17 " every disease and every sickness among the people.
|
|
18 " Load Once: {{{1
|
|
19 if exists("g:loaded_netrwSettings") || &cp
|
|
20 finish
|
|
21 endif
|
1214
|
22 let g:loaded_netrwSettings = "v9"
|
557
|
23
|
|
24 " ---------------------------------------------------------------------
|
|
25 " NetrwSettings: {{{1
|
|
26 fun! netrwSettings#NetrwSettings()
|
|
27 " this call is here largely just to insure that netrw has been loaded
|
|
28 call netrw#NetSavePosn()
|
|
29 if !exists("g:loaded_netrw")
|
|
30 echohl WarningMsg | echomsg "***sorry*** netrw needs to be loaded prior to using NetrwSettings" | echohl None
|
|
31 return
|
|
32 endif
|
|
33
|
|
34 above wincmd s
|
|
35 enew
|
|
36 setlocal noswapfile bh=wipe
|
|
37 set ft=vim
|
|
38 file Netrw\ Settings
|
|
39
|
|
40 " these variables have the following default effects when they don't
|
|
41 " exist (ie. have not been set by the user in his/her .vimrc)
|
1122
|
42 if !exists("g:netrw_liststyle")
|
|
43 let g:netrw_liststyle= 0
|
557
|
44 let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa"
|
|
45 endif
|
|
46 if !exists("g:netrw_silent")
|
|
47 let g:netrw_silent= 0
|
|
48 endif
|
|
49 if !exists("g:netrw_use_nt_rcp")
|
|
50 let g:netrw_use_nt_rcp= 0
|
|
51 endif
|
|
52 if !exists("g:netrw_ftp")
|
|
53 let g:netrw_ftp= 0
|
|
54 endif
|
|
55 if !exists("g:netrw_ignorenetrc")
|
|
56 let g:netrw_ignorenetrc= 0
|
|
57 endif
|
|
58
|
798
|
59 put ='+ ---------------------------------------------'
|
|
60 put ='+ NetrwSettings: by Charles E. Campbell, Jr.'
|
|
61 put ='+ Press <F1> with cursor atop any line for help'
|
|
62 put ='+ ---------------------------------------------'
|
557
|
63 let s:netrw_settings_stop= line(".")
|
|
64
|
|
65 put =''
|
|
66 put ='+ Netrw Protocol Commands'
|
|
67 put = 'let g:netrw_dav_cmd = '.g:netrw_dav_cmd
|
|
68 put = 'let g:netrw_fetch_cmd = '.g:netrw_fetch_cmd
|
|
69 put = 'let g:netrw_ftp_cmd = '.g:netrw_ftp_cmd
|
|
70 put = 'let g:netrw_http_cmd = '.g:netrw_http_cmd
|
|
71 put = 'let g:netrw_rcp_cmd = '.g:netrw_rcp_cmd
|
|
72 put = 'let g:netrw_rsync_cmd = '.g:netrw_rsync_cmd
|
|
73 put = 'let g:netrw_scp_cmd = '.g:netrw_scp_cmd
|
|
74 put = 'let g:netrw_sftp_cmd = '.g:netrw_sftp_cmd
|
|
75 put = 'let g:netrw_ssh_cmd = '.g:netrw_ssh_cmd
|
|
76 let s:netrw_protocol_stop= line(".")
|
|
77 put = ''
|
|
78
|
|
79 put ='+Netrw Transfer Control'
|
|
80 put = 'let g:netrw_cygwin = '.g:netrw_cygwin
|
|
81 put = 'let g:netrw_ftp = '.g:netrw_ftp
|
|
82 put = 'let g:netrw_ftpmode = '.g:netrw_ftpmode
|
|
83 put = 'let g:netrw_ignorenetrc = '.g:netrw_ignorenetrc
|
1214
|
84 put = 'let g:netrw_sshport = '.g:netrw_sshport
|
1122
|
85 let shqline= line("$")
|
|
86 put = 'let g:netrw_shq...'
|
557
|
87 put = 'let g:netrw_use_nt_rcp = '.g:netrw_use_nt_rcp
|
|
88 put = 'let g:netrw_win95ftp = '.g:netrw_win95ftp
|
|
89 let s:netrw_xfer_stop= line(".")
|
1214
|
90 put =''
|
|
91 put ='+ Netrw Messages'
|
|
92 put ='let g:netrw_use_errorwindow = '.g:netrw_use_errorwindow
|
557
|
93
|
|
94 put = ''
|
|
95 put ='+ Netrw Browser Control'
|
|
96 put = 'let g:netrw_alto = '.g:netrw_alto
|
|
97 put = 'let g:netrw_altv = '.g:netrw_altv
|
650
|
98 put = 'let g:netrw_browse_split = '.g:netrw_browse_split
|
|
99 if exists("g:netrw_browsex_viewer")
|
|
100 put = 'let g:netrw_browsex_viewer = '.g:netrw_browsex_viewer
|
|
101 else
|
|
102 put = 'let g:netrw_browsex_viewer = (not defined)'
|
|
103 endif
|
557
|
104 put = 'let g:netrw_dirhistmax = '.g:netrw_dirhistmax
|
719
|
105 put = 'let g:netrw_fastbrowse = '.g:netrw_fastbrowse
|
557
|
106 put = 'let g:netrw_ftp_browse_reject = '.g:netrw_ftp_browse_reject
|
|
107 put = 'let g:netrw_ftp_list_cmd = '.g:netrw_ftp_list_cmd
|
1122
|
108 put = 'let g:netrw_ftp_sizelist_cmd = '.g:netrw_ftp_sizelist_cmd
|
|
109 put = 'let g:netrw_ftp_timelist_cmd = '.g:netrw_ftp_timelist_cmd
|
557
|
110 put = 'let g:netrw_hide = '.g:netrw_hide
|
|
111 put = 'let g:netrw_keepdir = '.g:netrw_keepdir
|
|
112 put = 'let g:netrw_list_cmd = '.g:netrw_list_cmd
|
|
113 put = 'let g:netrw_list_hide = '.g:netrw_list_hide
|
|
114 put = 'let g:netrw_local_mkdir = '.g:netrw_local_mkdir
|
|
115 put = 'let g:netrw_local_rmdir = '.g:netrw_local_rmdir
|
1122
|
116 put = 'let g:netrw_liststyle = '.g:netrw_liststyle
|
557
|
117 put = 'let g:netrw_maxfilenamelen = '.g:netrw_maxfilenamelen
|
1122
|
118 put = 'let g:netrw_menu = '.g:netrw_menu
|
557
|
119 put = 'let g:netrw_mkdir_cmd = '.g:netrw_mkdir_cmd
|
|
120 put = 'let g:netrw_rename_cmd = '.g:netrw_rename_cmd
|
|
121 put = 'let g:netrw_rm_cmd = '.g:netrw_rm_cmd
|
|
122 put = 'let g:netrw_rmdir_cmd = '.g:netrw_rmdir_cmd
|
|
123 put = 'let g:netrw_rmf_cmd = '.g:netrw_rmf_cmd
|
|
124 put = 'let g:netrw_silent = '.g:netrw_silent
|
|
125 put = 'let g:netrw_sort_by = '.g:netrw_sort_by
|
|
126 put = 'let g:netrw_sort_direction = '.g:netrw_sort_direction
|
|
127 put = 'let g:netrw_sort_sequence = '.g:netrw_sort_sequence
|
|
128 put = 'let g:netrw_ssh_browse_reject = '.g:netrw_ssh_browse_reject
|
1214
|
129 put = 'let g:netrw_scpport = '.g:netrw_scpport
|
|
130 put = 'let g:netrw_sshport = '.g:netrw_sshport
|
557
|
131 put = 'let g:netrw_timefmt = '.g:netrw_timefmt
|
1122
|
132 put = 'let g:netrw_use_noswf = '.g:netrw_use_noswf
|
557
|
133 put = 'let g:netrw_winsize = '.g:netrw_winsize
|
|
134
|
|
135 put =''
|
1214
|
136 put ='+ For help, place cursor on line and press <F1>'
|
557
|
137
|
|
138 1d
|
|
139 silent %s/^+/"/e
|
|
140 res 99
|
|
141 silent %s/= \([^0-9].*\)$/= '\1'/e
|
|
142 silent %s/= $/= ''/e
|
|
143 1
|
|
144
|
1122
|
145 " Put in shq setting.
|
|
146 " (deferred so as to avoid the quote manipulation just preceding)
|
|
147 if g:netrw_shq == "'"
|
|
148 call setline(shqline,'let g:netrw_shq = "'.g:netrw_shq.'"')
|
|
149 else
|
|
150 call setline(shqline,"let g:netrw_shq = '".g:netrw_shq."'")
|
|
151 endif
|
|
152
|
557
|
153 set nomod
|
|
154
|
1122
|
155 nmap <buffer> <silent> <F1> :call NetrwSettingHelp()<cr>
|
|
156 nnoremap <buffer> <silent> <leftmouse> <leftmouse>:call NetrwSettingHelp()<cr>
|
557
|
157 let tmpfile= tempname()
|
|
158 exe 'au BufWriteCmd Netrw\ Settings silent w! '.tmpfile.'|so '.tmpfile.'|call delete("'.tmpfile.'")|set nomod'
|
|
159 endfun
|
|
160
|
|
161 " ---------------------------------------------------------------------
|
|
162 " NetrwSettingHelp: {{{2
|
|
163 fun! NetrwSettingHelp()
|
|
164 " call Dfunc("NetrwSettingHelp()")
|
|
165 let curline = getline(".")
|
|
166 if curline =~ '='
|
|
167 let varhelp = substitute(curline,'^\s*let ','','e')
|
|
168 let varhelp = substitute(varhelp,'\s*=.*$','','e')
|
|
169 " call Decho("trying help ".varhelp)
|
|
170 try
|
|
171 exe "he ".varhelp
|
|
172 catch /^Vim\%((\a\+)\)\=:E149/
|
|
173 echo "***sorry*** no help available for <".varhelp.">"
|
|
174 endtry
|
|
175 elseif line(".") < s:netrw_settings_stop
|
|
176 he netrw-settings
|
|
177 elseif line(".") < s:netrw_protocol_stop
|
|
178 he netrw-externapp
|
|
179 elseif line(".") < s:netrw_xfer_stop
|
|
180 he netrw-variables
|
|
181 else
|
|
182 he netrw-browse-var
|
|
183 endif
|
|
184 " call Dret("NetrwSettingHelp")
|
|
185 endfun
|
|
186
|
|
187 " ---------------------------------------------------------------------
|
|
188 " Modelines: {{{1
|
|
189 " vim:ts=8 fdm=marker
|