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 -" 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 " 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")? "\" : "\") -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\\\\"") @@ -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 v :call NetrwSplit(5) nnoremap x :call netrw#NetrwBrowseX(NetrwBrowseChgDir(1,NetrwGetWord(),0),0)" nnoremap % :call NetrwOpenFile(1) + inoremap :call netrw#LocalBrowseCheck(NetrwBrowseChgDir(1,NetrwGetWord())) + inoremap - :exe "norm! 0"call netrw#LocalBrowseCheck(NetrwBrowseChgDir(1,'../')) + inoremap a :call NetrwHide(1) + inoremap mb :call NetrwBookHistHandler(0,b:netrw_curdir) + inoremap mc :call NetrwMarkFileCopy(1) + inoremap md :call NetrwMarkFileDiff(1) + inoremap me :call NetrwMarkFileEdit(1) + inoremap mf :call NetrwMarkFile(1,NetrwGetWord()) + inoremap mg :call NetrwMarkFileGrep(1) + inoremap mh :call NetrwMarkHideSfx(1) + inoremap mm :call NetrwMarkFileMove(1) + inoremap mp :call NetrwMarkFilePrint(1) + inoremap mr :call NetrwMarkFileRegexp(1) + inoremap ms :call NetrwMarkFileSource(1) + inoremap mT :call NetrwMarkFileTag(1) + inoremap mt :call NetrwMarkFileTgt(1) + inoremap mu :call NetrwUnMarkFile(1) + inoremap mx :call NetrwMarkFileExe(1) + inoremap mz :call NetrwMarkFileCompress(1) + inoremap gb :call NetrwBookHistHandler(1,b:netrw_curdir) + inoremap gh :call NetrwHidden(1) + inoremap gp :call NetrwChgPerm(1,b:netrw_curdir) + inoremap c :exe "keepjumps lcd ".fnameescape(b:netrw_curdir) + inoremap C :let g:netrw_chgwin= winnr() + inoremap d :call NetrwMakeDir("") + inoremap i :call NetrwListStyle(1) + inoremap I :call NetrwBannerCtrl(1) + inoremap o :call NetrwSplit(3) + inoremap O :call NetrwObtain(1) + inoremap p :call NetrwPreview(NetrwBrowseChgDir(1,NetrwGetWord(),1)) + inoremap P :call NetrwPrevWinOpen(1) + inoremap qb :call NetrwBookHistHandler(2,b:netrw_curdir) + inoremap mB :call NetrwBookHistHandler(6,b:netrw_curdir) + inoremap qf :call NetrwFileInfo(1,NetrwGetWord()) + inoremap r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'exe "norm! 0"call NetrwRefresh(1,NetrwBrowseChgDir(1,'./')) + inoremap s :call NetrwSortStyle(1) + inoremap S :call NetSortSequence(1) + inoremap t :call NetrwSplit(4) + inoremap T :call NetrwSplit(4)norm! gT + inoremap u :call NetrwBookHistHandler(4,expand("%")) + inoremap U :call NetrwBookHistHandler(5,expand("%")) + inoremap v :call NetrwSplit(5) + inoremap x :call netrw#NetrwBrowseX(NetrwBrowseChgDir(1,NetrwGetWord(),0),0)" + inoremap % :call NetrwOpenFile(1) if !hasmapto('NetrwHideEdit') nmap NetrwHideEdit + imap NetrwHideEdit endif nnoremap NetrwHideEdit :call NetrwHideEdit(1) if !hasmapto('NetrwRefresh') nmap NetrwRefresh + imap NetrwRefresh endif nnoremap NetrwRefresh :call NetrwRefresh(1,NetrwBrowseChgDir(1,'./')) if s:didstarstar || !mapcheck("","n") nnoremap :Nexplore + inoremap :Nexplore endif if s:didstarstar || !mapcheck("","n") nnoremap :Pexplore + inoremap :Pexplore 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 :call NetrwMarkFile(1,NetrwGetWord()) exe 'nnoremap :call NetrwLocalRm("'.mapsafecurdir.'")' exe 'vnoremap :call NetrwLocalRm("'.mapsafecurdir.'")' + inoremap :call NetrwLeftmouse(1) + inoremap :call NetrwPrevWinOpen(1) + inoremap :call NetrwMarkFile(1,NetrwGetWord()) + exe 'inoremap :call NetrwLocalRm("'.mapsafecurdir.'")' endif exe 'nnoremap :call NetrwLocalRm("'.mapsafecurdir.'")' - exe 'vnoremap :call NetrwLocalRm("'.mapsafecurdir.'")' exe 'nnoremap D :call NetrwLocalRm("'.mapsafecurdir.'")' - exe 'vnoremap D :call NetrwLocalRm("'.mapsafecurdir.'")' exe 'nnoremap R :call NetrwLocalRename("'.mapsafecurdir.'")' - exe 'vnoremap R :call NetrwLocalRename("'.mapsafecurdir.'")' exe 'nnoremap m :call NetrwMakeDir("")' + exe 'vnoremap :call NetrwLocalRm("'.mapsafecurdir.'")' + exe 'vnoremap D :call NetrwLocalRm("'.mapsafecurdir.'")' + exe 'vnoremap R :call NetrwLocalRename("'.mapsafecurdir.'")' + exe 'inoremap :call NetrwLocalRm("'.mapsafecurdir.'")' + exe 'inoremap D :call NetrwLocalRm("'.mapsafecurdir.'")' + exe 'inoremap R :call NetrwLocalRename("'.mapsafecurdir.'")' + exe 'inoremap m :call NetrwMakeDir("")' nnoremap :he netrw-quickhelp else " remote @@ -1840,12 +1908,57 @@ fun! s:BrowserMaps(islocal) nnoremap v :call NetrwSplit(2) nnoremap x :call netrw#NetrwBrowseX(NetrwBrowseChgDir(0,NetrwGetWord()),1) nnoremap % :call NetrwOpenFile(0) + inoremap :call NetrwBrowse(0,NetrwBrowseChgDir(0,NetrwGetWord())) + inoremap :call NetrwRefresh(0,NetrwBrowseChgDir(0,'./')) + inoremap - :exe "norm! 0"call NetrwBrowse(0,NetrwBrowseChgDir(0,'../')) + inoremap a :call NetrwHide(0) + inoremap mb :call NetrwBookHistHandler(0,b:netrw_curdir) + inoremap mc :call NetrwMarkFileCopy(0) + inoremap md :call NetrwMarkFileDiff(0) + inoremap me :call NetrwMarkFileEdit(0) + inoremap mf :call NetrwMarkFile(0,NetrwGetWord()) + inoremap mg :call NetrwMarkFileGrep(0) + inoremap mh :call NetrwMarkHideSfx(0) + inoremap mm :call NetrwMarkFileMove(0) + inoremap mp :call NetrwMarkFilePrint(0) + inoremap mr :call NetrwMarkFileRegexp(0) + inoremap ms :call NetrwMarkFileSource(0) + inoremap mT :call NetrwMarkFileTag(0) + inoremap mt :call NetrwMarkFileTgt(0) + inoremap mu :call NetrwUnMarkFile(0) + inoremap mx :call NetrwMarkFileExe(0) + inoremap mz :call NetrwMarkFileCompress(0) + inoremap gb :call NetrwBookHistHandler(1,b:netrw_cur) + inoremap gh :call NetrwHidden(0) + inoremap gp :call NetrwChgPerm(0,b:netrw_curdir) + inoremap C :let g:netrw_chgwin= winnr() + inoremap i :call NetrwListStyle(0) + inoremap I :call NetrwBannerCtrl(1) + inoremap o :call NetrwSplit(0) + inoremap O :call NetrwObtain(0) + inoremap p :call NetrwPreview(NetrwBrowseChgDir(1,NetrwGetWord(),1)) + inoremap P :call NetrwPrevWinOpen(0) + inoremap qb :call NetrwBookHistHandler(2,b:netrw_curdir) + inoremap mB :call NetrwBookHistHandler(6,b:netrw_curdir) + inoremap qf :call NetrwFileInfo(0,NetrwGetWord()) + inoremap r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'exe "norm! 0"call NetrwBrowse(0,NetrwBrowseChgDir(0,'./')) + inoremap s :call NetrwSortStyle(0) + inoremap S :call NetSortSequence(0) + inoremap t :call NetrwSplit(1) + inoremap T :call NetrwSplit(1)norm! gT + inoremap u :call NetrwBookHistHandler(4,b:netrw_curdir) + inoremap U :call NetrwBookHistHandler(5,b:netrw_curdir) + inoremap v :call NetrwSplit(2) + inoremap x :call netrw#NetrwBrowseX(NetrwBrowseChgDir(0,NetrwGetWord()),1) + inoremap % :call NetrwOpenFile(0) if !hasmapto('NetrwHideEdit') nmap NetrwHideEdit + imap NetrwHideEdit endif nnoremap NetrwHideEdit :call NetrwHideEdit(0) if !hasmapto('NetrwRefresh') nmap NetrwRefresh + imap NetrwRefresh endif let mapsafepath = escape(s:path, s:netrw_map_escape) @@ -1858,15 +1971,24 @@ fun! s:BrowserMaps(islocal) nnoremap :call NetrwMarkFile(0,NetrwGetWord()) exe 'nnoremap :call NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")' exe 'vnoremap :call NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")' + inoremap :call NetrwLeftmouse(0) + inoremap :call NetrwPrevWinOpen(0) + inoremap :call NetrwMarkFile(0,NetrwGetWord()) + exe 'inoremap :call NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")' endif exe 'nnoremap :call NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")' + exe 'nnoremap d :call NetrwMakeDir("'.mapsafeusermach.'")' + exe 'nnoremap D :call NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")' + exe 'nnoremap R :call NetrwRemoteRename("'.mapsafeusermach.'","'.mapsafepath.'")' exe 'vnoremap :call NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")' - exe 'nnoremap d :call NetrwMakeDir("'.mapsafeusermach.'")' - exe 'nnoremap D :call NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")' - exe 'vnoremap D :call NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")' - exe 'nnoremap R :call NetrwRemoteRename("'.mapsafeusermach.'","'.mapsafepath.'")' - exe 'vnoremap R :call NetrwRemoteRename("'.mapsafeusermach.'","'.mapsafepath.'")' + exe 'vnoremap D :call NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")' + exe 'vnoremap R :call NetrwRemoteRename("'.mapsafeusermach.'","'.mapsafepath.'")' + exe 'inoremap :call NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")' + exe 'inoremap d :call NetrwMakeDir("'.mapsafeusermach.'")' + exe 'inoremap D :call NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")' + exe 'inoremap R :call NetrwRemoteRename("'.mapsafeusermach.'","'.mapsafepath.'")' nnoremap :he netrw-quickhelp + inoremap :he netrw-quickhelp endif call s:SetRexDir(a:islocal,b:netrw_curdir) " call Dret("s:BrowserMaps") @@ -1895,7 +2017,7 @@ endfun " 5: (user: ) go down (next) bookmark " 6: (user: ) 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! keepalt file ".fnameescape(s:method."://".s:user.s:machine."/".s:path)." (bt=".&bt.")") - exe "silent! keepalt file ".fnameescape(s:method."://".s:user.s:machine."/".s:path) - exe "silent keepalt doau BufReadPre ".fnameescape(s:fname) + exe "sil! keepalt file ".fnameescape(s:method."://".s:user.s:machine."/".s:path) + exe "sil keepalt doau BufReadPre ".fnameescape(s:fname) silent call netrw#NetRead(2,s:method."://".s:user.s:machine."/".s:path) if s:path !~ '.tar.bz2$' && s:path !~ '.tar.gz' " netrw.vim and tar.vim have already handled decompression of the tarball; avoiding gzip.vim error - exe "silent keepalt doau BufReadPost ".fnameescape(s:fname) + exe "sil keepalt doau BufReadPost ".fnameescape(s:fname) endif " save certain window-oriented variables into buffer-oriented variables {{{3 @@ -2201,6 +2327,7 @@ fun! s:NetrwBrowse(islocal,dirname) return endif " call FOTEST(11) +"call Decho("COMBAK#05 buf(%)#".bufnr("%")."<".bufname("%")."> win#".winnr()." bufnr(win#1)=".winbufnr(1)."<".bufname(winbufnr(1))." bufnr(win#2)=".winbufnr(2)."<".bufname(winbufnr(2)).">") " use buffer-oriented WinVars if buffer ones exist but window ones don't {{{3 call s:UseBufWinVars() @@ -2213,6 +2340,7 @@ fun! s:NetrwBrowse(islocal,dirname) " set up menu {{{3 call s:NetrwMenu(1) " call FOTEST(12) +"call Decho("COMBAK#06 buf(%)#".bufnr("%")."<".bufname("%")."> win#".winnr()." bufnr(win#1)=".winbufnr(1)."<".bufname(winbufnr(1))." bufnr(win#2)=".winbufnr(2)."<".bufname(winbufnr(2)).">") " set up buffer {{{3 let reusing= s:NetrwGetBuffer(a:islocal,dirname) @@ -2233,9 +2361,10 @@ fun! s:NetrwBrowse(islocal,dirname) return endif "" call FOTEST(13) " PROBLEM WITH LISTING +"call Decho("COMBAK#07 buf(%)#".bufnr("%")."<".bufname("%")."> win#".winnr()." bufnr(win#1)=".winbufnr(1)."<".bufname(winbufnr(1))." bufnr(win#2)=".winbufnr(2)."<".bufname(winbufnr(2)).">") " set b:netrw_curdir to the new directory name {{{3 -" call Decho("set b:netrw_curdir to the new directory name:") +" call Decho("set b:netrw_curdir to the new directory name: (buf#".bufnr("%").")") let b:netrw_curdir= dirname if b:netrw_curdir =~ '[/\\]$' let b:netrw_curdir= substitute(b:netrw_curdir,'[/\\]$','','e') @@ -2255,6 +2384,7 @@ fun! s:NetrwBrowse(islocal,dirname) endif " call Decho("b:netrw_curdir<".b:netrw_curdir.">") "" call FOTEST(14) " PROBLEM WITH LISTING +"call Decho("COMBAK#08 buf(%)#".bufnr("%")."<".bufname("%")."> win#".winnr()." bufnr(win#1)=".winbufnr(1)."<".bufname(winbufnr(1))." bufnr(win#2)=".winbufnr(2)."<".bufname(winbufnr(2)).">") " ------------ " (local only) {{{3 @@ -2272,7 +2402,7 @@ fun! s:NetrwBrowse(islocal,dirname) if !exists("&l:acd") || !&l:acd " call Decho('exe keepjumps lcd '.fnameescape(b:netrw_curdir)) try - exe 'keepjumps lcd '.fnameescape(b:netrw_curdir) + exe 'keepj lcd '.fnameescape(b:netrw_curdir) catch /^Vim\%((\a\+)\)\=:E472/ call netrw#ErrorMsg(s:ERROR,"unable to change directory to <".b:netrw_curdir."> (permissions?)",61) if exists("w:netrw_prvdir") @@ -2327,6 +2457,7 @@ fun! s:NetrwBrowse(islocal,dirname) " call Decho("b:netrw_curdir<".b:netrw_curdir."> (remote)") endif " (additional remote handling) "" call FOTEST(15) " PROBLEM WITH LISTING +"call Decho("COMBAK#09 buf(%)#".bufnr("%")."<".bufname("%")."> win#".winnr()." bufnr(win#1)=".winbufnr(1)."<".bufname(winbufnr(1))." bufnr(win#2)=".winbufnr(2)."<".bufname(winbufnr(2)).">") " ----------------------- " Directory Listing: {{{3 @@ -2335,6 +2466,7 @@ fun! s:NetrwBrowse(islocal,dirname) "" call FOTEST(16) " PROBLEM WITH LISTING call s:PerformListing(a:islocal) " call FOTEST(17) +"call Decho("COMBAK#10 buf(%)#".bufnr("%")."<".bufname("%")."> win#".winnr()." bufnr(win#1)=".winbufnr(1)."<".bufname(winbufnr(1))." bufnr(win#2)=".winbufnr(2)."<".bufname(winbufnr(2)).">") " The s:LocalBrowseShellCmdRefresh() function is called by an autocmd " installed by s:LocalFastBrowser() when g:netrw_fastbrowse <= 1 (ie. slow, medium speed). @@ -2445,21 +2577,29 @@ fun! s:NetrwGetBuffer(islocal,dirname) " call Decho(" handling approx match: bufnum#".bufnum."<".bufname(bufnum)."> approx-dirname<".dirname.">") let ibuf = 1 let buflast = bufnr("$") -" call Decho(" findbuf2: buflast=".buflast) +" call Decho(" findbuf2: buflast=bufnr($)=".buflast) while ibuf <= buflast let bname= substitute(bufname(ibuf),'\\','/','g') let bname= substitute(bname,'.\zs/$','','') -" call Decho(" findbuf3: while [ibuf=",ibuf."]<=[buflast=".buflast."]: dirname<".dirname."> bufname(".ibuf.")<".bname.">") - if bname != '' && dirname =~ '/'.bname.'/\=$' && dirname !~ '^/' -" call Decho(" findbuf3: passes test 1 : dirname<".dirname.'> =~ /'.bname.'/\=$ && dirname !~ ^/') +" call Decho(" findbuf3: while [ibuf=",ibuf."]<=[buflast=".buflast."]: dirname<".dirname."> bname=bufname(".ibuf.")<".bname.">") + if bname != '' && dirname =~ '/'.bname.'/\=$' && dirname !~ '^/' + " bname is not empty + " dirname ends with bname, + " dirname doesn't start with /, so its not a absolute path +" call Decho(" findbuf3a: passes test 1 : dirname<".dirname.'> =~ /'.bname.'/\=$ && dirname !~ ^/') break endif - if bname =~ '^'.dirname.'/\=$' -" call Decho(' findbuf3: passes test 2 : bname<'.bname.'>=~^'.dirname.'/\=$') + if bname =~ '^'.dirname.'/\=$' + " bname begins with dirname +" call Decho(' findbuf3b: passes test 2 : bname<'.bname.'>=~^'.dirname.'/\=$') break endif if dirname =~ '^'.bname.'/$' -" call Decho(' findbuf3: passes test 3 : dirname<'.dirname.'>=~^'.bname.'/$') +" call Decho(' findbuf3c: passes test 3 : dirname<'.dirname.'>=~^'.bname.'/$') + break + endif + if bname != '' && dirname =~ '/'.bname.'$' && bname == bufname("%") && line("$") == 1 +" call Decho(' findbuf3d: passes test 4 : dirname<'.dirname.'>=~ /'.bname.'$') break endif let ibuf= ibuf + 1 @@ -2474,9 +2614,9 @@ fun! s:NetrwGetBuffer(islocal,dirname) endif " get enew buffer and name it -or- re-use buffer {{{3 -" call Decho("--get enew buffer and name it OR re-use buffer-- (bufnum=".bufnum.")") - mark ' + keepj mark ' if bufnum < 0 || !bufexists(bufnum) +" call Decho("--get enew buffer and name it (bufexists([bufnum=".bufnum."])=".bufexists(bufnum).")") call s:NetrwEnew(dirname) " call Decho(" got enew buffer#".bufnr("%")." (altbuf<".expand("#").">)") " name the buffer @@ -2490,7 +2630,8 @@ fun! s:NetrwGetBuffer(islocal,dirname) endif let w:netrw_treebufnr= bufnr("%") " call Decho(" exe silent! keepalt file NetrwTreeListing ".fnameescape(s:netrw_treelistnum)) - exe 'silent! keepalt file NetrwTreeListing\ '.fnameescape(s:netrw_treelistnum) + exe 'sil! keepalt file NetrwTreeListing\ '.fnameescape(s:netrw_treelistnum) + set bt=nofile noswf nnoremap [ :silent call TreeListMove('[') nnoremap ] :silent call TreeListMove(']') nnoremap [[ :silent call TreeListMove('[') @@ -2499,15 +2640,16 @@ fun! s:NetrwGetBuffer(islocal,dirname) else " let v:errmsg= "" " Decho let escdirname= fnameescape(dirname) -" call Decho(" errmsg<".v:errmsg."> bufnr(".escdirname.")=".bufnr(escdirname)."<".bufname(bufnr(escdirname)).">") +" call Decho(" errmsg<".v:errmsg."> bufnr(escdirname<".escdirname.">)=".bufnr(escdirname)." bufname()<".bufname(bufnr(escdirname)).">") " call Decho(' exe silent! keepalt file '.escdirname) - exe 'silent! keepalt file '.escdirname +" let v:errmsg= "" " Decho + exe 'sil! keepalt file '.escdirname " call Decho(" errmsg<".v:errmsg."> bufnr(".escdirname.")=".bufnr(escdirname)."<".bufname(bufnr(escdirname)).">") endif " call Decho(" named enew buffer#".bufnr("%")."<".bufname("%").">") else " Re-use the buffer -" call Decho("--re-use buffer#".bufnum.": --") +" call Decho("--re-use buffer#".bufnum." (bufexists([bufnum=".bufnum."])=".bufexists(bufnum).")") let eikeep= &ei set ei=all if getline(2) =~ '^" Netrw Directory Listing' @@ -2519,7 +2661,7 @@ fun! s:NetrwGetBuffer(islocal,dirname) endif if bufname("%") == '.' " call Decho("exe silent! keepalt file ".fnameescape(getcwd())) - exe "silent! keepalt file ".fnameescape(getcwd()) + exe "sil! keepalt file ".fnameescape(getcwd()) endif let &ei= eikeep if line("$") <= 1 @@ -2529,7 +2671,7 @@ fun! s:NetrwGetBuffer(islocal,dirname) elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST " call Decho("--re-use tree listing--") " call Decho(" clear buffer<".expand("%")."> with :%d") - silent %d + sil keepj %d call s:NetrwListSettings(a:islocal) " call Dret("s:NetrwGetBuffer 0 : re-using buffer#".bufnr("%").", but treelist mode always needs a refresh") return 0 @@ -2544,7 +2686,7 @@ fun! s:NetrwGetBuffer(islocal,dirname) " slow 0 D D Deleting a buffer implies it will not be re-used (slow) " med 1 D H " fast 2 H H -" call Decho("--do netrw settings: make this buffer not-a-file, modifiable, not line-numbered, etc--") +" call Decho("--do netrw settings: make this buffer#".bufnr("%")." not-a-file, modifiable, not line-numbered, etc--") let fname= expand("%") call s:NetrwListSettings(a:islocal) " call Decho("exe keepalt file ".fnameescape(fname)) @@ -2553,7 +2695,7 @@ fun! s:NetrwGetBuffer(islocal,dirname) " delete all lines from buffer {{{3 " call Decho("--delete all lines from buffer--") " call Decho(" clear buffer<".expand("%")."> with :%d") - keepalt silent! %d + sil! keepalt keepj %d " call Dret("s:NetrwGetBuffer 0 : buf#".bufnr("%")) return 0 @@ -2595,12 +2737,12 @@ fun! s:NetrwGetWord() if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt " Active Banner support " call Decho("active banner handling") - norm! 0 + keepj norm! 0 let dirname= "./" let curline= getline('.') if curline =~ '"\s*Sorted by\s' - norm s + keepj norm s let s:netrw_skipbrowse= 1 echo 'Pressing "s" also works' @@ -2609,27 +2751,27 @@ fun! s:NetrwGetWord() echo 'Press "S" to edit sorting sequence' elseif curline =~ '"\s*Quick Help:' - norm ? + keepj norm ? let s:netrw_skipbrowse= 1 echo 'Pressing "?" also works' elseif curline =~ '"\s*\%(Hiding\|Showing\):' - norm a + keepj norm a let s:netrw_skipbrowse= 1 echo 'Pressing "a" also works' elseif line("$") > w:netrw_bannercnt - exe 'silent keepjumps '.w:netrw_bannercnt + exe 'sil keepj '.w:netrw_bannercnt endif elseif w:netrw_liststyle == s:THINLIST " call Decho("thin column handling") - norm! 0 + keepj norm! 0 let dirname= getline('.') elseif w:netrw_liststyle == s:LONGLIST " call Decho("long column handling") - norm! 0 + keepj norm! 0 let dirname= substitute(getline('.'),'^\(\%(\S\+ \)*\S\+\).\{-}$','\1','e') elseif w:netrw_liststyle == s:TREELIST @@ -2652,18 +2794,18 @@ fun! s:NetrwGetWord() " call Decho("filestart= ([virtcol=".virtcol(".")."]/[b:netrw_cpf=".b:netrw_cpf."])*b:netrw_cpf=".filestart." bannercnt=".w:netrw_bannercnt) " call Decho("1: dirname<".dirname.">") if filestart == 0 - norm! 0ma + keepj norm! 0ma else call cursor(line("."),filestart+1) - norm! ma + keepj norm! ma endif let rega= @a let eofname= filestart + b:netrw_cpf + 1 if eofname <= col("$") call cursor(line("."),filestart+b:netrw_cpf+1) - norm! "ay`a + keepj norm! "ay`a else - norm! "ay$ + keepj norm! "ay$ endif let dirname = @a let @a = rega @@ -2683,7 +2825,7 @@ fun! s:NetrwGetWord() endfun " --------------------------------------------------------------------- -" s:NetrwListSettings: {{{2 +" s:NetrwListSettings: make standard settings for a netrw listing {{{2 fun! s:NetrwListSettings(islocal) " call Dfunc("s:NetrwListSettings(islocal=".a:islocal.")") let fname= bufname("%") @@ -2749,35 +2891,23 @@ fun! s:NetrwListStyle(islocal) " clear buffer - this will cause NetrwBrowse/LocalBrowseCheck to do a refresh " call Decho("clear buffer<".expand("%")."> with :%d") - %d + keepj %d + " following prevents tree listing buffer from being marked "modified" + setlocal nomod " refresh the listing +" call Decho("refresh the listing") let svpos= netrw#NetrwSavePosn() call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) call netrw#NetrwRestorePosn(svpos) - if w:netrw_liststyle != s:WIDELIST - if g:netrw_cursorline == 2 - setlocal cursorline - let &cursorcolumn= s:netrw_usercuc - elseif g:netrw_cursorline - setlocal cursorline -" call Decho("setlocal cursorline") - endif - else - if g:netrw_cursorline == 2 - setlocal cursorline cursorcolumn -" call Decho("setlocal cursorline cursorcolumn") - elseif g:netrw_cursorline - let &cursorline= s:netrw_usercul - endif - endif + call s:NetrwCursorline() " keep cursor on the filename - silent keepjumps $ + sil keepj $ let result= search('\%(^\%(|\+\s\)\=\|\s\{2,}\)\zs'.escape(fname,'.\[]*$^').'\%(\s\{2,}\|$\)','bc') " call Decho("search result=".result." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'N/A')) if result <= 0 && exists("w:netrw_bannercnt") - exe "keepjumps ".w:netrw_bannercnt + exe "keepj ".w:netrw_bannercnt endif " call Dret("NetrwListStyle".(exists("w:netrw_liststyle")? ' : w:netrw_liststyle='.w:netrw_liststyle : "")) @@ -2797,11 +2927,11 @@ fun! s:NetrwBannerCtrl(islocal) " keep cursor on the filename let fname= s:NetrwGetWord() - silent keepjumps $ + sil keepj $ let result= search('\%(^\%(|\+\s\)\=\|\s\{2,}\)\zs'.escape(fname,'.\[]*$^').'\%(\s\{2,}\|$\)','bc') " call Decho("search result=".result." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'N/A')) if result <= 0 && exists("w:netrw_bannercnt") - exe "keepjumps ".w:netrw_bannercnt + exe "keepj ".w:netrw_bannercnt endif " call Dret("s:NetrwBannerCtrl : g:netrw_banner=".g:netrw_banner) endfun @@ -2821,8 +2951,8 @@ fun! s:NetrwBookmarkMenu() if has("gui") && has("menu") && has("gui_running") && &go =~ 'm' && g:netrw_menu if exists("g:NetrwTopLvlMenu") " call Decho("removing ".g:NetrwTopLvlMenu."Bookmarks menu item(s)") - exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Bookmarks' - exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Bookmark\ Delete' + exe 'sil! unmenu '.g:NetrwTopLvlMenu.'Bookmarks' + exe 'sil! unmenu '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Bookmark\ Delete' endif if !exists("s:netrw_initbookhist") call s:NetrwBookHistRead() @@ -2833,13 +2963,13 @@ fun! s:NetrwBookmarkMenu() let cnt= 1 for bmd in g:netrw_bookmarklist " call Decho('silent! menu '.g:NetrwMenuPriority.".2.".cnt." ".g:NetrwTopLvlMenu.'Bookmark.'.bmd.' :e '.bmd) - let bmd= escape(bmd,'. ') + let bmd= escape(bmd,g:netrw_menu_escape) " show bookmarks for goto menu - exe 'silent! menu '.g:NetrwMenuPriority.".2.".cnt." ".g:NetrwTopLvlMenu.'Bookmarks.'.bmd.' :e '.bmd."\" + exe 'sil! menu '.g:NetrwMenuPriority.".2.".cnt." ".g:NetrwTopLvlMenu.'Bookmarks.'.bmd.' :e '.bmd."\" " show bookmarks for deletion menu - exe 'silent! menu '.g:NetrwMenuPriority.".8.2.".cnt." ".g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Bookmark\ Delete.'.bmd.' '.cnt."mB" + exe 'sil! menu '.g:NetrwMenuPriority.".8.2.".cnt." ".g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Bookmark\ Delete.'.bmd.' '.cnt."mB" let cnt= cnt + 1 endfor @@ -2853,9 +2983,9 @@ fun! s:NetrwBookmarkMenu() let histcnt = histcnt + 1 let priority = g:netrw_dirhist_cnt + histcnt if exists("g:netrw_dirhist_{cnt}") - let histdir= escape(g:netrw_dirhist_{cnt},'./&? ') + let histdir= escape(g:netrw_dirhist_{cnt},g:netrw_menu_escape) " call Decho('silent! menu '.g:NetrwMenuPriority.".3.".priority." ".g:NetrwTopLvlMenu.'History.'.histdir.' :e '.histdir) - exe 'silent! menu '.g:NetrwMenuPriority.".3.".priority." ".g:NetrwTopLvlMenu.'History.'.histdir.' :e '.histdir."\" + exe 'sil! menu '.g:NetrwMenuPriority.".3.".priority." ".g:NetrwTopLvlMenu.'History.'.histdir.' :e '.histdir."\" endif let first = 0 let cnt = ( cnt - 1 ) % g:netrw_dirhistmax @@ -2886,26 +3016,17 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) return endif - " check if the status bar was clicked on instead of a file/directory name - call feedkeys("\") - let c= getchar() - let mouse_lnum = v:mouse_lnum - let wlastline = line('w$') - let lastline = line('$') -" call Decho("v:mouse_lnum=".mouse_lnum." line(w$)=".wlastline." line($)=".lastline) - if mouse_lnum == wlastline + 1 || v:mouse_win != winnr() -" call Decho("appears to be a status bar leftmouse click") - " appears to be a status bar leftmouse click - return - endif - call s:NetrwOptionSave("s:") call s:NetrwSafeOptions() let nbcd_curpos = netrw#NetrwSavePosn() let s:nbcd_curpos_{bufnr('%')} = nbcd_curpos - let dirname = substitute(b:netrw_curdir,'\\','/','ge') - let newdir = a:newdir - let dolockout = 0 + if (has("win32") || has("win95") || has("win64") || has("win16")) + let dirname = substitute(b:netrw_curdir,'\\','/','ge') + else + let dirname= b:netrw_curdir + endif + let newdir = a:newdir + let dolockout = 0 " set up o/s-dependent directory recognition pattern if has("amiga") @@ -3028,7 +3149,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) " call Decho("clear buffer<".expand("%")."> with :%d") setlocal noro ma " call Decho("setlocal noro ma") - keepjumps %d + keepj %d endif if has("amiga") @@ -3064,7 +3185,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) " call Decho("setlocal noro ma") if !(exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir")) " call Decho("clear buffer<".expand("%")."> with :%d") - keepjumps %d + keepj %d endif let treedir = s:NetrwTreeDir() let s:treecurpos = nbcd_curpos @@ -3107,7 +3228,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) call remove(w:netrw_treedict,treedir) " call Decho("removed entry<".treedir."> from treedict") " call Decho("yielding treedict<".string(w:netrw_treedict).">") - let dirname = w:netrw_treetop + let dirname= w:netrw_treetop else " go down one directory let dirname= substitute(treedir,'/*$','/','') @@ -3204,6 +3325,11 @@ fun! netrw#NetrwBrowseX(fname,remote) endif else let fname= a:fname + " special ~ handler for local + if fname =~ '^\~' && expand("$HOME") != "" +" call Decho('invoking special ~ handler') + let fname= substitute(fname,'^\~',expand("$HOME"),'') + endif endif " call Decho("fname<".fname.">") " call Decho("exten<".exten."> "."netrwFileHandlers#NFH_".exten."():exists=".exists("*netrwFileHandlers#NFH_".exten)) @@ -3270,17 +3396,17 @@ fun! netrw#NetrwBrowseX(fname,remote) elseif has("unix") && executable("gnome-open") && !s:haskdeinit " call Decho("exe silent !gnome-open ".shellescape(fname,1)." ".redir) - exe "silent !gnome-open ".shellescape(fname,1).redir + exe "sil !gnome-open ".shellescape(fname,1).redir let ret= v:shell_error elseif has("unix") && executable("kfmclient") && s:haskdeinit " call Decho("exe silent !kfmclient exec ".shellescape(fname,1)." ".redir) - exe "silent !kfmclient exec ".shellescape(fname,1)." ".redir + exe "sil !kfmclient exec ".shellescape(fname,1)." ".redir let ret= v:shell_error elseif has("macunix") && executable("open") " call Decho("exe silent !open ".shellescape(fname,1)." ".redir) - exe "silent !open ".shellescape(fname,1)." ".redir + exe "sil !open ".shellescape(fname,1)." ".redir let ret= v:shell_error else @@ -3311,7 +3437,7 @@ fun! netrw#NetrwBrowseX(fname,remote) if g:netrw_use_noswf setlocal noswf endif - exe "norm! \" + exe "keepj norm! \" " redraw! endif @@ -3381,19 +3507,19 @@ fun! netrw#Explore(indx,dosplit,style,...) let b:netrw_curdir= getcwd() " call Decho("set b:netrw_curdir<".b:netrw_curdir."> (used getcwd)") endif - let curdir = b:netrw_curdir + let curdir = simplify(b:netrw_curdir) let curfiledir = substitute(expand("%:p"),'^\(.*[/\\]\)[^/\\]*$','\1','e') " call Decho("curdir<".curdir."> curfiledir<".curfiledir.">") " call FOTEST(1) " save registers - silent! let keepregstar = @* - silent! let keepregplus = @+ - silent! let keepregslash= @/ + sil! let keepregstar = @* + sil! let keepregplus = @+ + sil! let keepregslash= @/ " if dosplit or file has been modified if a:dosplit || &modified || a:style == 6 -" call Decho("case: dosplit=".a:dosplit." modified=".&modified." a:style=".a:style) +" call Decho("case dosplit=".a:dosplit." modified=".&modified." a:style=".a:style.": dosplit or file has been modified") call s:SaveWinVars() let winsize= g:netrw_winsize if a:indx > 0 @@ -3431,35 +3557,53 @@ fun! netrw#Explore(indx,dosplit,style,...) call s:RestoreBufVars() endif call s:RestoreWinVars() +" else " Decho +" call Decho("case a:dosplit=".a:dosplit." AND modified=".&modified." AND a:style=".a:style." is not 6") endif - norm! 0 + keepj norm! 0 " call FOTEST(2) if a:0 > 0 -" call Decho("case [a:0=".a:0."]>0: a:1<".a:1.">") +" call Decho("case [a:0=".a:0."] > 0: a:1<".a:1.">") if a:1 =~ '^\~' && (has("unix") || (exists("g:netrw_cygwin") && g:netrw_cygwin)) - let dirname= substitute(a:1,'\~',expand("$HOME"),'') +" call Decho("case a:1: ~ and unix or cygwin") + let dirname= simplify(substitute(a:1,'\~',expand("$HOME"),'')) " call Decho("using dirname<".dirname."> (case: ~ && unix||cygwin)") elseif a:1 == '.' - let dirname= exists("b:netrw_curdir")? b:netrw_curdir : getcwd() +" call Decho("case a:1: .") + let dirname= simplify(exists("b:netrw_curdir")? b:netrw_curdir : getcwd()) if dirname !~ '/$' let dirname= dirname."/" endif " call Decho("using dirname<".dirname."> (case: ".(exists("b:netrw_curdir")? "b:netrw_curdir" : "getcwd()").")") elseif a:1 =~ '\$' - let dirname= expand(a:1) +" call Decho("case a:1: $") + let dirname= simplify(expand(a:1)) " call Decho("using user-specified dirname<".dirname."> with $env-var") - else - let dirname= a:1 + elseif a:1 !~ '^\*/' +" call Decho("case a:1: other, not pattern or filepattern") + let dirname= simplify(a:1) " call Decho("using user-specified dirname<".dirname.">") + else +" call Decho("case a:1: pattern or filepattern") + let dirname= a:1 endif else " clear explore +" call Decho("case a:0=".a:0.": clearing Explore list") call s:NetrwClearExplore() " call Dret("netrw#Explore : cleared list") return endif + " call FOTEST(3) +" call Decho("dirname<".dirname.">") + if dirname =~ '\.\./\=$' + let dirname= simplify(fnamemodify(dirname,':p:h')) + elseif dirname =~ '\.\.' || dirname == '.' + let dirname= simplify(fnamemodify(dirname,':p')) + endif +" call Decho("dirname<".dirname."> (after simplify)") if dirname =~ '/\*\*/' " handle .../**/.../filepat @@ -3524,9 +3668,9 @@ fun! netrw#Explore(indx,dosplit,style,...) " call Decho("curdir<".curdir.">") if has("win32") || has("win95") || has("win64") || has("win16") - call search('\<'.substitute(curdir,'^.*[/\\]','','e').'\>','cW') + keepj call search('\<'.substitute(curdir,'^.*[/\\]','','e').'\>','cW') else - call search('\<'.substitute(curdir,'^.*/','','e').'\>','cW') + keepj call search('\<'.substitute(curdir,'^.*/','','e').'\>','cW') endif " starpat=1: Explore *//pattern (current directory only search for files containing pattern) @@ -3557,9 +3701,9 @@ fun! netrw#Explore(indx,dosplit,style,...) " call Decho("case Nexplore with starpat=".starpat.": (indx=".indx.")") if !exists("w:netrw_explore_list") " sanity check call netrw#ErrorMsg(s:WARNING,"using Nexplore or improperly; see help for netrw-starstar",40) - silent! let @* = keepregstar - silent! let @+ = keepregstar - silent! let @/ = keepregslash + sil! let @* = keepregstar + sil! let @+ = keepregstar + sil! let @/ = keepregslash " call Dret("netrw#Explore") return endif @@ -3580,9 +3724,9 @@ fun! netrw#Explore(indx,dosplit,style,...) " call Decho("case Pexplore with starpat=".starpat.": (indx=".indx.")") if !exists("w:netrw_explore_list") " sanity check call netrw#ErrorMsg(s:WARNING,"using Pexplore or improperly; see help for netrw-starstar",41) - silent! let @* = keepregstar - silent! let @+ = keepregstar - silent! let @/ = keepregslash + sil! let @* = keepregstar + sil! let @+ = keepregstar + sil! let @/ = keepregslash " call Dret("netrw#Explore") return endif @@ -3615,7 +3759,7 @@ fun! netrw#Explore(indx,dosplit,style,...) " call Decho("starpat=".starpat.": build *//pattern list") " call Decho("pattern<".pattern.">") try - exe "noautocmd vimgrep /".pattern."/gj ".fnameescape(b:netrw_curdir)."/*" + exe "keepj noautocmd vimgrep /".pattern."/gj ".fnameescape(b:netrw_curdir)."/*" catch /^Vim\%((\a\+)\)\=:E480/ call netrw#ErrorMsg(s:WARNING,"no match with pattern<".pattern.">",76) " call Dret("netrw#Explore : unable to find pattern<".pattern.">") @@ -3628,7 +3772,7 @@ fun! netrw#Explore(indx,dosplit,style,...) " starpat=2: Explore **//pattern (recursive descent search for files containing pattern) " call Decho("starpat=".starpat.": build **//pattern list") try - exe "silent noautocmd vimgrep /".pattern."/gj "."**/*" + exe "sil keepj noautocmd vimgrep /".pattern."/gj "."**/*" catch /^Vim\%((\a\+)\)\=:E480/ call netrw#ErrorMsg(s:WARNING,'no files matched pattern<'.pattern.'>',45) if &hls | let keepregslash= s:ExplorePatHls(pattern) | endif @@ -3665,9 +3809,9 @@ fun! netrw#Explore(indx,dosplit,style,...) if w:netrw_explore_listlen == 0 || (w:netrw_explore_listlen == 1 && w:netrw_explore_list[0] =~ '\*\*\/') call netrw#ErrorMsg(s:WARNING,"no files matched",42) - silent! let @* = keepregstar - silent! let @+ = keepregstar - silent! let @/ = keepregslash + sil! let @* = keepregstar + sil! let @+ = keepregstar + sil! let @/ = keepregslash " call Dret("netrw#Explore : no files matched") return endif @@ -3696,9 +3840,9 @@ fun! netrw#Explore(indx,dosplit,style,...) let w:netrw_liststyle= g:netrw_liststyle endif if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:LONGLIST - call search('^'.substitute(dirfile,"^.*/","","").'\>',"W") + keepj call search('^'.substitute(dirfile,"^.*/","","").'\>',"W") else - call search('\<'.substitute(dirfile,"^.*/","","").'\>',"w") + keepj call search('\<'.substitute(dirfile,"^.*/","","").'\>',"w") endif let w:netrw_explore_mtchcnt = indx + 1 let w:netrw_explore_bufnr = bufnr("%") @@ -3711,9 +3855,9 @@ fun! netrw#Explore(indx,dosplit,style,...) if !exists("g:netrw_quiet") call netrw#ErrorMsg(s:WARNING,"your vim needs the +path_extra feature for Exploring with **!",44) endif - silent! let @* = keepregstar - silent! let @+ = keepregstar - silent! let @/ = keepregslash + sil! let @* = keepregstar + sil! let @+ = keepregstar + sil! let @/ = keepregslash " call Dret("netrw#Explore : missing +path_extra") return endif @@ -3721,8 +3865,8 @@ fun! netrw#Explore(indx,dosplit,style,...) else " call Decho("default case: Explore newdir<".dirname.">") if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && dirname =~ '/' - silent! unlet w:netrw_treedict - silent! unlet w:netrw_treetop + sil! unlet w:netrw_treedict + sil! unlet w:netrw_treetop endif let newdir= dirname if !exists("b:netrw_curdir") @@ -3778,9 +3922,9 @@ fun! netrw#Explore(indx,dosplit,style,...) endif " call FOTEST(6) - silent! let @* = keepregstar - silent! let @+ = keepregstar - silent! let @/ = keepregslash + sil! let @* = keepregstar + sil! let @+ = keepregstar + sil! let @/ = keepregslash " call Dret("netrw#Explore : @/<".@/.">") endfun @@ -3843,7 +3987,7 @@ fun! s:NetrwHide(islocal) " switch between show-all/show-not-hidden/show-hidden let g:netrw_hide=(g:netrw_hide+1)%3 - exe "norm! 0" + exe "keepj norm! 0" if g:netrw_hide && g:netrw_list_hide == "" call netrw#ErrorMsg(s:WARNING,"your hiding list is empty!",49) " call Dret("NetrwHide") @@ -3917,6 +4061,25 @@ endfun " s:NetrwLeftmouse: handles the when in a netrw browsing window {{{2 fun! s:NetrwLeftmouse(islocal) " call Dfunc("s:NetrwLeftmouse(islocal=".a:islocal.")") + + " check if the status bar was clicked on instead of a file/directory name + call feedkeys("\") + let c= getchar() + let mouse_lnum = v:mouse_lnum + let wlastline = line('w$') + let lastline = line('$') +" call Decho("v:mouse_lnum=".mouse_lnum." line(w$)=".wlastline." line($)=".lastline." v:mouse_win=".v:mouse_win." winnr#".winnr()) +" call Decho("v:mouse_col =".v:mouse_col." col=".col(".")." wincol =".wincol()." winwidth =".winwidth(0)) + if mouse_lnum >= wlastline + 1 || v:mouse_win != winnr() + " appears to be a status bar leftmouse click +" call Dret("s:NetrwLeftmouse : detected a status bar leftmouse click") + return + endif + if v:mouse_col != col('.') +" call Dret("s:NetrwLeftmouse : detected a vertical separator bar leftmouse click") + return + endif + if a:islocal if exists("b:netrw_curdir") call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord())) @@ -3955,15 +4118,15 @@ fun! s:NetrwListHide() " Prune the list by hiding any files which match if g:netrw_hide == 1 " call Decho("hiding<".hide."> listhide<".listhide.">") - exe 'silent keepjumps '.w:netrw_bannercnt.',$g'.sep.hide.sep.'d' + exe 'sil keepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'d' elseif g:netrw_hide == 2 " call Decho("showing<".hide."> listhide<".listhide.">") - exe 'silent keepjumps '.w:netrw_bannercnt.',$g'.sep.hide.sep.'s@^@ /-KEEP-/ @' + exe 'sil keepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'s@^@ /-KEEP-/ @' endif endwhile if g:netrw_hide == 2 - exe 'silent keepjumps '.w:netrw_bannercnt.',$v@^ /-KEEP-/ @d' - exe 'silent keepjumps '.w:netrw_bannercnt.',$s@^\%( /-KEEP-/ \)\+@@e' + exe 'sil keepj '.w:netrw_bannercnt.',$v@^ /-KEEP-/ @d' + exe 'sil keepj '.w:netrw_bannercnt.',$s@^\%( /-KEEP-/ \)\+@@e' endif " call Dret("NetrwListHide") @@ -3985,7 +4148,7 @@ fun! s:NetrwHideEdit(islocal) " call Decho("new g:netrw_list_hide<".g:netrw_list_hide.">") " refresh the listing - silent call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,"./")) + silent keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,"./")) " restore cursor position call netrw#NetrwRestorePosn(svpos) @@ -4057,12 +4220,12 @@ fun! s:NetrwMakeDir(usrhost) call mkdir(fullnewdir,"p") else let netrw_origdir= s:NetrwGetcwd(1) - exe 'keepjumps lcd '.fnameescape(b:netrw_curdir) + exe 'keepj lcd '.fnameescape(b:netrw_curdir) " call Decho("netrw_origdir<".netrw_origdir.">: lcd b:netrw_curdir<".fnameescape(b:netrw_curdir).">") " call Decho("exe silent! !".g:netrw_local_mkdir.' '.shellescape(newdirname,1)) - exe "silent! !".g:netrw_local_mkdir.' '.shellescape(newdirname,1) + exe "sil! !".g:netrw_local_mkdir.' '.shellescape(newdirname,1) if !g:netrw_keepdir - exe 'keepjumps lcd '.fnameescape(netrw_origdir) + exe 'keepj lcd '.fnameescape(netrw_origdir) " call Decho("netrw_keepdir=".g:netrw_keepdir.": keepjumps lcd ".fnameescape(netrw_origdir)." getcwd<".getcwd().">") endif endif @@ -4084,7 +4247,7 @@ fun! s:NetrwMakeDir(usrhost) let mkdircmd = s:MakeSshCmd(g:netrw_mkdir_cmd) let newdirname= substitute(b:netrw_curdir,'^\%(.\{-}/\)\{3}\(.*\)$','\1','').newdirname " call Decho("exe silent! !".mkdircmd." ".shellescape(newdirname,1)) - exe "silent! !".mkdircmd." ".shellescape(newdirname,1) + exe "sil! !".mkdircmd." ".shellescape(newdirname,1) if v:shell_error == 0 " refresh listing let svpos= netrw#NetrwSavePosn() @@ -4330,10 +4493,10 @@ fun! s:NetrwMarkFileCopy(islocal) if exists("*mkdir") call mkdir(tmpdir) else - exe "silent! !".g:netrw_local_mkdir.' '.shellescape(tmpdir,1) + exe "sil! !".g:netrw_local_mkdir.' '.shellescape(tmpdir,1) endif if isdirectory(tmpdir) - exe "keepjumps lcd ".fnameescape(tmpdir) + exe "keepj lcd ".fnameescape(tmpdir) call netrw#NetrwObtain(a:islocal,s:netrwmarkfilelist_{bufnr('%')},tmpdir) let localfiles= map(deepcopy(s:netrwmarkfilelist_{bufnr('%')}),'substitute(v:val,"^.*/","","")') call s:NetrwUpload(localfiles,s:netrwmftgt) @@ -4341,10 +4504,10 @@ fun! s:NetrwMarkFileCopy(islocal) for fname in s:netrwmarkfilelist_{bufnr('%')} call s:NetrwDelete(fname) endfor - exe "keepjumps lcd ".fnameescape(curdir) - exe "silent !".g:netrw_local_rmdir." ".shellescape(tmpdir,1) + exe "keepj lcd ".fnameescape(curdir) + exe "sil !".g:netrw_local_rmdir." ".shellescape(tmpdir,1) else - exe "keepjumps lcd ".fnameescape(curdir) + exe "keepj lcd ".fnameescape(curdir) endif endif endif @@ -4570,7 +4733,7 @@ fun! s:NetrwMarkFileGrep(islocal) " use vimgrep for both local and remote " call Decho("exe vimgrep".pat." ".netrwmarkfilelist) try - exe "noautocmd vimgrep".pat." ".netrwmarkfilelist + exe "keepj noautocmd vimgrep".pat." ".netrwmarkfilelist catch /^Vim\%((\a\+)\)\=:E480/ call netrw#ErrorMsg(s:WARNING,"no match with pattern<".pattern.">",76) " call Dret("s:NetrwMarkFileGrep : unable to find pattern<".pattern.">") @@ -4750,33 +4913,33 @@ fun! s:NetrwMarkFileRegexp(islocal) " convert displayed listing into a filelist let eikeep = &ei let areg = @a - silent %y a + sil keepj %y a set ei=all ma " call Decho("set ei=all ma") 1split call s:NetrwEnew() call s:NetrwSafeOptions() - silent norm! "ap - 2 + sil keepj norm! "ap + keepj 2 let bannercnt= search('^" =====','W') - exe "silent 1,".bannercnt."d" + exe "sil keepj 1,".bannercnt."d" set bt=nofile if g:netrw_liststyle == s:LONGLIST - silent %s/\s\{2,}\S.*$//e + sil keepj %s/\s\{2,}\S.*$//e call histdel("/",-1) elseif g:netrw_liststyle == s:WIDELIST - silent %s/\s\{2,}/\r/ge + sil keepj %s/\s\{2,}/\r/ge call histdel("/",-1) elseif g:netrw_liststyle == s:TREELIST - silent %s/^| //e - silent! g/^ .*$/d + sil keepj %s/^| //e + sil! keepj g/^ .*$/d call histdel("/",-1) call histdel("/",-1) endif " convert regexp into the more usual glob-style format let regexp= substitute(regexp,'\*','.*','g') " call Decho("regexp<".regexp.">") - exe "silent! v/".escape(regexp,'/')."/d" + exe "sil! keepj v/".escape(regexp,'/')."/d" call histdel("/",-1) let filelist= getline(1,line("$")) q! @@ -4847,7 +5010,7 @@ fun! s:NetrwMarkFileTag(islocal) e tags let path= substitute(curdir,'^\(.*\)/[^/]*$','\1/','') " call Decho("curdir<".curdir."> path<".path.">") - exe '%s/\t\(\S\+\)\t/\t'.escape(path,"/\n\r\\").'\1\t/e' + exe 'keepj %s/\t\(\S\+\)\t/\t'.escape(path,"/\n\r\\").'\1\t/e' call histdel("/",-1) wq! endif @@ -4914,7 +5077,7 @@ fun! s:NetrwMarkFileTgt(islocal) call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) call netrw#NetrwRestorePosn(svpos) if !hadtgt - norm! j + sil! keepj norm! j endif " call Dret("s:NetrwMarkFileTgt : netrwmftgt<".(exists("s:netrwmftgt")? s:netrwmftgt : "").">") @@ -5042,55 +5205,55 @@ fun! s:NetrwMenu(domenu) if !exists("s:netrw_menu_enabled") && a:domenu " call Decho("initialize menu") let s:netrw_menu_enabled= 1 - exe 'silent! menu '.g:NetrwMenuPriority.'.1 '.g:NetrwTopLvlMenu.'Help ' - exe 'silent! menu '.g:NetrwMenuPriority.'.5 '.g:NetrwTopLvlMenu.'-Sep1- :' - exe 'silent! menu '.g:NetrwMenuPriority.'.6 '.g:NetrwTopLvlMenu.'Go\ Up\ Directory- -' - exe 'silent! menu '.g:NetrwMenuPriority.'.7 '.g:NetrwTopLvlMenu.'Apply\ Special\ Viewerx x' - exe 'silent! menu '.g:NetrwMenuPriority.'.8.1 '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Bookmark\ Current\ Directorymb mb' - exe 'silent! menu '.g:NetrwMenuPriority.'.8.4 '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Goto\ Prev\ Dir\ (History)u u' - exe 'silent! menu '.g:NetrwMenuPriority.'.8.5 '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Goto\ Next\ Dir\ (History)U U' - exe 'silent! menu '.g:NetrwMenuPriority.'.8.6 '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Listqb qb' - exe 'silent! menu '.g:NetrwMenuPriority.'.9.1 '.g:NetrwTopLvlMenu.'Browsing\ Control.Edit\ File\ Hiding\ List'." \'" - exe 'silent! menu '.g:NetrwMenuPriority.'.9.2 '.g:NetrwTopLvlMenu.'Browsing\ Control.Edit\ Sorting\ SequenceS S' - exe 'silent! menu '.g:NetrwMenuPriority.'.9.3 '.g:NetrwTopLvlMenu.'Browsing\ Control.Quick\ Hide/Unhide\ Dot\ Files'."gh gh" - exe 'silent! menu '.g:NetrwMenuPriority.'.9.4 '.g:NetrwTopLvlMenu.'Browsing\ Control.Refresh\ Listing'." \" - exe 'silent! menu '.g:NetrwMenuPriority.'.9.5 '.g:NetrwTopLvlMenu.'Browsing\ Control.Settings/Options:NetrwSettings '.":NetrwSettings\" - exe 'silent! menu '.g:NetrwMenuPriority.'.10 '.g:NetrwTopLvlMenu.'Delete\ File/DirectoryD D' - exe 'silent! menu '.g:NetrwMenuPriority.'.11.1 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ Current\ Window '."\" - exe 'silent! menu '.g:NetrwMenuPriority.'.11.2 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.Preview\ File/Directoryp p' - exe 'silent! menu '.g:NetrwMenuPriority.'.11.3 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ Previous\ WindowP P' - exe 'silent! menu '.g:NetrwMenuPriority.'.11.4 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ New\ Windowo o' - exe 'silent! menu '.g:NetrwMenuPriority.'.11.5 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ New\ Vertical\ Windowv v' - exe 'silent! menu '.g:NetrwMenuPriority.'.12.1 '.g:NetrwTopLvlMenu.'Explore.Directory\ Name :Explore ' - exe 'silent! menu '.g:NetrwMenuPriority.'.12.2 '.g:NetrwTopLvlMenu.'Explore.Filenames\ Matching\ Pattern\ (curdir\ only):Explore\ */ :Explore */' - exe 'silent! menu '.g:NetrwMenuPriority.'.12.2 '.g:NetrwTopLvlMenu.'Explore.Filenames\ Matching\ Pattern\ (+subdirs):Explore\ **/ :Explore **/' - exe 'silent! menu '.g:NetrwMenuPriority.'.12.3 '.g:NetrwTopLvlMenu.'Explore.Files\ Containing\ String\ Pattern\ (curdir\ only):Explore\ *// :Explore *//' - exe 'silent! menu '.g:NetrwMenuPriority.'.12.4 '.g:NetrwTopLvlMenu.'Explore.Files\ Containing\ String\ Pattern\ (+subdirs):Explore\ **// :Explore **//' - exe 'silent! menu '.g:NetrwMenuPriority.'.12.4 '.g:NetrwTopLvlMenu.'Explore.Next\ Match:Nexplore :Nexplore' - exe 'silent! menu '.g:NetrwMenuPriority.'.12.4 '.g:NetrwTopLvlMenu.'Explore.Prev\ Match:Pexplore :Pexplore' - exe 'silent! menu '.g:NetrwMenuPriority.'.13 '.g:NetrwTopLvlMenu.'Make\ Subdirectoryd d' - exe 'silent! menu '.g:NetrwMenuPriority.'.14.1 '.g:NetrwTopLvlMenu.'Marked\ Files.Mark\ Filemf mf' - exe 'silent! menu '.g:NetrwMenuPriority.'.14.2 '.g:NetrwTopLvlMenu.'Marked\ Files.Mark\ Files\ by\ Regexpmr mr' - exe 'silent! menu '.g:NetrwMenuPriority.'.14.3 '.g:NetrwTopLvlMenu.'Marked\ Files.Hide-Show-List\ Controla a' - exe 'silent! menu '.g:NetrwMenuPriority.'.14.4 '.g:NetrwTopLvlMenu.'Marked\ Files.Copy\ To\ Targetmc mc' - exe 'silent! menu '.g:NetrwMenuPriority.'.14.5 '.g:NetrwTopLvlMenu.'Marked\ Files.DeleteD D' - exe 'silent! menu '.g:NetrwMenuPriority.'.14.6 '.g:NetrwTopLvlMenu.'Marked\ Files.Diffmd md' - exe 'silent! menu '.g:NetrwMenuPriority.'.14.7 '.g:NetrwTopLvlMenu.'Marked\ Files.Editme me' - exe 'silent! menu '.g:NetrwMenuPriority.'.14.8 '.g:NetrwTopLvlMenu.'Marked\ Files.Exe\ Cmdmx mx' - exe 'silent! menu '.g:NetrwMenuPriority.'.14.9 '.g:NetrwTopLvlMenu.'Marked\ Files.Move\ To\ Targetmm mm' - exe 'silent! menu '.g:NetrwMenuPriority.'.14.10 '.g:NetrwTopLvlMenu.'Marked\ Files.ObtainO O' - exe 'silent! menu '.g:NetrwMenuPriority.'.14.11 '.g:NetrwTopLvlMenu.'Marked\ Files.Printmp mp' - exe 'silent! menu '.g:NetrwMenuPriority.'.14.12 '.g:NetrwTopLvlMenu.'Marked\ Files.ReplaceR R' - exe 'silent! menu '.g:NetrwMenuPriority.'.14.13 '.g:NetrwTopLvlMenu.'Marked\ Files.Set\ Targetmt mt' - exe 'silent! menu '.g:NetrwMenuPriority.'.14.14 '.g:NetrwTopLvlMenu.'Marked\ Files.TagmT mT' - exe 'silent! menu '.g:NetrwMenuPriority.'.14.15 '.g:NetrwTopLvlMenu.'Marked\ Files.Zip/Unzip/Compress/Uncompressmz mz' - exe 'silent! menu '.g:NetrwMenuPriority.'.15 '.g:NetrwTopLvlMenu.'Obtain\ FileO O' - exe 'silent! menu '.g:NetrwMenuPriority.'.16.1 '.g:NetrwTopLvlMenu.'Style.Listing\ Style\ (thin-long-wide-tree)i i' - exe 'silent! menu '.g:NetrwMenuPriority.'.16.2 '.g:NetrwTopLvlMenu.'Style.Normal-Hide-Showa a' - exe 'silent! menu '.g:NetrwMenuPriority.'.16.3 '.g:NetrwTopLvlMenu.'Style.Reverse\ Sorting\ Order'."r r" - exe 'silent! menu '.g:NetrwMenuPriority.'.16.4 '.g:NetrwTopLvlMenu.'Style.Sorting\ Method\ (name-time-size)s s' - exe 'silent! menu '.g:NetrwMenuPriority.'.17 '.g:NetrwTopLvlMenu.'Rename\ File/DirectoryR R' - exe 'silent! menu '.g:NetrwMenuPriority.'.18 '.g:NetrwTopLvlMenu.'Set\ Current\ Directoryc c' + exe 'sil! menu '.g:NetrwMenuPriority.'.1 '.g:NetrwTopLvlMenu.'Help ' + exe 'sil! menu '.g:NetrwMenuPriority.'.5 '.g:NetrwTopLvlMenu.'-Sep1- :' + exe 'sil! menu '.g:NetrwMenuPriority.'.6 '.g:NetrwTopLvlMenu.'Go\ Up\ Directory- -' + exe 'sil! menu '.g:NetrwMenuPriority.'.7 '.g:NetrwTopLvlMenu.'Apply\ Special\ Viewerx x' + exe 'sil! menu '.g:NetrwMenuPriority.'.8.1 '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Bookmark\ Current\ Directorymb mb' + exe 'sil! menu '.g:NetrwMenuPriority.'.8.4 '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Goto\ Prev\ Dir\ (History)u u' + exe 'sil! menu '.g:NetrwMenuPriority.'.8.5 '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Goto\ Next\ Dir\ (History)U U' + exe 'sil! menu '.g:NetrwMenuPriority.'.8.6 '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Listqb qb' + exe 'sil! menu '.g:NetrwMenuPriority.'.9.1 '.g:NetrwTopLvlMenu.'Browsing\ Control.Edit\ File\ Hiding\ List'." \'" + exe 'sil! menu '.g:NetrwMenuPriority.'.9.2 '.g:NetrwTopLvlMenu.'Browsing\ Control.Edit\ Sorting\ SequenceS S' + exe 'sil! menu '.g:NetrwMenuPriority.'.9.3 '.g:NetrwTopLvlMenu.'Browsing\ Control.Quick\ Hide/Unhide\ Dot\ Files'."gh gh" + exe 'sil! menu '.g:NetrwMenuPriority.'.9.4 '.g:NetrwTopLvlMenu.'Browsing\ Control.Refresh\ Listing'." \" + exe 'sil! menu '.g:NetrwMenuPriority.'.9.5 '.g:NetrwTopLvlMenu.'Browsing\ Control.Settings/Options:NetrwSettings '.":NetrwSettings\" + exe 'sil! menu '.g:NetrwMenuPriority.'.10 '.g:NetrwTopLvlMenu.'Delete\ File/DirectoryD D' + exe 'sil! menu '.g:NetrwMenuPriority.'.11.1 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ Current\ Window '."\" + exe 'sil! menu '.g:NetrwMenuPriority.'.11.2 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.Preview\ File/Directoryp p' + exe 'sil! menu '.g:NetrwMenuPriority.'.11.3 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ Previous\ WindowP P' + exe 'sil! menu '.g:NetrwMenuPriority.'.11.4 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ New\ Windowo o' + exe 'sil! menu '.g:NetrwMenuPriority.'.11.5 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ New\ Vertical\ Windowv v' + exe 'sil! menu '.g:NetrwMenuPriority.'.12.1 '.g:NetrwTopLvlMenu.'Explore.Directory\ Name :Explore ' + exe 'sil! menu '.g:NetrwMenuPriority.'.12.2 '.g:NetrwTopLvlMenu.'Explore.Filenames\ Matching\ Pattern\ (curdir\ only):Explore\ */ :Explore */' + exe 'sil! menu '.g:NetrwMenuPriority.'.12.2 '.g:NetrwTopLvlMenu.'Explore.Filenames\ Matching\ Pattern\ (+subdirs):Explore\ **/ :Explore **/' + exe 'sil! menu '.g:NetrwMenuPriority.'.12.3 '.g:NetrwTopLvlMenu.'Explore.Files\ Containing\ String\ Pattern\ (curdir\ only):Explore\ *// :Explore *//' + exe 'sil! menu '.g:NetrwMenuPriority.'.12.4 '.g:NetrwTopLvlMenu.'Explore.Files\ Containing\ String\ Pattern\ (+subdirs):Explore\ **// :Explore **//' + exe 'sil! menu '.g:NetrwMenuPriority.'.12.4 '.g:NetrwTopLvlMenu.'Explore.Next\ Match:Nexplore :Nexplore' + exe 'sil! menu '.g:NetrwMenuPriority.'.12.4 '.g:NetrwTopLvlMenu.'Explore.Prev\ Match:Pexplore :Pexplore' + exe 'sil! menu '.g:NetrwMenuPriority.'.13 '.g:NetrwTopLvlMenu.'Make\ Subdirectoryd d' + exe 'sil! menu '.g:NetrwMenuPriority.'.14.1 '.g:NetrwTopLvlMenu.'Marked\ Files.Mark\ Filemf mf' + exe 'sil! menu '.g:NetrwMenuPriority.'.14.2 '.g:NetrwTopLvlMenu.'Marked\ Files.Mark\ Files\ by\ Regexpmr mr' + exe 'sil! menu '.g:NetrwMenuPriority.'.14.3 '.g:NetrwTopLvlMenu.'Marked\ Files.Hide-Show-List\ Controla a' + exe 'sil! menu '.g:NetrwMenuPriority.'.14.4 '.g:NetrwTopLvlMenu.'Marked\ Files.Copy\ To\ Targetmc mc' + exe 'sil! menu '.g:NetrwMenuPriority.'.14.5 '.g:NetrwTopLvlMenu.'Marked\ Files.DeleteD D' + exe 'sil! menu '.g:NetrwMenuPriority.'.14.6 '.g:NetrwTopLvlMenu.'Marked\ Files.Diffmd md' + exe 'sil! menu '.g:NetrwMenuPriority.'.14.7 '.g:NetrwTopLvlMenu.'Marked\ Files.Editme me' + exe 'sil! menu '.g:NetrwMenuPriority.'.14.8 '.g:NetrwTopLvlMenu.'Marked\ Files.Exe\ Cmdmx mx' + exe 'sil! menu '.g:NetrwMenuPriority.'.14.9 '.g:NetrwTopLvlMenu.'Marked\ Files.Move\ To\ Targetmm mm' + exe 'sil! menu '.g:NetrwMenuPriority.'.14.10 '.g:NetrwTopLvlMenu.'Marked\ Files.ObtainO O' + exe 'sil! menu '.g:NetrwMenuPriority.'.14.11 '.g:NetrwTopLvlMenu.'Marked\ Files.Printmp mp' + exe 'sil! menu '.g:NetrwMenuPriority.'.14.12 '.g:NetrwTopLvlMenu.'Marked\ Files.ReplaceR R' + exe 'sil! menu '.g:NetrwMenuPriority.'.14.13 '.g:NetrwTopLvlMenu.'Marked\ Files.Set\ Targetmt mt' + exe 'sil! menu '.g:NetrwMenuPriority.'.14.14 '.g:NetrwTopLvlMenu.'Marked\ Files.TagmT mT' + exe 'sil! menu '.g:NetrwMenuPriority.'.14.15 '.g:NetrwTopLvlMenu.'Marked\ Files.Zip/Unzip/Compress/Uncompressmz mz' + exe 'sil! menu '.g:NetrwMenuPriority.'.15 '.g:NetrwTopLvlMenu.'Obtain\ FileO O' + exe 'sil! menu '.g:NetrwMenuPriority.'.16.1 '.g:NetrwTopLvlMenu.'Style.Listing\ Style\ (thin-long-wide-tree)i i' + exe 'sil! menu '.g:NetrwMenuPriority.'.16.2 '.g:NetrwTopLvlMenu.'Style.Normal-Hide-Showa a' + exe 'sil! menu '.g:NetrwMenuPriority.'.16.3 '.g:NetrwTopLvlMenu.'Style.Reverse\ Sorting\ Order'."r r" + exe 'sil! menu '.g:NetrwMenuPriority.'.16.4 '.g:NetrwTopLvlMenu.'Style.Sorting\ Method\ (name-time-size)s s' + exe 'sil! menu '.g:NetrwMenuPriority.'.17 '.g:NetrwTopLvlMenu.'Rename\ File/DirectoryR R' + exe 'sil! menu '.g:NetrwMenuPriority.'.18 '.g:NetrwTopLvlMenu.'Set\ Current\ Directoryc c' call s:NetrwBookmarkMenu() " provide some history! uses priorities 2,3, reserves 4, 8.2.x let s:netrw_menucnt= 28 @@ -5102,9 +5265,9 @@ fun! s:NetrwMenu(domenu) if s:netrwcnt <= 1 " call Decho("clear menus") - exe 'silent! unmenu '.g:NetrwTopLvlMenu + exe 'sil! unmenu '.g:NetrwTopLvlMenu " call Decho('exe silent! unmenu '.g:NetrwTopLvlMenu.'*') - silent! unlet s:netrw_menu_enabled + sil! unlet s:netrw_menu_enabled endif endif " call Dret("NetrwMenu") @@ -5214,7 +5377,7 @@ fun! netrw#NetrwObtain(islocal,fname,...) let tmpbufnr= bufnr("%") setlocal ff=unix if exists("g:netrw_ftpmode") && g:netrw_ftpmode != "" - put =g:netrw_ftpmode + keepj put =g:netrw_ftpmode " call Decho("filter input: ".getline('$')) endif @@ -5224,7 +5387,7 @@ fun! netrw#NetrwObtain(islocal,fname,...) endif if exists("g:netrw_ftpextracmd") - put =g:netrw_ftpextracmd + keepj put =g:netrw_ftpextracmd " call Decho("filter input: ".getline('$')) endif for fname in fnamelist @@ -5254,44 +5417,44 @@ fun! netrw#NetrwObtain(islocal,fname,...) 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("b:netrw_fname") && b:netrw_fname != "" - call setline(line("$")+1,'cd "'.b:netrw_fname.'"') + keepj call setline(line("$")+1,'cd "'.b:netrw_fname.'"') " call Decho("filter input: ".getline('$')) endif if exists("g:netrw_ftpextracmd") - put =g:netrw_ftpextracmd + keepj put =g:netrw_ftpextracmd " call Decho("filter input: ".getline('$')) endif if exists("g:netrw_ftpextracmd") - put =g:netrw_ftpextracmd + keepj put =g:netrw_ftpextracmd " call Decho("filter input: ".getline('$')) endif for fname in fnamelist - call setline(line("$")+1,'get "'.fname.'"') + keepj call setline(line("$")+1,'get "'.fname.'"') endfor " call Decho("filter input: ".getline('$')) @@ -5299,7 +5462,7 @@ fun! netrw#NetrwObtain(islocal,fname,...) " -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) @@ -5502,25 +5665,25 @@ fun! s:NetrwUpload(fname,tgt,...) if b:netrw_method == 2 " handle uploading a list of files via ftp+.netrc let netrw_fname = b:netrw_fname - silent keepjumps new + sil keepj new " call Decho("filter input window#".winnr()) - 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,'lcd "'.fromdir.'"') + keepj call setline(line("$")+1,'lcd "'.fromdir.'"') " call Decho("filter input: ".getline('$')) - call setline(line("$")+1,'cd "'.tgtdir.'"') + keepj call setline(line("$")+1,'cd "'.tgtdir.'"') " call Decho("filter input: ".getline('$')) for fname in a:fname - call setline(line("$")+1,'put "'.fname.'"') + keepj call setline(line("$")+1,'put "'.fname.'"') " call Decho("filter input: ".getline('$')) endfor @@ -5533,7 +5696,7 @@ fun! s:NetrwUpload(fname,tgt,...) exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1) endif " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar) - silent g/Local directory now/d + sil keepj g/Local directory now/d call histdel("/",-1) if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying ' call netrw#ErrorMsg(s:ERROR,getline(1),14) @@ -5549,38 +5712,38 @@ fun! s:NetrwUpload(fname,tgt,...) 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('$')) - call setline(line("$")+1,'"'.s:netrw_passwd.'"') + keepj call setline(line("$")+1,'"'.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 - call setline(line("$")+1,'lcd "'.fromdir.'"') + keepj call setline(line("$")+1,'lcd "'.fromdir.'"') " call Decho("filter input: ".getline('$')) if exists("b:netrw_fname") && b:netrw_fname != "" - call setline(line("$")+1,'cd "'.b:netrw_fname.'"') + keepj call setline(line("$")+1,'cd "'.b:netrw_fname.'"') " call Decho("filter input: ".getline('$')) endif if exists("g:netrw_ftpextracmd") - put =g:netrw_ftpextracmd + keepj put =g:netrw_ftpextracmd " call Decho("filter input: ".getline('$')) endif for fname in a:fname - call setline(line("$")+1,'put "'.fname.'"') + keepj call setline(line("$")+1,'put "'.fname.'"') " call Decho("filter input: ".getline('$')) endfor @@ -5588,11 +5751,11 @@ fun! s:NetrwUpload(fname,tgt,...) " -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: ".s:netrw_silentxfer."%!".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) - silent g/Local directory now/d + sil keepj g/Local directory now/d call histdel("/",-1) if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying ' let debugkeep= &debug @@ -5623,7 +5786,14 @@ fun! s:NetrwPreview(path) range call s:NetrwSafeOptions() if has("quickfix") if !isdirectory(a:path) - exe (g:netrw_preview? "vert " : "")."pedit ".fnameescape(a:path) + if g:netrw_preview && !g:netrw_alto + let pvhkeep= &pvh + let &pvh = winwidth(0) - g:netrw_winsize + endif + exe (g:netrw_alto? "top " : "bot ").(g:netrw_preview? "vert " : "")."pedit ".fnameescape(a:path) + if exists("pvhkeep") + let &pvh= pvhkeep + endif elseif !exists("g:netrw_quiet") call netrw#ErrorMsg(s:WARNING,"sorry, cannot preview a directory such as <".a:path.">",38) endif @@ -5644,7 +5814,7 @@ fun! s:NetrwRefresh(islocal,dirname) setlocal ma noro " call Decho("setlocal ma noro") " call Decho("clear buffer<".expand("%")."> with :%d") - %d + keepj %d if a:islocal call netrw#LocalBrowseCheck(a:dirname) else @@ -5744,17 +5914,17 @@ fun! s:NetrwSetSort() if seq == '*' let starpriority= spriority else - exe 'silent keepjumps '.w:netrw_bannercnt.',$g/'.seq.'/s/^/'.spriority.'/' + exe 'sil keepj '.w:netrw_bannercnt.',$g/'.seq.'/s/^/'.spriority.'/' call histdel("/",-1) " sometimes multiple sorting patterns will match the same file or directory. " The following substitute is intended to remove the excess matches. - exe 'silent keepjumps '.w:netrw_bannercnt.',$g/^\d\{3}'.g:netrw_sepchr.'\d\{3}\//s/^\d\{3}'.g:netrw_sepchr.'\(\d\{3}\/\).\@=/\1/e' + exe 'sil keepj '.w:netrw_bannercnt.',$g/^\d\{3}'.g:netrw_sepchr.'\d\{3}\//s/^\d\{3}'.g:netrw_sepchr.'\(\d\{3}\/\).\@=/\1/e' call histdel("/",-1) endif let priority = priority + 1 endwhile if exists("starpriority") - exe 'silent keepjumps '.w:netrw_bannercnt.',$v/^\d\{3}'.g:netrw_sepchr.'/s/^/'.starpriority.'/' + exe 'sil keepj '.w:netrw_bannercnt.',$v/^\d\{3}'.g:netrw_sepchr.'/s/^/'.starpriority.'/' call histdel("/",-1) endif @@ -5764,7 +5934,7 @@ fun! s:NetrwSetSort() " priority pattern needs to be retained. So, at this point, these excess " priority prefixes need to be removed, but not directories that happen to " be just digits themselves. - exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\(\d\{3}'.g:netrw_sepchr.'\)\%(\d\{3}'.g:netrw_sepchr.'\)\+\ze./\1/e' + exe 'sil keepj '.w:netrw_bannercnt.',$s/^\(\d\{3}'.g:netrw_sepchr.'\)\%(\d\{3}'.g:netrw_sepchr.'\)\+\ze./\1/e' call histdel("/",-1) " call Dret("SetSort") @@ -5778,7 +5948,7 @@ fun! s:NetrwSortStyle(islocal) let svpos= netrw#NetrwSavePosn() let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name' - norm! 0 + keepj norm! 0 call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) call netrw#NetrwRestorePosn(svpos) @@ -5923,7 +6093,7 @@ fun! s:NetrwTreeDir() " call Decho("user attempted to close treeroot") " now force a refresh " call Decho("clear buffer<".expand("%")."> with :%d") - keepjumps %d + keepj %d " call Dret("NetrwTreeDir <".treedir."> : (side effect) s:treecurpos<".string(s:treecurpos).">") return b:netrw_curdir endif @@ -6004,7 +6174,7 @@ fun! s:NetrwTreeDisplay(dir,depth) call s:NetrwTreeDisplay(direntry.'/',depth) else " call Decho("<".entry."> is not a key in treedict (no subtree)") - call setline(line("$")+1,depth.entry) + keepj call setline(line("$")+1,depth.entry) endif endfor " call Dret("NetrwTreeDisplay") @@ -6038,7 +6208,7 @@ fun! s:NetrwTreeListing(dirname) " call Decho("bannercnt=".w:netrw_bannercnt." line($)=".line("$")) exe "silent! keepjumps ".w:netrw_bannercnt.',$g@^\.\.\=/$@d' let w:netrw_treedict[a:dirname]= getline(w:netrw_bannercnt,line("$")) -" call Decho("w:treedict[".a:dirname."]= ".w:netrw_treedict[a:dirname]) +" call Decho("w:treedict[".a:dirname."]= ".string(w:netrw_treedict[a:dirname])) exe "silent! keepjumps ".w:netrw_bannercnt.",$d" " if past banner, record word @@ -6070,7 +6240,7 @@ fun! s:NetrwWideListing() " call Decho("setlocal ma noro") 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' + exe 'sil keepj '.w:netrw_bannercnt.',$g/^./if virtcol("$") > b:netrw_cpf|let b:netrw_cpf= virtcol("$")|endif' call histdel("/",-1) else " call Dret("NetrwWideListing") @@ -6087,7 +6257,7 @@ fun! s:NetrwWideListing() " call Decho("fpl= [winwidth=".winwidth(0)."]/[b:netrw_cpf=".b:netrw_cpf.']='.w:netrw_fpl) " make wide display - exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^.*$/\=escape(printf("%-'.b:netrw_cpf.'s",submatch(0)),"\\")/' + exe 'sil keepj '.w:netrw_bannercnt.',$s/^.*$/\=escape(printf("%-'.b:netrw_cpf.'s",submatch(0)),"\\")/' call histdel("/",-1) let fpc = (line("$") - w:netrw_bannercnt + w:netrw_fpl)/w:netrw_fpl let newcolstart = w:netrw_bannercnt + fpc @@ -6099,15 +6269,15 @@ fun! s:NetrwWideListing() let newcolqty= newcolend - newcolstart exe newcolstart if newcolqty == 0 - exe "silent keepjumps norm! 0\$hx".w:netrw_bannercnt."G$p" + exe "sil keepj norm! 0\$hx".w:netrw_bannercnt."G$p" else - exe "silent keepjumps norm! 0\".newcolqty.'j$hx'.w:netrw_bannercnt.'G$p' + exe "sil keepj norm! 0\".newcolqty.'j$hx'.w:netrw_bannercnt.'G$p' endif - exe "silent keepjumps ".newcolstart.','.newcolend.'d' - exe 'silent keepjumps '.w:netrw_bannercnt + exe "sil keepj ".newcolstart.','.newcolend.'d' + exe 'sil keepj '.w:netrw_bannercnt endwhile silent! let @*= keepregstar - exe "silent keepjumps ".w:netrw_bannercnt.',$s/\s\+$//e' + exe "sil keepj ".w:netrw_bannercnt.',$s/\s\+$//e' call histdel("/",-1) setlocal noma nomod ro " call Dret("NetrwWideListing") @@ -6118,7 +6288,7 @@ endfun " --------------------------------------------------------------------- " s:PerformListing: {{{2 fun! s:PerformListing(islocal) -" call Dfunc("s:PerformListing(islocal=".a:islocal.") buf(%)=".bufnr("%")."<".bufname("%").">") +" call Dfunc("s:PerformListing(islocal=".a:islocal.") bufnr(%)=".bufnr("%")."<".bufname("%").">") call s:NetrwSafeOptions() setlocal noro ma @@ -6132,7 +6302,7 @@ fun! s:PerformListing(islocal) if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict") " force a refresh for tree listings " call Decho("force refresh for treelisting: clear buffer<".expand("%")."> with :%d") - keepjumps %d + keepj %d endif " save current directory on directory history list @@ -6141,14 +6311,14 @@ fun! s:PerformListing(islocal) " Set up the banner {{{3 if g:netrw_banner " call Decho("set up banner") - keepjumps put ='\" ============================================================================' - keepjumps put ='\" Netrw Directory Listing (netrw '.g:loaded_netrw.')' - keepjumps put ='\" '.b:netrw_curdir - keepjumps 1d + keepj put ='\" ============================================================================' + keepj put ='\" Netrw Directory Listing (netrw '.g:loaded_netrw.')' + keepj put ='\" '.b:netrw_curdir + keepj 1d let w:netrw_bannercnt= 3 - exe "keepjumps ".w:netrw_bannercnt + exe "keepj ".w:netrw_bannercnt else - keepjumps 1 + keepj 1 let w:netrw_bannercnt= 1 endif @@ -6163,33 +6333,33 @@ fun! s:PerformListing(islocal) if g:netrw_sort_by =~ "^n" " call Decho("directories will be sorted by name") " sorted by name - keepjumps put ='\" Sorted by '.sortby - keepjumps put ='\" Sort sequence: '.g:netrw_sort_sequence + keepj put ='\" Sorted by '.sortby + keepj put ='\" Sort sequence: '.g:netrw_sort_sequence let w:netrw_bannercnt= w:netrw_bannercnt + 2 else " call Decho("directories will be sorted by size or time") " sorted by size or date - keepjumps put ='\" Sorted by '.sortby + keepj put ='\" Sorted by '.sortby let w:netrw_bannercnt= w:netrw_bannercnt + 1 endif - exe "keepjumps ".w:netrw_bannercnt + exe "keepj ".w:netrw_bannercnt endif " show copy/move target, if any if g:netrw_banner if exists("s:netrwmftgt") && exists("s:netrwmftgt_islocal") " call Decho("show copy/move target<".s:netrwmftgt.">") - keepjumps put ='' + keepj put ='' if s:netrwmftgt_islocal - call setline(line("."),'" Copy/Move Tgt: '.s:netrwmftgt.' (local)') + keepj call setline(line("."),'" Copy/Move Tgt: '.s:netrwmftgt.' (local)') else - call setline(line("."),'" Copy/Move Tgt: '.s:netrwmftgt.' (remote)') + keepj call setline(line("."),'" Copy/Move Tgt: '.s:netrwmftgt.' (remote)') endif let w:netrw_bannercnt= w:netrw_bannercnt + 1 else " call Decho("s:netrwmftgt does not exist, don't make Copy/Move Tgt") endif - exe "keepjumps ".w:netrw_bannercnt + exe "keepj ".w:netrw_bannercnt endif " Hiding... -or- Showing... {{{3 @@ -6197,22 +6367,22 @@ fun! s:PerformListing(islocal) " call Decho("handle hiding/showing (g:netrw_hide=".g:netrw_list_hide." g:netrw_list_hide<".g:netrw_list_hide.">)") if g:netrw_list_hide != "" && g:netrw_hide if g:netrw_hide == 1 - keepjumps put ='\" Hiding: '.g:netrw_list_hide + keepj put ='\" Hiding: '.g:netrw_list_hide else - keepjumps put ='\" Showing: '.g:netrw_list_hide + keepj put ='\" Showing: '.g:netrw_list_hide endif let w:netrw_bannercnt= w:netrw_bannercnt + 1 endif exe "keepjumps ".w:netrw_bannercnt - keepjumps put ='\" Quick Help: :help -:go up dir D:delete R:rename s:sort-by x:exec' - keepjumps put ='\" ============================================================================' + keepj put ='\" Quick Help: :help -:go up dir D:delete R:rename s:sort-by x:exec' + keepj put ='\" ============================================================================' let w:netrw_bannercnt= w:netrw_bannercnt + 2 endif " bannercnt should index the line just after the banner if g:netrw_banner let w:netrw_bannercnt= w:netrw_bannercnt + 1 - exe "keepjumps ".w:netrw_bannercnt + exe "keepj ".w:netrw_bannercnt " call Decho("bannercnt=".w:netrw_bannercnt." (should index line just after banner) line($)=".line("$")) endif @@ -6252,15 +6422,15 @@ fun! s:PerformListing(islocal) " call Decho("g:netrw_sort_direction=".g:netrw_sort_direction." (bannercnt=".w:netrw_bannercnt.")") if g:netrw_sort_direction =~ 'n' " normal direction sorting - exe 'silent keepjumps '.w:netrw_bannercnt.',$sort'.' '.g:netrw_sort_options + exe 'sil keepj '.w:netrw_bannercnt.',$sort'.' '.g:netrw_sort_options else " reverse direction sorting - exe 'silent keepjumps '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options + exe 'sil keepj '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options endif endif " remove priority pattern prefix " call Decho("remove priority pattern prefix") - exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\d\{3}'.g:netrw_sepchr.'//e' + exe 'sil keepj '.w:netrw_bannercnt.',$s/^\d\{3}'.g:netrw_sepchr.'//e' call histdel("/",-1) elseif a:islocal @@ -6268,12 +6438,12 @@ fun! s:PerformListing(islocal) " call Decho("g:netrw_sort_direction=".g:netrw_sort_direction) if g:netrw_sort_direction =~ 'n' " call Decho('exe silent keepjumps '.w:netrw_bannercnt.',$sort') - exe 'silent keepjumps '.w:netrw_bannercnt.',$sort'.' '.g:netrw_sort_options + exe 'sil keepj '.w:netrw_bannercnt.',$sort'.' '.g:netrw_sort_options else " call Decho('exe silent keepjumps '.w:netrw_bannercnt.',$sort!') - exe 'silent keepjumps '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options + exe 'sil keepj '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options endif - exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\d\{-}\///e' + exe 'sil keepj '.w:netrw_bannercnt.',$s/^\d\{-}\///e' call histdel("/",-1) endif endif @@ -6281,7 +6451,7 @@ fun! s:PerformListing(islocal) elseif g:netrw_sort_direction =~ 'r' " call Decho('reverse the sorted listing') if !g:netrw_banner || w:netrw_bannercnt < line('$') - exe 'silent keepjumps '.w:netrw_bannercnt.',$g/^/m '.w:netrw_bannercnt + exe 'sil keepj '.w:netrw_bannercnt.',$g/^/m '.w:netrw_bannercnt call histdel("/",-1) endif endif @@ -6295,8 +6465,8 @@ fun! s:PerformListing(islocal) if exists("w:netrw_bannercnt") && (line("$") > w:netrw_bannercnt || !g:netrw_banner) " place cursor on the top-left corner of the file listing " call Decho("place cursor on top-left corner of file listing") - exe 'silent keepjumps '.w:netrw_bannercnt - norm! 0 + exe 'sil keepj '.w:netrw_bannercnt + keepj norm! 0 endif " record previous current directory @@ -6416,43 +6586,43 @@ fun! s:NetrwRemoteListing() endif " call Decho("listcmd<".listcmd."> (using g:netrw_ftp_list_cmd)") call s:NetrwRemoteFtpCmd(s:path,listcmd) -" exe "keepjumps ".w:netrw_bannercnt.',$g/^./call Decho("raw listing: ".getline("."))' +" exe "keepj ".w:netrw_bannercnt.',$g/^./call Decho("raw listing: ".getline("."))' if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:WIDELIST || w:netrw_liststyle == s:TREELIST " shorten the listing " call Decho("generate short listing") - exe "keepjumps ".w:netrw_bannercnt + exe "keepj ".w:netrw_bannercnt " cleanup if g:netrw_ftp_browse_reject != "" - exe "silent! g/".g:netrw_ftp_browse_reject."/keepjumps d" + exe "sil! keepj g/".g:netrw_ftp_browse_reject."/keepj d" call histdel("/",-1) endif - silent! keepjumps %s/\r$//e + sil! keepj %s/\r$//e call histdel("/",-1) " if there's no ../ listed, then put ./ and ../ in let line1= line(".") - exe "keepjumps ".w:netrw_bannercnt + exe "keepj ".w:netrw_bannercnt let line2= search('^\.\.\/\%(\s\|$\)','cnW') if line2 == 0 " call Decho("netrw is putting ./ and ../ into listing") - keepjumps put='../' - keepjumps put='./' + keepj put='../' + keepj put='./' endif - exe "keepjumps ".line1 + exe "keepj ".line1 keepjumps norm! 0 " call Decho("line1=".line1." line2=".line2." line(.)=".line(".")) if search('^\d\{2}-\d\{2}-\d\{2}\s','n') " M$ ftp site cleanup " call Decho("M$ ftp cleanup") - exe 'silent! keepjumps '.w:netrw_bannercnt.',$s/^\d\{2}-\d\{2}-\d\{2}\s\+\d\+:\d\+[AaPp][Mm]\s\+\%(\|\d\+\)\s\+//' + exe 'sil! keepj '.w:netrw_bannercnt.',$s/^\d\{2}-\d\{2}-\d\{2}\s\+\d\+:\d\+[AaPp][Mm]\s\+\%(\|\d\+\)\s\+//' call histdel("/",-1) else " normal ftp cleanup " call Decho("normal ftp cleanup") - exe 'silent! keepjumps '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2/e' - exe "silent! keepjumps ".w:netrw_bannercnt.',$g/ -> /s# -> .*/$#/#e' - exe "silent! keepjumps ".w:netrw_bannercnt.',$g/ -> /s# -> .*$#/#e' + exe 'sil! keepj '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2/e' + exe "sil! keepj ".w:netrw_bannercnt.',$g/ -> /s# -> .*/$#/#e' + exe "sil! keepj ".w:netrw_bannercnt.',$g/ -> /s# -> .*$#/#e' call histdel("/",-1) call histdel("/",-1) call histdel("/",-1) @@ -6468,23 +6638,23 @@ fun! s:NetrwRemoteListing() " call Decho("1: exe silent r! ".shellescape(listcmd.s:path, 1)) exe "silent r! ".listcmd.shellescape(s:path, 1) " remove rubbish and adjust listing format of 'pscp' to 'ssh ls -FLa' like - g/^Listing directory/d - g/^d[-rwx][-rwx][-rwx]/s+$+/+e - silent g/^l[-rwx][-rwx][-rwx]/s+$+@+e + keepj g/^Listing directory/keepj d + keepj g/^d[-rwx][-rwx][-rwx]/keepj s+$+/+e + sil keepj g/^l[-rwx][-rwx][-rwx]/keepj s+$+@+e call histdel("/",-1) call histdel("/",-1) call histdel("/",-1) if g:netrw_liststyle != s:LONGLIST - g/^[dlsp-][-rwx][-rwx][-rwx]/s/^.*\s\(\S\+\)$/\1/e + keepj g/^[dlsp-][-rwx][-rwx][-rwx]/keepj s/^.*\s\(\S\+\)$/\1/e call histdel("/",-1) endif else if s:path == "" " call Decho("2: exe silent r! ".listcmd) - exe "silent r! ".listcmd + exe "sil r! ".listcmd else " call Decho("3: exe silent r! ".listcmd.' '.shellescape(s:path,1)) - exe "silent r! ".listcmd.' '.shellescape(s:path,1) + exe "sil r! ".listcmd.' '.shellescape(s:path,1) " call Decho("listcmd<".listcmd."> path<".s:path.">") endif endif @@ -6492,7 +6662,7 @@ fun! s:NetrwRemoteListing() " cleanup if g:netrw_ftp_browse_reject != "" " call Decho("(cleanup) exe silent! g/".g:netrw_ssh_browse_reject."/keepjumps d") - exe "silent! g/".g:netrw_ssh_browse_reject."/keepjumps d" + exe "sil! g/".g:netrw_ssh_browse_reject."/keepjumps d" call histdel("/",-1) endif endif @@ -6503,33 +6673,33 @@ fun! s:NetrwRemoteListing() if s:method == "ftp" " cleanup - exe "keepjumps ".w:netrw_bannercnt + exe "keepj ".w:netrw_bannercnt while getline('.') =~ g:netrw_ftp_browse_reject - keepjumps d + keepj d endwhile " if there's no ../ listed, then put ./ and ../ in let line1= line(".") - keepjumps 1 - silent keepjumps call search('^\.\.\/\%(\s\|$\)','W') + keepj 1 + sil keepj call search('^\.\.\/\%(\s\|$\)','W') let line2= line(".") if line2 == 0 - exe 'keepjumps '.w:netrw_bannercnt."put='./'" + exe 'keepj '.w:netrw_bannercnt."put='./'" if b:netrw_curdir != '/' - exe 'keepjumps '.w:netrw_bannercnt."put='../'" + exe 'keepj '.w:netrw_bannercnt."put='../'" endif endif - exe "keepjumps ".line1 + exe "keepj ".line1 keepjumps norm! 0 endif if search('^\d\{2}-\d\{2}-\d\{2}\s','n') " M$ ftp site cleanup " call Decho("M$ ftp site listing cleanup") - exe 'silent! keepjumps '.w:netrw_bannercnt.',$s/^\(\d\{2}-\d\{2}-\d\{2}\s\+\d\+:\d\+[AaPp][Mm]\s\+\%(\|\d\+\)\s\+\)\(\w.*\)$/\2\t\1/' + exe 'sil! keepj '.w:netrw_bannercnt.',$s/^\(\d\{2}-\d\{2}-\d\{2}\s\+\d\+:\d\+[AaPp][Mm]\s\+\%(\|\d\+\)\s\+\)\(\w.*\)$/\2\t\1/' elseif exists("w:netrw_bannercnt") && w:netrw_bannercnt <= line("$") " call Decho("normal ftp site listing cleanup: bannercnt=".w:netrw_bannercnt." line($)=".line("$")) - exe 'silent keepjumps '.w:netrw_bannercnt.',$s/ -> .*$//e' - exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2\t\1/e' - exe 'silent keepjumps '.w:netrw_bannercnt + exe 'sil keepj '.w:netrw_bannercnt.',$s/ -> .*$//e' + exe 'sil keepj '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2\t\1/e' + exe 'sil keepj '.w:netrw_bannercnt call histdel("/",-1) call histdel("/",-1) call histdel("/",-1) @@ -6537,7 +6707,7 @@ fun! s:NetrwRemoteListing() endif " if exists("w:netrw_bannercnt") && w:netrw_bannercnt <= line("$") " Decho -" exe "keepjumps ".w:netrw_bannercnt.',$g/^./call Decho("listing: ".getline("."))' +" exe "keepj ".w:netrw_bannercnt.',$g/^./call Decho("listing: ".getline("."))' " endif " Decho " call Dret("s:NetrwRemoteListing") endfun @@ -6729,10 +6899,10 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd) if w:netrw_method == 2 || w:netrw_method == 5 " ftp + <.netrc>: Method #2 if a:path != "" - put ='cd \"'.a:path.'\"' + keepj put ='cd \"'.a:path.'\"' endif if exists("g:netrw_ftpextracmd") - put =g:netrw_ftpextracmd + keepj put =g:netrw_ftpextracmd " call Decho("filter input: ".getline('.')) endif call setline(line("$")+1,a:listcmd) @@ -6750,26 +6920,26 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd) " 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 + 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_ftp") && g:netrw_ftp == 1 - put =g:netrw_uid - put ='\"'.s:netrw_passwd.'\"' + keepj put =g:netrw_uid + keepj put ='\"'.s:netrw_passwd.'\"' else - put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"' + keepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"' endif if a:path != "" - put ='cd \"'.a:path.'\"' + keepj put ='cd \"'.a:path.'\"' endif if exists("g:netrw_ftpextracmd") - put =g:netrw_ftpextracmd + keepj put =g:netrw_ftpextracmd " call Decho("filter input: ".getline('.')) endif - call setline(line("$")+1,a:listcmd) + keepj call setline(line("$")+1,a:listcmd) " perform ftp: " -i : turns off interactive prompting from ftp @@ -6786,29 +6956,29 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd) " cleanup for Windows if has("win32") || has("win95") || has("win64") || has("win16") - silent! keepjumps %s/\r$//e + sil! keepj %s/\r$//e call histdel("/",-1) endif if a:listcmd == "dir" " infer directory/link based on the file permission string - silent! keepjumps g/d\%([-r][-w][-x]\)\{3}/s@$@/@ - silent! keepjumps g/l\%([-r][-w][-x]\)\{3}/s/$/@/ + sil! keepj g/d\%([-r][-w][-x]\)\{3}/keepj s@$@/@ + sil! keepj g/l\%([-r][-w][-x]\)\{3}/keepj s/$/@/ call histdel("/",-1) call histdel("/",-1) if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:WIDELIST || w:netrw_liststyle == s:TREELIST - exe "silent! keepjumps ".w:netrw_bannercnt.',$s/^\%(\S\+\s\+\)\{8}//e' + exe "sil! keepj ".w:netrw_bannercnt.',$s/^\%(\S\+\s\+\)\{8}//e' call histdel("/",-1) endif endif " ftp's listing doesn't seem to include ./ or ../ if !search('^\.\/$\|\s\.\/$','wn') - exe 'keepjumps '.w:netrw_bannercnt - put ='./' + exe 'keepj '.w:netrw_bannercnt + keepj put ='./' endif if !search('^\.\.\/$\|\s\.\.\/$','wn') - exe 'keepjumps '.w:netrw_bannercnt - put ='../' + exe 'keepj '.w:netrw_bannercnt + keepj put ='../' endif " restore settings @@ -6861,7 +7031,7 @@ fun! s:NetrwRemoteRename(usrhost,path) range " attempt to rename files/directories while ctr <= a:lastline - exe "keepjumps ".ctr + exe "keepj ".ctr let oldname= s:NetrwGetWord() " call Decho("oldname<".oldname.">") @@ -7061,7 +7231,7 @@ fun! s:LocalListing() let ft = strpart("000000000000000000",1,18-strlen(t)).t " call Decho("exe keepjumps put ='".ft.'/'.filename."'") let ftpfile= ft.'/'.pfile - keepjumps silent! put=ftpfile + sil! keepj put=ftpfile elseif g:netrw_sort_by =~ "^s" " sort by size (handles file sizes up to 1 quintillion bytes, US) @@ -7070,18 +7240,18 @@ fun! s:LocalListing() let fsz = strpart("000000000000000000",1,18-strlen(sz)).sz " call Decho("exe keepjumps put ='".fsz.'/'.filename."'") let fszpfile= fsz.'/'.pfile - keepjumps silent! put =fszpfile + sil! keepj put =fszpfile else " sort by name " call Decho("exe keepjumps put ='".pfile."'") - keepjumps silent! put=pfile + sil! keepj put=pfile endif endwhile " cleanup any windows mess at end-of-line - silent! keepjumps g/^$/d - silent! keepjumps %s/\r$//e + sil! keepj g/^$/d + sil! keepj %s/\r$//e call histdel("/",-1) exe "setlocal ts=".g:netrw_maxfilenamelen " call Decho("setlocal ts=".g:netrw_maxfilenamelen) @@ -7132,7 +7302,7 @@ fun! s:LocalBrowseShellCmdRefresh() if bufwinnr(ibuf) == -1 && index(buftablist,ibuf) == -1 " wipe out any non-displaying netrw buffer " call Decho("wiping buf#".ibuf,"<".bufname(ibuf).">") - exe "silent! bd ".fnameescape(ibuf) + exe "sil! bd ".fnameescape(ibuf) call remove(s:netrw_browselist,ibl) " call Decho("browselist=".string(s:netrw_browselist)) continue @@ -7179,7 +7349,7 @@ fun! s:NetrwLocalRm(path) range let ctr = a:firstline while ctr <= a:lastline - exe "keepjumps ".ctr + exe "keepj ".ctr " sanity checks if line(".") < w:netrw_bannercnt @@ -7219,7 +7389,7 @@ fun! s:NetrwLocalRmFile(path,fname,all) let all= a:all let ok = "" - norm! 0 + keepj norm! 0 let rmfile= s:ComposePath(a:path,a:fname) " call Decho("rmfile<".rmfile.">") @@ -7331,7 +7501,7 @@ fun! s:NetrwLocalRename(path) range " attempt to rename files/directories while ctr <= a:lastline - exe "keepjumps ".ctr + exe "keepj ".ctr " sanity checks if line(".") < w:netrw_bannercnt @@ -7344,7 +7514,7 @@ fun! s:NetrwLocalRename(path) range continue endif - norm! 0 + keepj norm! 0 let oldname= s:ComposePath(a:path,curword) " call Decho("oldname<".oldname.">") @@ -7464,7 +7634,7 @@ fun! netrw#ErrorMsg(level,msg,errnum) " call Decho("setlocal ma noro") setlocal ma noro call setline(line("$")+1,level.a:msg) - $ + keepj $ else " call Decho("create a NetrwMessage buffer window") bo 1split @@ -7521,7 +7691,7 @@ fun! netrw#NetrwRestorePosn(...) " restore window if exists("w:netrw_winnr") " call Decho("restore window: exe silent! ".w:netrw_winnr."wincmd w") - exe "silent! ".w:netrw_winnr."wincmd w" + exe "sil! ".w:netrw_winnr."wincmd w" endif if v:shell_error == 0 " as suggested by Bram M: redraw on no error @@ -7532,13 +7702,13 @@ fun! netrw#NetrwRestorePosn(...) " restore top-of-screen line if exists("w:netrw_hline") " call Decho("restore topofscreen: exe norm! ".w:netrw_hline."G0z") - exe "norm! ".w:netrw_hline."G0z\" + exe "keepj norm! ".w:netrw_hline."G0z\" endif " restore position if exists("w:netrw_line") && exists("w:netrw_col") " call Decho("restore posn: exe norm! ".w:netrw_line."G0".w:netrw_col."|") - exe "norm! ".w:netrw_line."G0".w:netrw_col."\" + exe "keepj norm! ".w:netrw_line."G0".w:netrw_col."\" endif let &ei= eikeep @@ -7556,7 +7726,7 @@ fun! netrw#NetrwSavePosn() " call Decho("currently, win#".w:netrw_winnr." line#".w:netrw_line." col#".w:netrw_col) " Save top-of-screen line - norm! H0 + keepj norm! H0 let w:netrw_hline= line(".") " set up string holding position parameters @@ -7747,13 +7917,54 @@ fun! s:NetrwBMShow() if bmshowfuncs != [] let bmshowfunc = substitute(bmshowfuncs[0],'^.*:\(call.*BMShow()\).*$','\1','') if bmshowfunc =~ '^call.*BMShow()' - exe "silent! ".bmshowfunc + exe "sil! ".bmshowfunc endif endif endif " call Dret("s:NetrwBMShow : bmshowfunc<".(exists("bmshowfunc")? bmshowfunc : 'n/a').">") endfun +" --------------------------------------------------------------------- +" s:NetrwCursorline: {{{2 +fun! s:NetrwCursorline() + if !exists("w:netrw_liststyle") + let w:netrw_liststyle= g:netrw_liststyle + endif +" call Dfunc("s:NetrwCursorline() liststyle=".w:netrw_liststyle." g:netrw_cursorline=".g:netrw_cursorline." s:netrw_usercuc=".s:netrw_usercuc." s:netrw_usercul=".s:netrw_usercul) + " + if w:netrw_liststyle != s:WIDELIST + " thin-long-tree listings + if g:netrw_cursorline == 2 + setlocal cursorline + let &l:cursorcolumn= s:netrw_usercuc +" call Decho("setlocal cursorline (cursorcolumn is ".((s:netrw_usercuc)? "on" : "off").")") + elseif g:netrw_cursorline + setlocal cursorline +" call Decho("setlocal cursorline") + endif + + else + " wide listings + if g:netrw_cursorline == 2 + setlocal cursorline cursorcolumn +" call Decho("setlocal cursorline cursorcolumn") + elseif g:netrw_cursorline + let &l:cursorline= s:netrw_usercul +" call Decho("cursorline is ".((s:netrw_usercul)? "on" : "off").")") + endif + endif +" call Dret("s:NetrwCursorline : l:cursorline=".&l:cursorline." l:cursorcolumn=".&l:cursorcolumn) +endfun + +" --------------------------------------------------------------------- +" s:RestoreCursorline: restores cursorline/cursorcolumn to original user settings {{{2 +fun! s:RestoreCursorline() +" call Dfunc("s:RestoreCursorline() currently, cul=".&l:cursorline." cuc=".&l:cursorcolumn." win#".winnr()." buf#".bufnr("%")) + let &l:cursorline = s:netrw_usercul + let &l:cursorcolumn = s:netrw_usercuc +" call Dret("s:RestoreCursorline : restored cul=".&l:cursorline." cuc=".&l:cursorcolumn) +endfun + " --------------------------------------------------------------------- " s:NetrwDelete: Deletes a file. {{{2 " Uses Steve Hall's idea to insure that Windows paths stay @@ -7788,10 +7999,11 @@ endfun " --------------------------------------------------------------------- " s:NetrwEnew: opens a new buffer, passes netrw buffer variables through {{{2 fun! s:NetrwEnew(...) -" call Dfunc("s:NetrwEnew() a:0=".a:0) +" call Dfunc("s:NetrwEnew() a:0=".a:0." bufnr($)=".bufnr("$")) " call Decho("curdir<".((a:0>0)? a:1 : "")."> buf#".bufnr("%")."<".bufname("%").">") " grab a function-local-variable copy of buffer variables +" call Decho("make function-local copy of netrw variables") if exists("b:netrw_bannercnt") |let netrw_bannercnt = b:netrw_bannercnt |endif if exists("b:netrw_browser_active") |let netrw_browser_active = b:netrw_browser_active |endif if exists("b:netrw_cpf") |let netrw_cpf = b:netrw_cpf |endif @@ -7811,10 +8023,12 @@ fun! s:NetrwEnew(...) call s:NetrwOptionRestore("w:") " call Decho("generate a buffer with keepjumps keepalt enew!") - keepjumps keepalt enew! + keepj keepalt enew! +" call Decho("bufnr($)=".bufnr("$")) call s:NetrwOptionSave("w:") " copy function-local-variables to buffer variable equivalents +" call Decho("copy function-local variables back to buffer netrw variables") if exists("netrw_bannercnt") |let b:netrw_bannercnt = netrw_bannercnt |endif if exists("netrw_browser_active") |let b:netrw_browser_active = netrw_browser_active |endif if exists("netrw_cpf") |let b:netrw_cpf = netrw_cpf |endif @@ -7837,10 +8051,11 @@ fun! s:NetrwEnew(...) if b:netrw_curdir =~ '/$' if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST file NetrwTreeListing + set bt=nowrite noswf nno [ :silent call TreeListMove('[') nno ] :silent call TreeListMove(']') else - exe "silent! keepalt file ".fnameescape(b:netrw_curdir) + exe "sil! keepalt file ".fnameescape(b:netrw_curdir) endif endif endif @@ -8095,10 +8310,10 @@ fun! s:Strlen(x) " preceded by lam, one otherwise, etc.) " (comment from TM, solution from me) let modkeep= &mod - exe "norm! o\" + exe "keepj norm! o\" call setline(line("."),a:x) let ret= virtcol("$") - 1 - d + keepj d let &mod= modkeep else @@ -8127,17 +8342,17 @@ fun! s:TreeListMove(dir) if curline !~ '/$' " call Decho('regfile') if a:dir == '[' && prvline != '' - norm! 0 + keepj norm! 0 let nl = search('^'.indentm1.'[^|]','bWe') " search backwards from regular file " call Decho("regfile srch back: ".nl) elseif a:dir == ']' && nxtline != '' - norm! $ + keepj norm! $ let nl = search('^'.indentm1.'[^|]','We') " search forwards from regular file " call Decho("regfile srch fwd: ".nl) endif elseif a:dir == '[' && prvline != '' - norm! 0 + keepj norm! 0 let curline= line(".") let nl = search('^'.curindent.'[^|]','bWe') " search backwards From directory, same indentation " call Decho("dir srch back ind: ".nl) @@ -8149,7 +8364,7 @@ fun! s:TreeListMove(dir) endif elseif a:dir == ']' && nxtline != '' - norm! $ + keepj norm! $ let curline = line(".") let nl = search('^'.curindent.'[^|]','We') " search forwards from directory, same indentation " call Decho("dir srch fwd ind: ".nl) diff --git a/runtime/autoload/sqlcomplete.vim b/runtime/autoload/sqlcomplete.vim index aae92e6146..2d88862a13 100644 --- a/runtime/autoload/sqlcomplete.vim +++ b/runtime/autoload/sqlcomplete.vim @@ -1,14 +1,23 @@ " Vim OMNI completion script for SQL " Language: SQL " Maintainer: David Fishburn -" Version: 7.0 -" Last Change: 2009 Jan 04 +" Version: 9.0 +" Last Change: 2010 Apr 20 " Usage: For detailed help " ":help sql.txt" " or ":help ft-sql-omni" " or read $VIMRUNTIME/doc/sql.txt " History +" Version 9.0 +" This change removes some of the support for tables with spaces in their +" names in order to simplify the regexes used to pull out query table +" aliases for more robust table name and column name code completion. +" Full support for "table names with spaces" can be added in again +" after 7.3. +" Version 8.0 +" Incorrectly re-executed the g:ftplugin_sql_omni_key_right and g:ftplugin_sql_omni_key_left +" when drilling in and out of a column list for a table. " Version 7.0 " Better handling of object names " Version 6.0 @@ -250,7 +259,7 @@ function! sqlcomplete#Complete(findstart, base) " 1. Check if the dbext plugin has the option turned " on to even allow owners " 2. Based on 1, if the user is showing a table list - " and the DrillIntoTable (using ) then + " and the DrillIntoTable (using ) then " this will be owner.table. In this case, we can " check to see the table.column exists in the " cached table list. If it does, then we have @@ -390,13 +399,14 @@ function! sqlcomplete#DrillIntoTable() call sqlcomplete#Map('column') " C-Y, makes the currently highlighted entry active " and trigger the omni popup to be redisplayed - call feedkeys("\\\") + call feedkeys("\\\", 'n') else - if has('win32') - " If the popup is not visible, simple perform the normal - " behaviour - exec "normal! \" - endif + " If the popup is not visible, simple perform the normal + " key behaviour. + " Must use exec since they key must be preceeded by "\" + " or feedkeys will simply push each character of the string + " rather than the "key press". + exec 'call feedkeys("\'.g:ftplugin_sql_omni_key_right.'", "n")' endif return "" endfunction @@ -408,11 +418,12 @@ function! sqlcomplete#DrillOutOfColumns() " Trigger the omni popup to be redisplayed call feedkeys("\\") else - if has('win32') - " If the popup is not visible, simple perform the normal - " behaviour - exec "normal! \" - endif + " If the popup is not visible, simple perform the normal + " key behaviour. + " Must use exec since they key must be preceeded by "\" + " or feedkeys will simply push each character of the string + " rather than the "key press". + exec 'call feedkeys("\'.g:ftplugin_sql_omni_key_left.'", "n")' endif return "" endfunction @@ -609,7 +620,7 @@ function! s:SQLCGetColumns(table_name, list_type) " Search backwards to the beginning of the statement " and do NOT wrap " exec 'silent! normal! v?\<\(select\|update\|delete\|;\)\>'."\n".'"yy' - exec 'silent! normal! ?\<\(select\|update\|delete\|;\)\>'."\n" + exec 'silent! normal! ?\<\c\(select\|update\|delete\|;\)\>'."\n" " Start characterwise visual mode " Advance right one character @@ -618,27 +629,38 @@ function! s:SQLCGetColumns(table_name, list_type) " 2. A ; at the end of a line (the delimiter) " 3. The end of the file (incase no delimiter) " Yank the visually selected text into the "y register. - exec 'silent! normal! vl/\(\\|\\|\\|;\s*$\|\%$\)'."\n".'"yy' + exec 'silent! normal! vl/\c\(\\|\\|\\|;\s*$\|\%$\)'."\n".'"yy' let query = @y let query = substitute(query, "\n", ' ', 'g') let found = 0 - " if query =~? '^\(select\|update\|delete\)' - if query =~? '^\(select\)' + " if query =~? '^\c\(select\)' + if query =~? '^\(select\|update\|delete\)' let found = 1 " \(\(\<\w\+\>\)\.\)\? - - " 'from.\{-}' - Starting at the from clause + " '\c\(from\|join\|,\).\{-}' - Starting at the from clause (case insensitive) " '\zs\(\(\<\w\+\>\)\.\)\?' - Get the owner name (optional) " '\<\w\+\>\ze' - Get the table name " '\s\+\<'.table_name.'\>' - Followed by the alias " '\s*\.\@!.*' - Cannot be followed by a . " '\(\\|$\)' - Must be followed by a WHERE clause " '.*' - Exclude the rest of the line in the match + " let table_name_new = matchstr(@y, + " \ '\c\(from\|join\|,\).\{-}'. + " \ '\zs\(\("\|\[\)\?.\{-}\("\|\]\)\.\)\?'. + " \ '\("\|\[\)\?.\{-}\("\|\]\)\?\ze'. + " \ '\s\+\%(as\s\+\)\?\<'. + " \ matchstr(table_name, '.\{-}\ze\.\?$'). + " \ '\>'. + " \ '\s*\.\@!.*'. + " \ '\(\\|$\)'. + " \ '.*' + " \ ) let table_name_new = matchstr(@y, - \ 'from.\{-}'. - \ '\zs\(\("\|\[\)\?.\{-}\("\|\]\)\.\)\?'. - \ '\("\|\[\)\?.\{-}\("\|\]\)\ze'. + \ '\c\(\\|\\|,\)\s*'. + \ '\zs\(\("\|\[\)\?\w\+\("\|\]\)\?\.\)\?'. + \ '\("\|\[\)\?\w\+\("\|\]\)\?\ze'. \ '\s\+\%(as\s\+\)\?\<'. \ matchstr(table_name, '.\{-}\ze\.\?$'). \ '\>'. @@ -649,7 +671,7 @@ function! s:SQLCGetColumns(table_name, list_type) if table_name_new != '' let table_alias = table_name - let table_name = table_name_new + let table_name = matchstr( table_name_new, '^\(.*\.\)\?\zs.*\ze' ) let list_idx = index(s:tbl_name, table_name, 0, &ignorecase) if list_idx > -1 @@ -717,4 +739,3 @@ function! s:SQLCGetColumns(table_name, list_type) return table_cols endfunction - diff --git a/runtime/autoload/vimball.vim b/runtime/autoload/vimball.vim index b97c3a5344..13e82ac49f 100644 --- a/runtime/autoload/vimball.vim +++ b/runtime/autoload/vimball.vim @@ -1,7 +1,7 @@ " vimball.vim : construct a file containing both paths and files " Author: Charles E. Campbell, Jr. -" Date: Dec 28, 2009 -" Version: 30 +" Date: Apr 12, 2010 +" Version: 31 " GetLatestVimScripts: 1502 1 :AutoInstall: vimball.vim " Copyright: (c) 2004-2009 by Charles E. Campbell, Jr. " The VIM LICENSE applies to Vimball.vim, and Vimball.txt @@ -14,7 +14,7 @@ if &cp || exists("g:loaded_vimball") finish endif -let g:loaded_vimball = "v30" +let g:loaded_vimball = "v31" if v:version < 702 echohl WarningMsg echo "***warning*** this version of vimball needs vim 7.2" diff --git a/runtime/autoload/zip.vim b/runtime/autoload/zip.vim index af56944ce3..a55f1dccd3 100644 --- a/runtime/autoload/zip.vim +++ b/runtime/autoload/zip.vim @@ -1,7 +1,7 @@ " zip.vim: Handles browsing zipfiles " AUTOLOAD PORTION -" Date: Jul 30, 2008 -" Version: 22 +" Date: Apr 12, 2010 +" Version: 23 " Maintainer: Charles E Campbell, Jr " License: Vim License (see vim's :help license) " Copyright: Copyright (C) 2005-2008 Charles E. Campbell, Jr. {{{1 @@ -16,13 +16,19 @@ " --------------------------------------------------------------------- " Load Once: {{{1 -let s:keepcpo= &cpo -set cpo&vim -if &cp || exists("g:loaded_zip") || v:version < 700 +if &cp || exists("g:loaded_zip") finish endif +let g:loaded_zip= "v23" +if v:version < 702 + echohl WarningMsg + echo "***warning*** this version of zip needs vim 7.2" + echohl Normal + finish +endif +let s:keepcpo= &cpo +set cpo&vim -let g:loaded_zip = "v22" let s:zipfile_escape = ' ?&;\' let s:ERROR = 2 let s:WARNING = 1 diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index d1e53c4a9b..72cf61f36e 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim version 7.2. Last change: 2009 Nov 25 +*autocmd.txt* For Vim version 7.2. Last change: 2010 May 14 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index f493e10e84..99ad77652c 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1,4 +1,4 @@ -*change.txt* For Vim version 7.2. Last change: 2009 Nov 11 +*change.txt* For Vim version 7.2. Last change: 2010 Mar 23 VIM REFERENCE MANUAL by Bram Moolenaar @@ -585,7 +585,7 @@ For other systems the tmpnam() library function is used. ":&r". See |:s_flags| for [flags]. *&* -& Synonym for ":s//~/" (repeat last substitute). Note +& Synonym for ":s" (repeat last substitute). Note that the flags are not remembered, thus it might actually work differently. You can use ":&&" to keep the flags. diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index b98ded1662..3088ea1f57 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -1,4 +1,4 @@ -*cmdline.txt* For Vim version 7.2. Last change: 2009 Oct 25 +*cmdline.txt* For Vim version 7.2. Last change: 2010 May 07 VIM REFERENCE MANUAL by Bram Moolenaar @@ -522,6 +522,7 @@ followed by another Vim command: :registers :read ! :scscope + :sign :tcl :tcldo :tclfile diff --git a/runtime/doc/digraph.txt b/runtime/doc/digraph.txt index 65261b72e0..8440a7779f 100644 --- a/runtime/doc/digraph.txt +++ b/runtime/doc/digraph.txt @@ -1,4 +1,4 @@ -*digraph.txt* For Vim version 7.2. Last change: 2008 Aug 06 +*digraph.txt* For Vim version 7.2. Last change: 2010 Apr 11 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index ec372d1db3..1e7d6f3400 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.2. Last change: 2010 Mar 10 +*eval.txt* For Vim version 7.2. Last change: 2010 May 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -67,7 +67,7 @@ the Number. Examples: > Number 123 --> String "123" Number 0 --> String "0" Number -1 --> String "-1" - + *octal* Conversion from a String to a Number is done by converting the first digits to a number. Hexadecimal "0xf9" and Octal "017" numbers are recognized. If the String doesn't start with digits, the result is zero. Examples: > @@ -1020,7 +1020,9 @@ A string constant accepts these special characters: \t tab \\ backslash \" double quote -\ Special key named "xxx". e.g. "\" for CTRL-W. +\ Special key named "xxx". e.g. "\" for CTRL-W. This is for use + in mappings, the 0x80 byte is escaped. Don't use to get a + utf-8 character, use \uxxxx as mentioned above. Note that "\xff" is stored as the byte 255, which may be invalid in some encodings. Use "\u00ff" to store character 255 according to the current value @@ -4944,6 +4946,8 @@ setqflist({list} [, {action}]) *setqflist()* item will not be handled as an error line. If both "pattern" and "lnum" are present then "pattern" will be used. + If you supply an empty {list}, the quickfix list will be + cleared. Note that the list is not exactly the same as what |getqflist()| returns. @@ -6828,14 +6832,16 @@ This would call the function "my_func_whizz(parameter)". < *:exe* *:execute* :exe[cute] {expr1} .. Executes the string that results from the evaluation - of {expr1} as an Ex command. Multiple arguments are - concatenated, with a space in between. {expr1} is - used as the processed command, command line editing - keys are not recognized. + of {expr1} as an Ex command. + Multiple arguments are concatenated, with a space in + between. To avoid the extra space use the "." + operator to concatenate strings into one argument. + {expr1} is used as the processed command, command line + editing keys are not recognized. Cannot be followed by a comment. Examples: > - :execute "buffer " nextbuf - :execute "normal " count . "w" + :execute "buffer" nextbuf + :execute "normal" count . "w" < ":execute" can be used to append a command to commands that don't accept a '|'. Example: > diff --git a/runtime/doc/fold.txt b/runtime/doc/fold.txt index 60704c598a..cf920968f2 100644 --- a/runtime/doc/fold.txt +++ b/runtime/doc/fold.txt @@ -1,4 +1,4 @@ -*fold.txt* For Vim version 7.2. Last change: 2010 Feb 21 +*fold.txt* For Vim version 7.2. Last change: 2010 May 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -127,6 +127,9 @@ fold level. But note that foldlevel() may return -1 if the level is not known yet. And it returns the level at the start of the line, while a fold might end in that line. +It may happened that folds are not updated properly. You can use |zx| or |zX| +to force updating folds. + SYNTAX *fold-syntax* @@ -352,9 +355,13 @@ zv View cursor line: Open just enough folds to make the line in *zx* zx Update folds: Undo manually opened and closed folds: re-apply 'foldlevel', then do "zv": View cursor line. + Also forces recomputing folds. This is useful when using + 'foldexpr' and the buffer is changed in a way that results in + folds not to be updated properly. *zX* zX Undo manually opened and closed folds: re-apply 'foldlevel'. + Also forces recomputing folds, like |zx|. *zm* zm Fold more: Subtract one from 'foldlevel'. If 'foldlevel' was diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt index 09a833b463..6243e10f94 100644 --- a/runtime/doc/gui.txt +++ b/runtime/doc/gui.txt @@ -1,4 +1,4 @@ -*gui.txt* For Vim version 7.2. Last change: 2009 Jan 22 +*gui.txt* For Vim version 7.2. Last change: 2010 May 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -556,7 +556,7 @@ some modes: mode inserted appended ~ Normal nothing nothing Visual - Insert + Insert Cmdline Op-pending @@ -571,7 +571,7 @@ is equal to: > :nmenu File.Next :next^M :vmenu File.Next ^C:next^M^\^G - :imenu File.Next ^O:next^M + :imenu File.Next ^\^O:next^M :cmenu File.Next ^C:next^M^\^G :omenu File.Next ^C:next^M^\^G diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt index 33593cca69..ac64f04709 100644 --- a/runtime/doc/indent.txt +++ b/runtime/doc/indent.txt @@ -1,4 +1,4 @@ -*indent.txt* For Vim version 7.2. Last change: 2010 Jan 27 +*indent.txt* For Vim version 7.2. Last change: 2010 Mar 27 VIM REFERENCE MANUAL by Bram Moolenaar @@ -447,7 +447,7 @@ assume a 'shiftwidth' of 4. The defaults, spelled out in full, are: cinoptions=>s,e0,n0,f0,{0,}0,^0,:s,=s,l0,b0,gs,hs,ps,ts,is,+s,c3,C0, - /0,(2s,us,U0,w0,W0,m0,j0,)20,*30,#0 + /0,(2s,us,U0,w0,W0,m0,j0,)20,*70,#0 Vim puts a line in column 1 if: - It starts with '#' (preprocessor directives), if 'cinkeys' contains '#'. diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt index 0b5afe709d..d6d2ab91bf 100644 --- a/runtime/doc/motion.txt +++ b/runtime/doc/motion.txt @@ -1,4 +1,4 @@ -*motion.txt* For Vim version 7.2. Last change: 2009 Sep 15 +*motion.txt* For Vim version 7.2. Last change: 2010 May 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -315,6 +315,7 @@ _ [count] - 1 lines downward, on the first non-blank G Goto line [count], default last line, on the first non-blank character |linewise|. If 'startofline' not set, keep the same column. + G is a one of |jump-motions|. ** Goto line [count], default last line, on the last @@ -328,6 +329,8 @@ gg Goto line [count], default first line, on the first :[range] Set the cursor on the last line number in [range]. [range] can also be just one line number, e.g., ":1" or ":'m". + In contrast with |G| this command does not modify the + |jumplist|. *N%* {count}% Go to {count} percentage in the file, on the first non-blank in the line |linewise|. To compute the new diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index e1786133ff..33093b22a7 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.2. Last change: 2010 Jan 06 +*options.txt* For Vim version 7.2. Last change: 2010 May 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -40,6 +40,7 @@ achieve special effects. These options come in three forms: :se[t] no{option} Toggle option: Reset, switch it off. + *:set-!* *:set-inv* :se[t] {option}! or :se[t] inv{option} Toggle option: Invert value. {not in Vi} @@ -696,8 +697,8 @@ A jump table for the options with a short description can be found at |Q_op|. 'autochdir' 'acd' boolean (default off) global {not in Vi} - {only available when compiled with the - |+netbeans_intg| or |+sun_workshop| feature} + {only available when compiled with it, use + exists("+autochdir") to check} When on, Vim will change the current working directory whenever you open a file, switch buffers, delete a buffer or open/close a window. It will change to the directory containing the file which was opened @@ -5708,7 +5709,8 @@ A jump table for the options with a short description can be found at |Q_op|. in a file and echoed to the screen. If the 'shell' option is "csh" or "tcsh" after initializations, the default becomes "|& tee". If the 'shell' option is "sh", "ksh", "zsh" or "bash" the default becomes - "2>&1| tee". This means that stderr is also included. + "2>&1| tee". This means that stderr is also included. Before using + the 'shell' option a path is removed, thus "/bin/sh" uses "sh". The initialization of this option is done after reading the ".vimrc" and the other initializations, so that when the 'shell' option is set there, the 'shellpipe' option changes automatically, unless it was diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 7635af288a..9f0955b18a 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -1,4 +1,4 @@ -*pi_netrw.txt* For Vim version 7.2. Last change: 2009 Dec 28 +*pi_netrw.txt* For Vim version 7.2. Last change: 2010 May 14 ----------------------------------------------------- NETRW REFERENCE MANUAL by Charles E. Campbell, Jr. @@ -6,7 +6,7 @@ Author: Charles E. Campbell, Jr. (remove NOSPAM from Campbell's email first) -Copyright: Copyright (C) 2009 Charles E Campbell, Jr *netrw-copyright* +Copyright: Copyright (C) 1999-2010 Charles E Campbell, Jr *netrw-copyright* Permission is hereby granted to use and distribute this code, with or without modifications, provided that this copyright notice is copied with it. Like anything else that's free, netrw.vim, @@ -19,9 +19,9 @@ Copyright: Copyright (C) 2009 Charles E Campbell, Jr *netrw-copyright* use of this software. -*dav* *ftp* *netrw-file* *Nread* *rcp* *scp* -*davs* *http* *netrw.vim* *Nsource* *rsync* *sftp* -*fetch* *netrw* *network* *Nwrite* + *dav* *ftp* *netrw-file* *rcp* *scp* + *davs* *http* *netrw.vim* *rsync* *sftp* + *fetch* *netrw* *network* ============================================================================== 1. Contents *netrw-contents* {{{1 @@ -158,7 +158,7 @@ There are more protocols supported by netrw than just scp and ftp, too: see the next section, |netrw-externapp|, on how to use these external applications with netrw and vim. -PREVENTING LOADING +PREVENTING LOADING *netrw-noload* If you want to use plugins, but for some reason don't wish to use netrw, then you need to avoid loading both the plugin and the autoload portions of netrw. @@ -169,7 +169,7 @@ You may do so by placing the following two lines in your <.vimrc>: > < ============================================================================== -3. Netrw Reference *netrw-ref* {{{1 +3. Netrw Reference *netrw-ref* {{{1 Netrw supports several protocols in addition to scp and ftp as mentioned in |netrw-start|. These include dav, fetch, http,... well, just look @@ -642,18 +642,22 @@ Nread as shown in |netrw-transparent| (ie. simply use > instead, as appropriate) -- see |netrw-urls|. In the explanations below, a {netfile} is an url to a remote file. + *:Nwrite* *:Nw* :[range]Nw[rite] Write the specified lines to the current file as specified in b:netrw_lastfile. + (related: |netrw-nwrite|) :[range]Nw[rite] {netfile} [{netfile}]... Write the specified lines to the {netfile}. + *:Nread* *:Nr* :Nr[ead] Read the lines from the file specified in b:netrw_lastfile - into the current buffer. + into the current buffer. (related: |netrw-nread|) :Nr[ead] {netfile} {netfile}... Read the {netfile} after the current line. + *:Nsource* *:Ns* :Ns[ource] {netfile} Source the {netfile}. To start up vim using a remote .vimrc, one may use @@ -661,20 +665,24 @@ below, a {netfile} is an url to a remote file. vim -u NORC -N --cmd "runtime plugin/netrwPlugin.vim" --cmd "source scp://HOSTNAME/.vimrc" -< *netrw-uidpass* -:call NetUserPass() +< (related: |netrw-source|) + +:call NetUserPass() *NetUserPass()* If g:netrw_uid and s:netrw_passwd don't exist, this function will query the user for them. + (related: |netrw-userpass|) :call NetUserPass("userid") This call will set the g:netrw_uid and, if the password doesn't exist, will query the user for it. + (related: |netrw-userpass|) :call NetUserPass("userid","passwd") This call will set both the g:netrw_uid and s:netrw_passwd. The user-id and password are used by ftp transfers. One may effectively remove the user-id and password by using empty strings (ie. ""). + (related: |netrw-userpass|) :NetrwSettings This command is described in |netrw-settings| -- used to display netrw settings and change netrw behavior. @@ -688,9 +696,7 @@ below, a {netfile} is an url to a remote file. The script provides several variables which act as options to affect 's file transfer behavior. These variables typically may be set in the user's <.vimrc> file: (see also |netrw-settings| |netrw-protocol|) - > - ------------- Netrw Options ------------- @@ -1025,6 +1031,8 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2 to the netrw browser window. See |g:netrw_retmap|. (gvim only) like mf, will mark files + (to disable mouse buttons while browsing: |g:netrw_mousemaps|) + *netrw-quickcom* *netrw-quickcoms* QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2 :NetrwClean[!] ...........................................|netrw-clean| @@ -1202,7 +1210,7 @@ Related Topics: |netrw-qb| how to list bookmarks -CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir* {{{2 +CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir* {{{2 Every time you change to a new directory (new for the current session), netrw will save the directory in a recently-visited directory history @@ -2022,7 +2030,8 @@ your browsing preferences. (see also: |netrw-settings|) unix or g:netrw_cygwin set: : "ls -tlF" otherwise "dir" - *g:netrw_glob_escape* ='[]*?`{~$' + *g:netrw_glob_escape* ='[]*?`{~$' (unix) + ='[]*?`{$' (windows These characters in directory names are escaped before applying glob() @@ -2293,6 +2302,18 @@ the browser (where the cursor will remain) and the file (see |:pedit|). By default, the split will be taken horizontally; one may use vertical splitting if one has set |g:netrw_preview| first. +An interesting set of netrw settings is: > + + let g:netrw_preview = 1 + let g:netrw_liststyle = 3 + let g:netrw_winsize = 30 + +These will: + 1. Make vertical splitting the default for previewing files + 2. Make the default listing style "tree" + 3. When a vertical preview window is opened, the directory listing + will use only 30 columns; the rest of the window is used for the + preview window. PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2 @@ -2597,6 +2618,29 @@ Associated setting variables: |g:netrw_chgwin| Multibyte encodings use two (or more) bytes per character. You may need to change |g:netrw_sepchr| and/or |g:netrw_xstrlen|. + *netrw-p13* + P13. I'm a Windows + putty + ssh user, and when I attempt to browse, + the directories are missing trailing "/"s so netrw treats them + as file transfers instead of as attempts to browse + subdirectories. How may I fix this? + + (mikeyao) If you want to use vim via ssh and putty under Windows, + try combining the use of pscp/psftp with plink. pscp/psftp will + be used to connect and plink will be used to execute commands on + the server, for example: list files and directory using 'ls'. + + These are the settings I use to do this: +> + " list files, it's the key setting, if you haven't set, + " you will get a blank buffer + let g:netrw_list_cmd = "plink HOSTNAME ls -Fa" + " if you haven't add putty directory in system path, you should + " specify scp/sftp command. For examples: + "let g:netrw_sftp_cmd = "d:\\dev\\putty\\PSFTP.exe" + "let g:netrw_scp_cmd = "d:\\dev\\putty\\PSCP.exe" +< + + ============================================================================== 11. Debugging Netrw Itself *netrw-debug* {{{1 @@ -2651,6 +2695,35 @@ which is loaded automatically at startup (assuming :set nocp). ============================================================================== 12. History *netrw-history* {{{1 + v138: May 01, 2010 * added the bomb setting to the Save-Set-Restore + option handling (for Tony M) + * (Bram Moolenaar) netrw optionally sets cursorline + (and sometimes cursorcolumn) for its display. + This option setting was leaking through with + remote file handling. + v137: Dec 28, 2009 * modified the preview window handling for + vertically split windows. The preview + window will take up all but g:netrw_winsize + columns of the original window; those + g:netrw_winsize columns will be used for + the netrw listing. + * (Simon Dambe) removed "~" from + |g:netrw_glob_escape| under Windows + * (Bram Moolenaar) modified test for status bar + click with leftmouse. Moved code to + s:NetrwLeftmouse(). + Feb 24, 2010 * (for Jean Johner) added insert-mode maps; one + can get into insert mode with netrw via + ctrl-o :e . + Mar 15, 2010 * (Dominique Pellé) Directory with backslashes such + as foo\bar were not being entered/left properly + Mar 15, 2010 * Using :Explore .. and causing two FocusGained + events caused the directory to change. Fixed. + Mar 22, 2010 * Last fix caused problems for *//pat and */filepat + searches. + Mar 30, 2010 * With :set hidden and changing listing styles 8 + times, the tree listing buffer was being marked + as modified upon exit. Fixed. v136: Jan 14, 2009 * extended |g:Netrw_funcref| to also handle lists of function references Jan 14, 2009 * (reported by Marvin Renich) with spell check diff --git a/runtime/doc/pi_vimball.txt b/runtime/doc/pi_vimball.txt index 885131e292..a1a32549ac 100644 --- a/runtime/doc/pi_vimball.txt +++ b/runtime/doc/pi_vimball.txt @@ -1,4 +1,4 @@ -*pi_vimball.txt* For Vim version 7.2. Last change: 2009 Dec 28 +*pi_vimball.txt* For Vim version 7.2. Last change: 2010 Apr 12 ---------------- Vimball Archiver @@ -156,6 +156,22 @@ PREVENTING LOADING let g:loaded_vimballPlugin= 1 let g:loaded_vimball = 1 < +WINDOWS *vimball-windows* + + Many vimball files are compressed with gzip. Windows, unfortunately, + does not come provided with a tool to decompress gzip'ped files. + Fortunately, there are a number of tools available for Windows users + to un-gzip files: +> + Item Tool/Suite Free Website + ---- ---------- ---- ------- + 7zip tool y http://www.7-zip.org/ + Winzip tool n http://www.winzip.com/downwz.htm + unxutils suite y http://unxutils.sourceforge.net/ + cygwin suite y http://www.cygwin.com/ + GnuWin32 suite y http://gnuwin32.sourceforge.net/ + MinGW suite y http://www.mingw.org/ +< ============================================================================== 4. Vimball History *vimball-history* {{{1 diff --git a/runtime/doc/pi_zip.txt b/runtime/doc/pi_zip.txt index 5c5cf8631a..3775712f27 100644 --- a/runtime/doc/pi_zip.txt +++ b/runtime/doc/pi_zip.txt @@ -1,4 +1,4 @@ -*pi_zip.txt* For Vim version 7.2. Last change: 2008 Jul 30 +*pi_zip.txt* For Vim version 7.2. Last change: 2010 Apr 12 +====================+ | Zip File Interface | @@ -6,7 +6,7 @@ Author: Charles E. Campbell, Jr. (remove NOSPAM from Campbell's email first) -Copyright: Copyright (C) 2005-2008 Charles E Campbell, Jr *zip-copyright* +Copyright: Copyright (C) 2005-2009 Charles E Campbell, Jr *zip-copyright* Permission is hereby granted to use and distribute this code, with or without modifications, provided that this copyright notice is copied with it. Like anything else that's free, @@ -59,6 +59,16 @@ Copyright: Copyright (C) 2005-2008 Charles E Campbell, Jr *zip-copyright* It's used during the writing (updating) of a file already in a zip file; by default: > let g:zip_zipcmd= "zip" +< + PREVENTING LOADING~ + + If for some reason you do not wish to use vim to examine zipped files, + you may put the following two variables into your <.vimrc> to prevent + the tar plugin from loading: > + + let g:loaded_zipPlugin= 1 + let g:loaded_zip = 1 +< < ============================================================================== diff --git a/runtime/doc/sign.txt b/runtime/doc/sign.txt index 8e08ed57fa..5eb8b122a8 100644 --- a/runtime/doc/sign.txt +++ b/runtime/doc/sign.txt @@ -1,4 +1,4 @@ -*sign.txt* For Vim version 7.2. Last change: 2006 Apr 24 +*sign.txt* For Vim version 7.2. Last change: 2010 May 07 VIM REFERENCE MANUAL by Gordon Prieur @@ -53,7 +53,7 @@ disappears again. The color of the column is set with the SignColumn group ============================================================================== 2. Commands *sign-commands* *:sig* *:sign* -Here is an example that places a sign piet, displayed with the text ">>", in +Here is an example that places a sign "piet", displayed with the text ">>", in line 23 of the current file: > :sign define piet text=>> texthl=Search :exe ":sign place 2 line=23 name=piet file=" . expand("%:p") diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt index 8a559dde86..dc022459d2 100644 --- a/runtime/doc/spell.txt +++ b/runtime/doc/spell.txt @@ -1,4 +1,4 @@ -*spell.txt* For Vim version 7.2. Last change: 2009 Oct 28 +*spell.txt* For Vim version 7.2. Last change: 2010 Apr 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -468,8 +468,11 @@ Vim uses a binary file format for spelling. This greatly speeds up loading the word list and keeps it small. *.aff* *.dic* *Myspell* You can create a Vim spell file from the .aff and .dic files that Myspell -uses. Myspell is used by OpenOffice.org and Mozilla. You should be able to -find them here: +uses. Myspell is used by OpenOffice.org and Mozilla. The OpenOffice .oxt +files are zip files which contain the .aff and .dic files. You should be able +to find them here: + http://extensions.services.openoffice.org/dictionary +The older, OpenOffice 2 files may be used if this doesn't work: http://wiki.services.openoffice.org/wiki/Dictionaries You can also use a plain word list. The results are the same, the choice depends on what word lists you can find. diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 4b92ac14ae..c80c5c3a6a 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 7.2. Last change: 2009 Dec 19 +*syntax.txt* For Vim version 7.2. Last change: 2010 May 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -3871,13 +3871,19 @@ This will open a new window containing all highlight group names, displayed in their own color. *:colo* *:colorscheme* *E185* +:colo[rscheme] Output the name of the currently active color scheme. + This is basically the same as > + :echo g:colors_name +< In case g:colors_name has not been defined :colo will + output "default". When compiled without the |+eval| + feature it will output "unknown". + :colo[rscheme] {name} Load color scheme {name}. This searches 'runtimepath' for the file "colors/{name}.vim. The first one that is found is loaded. To see the name of the currently active color scheme: > - :echo g:colors_name -< When using the default colors you will get an E121 - error. + :colo +< The name is also stored in the g:colors_name variable. Doesn't work recursively, thus you can't use ":colorscheme" in a color scheme script. After the color scheme has been loaded the diff --git a/runtime/doc/tags b/runtime/doc/tags index dd806fca01..990fc20631 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -1767,6 +1767,12 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* :Nexplore pi_netrw.txt /*:Nexplore* :Next editing.txt /*:Next* :NoMatchParen pi_paren.txt /*:NoMatchParen* +:Nr pi_netrw.txt /*:Nr* +:Nread pi_netrw.txt /*:Nread* +:Ns pi_netrw.txt /*:Ns* +:Nsource pi_netrw.txt /*:Nsource* +:Nw pi_netrw.txt /*:Nw* +:Nwrite pi_netrw.txt /*:Nwrite* :P various.txt /*:P* :Pexplore pi_netrw.txt /*:Pexplore* :Print various.txt /*:Print* @@ -2614,6 +2620,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* :search-args tagsrch.txt /*:search-args* :set options.txt /*:set* :set+= options.txt /*:set+=* +:set-! options.txt /*:set-!* :set-& options.txt /*:set-&* :set-&vi options.txt /*:set-&vi* :set-&vim options.txt /*:set-&vim* @@ -2621,6 +2628,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* :set-args options.txt /*:set-args* :set-browse options.txt /*:set-browse* :set-default options.txt /*:set-default* +:set-inv options.txt /*:set-inv* :set-termcap options.txt /*:set-termcap* :set-verbose options.txt /*:set-verbose* :set^= options.txt /*:set^=* @@ -4235,13 +4243,11 @@ N: cmdline.txt /*N:* N various.txt /*N* NL-used-for-Nul pattern.txt /*NL-used-for-Nul* NetBSD-backspace options.txt /*NetBSD-backspace* +NetUserPass() pi_netrw.txt /*NetUserPass()* Normal intro.txt /*Normal* Normal-mode intro.txt /*Normal-mode* -Nread pi_netrw.txt /*Nread* -Nsource pi_netrw.txt /*Nsource* Number eval.txt /*Number* Nvi intro.txt /*Nvi* -Nwrite pi_netrw.txt /*Nwrite* O insert.txt /*O* OS/2 os_os2.txt /*OS\/2* OS2 os_os2.txt /*OS2* @@ -6620,6 +6626,7 @@ netrw-mx pi_netrw.txt /*netrw-mx* netrw-mz pi_netrw.txt /*netrw-mz* netrw-netrc pi_netrw.txt /*netrw-netrc* netrw-nexplore pi_netrw.txt /*netrw-nexplore* +netrw-noload pi_netrw.txt /*netrw-noload* netrw-nread pi_netrw.txt /*netrw-nread* netrw-nwrite pi_netrw.txt /*netrw-nwrite* netrw-o pi_netrw.txt /*netrw-o* @@ -6629,6 +6636,7 @@ netrw-p1 pi_netrw.txt /*netrw-p1* netrw-p10 pi_netrw.txt /*netrw-p10* netrw-p11 pi_netrw.txt /*netrw-p11* netrw-p12 pi_netrw.txt /*netrw-p12* +netrw-p13 pi_netrw.txt /*netrw-p13* netrw-p2 pi_netrw.txt /*netrw-p2* netrw-p3 pi_netrw.txt /*netrw-p3* netrw-p4 pi_netrw.txt /*netrw-p4* @@ -6679,7 +6687,6 @@ netrw-texplore pi_netrw.txt /*netrw-texplore* netrw-todo pi_netrw.txt /*netrw-todo* netrw-transparent pi_netrw.txt /*netrw-transparent* netrw-u pi_netrw.txt /*netrw-u* -netrw-uidpass pi_netrw.txt /*netrw-uidpass* netrw-updir pi_netrw.txt /*netrw-updir* netrw-urls pi_netrw.txt /*netrw-urls* netrw-userpass pi_netrw.txt /*netrw-userpass* @@ -6792,6 +6799,7 @@ object-select motion.txt /*object-select* objects index.txt /*objects* obtaining-exted netbeans.txt /*obtaining-exted* ocaml.vim syntax.txt /*ocaml.vim* +octal eval.txt /*octal* oldfiles-variable eval.txt /*oldfiles-variable* ole-activation if_ole.txt /*ole-activation* ole-eval if_ole.txt /*ole-eval* @@ -8072,6 +8080,7 @@ vimball-extract pi_vimball.txt /*vimball-extract* vimball-history pi_vimball.txt /*vimball-history* vimball-intro pi_vimball.txt /*vimball-intro* vimball-manual pi_vimball.txt /*vimball-manual* +vimball-windows pi_vimball.txt /*vimball-windows* vimdev intro.txt /*vimdev* vimdiff diff.txt /*vimdiff* vimfiles options.txt /*vimfiles* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 8b0ce31bf7..2becf8733b 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.2. Last change: 2010 Mar 17 +*todo.txt* For Vim version 7.2. Last change: 2010 May 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -30,20 +30,59 @@ be worked on, but only if you sponsor Vim development. See |sponsor|. *known-bugs* -------------------- Known bugs and current work ----------------------- -":s" summary in :folddo is not correct. (Jean Johner, 2010 Feb 20) -Patch from Lech Lorens, 2010 Mar 13. +Cursor positioning wrong with 0x200e character. (John Becket, 2010 May 6) -Vim tries to set the background or foreground color in a terminal to -1. -(Graywh) Appears to happen with ":hi Normal ctermbg=NONE". -Possible solution from Matt Wozniski, 2010 Mar 17. +E315 when trying to change a file in FileChangedRO autocommand event. +(Dominique Pelle, 2010 Apr 30) + +When directory "/tmp/tags" contains "tags1" and "tags2", setting 'tags' to +"/tmp/tags/*" doesn't pick up these files. (Simon Ruggier, 2010 Mar 17) + +":command Print echo 'print'" works, but ":Print" doesn't. Builtin Print +should be overruled. (Aaron Thoma) + +Editing a file with a ^M with 'ff' set to "mac", opening a help file, then the +^M is displayed as ^J sometimes. Getting 'ff' value from wrong window/buffer? + +Have a look at patch to enable screen access from Python. (Marko Mahnic, 2010 +Apr 12) + +Problem producing tags file when hebrew.frx is present. It has a BOM. +Results in E670. (Tony Mechelynck, 2010 May 2) + +'cindent' not correct when 'list' is set. (Zdravi Korusef, 2010 Apr 15) + +":helpgrep" does not put the cursor in the correct column when preceded by +accented character. (Tony Mechelynck, 2010 Apr 15) + +Better Czech keymap. (Stepnem, 2010 May 4) Use if no response from Jiri +Tobisek. + +Use Dutch spell files from: +http://extensions.services.openoffice.org/en/project/dict-nl +Looks like this is newer than the new wordlist for Dutch: +http://www.opentaal.org/bestanden/1_10/nl_NL-Pack Problem with cursor in the wrong column. (SungHyun Nam, 2010 Mar 11) -Additional info by Dominique Pelle. +Additional info by Dominique Pelle. (also on 2010 Apr 10) + +"make install" installs some of the .info files on Unix. +(James Vega, 2010 Mar 30) + +Is ~/bin (literally) in $PATH supposed to work? (Paul, 2010 March 29) +Looks like only bash can do it. (Yakov Lerner) + +8 Add an event like CursorHold that is triggered repeatedly, not just once + after typing something. +Need for CursorHold that retriggers. Use a key that doesn't do anything, or a +function that resets did_cursorhold. I often see pasted text (from Firefox, to Vim in xterm) appear twice. Also, Vim in xterm sometimes loses copy/paste ability (probably after running an external command). +Jumplist doesn't work properly in Insert mode? (Jean Johner, 2010 Mar 20) + Problem with transparent cmdline. Also: Terminal title is wrong with non-ASCII character. (Lily White, 2010 Mar 7) @@ -59,15 +98,12 @@ Shell not recognized properly if it ends in "csh -f". (James Vega, 2009 Nov 3) Find tail? Might have a / in argument. Find space? Might have space in path. -Patch to support netbeans in Unix console Vim. (Xavier de Gaye, 2009 Apr 26) -Now with Mercurial repository (2010 Jan 2) - -Crash when assigning s: to variable, pointer becomes invalid later. -(Yukihiro Nakadaira, 2009 Oct 12, confirmed by Dominique Pelle) - Test 69 breaks on MS-Windows, both 32 and 64 builds. (George Reilly, 2010 Feb 26) +":function f(x) keepjumps" creates a function where every command is executed +like it has ":keepjumps" before it. + Coverity: ask someone to create new user: Dominique. look into reported defects: http://scan.coverity.com/rung2.html @@ -78,20 +114,16 @@ Problem with editing file in binary mode. (Ingo Krabbe, 2009 Oct 8) Support .xz with the xz program, like with lzma. -Perl runtime files update. (Andy Lester, 2009 Aug 25) - -Gvimext patch to support wide file names. (Szabolcs Horvat 2008 Sep 10) - Problem with stop directory in findfile(). (Adam Simpkins, 2009 Aug 26) -Patch to support :browse for more commands. (Lech Lorens, 2009 Jul 18) +Undo problem: line not removed as expected when using setline() from Insert +mode. (Israel Chauca, 2010 May 13, more in second msg) +Break undo when CTRL-R = changes the text? Or save more lines? Change to C syntax folding to make it work much faster, but a bit less reliable. (Lech Lorens, 2009 Nov 9) Enable with an option? Most time is spent in in_id_list(). -New wordlist for Dutch: http://www.opentaal.org/bestanden/1_10/nl_NL-Pack - Check for unused functions, idea: http://blog.flameeyes.eu/2008/01/17/today-how-to-identify-unused-exported-functions-and-variables @@ -102,17 +134,17 @@ When a:base in 'completefunc' starts with a number it's passed as a number, not a string. (Sean Ma) Need to add flag to call_func_retlist() to force a string value. +There is no command line completion for ":lmap". + Reproducible crash in syntax HL. (George Reilly, Dominique Pelle, 2009 May 9) Invalid read error in Farsi mode. (Dominique Pelle, 2009 Aug 2) -Patch to add diff functionality to 2html.vim. (Christian Brabandt, 2009 Dec -15) - For running gvim on an USB stick: avoid the OLE registration. Use a command line argument -noregister. -submatch() may remove backslash. (Sergey Goldgaber, 2009 Jul 6) +When a mapping exists both for insert mode and lang-insert mode, the last one +doesn't work. (Tyru, 2010 May 6) Or is this intended? Still a problem with ":make" in the wrong directory. Caused by ":bufdo". (Ajit Thakkar, 2009 Jul 1) More information Jul 9, Jul 15. @@ -148,10 +180,6 @@ Needs more work. Problem with