diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-05-14 23:24:24 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-05-14 23:24:24 +0200 |
commit | 00a927d62b68a3523cb1c4f9aa3f7683345c8182 (patch) | |
tree | 9138abae11d363aa87818791195edf6e85aef15d /runtime | |
parent | f1eeae94fd78f81d85d2abe3d955dc21d5ef979c (diff) |
Updated runtime files.
Diffstat (limited to 'runtime')
80 files changed, 5680 insertions, 2286 deletions
diff --git a/runtime/autoload/ccomplete.vim b/runtime/autoload/ccomplete.vim index 6850e19a0b..12fc92df2c 100644 --- a/runtime/autoload/ccomplete.vim +++ b/runtime/autoload/ccomplete.vim @@ -1,7 +1,7 @@ " Vim completion script " Language: C " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2007 Aug 30 +" Last Change: 2010 Mar 23 " This function is used for the 'omnifunc' option. @@ -161,7 +161,7 @@ function! ccomplete#Complete(findstart, base) let res = [{'match': match, 'tagline' : '', 'kind' : kind, 'info' : line}] else " Completing "var.", "var.something", etc. - let res = s:Nextitem(strpart(line, 0, col), items[-1], 0, 1) + let res = s:Nextitem(strpart(line, 0, col), items[1:], 0, 1) endif endif diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index c1b178d195..70b146d648 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -1,7 +1,7 @@ " netrw.vim: Handles file transfer and remote directory listing across " AUTOLOAD SECTION -" Date: Dec 28, 2009 -" Version: 136 +" Date: May 14, 2010 +" Version: 138 " Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM> " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 1999-2009 Charles E. Campbell, Jr. {{{1 @@ -22,7 +22,7 @@ if &cp || exists("g:loaded_netrw") finish endif -let g:loaded_netrw = "v136" +let g:loaded_netrw = "v138" if v:version < 702 echohl WarningMsg echo "***warning*** this version of netrw needs vim 7.2" @@ -266,7 +266,7 @@ call s:NetrwInit("g:netrw_rmf_cmd" , g:netrw_ssh_cmd." USEPORT HOSTNAME rm " Default values - s ---------- {{{3 " g:netrw_sepchr: picking a character that doesn't appear in filenames that can be used to separate priority from filename call s:NetrwInit("g:netrw_sepchr" , (&enc == "euc-jp")? "\<Char-0x01>" : "\<Char-0xff>") -call s:NetrwInit("s:netrw_silentxfer" , (exists("g:netrw_silent") && g:netrw_silent != 0)? "silent " : "") +call s:NetrwInit("s:netrw_silentxfer" , (exists("g:netrw_silent") && g:netrw_silent != 0)? "silent keepj " : "keepj ") call s:NetrwInit("g:netrw_sort_by" , "name") " alternatives: date , size call s:NetrwInit("g:netrw_sort_options" , "") call s:NetrwInit("g:netrw_sort_direction", "normal") " alternative: reverse (z y x ...) @@ -286,11 +286,16 @@ call s:NetrwInit("g:netrw_xstrlen",0) call s:NetrwInit("g:NetrwTopLvlMenu","Netrw.") call s:NetrwInit("g:netrw_use_errorwindow",1) call s:NetrwInit("g:netrw_win95ftp",1) -call s:NetrwInit("g:netrw_winsize","") +call s:NetrwInit("g:netrw_winsize",25) " --------------------------------------------------------------------- " Default values for netrw's script variables: {{{2 call s:NetrwInit("g:netrw_fname_escape",' ?&;%') -call s:NetrwInit("g:netrw_glob_escape",'[]*?`{~$') +if has("win32") || has("win95") || has("win64") || has("win16") + call s:NetrwInit("g:netrw_glob_escape",'[]*?`{$') +else + call s:NetrwInit("g:netrw_glob_escape",'[]*?`{~$\') +endif +call s:NetrwInit("g:netrw_menu_escape",'./&? \') call s:NetrwInit("g:netrw_tmpfile_escape",' &;') call s:NetrwInit("s:netrw_map_escape","<|\n\r\\\<C-V>\"") @@ -329,6 +334,7 @@ fun! s:NetrwOptionSave(vt) endif let {a:vt}netrw_aikeep = &l:ai let {a:vt}netrw_awkeep = &l:aw + let {a:vt}netrw_bombkeep = &l:bomb let {a:vt}netrw_cikeep = &l:ci let {a:vt}netrw_cinkeep = &l:cin let {a:vt}netrw_cinokeep = &l:cino @@ -340,6 +346,7 @@ fun! s:NetrwOptionSave(vt) let {a:vt}netrw_fokeep = &l:fo " formatoptions let {a:vt}netrw_gdkeep = &l:gd " gdefault let {a:vt}netrw_hidkeep = &l:hidden + let {a:vt}netrw_imkeep = &l:im let {a:vt}netrw_magickeep = &l:magic let {a:vt}netrw_repkeep = &l:report let {a:vt}netrw_spellkeep = &l:spell @@ -375,7 +382,7 @@ fun! s:NetrwOptionRestore(vt) " call Decho("exe keepjumps lcd ".fnameescape(curdir)) " NOTE: was g:netrw_fname_escape for some reason try if !exists("&l:acd") && !&l:acd - exe 'keepjumps lcd '.fnameescape(curdir) + exe 'keepj lcd '.fnameescape(curdir) endif catch /^Vim\%((\a\+)\)\=:E472/ call netrw#ErrorMsg(s:ERROR,"unable to change directory to <".curdir."> (permissions?)",61) @@ -385,6 +392,7 @@ fun! s:NetrwOptionRestore(vt) endif if exists("{a:vt}netrw_aikeep") |let &l:ai = {a:vt}netrw_aikeep |unlet {a:vt}netrw_aikeep |endif if exists("{a:vt}netrw_awkeep") |let &l:aw = {a:vt}netrw_awkeep |unlet {a:vt}netrw_awkeep |endif + if exists("{a:vt}netrw_bombkeep") |let &l:bomb = {a:vt}netrw_bombkeep |unlet {a:vt}netrw_bombkeep |endif if exists("{a:vt}netrw_cikeep") |let &l:ci = {a:vt}netrw_cikeep |unlet {a:vt}netrw_cikeep |endif if exists("{a:vt}netrw_cinkeep") |let &l:cin = {a:vt}netrw_cinkeep |unlet {a:vt}netrw_cinkeep |endif if exists("{a:vt}netrw_cinokeep") |let &l:cino = {a:vt}netrw_cinokeep |unlet {a:vt}netrw_cinokeep |endif @@ -397,6 +405,7 @@ fun! s:NetrwOptionRestore(vt) if exists("{a:vt}netrw_fokeep") |let &l:fo = {a:vt}netrw_fokeep |unlet {a:vt}netrw_fokeep |endif if exists("{a:vt}netrw_gdkeep") |let &l:gd = {a:vt}netrw_gdkeep |unlet {a:vt}netrw_gdkeep |endif if exists("{a:vt}netrw_hidkeep") |let &l:hidden = {a:vt}netrw_hidkeep |unlet {a:vt}netrw_hidkeep |endif + if exists("{a:vt}netrw_imkeep") |let &l:im = {a:vt}netrw_imkeep |unlet {a:vt}netrw_imkeep |endif if exists("{a:vt}netrw_magic") |let &l:magic = {a:vt}netrw_magic |unlet {a:vt}netrw_magic |endif if exists("{a:vt}netrw_repkeep") |let &l:report = {a:vt}netrw_repkeep |unlet {a:vt}netrw_repkeep |endif if exists("{a:vt}netrw_spellkeep")|let &l:spell = {a:vt}netrw_spellkeep |unlet {a:vt}netrw_spellkeep|endif @@ -436,7 +445,7 @@ fun! s:NetrwSafeOptions() setlocal com= setlocal cpo-=aA if exists("&acd") | setlocal noacd | endif - setlocal nocin noai noci magic nospell nohid wig= noaw + setlocal nocin noai nobomb noci magic nospell nohid wig= noaw noim setlocal fo=nroql2 setlocal tw=0 setlocal report=10000 @@ -444,9 +453,11 @@ fun! s:NetrwSafeOptions() if g:netrw_use_noswf && has("win32") && !has("win95") setlocal noswf endif + call s:NetrwCursorline() " allow the user to override safe options if &ft == "netrw" +" call Decho("do any netrw FileType autocmds") silent keepalt keepjumps doau FileType netrw endif @@ -526,6 +537,7 @@ fun! netrw#NetRead(mode,...) " NetRead: save options {{{3 call s:NetrwOptionSave("w:") call s:NetrwSafeOptions() + call s:RestoreCursorline() " NetRead: interpret mode into a readcmd {{{3 if a:mode == 0 " read remote file before current line @@ -622,7 +634,7 @@ fun! netrw#NetRead(mode,...) " call Decho("checking if NetrwBrowse() should handle choice<".choice."> with netrw_list_cmd<".g:netrw_list_cmd.">") if choice =~ "^.*[\/]$" && b:netrw_method != 5 && choice !~ '^http://' " call Decho("yes, choice matches '^.*[\/]$'") - keepjumps call s:NetrwBrowse(0,choice) + keepj call s:NetrwBrowse(0,choice) " call Dret("netrw#NetRead :3 getcwd<".getcwd().">") return endif @@ -669,10 +681,10 @@ fun! netrw#NetRead(mode,...) call s:SaveBufVars()|new|call s:RestoreBufVars() let filtbuf= bufnr("%") setlocal ff=unix - put =g:netrw_ftpmode + keepj put =g:netrw_ftpmode " call Decho("filter input: ".getline(line("$"))) if exists("g:netrw_ftpextracmd") - put =g:netrw_ftpextracmd + keepj put =g:netrw_ftpextracmd " call Decho("filter input: ".getline(line("$"))) endif call setline(line("$")+1,'get "'.netrw_fname.'" '.tmpfile) @@ -711,32 +723,32 @@ fun! netrw#NetRead(mode,...) let filtbuf= bufnr("%") setlocal ff=unix if exists("g:netrw_port") && g:netrw_port != "" - put ='open '.g:netrw_machine.' '.g:netrw_port + keepj put ='open '.g:netrw_machine.' '.g:netrw_port " call Decho("filter input: ".getline('.')) else - put ='open '.g:netrw_machine + keepj put ='open '.g:netrw_machine " call Decho("filter input: ".getline('.')) endif if exists("g:netrw_ftp") && g:netrw_ftp == 1 - put =g:netrw_uid + keepj put =g:netrw_uid " call Decho("filter input: ".getline('.')) - put ='\"'.s:netrw_passwd.'\"' + keepj put ='\"'.s:netrw_passwd.'\"' " call Decho("filter input: ".getline('.')) else - put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"' + keepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"' " call Decho("filter input: ".getline('.')) endif if exists("g:netrw_ftpmode") && g:netrw_ftpmode != "" - put =g:netrw_ftpmode + keepj put =g:netrw_ftpmode " call Decho("filter input: ".getline('.')) endif if exists("g:netrw_ftpextracmd") put =g:netrw_ftpextracmd " call Decho("filter input: ".getline('.')) endif - put ='get \"'.netrw_fname.'\" '.tmpfile + keepj put ='get \"'.netrw_fname.'\" '.tmpfile " call Decho("filter input: ".getline('.')) " perform ftp: @@ -830,16 +842,16 @@ fun! netrw#NetRead(mode,...) new setlocal ff=unix if exists("g:netrw_port") && g:netrw_port != "" - put ='open '.g:netrw_machine.' '.g:netrw_port + keepj put ='open '.g:netrw_machine.' '.g:netrw_port else - put ='open '.g:netrw_machine + keepj put ='open '.g:netrw_machine endif - put ='user '.g:netrw_uid.' '.s:netrw_passwd - put ='get '.netrw_fname.' '.tmpfile - put ='quit' + keepj put ='user '.g:netrw_uid.' '.s:netrw_passwd + keepj put ='get '.netrw_fname.' '.tmpfile + keepj put ='quit' " perform cadaver operation: - norm! 1Gdd + keepj norm! 1Gdd " call Decho("executing: %!".g:netrw_dav_cmd) exe s:netrw_silentxfer."%!".g:netrw_dav_cmd bd! @@ -947,16 +959,16 @@ fun! netrw#NetWrite(...) range " (line numbers don't really make sense for that). " Also supports the writing of tar and zip files. " call Decho("(write entire file) silent exe w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile)) - silent exe "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile) + exe "silent keepj w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile) elseif g:netrw_cygwin " write (selected portion of) file to temporary let cygtmpfile= substitute(tmpfile,'/cygdrive/\(.\)','\1:','') " call Decho("(write selected portion) silent exe ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(cygtmpfile)) - silent exe a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(cygtmpfile) + exe "sil keepj ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(cygtmpfile) else " write (selected portion of) file to temporary " call Decho("(write selected portion) silent exe ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile)) - silent exe a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile) + exe "sil keepj ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile) endif if curbufname == "" @@ -1072,10 +1084,10 @@ fun! netrw#NetWrite(...) range " call Decho("filter input window#".winnr()) setlocal ff=unix - put =g:netrw_ftpmode + keepj put =g:netrw_ftpmode " call Decho("filter input: ".getline('$')) if exists("g:netrw_ftpextracmd") - put =g:netrw_ftpextracmd + keepj put =g:netrw_ftpextracmd " call Decho("filter input: ".getline("$")) endif call setline(line("$")+1,'put "'.tmpfile.'" "'.netrw_fname.'"') @@ -1119,28 +1131,28 @@ fun! netrw#NetWrite(...) range setlocal ff=unix if exists("g:netrw_port") && g:netrw_port != "" - put ='open '.g:netrw_machine.' '.g:netrw_port + keepj put ='open '.g:netrw_machine.' '.g:netrw_port " call Decho("filter input: ".getline('.')) else - put ='open '.g:netrw_machine + keepj put ='open '.g:netrw_machine " call Decho("filter input: ".getline('.')) endif if exists("g:netrw_ftp") && g:netrw_ftp == 1 - put =g:netrw_uid + keepj put =g:netrw_uid " call Decho("filter input: ".getline('.')) - put ='\"'.s:netrw_passwd.'\"' + keepj put ='\"'.s:netrw_passwd.'\"' " call Decho("filter input: ".getline('.')) else - put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"' + keepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"' " call Decho("filter input: ".getline('.')) endif - put =g:netrw_ftpmode + keepj put =g:netrw_ftpmode " call Decho("filter input: ".getline('$')) if exists("g:netrw_ftpextracmd") - put =g:netrw_ftpextracmd + keepj put =g:netrw_ftpextracmd " call Decho("filter input: ".getline("$")) endif - put ='put \"'.tmpfile.'\" \"'.netrw_fname.'\"' + keepj put ='put \"'.tmpfile.'\" \"'.netrw_fname.'\"' " call Decho("filter input: ".getline('.')) " save choice/id/password for future use let b:netrw_lastfile = choice @@ -1149,7 +1161,7 @@ fun! netrw#NetWrite(...) range " -i : turns off interactive prompting from ftp " -n unix : DON'T use <.netrc>, even though it exists " -n win32: quit being obnoxious about password - norm! 1Gdd + keepj norm! 1Gdd " call Decho("executing: %!".g:netrw_ftp_cmd." -i -n") exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i -n" " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar) @@ -1203,17 +1215,17 @@ fun! netrw#NetWrite(...) range setlocal ff=unix if exists("g:netrw_port") && g:netrw_port != "" - put ='open '.g:netrw_machine.' '.g:netrw_port + keepj put ='open '.g:netrw_machine.' '.g:netrw_port else - put ='open '.g:netrw_machine + keepj put ='open '.g:netrw_machine endif if exists("g:netrw_uid") && exists("s:netrw_passwd") - put ='user '.g:netrw_uid.' '.s:netrw_passwd + keepj put ='user '.g:netrw_uid.' '.s:netrw_passwd endif - put ='put '.tmpfile.' '.netrw_fname + keepj put ='put '.tmpfile.' '.netrw_fname " perform cadaver operation: - norm! 1Gdd + keepj norm! 1Gdd " call Decho("executing: %!".g:netrw_dav_cmd) exe s:netrw_silentxfer."%!".g:netrw_dav_cmd @@ -1382,7 +1394,7 @@ fun! s:NetrwGetFile(readcmd, tfile, method) " rename buffer back to remote filename " call Decho("exe silent! keepalt file ".fnameescape(rfile)) - exe "silent! keepalt file ".fnameescape(rfile) + exe "sil! keepalt file ".fnameescape(rfile) filetype detect " call Dredir("renamed buffer back to remote filename<".rfile."> : expand(%)<".expand("%").">","ls!") let line1 = 1 @@ -1669,7 +1681,7 @@ if has("win95") && exists("g:netrw_win95ftp") && g:netrw_win95ftp if method == 3 " ftp (no <.netrc>) let fourblanklines= line2 - 3 if fourblanklines >= line1 - exe "silent ".fourblanklines.",".line2."g/^\s*$/d" + exe "sil keepj ".fourblanklines.",".line2."g/^\s*$/d" call histdel("/",-1) endif endif @@ -1693,7 +1705,7 @@ fun! NetUserPass(...) let g:netrw_uid= input('Enter username: ') endif else " from command line -" call Dfunc("NetUserPass(a:1<".a:1.">) {") +" call Dfunc("NetUserPass(a:1<".a:1.">)") let g:netrw_uid= a:1 endif @@ -1763,19 +1775,67 @@ fun! s:BrowserMaps(islocal) nnoremap <buffer> <silent> v :call <SID>NetrwSplit(5)<cr> nnoremap <buffer> <silent> x :call netrw#NetrwBrowseX(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),0),0)"<cr> nnoremap <buffer> <silent> % :call <SID>NetrwOpenFile(1)<cr> + inoremap <buffer> <silent> <cr> <c-o>:call netrw#LocalBrowseCheck(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord()))<cr> + inoremap <buffer> <silent> - <c-o>:exe "norm! 0"<bar>call netrw#LocalBrowseCheck(<SID>NetrwBrowseChgDir(1,'../'))<cr> + inoremap <buffer> <silent> a <c-o>:call <SID>NetrwHide(1)<cr> + inoremap <buffer> <silent> mb <c-o>:<c-u>call <SID>NetrwBookHistHandler(0,b:netrw_curdir)<cr> + inoremap <buffer> <silent> mc <c-o>:<c-u>call <SID>NetrwMarkFileCopy(1)<cr> + inoremap <buffer> <silent> md <c-o>:<c-u>call <SID>NetrwMarkFileDiff(1)<cr> + inoremap <buffer> <silent> me <c-o>:<c-u>call < |