mirror of
https://github.com/vim/vim.git
synced 2025-07-04 23:07:33 -04:00
updated for version 7.0145
This commit is contained in:
parent
32330d3c67
commit
578b49e4f7
@ -1,8 +1,8 @@
|
|||||||
" netrw.vim: Handles file transfer and remote directory listing across a network
|
" netrw.vim: Handles file transfer and remote directory listing across a network
|
||||||
" AUTOLOAD PORTION
|
" AUTOLOAD PORTION
|
||||||
" Last Change: Aug 19, 2005
|
" Date: Sep 09, 2005
|
||||||
|
" Version: 69
|
||||||
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
|
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
|
||||||
" Version: 65
|
|
||||||
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
|
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
|
||||||
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
|
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
|
||||||
" Permission is hereby granted to use and distribute this code,
|
" Permission is hereby granted to use and distribute this code,
|
||||||
@ -17,7 +17,17 @@
|
|||||||
" But be doers of the Word, and not only hearers, deluding your own selves {{{1
|
" But be doers of the Word, and not only hearers, deluding your own selves {{{1
|
||||||
" (James 1:22 RSV)
|
" (James 1:22 RSV)
|
||||||
" =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
" =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
||||||
let s:keepcpo= &cpo
|
|
||||||
|
" Exception for &cp: {{{1
|
||||||
|
if &cp
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
if v:version < 700
|
||||||
|
echohl WarningMsg | echo "***netrw*** you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw" | echohl None
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let g:loaded_netrw = "v69"
|
||||||
|
let s:keepcpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
" call Decho("doing autoload/netrw.vim")
|
" call Decho("doing autoload/netrw.vim")
|
||||||
|
|
||||||
@ -90,8 +100,10 @@ if !exists("g:netrw_sort_direction")
|
|||||||
" alternative: reverse (z y x ...)
|
" alternative: reverse (z y x ...)
|
||||||
let g:netrw_sort_direction= "normal"
|
let g:netrw_sort_direction= "normal"
|
||||||
endif
|
endif
|
||||||
if !exists("g:netrw_longlist") || g:netrw_longlist == 0
|
if !exists("g:netrw_longlist")
|
||||||
let g:netrw_longlist= 0
|
let g:netrw_longlist= 0
|
||||||
|
endif
|
||||||
|
if g:netrw_longlist == 0 || g:netrw_longlist == 2
|
||||||
let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa"
|
let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa"
|
||||||
else
|
else
|
||||||
let g:netrw_longlist= 1
|
let g:netrw_longlist= 1
|
||||||
@ -275,8 +287,9 @@ fun! netrw#NetRead(...)
|
|||||||
|
|
||||||
" get name of a temporary file and set up shell-quoting character
|
" get name of a temporary file and set up shell-quoting character
|
||||||
let tmpfile= tempname()
|
let tmpfile= tempname()
|
||||||
|
let tmpfile= substitute(tmpfile,'\','/','ge')
|
||||||
if !isdirectory(substitute(tmpfile,'[^/]\+$','','e'))
|
if !isdirectory(substitute(tmpfile,'[^/]\+$','','e'))
|
||||||
echohl Error | echo "***netrw*** your ".substitute(tmpfile,'[^/]\+$','','e')." directory is missing!"
|
echohl Error | echo "***netrw*** your <".substitute(tmpfile,'[^/]\+$','','e')."> directory is missing!"
|
||||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||||
" call Dret("NetRead")
|
" call Dret("NetRead")
|
||||||
return
|
return
|
||||||
@ -661,11 +674,7 @@ fun! s:NetGetFile(readcmd, fname, method)
|
|||||||
" call Dredir("ls!","starting buffer list")
|
" call Dredir("ls!","starting buffer list")
|
||||||
|
|
||||||
" rename the current buffer to the temp file (ie. fname)
|
" rename the current buffer to the temp file (ie. fname)
|
||||||
if v:version < 700
|
keepalt exe "file ".fname
|
||||||
exe "file ".fname
|
|
||||||
else
|
|
||||||
keepalt exe "file ".fname
|
|
||||||
endif
|
|
||||||
" call Dredir("ls!","after renaming current buffer to <".fname.">")
|
" call Dredir("ls!","after renaming current buffer to <".fname.">")
|
||||||
|
|
||||||
" edit temporary file
|
" edit temporary file
|
||||||
@ -673,11 +682,7 @@ fun! s:NetGetFile(readcmd, fname, method)
|
|||||||
" call Dredir("ls!","after editing temporary file")
|
" call Dredir("ls!","after editing temporary file")
|
||||||
|
|
||||||
" rename buffer back to remote filename
|
" rename buffer back to remote filename
|
||||||
if v:version < 700
|
keepalt exe "file ".rfile
|
||||||
exe "file ".rfile
|
|
||||||
else
|
|
||||||
keepalt exe "file ".rfile
|
|
||||||
endif
|
|
||||||
" call Dredir("ls!","renaming buffer back to remote filename<".rfile.">")
|
" call Dredir("ls!","renaming buffer back to remote filename<".rfile.">")
|
||||||
let line1 = 1
|
let line1 = 1
|
||||||
let line2 = line("$")
|
let line2 = line("$")
|
||||||
@ -1015,7 +1020,8 @@ endfun
|
|||||||
" g:netrw_list_cmd has a string, HOSTNAME, that needs to be substituted
|
" g:netrw_list_cmd has a string, HOSTNAME, that needs to be substituted
|
||||||
" with the requested remote hostname first.
|
" with the requested remote hostname first.
|
||||||
fun! s:NetBrowse(dirname)
|
fun! s:NetBrowse(dirname)
|
||||||
" call Dfunc("NetBrowse(dirname<".a:dirname.">) longlist=".g:netrw_longlist)
|
if !exists("w:netrw_longlist")|let w:netrw_longlist= g:netrw_longlist|endif
|
||||||
|
" call Dfunc("NetBrowse(dirname<".a:dirname.">) longlist=".w:netrw_longlist)
|
||||||
|
|
||||||
if exists("s:netrw_skipbrowse")
|
if exists("s:netrw_skipbrowse")
|
||||||
unlet s:netrw_skipbrowse
|
unlet s:netrw_skipbrowse
|
||||||
@ -1127,7 +1133,8 @@ fun! s:NetBrowse(dirname)
|
|||||||
" call Decho("new path<".path.">")
|
" call Decho("new path<".path.">")
|
||||||
|
|
||||||
" remote-read the requested file into current buffer
|
" remote-read the requested file into current buffer
|
||||||
enew!
|
keepjumps keepalt enew!
|
||||||
|
set ma
|
||||||
" call Decho("exe file .method."://".user.machine."/".escape(path,s:netrw_cd_escape))
|
" call Decho("exe file .method."://".user.machine."/".escape(path,s:netrw_cd_escape))
|
||||||
exe "file ".method."://".user.machine."/".escape(path,s:netrw_cd_escape)
|
exe "file ".method."://".user.machine."/".escape(path,s:netrw_cd_escape)
|
||||||
exe "silent doau BufReadPre ".fname
|
exe "silent doau BufReadPre ".fname
|
||||||
@ -1138,7 +1145,7 @@ fun! s:NetBrowse(dirname)
|
|||||||
" save certain window-oriented variables into buffer-oriented variables
|
" save certain window-oriented variables into buffer-oriented variables
|
||||||
call s:BufWinVars()
|
call s:BufWinVars()
|
||||||
call s:NetOptionRestore()
|
call s:NetOptionRestore()
|
||||||
setlocal nonu nomod noma
|
setlocal nomod
|
||||||
|
|
||||||
" call Dret("NetBrowse : file<".fname.">")
|
" call Dret("NetBrowse : file<".fname.">")
|
||||||
return
|
return
|
||||||
@ -1162,7 +1169,7 @@ fun! s:NetBrowse(dirname)
|
|||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
" call Decho("generate a new buffer")
|
" call Decho("generate a new buffer")
|
||||||
enew!
|
keepjumps keepalt enew!
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" rename file to reflect where its from
|
" rename file to reflect where its from
|
||||||
@ -1178,15 +1185,20 @@ fun! s:NetBrowse(dirname)
|
|||||||
|
|
||||||
" set up buffer-local mappings
|
" set up buffer-local mappings
|
||||||
" call Decho("set up buffer-local mappings")
|
" call Decho("set up buffer-local mappings")
|
||||||
nnoremap <buffer> <silent> <cr> :exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()))<cr>
|
nnoremap <buffer> <silent> <cr> :call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()))<cr>
|
||||||
nnoremap <buffer> <silent> <c-l> :call <SID>NetRefresh(<SID>NetBrowseChgDir(expand("%"),'./'))<cr>
|
nnoremap <buffer> <silent> <c-l> :call <SID>NetRefresh(<SID>NetBrowseChgDir(expand("%"),'./'))<cr>
|
||||||
nnoremap <buffer> <silent> - :exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'../'))<cr>
|
nnoremap <buffer> <silent> - :exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'../'))<cr>
|
||||||
nnoremap <buffer> <silent> a :let g:netrw_hide=(g:netrw_hide+1)%3<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<cr>
|
nnoremap <buffer> <silent> a :let g:netrw_hide=(g:netrw_hide+1)%3<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<cr>
|
||||||
nnoremap <buffer> <silent> b :<c-u>call <SID>NetBookmarkDir(0,expand("%"))<cr>
|
if w:netrw_longlist != 2
|
||||||
nnoremap <buffer> <silent> B :<c-u>call <SID>NetBookmarkDir(1,expand("%"))<cr>
|
nnoremap <buffer> <silent> b :<c-u>call <SID>NetBookmarkDir(0,expand("%"))<cr>
|
||||||
|
nnoremap <buffer> <silent> B :<c-u>call <SID>NetBookmarkDir(1,expand("%"))<cr>
|
||||||
|
endif
|
||||||
|
nnoremap <buffer> <silent> Nb :<c-u>call <SID>NetBookmarkDir(0,expand("%"))<cr>
|
||||||
|
nnoremap <buffer> <silent> NB :<c-u>call <SID>NetBookmarkDir(0,expand("%"))<cr>
|
||||||
nnoremap <buffer> <silent> <c-h> :call <SID>NetHideEdit(0)<cr>
|
nnoremap <buffer> <silent> <c-h> :call <SID>NetHideEdit(0)<cr>
|
||||||
nnoremap <buffer> <silent> i :call <SID>NetLongList(0)<cr>
|
nnoremap <buffer> <silent> i :call <SID>NetLongList(0)<cr>
|
||||||
nnoremap <buffer> <silent> o :call <SID>NetSplit(0)<cr>
|
nnoremap <buffer> <silent> o :call <SID>NetSplit(0)<cr>
|
||||||
|
nnoremap <buffer> <silent> O :call <SID>NetObtain()<cr>
|
||||||
nnoremap <buffer> <silent> q :<c-u>call <SID>NetBookmarkDir(2,expand("%"))<cr>
|
nnoremap <buffer> <silent> q :<c-u>call <SID>NetBookmarkDir(2,expand("%"))<cr>
|
||||||
nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<cr>
|
nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<cr>
|
||||||
nnoremap <buffer> <silent> s :call <SID>NetSaveWordPosn()<bar>let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<bar>call <SID>NetRestoreWordPosn()<cr>
|
nnoremap <buffer> <silent> s :call <SID>NetSaveWordPosn()<bar>let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<bar>call <SID>NetRestoreWordPosn()<cr>
|
||||||
@ -1194,14 +1206,14 @@ fun! s:NetBrowse(dirname)
|
|||||||
nnoremap <buffer> <silent> u :<c-u>call <SID>NetBookmarkDir(4,expand("%"))<cr>
|
nnoremap <buffer> <silent> u :<c-u>call <SID>NetBookmarkDir(4,expand("%"))<cr>
|
||||||
nnoremap <buffer> <silent> U :<c-u>call <SID>NetBookmarkDir(5,expand("%"))<cr>
|
nnoremap <buffer> <silent> U :<c-u>call <SID>NetBookmarkDir(5,expand("%"))<cr>
|
||||||
nnoremap <buffer> <silent> v :call <SID>NetSplit(1)<cr>
|
nnoremap <buffer> <silent> v :call <SID>NetSplit(1)<cr>
|
||||||
nnoremap <buffer> <silent> x :exe "norm! 0"<bar>call <SID>NetBrowseX(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()),1)<cr>
|
nnoremap <buffer> <silent> x :call <SID>NetBrowseX(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()),1)<cr>
|
||||||
nnoremap <buffer> <silent> <2-leftmouse> :exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()))<cr>
|
nnoremap <buffer> <silent> <2-leftmouse> :call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()))<cr>
|
||||||
exe 'nnoremap <buffer> <silent> <del> :exe "norm! 0"<bar>call <SID>NetBrowseRm("'.user.machine.'","'.path.'")<cr>'
|
exe 'nnoremap <buffer> <silent> <del> :call <SID>NetBrowseRm("'.user.machine.'","'.path.'")<cr>'
|
||||||
exe 'vnoremap <buffer> <silent> <del> :call <SID>NetBrowseRm("'.user.machine.'","'.path.'")<cr>'
|
exe 'vnoremap <buffer> <silent> <del> :call <SID>NetBrowseRm("'.user.machine.'","'.path.'")<cr>'
|
||||||
exe 'nnoremap <buffer> <silent> d :call <SID>NetMakeDir("'.user.machine.'")<cr>'
|
exe 'nnoremap <buffer> <silent> d :call <SID>NetMakeDir("'.user.machine.'")<cr>'
|
||||||
exe 'nnoremap <buffer> <silent> D :exe "norm! 0"<bar>call <SID>NetBrowseRm("'.user.machine.'","'.path.'")<cr>'
|
exe 'nnoremap <buffer> <silent> D :call <SID>NetBrowseRm("'.user.machine.'","'.path.'")<cr>'
|
||||||
exe 'vnoremap <buffer> <silent> D :call <SID>NetBrowseRm("'.user.machine.'","'.path.'")<cr>'
|
exe 'vnoremap <buffer> <silent> D :call <SID>NetBrowseRm("'.user.machine.'","'.path.'")<cr>'
|
||||||
exe 'nnoremap <buffer> <silent> R :exe "norm! 0"<bar>call <SID>NetBrowseRename("'.user.machine.'","'.path.'")<cr>'
|
exe 'nnoremap <buffer> <silent> R :call <SID>NetBrowseRename("'.user.machine.'","'.path.'")<cr>'
|
||||||
exe 'vnoremap <buffer> <silent> R :call <SID>NetBrowseRename("'.user.machine.'","'.path.'")<cr>'
|
exe 'vnoremap <buffer> <silent> R :call <SID>NetBrowseRename("'.user.machine.'","'.path.'")<cr>'
|
||||||
nnoremap <buffer> ? :he netrw-browse-cmds<cr>
|
nnoremap <buffer> ? :he netrw-browse-cmds<cr>
|
||||||
setlocal ma nonu nowrap
|
setlocal ma nonu nowrap
|
||||||
@ -1209,7 +1221,7 @@ fun! s:NetBrowse(dirname)
|
|||||||
" Set up the banner
|
" Set up the banner
|
||||||
" call Decho("set up the banner: sortby<".g:netrw_sort_by."> method<".method.">")
|
" call Decho("set up the banner: sortby<".g:netrw_sort_by."> method<".method.">")
|
||||||
keepjumps put ='\" ==========================================================================='
|
keepjumps put ='\" ==========================================================================='
|
||||||
keepjumps put ='\" Netrw Remote Directory Listing'
|
keepjumps put ='\" Netrw Remote Directory Listing (netrw '.g:loaded_netrw.')'
|
||||||
keepjumps put ='\" '.bufname
|
keepjumps put ='\" '.bufname
|
||||||
let w:netrw_bannercnt = 7
|
let w:netrw_bannercnt = 7
|
||||||
let sortby = g:netrw_sort_by
|
let sortby = g:netrw_sort_by
|
||||||
@ -1246,7 +1258,7 @@ fun! s:NetBrowse(dirname)
|
|||||||
call s:NetBrowseFtpCmd(path,listcmd)
|
call s:NetBrowseFtpCmd(path,listcmd)
|
||||||
keepjumps 1d
|
keepjumps 1d
|
||||||
|
|
||||||
if !g:netrw_longlist
|
if w:netrw_longlist == 0 || w:netrw_longlist == 2
|
||||||
" shorten the listing
|
" shorten the listing
|
||||||
" call Decho("generate short listing")
|
" call Decho("generate short listing")
|
||||||
exe "keepjumps ".w:netrw_bannercnt
|
exe "keepjumps ".w:netrw_bannercnt
|
||||||
@ -1255,6 +1267,7 @@ fun! s:NetBrowse(dirname)
|
|||||||
if g:netrw_ftp_browse_reject != ""
|
if g:netrw_ftp_browse_reject != ""
|
||||||
exe "silent! g/".g:netrw_ftp_browse_reject."/keepjumps d"
|
exe "silent! g/".g:netrw_ftp_browse_reject."/keepjumps d"
|
||||||
endif
|
endif
|
||||||
|
silent! keepjumps %s/\r$//e
|
||||||
|
|
||||||
" if there's no ../ listed, then put ./ and ../ in
|
" if there's no ../ listed, then put ./ and ../ in
|
||||||
let line1= line(".")
|
let line1= line(".")
|
||||||
@ -1269,9 +1282,9 @@ fun! s:NetBrowse(dirname)
|
|||||||
keepjumps norm! 0
|
keepjumps norm! 0
|
||||||
|
|
||||||
" more cleanup
|
" more cleanup
|
||||||
exe 'keepjumps silent! '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2/e'
|
exe 'silent! keepjumps '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2/e'
|
||||||
exe "keepjumps silent! ".w:netrw_bannercnt.',$g/ -> /s# -> .*/$#/#e'
|
exe "silent! keepjumps ".w:netrw_bannercnt.',$g/ -> /s# -> .*/$#/#e'
|
||||||
exe "keepjumps silent! ".w:netrw_bannercnt.',$g/ -> /s# -> .*$#/#e'
|
exe "silent! keepjumps ".w:netrw_bannercnt.',$g/ -> /s# -> .*$#/#e'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
else
|
else
|
||||||
@ -1305,7 +1318,7 @@ fun! s:NetBrowse(dirname)
|
|||||||
call s:NetrwListHide()
|
call s:NetrwListHide()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if g:netrw_longlist
|
if w:netrw_longlist == 1
|
||||||
" do a long listing; these substitutions need to be done prior to sorting
|
" do a long listing; these substitutions need to be done prior to sorting
|
||||||
" call Decho("manipulate long listing")
|
" call Decho("manipulate long listing")
|
||||||
|
|
||||||
@ -1328,33 +1341,34 @@ fun! s:NetBrowse(dirname)
|
|||||||
keepjumps norm! 0
|
keepjumps norm! 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
exe 'keepjumps silent '.w:netrw_bannercnt.',$s/ -> .*$//e'
|
exe 'silent keepjumps '.w:netrw_bannercnt.',$s/ -> .*$//e'
|
||||||
exe 'keepjumps silent '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2\t\1/e'
|
exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2\t\1/e'
|
||||||
exe w:netrw_bannercnt
|
exe 'silent keepjumps '.w:netrw_bannercnt
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if line("$") >= w:netrw_bannercnt
|
if line("$") >= w:netrw_bannercnt
|
||||||
if g:netrw_sort_by =~ "^n"
|
if g:netrw_sort_by =~ "^n"
|
||||||
call s:SetSort()
|
call s:SetSort()
|
||||||
if v:version < 700
|
if g:netrw_sort_direction =~ 'n'
|
||||||
exe 'keepjumps silent '.w:netrw_bannercnt.',$call s:NetSort()'
|
exe 'silent keepjumps '.w:netrw_bannercnt.',$sort'
|
||||||
elseif g:netrw_sort_direction =~ 'n'
|
|
||||||
exe 'keepjumps silent '.w:netrw_bannercnt.',$sort'
|
|
||||||
else
|
else
|
||||||
exe 'keepjumps silent '.w:netrw_bannercnt.',$sort!'
|
exe 'silent keepjumps '.w:netrw_bannercnt.',$sort!'
|
||||||
endif
|
endif
|
||||||
exe 'keepjumps silent '.w:netrw_bannercnt.',$s/^\d\{3}\///e'
|
exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\d\{3}\///e'
|
||||||
endif
|
endif
|
||||||
if g:netrw_longlist
|
if w:netrw_longlist == 1
|
||||||
" shorten the list to keep its width <= 80 characters
|
" shorten the list to keep its width <= winwidth characters
|
||||||
exe "keepjumps silent ".w:netrw_bannercnt.',$s/\t[-dstrwx]\+/\t/e'
|
exe "silent keepjumps ".w:netrw_bannercnt.',$s/\t[-dstrwx]\+/\t/e'
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" cleanup any windows mess at end-of-line
|
call s:NetrwWideListing()
|
||||||
keepjumps silent! %s/\r$//e
|
if line("$") >= w:netrw_bannercnt
|
||||||
exe "keepjumps ".w:netrw_bannercnt
|
" place cursor on the top-left corner of the file listing
|
||||||
|
exe "keepjumps ".w:netrw_bannercnt
|
||||||
|
norm! 0
|
||||||
|
endif
|
||||||
|
|
||||||
call s:NetOptionRestore()
|
call s:NetOptionRestore()
|
||||||
setlocal nomod noma nonu
|
setlocal nomod noma nonu
|
||||||
@ -1412,7 +1426,19 @@ fun! s:NetGetWord()
|
|||||||
" call Dfunc("NetGetWord() line#".line("."))
|
" call Dfunc("NetGetWord() line#".line("."))
|
||||||
call s:UseBufWinVars()
|
call s:UseBufWinVars()
|
||||||
|
|
||||||
|
" insure that w:netrw_longlist is set up
|
||||||
|
if !exists("w:netrw_longlist")
|
||||||
|
if exists("g:netrw_longlist")
|
||||||
|
let w:netrw_longlist= g:netrw_longlist
|
||||||
|
else
|
||||||
|
let w:netrw_longlist= 0
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt
|
if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt
|
||||||
|
" Active Banner support
|
||||||
|
" call Decho("active banner handling")
|
||||||
|
norm! 0
|
||||||
let dirname= "./"
|
let dirname= "./"
|
||||||
let curline= getline(".")
|
let curline= getline(".")
|
||||||
if curline =~ '"\s*Sorted by\s'
|
if curline =~ '"\s*Sorted by\s'
|
||||||
@ -1431,14 +1457,40 @@ fun! s:NetGetWord()
|
|||||||
let s:netrw_skipbrowse= 1
|
let s:netrw_skipbrowse= 1
|
||||||
echo 'Pressing "a" also works'
|
echo 'Pressing "a" also works'
|
||||||
elseif line("$") > w:netrw_bannercnt
|
elseif line("$") > w:netrw_bannercnt
|
||||||
exe w:netrw_bannercnt
|
exe 'silent keepjumps '.w:netrw_bannercnt
|
||||||
endif
|
endif
|
||||||
else
|
|
||||||
|
elseif w:netrw_longlist == 0
|
||||||
|
" call Decho("thin column handling")
|
||||||
|
norm! 0
|
||||||
let dirname= getline(".")
|
let dirname= getline(".")
|
||||||
if dirname =~ '\t'
|
|
||||||
let dirname= substitute(dirname,'\t.*$','','e')
|
elseif w:netrw_longlist == 1
|
||||||
|
" call Decho("long column handling")
|
||||||
|
norm! 0
|
||||||
|
let dirname= substitute(getline("."),'^\(\%(\S\+\s\)*\S\+\).\{-}$','\1','e')
|
||||||
|
|
||||||
|
else
|
||||||
|
" call Decho("obtain word from wide listing")
|
||||||
|
let dirname= getline(".")
|
||||||
|
|
||||||
|
if !exists("b:netrw_cpf")
|
||||||
|
let b:netrw_cpf= 0
|
||||||
|
exe 'silent keepjumps '.w:netrw_bannercnt.',$g/^./if virtcol("$") > b:netrw_cpf|let b:netrw_cpf= virtcol("$")|endif'
|
||||||
|
" call Decho("computed cpf")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let filestart = (virtcol(".")/b:netrw_cpf)*b:netrw_cpf
|
||||||
|
" call Decho("virtcol=".virtcol(".")." cpf=".b:netrw_cpf." bannercnt=".w:netrw_bannercnt." filestart=".filestart)
|
||||||
|
" call Decho("1: dirname<".dirname.">")
|
||||||
|
if filestart > 0|let dirname= substitute(dirname,'^.\{'.filestart.'}','','')|endif
|
||||||
|
" call Decho("2: dirname<".dirname.">")
|
||||||
|
let dirname = substitute(dirname,'^\(.\{'.b:netrw_cpf.'}\).*$','\1','e')
|
||||||
|
" call Decho("3: dirname<".dirname.">")
|
||||||
|
let dirname = substitute(dirname,'\s\+$','','e')
|
||||||
|
" call Decho("4: dirname<".dirname.">")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" call Dret("NetGetWord <".dirname.">")
|
" call Dret("NetGetWord <".dirname.">")
|
||||||
return dirname
|
return dirname
|
||||||
endfun
|
endfun
|
||||||
@ -1646,7 +1698,7 @@ fun! s:NetBrowseX(fname,remote)
|
|||||||
" create a local copy
|
" create a local copy
|
||||||
let fname= tempname().".".exten
|
let fname= tempname().".".exten
|
||||||
" call Decho("create a local copy of <".a:fname."> as <".fname.">")
|
" call Decho("create a local copy of <".a:fname."> as <".fname.">")
|
||||||
exe "keepjumps silent bot 1new ".a:fname
|
exe "silent keepjumps bot 1new ".a:fname
|
||||||
set bh=delete
|
set bh=delete
|
||||||
exe "w! ".fname
|
exe "w! ".fname
|
||||||
q
|
q
|
||||||
@ -1717,13 +1769,15 @@ fun! s:NetBrowseFtpCmd(path,cmd)
|
|||||||
let curline= w:netrw_bannercnt+1
|
let curline= w:netrw_bannercnt+1
|
||||||
exe "silent! keepjumps ".curline.",$d"
|
exe "silent! keepjumps ".curline.",$d"
|
||||||
|
|
||||||
".........................................
|
".........................................
|
||||||
if w:netrw_method == 2 || w:netrw_method == 5
|
if w:netrw_method == 2 || w:netrw_method == 5
|
||||||
" ftp + <.netrc>: Method #2
|
" ftp + <.netrc>: Method #2
|
||||||
if a:path != ""
|
if a:path != ""
|
||||||
put ='cd '.a:path
|
put ='cd '.a:path
|
||||||
|
" call Decho("ftp: cd ".a:path)
|
||||||
endif
|
endif
|
||||||
exe "put ='".a:cmd."'"
|
exe "put ='".a:cmd."'"
|
||||||
|
" call Decho("ftp: ".a:cmd)
|
||||||
" redraw!|call inputsave()|call input("Pausing...")|call inputrestore()
|
" redraw!|call inputsave()|call input("Pausing...")|call inputrestore()
|
||||||
if exists("g:netrw_port") && g:netrw_port != ""
|
if exists("g:netrw_port") && g:netrw_port != ""
|
||||||
" call Decho("exe ".g:netrw_silentxfer.curline.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port)
|
" call Decho("exe ".g:netrw_silentxfer.curline.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port)
|
||||||
@ -1769,14 +1823,14 @@ fun! s:NetBrowseFtpCmd(path,cmd)
|
|||||||
|
|
||||||
" cleanup for Windows
|
" cleanup for Windows
|
||||||
if has("win32") || has("win95") || has("win64") || has("win16")
|
if has("win32") || has("win95") || has("win64") || has("win16")
|
||||||
keepjumps silent!! %s/\r$//e
|
silent! keepjumps! %s/\r$//e
|
||||||
endif
|
endif
|
||||||
if a:cmd == "dir"
|
if a:cmd == "dir"
|
||||||
" infer directory/link based on the file permission string
|
" infer directory/link based on the file permission string
|
||||||
keepjumps silent! g/d\%([-r][-w][-x]\)\{3}/s@$@/@
|
silent! keepjumps g/d\%([-r][-w][-x]\)\{3}/s@$@/@
|
||||||
keepjumps silent! g/l\%([-r][-w][-x]\)\{3}/s/$/@/
|
silent! keepjumps g/l\%([-r][-w][-x]\)\{3}/s/$/@/
|
||||||
if !g:netrw_longlist
|
if w:netrw_longlist == 0 || w:netrw_longlist == 2
|
||||||
exe "keepjumps silent! ".curline.',$s/^\%(\S\+\s\+\)\{8}//e'
|
exe "silent! keepjumps ".curline.',$s/^\%(\S\+\s\+\)\{8}//e'
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -1814,9 +1868,9 @@ fun! s:NetrwListHide()
|
|||||||
" Prune the list by hiding any files which match
|
" Prune the list by hiding any files which match
|
||||||
" call Decho("pruning <".hide."> listhide<".listhide.">")
|
" call Decho("pruning <".hide."> listhide<".listhide.">")
|
||||||
if g:netrw_hide == 1
|
if g:netrw_hide == 1
|
||||||
exe 'keepjumps silent '.w:netrw_bannercnt.',$g~'.hide.'~d'
|
exe 'silent keepjumps '.w:netrw_bannercnt.',$g~'.hide.'~d'
|
||||||
elseif g:netrw_hide == 2
|
elseif g:netrw_hide == 2
|
||||||
exe 'keepjumps silent '.w:netrw_bannercnt.',$v~'.hide.'~d'
|
exe 'silent keepjumps '.w:netrw_bannercnt.',$v~'.hide.'~d'
|
||||||
endif
|
endif
|
||||||
endwhile
|
endwhile
|
||||||
|
|
||||||
@ -1866,20 +1920,25 @@ endfun
|
|||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" NetLongList: {{{2
|
" NetLongList: {{{2
|
||||||
fun! s:NetLongList(mode)
|
fun! s:NetLongList(mode)
|
||||||
" call Dfunc("NetLongList(mode=".a:mode.") netrw_longlist=".g:netrw_longlist)
|
" call Dfunc("NetLongList(mode=".a:mode.") netrw_longlist=".w:netrw_longlist)
|
||||||
call netrw#NetSavePosn()
|
let fname = s:NetGetWord()
|
||||||
|
let w:netrw_longlist = (w:netrw_longlist + 1) % 3
|
||||||
|
" call Decho("fname<".fname.">")
|
||||||
|
|
||||||
if g:netrw_longlist != 0
|
if w:netrw_longlist == 0
|
||||||
" turn long listing off
|
" use one column listing
|
||||||
" call Decho("turn long listing off")
|
" call Decho("use one column list")
|
||||||
let g:netrw_longlist = 0
|
|
||||||
let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge')
|
let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge')
|
||||||
|
|
||||||
else
|
elseif w:netrw_longlist == 1
|
||||||
" turn long listing on
|
" use long list
|
||||||
" call Decho("turn long listing on")
|
" call Decho("use long list")
|
||||||
let g:netrw_longlist = 1
|
|
||||||
let g:netrw_list_cmd = g:netrw_list_cmd." -l"
|
let g:netrw_list_cmd = g:netrw_list_cmd." -l"
|
||||||
|
|
||||||
|
else
|
||||||
|
" give wide list
|
||||||
|
" call Decho("use wide list")
|
||||||
|
let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge')
|
||||||
endif
|
endif
|
||||||
setlocal ma
|
setlocal ma
|
||||||
|
|
||||||
@ -1893,9 +1952,65 @@ fun! s:NetLongList(mode)
|
|||||||
silent call s:LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,"./"))
|
silent call s:LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,"./"))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call netrw#NetRestorePosn()
|
" keep cursor on the filename
|
||||||
|
silent keepjumps $
|
||||||
|
if fname =~ '/$'
|
||||||
|
silent call search('\%(^\|\s\{2,}\)\zs'.escape(fname,'.\[]*$^').'\%(\s\{2,}\|$\)','bW')
|
||||||
|
else
|
||||||
|
silent call search('\%(^\|\s\{2,}\)\zs'.escape(fname,'.\[]*$^').'\%(\s\{2,}\|$\)','bW')
|
||||||
|
endif
|
||||||
|
|
||||||
" call Dret("NetLongList : g:netrw_longlist=".g:netrw_longlist)
|
" call Dret("NetLongList : w:netrw_longlist=".w:netrw_longlist)
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" NetrwWideListing: {{{2
|
||||||
|
fun! s:NetrwWideListing()
|
||||||
|
" call Dfunc("NetrwWideListing()")
|
||||||
|
|
||||||
|
if w:netrw_longlist == 2
|
||||||
|
" look for longest filename (cpf=characters per filename)
|
||||||
|
" cpf: characters per file
|
||||||
|
" fpl: files per line
|
||||||
|
" fpc: files per column
|
||||||
|
set ma
|
||||||
|
let b:netrw_cpf= 0
|
||||||
|
if line("$") >= w:netrw_bannercnt
|
||||||
|
exe 'silent keepjumps '.w:netrw_bannercnt.',$g/^./if virtcol("$") > b:netrw_cpf|let b:netrw_cpf= virtcol("$")|endif'
|
||||||
|
else
|
||||||
|
" call Dret("NetrwWideListing")
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
" call Decho("max file strlen+1=".b:netrw_cpf)
|
||||||
|
let b:netrw_cpf= b:netrw_cpf + 1
|
||||||
|
|
||||||
|
" determine qty files per line (fpl)
|
||||||
|
let w:netrw_fpl= winwidth(0)/b:netrw_cpf
|
||||||
|
" call Decho("fpl= ".winwidth(0)."/[b:netrw_cpf=".b:netrw_cpf.']='.w:netrw_fpl)
|
||||||
|
|
||||||
|
" make wide display
|
||||||
|
exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^.*$/\=printf("%-'.b:netrw_cpf.'s",submatch(0))/'
|
||||||
|
let fpc = (line("$") - w:netrw_bannercnt + w:netrw_fpl)/w:netrw_fpl
|
||||||
|
let newcolstart = w:netrw_bannercnt + fpc
|
||||||
|
let newcolend = newcolstart + fpc - 1
|
||||||
|
" call Decho("bannercnt=".w:netrw_bannercnt." fpl=".w:netrw_fpl." fpc=".fpc." newcol[".newcolstart.",".newcolend."]")
|
||||||
|
while line("$") >= newcolstart
|
||||||
|
if newcolend > line("$") | let newcolend= line("$") | endif
|
||||||
|
let newcolqty= newcolend - newcolstart
|
||||||
|
exe newcolstart
|
||||||
|
if newcolqty == 0
|
||||||
|
exe "silent keepjumps norm! 0\<c-v>$hx".w:netrw_bannercnt."G$p"
|
||||||
|
else
|
||||||
|
exe "silent keepjumps norm! 0\<c-v>".newcolqty.'j$hx'.w:netrw_bannercnt.'G$p'
|
||||||
|
endif
|
||||||
|
exe "silent keepjumps ".newcolstart.','.newcolend.'d'
|
||||||
|
exe 'silent keepjumps '.w:netrw_bannercnt
|
||||||
|
endwhile
|
||||||
|
exe "silent keepjumps ".w:netrw_bannercnt.',$s/\s\+$//e'
|
||||||
|
set noma nomod
|
||||||
|
endif
|
||||||
|
|
||||||
|
" call Dret("NetrwWideListing")
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
@ -2023,7 +2138,7 @@ fun! s:NetBookmarkDir(chg,curdir)
|
|||||||
if exists("w:netrw_bannercnt") && line(".") <= w:netrw_bannercnt
|
if exists("w:netrw_bannercnt") && line(".") <= w:netrw_bannercnt
|
||||||
" looks like a "b" was pressed while in the banner region
|
" looks like a "b" was pressed while in the banner region
|
||||||
if line("$") > w:netrw_bannercnt
|
if line("$") > w:netrw_bannercnt
|
||||||
exe w:netrw_bannercnt
|
exe 'silent keepjumps '.w:netrw_bannercnt
|
||||||
endif
|
endif
|
||||||
echo ""
|
echo ""
|
||||||
" call Dret("NetBookmarkDir - ignoring")
|
" call Dret("NetBookmarkDir - ignoring")
|
||||||
@ -2119,6 +2234,121 @@ fun! s:NetBookmarkDir(chg,curdir)
|
|||||||
" call Dret("NetBookmarkDir")
|
" call Dret("NetBookmarkDir")
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" NetObtain: obtain file under cursor (for remote browsing support) {{{2
|
||||||
|
fun! s:NetObtain()
|
||||||
|
if !exists("s:netrw_users_stl")
|
||||||
|
let s:netrw_users_stl= &stl
|
||||||
|
endif
|
||||||
|
let fname= expand("<cWORD>")
|
||||||
|
exe 'set stl=%f\ %h%m%r%=Obtaining\ '.escape(fname,' ')
|
||||||
|
redraw!
|
||||||
|
|
||||||
|
" call Dfunc("NetObtain() method=".w:netrw_method)
|
||||||
|
if exists("w:netrw_method") && w:netrw_method =~ '[235]'
|
||||||
|
if executable("ftp")
|
||||||
|
let curdir = expand("%")
|
||||||
|
let path = substitute(curdir,'ftp://[^/]\+/','','e')
|
||||||
|
let curline= line(".")
|
||||||
|
let endline= line("$")+1
|
||||||
|
set ma
|
||||||
|
keepjumps $
|
||||||
|
|
||||||
|
".........................................
|
||||||
|
if w:netrw_method == 2
|
||||||
|
" ftp + <.netrc>: Method #2
|
||||||
|
if path != ""
|
||||||
|
put ='cd '.path
|
||||||
|
" call Decho("ftp: cd ".path)
|
||||||
|
endif
|
||||||
|
put ='get '.fname
|
||||||
|
" call Decho("ftp: get ".fname)
|
||||||
|
if exists("g:netrw_port") && g:netrw_port != ""
|
||||||
|
" call Decho("exe ".g:netrw_silentxfer.endline.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port)
|
||||||
|
exe g:netrw_silentxfer.endline.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port
|
||||||
|
else
|
||||||
|
" call Decho("exe ".g:netrw_silentxfer.endline.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine)
|
||||||
|
exe g:netrw_silentxfer.endline.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine
|
||||||
|
endif
|
||||||
|
|
||||||
|
".........................................
|
||||||
|
elseif w:netrw_method == 3
|
||||||
|
" ftp + machine,id,passwd,filename: Method #3
|
||||||
|
setlocal ff=unix
|
||||||
|
if exists("g:netrw_port") && g:netrw_port != ""
|
||||||
|
put ='open '.g:netrw_machine.' '.g:netrw_port
|
||||||
|
" call Decho('ftp: open '.g:netrw_machine.' '.g:netrw_port)
|
||||||
|
else
|
||||||
|
put ='open '.g:netrw_machine
|
||||||
|
" call Decho('ftp: open '.g:netrw_machine
|
||||||
|
endif
|
||||||
|
|
||||||
|
if exists("g:netrw_ftp") && g:netrw_ftp == 1
|
||||||
|
put =g:netrw_uid
|
||||||
|
put =g:netrw_passwd
|
||||||
|
" call Decho('ftp: g:netrw_uid')
|
||||||
|
" call Decho('ftp: g:netrw_passwd')
|
||||||
|
else
|
||||||
|
put ='user '.g:netrw_uid.' '.g:netrw_passwd
|
||||||
|
" call Decho('user '.g:netrw_uid.' '.g:netrw_passwd)
|
||||||
|
endif
|
||||||
|
|
||||||
|
if a:path != ""
|
||||||
|
put ='cd '.a:path
|
||||||
|
" call Decho('cd '.a:path)
|
||||||
|
endif
|
||||||
|
exe "put ='".a:cmd."'"
|
||||||
|
" call Decho("ftp: ".a:cmd)
|
||||||
|
|
||||||
|
" perform ftp:
|
||||||
|
" -i : turns off interactive prompting from ftp
|
||||||
|
" -n unix : DON'T use <.netrc>, even though it exists
|
||||||
|
" -n win32: quit being obnoxious about password
|
||||||
|
" call Decho("exe ".g:netrw_silentxfer.curline.",$!".g:netrw_ftp_cmd." -i -n")
|
||||||
|
exe g:netrw_silentxfer.endline.",$!".g:netrw_ftp_cmd." -i -n"
|
||||||
|
|
||||||
|
".........................................
|
||||||
|
else
|
||||||
|
echo "***warning*** unable to comply with your request<" . choice . ">"
|
||||||
|
endif
|
||||||
|
" restore
|
||||||
|
exe "silent! ".endline.",$d"
|
||||||
|
exe "keepjumps ".curline
|
||||||
|
set noma nomod
|
||||||
|
else
|
||||||
|
if !exists("g:netrw_quiet")
|
||||||
|
echohl Error | echo "***netrw*** this system doesn't support ftp" | echohl None
|
||||||
|
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||||
|
endif
|
||||||
|
" call Dret("NetObtain")
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
".........................................
|
||||||
|
else
|
||||||
|
" scp: Method#4
|
||||||
|
if exists("g:netrw_port") && g:netrw_port != ""
|
||||||
|
let useport= " -P ".g:netrw_port
|
||||||
|
else
|
||||||
|
let useport= ""
|
||||||
|
endif
|
||||||
|
if g:netrw_cygwin == 1
|
||||||
|
let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
|
||||||
|
" call Decho("executing: !".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(fname,' ?&')." .")
|
||||||
|
exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(fname,' ?&')." ."
|
||||||
|
else
|
||||||
|
" call Decho("executing: !".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(fname,' ?&')." .")
|
||||||
|
exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(fname,' ?&')." ."
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
" restore status line
|
||||||
|
let &stl= s:netrw_users_stl
|
||||||
|
redraw!
|
||||||
|
|
||||||
|
" call Dret("NetObtain")
|
||||||
|
endfun
|
||||||
|
|
||||||
" ==========================================
|
" ==========================================
|
||||||
" Local Directory Browsing Support: {{{1
|
" Local Directory Browsing Support: {{{1
|
||||||
" ==========================================
|
" ==========================================
|
||||||
@ -2138,6 +2368,7 @@ endfun
|
|||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" DirBrowse: supports local file/directory browsing {{{2
|
" DirBrowse: supports local file/directory browsing {{{2
|
||||||
fun! netrw#DirBrowse(dirname)
|
fun! netrw#DirBrowse(dirname)
|
||||||
|
if !exists("w:netrw_longlist")|let w:netrw_longlist= g:netrw_longlist|endif
|
||||||
" call Dfunc("DirBrowse(dirname<".a:dirname.">) buf#".bufnr("%")." winnr=".winnr()." sortby=".g:netrw_sort_by)
|
" call Dfunc("DirBrowse(dirname<".a:dirname.">) buf#".bufnr("%")." winnr=".winnr()." sortby=".g:netrw_sort_by)
|
||||||
" call Dredir("ls!")
|
" call Dredir("ls!")
|
||||||
|
|
||||||
@ -2181,18 +2412,10 @@ fun! netrw#DirBrowse(dirname)
|
|||||||
|
|
||||||
" get cleared buffer
|
" get cleared buffer
|
||||||
if bufnum < 0 || !bufexists(bufnum)
|
if bufnum < 0 || !bufexists(bufnum)
|
||||||
if v:version < 700
|
keepjumps keepalt enew!
|
||||||
enew!
|
|
||||||
else
|
|
||||||
keepalt enew!
|
|
||||||
endif
|
|
||||||
" call Decho("enew buffer")
|
" call Decho("enew buffer")
|
||||||
else
|
else
|
||||||
if v:version < 700
|
exe "keepalt b ".bufnum
|
||||||
exe "b ".bufnum
|
|
||||||
else
|
|
||||||
exe "keepalt b ".bufnum
|
|
||||||
endif
|
|
||||||
if exists("s:last_sort_by") && g:netrw_sort_by == s:last_sort_by
|
if exists("s:last_sort_by") && g:netrw_sort_by == s:last_sort_by
|
||||||
if getline(2) =~ '^" Directory Listing '
|
if getline(2) =~ '^" Directory Listing '
|
||||||
if !g:netrw_keepdir
|
if !g:netrw_keepdir
|
||||||
@ -2246,11 +2469,7 @@ fun! netrw#DirBrowse(dirname)
|
|||||||
|
|
||||||
" make this buffer not-a-file, modifiable, not line-numbered, etc
|
" make this buffer not-a-file, modifiable, not line-numbered, etc
|
||||||
setlocal bh=hide bt=nofile nobl ma nonu
|
setlocal bh=hide bt=nofile nobl ma nonu
|
||||||
if v:version < 700
|
keepalt silent! %d
|
||||||
silent! %d
|
|
||||||
else
|
|
||||||
keepalt silent! %d
|
|
||||||
endif
|
|
||||||
|
|
||||||
" ---------------------------
|
" ---------------------------
|
||||||
" Perform Directory Listing:
|
" Perform Directory Listing:
|
||||||
@ -2260,18 +2479,23 @@ fun! netrw#DirBrowse(dirname)
|
|||||||
|
|
||||||
" set up all the maps
|
" set up all the maps
|
||||||
" call Decho("Setting up local browser maps")
|
" call Decho("Setting up local browser maps")
|
||||||
nnoremap <buffer> <silent> <cr> :exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))<cr>
|
nnoremap <buffer> <silent> <cr> :call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))<cr>
|
||||||
nnoremap <buffer> <silent> <c-l> :set ma<bar>%d<bar>call <SID>LocalRefresh(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<bar>redraw!<cr>
|
nnoremap <buffer> <silent> <c-l> :set ma<bar>%d<bar>call <SID>LocalRefresh(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<bar>redraw!<cr>
|
||||||
nnoremap <buffer> <silent> - :exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'../'))<cr>
|
nnoremap <buffer> <silent> - :exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'../'))<cr>
|
||||||
nnoremap <buffer> <silent> a :let g:netrw_hide=(g:netrw_hide+1)%3<bar>exe "norm! 0"<bar>call <SID>LocalRefresh(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<cr>
|
nnoremap <buffer> <silent> a :let g:netrw_hide=(g:netrw_hide+1)%3<bar>exe "norm! 0"<bar>call <SID>LocalRefresh(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<cr>
|
||||||
nnoremap <buffer> <silent> b :<c-u>call <SID>NetBookmarkDir(0,b:netrw_curdir)<cr>
|
if w:netrw_longlist != 2
|
||||||
nnoremap <buffer> <silent> B :<c-u>call <SID>NetBookmarkDir(1,b:netrw_curdir)<cr>
|
nnoremap <buffer> <silent> b :<c-u>call <SID>NetBookmarkDir(0,b:netrw_curdir)<cr>
|
||||||
|
nnoremap <buffer> <silent> B :<c-u>call <SID>NetBookmarkDir(1,b:netrw_curdir)<cr>
|
||||||
|
endif
|
||||||
|
nnoremap <buffer> <silent> Nb :<c-u>call <SID>NetBookmarkDir(0,b:netrw_curdir)<cr>
|
||||||
|
nnoremap <buffer> <silent> NB :<c-u>call <SID>NetBookmarkDir(1,b:netrw_curdir)<cr>
|
||||||
nnoremap <buffer> <silent> c :exe "cd ".b:netrw_curdir<cr>
|
nnoremap <buffer> <silent> c :exe "cd ".b:netrw_curdir<cr>
|
||||||
nnoremap <buffer> <silent> d :call <SID>NetMakeDir("")<cr>
|
nnoremap <buffer> <silent> d :call <SID>NetMakeDir("")<cr>
|
||||||
nnoremap <buffer> <silent> <c-h> :call <SID>NetHideEdit(1)<cr>
|
nnoremap <buffer> <silent> <c-h> :call <SID>NetHideEdit(1)<cr>
|
||||||
nnoremap <buffer> <silent> i :call <SID>NetLongList(1)<cr>
|
nnoremap <buffer> <silent> i :call <SID>NetLongList(1)<cr>
|
||||||
nnoremap <buffer> <silent> o :call <SID>NetSplit(2)<cr>
|
nnoremap <buffer> <silent> o :call <SID>NetSplit(2)<cr>
|
||||||
nnoremap <buffer> <silent> p :exe "norm! 0"<bar>call <SID>LocalPreview(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord(),1))<cr>
|
nnoremap <buffer> <silent> O :call <SID>LocalObtain()<cr>
|
||||||
|
nnoremap <buffer> <silent> p :call <SID>LocalPreview(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord(),1))<cr>
|
||||||
nnoremap <buffer> <silent> q :<c-u>call <SID>NetBookmarkDir(2,b:netrw_curdir)<cr>
|
nnoremap <buffer> <silent> q :<c-u>call <SID>NetBookmarkDir(2,b:netrw_curdir)<cr>
|
||||||
nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>LocalRefresh(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<cr>
|
nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>LocalRefresh(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<cr>
|
||||||
nnoremap <buffer> <silent> s :call <SID>NetSaveWordPosn()<bar>let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'<bar>exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<bar>call <SID>NetRestoreWordPosn()<cr>
|
nnoremap <buffer> <silent> s :call <SID>NetSaveWordPosn()<bar>let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'<bar>exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<bar>call <SID>NetRestoreWordPosn()<cr>
|
||||||
@ -2279,15 +2503,15 @@ fun! netrw#DirBrowse(dirname)
|
|||||||
nnoremap <buffer> <silent> u :<c-u>call <SID>NetBookmarkDir(4,expand("%"))<cr>
|
nnoremap <buffer> <silent> u :<c-u>call <SID>NetBookmarkDir(4,expand("%"))<cr>
|
||||||
nnoremap <buffer> <silent> U :<c-u>call <SID>NetBookmarkDir(5,expand("%"))<cr>
|
nnoremap <buffer> <silent> U :<c-u>call <SID>NetBookmarkDir(5,expand("%"))<cr>
|
||||||
nnoremap <buffer> <silent> v :call <SID>NetSplit(3)<cr>
|
nnoremap <buffer> <silent> v :call <SID>NetSplit(3)<cr>
|
||||||
nnoremap <buffer> <silent> x :exe "norm! 0"<bar>call <SID>NetBrowseX(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord(),0),0)<cr>
|
nnoremap <buffer> <silent> x :call <SID>NetBrowseX(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord(),0),0)"<cr>
|
||||||
nnoremap <buffer> <silent> <2-leftmouse> :exe "norm! 0"<bar>call <SID>LocalRefresh(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))<cr>
|
nnoremap <buffer> <silent> <2-leftmouse> :call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))<cr>
|
||||||
nnoremap <buffer> <silent> <s-up> :Pexplore<cr>
|
nnoremap <buffer> <silent> <s-up> :Pexplore<cr>
|
||||||
nnoremap <buffer> <silent> <s-down> :Nexplore<cr>
|
nnoremap <buffer> <silent> <s-down> :Nexplore<cr>
|
||||||
exe 'nnoremap <buffer> <silent> <del> :exe "norm! 0"<bar>call <SID>LocalBrowseRm("'.b:netrw_curdir.'")<cr>'
|
exe 'nnoremap <buffer> <silent> <del> :call <SID>LocalBrowseRm("'.b:netrw_curdir.'")<cr>'
|
||||||
exe 'vnoremap <buffer> <silent> <del> :call <SID>LocalBrowseRm("'.b:netrw_curdir.'")<cr>'
|
exe 'vnoremap <buffer> <silent> <del> :call <SID>LocalBrowseRm("'.b:netrw_curdir.'")<cr>'
|
||||||
exe 'nnoremap <buffer> <silent> D :exe "norm! 0"<bar>call <SID>LocalBrowseRm("'.b:netrw_curdir.'")<cr>'
|
exe 'nnoremap <buffer> <silent> D :call <SID>LocalBrowseRm("'.b:netrw_curdir.'")<cr>'
|
||||||
exe 'vnoremap <buffer> <silent> D :call <SID>LocalBrowseRm("'.b:netrw_curdir.'")<cr>'
|
exe 'vnoremap <buffer> <silent> D :call <SID>LocalBrowseRm("'.b:netrw_curdir.'")<cr>'
|
||||||
exe 'nnoremap <buffer> <silent> R :exe "norm! 0"<bar>call <SID>LocalBrowseRename("'.b:netrw_curdir.'")<cr>'
|
exe 'nnoremap <buffer> <silent> R :call <SID>LocalBrowseRename("'.b:netrw_curdir.'")<cr>'
|
||||||
exe 'vnoremap <buffer> <silent> R :call <SID>LocalBrowseRename("'.b:netrw_curdir.'")<cr>'
|
exe 'vnoremap <buffer> <silent> R :call <SID>LocalBrowseRename("'.b:netrw_curdir.'")<cr>'
|
||||||
exe 'nnoremap <buffer> <silent> <Leader>m :call <SID>NetMakeDir("")<cr>'
|
exe 'nnoremap <buffer> <silent> <Leader>m :call <SID>NetMakeDir("")<cr>'
|
||||||
nnoremap <buffer> ? :he netrw-dir<cr>
|
nnoremap <buffer> ? :he netrw-dir<cr>
|
||||||
@ -2357,30 +2581,30 @@ fun! netrw#DirBrowse(dirname)
|
|||||||
if g:netrw_sort_by =~ "^n"
|
if g:netrw_sort_by =~ "^n"
|
||||||
call s:SetSort()
|
call s:SetSort()
|
||||||
|
|
||||||
if v:version < 700
|
if g:netrw_sort_direction =~ 'n'
|
||||||
exe 'keepjumps silent '.w:netrw_bannercnt.',$call s:NetSort()'
|
exe 'silent keepjumps '.w:netrw_bannercnt.',$sort'
|
||||||
elseif g:netrw_sort_direction =~ 'n'
|
|
||||||
exe 'keepjumps silent '.w:netrw_bannercnt.',$sort'
|
|
||||||
else
|
else
|
||||||
exe 'keepjumps silent '.w:netrw_bannercnt.',$sort!'
|
exe 'silent keepjumps '.w:netrw_bannercnt.',$sort!'
|
||||||
endif
|
endif
|
||||||
exe 'keepjumps silent '.w:netrw_bannercnt.',$s/^\d\{3}\///e'
|
exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\d\{3}\///e'
|
||||||
|
|
||||||
else
|
else
|
||||||
if v:version < 700
|
if g:netrw_sort_direction =~ 'n'
|
||||||
exe 'keepjumps silent '.w:netrw_bannercnt.',$call s:NetSort()'
|
exe 'silent keepjumps '.w:netrw_bannercnt.',$sort'
|
||||||
elseif g:netrw_sort_direction =~ 'n'
|
|
||||||
exe 'keepjumps silent '.w:netrw_bannercnt.',$sort'
|
|
||||||
else
|
else
|
||||||
exe 'keepjumps silent '.w:netrw_bannercnt.',$sort!'
|
exe 'silent keepjumps '.w:netrw_bannercnt.',$sort!'
|
||||||
endif
|
endif
|
||||||
exe 'keepjumps silent '.w:netrw_bannercnt.',$s/^\d\{-}\///e'
|
exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\d\{-}\///e'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
call s:NetrwWideListing()
|
||||||
if exists("w:netrw_bannercnt") && line("$") > w:netrw_bannercnt
|
if exists("w:netrw_bannercnt") && line("$") > w:netrw_bannercnt
|
||||||
exe w:netrw_bannercnt
|
" place cursor on the top-left corner of the file listing
|
||||||
|
exe 'silent '.w:netrw_bannercnt
|
||||||
|
norm! 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" record previous current directory
|
" record previous current directory
|
||||||
@ -2427,6 +2651,7 @@ fun! s:LocalBrowseList()
|
|||||||
" call Decho("filelist<".filelist.">")
|
" call Decho("filelist<".filelist.">")
|
||||||
endif
|
endif
|
||||||
let filelist= substitute(filelist,'\n\{2,}','\n','ge')
|
let filelist= substitute(filelist,'\n\{2,}','\n','ge')
|
||||||
|
let filelist= substitute(filelist,'\','/','ge')
|
||||||
|
|
||||||
" call Decho("dirname<".dirname.">")
|
" call Decho("dirname<".dirname.">")
|
||||||
" call Decho("dirnamelen<".dirnamelen.">")
|
" call Decho("dirnamelen<".dirnamelen.">")
|
||||||
@ -2453,14 +2678,10 @@ fun! s:LocalBrowseList()
|
|||||||
" call Decho("filename<".filename.">")
|
" call Decho("filename<".filename.">")
|
||||||
" call Decho("pfile <".pfile.">")
|
" call Decho("pfile <".pfile.">")
|
||||||
|
|
||||||
if g:netrw_longlist
|
if w:netrw_longlist == 1
|
||||||
let sz = getfsize(filename)
|
let sz = getfsize(filename)
|
||||||
if v:version <= 700
|
let fsz = strpart(" ",1,15-strlen(sz)).sz
|
||||||
let fsz = strpart(" ",1,15-strlen(sz)).sz
|
let pfile= pfile."\t".fsz." ".strftime(g:netrw_timefmt,getftime(filename))
|
||||||
let pfile= pfile."\t".fsz." ".strftime(g:netrw_timefmt,getftime(filename))
|
|
||||||
else
|
|
||||||
let pfile= printf('%-'.g:netrw_maxfilenamelen.'s%15d%s',pfile,sz,getftime(filename))
|
|
||||||
endif
|
|
||||||
" call Decho("sz=".sz." fsz=".fsz)
|
" call Decho("sz=".sz." fsz=".fsz)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -2490,7 +2711,7 @@ fun! s:LocalBrowseList()
|
|||||||
endwhile
|
endwhile
|
||||||
|
|
||||||
" cleanup any windows mess at end-of-line
|
" cleanup any windows mess at end-of-line
|
||||||
keepjumps silent! %s/\r$//e
|
silent! keepjumps %s/\r$//e
|
||||||
setlocal ts=32
|
setlocal ts=32
|
||||||
|
|
||||||
" call Dret("LocalBrowseList")
|
" call Dret("LocalBrowseList")
|
||||||
@ -2521,6 +2742,7 @@ fun! s:LocalBrowseChgDir(dirname,newdir,...)
|
|||||||
" call Decho("dirname<".dirname."> netrw_cd_escape<".s:netrw_cd_escape.">")
|
" call Decho("dirname<".dirname."> netrw_cd_escape<".s:netrw_cd_escape.">")
|
||||||
" call Decho("about to edit<".escape(dirname,s:netrw_cd_escape).">")
|
" call Decho("about to edit<".escape(dirname,s:netrw_cd_escape).">")
|
||||||
exe "e! ".escape(dirname,s:netrw_cd_escape)
|
exe "e! ".escape(dirname,s:netrw_cd_escape)
|
||||||
|
set ma nomod
|
||||||
endif
|
endif
|
||||||
|
|
||||||
elseif newdir == './'
|
elseif newdir == './'
|
||||||
@ -2620,11 +2842,11 @@ fun! s:LocalBrowseRm(path) range
|
|||||||
if errcode != 0
|
if errcode != 0
|
||||||
if has("unix")
|
if has("unix")
|
||||||
" call Decho("3rd attempt to remove directory<".rmfile.">")
|
" call Decho("3rd attempt to remove directory<".rmfile.">")
|
||||||
call system("rm ".rmfile)
|
call system("rm ".rmfile)
|
||||||
if v:shell_error != 0 && !exists("g:netrw_quiet")
|
if v:shell_error != 0 && !exists("g:netrw_quiet")
|
||||||
echohl Error | echo "***netrw*** unable to remove directory<".rmfile."> -- is it empty?" | echohl None
|
echohl Error | echo "***netrw*** unable to remove directory<".rmfile."> -- is it empty?" | echohl None
|
||||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||||
endif
|
endif
|
||||||
elseif !exists("g:netrw_quiet")
|
elseif !exists("g:netrw_quiet")
|
||||||
echohl Error | echo "***netrw*** unable to remove directory<".rmfile."> -- is it empty?" | echohl None
|
echohl Error | echo "***netrw*** unable to remove directory<".rmfile."> -- is it empty?" | echohl None
|
||||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||||
@ -2694,6 +2916,24 @@ fun! s:LocalBrowseRename(path) range
|
|||||||
" call Dret("LocalBrowseRename")
|
" call Dret("LocalBrowseRename")
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" LocalObtain: copy selected file to current working directory {{{2
|
||||||
|
fun! s:LocalObtain()
|
||||||
|
" call Dfunc("LocalObtain()")
|
||||||
|
if exists("b:netrw_curdir") && getcwd() != b:netrw_curdir
|
||||||
|
let fname= expand("<cWORD>")
|
||||||
|
let fcopy= readfile(b:netrw_curdir."/".fname,"b")
|
||||||
|
call writefile(fcopy,getcwd()."/".fname,"b")
|
||||||
|
elseif !exists("b:netrw_curdir")
|
||||||
|
echohl Error | echo "***netrw*** local browsing directory doesn't exist!"
|
||||||
|
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||||
|
else
|
||||||
|
echohl Error | echo "***netrw*** local browsing directory and current directory are identical"
|
||||||
|
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||||
|
endif
|
||||||
|
" call Dret("LocalObtain")
|
||||||
|
endfun
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" LocalPreview: {{{2
|
" LocalPreview: {{{2
|
||||||
fun! s:LocalPreview(path) range
|
fun! s:LocalPreview(path) range
|
||||||
@ -2778,7 +3018,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
|
|||||||
elseif a:1 =~ '\*\*/' || a:indx < 0
|
elseif a:1 =~ '\*\*/' || a:indx < 0
|
||||||
" Nexplore Pexplore -or- Explore **/...
|
" Nexplore Pexplore -or- Explore **/...
|
||||||
|
|
||||||
if has("path_extra") && v:version >= 700
|
if has("path_extra")
|
||||||
if !exists("w:netrw_explore_indx")
|
if !exists("w:netrw_explore_indx")
|
||||||
let w:netrw_explore_indx= 0
|
let w:netrw_explore_indx= 0
|
||||||
endif
|
endif
|
||||||
@ -2804,8 +3044,8 @@ fun! netrw#Explore(indx,dosplit,style,...)
|
|||||||
|
|
||||||
" NetrwStatusLine support
|
" NetrwStatusLine support
|
||||||
let w:netrw_explore_indx= indx
|
let w:netrw_explore_indx= indx
|
||||||
if !exists("s:netrw_explore_stl")
|
if !exists("s:netrw_users_stl")
|
||||||
let s:netrw_explore_stl= &stl
|
let s:netrw_users_stl= &stl
|
||||||
endif
|
endif
|
||||||
set stl=%f\ %h%m%r%=%{NetrwStatusLine()}
|
set stl=%f\ %h%m%r%=%{NetrwStatusLine()}
|
||||||
" call Decho("explorelist<".join(w:netrw_explore_list,',')."> len=".w:netrw_explore_listlen)
|
" call Decho("explorelist<".join(w:netrw_explore_list,',')."> len=".w:netrw_explore_listlen)
|
||||||
@ -2832,9 +3072,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
|
|||||||
" call Decho("explore: mtchcnt=".w:netrw_explore_mtchcnt." bufnr=".w:netrw_explore_bufnr." line#".w:netrw_explore_line)
|
" call Decho("explore: mtchcnt=".w:netrw_explore_mtchcnt." bufnr=".w:netrw_explore_bufnr." line#".w:netrw_explore_line)
|
||||||
|
|
||||||
else
|
else
|
||||||
if v:version < 700
|
if !exists("g:netrw_quiet")
|
||||||
echohl WarningMsg | echo "***netrw*** you need vim version 7.0 or later for Exploring with **!" | echohl None
|
|
||||||
elseif !exists("g:netrw_quiet")
|
|
||||||
echohl WarningMsg | echo "***netrw*** your vim needs the +path_extra feature for Exploring with **!" | echohl None | echohl None
|
echohl WarningMsg | echo "***netrw*** your vim needs the +path_extra feature for Exploring with **!" | echohl None | echohl None
|
||||||
endif
|
endif
|
||||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||||
@ -2854,7 +3092,8 @@ endfun
|
|||||||
fun! NetrwStatusLine()
|
fun! NetrwStatusLine()
|
||||||
" let g:stlmsg= "Xbufnr=".w:netrw_explore_bufnr." bufnr=".bufnr(".")." Xline#".w:netrw_explore_line." line#".line(".")
|
" let g:stlmsg= "Xbufnr=".w:netrw_explore_bufnr." bufnr=".bufnr(".")." Xline#".w:netrw_explore_line." line#".line(".")
|
||||||
if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr(".") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list")
|
if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr(".") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list")
|
||||||
let &stl= s:netrw_explore_stl
|
" restore user's status line
|
||||||
|
let &stl= s:netrw_users_stl
|
||||||
if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif
|
if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif
|
||||||
if exists("w:netrw_explore_line")|unlet w:netrw_explore_line|endif
|
if exists("w:netrw_explore_line")|unlet w:netrw_explore_line|endif
|
||||||
return ""
|
return ""
|
||||||
@ -2940,7 +3179,7 @@ fun! s:NetMethod(choice) " globals: method machine id passwd fname
|
|||||||
" scp://user@hostname/...path-to-file
|
" scp://user@hostname/...path-to-file
|
||||||
elseif match(a:choice,scpurm) == 0
|
elseif match(a:choice,scpurm) == 0
|
||||||
" call Decho("scp://...")
|
" call Decho("scp://...")
|
||||||
let b:netrw_method = 4
|
let b:netrw_method = 4
|
||||||
let g:netrw_machine = substitute(a:choice,scpurm,'\1',"")
|
let g:netrw_machine = substitute(a:choice,scpurm,'\1',"")
|
||||||
let g:netrw_port = substitute(a:choice,scpurm,'\2',"")
|
let g:netrw_port = substitute(a:choice,scpurm,'\2',"")
|
||||||
let b:netrw_fname = substitute(a:choice,scpurm,'\3',"")
|
let b:netrw_fname = substitute(a:choice,scpurm,'\3',"")
|
||||||
@ -2973,7 +3212,7 @@ fun! s:NetMethod(choice) " globals: method machine id passwd fname
|
|||||||
" ftp://[user@]hostname[[:#]port]/...path-to-file
|
" ftp://[user@]hostname[[:#]port]/...path-to-file
|
||||||
elseif match(a:choice,ftpurm) == 0
|
elseif match(a:choice,ftpurm) == 0
|
||||||
" call Decho("ftp://...")
|
" call Decho("ftp://...")
|
||||||
let userid = substitute(a:choice,ftpurm,'\2',"")
|
let userid = substitute(a:choice,ftpurm,'\2',"")
|
||||||
let g:netrw_machine= substitute(a:choice,ftpurm,'\3',"")
|
let g:netrw_machine= substitute(a:choice,ftpurm,'\3',"")
|
||||||
let g:netrw_port = substitute(a:choice,ftpurm,'\4',"")
|
let g:netrw_port = substitute(a:choice,ftpurm,'\4',"")
|
||||||
let b:netrw_fname = substitute(a:choice,ftpurm,'\5',"")
|
let b:netrw_fname = substitute(a:choice,ftpurm,'\5',"")
|
||||||
@ -3107,6 +3346,12 @@ fun! NetUserPass(...)
|
|||||||
" call Decho("a:0=".a:0." case >1: a:2<".a:2.">")
|
" call Decho("a:0=".a:0." case >1: a:2<".a:2.">")
|
||||||
let g:netrw_passwd=a:2
|
let g:netrw_passwd=a:2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" surround password with double-quotes if it contains embedded blanks
|
||||||
|
if g:netrw_passwd !~ '^"' && g:netrw_passwd =~ ' '
|
||||||
|
let g:netrw_passwd= '"'.g:netrw_passwd.'"'
|
||||||
|
endif
|
||||||
|
|
||||||
" call Dret("NetUserPass")
|
" call Dret("NetUserPass")
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
@ -3158,27 +3403,26 @@ endfun
|
|||||||
fun! s:NetOptionRestore()
|
fun! s:NetOptionRestore()
|
||||||
" call Dfunc("NetOptionRestore()")
|
" call Dfunc("NetOptionRestore()")
|
||||||
if !exists("w:netoptionsave")
|
if !exists("w:netoptionsave")
|
||||||
" call Dret("NetOptionRestore : netoptionsave=".w:netoptionsave)
|
" call Dret("NetOptionRestore : w:netoptionsave doesn't exist")
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
unlet w:netoptionsave
|
unlet w:netoptionsave
|
||||||
|
|
||||||
let &ai = w:aikeep
|
if exists("w:aikeep")| let &ai= w:aikeep|endif
|
||||||
if has("netbeans_intg") || has("sun_workshop")
|
if (has("netbeans_intg") || has("sun_workshop")) && exists("w:acdkeep")
|
||||||
let &acd = w:acdkeep
|
let &acd= w:acdkeep
|
||||||
|
unlet w:acdkeep
|
||||||
endif
|
endif
|
||||||
let &cin = w:cinkeep
|
if exists("w:cinkeep") |let &cin = w:cinkeep |unlet w:cinkeep |endif
|
||||||
let &cino = w:cinokeep
|
if exists("w:cinokeep")|let &cino = w:cinokeep|unlet w:cinokeep|endif
|
||||||
let &com = w:comkeep
|
if exists("w:comkeep") |let &com = w:comkeep |unlet w:comkeep |endif
|
||||||
let &cpo = w:cpokeep
|
if exists("w:cpokeep") |let &cpo = w:cpokeep |unlet w:cpokeep |endif
|
||||||
if exists("w:dirkeep")
|
if exists("w:dirkeep") |exe "lcd ".w:dirkeep |unlet w:dirkeep |endif
|
||||||
exe "lcd ".w:dirkeep
|
if exists("w:gdkeep") |let &gd = w:gdkeep |unlet w:gdkeep |endif
|
||||||
endif
|
if exists("w:repkeep") |let &report = w:repkeep |unlet w:repkeep |endif
|
||||||
let &gd = w:gdkeep
|
if exists("w:twkeep") |let &tw = w:twkeep |unlet w:twkeep |endif
|
||||||
let &report = w:repkeep
|
|
||||||
let &tw = w:twkeep
|
|
||||||
if exists("w:swfkeep")
|
if exists("w:swfkeep")
|
||||||
if &directory == ""
|
if &directory == "" && exists("w:swfkeep")
|
||||||
" user hasn't specified a swapfile directory;
|
" user hasn't specified a swapfile directory;
|
||||||
" netrw will temporarily make the swapfile
|
" netrw will temporarily make the swapfile
|
||||||
" directory the current local one.
|
" directory the current local one.
|
||||||
@ -3190,17 +3434,6 @@ fun! s:NetOptionRestore()
|
|||||||
endif
|
endif
|
||||||
unlet w:swfkeep
|
unlet w:swfkeep
|
||||||
endif
|
endif
|
||||||
unlet w:aikeep
|
|
||||||
unlet w:cinkeep
|
|
||||||
unlet w:cinokeep
|
|
||||||
unlet w:comkeep
|
|
||||||
unlet w:cpokeep
|
|
||||||
unlet w:gdkeep
|
|
||||||
unlet w:repkeep
|
|
||||||
unlet w:twkeep
|
|
||||||
if exists("w:dirkeep")
|
|
||||||
unlet w:dirkeep
|
|
||||||
endif
|
|
||||||
|
|
||||||
" call Dret("NetOptionRestore")
|
" call Dret("NetOptionRestore")
|
||||||
endfun
|
endfun
|
||||||
@ -3212,7 +3445,7 @@ endfun
|
|||||||
" example and as a fix for a Windows 95 problem: in my
|
" example and as a fix for a Windows 95 problem: in my
|
||||||
" experience, win95's ftp always dumped four blank lines
|
" experience, win95's ftp always dumped four blank lines
|
||||||
" at the end of the transfer.
|
" at the end of the transfer.
|
||||||
if has("win95") && g:netrw_win95ftp
|
if has("win95") && exists("g:netrw_win95ftp") && g:netrw_win95ftp
|
||||||
fun! NetReadFixup(method, line1, line2)
|
fun! NetReadFixup(method, line1, line2)
|
||||||
" call Dfunc("NetReadFixup(method<".a:method."> line1=".a:line1." line2=".a:line2.")")
|
" call Dfunc("NetReadFixup(method<".a:method."> line1=".a:line1." line2=".a:line2.")")
|
||||||
if method == 3 " ftp (no <.netrc>)
|
if method == 3 " ftp (no <.netrc>)
|
||||||
@ -3276,7 +3509,7 @@ endif
|
|||||||
" front. An "*" pattern handles the default priority.
|
" front. An "*" pattern handles the default priority.
|
||||||
fun! s:SetSort()
|
fun! s:SetSort()
|
||||||
" call Dfunc("SetSort() bannercnt=".w:netrw_bannercnt)
|
" call Dfunc("SetSort() bannercnt=".w:netrw_bannercnt)
|
||||||
if g:netrw_longlist
|
if w:netrw_longlist == 1
|
||||||
let seqlist = substitute(g:netrw_sort_sequence,'\$','\\%(\t\\|\$\\)','ge')
|
let seqlist = substitute(g:netrw_sort_sequence,'\$','\\%(\t\\|\$\\)','ge')
|
||||||
else
|
else
|
||||||
let seqlist = g:netrw_sort_sequence
|
let seqlist = g:netrw_sort_sequence
|
||||||
@ -3313,14 +3546,14 @@ fun! s:SetSort()
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
if seq == '*'
|
if seq == '*'
|
||||||
exe 'keepjumps silent '.w:netrw_bannercnt.',$v/^\d\{3}\//s/^/'.spriority.'/'
|
exe 'silent keepjumps '.w:netrw_bannercnt.',$v/^\d\{3}\//s/^/'.spriority.'/'
|
||||||
else
|
else
|
||||||
exe 'keepjumps silent '.w:netrw_bannercnt.',$g/'.eseq.'/s/^/'.spriority.'/'
|
exe 'silent keepjumps '.w:netrw_bannercnt.',$g/'.eseq.'/s/^/'.spriority.'/'
|
||||||
endif
|
endif
|
||||||
let priority = priority + 1
|
let priority = priority + 1
|
||||||
endwhile
|
endwhile
|
||||||
|
|
||||||
exe 'keepjumps silent '.w:netrw_bannercnt.',$s/^\(\d\{3}\/\)\%(\d\{3}\/\)\+/\1/e'
|
exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\(\d\{3}\/\)\%(\d\{3}\/\)\+/\1/e'
|
||||||
|
|
||||||
" call Dret("SetSort")
|
" call Dret("SetSort")
|
||||||
endfun
|
endfun
|
||||||
@ -3366,6 +3599,7 @@ endfun
|
|||||||
" UseBufWinVars() get around that.
|
" UseBufWinVars() get around that.
|
||||||
fun! s:BufWinVars()
|
fun! s:BufWinVars()
|
||||||
" call Dfunc("BufWinVars()")
|
" call Dfunc("BufWinVars()")
|
||||||
|
if exists("w:netrw_longlist") |let b:netrw_longlist = w:netrw_longlist |endif
|
||||||
if exists("w:netrw_bannercnt") |let b:netrw_bannercnt = w:netrw_bannercnt |endif
|
if exists("w:netrw_bannercnt") |let b:netrw_bannercnt = w:netrw_bannercnt |endif
|
||||||
if exists("w:netrw_method") |let b:netrw_method = w:netrw_method |endif
|
if exists("w:netrw_method") |let b:netrw_method = w:netrw_method |endif
|
||||||
if exists("w:netrw_prvdir") |let b:netrw_prvdir = w:netrw_prvdir |endif
|
if exists("w:netrw_prvdir") |let b:netrw_prvdir = w:netrw_prvdir |endif
|
||||||
@ -3383,6 +3617,7 @@ endfun
|
|||||||
" Matching function to BufferWinVars()
|
" Matching function to BufferWinVars()
|
||||||
fun! s:UseBufWinVars()
|
fun! s:UseBufWinVars()
|
||||||
" call Dfunc("UseBufWinVars()")
|
" call Dfunc("UseBufWinVars()")
|
||||||
|
if exists("b:netrw_longlist") && !exists("w:netrw_longlist") |let w:netrw_longlist = b:netrw_longlist |endif
|
||||||
if exists("b:netrw_bannercnt") && !exists("w:netrw_bannercnt") |let w:netrw_bannercnt = b:netrw_bannercnt |endif
|
if exists("b:netrw_bannercnt") && !exists("w:netrw_bannercnt") |let w:netrw_bannercnt = b:netrw_bannercnt |endif
|
||||||
if exists("b:netrw_method") && !exists("w:netrw_method") |let w:netrw_method = b:netrw_method |endif
|
if exists("b:netrw_method") && !exists("w:netrw_method") |let w:netrw_method = b:netrw_method |endif
|
||||||
if exists("b:netrw_prvdir") && !exists("w:netrw_prvdir") |let w:netrw_prvdir = b:netrw_prvdir |endif
|
if exists("b:netrw_prvdir") && !exists("w:netrw_prvdir") |let w:netrw_prvdir = b:netrw_prvdir |endif
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
*eval.txt* For Vim version 7.0aa. Last change: 2005 Sep 09
|
*eval.txt* For Vim version 7.0aa. Last change: 2005 Sep 10
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@ -2957,6 +2957,21 @@ inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()*
|
|||||||
Hitting <Enter> works like pressing the OK button. Hitting
|
Hitting <Enter> works like pressing the OK button. Hitting
|
||||||
<Esc> works like pressing the Cancel button.
|
<Esc> works like pressing the Cancel button.
|
||||||
|
|
||||||
|
inputlist({textlist}) *inputlist()*
|
||||||
|
{textlist} must be a list of strings. This list is displayed,
|
||||||
|
one string per line. The user will be prompted to enter a
|
||||||
|
number, which is returned.
|
||||||
|
The user can also select an item by clicking on it with the
|
||||||
|
mouse. For the first string 0 is returned. When clicking
|
||||||
|
above the first item a negative number is returned. When
|
||||||
|
clicking on the prompt one more than the length of {textlist}
|
||||||
|
is returned.
|
||||||
|
Make sure {textlist} has less then 'lines' entries, otherwise
|
||||||
|
it won't work. It's a good idea to put the entry number at
|
||||||
|
the start of the string. Example: >
|
||||||
|
let color = inputlist(['Select color:', '1. red',
|
||||||
|
\ '2. green', '3. blue'])
|
||||||
|
|
||||||
inputrestore() *inputrestore()*
|
inputrestore() *inputrestore()*
|
||||||
Restore typeahead that was saved with a previous inputsave().
|
Restore typeahead that was saved with a previous inputsave().
|
||||||
Should be called the same number of times inputsave() is
|
Should be called the same number of times inputsave() is
|
||||||
@ -4299,7 +4314,7 @@ taglist({expr}) *taglist()*
|
|||||||
located by Vim. Refer to |tags-file-format| for the format of
|
located by Vim. Refer to |tags-file-format| for the format of
|
||||||
the tags file generated by the different ctags tools.
|
the tags file generated by the different ctags tools.
|
||||||
|
|
||||||
*tagfiles*
|
*tagfiles()*
|
||||||
tagfiles() Returns a List with the file names used to search for tags for
|
tagfiles() Returns a List with the file names used to search for tags for
|
||||||
the current buffer. This is the 'tags' option expanded.
|
the current buffer. This is the 'tags' option expanded.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
*fold.txt* For Vim version 7.0aa. Last change: 2005 Mar 29
|
*fold.txt* For Vim version 7.0aa. Last change: 2005 Sep 10
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@ -512,7 +512,8 @@ FOLDCOLUMN *fold-foldcolumn*
|
|||||||
|
|
||||||
'foldcolumn' is a number, which sets the width for a column on the side of the
|
'foldcolumn' is a number, which sets the width for a column on the side of the
|
||||||
window to indicate folds. When it is zero, there is no foldcolumn. A normal
|
window to indicate folds. When it is zero, there is no foldcolumn. A normal
|
||||||
value is 4 or 5. The minimal useful value is 2. The maximum is 12.
|
value is 4 or 5. The minimal useful value is 2, although 1 still provides
|
||||||
|
some information. The maximum is 12.
|
||||||
|
|
||||||
An open fold is indicated with a column that has a '-' at the top and '|'
|
An open fold is indicated with a column that has a '-' at the top and '|'
|
||||||
characters below it. This column stops where the open fold stops. When folds
|
characters below it. This column stops where the open fold stops. When folds
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
*insert.txt* For Vim version 7.0aa. Last change: 2005 Sep 01
|
*insert.txt* For Vim version 7.0aa. Last change: 2005 Sep 10
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@ -888,6 +888,7 @@ Completion is done by a function that can be defined by the user with the
|
|||||||
'occultfunc' option. This is to be used for filetype-specific completion.
|
'occultfunc' option. This is to be used for filetype-specific completion.
|
||||||
|
|
||||||
See the 'completefunc' help for how the function is called and an example.
|
See the 'completefunc' help for how the function is called and an example.
|
||||||
|
For remarks about specific filetypes see |compl-occult-filetypes|.
|
||||||
|
|
||||||
*i_CTRL-X_CTRL-O*
|
*i_CTRL-X_CTRL-O*
|
||||||
CTRL-X CTRL-O Guess what kind of item is in front of the cursor and
|
CTRL-X CTRL-O Guess what kind of item is in front of the cursor and
|
||||||
@ -947,6 +948,37 @@ CTRL-P Find previous match for words that start with the
|
|||||||
copy the words following the previous expansion in
|
copy the words following the previous expansion in
|
||||||
other contexts unless a double CTRL-X is used.
|
other contexts unless a double CTRL-X is used.
|
||||||
|
|
||||||
|
|
||||||
|
Filetype-specific remarks for occult completion *compl-occult-filetypes*
|
||||||
|
|
||||||
|
C *ft-c-occult*
|
||||||
|
|
||||||
|
Completion requires a tags file. You should use Exuberant ctags, because it
|
||||||
|
adds extra information that is needed for completion. You can find it here:
|
||||||
|
http://ctags.sourceforge.net/
|
||||||
|
For version 5.5.4 you need to add a patch that adds the "typename:" field:
|
||||||
|
ftp://ftp.vim.org/pub/vim/unstable/patches/ctags-5.5.4.patch
|
||||||
|
|
||||||
|
If you want to complete system functions you can do something like this. Use
|
||||||
|
ctags to generate a tags file for all the system header files: >
|
||||||
|
% ctags -R -f ~/.vim/systags /usr/include /usr/local/include
|
||||||
|
In your vimrc file add this tags file to the 'tags' option: >
|
||||||
|
set tags+=~/.vim/systags
|
||||||
|
|
||||||
|
When using CTRL-X CTRL-O after a name without any "." or "->" it is completed
|
||||||
|
from the tags file directly. This works for any identifier, also function
|
||||||
|
names. If you want to complete a local variable name, which does not appear
|
||||||
|
in the tags file, use CTRL-P instead.
|
||||||
|
|
||||||
|
When using CTRL-X CTRL-O after something that has "." or "->" Vim will attempt
|
||||||
|
to recognize the type of the variable and figure out what members it has.
|
||||||
|
This means only members valid for the variable will be listed.
|
||||||
|
|
||||||
|
Vim doesn't include a C compiler, only the most obviously formatted
|
||||||
|
declarations are recognized. Preprocessor stuff may cause confusion.
|
||||||
|
When the same structure name appears in multiple places all possible members
|
||||||
|
are included.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
8. Insert mode commands *inserting*
|
8. Insert mode commands *inserting*
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
*options.txt* For Vim version 7.0aa. Last change: 2005 Sep 08
|
*options.txt* For Vim version 7.0aa. Last change: 2005 Sep 10
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@ -560,12 +560,20 @@ is entered, this is almost like having global options. If 's' and 'S' are not
|
|||||||
present, the options are copied from the currently active buffer when the
|
present, the options are copied from the currently active buffer when the
|
||||||
buffer is created.
|
buffer is created.
|
||||||
|
|
||||||
Not all options are supported in all versions. To test if option "foo" can be
|
Hidden options *hidden-options*
|
||||||
used with ":set" use "exists('&foo')". This doesn't mean the value is
|
|
||||||
actually remembered and works. Some options are hidden, which means that you
|
|
||||||
can set them but the value is not remembered. To test if option "foo" is
|
|
||||||
really supported use "exists('+foo')".
|
|
||||||
|
|
||||||
|
Not all options are supported in all versions. This depends on the supported
|
||||||
|
features and sometimes on the system. A remark about this is in curly braces
|
||||||
|
below. When an option is not supported it may still be set without getting an
|
||||||
|
error, this is called a hidden option. You can't get the value of a hidden
|
||||||
|
option though, it is not stored.
|
||||||
|
|
||||||
|
To test if option "foo" can be used with ":set" use something like this: >
|
||||||
|
if exists('&foo')
|
||||||
|
This also returns true for a hidden option. To test if option "foo" is really
|
||||||
|
supported use something like this: >
|
||||||
|
if exists('+foo')
|
||||||
|
<
|
||||||
*E355*
|
*E355*
|
||||||
A jump table for the options with a short description can be found at |Q_op|.
|
A jump table for the options with a short description can be found at |Q_op|.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
*pi_netrw.txt* For Vim version 7.0. Last change: Aug 15, 2005
|
*pi_netrw.txt* For Vim version 7.0. Last change: Sep 07, 2005
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Charles E. Campbell, Jr.
|
VIM REFERENCE MANUAL by Charles E. Campbell, Jr.
|
||||||
@ -25,7 +25,7 @@
|
|||||||
4. Transparent File Transfer............................|netrw-transparent|
|
4. Transparent File Transfer............................|netrw-transparent|
|
||||||
5. Ex Commands..........................................|netrw-ex|
|
5. Ex Commands..........................................|netrw-ex|
|
||||||
6. Variables and Options................................|netrw-var|
|
6. Variables and Options................................|netrw-var|
|
||||||
7. Directory Browser....................................|netrw-browse| {{{1
|
7. Directory Browsing...................................|netrw-browse| {{{1
|
||||||
Maps...............................................|netrw-maps|
|
Maps...............................................|netrw-maps|
|
||||||
Exploring..........................................|netrw-explore-cmds|
|
Exploring..........................................|netrw-explore-cmds|
|
||||||
Quick Reference Commands Table.....................|netrw-browse-cmds|
|
Quick Reference Commands Table.....................|netrw-browse-cmds|
|
||||||
@ -35,11 +35,12 @@
|
|||||||
Refreshing The Listing.............................|netrw-ctrl-l|
|
Refreshing The Listing.............................|netrw-ctrl-l|
|
||||||
Going Up...........................................|netrw--|
|
Going Up...........................................|netrw--|
|
||||||
Browsing...........................................|netrw-cr|
|
Browsing...........................................|netrw-cr|
|
||||||
Long Vs Short Listing..............................|netrw-i|
|
Obtaining A File...................................|netrw-O|
|
||||||
|
Thin, Long, and Wide Listings......................|netrw-i|
|
||||||
Making A New Directory.............................|netrw-d|
|
Making A New Directory.............................|netrw-d|
|
||||||
Deleting Files Or Directories......................|netrw-delete|
|
Deleting Files Or Directories......................|netrw-delete|
|
||||||
Renaming Files Or Directories......................|netrw-move|
|
Renaming Files Or Directories......................|netrw-move|
|
||||||
Hiding Files Or Directories........................|g:netrw-a|
|
Hiding Files Or Directories........................|netrw-a|
|
||||||
Edit File Or Directory Hiding List.................|netrw-h|
|
Edit File Or Directory Hiding List.................|netrw-h|
|
||||||
Browsing With A Horizontally Split Window..........|netrw-o|
|
Browsing With A Horizontally Split Window..........|netrw-o|
|
||||||
Preview Window.....................................|netrw-p|
|
Preview Window.....................................|netrw-p|
|
||||||
@ -51,10 +52,10 @@
|
|||||||
Browsing With A Vertically Split Window............|netrw-v|
|
Browsing With A Vertically Split Window............|netrw-v|
|
||||||
Customizing Browsing With A User Function..........|netrw-x|
|
Customizing Browsing With A User Function..........|netrw-x|
|
||||||
Making The Browsing Directory The Current Directory|netrw-c|
|
Making The Browsing Directory The Current Directory|netrw-c|
|
||||||
Bookmarking A Directory............................|netrw-b|
|
Bookmarking A Directory............................|netrw-b| |netrw-Nb|
|
||||||
Changing To A Bookmarked Directory.................|netrw-B|
|
Changing To A Bookmarked Directory.................|netrw-B| |netrw-NB|
|
||||||
Listing Bookmarks And History......................|netrw-q|
|
Listing Bookmarks And History......................|netrw-q|
|
||||||
Improving Directory Browsing.......................|netrw-list-hack| }}}1
|
Improving Directory Browsing.......................|netrw-listhack| }}}1
|
||||||
8. Problems and Fixes...................................|netrw-problems|
|
8. Problems and Fixes...................................|netrw-problems|
|
||||||
9. Debugging............................................|netrw-debug|
|
9. Debugging............................................|netrw-debug|
|
||||||
10. History..............................................|netrw-history|
|
10. History..............................................|netrw-history|
|
||||||
@ -193,8 +194,8 @@ file using root-relative paths, use the full path:
|
|||||||
2. Network-Oriented File Transfer *netrw-xfer*
|
2. Network-Oriented File Transfer *netrw-xfer*
|
||||||
|
|
||||||
Network-oriented file transfer under Vim is implemented by a VimL-based script
|
Network-oriented file transfer under Vim is implemented by a VimL-based script
|
||||||
(<netrw.vim>) using plugin techniques. It currently supports both reading
|
(<netrw.vim>) using plugin techniques. It currently supports both reading and
|
||||||
and writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch,
|
writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch,
|
||||||
dav/cadaver, rsync, or sftp.
|
dav/cadaver, rsync, or sftp.
|
||||||
|
|
||||||
http is currently supported read-only via use of wget or fetch.
|
http is currently supported read-only via use of wget or fetch.
|
||||||
@ -205,24 +206,23 @@ FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. >
|
|||||||
|
|
||||||
ex. vim ftp://hostname/path/to/file
|
ex. vim ftp://hostname/path/to/file
|
||||||
<
|
<
|
||||||
The characters preceding the colon specify the protocol to use;
|
The characters preceding the colon specify the protocol to use; in the
|
||||||
in the example, its ftp. The <netrw.vim> script then formulates
|
example, its ftp. The <netrw.vim> script then formulates a command or a
|
||||||
a command or a series of commands (typically ftp) which it issues
|
series of commands (typically ftp) which it issues to an external program
|
||||||
to an external program (ftp, scp, etc) which does the actual file
|
(ftp, scp, etc) which does the actual file transfer/protocol. Files are read
|
||||||
transfer/protocol. Files are read from/written to a temporary file
|
from/written to a temporary file (under Unix/Linux, /tmp/...) which the
|
||||||
(under Unix/Linux, /tmp/...) which the <netrw.vim> script will
|
<netrw.vim> script will clean up.
|
||||||
clean up.
|
|
||||||
|
|
||||||
One may modify any protocol's implementing external application
|
One may modify any protocol's implementing external application by setting a
|
||||||
by setting a variable (ex. scp uses the variable g:netrw_scp_cmd,
|
variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to
|
||||||
which is defaulted to "scp -q").
|
"scp -q").
|
||||||
|
|
||||||
Ftp, an old protocol, seems to be blessed by numerous implementations.
|
Ftp, an old protocol, seems to be blessed by numerous implementations.
|
||||||
Unfortunately, some implementations are noisy (ie., add junk to the end
|
Unfortunately, some implementations are noisy (ie., add junk to the end of the
|
||||||
of the file). Thus, concerned users may decide to write a NetReadFixup()
|
file). Thus, concerned users may decide to write a NetReadFixup() function
|
||||||
function that will clean up after reading with their ftp. Some Unix systems
|
that will clean up after reading with their ftp. Some Unix systems (ie.,
|
||||||
(ie., FreeBSD) provide a utility called "fetch" which uses the ftp protocol
|
FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is
|
||||||
but is not noisy and more convenient, actually, for <netrw.vim> to use.
|
not noisy and more convenient, actually, for <netrw.vim> to use.
|
||||||
Consequently, if "fetch" is executable, it will be used to do reads for
|
Consequently, if "fetch" is executable, it will be used to do reads for
|
||||||
ftp://... (and http://...) . See |netrw-var| for more about this.
|
ftp://... (and http://...) . See |netrw-var| for more about this.
|
||||||
|
|
||||||
@ -331,8 +331,8 @@ The script attempts to get passwords for ftp invisibly using |inputsecret()|,
|
|||||||
a built-in Vim function. See |netrw-uidpass| for how to change the password
|
a built-in Vim function. See |netrw-uidpass| for how to change the password
|
||||||
after one has set it.
|
after one has set it.
|
||||||
|
|
||||||
Unfortunately there doesn't appear to be a way for netrw to feed a password
|
Unfortunately there doesn't appear to be a way for netrw to feed a password to
|
||||||
to scp. Thus every transfer via scp will require re-entry of the password.
|
scp. Thus every transfer via scp will require re-entry of the password.
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
@ -340,8 +340,8 @@ to scp. Thus every transfer via scp will require re-entry of the password.
|
|||||||
|
|
||||||
Network-oriented file transfers are available by default whenever
|
Network-oriented file transfers are available by default whenever
|
||||||
|'nocompatible'| mode is enabled. The <netrw.vim> file resides in your
|
|'nocompatible'| mode is enabled. The <netrw.vim> file resides in your
|
||||||
system's vim-plugin directory and is sourced automatically whenever you
|
system's vim-plugin directory and is sourced automatically whenever you bring
|
||||||
bring up vim.
|
up vim.
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
@ -376,7 +376,7 @@ additional commands available.
|
|||||||
:Nread {netfile} {netfile}...
|
:Nread {netfile} {netfile}...
|
||||||
Read the {netfile} after the current line.
|
Read the {netfile} after the current line.
|
||||||
|
|
||||||
*netrw-uidpass*
|
*netrw-uidpass*
|
||||||
:call NetUserPass()
|
:call NetUserPass()
|
||||||
If b:netrw_uid and b:netrw_passwd don't exist,
|
If b:netrw_uid and b:netrw_passwd don't exist,
|
||||||
this function query the user for them.
|
this function query the user for them.
|
||||||
@ -426,7 +426,7 @@ behavior. These variables typically may be set in the user's <.vimrc> file:
|
|||||||
g:netrw_silent =0 transfers done normally
|
g:netrw_silent =0 transfers done normally
|
||||||
=1 transfers done silently
|
=1 transfers done silently
|
||||||
g:netrw_uid Holds current user-id for ftp.
|
g:netrw_uid Holds current user-id for ftp.
|
||||||
=1 use alternate ftp (user uid password)
|
=1 use alternate ftp (user uid password)
|
||||||
(see |netrw-options|)
|
(see |netrw-options|)
|
||||||
g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default)
|
g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default)
|
||||||
=1 use WinNT/2K/XP's rcp, binary mode
|
=1 use WinNT/2K/XP's rcp, binary mode
|
||||||
@ -480,12 +480,12 @@ variables listed below, and may be modified by the user.
|
|||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
<
|
<
|
||||||
*netrw-ftp*
|
*netrw-ftp*
|
||||||
The first two options both help with certain ftp's that give trouble otherwise.
|
The first two options both help with certain ftp's that give trouble
|
||||||
In order to best understand how to use these options if ftp is giving you
|
otherwise. In order to best understand how to use these options if ftp is
|
||||||
troubles, a bit of discussion follows on how netrw does ftp reads.
|
giving you troubles, a bit of discussion follows on how netrw does ftp reads.
|
||||||
|
|
||||||
The g:netrw_..._cmd variables specify the external program to use handle
|
The g:netrw_..._cmd variables specify the external program to use handle the
|
||||||
the associated protocol (rcp, ftp, etc), plus any options.
|
associated protocol (rcp, ftp, etc), plus any options.
|
||||||
|
|
||||||
The g:netrw_list_cmd's HOSTNAME entry will be changed via substitution with
|
The g:netrw_list_cmd's HOSTNAME entry will be changed via substitution with
|
||||||
whatever the current request is for a hostname.
|
whatever the current request is for a hostname.
|
||||||
@ -518,8 +518,8 @@ userid and password. The transferred file is put into a temporary file.
|
|||||||
The temporary file is then read into the main editing session window that
|
The temporary file is then read into the main editing session window that
|
||||||
requested it and the temporary file deleted.
|
requested it and the temporary file deleted.
|
||||||
|
|
||||||
If your ftp doesn't accept the "user" command and immediately just demands
|
If your ftp doesn't accept the "user" command and immediately just demands a
|
||||||
a userid, then try putting "let netrw_ftp=1" in your <.vimrc>.
|
userid, then try putting "let netrw_ftp=1" in your <.vimrc>.
|
||||||
|
|
||||||
*netrw-cadaver*
|
*netrw-cadaver*
|
||||||
To handle the SSL certificate dialog for untrusted servers, one may pull
|
To handle the SSL certificate dialog for untrusted servers, one may pull
|
||||||
@ -546,12 +546,12 @@ messages) you may write a NetReadFixup(tmpfile) function:
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
>
|
>
|
||||||
The NetReadFixup() function will be called if it exists and thus allows
|
The NetReadFixup() function will be called if it exists and thus allows you to
|
||||||
you to customize your reading process. As a further example, <netrw.vim>
|
customize your reading process. As a further example, <netrw.vim> contains
|
||||||
contains just such a function to handle Windows 95 ftp. For whatever
|
just such a function to handle Windows 95 ftp. For whatever reason, Windows
|
||||||
reason, Windows 95's ftp dumps four blank lines at the end of a transfer,
|
95's ftp dumps four blank lines at the end of a transfer, and so it is
|
||||||
and so it is desirable to automate their removal. Here's some code taken
|
desirable to automate their removal. Here's some code taken from <netrw.vim>
|
||||||
from <netrw.vim> itself:
|
itself:
|
||||||
>
|
>
|
||||||
if has("win95") && g:netrw_win95ftp
|
if has("win95") && g:netrw_win95ftp
|
||||||
fun! NetReadFixup(method, line1, line2)
|
fun! NetReadFixup(method, line1, line2)
|
||||||
@ -564,7 +564,7 @@ from <netrw.vim> itself:
|
|||||||
>
|
>
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
7. Directory Browser *netrw-browse* *netrw-dir* *netrw-list* *netrw-help*
|
7. Directory Browsing *netrw-browse* *netrw-dir* *netrw-list* *netrw-help*
|
||||||
|
|
||||||
MAPS *netrw-maps*
|
MAPS *netrw-maps*
|
||||||
?................Help.......................................|netrw-help|
|
?................Help.......................................|netrw-help|
|
||||||
@ -731,7 +731,7 @@ NETRW BROWSER VARIABLES *netrw-browse-var*
|
|||||||
INTRODUCTION TO DIRECTORY BROWSING *netrw-browse-intro*
|
INTRODUCTION TO DIRECTORY BROWSING *netrw-browse-intro*
|
||||||
|
|
||||||
Netrw supports the browsing of directories on the local system and on remote
|
Netrw supports the browsing of directories on the local system and on remote
|
||||||
hosts, including generating listing directories, entering directories, editing
|
hosts, including listing files and directories, entering directories, editing
|
||||||
files therein, deleting files/directories, making new directories, and moving
|
files therein, deleting files/directories, making new directories, and moving
|
||||||
(renaming) files and directories. The Netrw browser generally implements the
|
(renaming) files and directories. The Netrw browser generally implements the
|
||||||
previous explorer maps and commands for remote directories, although details
|
previous explorer maps and commands for remote directories, although details
|
||||||
@ -742,13 +742,15 @@ ftp. The protocol in the url, if it is ftp, will cause netrw to use ftp
|
|||||||
in its remote browsing. Any other protocol will be used for file transfers,
|
in its remote browsing. Any other protocol will be used for file transfers,
|
||||||
but otherwise the ssh protocol will be used to do remote directory browsing.
|
but otherwise the ssh protocol will be used to do remote directory browsing.
|
||||||
|
|
||||||
To enter the netrw directory browser, simply attempt to read a "file" with a
|
To use Netrw's remote directory browser, simply attempt to read a "file" with a
|
||||||
trailing slash and it will be interpreted as a request to list a directory:
|
trailing slash and it will be interpreted as a request to list a directory:
|
||||||
|
|
||||||
vim [protocol]://[user@]hostname/path/
|
vim [protocol]://[user@]hostname/path/
|
||||||
|
|
||||||
If you'd like to avoid entering the password in for directory listings, scp,
|
For local directories, the trailing slash is not required.
|
||||||
ssh interaction, etc, see |netrw-list-hack|.
|
|
||||||
|
If you'd like to avoid entering the password in for remote directory listings
|
||||||
|
with ssh or scp, see |netrw-listhack|.
|
||||||
|
|
||||||
*netrw-explore* *netrw-pexplore*
|
*netrw-explore* *netrw-pexplore*
|
||||||
*netrw-hexplore* *netrw-sexplore*
|
*netrw-hexplore* *netrw-sexplore*
|
||||||
@ -782,7 +784,8 @@ By default, these commands use the current file's directory. However, one
|
|||||||
may explicitly provide a directory (path) to use.
|
may explicitly provide a directory (path) to use.
|
||||||
|
|
||||||
(Following needs v7.0 or later) *netrw-starstar*
|
(Following needs v7.0 or later) *netrw-starstar*
|
||||||
When Explore, Sexplore, Hexplore, or Vexplore are used like
|
When Explore, Sexplore, Hexplore, or Vexplore are used with a **,
|
||||||
|
such as:
|
||||||
>
|
>
|
||||||
:Explore **/filename_pattern
|
:Explore **/filename_pattern
|
||||||
<
|
<
|
||||||
@ -796,7 +799,8 @@ The directory display is updated to show the subdirectory containing a
|
|||||||
matching file. One may then proceed to the next (or previous) matching files'
|
matching file. One may then proceed to the next (or previous) matching files'
|
||||||
directories by using Nexplore or Pexplore, respectively. If your console or
|
directories by using Nexplore or Pexplore, respectively. If your console or
|
||||||
gui produces recognizable shift-up or shift-down sequences, then you'll likely
|
gui produces recognizable shift-up or shift-down sequences, then you'll likely
|
||||||
find the following mappings convenient:
|
find using shift-downarrow and shift-uparrow convenient. They're mapped by
|
||||||
|
netrw:
|
||||||
|
|
||||||
<s-down> == Nexplore, and
|
<s-down> == Nexplore, and
|
||||||
<s-up> == Pexplore.
|
<s-up> == Pexplore.
|
||||||
@ -821,11 +825,12 @@ refresh a local directory by using ":e .".
|
|||||||
|
|
||||||
GOING UP *netrw--*
|
GOING UP *netrw--*
|
||||||
|
|
||||||
To go up a directory, press - or his the <cr> when atop the ../ directory
|
To go up a directory, press - or press the <cr> when atop the ../ directory
|
||||||
entry in the listing.
|
entry in the listing.
|
||||||
|
|
||||||
Netrw will modify the command in |g:netrw_list_cmd| to perform the directory
|
Netrw will use the command in |g:netrw_list_cmd| to perform the directory
|
||||||
listing operation. By default the command is:
|
listing operation after changing HOSTNAME to the host specified by the
|
||||||
|
user-provided url. By default netrw provides the command as:
|
||||||
|
|
||||||
ssh HOSTNAME ls -FLa
|
ssh HOSTNAME ls -FLa
|
||||||
|
|
||||||
@ -840,23 +845,51 @@ BROWSING *netrw-cr*
|
|||||||
Browsing is simple: move the cursor onto a file or directory of interest.
|
Browsing is simple: move the cursor onto a file or directory of interest.
|
||||||
Hitting the <cr> (the return key) will select the file or directory.
|
Hitting the <cr> (the return key) will select the file or directory.
|
||||||
Directories will themselves be listed, and files will be opened using the
|
Directories will themselves be listed, and files will be opened using the
|
||||||
protocol given in the original read request.
|
protocol given in the original read request.
|
||||||
|
|
||||||
|
CAVEAT: There are three forms of listing (see |netrw-i|). Netrw assumes
|
||||||
|
that two or more spaces delimit filenames and directory names for the long
|
||||||
|
and wide listing formats. Thus, if your filename or directory name has two
|
||||||
|
or more spaces embedded in it, or any trailing spaces, then you'll need to
|
||||||
|
use the "thin" format to select it.
|
||||||
|
|
||||||
|
|
||||||
LONG VS SHORT LISTING *netrw-i*
|
OBTAINING A FILE *netrw-O*
|
||||||
|
|
||||||
|
When browsing a remote directory, one may obtain a file under the cursor (ie.
|
||||||
|
get a copy on your local machine, but not edit it) by pressing the O key.
|
||||||
|
Only ftp and scp are supported for this operation (but since these two are
|
||||||
|
available for browsing, that shouldn't be a problem).
|
||||||
|
|
||||||
|
|
||||||
|
THIN, LONG, AND WIDE LISTINGS *netrw-i*
|
||||||
|
|
||||||
|
The "i" map cycles between the thin, long, and wide listing formats.
|
||||||
|
|
||||||
The short listing format gives just the files' and directories' names.
|
The short listing format gives just the files' and directories' names.
|
||||||
|
|
||||||
The long listing is either based on the "ls" command via ssh for remote
|
The long listing is either based on the "ls" command via ssh for remote
|
||||||
directories or displays the filename, file size (in bytes), and the
|
directories or displays the filename, file size (in bytes), and the time and
|
||||||
time and date of last modification for local directories.
|
date of last modification for local directories. With the long listing
|
||||||
|
format, netrw is not able to recognize filenames which have trailing spaces.
|
||||||
|
Use the thin listing format for such files.
|
||||||
|
|
||||||
|
The wide listing format has a multi-column display of the various files in the
|
||||||
|
netrw current directory, rather like the Unix "ls" presents. In this mode the
|
||||||
|
"b" and "B" maps are not available; instead, use Nb (|netrw-Nb|) and NB
|
||||||
|
(|netrw-NB|). The wide listing format uses two or more contiguous spaces to
|
||||||
|
delineate filenames; when using that format, netrw won't be able to recognize
|
||||||
|
or use filenames which have two or more contiguous spaces embedded in the name
|
||||||
|
or any trailing spaces. The thin listing format will, however, work with such
|
||||||
|
files.
|
||||||
|
|
||||||
|
|
||||||
MAKING A NEW DIRECTORY *netrw-d*
|
MAKING A NEW DIRECTORY *netrw-d*
|
||||||
|
|
||||||
With the "d" map one may make a new directory either remotely (which
|
With the "d" map one may make a new directory either remotely (which depends
|
||||||
depends on the global variable g:netrw_mkdir_cmd) or locally (which depends on
|
on the global variable g:netrw_mkdir_cmd) or locally (which depends on the
|
||||||
the global variable g:netrw_local_mkdir). Netrw will issue a request for the
|
global variable g:netrw_local_mkdir). Netrw will issue a request for the new
|
||||||
new directory's name. A bare <CR> at that point will abort the making of the
|
directory's name. A bare <CR> at that point will abort the making of the
|
||||||
directory. Attempts to make a local directory that already exists (as either
|
directory. Attempts to make a local directory that already exists (as either
|
||||||
a file or a directory) will be detected, reported on, and ignored.
|
a file or a directory) will be detected, reported on, and ignored.
|
||||||
|
|
||||||
@ -864,12 +897,12 @@ a file or a directory) will be detected, reported on, and ignored.
|
|||||||
DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D*
|
DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D*
|
||||||
|
|
||||||
Deleting/removing files and directories involves moving the cursor to the
|
Deleting/removing files and directories involves moving the cursor to the
|
||||||
file/directory to be deleted and pressing "D". Directories must be empty first
|
file/directory to be deleted and pressing "D". Directories must be empty
|
||||||
before they can be successfully removed. If the directory is a softlink to a
|
first before they can be successfully removed. If the directory is a softlink
|
||||||
directory, then netrw will make two requests to remove the directory before
|
to a directory, then netrw will make two requests to remove the directory
|
||||||
succeeding. Netrw will ask for confirmation before doing the removal(s).
|
before succeeding. Netrw will ask for confirmation before doing the
|
||||||
You may select a range of lines with the "V" command (visual selection),
|
removal(s). You may select a range of lines with the "V" command (visual
|
||||||
and then pressing "D".
|
selection), and then pressing "D".
|
||||||
|
|
||||||
The g:netrw_rm_cmd, g:netrw_rmf_cmd, and g:netrw_rmdir_cmd variables are used
|
The g:netrw_rm_cmd, g:netrw_rmf_cmd, and g:netrw_rmdir_cmd variables are used
|
||||||
to control the attempts to remove files and directories. The g:netrw_rm_cmd
|
to control the attempts to remove files and directories. The g:netrw_rm_cmd
|
||||||
@ -904,19 +937,19 @@ One may rename a block of files and directories by selecting them with
|
|||||||
the V (|linewise-visual|).
|
the V (|linewise-visual|).
|
||||||
|
|
||||||
|
|
||||||
HIDING FILES OR DIRECTORIES *g:netrw-a* *netrw-a*
|
HIDING FILES OR DIRECTORIES *netrw-a*
|
||||||
|
|
||||||
Netrw's browsing facility allows one to use the hiding list in one of
|
Netrw's browsing facility allows one to use the hiding list in one of three
|
||||||
three ways: ignore it, hide files which match, and show only those files
|
ways: ignore it, hide files which match, and show only those files which
|
||||||
which match. The "a" map allows the user to cycle about these three ways.
|
match. The "a" map allows the user to cycle about these three ways.
|
||||||
|
|
||||||
The g:netrw_list_hide variable holds a comma delimited list of patterns
|
The g:netrw_list_hide variable holds a comma delimited list of patterns (ex.
|
||||||
(ex. \.obj) which specify the hiding list. (also see |netrw-h|) To
|
\.obj) which specify the hiding list. (also see |netrw-h|) To set the hiding
|
||||||
set the hiding list, use the <c-h> map. As an example, to hide files
|
list, use the <c-h> map. As an example, to hide files which begin with a ".",
|
||||||
which begin with a ".", one may use the <c-h> map to set the hiding
|
one may use the <c-h> map to set the hiding list to '^\..*' (or one may put
|
||||||
list to '^\..*' (or one may put let g:netrw_list_hide= '^\..*' in
|
let g:netrw_list_hide= '^\..*' in one's <.vimrc>). One may then use the "a"
|
||||||
one's <.vimrc>). One may then use the "a" key to show all files,
|
key to show all files, hide matching files, or to show only the matching
|
||||||
hide matching files, or to show only the matching files.
|
files.
|
||||||
|
|
||||||
|
|
||||||
EDIT FILE OR DIRECTORY HIDING LIST *netrw-h* *netrw-edithide*
|
EDIT FILE OR DIRECTORY HIDING LIST *netrw-h* *netrw-edithide*
|
||||||
@ -924,7 +957,8 @@ EDIT FILE OR DIRECTORY HIDING LIST *netrw-h* *netrw-edithide*
|
|||||||
The "<ctrl-h>" map brings up a requestor allowing the user to change the
|
The "<ctrl-h>" map brings up a requestor allowing the user to change the
|
||||||
file/directory hiding list. The hiding list consists of one or more patterns
|
file/directory hiding list. The hiding list consists of one or more patterns
|
||||||
delimited by commas. Files and/or directories satisfying these patterns will
|
delimited by commas. Files and/or directories satisfying these patterns will
|
||||||
either be hidden (ie. not shown) or be the only ones displayed (see |netrw-a|).
|
either be hidden (ie. not shown) or be the only ones displayed (see
|
||||||
|
|netrw-a|).
|
||||||
|
|
||||||
|
|
||||||
BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz*
|
BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz*
|
||||||
@ -933,9 +967,9 @@ Normally one enters a file or directory using the <cr>. However, the "o" map
|
|||||||
allows one to open a new window to hold the new directory listing or file. A
|
allows one to open a new window to hold the new directory listing or file. A
|
||||||
horizontal split is used. (for vertical splitting, see |netrw-v|)
|
horizontal split is used. (for vertical splitting, see |netrw-v|)
|
||||||
|
|
||||||
Normally, the o key splits the window horizontally with the new window
|
Normally, the o key splits the window horizontally with the new window and
|
||||||
and cursor at the top. To change to splitting the window horizontally
|
cursor at the top. To change to splitting the window horizontally with the
|
||||||
with the new window and cursor at the bottom, have
|
new window and cursor at the bottom, have
|
||||||
|
|
||||||
let g:netrw_alto = 1
|
let g:netrw_alto = 1
|
||||||
|
|
||||||
@ -944,30 +978,30 @@ in your <.vimrc>.
|
|||||||
|
|
||||||
PREVIEW WINDOW *netrw-p* *netrw-preview*
|
PREVIEW WINDOW *netrw-p* *netrw-preview*
|
||||||
|
|
||||||
One may use a preview window (currently only for local browsing) by using
|
One may use a preview window (currently only for local browsing) by using the
|
||||||
the "p" key when the cursor is atop the desired filename to be previewed.
|
"p" key when the cursor is atop the desired filename to be previewed.
|
||||||
|
|
||||||
|
|
||||||
SELECTING SORTING STYLE *netrw-s* *netrw-sort*
|
SELECTING SORTING STYLE *netrw-s* *netrw-sort*
|
||||||
|
|
||||||
One may select the sorting style by name, time, or (file) size. The
|
One may select the sorting style by name, time, or (file) size. The "s" map
|
||||||
"s" map allows one to circulate amongst the three choices; the directory
|
allows one to circulate amongst the three choices; the directory listing will
|
||||||
listing will automatically be refreshed to reflect the selected style.
|
automatically be refreshed to reflect the selected style.
|
||||||
|
|
||||||
|
|
||||||
EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence*
|
EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence*
|
||||||
|
|
||||||
When "Sorted by" is name, one may specify priority via the sorting
|
When "Sorted by" is name, one may specify priority via the sorting sequence
|
||||||
sequence (g:netrw_sort_sequence). The sorting sequence typically
|
(g:netrw_sort_sequence). The sorting sequence typically prioritizes the
|
||||||
prioritizes the name-listing by suffix, although any pattern will do.
|
name-listing by suffix, although any pattern will do. Patterns are delimited
|
||||||
Patterns are delimited by commas. The default sorting sequence is:
|
by commas. The default sorting sequence is:
|
||||||
>
|
>
|
||||||
[\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$
|
[\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$
|
||||||
<
|
<
|
||||||
The lone * is where all filenames not covered by one of the other
|
The lone * is where all filenames not covered by one of the other patterns
|
||||||
patterns will end up. One may change the sorting sequence by modifying
|
will end up. One may change the sorting sequence by modifying the
|
||||||
the g:netrw_sort_sequence variable (either manually or in your <.vimrc>)
|
g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by
|
||||||
or by using the "S" map.
|
using the "S" map.
|
||||||
|
|
||||||
|
|
||||||
REVERSING SORTING ORDER *netrw-r* *netrw-reverse*
|
REVERSING SORTING ORDER *netrw-r* *netrw-reverse*
|
||||||
@ -994,20 +1028,20 @@ q map to list both the bookmarks and history. (see |netrw-q|)
|
|||||||
|
|
||||||
BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v*
|
BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v*
|
||||||
|
|
||||||
Normally one enters a file or directory using the <cr>. However, the "v"
|
Normally one enters a file or directory using the <cr>. However, the "v" map
|
||||||
map allows one to open a new window to hold the new directory listing or
|
allows one to open a new window to hold the new directory listing or file. A
|
||||||
file. A vertical split is used. (for horizontal splitting, see |netrw-o|)
|
vertical split is used. (for horizontal splitting, see |netrw-o|)
|
||||||
|
|
||||||
Normally, the v key splits the window vertically with the new window
|
Normally, the v key splits the window vertically with the new window and
|
||||||
and cursor at the left. To change to splitting the window vertically
|
cursor at the left. To change to splitting the window vertically with the new
|
||||||
with the new window and cursor at the right, have
|
window and cursor at the right, have
|
||||||
|
|
||||||
let g:netrw_altv = 1
|
let g:netrw_altv = 1
|
||||||
|
|
||||||
in your <.vimrc>.
|
in your <.vimrc>.
|
||||||
|
|
||||||
|
|
||||||
CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler*
|
CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler*
|
||||||
|
|
||||||
One may "enter" a file with a special handler, thereby firing up a browser or
|
One may "enter" a file with a special handler, thereby firing up a browser or
|
||||||
other application, for example, on a file by hitting the "x" key. The special
|
other application, for example, on a file by hitting the "x" key. The special
|
||||||
@ -1019,9 +1053,9 @@ handler varies:
|
|||||||
* otherwise the NetrwFileHandler plugin is used.
|
* otherwise the NetrwFileHandler plugin is used.
|
||||||
|
|
||||||
The file's suffix is used by these various approaches to determine an
|
The file's suffix is used by these various approaches to determine an
|
||||||
appropriate application to use to "handle" these files. Such things
|
appropriate application to use to "handle" these files. Such things as
|
||||||
as OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript
|
OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps,
|
||||||
(*.ps, *.eps) can be handled.
|
*.eps) can be handled.
|
||||||
|
|
||||||
The NetrwFileHandler applies a user-defined function to a file, based on its
|
The NetrwFileHandler applies a user-defined function to a file, based on its
|
||||||
extension. Of course, the handler function must exist for it to be called!
|
extension. Of course, the handler function must exist for it to be called!
|
||||||
@ -1046,12 +1080,12 @@ g:netrw_keepdir to 0 (say, in your <.vimrc>) will tell netrw to have the
|
|||||||
currently browsed directory be the current directory.
|
currently browsed directory be the current directory.
|
||||||
|
|
||||||
With the default setting for g:netrw_keepdir, in order to make the two
|
With the default setting for g:netrw_keepdir, in order to make the two
|
||||||
directories the same, use the "c" map (just type c). That map will set
|
directories the same, use the "c" map (just type c). That map will set the
|
||||||
the current directory to the current browsing directory.
|
current directory to the current browsing directory.
|
||||||
|
|
||||||
|
|
||||||
BOOKMARKING A DIRECTORY *netrw-b* *netrw-bookmark* *netrw-bookmarks*
|
BOOKMARKING A DIRECTORY *netrw-b* *netrw-bookmark* *netrw-bookmarks*
|
||||||
|
*netrw-Nb*
|
||||||
One may easily "bookmark" a directory by using >
|
One may easily "bookmark" a directory by using >
|
||||||
|
|
||||||
{cnt}b
|
{cnt}b
|
||||||
@ -1060,15 +1094,21 @@ Any count may be used. One may use viminfo's "!" option to retain bookmarks
|
|||||||
between vim sessions. See |netrw-B| for how to return to a bookmark and
|
between vim sessions. See |netrw-B| for how to return to a bookmark and
|
||||||
|netrw-q| for how to list them.
|
|netrw-q| for how to list them.
|
||||||
|
|
||||||
|
When wide listing is in use (see |netrw-i|), then the b map is not available;
|
||||||
|
instead, use {cnt}Nb.
|
||||||
|
|
||||||
CHANGING TO A BOOKMARKED DIRECTORY *netrw-B*
|
|
||||||
|
CHANGING TO A BOOKMARKED DIRECTORY *netrw-NB* *netrw-B*
|
||||||
|
|
||||||
To change directory back to a bookmarked directory, use
|
To change directory back to a bookmarked directory, use
|
||||||
|
|
||||||
{cnt}B
|
{cnt}B
|
||||||
|
|
||||||
Any count may be used to reference any of the bookmarks. See |netrw-b|
|
Any count may be used to reference any of the bookmarks. See |netrw-b| on
|
||||||
for how to bookmark a directory and |netrw-q| for how to list them.
|
how to bookmark a directory and |netrw-q| on how to list bookmarks.
|
||||||
|
|
||||||
|
When wide listing is in use (see |netrw-i|), then the B map is not available;
|
||||||
|
instead, use {cnt}NB.
|
||||||
|
|
||||||
|
|
||||||
LISTING BOOKMARKS AND HISTORY *netrw-q* *netrw-listbookmark*
|
LISTING BOOKMARKS AND HISTORY *netrw-q* *netrw-listbookmark*
|
||||||
@ -1077,7 +1117,7 @@ Pressing "q" will list the bookmarked directories and directory traversal
|
|||||||
history (query). (see |netrw-b|, |netrw-B|, |netrw-u|, and |netrw-U|)
|
history (query). (see |netrw-b|, |netrw-B|, |netrw-u|, and |netrw-U|)
|
||||||
|
|
||||||
|
|
||||||
IMPROVING DIRECTORY BROWSING *netrw-list-hack*
|
IMPROVING DIRECTORY BROWSING *netrw-listhack*
|
||||||
|
|
||||||
Especially with the remote directory browser, constantly entering the password
|
Especially with the remote directory browser, constantly entering the password
|
||||||
is tedious.
|
is tedious.
|
||||||
@ -1095,9 +1135,9 @@ NETRW SETTINGS *netrw-settings*
|
|||||||
With the NetrwSettings.vim plugin, >
|
With the NetrwSettings.vim plugin, >
|
||||||
:NetrwSettings
|
:NetrwSettings
|
||||||
will bring up a window with the many variables that netrw uses for its
|
will bring up a window with the many variables that netrw uses for its
|
||||||
settings. You may change any of their values; when you save the file,
|
settings. You may change any of their values; when you save the file, the
|
||||||
the settings therein will be used. One may also press "?" on any of
|
settings therein will be used. One may also press "?" on any of the lines for
|
||||||
the lines for help on what each of the variables do.
|
help on what each of the variables do.
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
@ -1178,10 +1218,10 @@ which is loaded automatically at startup (assuming :set nocp).
|
|||||||
|
|
||||||
1. Get the <Decho.vim> script, available as:
|
1. Get the <Decho.vim> script, available as:
|
||||||
|
|
||||||
http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_scripts
|
http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_scripts
|
||||||
as "Decho, a vimL debugging aid"
|
as "Decho, a vimL debugging aid"
|
||||||
or
|
or
|
||||||
http://vim.sourceforge.net/scripts/script.php?script_id=120
|
http://vim.sourceforge.net/scripts/script.php?script_id=120
|
||||||
|
|
||||||
and put it into your local plugin directory.
|
and put it into your local plugin directory.
|
||||||
|
|
||||||
@ -1217,9 +1257,21 @@ which is loaded automatically at startup (assuming :set nocp).
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
10. History *netrw-history*
|
10. History *netrw-history*
|
||||||
|
|
||||||
v64: * Browser functions now use NetOptionSave/Restore; in particular,
|
v69: * Bugfix: win95/98 machines were experiencing a
|
||||||
|
"E121: Undefined variable: g:netrw_win95ftp" message
|
||||||
|
v68: * double-click-leftmouse selects word under mouse
|
||||||
|
v67: * Passwords which contain blanks will now be surrounded by
|
||||||
|
double-quotes automatically (Yongwei)
|
||||||
|
v66: * Netrw now seems to work with a few more Windows situations
|
||||||
|
* O now obtains a file: remote browsing file -> local copy,
|
||||||
|
locally browsing file -> current directory (see :pwd)
|
||||||
|
* i now cycles between thin, long, and wide listing styles
|
||||||
|
* NB and Nb are maps that are always available; corresponding
|
||||||
|
B and b maps are only available when not using wide listing
|
||||||
|
in order to allow them to be used for motions
|
||||||
|
v65: * Browser functions now use NetOptionSave/Restore; in particular,
|
||||||
netrw now works around the report setting
|
netrw now works around the report setting
|
||||||
* Bugfix - browsing a "/" directory (Unix) yielded buffers
|
v64: * Bugfix - browsing a "/" directory (Unix) yielded buffers
|
||||||
named "[Scratch]" instead of "/"
|
named "[Scratch]" instead of "/"
|
||||||
* Bugfix - remote browsing with ftp was omitting the ./ and ../
|
* Bugfix - remote browsing with ftp was omitting the ./ and ../
|
||||||
v63: * netrw now takes advantage of autoload (and requires 7.0)
|
v63: * netrw now takes advantage of autoload (and requires 7.0)
|
||||||
@ -1366,7 +1418,7 @@ which is loaded automatically at startup (assuming :set nocp).
|
|||||||
Vim editor by Bram Moolenaar (Thanks, Bram!)
|
Vim editor by Bram Moolenaar (Thanks, Bram!)
|
||||||
dav support by C Campbell
|
dav support by C Campbell
|
||||||
fetch support by Bram Moolenaar and C Campbell
|
fetch support by Bram Moolenaar and C Campbell
|
||||||
ftp support by C Campbell <NdrOchip@ScampbellPfamily.AbizM> - NOSPAM
|
ftp support by C Campbell <NdrOchip@ScampbellPfamily.AbizM>
|
||||||
http support by Bram Moolenaar <bram@moolenaar.net>
|
http support by Bram Moolenaar <bram@moolenaar.net>
|
||||||
rcp
|
rcp
|
||||||
rsync support by C Campbell (suggested by Erik Warendorph)
|
rsync support by C Campbell (suggested by Erik Warendorph)
|
||||||
@ -1376,11 +1428,13 @@ which is loaded automatically at startup (assuming :set nocp).
|
|||||||
inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell
|
inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell
|
||||||
|
|
||||||
Jérôme Augé -- also using new buffer method with ftp+.netrc
|
Jérôme Augé -- also using new buffer method with ftp+.netrc
|
||||||
Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use, fetch,...
|
Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use,
|
||||||
|
fetch,...
|
||||||
Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution
|
Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution
|
||||||
Erik Warendorph -- for several suggestions (g:netrw_..._cmd
|
Erik Warendorph -- for several suggestions (g:netrw_..._cmd
|
||||||
variables, rsync etc)
|
variables, rsync etc)
|
||||||
Doug Claar -- modifications to test for success with ftp operation
|
Doug Claar -- modifications to test for success with ftp
|
||||||
|
operation
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
vim:tw=78:ts=8:ft=help:norl:fdm=marker
|
vim:tw=78:ts=8:ft=help:norl:fdm=marker
|
||||||
|
@ -4461,6 +4461,7 @@ compl-function insert.txt /*compl-function*
|
|||||||
compl-generic insert.txt /*compl-generic*
|
compl-generic insert.txt /*compl-generic*
|
||||||
compl-keyword insert.txt /*compl-keyword*
|
compl-keyword insert.txt /*compl-keyword*
|
||||||
compl-occult insert.txt /*compl-occult*
|
compl-occult insert.txt /*compl-occult*
|
||||||
|
compl-occult-filetypes insert.txt /*compl-occult-filetypes*
|
||||||
compl-spelling insert.txt /*compl-spelling*
|
compl-spelling insert.txt /*compl-spelling*
|
||||||
compl-tag insert.txt /*compl-tag*
|
compl-tag insert.txt /*compl-tag*
|
||||||
compl-vim insert.txt /*compl-vim*
|
compl-vim insert.txt /*compl-vim*
|
||||||
@ -4961,6 +4962,7 @@ ft-aspperl-syntax syntax.txt /*ft-aspperl-syntax*
|
|||||||
ft-aspvbs-syntax syntax.txt /*ft-aspvbs-syntax*
|
ft-aspvbs-syntax syntax.txt /*ft-aspvbs-syntax*
|
||||||
ft-bash-syntax syntax.txt /*ft-bash-syntax*
|
ft-bash-syntax syntax.txt /*ft-bash-syntax*
|
||||||
ft-basic-syntax syntax.txt /*ft-basic-syntax*
|
ft-basic-syntax syntax.txt /*ft-basic-syntax*
|
||||||
|
ft-c-occult insert.txt /*ft-c-occult*
|
||||||
ft-c-syntax syntax.txt /*ft-c-syntax*
|
ft-c-syntax syntax.txt /*ft-c-syntax*
|
||||||
ft-ch-syntax syntax.txt /*ft-ch-syntax*
|
ft-ch-syntax syntax.txt /*ft-ch-syntax*
|
||||||
ft-changelog-plugin filetype.txt /*ft-changelog-plugin*
|
ft-changelog-plugin filetype.txt /*ft-changelog-plugin*
|
||||||
@ -5077,7 +5079,6 @@ g'a motion.txt /*g'a*
|
|||||||
g, motion.txt /*g,*
|
g, motion.txt /*g,*
|
||||||
g0 motion.txt /*g0*
|
g0 motion.txt /*g0*
|
||||||
g8 various.txt /*g8*
|
g8 various.txt /*g8*
|
||||||
g:netrw-a pi_netrw.txt /*g:netrw-a*
|
|
||||||
g:netrw_alto pi_netrw.txt /*g:netrw_alto*
|
g:netrw_alto pi_netrw.txt /*g:netrw_alto*
|
||||||
g:netrw_altv pi_netrw.txt /*g:netrw_altv*
|
g:netrw_altv pi_netrw.txt /*g:netrw_altv*
|
||||||
g:netrw_cygwin pi_netrw.txt /*g:netrw_cygwin*
|
g:netrw_cygwin pi_netrw.txt /*g:netrw_cygwin*
|
||||||
@ -5291,6 +5292,7 @@ hebrew hebrew.txt /*hebrew*
|
|||||||
hebrew.txt hebrew.txt /*hebrew.txt*
|
hebrew.txt hebrew.txt /*hebrew.txt*
|
||||||
help various.txt /*help*
|
help various.txt /*help*
|
||||||
help-context help.txt /*help-context*
|
help-context help.txt /*help-context*
|
||||||
|
help-tags tags 1
|
||||||
help-translated various.txt /*help-translated*
|
help-translated various.txt /*help-translated*
|
||||||
help-xterm-window various.txt /*help-xterm-window*
|
help-xterm-window various.txt /*help-xterm-window*
|
||||||
help.txt help.txt /*help.txt*
|
help.txt help.txt /*help.txt*
|
||||||
@ -5298,6 +5300,7 @@ hex-editing tips.txt /*hex-editing*
|
|||||||
hidden-buffer windows.txt /*hidden-buffer*
|
hidden-buffer windows.txt /*hidden-buffer*
|
||||||
hidden-changed version5.txt /*hidden-changed*
|
hidden-changed version5.txt /*hidden-changed*
|
||||||
hidden-menus gui.txt /*hidden-menus*
|
hidden-menus gui.txt /*hidden-menus*
|
||||||
|
hidden-options options.txt /*hidden-options*
|
||||||
hidden-quit windows.txt /*hidden-quit*
|
hidden-quit windows.txt /*hidden-quit*
|
||||||
highlight-args syntax.txt /*highlight-args*
|
highlight-args syntax.txt /*highlight-args*
|
||||||
highlight-changed version4.txt /*highlight-changed*
|
highlight-changed version4.txt /*highlight-changed*
|
||||||
@ -5532,6 +5535,7 @@ inform.vim syntax.txt /*inform.vim*
|
|||||||
initialization starting.txt /*initialization*
|
initialization starting.txt /*initialization*
|
||||||
input() eval.txt /*input()*
|
input() eval.txt /*input()*
|
||||||
inputdialog() eval.txt /*inputdialog()*
|
inputdialog() eval.txt /*inputdialog()*
|
||||||
|
inputlist() eval.txt /*inputlist()*
|
||||||
inputrestore() eval.txt /*inputrestore()*
|
inputrestore() eval.txt /*inputrestore()*
|
||||||
inputsave() eval.txt /*inputsave()*
|
inputsave() eval.txt /*inputsave()*
|
||||||
inputsecret() eval.txt /*inputsecret()*
|
inputsecret() eval.txt /*inputsecret()*
|
||||||
@ -5838,6 +5842,9 @@ netrw pi_netrw.txt /*netrw*
|
|||||||
netrw-- pi_netrw.txt /*netrw--*
|
netrw-- pi_netrw.txt /*netrw--*
|
||||||
netrw-B pi_netrw.txt /*netrw-B*
|
netrw-B pi_netrw.txt /*netrw-B*
|
||||||
netrw-D pi_netrw.txt /*netrw-D*
|
netrw-D pi_netrw.txt /*netrw-D*
|
||||||
|
netrw-NB pi_netrw.txt /*netrw-NB*
|
||||||
|
netrw-Nb pi_netrw.txt /*netrw-Nb*
|
||||||
|
netrw-O pi_netrw.txt /*netrw-O*
|
||||||
netrw-R pi_netrw.txt /*netrw-R*
|
netrw-R pi_netrw.txt /*netrw-R*
|
||||||
netrw-S pi_netrw.txt /*netrw-S*
|
netrw-S pi_netrw.txt /*netrw-S*
|
||||||
netrw-U pi_netrw.txt /*netrw-U*
|
netrw-U pi_netrw.txt /*netrw-U*
|
||||||
@ -5880,8 +5887,8 @@ netrw-history pi_netrw.txt /*netrw-history*
|
|||||||
netrw-horiz pi_netrw.txt /*netrw-horiz*
|
netrw-horiz pi_netrw.txt /*netrw-horiz*
|
||||||
netrw-i pi_netrw.txt /*netrw-i*
|
netrw-i pi_netrw.txt /*netrw-i*
|
||||||
netrw-list pi_netrw.txt /*netrw-list*
|
netrw-list pi_netrw.txt /*netrw-list*
|
||||||
netrw-list-hack pi_netrw.txt /*netrw-list-hack*
|
|
||||||
netrw-listbookmark pi_netrw.txt /*netrw-listbookmark*
|
netrw-listbookmark pi_netrw.txt /*netrw-listbookmark*
|
||||||
|
netrw-listhack pi_netrw.txt /*netrw-listhack*
|
||||||
netrw-maps pi_netrw.txt /*netrw-maps*
|
netrw-maps pi_netrw.txt /*netrw-maps*
|
||||||
netrw-move pi_netrw.txt /*netrw-move*
|
netrw-move pi_netrw.txt /*netrw-move*
|
||||||
netrw-netrc pi_netrw.txt /*netrw-netrc*
|
netrw-netrc pi_netrw.txt /*netrw-netrc*
|
||||||
@ -6719,6 +6726,7 @@ tag-search tagsrch.txt /*tag-search*
|
|||||||
tag-security tagsrch.txt /*tag-security*
|
tag-security tagsrch.txt /*tag-security*
|
||||||
tag-skip-file tagsrch.txt /*tag-skip-file*
|
tag-skip-file tagsrch.txt /*tag-skip-file*
|
||||||
tag-stack tagsrch.txt /*tag-stack*
|
tag-stack tagsrch.txt /*tag-stack*
|
||||||
|
tagfiles() eval.txt /*tagfiles()*
|
||||||
taglist() eval.txt /*taglist()*
|
taglist() eval.txt /*taglist()*
|
||||||
tags tagsrch.txt /*tags*
|
tags tagsrch.txt /*tags*
|
||||||
tags-and-searches tagsrch.txt /*tags-and-searches*
|
tags-and-searches tagsrch.txt /*tags-and-searches*
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
" netrw.vim: Handles file transfer and remote directory listing across a network
|
" netrw.vim: Handles file transfer and remote directory listing across a network
|
||||||
" PLUGIN PORTION
|
" PLUGIN PORTION
|
||||||
" Last Change: Aug 17, 2005
|
" Date: Sep 08, 2005
|
||||||
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
|
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
|
||||||
" Version: 65a ASTRO-ONLY
|
|
||||||
" License: Vim License (see vim's :help license)
|
" License: Vim License (see vim's :help license)
|
||||||
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
|
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
|
||||||
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
|
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
|
||||||
@ -21,17 +20,6 @@
|
|||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" Load Once: {{{1
|
" Load Once: {{{1
|
||||||
if exists("g:loaded_netrw") || &cp
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
if v:version < 600
|
|
||||||
echoerr "***netrw*** doesn't support Vim version ".v:version
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
let g:loaded_netrw = "v65a"
|
|
||||||
if v:version < 700
|
|
||||||
let loaded_explorer = 1
|
|
||||||
endif
|
|
||||||
let s:keepcpo= &cpo
|
let s:keepcpo= &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
@ -138,7 +126,7 @@ endfun
|
|||||||
" example and as a fix for a Windows 95 problem: in my
|
" example and as a fix for a Windows 95 problem: in my
|
||||||
" experience, win95's ftp always dumped four blank lines
|
" experience, win95's ftp always dumped four blank lines
|
||||||
" at the end of the transfer.
|
" at the end of the transfer.
|
||||||
if has("win95") && g:netrw_win95ftp
|
if has("win95") && exists("g:netrw_win95ftp") && g:netrw_win95ftp
|
||||||
fun! NetReadFixup(method, line1, line2)
|
fun! NetReadFixup(method, line1, line2)
|
||||||
" call Dfunc("NetReadFixup(method<".a:method."> line1=".a:line1." line2=".a:line2.")")
|
" call Dfunc("NetReadFixup(method<".a:method."> line1=".a:line1." line2=".a:line2.")")
|
||||||
if method == 3 " ftp (no <.netrc>)
|
if method == 3 " ftp (no <.netrc>)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Language : Netrw Remote-Directory Listing Syntax
|
" Language : Netrw Remote-Directory Listing Syntax
|
||||||
" Maintainer : Charles E. Campbell, Jr.
|
" Maintainer : Charles E. Campbell, Jr.
|
||||||
" Last change: Sep 08, 2004
|
" Last change: Aug 29, 2005
|
||||||
" Version : 5
|
" Version : 7
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
|
|
||||||
" Syntax Clearing: {{{1
|
" Syntax Clearing: {{{1
|
||||||
@ -14,23 +14,30 @@ endif
|
|||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" Directory List Syntax Highlighting: {{{1
|
" Directory List Syntax Highlighting: {{{1
|
||||||
syn cluster NetrwGroup contains=netrwHide,netrwSortBy,netrwSortSeq,netrwQuickHelp,netrwVersion
|
syn cluster NetrwGroup contains=netrwHide,netrwSortBy,netrwSortSeq,netrwQuickHelp,netrwVersion
|
||||||
syn match netrwDir "^.*/\%(\t\|$\)" contains=netrwClassify
|
|
||||||
syn match netrwClassify "[*=|@/]\%(\t\|$\)"
|
syn match netrwSpecial "\%(\S\+ \)*\S\+[*|=]\ze\%(\s\{2,}\|$\)" contains=netrwClassify
|
||||||
syn match netrwSymLink "^.*@\%(\t\|$\)" contains=netrwClassify
|
syn match netrwDir "\.\{1,2}/" contains=netrwClassify
|
||||||
syn match netrwComment '".*\%(\t\|$\)' contains=@NetrwGroup
|
syn match netrwDir "\%(\S\+ \)*\S\+/" contains=netrwClassify
|
||||||
syn match netrwHide '^"\s*\(Hid\|Show\)ing:' skipwhite nextgroup=netrwHidePat
|
syn match netrwDir "^\S*/" contains=netrwClassify
|
||||||
syn match netrwSlash contained "/"
|
syn match netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify
|
||||||
syn match netrwHidePat contained "[^,]\+" skipwhite nextgroup=netrwHideSep
|
syn match netrwExe "\%(\S\+ \)*\S\+\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify
|
||||||
syn match netrwHideSep contained transparent "," skipwhite nextgroup=netrwHidePat
|
|
||||||
syn match netrwSortBy contained transparent "Sorted by" skipwhite nextgroup=netrwList
|
syn match netrwClassify "[*=|@/]\ze\%(\s\{2,}\|$\)" contained
|
||||||
syn match netrwSortSeq contained transparent "Sort sequence:" skipwhite nextgroup=netrwList
|
|
||||||
syn match netrwList contained ".*$" contains=netrwComma
|
syn match netrwComment '".*\%(\t\|$\)' contains=@NetrwGroup
|
||||||
syn match netrwComma contained ","
|
syn match netrwHide '^"\s*\(Hid\|Show\)ing:' skipwhite nextgroup=netrwHidePat
|
||||||
syn region netrwQuickHelp contained matchgroup=Comment start="Quick Help:\s\+" end="$" contains=netrwHelpCmd keepend
|
syn match netrwSlash "/" contained
|
||||||
syn match netrwHelpCmd contained "\S\ze:" skipwhite nextgroup=netrwCmdSep
|
syn match netrwHidePat "[^,]\+" contained skipwhite nextgroup=netrwHideSep
|
||||||
syn match netrwCmdSep contained ":" nextgroup=netrwCmdNote
|
syn match netrwHideSep "," contained transparent skipwhite nextgroup=netrwHidePat
|
||||||
syn match netrwCmdNote contained ".\{-}\ze "
|
syn match netrwSortBy "Sorted by" contained transparent skipwhite nextgroup=netrwList
|
||||||
syn match netrwVersion contained "(netrw.*)"
|
syn match netrwSortSeq "Sort sequence:" contained transparent skipwhite nextgroup=netrwList
|
||||||
|
syn match netrwList ".*$" contained contains=netrwComma
|
||||||
|
syn match netrwComma "," contained
|
||||||
|
syn region netrwQuickHelp matchgroup=Comment start="Quick Help:\s\+" end="$" contains=netrwHelpCmd keepend contained
|
||||||
|
syn match netrwHelpCmd "\S\ze:" contained skipwhite nextgroup=netrwCmdSep
|
||||||
|
syn match netrwCmdSep ":" contained nextgroup=netrwCmdNote
|
||||||
|
syn match netrwCmdNote ".\{-}\ze " contained
|
||||||
|
syn match netrwVersion "(netrw.*)" contained
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" Highlighting Links: {{{1
|
" Highlighting Links: {{{1
|
||||||
@ -45,6 +52,7 @@ if !exists("did_drchip_dbg_syntax")
|
|||||||
hi link netrwList Statement
|
hi link netrwList Statement
|
||||||
hi link netrwVersion Identifier
|
hi link netrwVersion Identifier
|
||||||
hi link netrwSymLink Special
|
hi link netrwSymLink Special
|
||||||
|
hi link netrwExe PreProc
|
||||||
|
|
||||||
hi link netrwComma netrwComment
|
hi link netrwComma netrwComment
|
||||||
hi link netrwHide netrwComment
|
hi link netrwHide netrwComment
|
||||||
|
@ -3861,6 +3861,9 @@ gui_do_scroll()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Make sure wp->w_leftcol and wp->w_skipcol are correct. */
|
||||||
|
validate_cursor();
|
||||||
|
|
||||||
curwin = save_wp;
|
curwin = save_wp;
|
||||||
curbuf = save_wp->w_buffer;
|
curbuf = save_wp->w_buffer;
|
||||||
|
|
||||||
@ -3869,6 +3872,7 @@ gui_do_scroll()
|
|||||||
* the status line!).
|
* the status line!).
|
||||||
*/
|
*/
|
||||||
if (old_topline != wp->w_topline
|
if (old_topline != wp->w_topline
|
||||||
|
|| wp->w_redr_type != 0
|
||||||
#ifdef FEAT_DIFF
|
#ifdef FEAT_DIFF
|
||||||
|| old_topfill != wp->w_topfill
|
|| old_topfill != wp->w_topfill
|
||||||
#endif
|
#endif
|
||||||
|
@ -2401,6 +2401,7 @@ fill_foldcolumn(p, wp, closed, lnum)
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
int level;
|
int level;
|
||||||
int first_level;
|
int first_level;
|
||||||
|
int empty;
|
||||||
|
|
||||||
/* Init to all spaces. */
|
/* Init to all spaces. */
|
||||||
copy_spaces(p, (size_t)wp->w_p_fdc);
|
copy_spaces(p, (size_t)wp->w_p_fdc);
|
||||||
@ -2408,13 +2409,16 @@ fill_foldcolumn(p, wp, closed, lnum)
|
|||||||
level = win_foldinfo.fi_level;
|
level = win_foldinfo.fi_level;
|
||||||
if (level > 0)
|
if (level > 0)
|
||||||
{
|
{
|
||||||
|
/* If there is only one column put more info in it. */
|
||||||
|
empty = (wp->w_p_fdc == 1) ? 0 : 1;
|
||||||
|
|
||||||
/* If the column is too narrow, we start at the lowest level that
|
/* If the column is too narrow, we start at the lowest level that
|
||||||
* fits and use numbers to indicated the depth. */
|
* fits and use numbers to indicated the depth. */
|
||||||
first_level = level - wp->w_p_fdc - closed + 2;
|
first_level = level - wp->w_p_fdc - closed + 1 + empty;
|
||||||
if (first_level < 1)
|
if (first_level < 1)
|
||||||
first_level = 1;
|
first_level = 1;
|
||||||
|
|
||||||
for (i = 0; i + 1 < wp->w_p_fdc; ++i)
|
for (i = 0; i + empty < wp->w_p_fdc; ++i)
|
||||||
{
|
{
|
||||||
if (win_foldinfo.fi_lnum == lnum
|
if (win_foldinfo.fi_lnum == lnum
|
||||||
&& first_level + i >= win_foldinfo.fi_low_level)
|
&& first_level + i >= win_foldinfo.fi_low_level)
|
||||||
|
@ -36,5 +36,5 @@
|
|||||||
#define VIM_VERSION_NODOT "vim70aa"
|
#define VIM_VERSION_NODOT "vim70aa"
|
||||||
#define VIM_VERSION_SHORT "7.0aa"
|
#define VIM_VERSION_SHORT "7.0aa"
|
||||||
#define VIM_VERSION_MEDIUM "7.0aa ALPHA"
|
#define VIM_VERSION_MEDIUM "7.0aa ALPHA"
|
||||||
#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Sep 9)"
|
#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Sep 10)"
|
||||||
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Sep 9, compiled "
|
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Sep 10, compiled "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user