diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-05-14 23:24:24 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-05-14 23:24:24 +0200 |
commit | 00a927d62b68a3523cb1c4f9aa3f7683345c8182 (patch) | |
tree | 9138abae11d363aa87818791195edf6e85aef15d /runtime/autoload | |
parent | f1eeae94fd78f81d85d2abe3d955dc21d5ef979c (diff) |
Updated runtime files.
Diffstat (limited to 'runtime/autoload')
-rw-r--r-- | runtime/autoload/ccomplete.vim | 4 | ||||
-rw-r--r-- | runtime/autoload/netrw.vim | 1051 | ||||
-rw-r--r-- | runtime/autoload/sqlcomplete.vim | 69 | ||||
-rw-r--r-- | runtime/autoload/vimball.vim | 6 | ||||
-rw-r--r-- | runtime/autoload/zip.vim | 18 |
5 files changed, 695 insertions, 453 deletions
diff --git a/runtime/autoload/ccomplete.vim b/runtime/autoload/ccomplete.vim index 6850e19a0b..12fc92df2c 100644 --- a/runtime/autoload/ccomplete.vim +++ b/runtime/autoload/ccomplete.vim @@ -1,7 +1,7 @@ " Vim completion script " Language: C " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2007 Aug 30 +" Last Change: 2010 Mar 23 " This function is used for the 'omnifunc' option. @@ -161,7 +161,7 @@ function! ccomplete#Complete(findstart, base) let res = [{'match': match, 'tagline' : '', 'kind' : kind, 'info' : line}] else " Completing "var.", "var.something", etc. - let res = s:Nextitem(strpart(line, 0, col), items[-1], 0, 1) + let res = s:Nextitem(strpart(line, 0, col), items[1:], 0, 1) endif endif diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index c1b178d195..70b146d648 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -1,7 +1,7 @@ " netrw.vim: Handles file transfer and remote directory listing across " AUTOLOAD SECTION -" Date: Dec 28, 2009 -" Version: 136 +" Date: May 14, 2010 +" Version: 138 " Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM> " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 1999-2009 Charles E. Campbell, Jr. {{{1 @@ -22,7 +22,7 @@ if &cp || exists("g:loaded_netrw") finish endif -let g:loaded_netrw = "v136" +let g:loaded_netrw = "v138" if v:version < 702 echohl WarningMsg echo "***warning*** this version of netrw needs vim 7.2" @@ -266,7 +266,7 @@ call s:NetrwInit("g:netrw_rmf_cmd" , g:netrw_ssh_cmd." USEPORT HOSTNAME rm " Default values - s ---------- {{{3 " g:netrw_sepchr: picking a character that doesn't appear in filenames that can be used to separate priority from filename call s:NetrwInit("g:netrw_sepchr" , (&enc == "euc-jp")? "\<Char-0x01>" : "\<Char-0xff>") -call s:NetrwInit("s:netrw_silentxfer" , (exists("g:netrw_silent") && g:netrw_silent != 0)? "silent " : "") +call s:NetrwInit("s:netrw_silentxfer" , (exists("g:netrw_silent") && g:netrw_silent != 0)? "silent keepj " : "keepj ") call s:NetrwInit("g:netrw_sort_by" , "name") " alternatives: date , size call s:NetrwInit("g:netrw_sort_options" , "") call s:NetrwInit("g:netrw_sort_direction", "normal") " alternative: reverse (z y x ...) @@ -286,11 +286,16 @@ call s:NetrwInit("g:netrw_xstrlen",0) call s:NetrwInit("g:NetrwTopLvlMenu","Netrw.") call s:NetrwInit("g:netrw_use_errorwindow",1) call s:NetrwInit("g:netrw_win95ftp",1) -call s:NetrwInit("g:netrw_winsize","") +call s:NetrwInit("g:netrw_winsize",25) " --------------------------------------------------------------------- " Default values for netrw's script variables: {{{2 call s:NetrwInit("g:netrw_fname_escape",' ?&;%') -call s:NetrwInit("g:netrw_glob_escape",'[]*?`{~$') +if has("win32") || has("win95") || has("win64") || has("win16") + call s:NetrwInit("g:netrw_glob_escape",'[]*?`{$') +else + call s:NetrwInit("g:netrw_glob_escape",'[]*?`{~$\') +endif +call s:NetrwInit("g:netrw_menu_escape",'./&? \') call s:NetrwInit("g:netrw_tmpfile_escape",' &;') call s:NetrwInit("s:netrw_map_escape","<|\n\r\\\<C-V>\"") @@ -329,6 +334,7 @@ fun! s:NetrwOptionSave(vt) endif let {a:vt}netrw_aikeep = &l:ai let {a:vt}netrw_awkeep = &l:aw + let {a:vt}netrw_bombkeep = &l:bomb let {a:vt}netrw_cikeep = &l:ci let {a:vt}netrw_cinkeep = &l:cin let {a:vt}netrw_cinokeep = &l:cino @@ -340,6 +346,7 @@ fun! s:NetrwOptionSave(vt) let {a:vt}netrw_fokeep = &l:fo " formatoptions let {a:vt}netrw_gdkeep = &l:gd " gdefault let {a:vt}netrw_hidkeep = &l:hidden + let {a:vt}netrw_imkeep = &l:im let {a:vt}netrw_magickeep = &l:magic let {a:vt}netrw_repkeep = &l:report let {a:vt}netrw_spellkeep = &l:spell @@ -375,7 +382,7 @@ fun! s:NetrwOptionRestore(vt) " call Decho("exe keepjumps lcd ".fnameescape(curdir)) " NOTE: was g:netrw_fname_escape for some reason try if !exists("&l:acd") && !&l:acd - exe 'keepjumps lcd '.fnameescape(curdir) + exe 'keepj lcd '.fnameescape(curdir) endif catch /^Vim\%((\a\+)\)\=:E472/ call netrw#ErrorMsg(s:ERROR,"unable to change directory to <".curdir."> (permissions?)",61) @@ -385,6 +392,7 @@ fun! s:NetrwOptionRestore(vt) endif if exists("{a:vt}netrw_aikeep") |let &l:ai = {a:vt}netrw_aikeep |unlet {a:vt}netrw_aikeep |endif if exists("{a:vt}netrw_awkeep") |let &l:aw = {a:vt}netrw_awkeep |unlet {a:vt}netrw_awkeep |endif + if exists("{a:vt}netrw_bombkeep") |let &l:bomb = {a:vt}netrw_bombkeep |unlet {a:vt}netrw_bombkeep |endif if exists("{a:vt}netrw_cikeep") |let &l:ci = {a:vt}netrw_cikeep |unlet {a:vt}netrw_cikeep |endif if exists("{a:vt}netrw_cinkeep") |let &l:cin = {a:vt}netrw_cinkeep |unlet {a:vt}netrw_cinkeep |endif if exists("{a:vt}netrw_cinokeep") |let &l:cino = {a:vt}netrw_cinokeep |unlet {a:vt}netrw_cinokeep |endif @@ -397,6 +405,7 @@ fun! s:NetrwOptionRestore(vt) if exists("{a:vt}netrw_fokeep") |let &l:fo = {a:vt}netrw_fokeep |unlet {a:vt}netrw_fokeep |endif if exists("{a:vt}netrw_gdkeep") |let &l:gd = {a:vt}netrw_gdkeep |unlet {a:vt}netrw_gdkeep |endif if exists("{a:vt}netrw_hidkeep") |let &l:hidden = {a:vt}netrw_hidkeep |unlet {a:vt}netrw_hidkeep |endif + if exists("{a:vt}netrw_imkeep") |let &l:im = {a:vt}netrw_imkeep |unlet {a:vt}netrw_imkeep |endif if exists("{a:vt}netrw_magic") |let &l:magic = {a:vt}netrw_magic |unlet {a:vt}netrw_magic |endif if exists("{a:vt}netrw_repkeep") |let &l:report = {a:vt}netrw_repkeep |unlet {a:vt}netrw_repkeep |endif if exists("{a:vt}netrw_spellkeep")|let &l:spell = {a:vt}netrw_spellkeep |unlet {a:vt}netrw_spellkeep|endif @@ -436,7 +445,7 @@ fun! s:NetrwSafeOptions() setlocal com= setlocal cpo-=aA if exists("&acd") | setlocal noacd | endif - setlocal nocin noai noci magic nospell nohid wig= noaw + setlocal nocin noai nobomb noci magic nospell nohid wig= noaw noim setlocal fo=nroql2 setlocal tw=0 setlocal report=10000 @@ -444,9 +453,11 @@ fun! s:NetrwSafeOptions() if g:netrw_use_noswf && has("win32") && !has("win95") setlocal noswf endif + call s:NetrwCursorline() " allow the user to override safe options if &ft == "netrw" +" call Decho("do any netrw FileType autocmds") silent keepalt keepjumps doau FileType netrw endif @@ -526,6 +537,7 @@ fun! netrw#NetRead(mode,...) " NetRead: save options {{{3 call s:NetrwOptionSave("w:") call s:NetrwSafeOptions() + call s:RestoreCursorline() " NetRead: interpret mode into a readcmd {{{3 if a:mode == 0 " read remote file before current line @@ -622,7 +634,7 @@ fun! netrw#NetRead(mode,...) " call Decho("checking if NetrwBrowse() should handle choice<".choice."> with netrw_list_cmd<".g:netrw_list_cmd.">") if choice =~ "^.*[\/]$" && b:netrw_method != 5 && choice !~ '^http://' " call Decho("yes, choice matches '^.*[\/]$'") - keepjumps call s:NetrwBrowse(0,choice) + keepj call s:NetrwBrowse(0,choice) " call Dret("netrw#NetRead :3 getcwd<".getcwd().">") return endif @@ -669,10 +681,10 @@ fun! netrw#NetRead(mode,...) call s:SaveBufVars()|new|call s:RestoreBufVars() let filtbuf= bufnr("%") setlocal ff=unix - put =g:netrw_ftpmode + keepj put =g:netrw_ftpmode " call Decho("filter input: ".getline(line("$"))) if exists("g:netrw_ftpextracmd") - put =g:netrw_ftpextracmd + keepj put =g:netrw_ftpextracmd " call Decho("filter input: ".getline(line("$"))) endif call setline(line("$")+1,'get "'.netrw_fname.'" '.tmpfile) @@ -711,32 +723,32 @@ fun! netrw#NetRead(mode,...) let filtbuf= bufnr("%") setlocal ff=unix if exists("g:netrw_port") && g:netrw_port != "" - put ='open '.g:netrw_machine.' '.g:netrw_port + keepj put ='open '.g:netrw_machine.' '.g:netrw_port " call Decho("filter input: ".getline('.')) else - put ='open '.g:netrw_machine + keepj put ='open '.g:netrw_machine " call Decho("filter input: ".getline('.')) endif if exists("g:netrw_ftp") && g:netrw_ftp == 1 - put =g:netrw_uid + keepj put =g:netrw_uid " call Decho("filter input: ".getline('.')) - put ='\"'.s:netrw_passwd.'\"' + keepj put ='\"'.s:netrw_passwd.'\"' " call Decho("filter input: ".getline('.')) else - put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"' + keepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"' " call Decho("filter input: ".getline('.')) endif if exists("g:netrw_ftpmode") && g:netrw_ftpmode != "" - put =g:netrw_ftpmode + keepj put =g:netrw_ftpmode " call Decho("filter input: ".getline('.')) endif if exists("g:netrw_ftpextracmd") put =g:netrw_ftpextracmd " call Decho("filter input: ".getline('.')) endif - put ='get \"'.netrw_fname.'\" '.tmpfile + keepj put ='get \"'.netrw_fname.'\" '.tmpfile " call Decho("filter input: ".getline('.')) " perform ftp: @@ -830,16 +842,16 @@ fun! netrw#NetRead(mode,...) new setlocal ff=unix if exists("g:netrw_port") && g:netrw_port != "" - put ='open '.g:netrw_machine.' '.g:netrw_port + keepj put ='open '.g:netrw_machine.' '.g:netrw_port else - put ='open '.g:netrw_machine + keepj put ='open '.g:netrw_machine endif - put ='user '.g:netrw_uid.' '.s:netrw_passwd - put ='get '.netrw_fname.' '.tmpfile - put ='quit' + keepj put ='user '.g:netrw_uid.' '.s:netrw_passwd + keepj put ='get '.netrw_fname.' '.tmpfile + keepj put ='quit' " perform cadaver operation: - norm! 1Gdd + keepj norm! 1Gdd " call Decho("executing: %!".g:netrw_dav_cmd) exe s:netrw_silentxfer."%!".g:netrw_dav_cmd bd! @@ -947,16 +959,16 @@ fun! netrw#NetWrite(...) range " (line numbers don't really make sense for that). " Also supports the writing of tar and zip files. " call Decho("(write entire file) silent exe w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile)) - silent exe "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile) + exe "silent keepj w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile) elseif g:netrw_cygwin " write (selected portion of) file to temporary let cygtmpfile= substitute(tmpfile,'/cygdrive/\(.\)','\1:','') " call Decho("(write selected portion) silent exe ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(cygtmpfile)) - silent exe a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(cygtmpfile) + exe "sil keepj ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(cygtmpfile) else " write (selected portion of) file to temporary " call Decho("(write selected portion) silent exe ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile)) - silent exe a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile) + exe "sil keepj ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile) endif if curbufname == "" @@ -1072,10 +1084,10 @@ fun! netrw#NetWrite(...) range " call Decho("filter input window#".winnr()) setlocal ff=unix - put =g:netrw_ftpmode + keepj put =g:netrw_ftpmode " call Decho("filter input: ".getline('$')) if exists("g:netrw_ftpextracmd") - put =g:netrw_ftpextracmd + keepj put =g:netrw_ftpextracmd " call Decho("filter input: ".getline("$")) endif call setline(line("$")+1,'put "'.tmpfile.'" "'.netrw_fname.'"') @@ -1119,28 +1131,28 @@ fun! netrw#NetWrite(...) range setlocal ff=unix if exists("g:netrw_port") && g:netrw_port != "" - put ='open '.g:netrw_machine.' '.g:netrw_port + keepj put ='open '.g:netrw_machine.' '.g:netrw_port " call Decho("filter input: ".getline('.')) else - put ='open '.g:netrw_machine + keepj put ='open '.g:netrw_machine " call Decho("filter input: ".getline('.')) endif if exists("g:netrw_ftp") && g:netrw_ftp == 1 - put =g:netrw_uid + keepj put =g:netrw_uid " call Decho("filter input: ".getline('.')) - put ='\"'.s:netrw_passwd.'\"' + keepj put ='\"'.s:netrw_passwd.'\"' " call Decho("filter input: ".getline('.')) else - put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"' + keepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"' " call Decho("filter input: ".getline('.')) endif - put =g:netrw_ftpmode + keepj put =g:netrw_ftpmode " call Decho("filter input: ".getline('$')) if exists("g:netrw_ftpextracmd") - put =g:netrw_ftpextracmd + keepj put =g:netrw_ftpextracmd " call Decho("filter input: ".getline("$")) endif - put ='put \"'.tmpfile.'\" \"'.netrw_fname.'\"' + keepj put ='put \"'.tmpfile.'\" \"'.netrw_fname.'\"' " call Decho("filter input: ".getline('.')) " save choice/id/password for future use let b:netrw_lastfile = choice @@ -1149,7 +1161,7 @@ fun! netrw#NetWrite(...) range " -i : turns off interactive prompting from ftp " -n unix : DON'T use <.netrc>, even though it exists " -n win32: quit being obnoxious about password - norm! 1Gdd + keepj norm! 1Gdd " call Decho("executing: %!".g:netrw_ftp_cmd." -i -n") exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i -n" " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar) @@ -1203,17 +1215,17 @@ fun! netrw#NetWrite(...) range setlocal ff=unix if exists("g:netrw_port") && g:netrw_port != "" - put ='open '.g:netrw_machine.' '.g:netrw_port + keepj put ='open '.g:netrw_machine.' '.g:netrw_port else - put ='open '.g:netrw_machine + keepj put ='open '.g:netrw_machine endif if exists("g:netrw_uid") && exists("s:netrw_passwd") - put ='user '.g:netrw_uid.' '.s:netrw_passwd + keepj put ='user '.g:netrw_uid.' '.s:netrw_passwd endif - put ='put '.tmpfile.' '.netrw_fname + keepj put ='put '.tmpfile.' '.netrw_fname " perform cadaver operation: - norm! 1Gdd + keepj norm! 1Gdd " call Decho("executing: %!".g:netrw_dav_cmd) exe s:netrw_silentxfer."%!".g:netrw_dav_cmd @@ -1382,7 +1394,7 @@ fun! s:NetrwGetFile(readcmd, tfile, method) " rename buffer back to remote filename " call Decho("exe silent! keepalt file ".fnameescape(rfile)) - exe "silent! keepalt file ".fnameescape(rfile) + exe "sil! keepalt file ".fnameescape(rfile) filetype detect " call Dredir("renamed buffer back to remote filename<".rfile."> : expand(%)<".expand("%").">","ls!") let line1 = 1 @@ -1669,7 +1681,7 @@ if has("win95") && exists("g:netrw_win95ftp") && g:netrw_win95ftp if method == 3 " ftp (no <.netrc>) let fourblanklines= line2 - 3 if fourblanklines >= line1 - exe "silent ".fourblanklines.",".line2."g/^\s*$/d" + exe "sil keepj ".fourblanklines.",".line2."g/^\s*$/d" call histdel("/",-1) endif endif @@ -1693,7 +1705,7 @@ fun! NetUserPass(...) let g:netrw_uid= input('Enter username: ') endif else " from command line -" call Dfunc("NetUserPass(a:1<".a:1.">) {") +" call Dfunc("NetUserPass(a:1<".a:1.">)") let g:netrw_uid= a:1 endif @@ -1763,19 +1775,67 @@ fun! s:BrowserMaps(islocal) nnoremap <buffer> <silent> v :call <SID>NetrwSplit(5)<cr> nnoremap <buffer> <silent> x :call netrw#NetrwBrowseX(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),0),0)"<cr> nnoremap <buffer> <silent> % :call <SID>NetrwOpenFile(1)<cr> + inoremap <buffer> <silent> <cr> <c-o>:call netrw#LocalBrowseCheck(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord()))<cr> + inoremap <buffer> <silent> - <c-o>:exe "norm! 0"<bar>call netrw#LocalBrowseCheck(<SID>NetrwBrowseChgDir(1,'../'))<cr> + inoremap <buffer> <silent> a <c-o>:call <SID>NetrwHide(1)<cr> + inoremap <buffer> <silent> mb <c-o>:<c-u>call <SID>NetrwBookHistHandler(0,b:netrw_curdir)<cr> + inoremap <buffer> <silent> mc <c-o>:<c-u>call <SID>NetrwMarkFileCopy(1)<cr> + inoremap <buffer> <silent> md <c-o>:<c-u>call <SID>NetrwMarkFileDiff(1)<cr> + inoremap <buffer> <silent> me <c-o>:<c-u>call <SID>NetrwMarkFileEdit(1)<cr> + inoremap <buffer> <silent> mf <c-o>:<c-u>call <SID>NetrwMarkFile(1,<SID>NetrwGetWord())<cr> + inoremap <buffer> <silent> mg <c-o>:<c-u>call <SID>NetrwMarkFileGrep(1)<cr> + inoremap <buffer> <silent> mh <c-o>:<c-u>call <SID>NetrwMarkHideSfx(1)<cr> + inoremap <buffer> <silent> mm <c-o>:<c-u>call <SID>NetrwMarkFileMove(1)<cr> + inoremap <buffer> <silent> mp <c-o>:<c-u>call <SID>NetrwMarkFilePrint(1)<cr> + inoremap <buffer> <silent> mr <c-o>:<c-u>call <SID>NetrwMarkFileRegexp(1)<cr> + inoremap <buffer> <silent> ms <c-o>:<c-u>call <SID>NetrwMarkFileSource(1)<cr> + inoremap <buffer> <silent> mT <c-o>:<c-u>call <SID>NetrwMarkFileTag(1)<cr> + inoremap <buffer> <silent> mt <c-o>:<c-u>call <SID>NetrwMarkFileTgt(1)<cr> + inoremap <buffer> <silent> mu <c-o>:<c-u>call <SID>NetrwUnMarkFile(1)<cr> + inoremap <buffer> <silent> mx <c-o>:<c-u>call <SID>NetrwMarkFileExe(1)<cr> + inoremap <buffer> <silent> mz <c-o>:<c-u>call <SID>NetrwMarkFileCompress(1)<cr> + inoremap <buffer> <silent> gb <c-o>:<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr> + inoremap <buffer> <silent> gh <c-o>:<c-u>call <SID>NetrwHidden(1)<cr> + inoremap <buffer> <silent> gp <c-o>:<c-u>call <SID>NetrwChgPerm(1,b:netrw_curdir)<cr> + inoremap <buffer> <silent> c <c-o>:exe "keepjumps lcd ".fnameescape(b:netrw_curdir)<cr> + inoremap <buffer> <silent> C <c-o>:let g:netrw_chgwin= winnr()<cr> + inoremap <buffer> <silent> d <c-o>:call <SID>NetrwMakeDir("")<cr> + inoremap <buffer> <silent> i <c-o>:call <SID>NetrwListStyle(1)<cr> + inoremap <buffer> <silent> I <c-o>:call <SID>NetrwBannerCtrl(1)<cr> + inoremap <buffer> <silent> o <c-o>:call <SID>NetrwSplit(3)<cr> + inoremap <buffer> <silent> O <c-o>:call <SID>NetrwObtain(1)<cr> + inoremap <buffer> <silent> p <c-o>:call <SID>NetrwPreview(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),1))<cr> + inoremap <buffer> <silent> P <c-o>:call <SID>NetrwPrevWinOpen(1)<cr> + inoremap <buffer> <silent> qb <c-o>:<c-u>call <SID>NetrwBookHistHandler(2,b:netrw_curdir)<cr> + inoremap <buffer> <silent> mB <c-o>:<c-u>call <SID>NetrwBookHistHandler(6,b:netrw_curdir)<cr> + inoremap <buffer> <silent> qf <c-o>:<c-u>call <SID>NetrwFileInfo(1,<SID>NetrwGetWord())<cr> + inoremap <buffer> <silent> r <c-o>:let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetrwRefresh(1,<SID>NetrwBrowseChgDir(1,'./'))<cr> + inoremap <buffer> <silent> s <c-o>:call <SID>NetrwSortStyle(1)<cr> + inoremap <buffer> <silent> S <c-o>:call <SID>NetSortSequence(1)<cr> + inoremap <buffer> <silent> t <c-o>:call <SID>NetrwSplit(4)<cr> + inoremap <buffer> <silent> T <c-o>:call <SID>NetrwSplit(4)<bar>norm! gT<cr> + inoremap <buffer> <silent> u <c-o>:<c-u>call <SID>NetrwBookHistHandler(4,expand("%"))<cr> + inoremap <buffer> <silent> U <c-o>:<c-u>call <SID>NetrwBookHistHandler(5,expand("%"))<cr> + inoremap <buffer> <silent> v <c-o>:call <SID>NetrwSplit(5)<cr> + inoremap <buffer> <silent> x <c-o>:call netrw#NetrwBrowseX(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),0),0)"<cr> + inoremap <buffer> <silent> % <c-o>:call <SID>NetrwOpenFile(1)<cr> if !hasmapto('<Plug>NetrwHideEdit') nmap <buffer> <unique> <c-h> <Plug>NetrwHideEdit + imap <buffer> <unique> <c-h> <Plug>NetrwHideEdit endif nnoremap <buffer> <silent> <Plug>NetrwHideEdit :call <SID>NetrwHideEdit(1)<cr> if !hasmapto('<Plug>NetrwRefresh') nmap <buffer> <unique> <c-l> <Plug>NetrwRefresh + imap <buffer> <unique> <c-l> <Plug>NetrwRefresh endif nnoremap <buffer> <silent> <Plug>NetrwRefresh :call <SID>NetrwRefresh(1,<SID>NetrwBrowseChgDir(1,'./'))<cr> if s:didstarstar || !mapcheck("<s-down>","n") nnoremap <buffer> <silent> <s-down> :Nexplore<cr> + inoremap <buffer> <silent> <s-down> :Nexplore<cr> endif if s:didstarstar || !mapcheck("<s-up>","n") nnoremap <buffer> <silent> <s-up> :Pexplore<cr> + inoremap <buffer> <silent> <s-up> :Pexplore<cr> endif let mapsafecurdir = escape(b:netrw_curdir, s:netrw_map_escape) if g:netrw_mousemaps == 1 @@ -1784,14 +1844,22 @@ fun! s:BrowserMaps(islocal) nnoremap <buffer> <silent> <s-leftmouse> <leftmouse>:call <SID>NetrwMarkFile(1,<SID>NetrwGetWord())<cr> exe 'nnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>' exe 'vnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>' + inoremap <buffer> <silent> <leftmouse> <c-o><leftmouse><c-o>:call <SID>NetrwLeftmouse(1)<cr> + inoremap <buffer> <silent> <middlemouse> <c-o><leftmouse><c-o>:call <SID>NetrwPrevWinOpen(1)<cr> + inoremap <buffer> <silent> <s-leftmouse> <c-o><leftmouse><c-o>:call <SID>NetrwMarkFile(1,<SID>NetrwGetWord())<cr> + exe 'inoremap <buffer> <silent> <rightmouse> <c-o><leftmouse><c-o>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>' endif exe 'nnoremap <buffer> <silent> <del> :call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>' - exe 'vnoremap <buffer> <silent> <del> :call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>' exe 'nnoremap <buffer> <silent> D :call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>' - exe 'vnoremap <buffer> <silent> D :call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>' exe 'nnoremap <buffer> <silent> R :call <SID>NetrwLocalRename("'.mapsafecurdir.'")<cr>' - exe 'vnoremap <buffer> <silent> R :call <SID>NetrwLocalRename("'.mapsafecurdir.'")<cr>' exe 'nnoremap <buffer> <silent> <Leader>m :call <SID>NetrwMakeDir("")<cr>' + exe 'vnoremap <buffer> <silent> <del> :call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>' + exe 'vnoremap <buffer> <silent> D :call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>' + exe 'vnoremap <buffer> <silent> R :call <SID>NetrwLocalRename("'.mapsafecurdir.'")<cr>' + exe 'inoremap <buffer> <silent> <del> <c-o>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>' + exe 'inoremap <buffer> <silent> D <c-o>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>' + exe 'inoremap <buffer> <silent> R <c-o>:call <SID>NetrwLocalRename("'.mapsafecurdir.'")<cr>' + exe 'inoremap <buffer> <silent> <Leader>m <c-o>:call <SID>NetrwMakeDir("")<cr>' nnoremap <buffer> <F1> :he netrw-quickhelp<cr> else " remote @@ -1840,12 +1908,57 @@ fun! s:BrowserMaps(islocal) nnoremap <buffer> <silent> v :call <SID>NetrwSplit(2)<cr> nnoremap <buffer> <silent> x :call netrw#NetrwBrowseX(<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()),1)<cr> nnoremap <buffer> <silent> % :call <SID>NetrwOpenFile(0)<cr> + inoremap <buffer> <silent> <cr> <c-o>:call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()))<cr> + inoremap <buffer> <silent> <c-l> <c-o>:call <SID>NetrwRefresh(0,<SID>NetrwBrowseChgDir(0,'./'))<cr> + inoremap <buffer> <silent> - <c-o>:exe "norm! 0"<bar>call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,'../'))<cr> + inoremap <buffer> <silent> a <c-o>:call <SID>NetrwHide(0)<cr> + inoremap <buffer> <silent> mb <c-o>:<c-u>call <SID>NetrwBookHistHandler(0,b:netrw_curdir)<cr> + inoremap <buffer> <silent> mc <c-o>:<c-u>call <SID>NetrwMarkFileCopy(0)<cr> + inoremap <buffer> <silent> md <c-o>:<c-u>call <SID>NetrwMarkFileDiff(0)<cr> + inoremap <buffer> <silent> me <c-o>:<c-u>call <SID>NetrwMarkFileEdit(0)<cr> + inoremap <buffer> <silent> mf <c-o>:<c-u>call <SID>NetrwMarkFile(0,<SID>NetrwGetWord())<cr> + inoremap <buffer> <silent> mg <c-o>:<c-u>call <SID>NetrwMarkFileGrep(0)<cr> + inoremap <buffer> <silent> mh <c-o>:<c-u>call <SID>NetrwMarkHideSfx(0)<cr> + inoremap <buffer> <silent> mm <c-o>:<c-u>call <SID>NetrwMarkFileMove(0)<cr> + inoremap <buffer> <silent> mp <c-o>:<c-u>call <SID>NetrwMarkFilePrint(0)<cr> + inoremap <buffer> <silent> mr <c-o>:<c-u>call <SID>NetrwMarkFileRegexp(0)<cr> + inoremap <buffer> <silent> ms <c-o>:<c-u>call <SID>NetrwMarkFileSource(0)<cr> + inoremap <buffer> <silent> mT <c-o>:<c-u>call <SID>NetrwMarkFileTag(0)<cr> + inoremap <buffer> <silent> mt <c-o>:<c-u>call <SID>NetrwMarkFileTgt(0)<cr> + inoremap <buffer> <silent> mu <c-o>:<c-u>call <SID>NetrwUnMarkFile(0)<cr> + inoremap <buffer> <silent> mx <c-o>:<c-u>call <SID>NetrwMarkFileExe(0)<cr> + inoremap <buffer> <silent> mz <c-o>:<c-u>call <SID>NetrwMarkFileCompress(0)<cr> + inoremap <buffer> <silent> gb <c-o>:<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_cur)<cr> + inoremap <buffer> <silent> gh <c-o>:<c-u>call <SID>NetrwHidden(0)<cr> + inoremap <buffer> <silent> gp <c-o>:<c-u>call <SID>NetrwChgPerm(0,b:netrw_curdir)<cr> + inoremap <buffer> <silent> C <c-o>:let g:netrw_chgwin= winnr()<cr> + inoremap <buffer> <silent> i <c-o>:call <SID>NetrwListStyle(0)<cr> + inoremap <buffer> <silent> I <c-o>:call <SID>NetrwBannerCtrl(1)<cr> + inoremap <buffer> <silent> o <c-o>:call <SID>NetrwSplit(0)<cr> + inoremap <buffer> <silent> O <c-o>:call <SID>NetrwObtain(0)<cr> + inoremap <buffer> <silent> p <c-o>:call <SID>NetrwPreview(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),1))<cr> + inoremap <buffer> <silent> P <c-o>:call <SID>NetrwPrevWinOpen(0)<cr> + inoremap <buffer> <silent> qb <c-o>:<c-u>call <SID>NetrwBookHistHandler(2,b:netrw_curdir)<cr> + inoremap <buffer> <silent> mB <c-o>:<c-u>call <SID>NetrwBookHistHandler(6,b:netrw_curdir)<cr> + inoremap <buffer> <silent> qf <c-o>:<c-u>call <SID>NetrwFileInfo(0,<SID>NetrwGetWord())<cr> + inoremap <buffer> <silent> r <c-o>:let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,'./'))<cr> + inoremap <buffer> <silent> s <c-o>:call <SID>NetrwSortStyle(0)<cr> + inoremap <buffer> <silent> S <c-o>:call <SID>NetSortSequence(0)<cr> + inoremap <buffer> <silent> t <c-o>:call <SID>NetrwSplit(1)<cr> + inoremap <buffer> <silent> T <c-o>:call <SID>NetrwSplit(1)<bar>norm! gT<cr> + inoremap <buffer> <silent> u <c-o>:<c-u>call <SID>NetrwBookHistHandler(4,b:netrw_curdir)<cr> + inoremap <buffer> <silent> U <c-o>:<c-u>call <SID>NetrwBookHistHandler(5,b:netrw_curdir)<cr> + inoremap <buffer> <silent> v <c-o>:call <SID>NetrwSplit(2)<cr> + inoremap <buffer> <silent> x <c-o>:call netrw#NetrwBrowseX(<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()),1)<cr> + inoremap <buffer> <silent> % <c-o>:call <SID>NetrwOpenFile(0)<cr> if !hasmapto('<Plug>NetrwHideEdit') nmap <buffer> <c-h> <Plug>NetrwHideEdit + imap <buffer> <c-h> <Plug>NetrwHideEdit endif nnoremap <buffer> <silent> <Plug>NetrwHideEdit :call <SID>NetrwHideEdit(0)<cr> if !hasmapto('<Plug>NetrwRefresh') nmap <buffer> <c-l> <Plug>NetrwRefresh + imap <buffer> <c-l> <Plug>NetrwRefresh endif let mapsafepath = escape(s:path, s:netrw_map_escape) @@ -1858,15 +1971,24 @@ fun! s:BrowserMaps(islocal) nnoremap <buffer> <silent> <s-leftmouse> <leftmouse>:call <SID>NetrwMarkFile(0,<SID>NetrwGetWord())<cr> exe 'nnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>' exe 'vnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>' + inoremap <buffer> <silent> <leftmouse> <c-o><leftmouse><c-o>:call <SID>NetrwLeftmouse(0)<cr> + inoremap <buffer> <silent> <middlemouse> <c-o><leftmouse><c-o>:call <SID>NetrwPrevWinOpen(0)<cr> + inoremap <buffer> <silent> <s-leftmouse> <c-o><leftmouse><c-o>:call <SID>NetrwMarkFile(0,<SID>NetrwGetWord())<cr> + exe 'inoremap <buffer> <silent> <rightmouse> <c-o><leftmouse><c-o>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>' endif exe 'nnoremap <buffer> <silent> <del> :call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>' + exe 'nnoremap <buffer> <silent> d :call <SID>NetrwMakeDir("'.mapsafeusermach.'")<cr>' + exe 'nnoremap <buffer> <silent> D :call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>' + exe 'nnoremap <buffer> <silent> R :call <SID>NetrwRemoteRename("'.mapsafeusermach.'","'.mapsafepath.'")<cr>' exe 'vnoremap <buffer> <silent> <del> :call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>' - exe 'nnoremap <buffer> <silent> d :call <SID>NetrwMakeDir("'.mapsafeusermach.'")<cr>' - exe 'nnoremap <buffer> <silent> D :call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>' - exe 'vnoremap <buffer> <silent> D :call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>' - exe 'nnoremap <buffer> <silent> R :call <SID>NetrwRemoteRename("'.mapsafeusermach.'","'.mapsafepath.'")<cr>' - exe 'vnoremap <buffer> <silent> R :call <SID>NetrwRemoteRename("'.mapsafeusermach.'","'.mapsafepath.'")<cr>' + exe 'vnoremap <buffer> <silent> D :call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>' + exe 'vnoremap <buffer> <silent> R :call <SID>NetrwRemoteRename("'.mapsafeusermach.'","'.mapsafepath.'")<cr>' + exe 'inoremap <buffer> <silent> <del> <c-o>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>' + exe 'inoremap <buffer> <silent> d <c-o>:call <SID>NetrwMakeDir("'.mapsafeusermach.'")<cr>' + exe 'inoremap <buffer> <silent> D <c-o>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>' + exe 'inoremap <buffer> <silent> R <c-o>:call <SID>NetrwRemoteRename("'.mapsafeusermach.'","'.mapsafepath.'")<cr>' nnoremap <buffer> <F1> :he netrw-quickhelp<cr> + inoremap <buffer> <F1> <c-o>:he netrw-quickhelp<cr> endif call s:SetRexDir(a:islocal,b:netrw_curdir) " call Dret("s:BrowserMaps") @@ -1895,7 +2017,7 @@ endfun " 5: (user: <U>) go down (next) bookmark " 6: (user: <mB>) delete bookmark fun! s:NetrwBookHistHandler(chg,curdir) -" call Dfunc("NetrwBookHistHandler(chg=".a:chg." curdir<".a:curdir.">) cnt=".v:count." histcnt=".g:netrw_dirhist_cnt." histmax=".g:netrw_dirhistmax) +" call Dfunc("s:NetrwBookHistHandler(chg=".a:chg." curdir<".a:curdir.">) cnt=".v:count." histcnt=".g:netrw_dirhist_cnt." histmax=".g:netrw_dirhistmax) if a:chg == 0 " bookmark the current directory @@ -1978,12 +2100,12 @@ fun! s:NetrwBookHistHandler(chg,curdir) if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir") setlocal ma noro " call Decho("setlocal ma noro") - %d + keepj %d setlocal nomod " call Decho("setlocal nomod") endif " " call Decho("exe e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt})) - exe "e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt}) + exe "keepj e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt}) else let g:netrw_dirhist_cnt= ( g:netrw_dirhist_cnt + 1 ) % g:netrw_dirhistmax echo "Sorry, no predecessor directory exists yet" @@ -1998,13 +2120,13 @@ fun! s:NetrwBookHistHandler(chg,curdir) if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir") setlocal ma noro " call Decho("setlocal ma noro") - %d + keepj %d " call Decho("removed all lines from buffer (%d)") setlocal nomod " call Decho("setlocal nomod") endif " call Decho("exe e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt})) - exe "e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt}) + exe "keepj e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt}) else let g:netrw_dirhist_cnt= ( g:netrw_dirhist_cnt - 1 ) % g:netrw_dirhistmax if g:netrw_dirhist_cnt < 0 @@ -2024,7 +2146,7 @@ fun! s:NetrwBookHistHandler(chg,curdir) call remove(g:netrw_bookmarklist,v:count-1) endif call s:NetrwBookmarkMenu() -" call Dret("NetrwBookHistHandler") +" call Dret("s:NetrwBookHistHandler") endfun " --------------------------------------------------------------------- @@ -2077,28 +2199,28 @@ fun! s:NetrwBookHistSave() call setline((cnt+lastline),'let g:netrw_dirhist_'.cnt."='".g:netrw_dirhist_{cnt}."'") let cnt= cnt + 1 endwhile - exe "silent! w! ".savefile + exe "sil! w! ".savefile - silent %d + sil keepj %d if exists("g:netrw_bookmarklist") && g:netrw_bookmarklist != [] " merge and write .netrwbook let savefile= s:NetrwHome()."/.netrwbook" if filereadable(savefile) let booklist= deepcopy(g:netrw_bookmarklist) - exe "silent so ".savefile + exe "sil keepj so ".savefile for bdm in booklist if index(g:netrw_bookmarklist,bdm) == -1 call add(g:netrw_bookmarklist,bdm) endif endfor call sort(g:netrw_bookmarklist) - exe "silent! w! ".savefile + exe "sil! w! ".savefile endif " construct and save .netrwbook call setline(1,"let g:netrw_bookmarklist= ".string(g:netrw_bookmarklist)) - exe "silent! w! ".savefile + exe "sil! w! ".savefile endif let bgone= bufnr("%") q! @@ -2114,13 +2236,14 @@ endfun " with the requested remote hostname first. fun! s:NetrwBrowse(islocal,dirname) if !exists("w:netrw_liststyle")|let w:netrw_liststyle= g:netrw_liststyle|endif -" call Dfunc("s:NetrwBrowse(islocal=".a:islocal." dirname<".a:dirname.">) liststyle=".w:netrw_liststyle." ".g:loaded_netrw." buf#".bufnr("%")."<".bufname("%").">") +" call Dfunc("s:NetrwBrowse(islocal=".a:islocal." dirname<".a:dirname.">) liststyle=".w:netrw_liststyle." ".g:loaded_netrw." buf#".bufnr("%")."<".bufname("%")."> win#".winnr()) " call Decho("tab#".tabpagenr()." win#".winnr()) " call Dredir("ls!") if !exists("s:netrw_initbookhist") call s:NetrwBookHistRead() endif " call FOTEST(7) +"call Decho("COMBAK#01 buf(%)#".bufnr("%")."<".bufname("%")."> win#".winnr()." bufnr(win#1)=".winbufnr(1)."<".bufname(winbufnr(1))." bufnr(win#2)=".winbufnr(2)."<".bufname(winbufnr(2)).">") " simplify the dirname (especially for ".."s in dirnames) if a:dirname !~ '^\a\+://' @@ -2129,6 +2252,7 @@ fun! s:NetrwBrowse(islocal,dirname) let dirname= a:dirname endif " call FOTEST(8) +"call Decho("COMBAK#02 buf(%)#".bufnr("%")."<".bufname("%")."> win#".winnr()." bufnr(win#1)=".winbufnr(1)."<".bufname(winbufnr(1))." bufnr(win#2)=".winbufnr(2)."<".bufname(winbufnr(2)).">") if exists("s:netrw_skipbrowse") unlet s:netrw_skipbrowse @@ -2149,6 +2273,7 @@ fun! s:NetrwBrowse(islocal,dirname) call s:NetrwOptionSave("w:") " call FOTEST(9) +"call Decho("COMBAK#03 buf(%)#".bufnr("%")."<".bufname("%")."> win#".winnr()." bufnr(win#1)=".winbufnr(1)."<".bufname(winbufnr(1))." bufnr(win#2)=".winbufnr(2)."<".bufname(winbufnr(2)).">") " re-instate any marked files if exists("s:netrwmarkfilelist_{bufnr('%')}") @@ -2156,11 +2281,12 @@ fun! s:NetrwBrowse(islocal,dirname) exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/" endif " call FOTEST(10) +"call Decho("COMBAK#04 buf(%)#".bufnr("%")."<".bufname("%")."> win#".winnr()." bufnr(win#1)=".winbufnr(1)."<".bufname(winbufnr(1))." bufnr(win#2)=".winbufnr(2)."<".bufname(winbufnr(2)).">") if a:islocal && exists("w:netrw_acdkeep") && w:netrw_acdkeep " call Decho("handle w:netrw_acdkeep:") " call Decho("keepjumps lcd ".fnameescape(dirname)." (due to w:netrw_acdkeep=".w:netrw_acdkeep." - acd=".&acd.")") - exe 'keepjumps lcd '.fnameescape(dirname) + exe 'keepj lcd '.fnameescape(dirname) call s:NetrwSafeOptions() " call Decho("getcwd<".getcwd().">") @@ -2176,19 +2302,19 @@ fun! s:NetrwBrowse(islocal,dirname) call s:RemotePathAnalysis(dirname) " remote-read the requested file into current buffer {{{3 - mark ' + keepj mark ' call s:NetrwEnew(dirname) call s:NetrwSafeOptions() setlocal ma noro " call Decho("setlocal ma noro") let b:netrw_curdir= dirname " call Decho("exe silent! |