diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-05-21 21:01:10 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-05-21 21:01:10 +0200 |
commit | e6ae6225b4abd914b13648638c58bb253124473a (patch) | |
tree | bd48cc57aaaf107ddad06fe8dbbe5a71807e0440 /runtime | |
parent | 774267bbb9ac66c89e6e1781c19730a58c772752 (diff) | |
download | vim-git-e6ae6225b4abd914b13648638c58bb253124473a.tar.gz |
Updated runtime files, language files and translations.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/autoload/netrw.vim | 300 | ||||
-rw-r--r-- | runtime/autoload/netrwFileHandlers.vim | 20 | ||||
-rw-r--r-- | runtime/autoload/netrwSettings.vim | 51 | ||||
-rw-r--r-- | runtime/doc/autocmd.txt | 2 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 6 | ||||
-rw-r--r-- | runtime/doc/if_pyth.txt | 2 | ||||
-rw-r--r-- | runtime/doc/indent.txt | 29 | ||||
-rw-r--r-- | runtime/doc/mbyte.txt | 8 | ||||
-rw-r--r-- | runtime/doc/options.txt | 15 | ||||
-rw-r--r-- | runtime/doc/pi_netrw.txt | 44 | ||||
-rw-r--r-- | runtime/doc/quickref.txt | 3 | ||||
-rw-r--r-- | runtime/doc/starting.txt | 4 | ||||
-rw-r--r-- | runtime/doc/tags | 2 | ||||
-rw-r--r-- | runtime/doc/todo.txt | 101 | ||||
-rw-r--r-- | runtime/doc/various.txt | 4 | ||||
-rw-r--r-- | runtime/indent/php.vim | 99 | ||||
-rw-r--r-- | runtime/lang/menu_ja_jp.euc-jp.vim | 48 | ||||
-rw-r--r-- | runtime/lang/menu_ja_jp.utf-8.vim | 48 | ||||
-rw-r--r-- | runtime/lang/menu_japanese_japan.932.vim | 48 | ||||
-rw-r--r-- | runtime/optwin.vim | 4 | ||||
-rw-r--r-- | runtime/plugin/netrwPlugin.vim | 24 | ||||
-rw-r--r-- | runtime/syntax/debcontrol.vim | 4 | ||||
-rw-r--r-- | runtime/syntax/fstab.vim | 41 | ||||
-rw-r--r-- | runtime/syntax/r.vim | 3 | ||||
-rw-r--r-- | runtime/syntax/resolv.vim | 23 |
25 files changed, 545 insertions, 388 deletions
diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index 8422d9dea..b077bb73b 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: Apr 16, 2013 -" Version: 148 +" Date: May 18, 2013 +" Version: 149 " Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM> " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 1999-2012 Charles E. Campbell {{{1 @@ -22,7 +22,7 @@ if &cp || exists("g:loaded_netrw") finish endif -let g:loaded_netrw = "v148" +let g:loaded_netrw = "v149" if v:version < 703 || (v:version == 703 && !has("patch465")) echohl WarningMsg echo "***warning*** this version of netrw needs vim 7.3.465 or later" @@ -49,12 +49,12 @@ set cpo&vim " 0=note = s:NOTE " 1=warning = s:WARNING " 2=error = s:ERROR -" Apr 02, 2013 : max errnum currently is 92 +" May 01, 2013 : max errnum currently is 93 fun! netrw#ErrorMsg(level,msg,errnum) " call Dfunc("netrw#ErrorMsg(level=".a:level." msg<".a:msg."> errnum=".a:errnum.") g:netrw_use_errorwindow=".g:netrw_use_errorwindow) if a:level < g:netrw_errorlvl -" call Dret("netrw#ErrorMsg : suppressing level=".a:level." since g;netrw_errorlvl=".g:netrw_errorlvl) +" call Dret("netrw#ErrorMsg : suppressing level=".a:level." since g:netrw_errorlvl=".g:netrw_errorlvl) return endif @@ -128,7 +128,7 @@ endfun " NetrwInit: initializes variables if they haven't been defined {{{2 " Loosely, varname = value. fun s:NetrwInit(varname,value) -" call Decho("varname<".a:varname."> value=".a:value) +" call Decho("varname<".a:varname."> value=".a:value) if !exists(a:varname) if type(a:value) == 0 exe "let ".a:varname."=".a:value @@ -202,7 +202,20 @@ if !exists("g:netrw_http_cmd") endif call s:NetrwInit("g:netrw_rcp_cmd" , "rcp") call s:NetrwInit("g:netrw_rsync_cmd", "rsync") -call s:NetrwInit("g:netrw_scp_cmd" , "scp -q") +if !exists("g:netrw_scp_cmd") + if executable("scp") + call s:NetrwInit("g:netrw_scp_cmd" , "scp -q") + elseif executable("pscp") + if (has("win32") || has("win95") || has("win64") || has("win16")) && filereadable('c:\private.ppk') + call s:NetrwInit("g:netrw_scp_cmd", 'pscp -i c:\private.ppk') + else + call s:NetrwInit("g:netrw_scp_cmd", 'pscp -q') + endif + else + call s:NetrwInit("g:netrw_scp_cmd" , "scp -q") + endif +endif + call s:NetrwInit("g:netrw_sftp_cmd" , "sftp") call s:NetrwInit("g:netrw_ssh_cmd" , "ssh") @@ -278,19 +291,23 @@ if !exists("g:netrw_ignorenetrc") endif call s:NetrwInit("g:netrw_keepdir",1) if !exists("g:netrw_list_cmd") + if g:netrw_scp_cmd =~ '^pscp' && executable("pscp") - " provide a 'pscp' listing command if (has("win32") || has("win95") || has("win64") || has("win16")) && filereadable("c:\\private.ppk") + " provide a pscp-based listing command let g:netrw_scp_cmd ="pscp -i C:\\private.ppk" endif let g:netrw_list_cmd= g:netrw_scp_cmd." -ls USEPORT HOSTNAME:" + elseif executable(g:netrw_ssh_cmd) - " provide a default listing command + " provide a scp-based default listing command let g:netrw_list_cmd= g:netrw_ssh_cmd." USEPORT HOSTNAME ls -FLa" + else " call Decho(g:netrw_ssh_cmd." is not executable") let g:netrw_list_cmd= "" endif + endif call s:NetrwInit("g:netrw_list_hide","") " Default values - lh-lz ---------- {{{3 @@ -474,7 +491,7 @@ endif " NetrwBrowse. " vt: normally its "w:" or "s:" (a variable type) fun! s:NetrwOptionSave(vt) -" call Dfunc("s:NetrwOptionSave(vt<".a:vt.">) win#".winnr()." buf#".bufnr("%")."<".bufname(bufnr("%")).">"." winnr($)=".winnr("$")) +" call Dfunc("s:NetrwOptionSave(vt<".a:vt.">) win#".winnr()." buf#".bufnr("%")."<".bufname(bufnr("%")).">"." winnr($)=".winnr("$")." mod=".&mod." ma=".&ma) " call Decho(a:vt."netrw_optionsave".(exists("{a:vt}netrw_optionsave")? ("=".{a:vt}netrw_optionsave) : " doesn't exist")) if !exists("{a:vt}netrw_optionsave") @@ -730,10 +747,16 @@ fun! netrw#Explore(indx,dosplit,style,...) " call Dfunc("netrw#Explore(indx=".a:indx." dosplit=".a:dosplit." style=".a:style.",a:1<".a:1.">) &modified=".&modified." modifiable=".&modifiable." a:0=".a:0." win#".winnr()." buf#".bufnr("%")) if !exists("b:netrw_curdir") let b:netrw_curdir= getcwd() + if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16")) + let b:netrw_curdir= substitute(b:netrw_curdir,'\','/','g') + endif " call Decho("(Explore) set b:netrw_curdir<".b:netrw_curdir."> (used getcwd)") endif let curdir = simplify(b:netrw_curdir) let curfiledir = substitute(expand("%:p"),'^\(.*[/\\]\)[^/\\]*$','\1','e') + if !exists("g:netrw_cygwin") && (has("win32") || has("win95") || has("win64") || has("win16")) + let curdir= substitute(curdir,'\','/','g') + endif " call Decho("(Explore) curdir<".curdir."> curfiledir<".curfiledir.">") " save registers @@ -793,7 +816,7 @@ fun! netrw#Explore(indx,dosplit,style,...) keepj norm! 0 if a:0 > 0 -" call Decho("(Explore) case [a:0=".a:0."] > 0") +" call Decho("(Explore) case [a:0=".a:0."] > 0: a:1<".a:1.">") if a:1 =~ '^\~' && (has("unix") || (exists("g:netrw_cygwin") && g:netrw_cygwin)) " call Decho("(Explore) ..case a:1<".a:1.">: starts with ~ and unix or cygwin") let dirname= simplify(substitute(a:1,'\~',expand("$HOME"),'')) @@ -809,7 +832,7 @@ fun! netrw#Explore(indx,dosplit,style,...) " call Decho("(Explore) ..case a:1<".a:1.">: matches ending $") let dirname= simplify(expand(a:1)) " call Decho("(Explore) ..using user-specified dirname<".dirname."> with $env-var") - elseif a:1 !~ '^\*\{1,2}/' + elseif a:1 !~ '^\*\{1,2}/' && a:1 !~ '^\a\{3,}://' " call Decho("(Explore) ..case a:1<".a:1.">: other, not pattern or filepattern") let dirname= simplify(a:1) " call Decho("(Explore) ..using user-specified dirname<".dirname.">") @@ -835,7 +858,7 @@ fun! netrw#Explore(indx,dosplit,style,...) if dirname =~ '^\*//' " starpat=1: Explore *//pattern (current directory only search for files containing pattern) -" call Decho("(Explore) case Explore *//pattern") +" call Decho("(Explore) case starpat=1: Explore *//pattern") let pattern= substitute(dirname,'^\*//\(.*\)$','\1','') let starpat= 1 " call Decho("(Explore) ..Explore *//pat: (starpat=".starpat.") dirname<".dirname."> -> pattern<".pattern.">") @@ -843,14 +866,14 @@ fun! netrw#Explore(indx,dosplit,style,...) elseif dirname =~ '^\*\*//' " starpat=2: Explore **//pattern (recursive descent search for files containing pattern) -" call Decho("(Explore) case Explore **//pattern") +" call Decho("(Explore) case starpat=2: Explore **//pattern") let pattern= substitute(dirname,'^\*\*//','','') let starpat= 2 " call Decho("(Explore) ..Explore **//pat: (starpat=".starpat.") dirname<".dirname."> -> pattern<".pattern.">") elseif dirname =~ '/\*\*/' " handle .../**/.../filepat -" call Decho("(Explore) case Explore .../**/.../filepat") +" call Decho("(Explore) case starpat=4: Explore .../**/.../filepat") let prefixdir= substitute(dirname,'^\(.\{-}\)\*\*.*$','\1','') if prefixdir =~ '^/' || (prefixdir =~ '^\a:/' && (has("win32") || has("win95") || has("win64") || has("win16"))) let b:netrw_curdir = prefixdir @@ -863,32 +886,40 @@ fun! netrw#Explore(indx,dosplit,style,...) " call Decho("(Explore) ..case Explore ../**/../filepat (starpat=".starpat.")") elseif dirname =~ '^\*/' - " starpat=3: Explore */filepat (search in current directory for filenames matching filepat) + " case starpat=3: Explore */filepat (search in current directory for filenames matching filepat) let starpat= 3 -" call Decho("(Explore) case Explore */filepat (starpat=".starpat.")") +" call Decho("(Explore) case starpat=3: Explore */filepat (starpat=".starpat.")") elseif dirname=~ '^\*\*/' " starpat=4: Explore **/filepat (recursive descent search for filenames matching filepat) let starpat= 4 -" call Decho("(Explore) case Explore **/filepat (starpat=".starpat.")") +" call Decho("(Explore) case starpat=4: Explore **/filepat (starpat=".starpat.")") else let starpat= 0 -" call Decho("(Explore) default case: starpat=".starpat) +" call Decho("(Explore) case starpat=0: default") endif if starpat == 0 && a:indx >= 0 " [Explore Hexplore Vexplore Sexplore] [dirname] -" call Decho("(Explore) case starpat==0 && a:indx=".a:indx.": dirname<".dirname."> Explore Hexplore Vexplore Sexplore") +" call Decho("(Explore) case starpat==0 && a:indx=".a:indx.": dirname<".dirname.">, handles Explore Hexplore Vexplore Sexplore") if dirname == "" let dirname= curfiledir " call Decho("(Explore) ..empty dirname, using current file's directory<".dirname.">") endif - if dirname =~ '^scp:' || dirname =~ '^ftp:' -" call Decho("(Explore) ..calling NetrwBrowse(0,dirname<".dirname.">)") - call s:NetrwBrowse(0,dirname) + if dirname =~ '^scp://' || dirname =~ '^ftp://' + call netrw#Nread(2,dirname) + "call s:NetrwBrowse(0,dirname) else - if dirname == ""|let dirname= getcwd()|endif + if dirname == "" + let dirname= getcwd() + elseif (has("win32") || has("win95") || has("win64") || has("win16")) && !g:netrw_cygwin + if dirname !~ '^[a-zA-Z]:' + let dirname= b:netrw_curdir."/".dirname + endif + elseif dirname !~ '^/' + let dirname= b:netrw_curdir."/".dirname + endif " call Decho("(Explore) ..calling LocalBrowseCheck(dirname<".dirname.">)") call netrw#LocalBrowseCheck(dirname) " call Decho("(Explore) win#".winnr()." buf#".bufnr("%")." modified=".&modified." modifiable=".&modifiable." readonly=".&readonly) @@ -1508,7 +1539,7 @@ endfun " =2 replace with remote file " =3 obtain file, but leave in temporary format fun! netrw#NetRead(mode,...) -" call Dfunc("netrw#NetRead(mode=".a:mode.",...) a:0=".a:0." ".g:loaded_netrw) +" call Dfunc("netrw#NetRead(mode=".a:mode.",...) a:0=".a:0." ".g:loaded_netrw.((a:0 > 0)? " a:1<".a:1.">" : "")) " NetRead: save options {{{3 call s:NetrwOptionSave("w:") @@ -2404,7 +2435,6 @@ fun! s:NetrwGetFile(readcmd, tfile, method) " call Decho("detect filetype of local version of remote file") let iskkeep= &l:isk setl isk-=/ - " filetype detect " COMBAK - trying filetype detect in NetrwOptionRestore Jan 24, 2013 let &l:isk= iskkeep " call Dredir("renamed buffer back to remote filename<".rfile."> : expand(%)<".expand("%").">","ls!") let line1 = 1 @@ -2611,8 +2641,7 @@ fun! s:NetrwMethod(choice) " call Decho("has -s: : s:netrw_ftp_cmd<".s:netrw_ftp_cmd.">") " call Decho(" g:netrw_ftp_cmd<".g:netrw_ftp_cmd.">") if g:netrw_ftp_cmd =~ '-[sS]:\S*MACHINE\>' - let machine = substitute(g:netrw_machine,'\([^.]\+\)\.\S*','\1','') - let s:netrw_ftp_cmd= substitute(g:netrw_ftp_cmd,'\<MACHINE\>',machine.".ftp",'') + let s:netrw_ftp_cmd= substitute(g:netrw_ftp_cmd,'\<MACHINE\>',g:netrw_machine,'') " call Decho("s:netrw_ftp_cmd<".s:netrw_ftp_cmd.">") endif let b:netrw_method= 2 @@ -3477,7 +3506,6 @@ 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("%")."> win#".winnr()) " call Decho("(NetrwBrowse) tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")." modified=".&modified." modifiable=".&modifiable." readonly=".&readonly) -" call Dredir("ls!") " s:NetrwBrowse: initialize history {{{3 if !exists("s:netrw_initbookhist") keepj call s:NetrwBookHistRead() @@ -3759,6 +3787,7 @@ endfun " 1=re-used buffer fun! s:NetrwGetBuffer(islocal,dirname) " call Dfunc("s:NetrwGetBuffer(islocal=".a:islocal." dirname<".a:dirname.">) liststyle=".g:netrw_liststyle) +" call Decho("(NetrwGetBuffer) modiable=".&mod." modifiable=".&ma." readonly=".&ro) let dirname= a:dirname " re-use buffer if possible {{{3 @@ -3767,8 +3796,9 @@ fun! s:NetrwGetBuffer(islocal,dirname) " find NetrwTreeList buffer if there is one " call Decho("(NetrwGetBuffer) case liststyle=treelist: find NetrwTreeList buffer if there is one") if exists("w:netrw_treebufnr") && w:netrw_treebufnr > 0 -" call Decho("(NetrwGetBuffer) re-use w:netrw_treebufnr=".w:netrw_treebufnr) - sil keepj %d +" call Decho("(NetrwGetBuffer) re-using w:netrw_treebufnr=".w:netrw_treebufnr) + setl mod + sil! keepj %d let eikeep= &ei set ei=all exe "sil! keepalt b ".w:netrw_treebufnr @@ -3782,7 +3812,6 @@ fun! s:NetrwGetBuffer(islocal,dirname) else " find buffer number of buffer named precisely the same as dirname {{{3 " call Decho("(NetrwGetBuffer) case listtyle not treelist: find buffer numnber of buffer named precisely the same as dirname--") -" call Dredir("ls!") " get dirname and associated buffer number let bufnum = bufnr(escape(dirname,'\')) @@ -4079,7 +4108,6 @@ fun! s:NetrwListSettings(islocal) if g:netrw_use_noswf setl noswf endif -" call Dredir("ls!") " call Decho("(NetrwListSettings) exe setl ts=".(g:netrw_maxfilenamelen+1)) exe "setl ts=".(g:netrw_maxfilenamelen+1) setl isk+=.,~,- @@ -4211,14 +4239,14 @@ fun! s:NetrwBookmarkMenu() if exists("g:netrw_bookmarklist") && g:netrw_bookmarklist != [] && g:netrw_dirhistmax > 0 let cnt= 1 for bmd in g:netrw_bookmarklist -" call Decho('sil! menu '.g:NetrwMenuPriority.".2.".cnt." ".g:NetrwTopLvlMenu.'Bookmark.'.bmd.' :e '.bmd) - let bmd= escape(bmd,g:netrw_menu_escape) + let ebmd= escape(bmd,g:netrw_menu_escape) +" call Decho('sil! menu '.g:NetrwMenuPriority.".2.".cnt." ".g:NetrwTopLvlMenu.'Bookmark.'.ebmd.' :e '.bmd) " show bookmarks for goto menu - exe 'sil! menu '.g:NetrwMenuPriority.".2.".cnt." ".g:NetrwTopLvlMenu.'Bookmarks.'.bmd.' :e '.bmd."\<cr>" + exe 'sil! menu '.g:NetrwMenuPriority.".2.".cnt." ".g:NetrwTopLvlMenu.'Bookmarks.'.ebmd.' :e '.bmd."\<cr>" " show bookmarks for deletion menu - exe 'sil! 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.'.ebmd.' '.cnt."mB" let cnt= cnt + 1 endfor @@ -4264,7 +4292,6 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) let @@= ykeep " call Decho("(NetrwBrowseChgDir) b:netrw_curdir doesn't exist!") " call Decho("(NetrwBrowseChgDir) getcwd<".getcwd().">") -" call Dredir("ls!") " call Dret("s:NetrwBrowseChgDir") return endif @@ -5467,8 +5494,13 @@ endfun " directories. Uses the local-buffer marked file list. " Returns 1=success (used by NetrwMarkFileMove()) " 0=failure -fun! s:NetrwMarkFileCopy(islocal) -" call Dfunc("s:NetrwMarkFileCopy(islocal=".a:islocal.") target<".(exists("s:netrwmftgt")? s:netrwmftgt : '---').">") +fun! s:NetrwMarkFileCopy(islocal,...) +" call Dfunc("s:NetrwMarkFileCopy(islocal=".a:islocal.") target<".(exists("s:netrwmftgt")? s:netrwmftgt : '---')."> a:0=".a:0) + + if !exists("b:netrw_curdir") + let b:netrw_curdir= getcwd() +" call Decho("set b:netrw_curdir<".b:netrw_curdir."> (used getcwd)") + endif let curdir = b:netrw_curdir let curbufnr = bufnr("%") @@ -5495,8 +5527,45 @@ fun! s:NetrwMarkFileCopy(islocal) " call Dfunc("s:NetrwMarkFileMove : g:netrw_localcopycmd<".g:netrw_localcopycmd."> n/a!") return endif - let args= join(map(deepcopy(s:netrwmarkfilelist_{bufnr('%')}),"shellescape(b:netrw_curdir.\"/\".v:val)")) - let tgt = shellescape(s:netrwmftgt) + + " copy marked files while within the same directory (ie. allow renaming) + if simplify(s:netrwmftgt) == simplify(b:netrw_curdir) + if len(s:netrwmarkfilelist_{bufnr('%')}) == 1 + " only one marked file + let args = shellescape(b:netrw_curdir."/".s:netrwmarkfilelist_{bufnr('%')}[0]) + let oldname = s:netrwmarkfilelist_{bufnr('%')}[0] + elseif a:0 == 1 + " this happens when the next case was used to recursively call s:NetrwMarkFileCopy() + let args = shellescape(b:netrw_curdir."/".a:1) + let oldname = a:1 + else + " copy multiple marked files inside the same directory + let s:recursive= 1 + for oldname in s:netrwmarkfilelist_{bufnr("%")} + let ret= s:NetrwMarkFileCopy(a:islocal,oldname) + if ret == 0 + break + endif + endfor + unlet s:recursive + call s:NetrwUnmarkList(curbufnr,curdir) +" call Dret("s:NetrwMarkFileCopy ".ret) + return ret + endif + + call inputsave() + let newname= input("Copy ".oldname." to : ",oldname,"file") + call inputrestore() + if newname == "" +" call Dret("s:NetrwMarkFileCopy 0") + return 0 + endif + let args= shellescape(oldname) + let tgt = shellescape(s:netrwmftgt.'/'.newname) + else + let args= join(map(deepcopy(s:netrwmarkfilelist_{bufnr('%')}),"shellescape(b:netrw_curdir.\"/\".v:val)")) + let tgt = shellescape(s:netrwmftgt) + endif if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16")) let args= substitute(args,'/','\\','g') let tgt = substitute(tgt, '/','\\','g') @@ -5525,10 +5594,12 @@ fun! s:NetrwMarkFileCopy(islocal) keepj call s:NetrwUpload(s:netrwmarkfilelist_{bufnr('%')},s:netrwmftgt) elseif !a:islocal && s:netrwmftgt_islocal + " Copy marked files, remote directory to local directory " call Decho("copy from remote to local") keepj call netrw#NetrwObtain(a:islocal,s:netrwmarkfilelist_{bufnr('%')},s:netrwmftgt) elseif !a:islocal && !s:netrwmftgt_islocal + " Copy marked files, remote directory to remote directory " call Decho("copy from remote to remote") let curdir = getcwd() let tmpdir = s:GetTempfile("") @@ -5570,10 +5641,11 @@ fun! s:NetrwMarkFileCopy(islocal) " ------- " cleanup " ------- -" call Decho("cleanup") - - " remove markings from local buffer - call s:NetrwUnmarkList(curbufnr,curdir) +" call Decho("cleanup") + if !exists("s:recursive") + " remove markings from local buffer + call s:NetrwUnmarkList(curbufnr,curdir) + endif " refresh buffers if !s:netrwmftgt_islocal @@ -5861,7 +5933,6 @@ fun! s:NetrwMarkFileVimCmd(islocal) exe cmd exe "sil! keepalt wq!" else - " COMBAK -- not supported yet " call Decho("remote<".fname.">: exe ".cmd." : NOT SUPPORTED YET") echo "sorry, \"mX\" not supported yet for remote files" endif @@ -7489,11 +7560,20 @@ fun! s:NetrwWideListing() sil! let @*= keepregstar exe "sil! keepj ".w:netrw_bannercnt.',$s/\s\+$//e' keepj call histdel("/",-1) + exe "nmap <buffer> <silent> w /^\\\\|\\s\\s\\zs\\S/\<cr>" + exe "nmap <buffer> <silent> b ?^\\\\|\\s\\s\\zs\\S?\<cr>" " call Decho("NetrwWideListing) setl noma nomod ro") setl noma nomod ro " call Decho("(NetrwWideListing) ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)") " call Dret("NetrwWideListing") return + else + if hasmapto("w","n") + sil! nunmap <buffer> w + endif + if hasmapto("b","n") + sil! nunmap <buffer> b + endif endif endfun @@ -7537,7 +7617,11 @@ fun! s:PerformListing(islocal) " call Decho("(PerformListing) set up banner") keepj call setline(1,'" ============================================================================') keepj call setline(2,'" Netrw Directory Listing (netrw '.g:loaded_netrw.')') - keepj call setline(3,'" '.b:netrw_curdir) + if exists("g:netrw_bannerbackslash") && g:netrw_bannerbackslash + keepj call setline(3,'" '.substitute(b:netrw_curdir,'/','\\','g')) + else + keepj call setline(3,'" '.b:netrw_curdir) + endif let w:netrw_bannercnt= 3 keepj exe "sil! keepj ".w:netrw_bannercnt else @@ -7606,7 +7690,7 @@ fun! s:PerformListing(islocal) if g:netrw_banner let w:netrw_bannercnt= w:netrw_bannercnt + 1 exe "sil! keepj ".w:netrw_bannercnt -" call Decho("(PerformListing) bannercnt=".w:netrw_bannercnt." (should index line just after banner) line($)=".line("$")) +" call Decho("(PerformListing) w:netrw_bannercnt=".w:netrw_bannercnt." (should index line just after banner) line($)=".line("$")) endif " get list of files @@ -7616,12 +7700,13 @@ fun! s:PerformListing(islocal) else " remote keepj call s:NetrwRemoteListing() endif -" call Decho("(PerformListing) g:netrw_banner=".g:netrw_banner." w:netrw_bannercnt=".w:netrw_bannercnt." (banner complete)") " manipulate the directory listing (hide, sort) {{{3 if !exists("w:netrw_bannercnt") let w:netrw_bannercnt= 0 endif +" call Decho("(PerformListing) g:netrw_banner=".g:netrw_banner." w:netrw_bannercnt=".w:netrw_bannercnt." (banner complete)") + if !g:netrw_banner || line("$") >= w:netrw_bannercnt " call Decho("(PerformListing) manipulate directory listing (hide)") " call Decho("(PerformListing) g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">") @@ -7763,10 +7848,18 @@ fun! s:NetrwRemoteListing() " call Dfunc("s:NetrwRemoteListing() b:netrw_curdir<".b:netrw_curdir.">)") call s:RemotePathAnalysis(b:netrw_curdir) +" call Decho("b:netrw_method#".(exists("b:netrw_method")? b:netrw_method : 'n/a')) +" call Decho("g:netrw_list_cmd<".(exists("g:netrw_list_cmd")? g:netrw_list_cmd : 'n/a').">") +" call Decho("ssh is ".(executable("ssh")? "" : "not ")."executable") +" call Decho("ftp is ".(executable("ftp")? "" : "not ")."executable") +" call Decho("sftp is ".(executable("sftp")? "" : "not ")."executable") " sanity check: if exists("b:netrw_method") && b:netrw_method =~ '[235]' -" call Decho("b:netrw_method=".b:netrw_method) + " b:netrw_method = 2: ftp+.netrc + " b:netrw_method = 3: ftp+machine,id,p/w,filename (ie. no .netrc) + " b:netrw_method = 5: wget (http) +" call Decho("b:netrw_method=".b:netrw_method." (for ".s:method.")") if !executable("ftp") if !exists("g:netrw_quiet") call netrw#ErrorMsg(s:ERROR,"this system doesn't support remote directory listing via ftp",18) @@ -7776,10 +7869,11 @@ fun! s:NetrwRemoteListing() return endif - elseif !exists("g:netrw_list_cmd") || g:netrw_list_cmd == '' + elseif s:method == "scp" && (!exists("g:netrw_list_cmd") || g:netrw_list_cmd == '') +" call Decho("g:netrw_list_cmd<".(exists("g:netrw_list_cmd")? g:netrw_list_cmd : 'n/a').">") if !exists("g:netrw_quiet") - if g:netrw_list_cmd == "" - keepj call netrw#ErrorMsg(s:ERROR,g:netrw_ssh_cmd." is not executable on your system",47) + if !exists("g:netrw_list_cmd") || g:netrw_list_cmd == "" + keepj call netrw#ErrorMsg(s:ERROR,"neither ssh nor ftp"." is executable on your system",47) else keepj call netrw#ErrorMsg(s:ERROR,"this system doesn't support remote directory listing via ".g:netrw_list_cmd,19) endif @@ -7791,15 +7885,15 @@ fun! s:NetrwRemoteListing() endif " (remote handling sanity check) if exists("b:netrw_method") -" call Decho("setting w:netrw_method<".b:netrw_method.">") +" call Decho("setting w:netrw_method to b:netrw_method<".b:netrw_method.">") let w:netrw_method= b:netrw_method endif if s:method == "ftp" " use ftp to get remote file listing {{{3 " call Decho("use ftp to get remote file listing") - let s:method = "ftp" - let listcmd = g:netrw_ftp_list_cmd + let s:method = "ftp" + let listcmd = g:netrw_ftp_list_cmd if g:netrw_sort_by =~ '^t' let listcmd= g:netrw_ftp_timelist_cmd elseif g:netrw_sort_by =~ '^s' @@ -7822,15 +7916,14 @@ fun! s:NetrwRemoteListing() sil! keepj %s/\r$//e keepj call histdel("/",-1) - " if there's no ../ listed, then put ./ and ../ in + " if there's no ../ listed, then put ../ in let line1= line(".") exe "sil! keepj ".w:netrw_bannercnt let line2= search('\.\.\/\%(\s\|$\)','cnW') " call Decho("search(".'\.\.\/\%(\s\|$\)'."','cnW')=".line2." w:netrw_bannercnt=".w:netrw_bannercnt) if line2 == 0 -" call Decho("netrw is putting ./ and ../ into listing") +" call Decho("netrw is putting ../ into listing") sil! keepj put='../' - sil! keepj put='./' endif exe "sil! keepj ".line1 sil! keepj norm! 0 @@ -7899,13 +7992,12 @@ fun! s:NetrwRemoteListing() while getline('.') =~ g:netrw_ftp_browse_reject sil! keepj d endwhile - " if there's no ../ listed, then put ./ and ../ in + " if there's no ../ listed, then put ../ in let line1= line(".") sil! keepj 1 sil! keepj call search('^\.\.\/\%(\s\|$\)','W') let line2= line(".") if line2 == 0 - exe 'sil! keepj '.w:netrw_bannercnt."put='./'" if b:netrw_curdir != '/' exe 'sil! keepj '.w:netrw_bannercnt."put='../'" endif @@ -8103,8 +8195,17 @@ endfun " and reverse sorts will be requested of the server but not otherwise " enforced here. fun! s:NetrwRemoteFtpCmd(path,listcmd) -" call Dfunc("NetrwRemoteFtpCmd(path<".a:path."> listcmd<".a:listcmd.">) netrw_method=".w:netrw_method) -" call Decho("line($)=".line("$")." bannercnt=".w:netrw_bannercnt) +" call Dfunc("NetrwRemoteFtpCmd(path<".a:path."> listcmd<".a:listcmd.">) w:netrw_method=".(exists("w:netrw_method")? w:netrw_method : (exists("b:netrw_method")? b:netrw_method : "???"))) +" call Decho("line($)=".line("$")." w:netrw_bannercnt=".w:netrw_bannercnt) + if !exists("w:netrw_method") + if exists("b:netrw_method") + let w:netrw_method= b:netrw_method + else + call netrw#ErrorMsg(2,"(s:NetrwRemoteFtpCmd) internal netrw error",93) +" call Dret("NetrwRemoteFtpCmd") + return + endif + endif " because WinXX ftp uses unix style input let ffkeep= &ff @@ -8359,7 +8460,7 @@ fun! netrw#LocalBrowseCheck(dirname) " call Dredir("LocalBrowseCheck","ls!")|redraw!|sleep 3 let ykeep= @@ if isdirectory(a:dirname) -" call Decho("(LocalBrowseCheck) ft<".&ft."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : " doesn't exist")."> dirname<".a:dirname.">"." line($)=".line("$")." ft<".&ft."> g:netrw_fastbrowse=".g:netrw_fastbrowse) +" call Decho("(LocalBrowseCheck) is-directory ft<".&ft."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : " doesn't exist")."> dirname<".a:dirname.">"." line($)=".line("$")." ft<".&ft."> g:netrw_fastbrowse=".g:netrw_fastbrowse) let svposn= netrw#NetrwSavePosn() if &ft != "netrw" || (exists("b:netrw_curdir") && b:netrw_curdir != a:dirname) || g:netrw_fastbrowse <= 1 sil! keepj keepalt call s:NetrwBrowse(1,a:dirname) @@ -8407,9 +8508,11 @@ fun! s:LocalListing() let filelist = filelist + glob(s:ComposePath(dirname,".*"),0,1) " call Decho("(LocalListing) filelist=".filelist) - if index(filelist,'..') == -1 && b:netrw_curdir != '/' + if g:netrw_cygwin == 0 && (has("win32") || has("win95") || has("win64") || has("win16")) +" call Decho("(LocalListing) filelist=".string(filelist)) + elseif index(filelist,'..') == -1 && b:netrw_curdir !~ '/' " include ../ in the glob() entry if its missing -" call Decho("(LocalListing) forcibly tacking on \"..\"") +" call Decho("(LocalListing) forcibly including on \"..\"") let filelist= filelist+[s:ComposePath(b:netrw_curdir,"../")] " call Decho("(LocalListing) filelist=".string(filelist)) endif @@ -8904,6 +9007,26 @@ endfun " Support Functions: {{{1 " --------------------------------------------------------------------- +" netrw#WinPath: tries to insure that the path is windows-acceptable, whether cygwin is used or not {{{2 +fun! netrw#WinPath(path) +" call Dfunc("netrw#WinPath(path<".a:path.">)") + if (!g:netrw_cygwin || &shell !~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$') && (has("win32") || has("win95") || has("win64") || has("win16")) + " remove cygdrive prefix, if present + let path = substitute(a:path,'/cygdrive/\(.\)','\1:','') + " remove trailing slash (Win95) + let path = substitute(path, '\(\\\|/\)$', '', 'g') + " remove escaped spaces + let path = substitute(path, '\ ', ' ', 'g') + " convert slashes to backslashes + let path = substitute(path, '/', '\', 'g') + else + let path= a:path + endif +" call Dret("netrw#WinPath <".path.">") + return path +endfun + +" --------------------------------------------------------------------- " netrw#NetrwRestorePosn: restores the cursor and file position as saved by NetrwSavePosn() {{{2 fun! netrw#NetrwRestorePosn(...) " call Dfunc("netrw#NetrwRestorePosn() a:0=".a:0." winnr=".(exists("w:netrw_winnr")? w:netrw_winnr : -1)." line=".(exists("w:netrw_line")? w:netrw_line : -1)." col=".(exists("w:netrw_col")? w:netrw_col : -1)." hline=".(exists("w:netrw_hline")? w:netrw_hline : -1)) @@ -8968,6 +9091,21 @@ fun! netrw#NetrwSavePosn() return ret endfun +" --------------------------------------------------------------------- +" netrw#NetrwAccess: intended to provide access to variable values for netrw's test suite {{{2 +" 0: marked file list of current buffer +" 1: marked file target +fun! netrw#NetrwAccess(ilist) + if a:ilist == 0 + if exists("s:netrwmarkfilelist_".bufnr('%')) + return s:netrwmarkfilelist_{bufnr('%')} + else + return "no-list-buf#".bufnr('%') + endif + elseif a:ilist == 1 + return s:netrwmftgt +endfun + " ------------------------------------------------------------------------ " netrw#RFC2396: converts %xx into characters {{{2 fun! netrw#RFC2396(fname) @@ -9223,7 +9361,7 @@ 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("%")) +" call Dfunc("s:RestoreCursorline() currently, cul=".&l:cursorline." cuc=".&l:cursorcolumn." win#".winnr()." buf#".bufnr("%")." mod=".&mod) if exists("s:netrw_usercul") let &l:cursorline = s:netrw_usercul endif @@ -9292,11 +9430,7 @@ fun! s:NetrwEnew(...) keepj call s:NetrwOptionRestore("w:") " call Decho("generate a buffer with keepjumps keepalt enew!") let netrw_keepdiff= &l:diff - " COMBAK: Benzinger: using tree mode, vim -o Foo/ file shows Foo/ Foo/ instead. Place return here, problem goes away (beeps result, but who knows) -" call Dredir("Benzinger 1:","ls!") keepj keepalt enew! -" call Dredir("Benzinger 2:","ls!") - " COMBAK: Benzinger: using tree mode, vim -o Foo/ file shows Foo/ Foo/ instead. Place return here, problem remains. let &l:diff= netrw_keepdiff " call Decho("bufnr($)=".bufnr("$")) keepj call s:NetrwOptionSave("w:") @@ -9715,27 +9849,7 @@ fun! s:UseBufWinVars() endfun " --------------------------------------------------------------------- -" netrw#WinPath: tries to insure that the path is windows-acceptable, whether cygwin is used or not {{{2 -fun! netrw#WinPath(path) -" call Dfunc("netrw#WinPath(path<".a:path.">)") - if (!g:netrw_cygwin || &shell !~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$') && (has("win32") || has("win95") || has("win64") || has("win16")) - " remove cygdrive prefix, if present - let path = substitute(a:path,'/cygdrive/\(.\)','\1:','') - " remove trailing slash (Win95) - let path = substitute(path, '\(\\\|/\)$', '', 'g') - " remove escaped spaces - let path = substitute(path, '\ ', ' ', 'g') - " convert slashes to backslashes - let path = substitute(path, '/', '\', 'g') - else - let path= a:path - endif -" call Dret("netrw#WinPath <".path.">") - return path -endfun - -" --------------------------------------------------------------------- -" Settings Restoration: {{{2 +" Settings Restoration: {{{1 let &cpo= s:keepcpo unlet s:keepcpo diff --git a/runtime/autoload/netrwFileHandlers.vim b/runtime/autoload/netrwFileHandlers.vim index 84f70c4f8..ed31e29a6 100644 --- a/runtime/autoload/netrwFileHandlers.vim +++ b/runtime/autoload/netrwFileHandlers.vim @@ -1,8 +1,8 @@ " netrwFileHandlers: contains various extension-based file handlers for " netrw's browsers' x command ("eXecute launcher") " Author: Charles E. Campbell -" Date: Mar 14, 2012 -" Version: 11a +" Date: May 03, 2013 +" Version: 11b ASTRO-ONLY " Copyright: Copyright (C) 1999-2012 Charles E. Campbell {{{1 " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright @@ -20,7 +20,7 @@ if exists("g:loaded_netrwFileHandlers") || &cp finish endif -let g:loaded_netrwFileHandlers= "v11a" +let g:loaded_netrwFileHandlers= "v11b" if v:version < 702 echohl WarningMsg echo "***warning*** this version of netrwFileHandlers needs vim 7.2" @@ -34,10 +34,10 @@ set cpo&vim " netrwFileHandlers#Invoke: {{{1 fun! netrwFileHandlers#Invoke(exten,fname) " call Dfunc("netrwFileHandlers#Invoke(exten<".a:exten."> fname<".a:fname.">)") - let fname= a:fname + let exten= a:exten " list of supported special characters. Consider rcs,v --- that can be " supported with a NFH_rcsCOMMAv() handler - if a:fname =~ '[@:,$!=\-+%?;~]' + if exten =~ '[@:,$!=\-+%?;~]' let specials= { \ '@' : 'AT', \ ':' : 'COLON', @@ -51,18 +51,18 @@ fun! netrwFileHandlers#Invoke(exten,fname) \ '?' : 'QUESTION', \ ';' : 'SEMICOLON', \ '~' : 'TILDE'} - let fname= substitute(a:fname,'[@:,$!=\-+%?;~]','\=specials[submatch(0)]','ge') + let exten= substitute(a:exten,'[@:,$!=\-+%?;~]','\=specials[submatch(0)]','ge') " call Decho('fname<'.fname.'> done with dictionary') endif - if a:exten != "" && exists("*NFH_".a:exten) + if a:exten != "" && exists("*NFH_".exten) " support user NFH_*() functions " call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")') - exe "let ret= NFH_".a:exten.'("'.fname.'")' - elseif a:exten != "" && exists("*s:NFH_".a:exten) + exe "let ret= NFH_".exten.'("'.a:fname.'")' + elseif a:exten != "" && exists("*s:NFH_".exten) " use builtin-NFH_*() functions " call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")') - exe "let ret= s:NFH_".a:exten.'("'.fname.'")' + exe "let ret= s:NFH_".a:exten.'("'.a:fname.'")' endif " call Dret("netrwFileHandlers#Invoke 0 : ret=".ret) diff --git a/runtime/autoload/netrwSettings.vim b/runtime/autoload/netrwSettings.vim index 68348d8d0..ee4305928 100644 --- a/runtime/autoload/netrwSettings.vim +++ b/runtime/autoload/netrwSettings.vim @@ -1,7 +1,7 @@ " netrwSettings.vim: makes netrw settings simpler -" Date: Sep 03, 2008 +" Date: May 03, 2013 " Maintainer: Charles E Campbell <drchipNOSPAM at campbellfamily dot biz> -" Version: 13 +" Version: 14a ASTRO-ONLY " Copyright: Copyright (C) 1999-2007 Charles E. Campbell {{{1 " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright @@ -19,7 +19,7 @@ if exists("g:loaded_netrwSettings") || &cp finish endif -let g:loaded_netrwSettings = "v13" +let g:loaded_netrwSettings = "v14a" if v:version < 700 echohl WarningMsg echo "***warning*** this version of netrwSettings needs vim 7.0" @@ -88,6 +88,7 @@ fun! netrwSettings#NetrwSettings() put = 'let g:netrw_ftpmode = '.g:netrw_ftpmode put = 'let g:netrw_ignorenetrc = '.g:netrw_ignorenetrc put = 'let g:netrw_sshport = '.g:netrw_sshport + put = 'let g:netrw_silent = '.g:netrw_silent put = 'let g:netrw_use_nt_rcp = '.g:netrw_use_nt_rcp put = 'let g:netrw_win95ftp = '.g:netrw_win95ftp let s:netrw_xfer_stop= line(".") @@ -99,27 +100,50 @@ fun! netrwSettings#NetrwSettings() put ='+ Netrw Browser Control' put = 'let g:netrw_alto = '.g:netrw_alto put = 'let g:netrw_altv = '.g:netrw_altv + put = 'let g:netrw_banner = '.g:netrw_banner + if exists("g:netrw_bannerbackslash") + put = 'let g:netrw_bannerbackslash = '.g:netrw_bannerbackslash + else + put = '\" let g:netrw_bannerbackslash = (not defined)' + endif put = 'let g:netrw_browse_split = '.g:netrw_browse_split if exists("g:netrw_browsex_viewer") - put = 'let g:netrw_browsex_viewer = '.g:netrw_browsex_viewer + put = 'let g:netrw_browsex_viewer = '.g:netrw_browsex_viewer else - put = 'let g:netrw_browsex_viewer = (not defined)' + put = '\" let g:netrw_browsex_viewer = (not defined)' endif put = 'let g:netrw_compress = '.g:netrw_compress + if exists("g:Netrw_corehandler") + put = 'let g:Netrw_corehandler = '.g:Netrw_corehandler + else + put = '\" let g:Netrw_corehandler = (not defined)' + endif + put = 'let g:netrw_ctags = '.g:netrw_ctags put = 'let g:netrw_cursor = '.g:netrw_cursor let decompressline= line("$") - put ='let g:netrw_decompress...' + put = 'let g:netrw_decompress = '.string(g:netrw_decompress) + if exists("g:netrw_dynamic_maxfilenamelen") + put = 'let g:netrw_dynamic_maxfilenamelen='.g:netrw_dynamic_maxfilenamelen + else + put = '\" let g:netrw_dynamic_maxfilenamelen= (not defined)' + endif put = 'let g:netrw_dirhistmax = '.g:netrw_dirhistmax + put = 'let g:netrw_errorlvl = '.g:netrw_errorlvl put = 'let g:netrw_fastbrowse = '.g:netrw_fastbrowse let fnameescline= line("$") - put = 'let g:netrw_fname_escape...' + put = 'let g:netrw_fname_escape = '.string(g:netrw_fname_escape) put = 'let g:netrw_ftp_browse_reject = '.g:netrw_ftp_browse_reject put = 'let g:netrw_ftp_list_cmd = '.g:netrw_ftp_list_cmd put = 'let g:netrw_ftp_sizelist_cmd = '.g:netrw_ftp_sizelist_cmd put = 'let g:netrw_ftp_timelist_cmd = '.g:netrw_ftp_timelist_cmd let globescline= line("$") - put ='let g:netrw_glob_escape...' + put = 'let g:netrw_glob_escape = '.string(g:netrw_glob_escape) put = 'let g:netrw_hide = '.g:netrw_hide + if exists("g:netrw_home") + put = 'let g:netrw_home = '.g:netrw_home + else + put = '\" let g:netrw_home = (not defined)' + endif put = 'let g:netrw_keepdir = '.g:netrw_keepdir put = 'let g:netrw_list_cmd = '.g:netrw_list_cmd put = 'let g:netrw_list_hide = '.g:netrw_list_hide @@ -127,23 +151,30 @@ fun! netrwSettings#NetrwSettings() put = 'let g:netrw_localcopycmd = '.g:netrw_localcopycmd put = 'let g:netrw_localmkdir = '.g:netrw_localmkdir put = 'let g:netrw_localmovecmd = '.g:netrw_localmovecmd - put = 'let g:netrw_localrmdir = '.g:netrw_localrmdir + put = 'let g:netrw_localrmdir = '.g:netrw_localrmdir put = 'let g:netrw_maxfilenamelen = '.g:netrw_maxfilenamelen put = 'let g:netrw_menu = '.g:netrw_menu + put = 'let g:netrw_mousemaps = '.g:netrw_mousemaps put = 'let g:netrw_mkdir_cmd = '.g:netrw_mkdir_cmd + if exists("g:netrw_nobeval") + put = 'let g:netrw_nobeval = '.g:netrw_nobeval + else + put = '\" let g:netrw_nobeval = (not defined)' + endif + put = 'let g:netrw_remote_mkdir = '.g:netrw_remote_mkdir put = 'let g:netrw_preview = '.g:netrw_preview put = 'let g:netrw_rename_cmd = '.g:netrw_rename_cmd put = 'let g:netrw_retmap = '.g:netrw_retmap put = 'let g:netrw_rm_cmd = '.g:netrw_rm_cmd put = 'let g:netrw_rmdir_cmd = '.g:netrw_rmdir_cmd put = 'let g:netrw_rmf_cmd = '.g:netrw_rmf_cmd - put = 'let g:netrw_silent = '.g:netrw_silent put = 'let g:netrw_sort_by = '.g:netrw_sort_by put = 'let g:netrw_sort_direction = '.g:netrw_sort_direction put = 'let g:netrw_sort_options = '.g:netrw_sort_options put = 'let g:netrw_sort_sequence = '.g:netrw_sort_sequence put = 'let g:netrw_special_syntax = '.g:netrw_special_syntax put = 'let g:netrw_ssh_browse_reject = '.g:netrw_ssh_browse_reject + put = 'let g:netrw_ssh_cmd = '.g:netrw_ssh_cmd put = 'let g:netrw_scpport = '.g:netrw_scpport put = 'let g:netrw_sepchr = '.g:netrw_sepchr put = 'let g:netrw_sshport = '.g:netrw_sshport diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 364670a94..b9d23b359 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim version 7.3. Last change: 2013 Mar 19 +*autocmd.txt* For Vim version 7.3. Last change: 2013 May 19 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 2114ff444..f7cc93b72 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.3. Last change: 2013 May 17 +*eval.txt* For Vim version 7.3. Last change: 2013 May 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1297,7 +1297,7 @@ v:beval_winnr The number of the window, over which the mouse pointer is. Only *v:char* *char-variable* v:char Argument for evaluating 'formatexpr' and used for the typed character when using <expr> in an abbreviation |:map-<expr>|. - It is also used by the |InsertCharPre| event. + It is also used by the |InsertCharPre| and |InsertEnter| events. *v:charconvert_from* *charconvert_from-variable* v:charconvert_from @@ -4639,7 +4639,7 @@ pumvisible() *pumvisible()* This can be used to avoid some things that would remove the popup menu. - *E860* *E861* + *E860* py3eval({expr}) *py3eval()* Evaluate Python expression {expr} and return its result converted to Vim data structures. diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt index 91292ea55..206cdf004 100644 --- a/runtime/doc/if_pyth.txt +++ b/runtime/doc/if_pyth.txt @@ -1,4 +1,4 @@ -*if_pyth.txt* For Vim version 7.3. Last change: 2013 May 17 +*if_pyth.txt* For Vim version 7.3. Last change: 2013 May 21 VIM REFERENCE MANUAL by Paul Moore diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt index 022e21252..0dd632b0c 100644 --- a/runtime/doc/indent.txt +++ b/runtime/doc/indent.txt @@ -1,4 +1,4 @@ -*indent.txt* For Vim version 7.3. Last change: 2012 Aug 30 +*indent.txt* For Vim version 7.3. Last change: 2013 May 20 VIM REFERENCE MANUAL by Bram Moolenaar @@ -740,12 +740,12 @@ those useless characters first with a command like: > :%s /\r$//g Or, you can simply |:let| the variable PHP_removeCRwhenUnix to 1 and the -script will silently remove them when Vim loads a PHP file (at each|BufRead|). +script will silently remove them when Vim loads a PHP file (at each |BufRead|). OPTIONS: ~ PHP indenting can be altered in several ways by modifying the values of some -variables: +global variables: *php-comment* To not enable auto-formating of comments by default (if you want to use your @@ -753,10 +753,21 @@ own 'formatoptions'): > :let g:PHP_autoformatcomment = 0 Else, 't' will be removed from the 'formatoptions' string and "qrowcb" will be -added, see|fo-table|for more information. +added, see |fo-table| for more information. ------------- -To add an extra indent to every PHP lines with N being the number of +To add extra indentation to single-line comments: > + :let g:PHP_outdentSLComments = N + +With N being the number of 'shiftwidth' to add. + +Only single-line comments will be affected such as: > + # Comment + // Comment + /* Comment */ +------------- + +To add extra indentation to every PHP lines with N being the number of 'shiftwidth' to add: > :let g:PHP_default_indenting = N @@ -772,7 +783,7 @@ For example, with N = 1, this will give: $command_hist = TRUE; ?> -(Notice the extra indent between the PHP container markers and the code) +(Notice the extra indentation between the PHP container markers and the code) ------------- To indent PHP tags as the surrounding code: > @@ -804,8 +815,10 @@ NOTE: Indenting will be a bit slower if this option is used because some To indent 'case:' and 'default:' statements in switch() blocks: > :let g:PHP_vintage_case_default_indent = 1 -(Since in PHP braces are not required inside 'case/default' blocks, by default they are indented at the same level than the 'switch()' to avoid -unnecessary indentation) +In PHP braces are not required inside 'case/default' blocks therefore 'case:' +and 'default:' are indented at the same level than the 'switch()' to avoid +meaningless indentation. You can use the above option to return to the +traditional way. PYTHON *ft-python-indent* diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt index 61647935f..8ae023bfb 100644 --- a/runtime/doc/mbyte.txt +++ b/runtime/doc/mbyte.txt @@ -1,4 +1,4 @@ -*mbyte.txt* For Vim version 7.3. Last change: 2012 Oct 06 +*mbyte.txt* For Vim version 7.3. Last change: 2013 May 18 VIM REFERENCE MANUAL by Bram Moolenaar et al. @@ -48,9 +48,9 @@ COMPILING If you already have a compiled Vim program, check if the |+multi_byte| feature is included. The |:version| command can be used for this. -If +multi_byte is not included, you should compile Vim with "big" features. -You can further tune what features are included. See the INSTALL files in the -source directory. +If +multi_byte is not included, you should compile Vim with "normal", "big" or +"huge" features. You can further tune what features are included. See the +INSTALL files in the source directory. LOCALE diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 63ac16d58..98f22ddb8 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.3. Last change: 2013 Apr 27 +*options.txt* For Vim version 7.3. Last change: 2013 May 17 VIM REFERENCE MANUAL by Bram Moolenaar @@ -5516,6 +5516,19 @@ A jump table for the options with a short description can be found at |Q_op|. matches will be highlighted. This is used to avoid that Vim hangs when using a very complicated pattern. + *'regexpengine''* *'re'* +'regexpengine' 're' number (default 0) + global + {not in Vi} + This selects the default regexp engine. |two-engines| + The possible values are: + 0 automatic selection + 1 old engine + 2 NFA engine + Note that when using the NFA engine and the pattern contains something + that is not supported the pattern will not match. This is only useful + for debugging the regexp engine. + *'relativenumber'* *'rnu'* *'norelativenumber'* *'nornu'* 'relativenumber' 'rnu' boolean (default off) local to window diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 98515647a..4d810eab4 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -1,4 +1,4 @@ -*pi_netrw.txt* For Vim version 7.3. Last change: 2013 Apr 19 +*pi_netrw.txt* For Vim version 7.3. Last change: 2013 May 18 ------------------------------------------------ NETRW REFERENCE MANUAL by Charles E. Campbell @@ -146,13 +146,13 @@ and has lines resembling > < Windows' ftp doesn't support .netrc; however, one may have in one's .vimrc: > - let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\Myself\MACHINE' + let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\MyUserName\MACHINE' < -Netrw will substitute the host's machine name for MACHINE from the url it is +Netrw will substitute the host's machine name for "MACHINE" from the url it is attempting to open, and so one may specify > userid password -for each site in a separate file in c:\Users\Myself\. +for each site in a separate file: c:\Users\MyUserName\MachineName. Now about browsing -- when you just want to look around before editing a file. For browsing on your current host, just "edit" a directory: > @@ -321,6 +321,8 @@ CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass* {{{2 :call NetUserPass("uid") -- prompts for password :call NetUserPass("uid","password") -- sets global uid and password +(Related topics: |ftp| |netrw-userpass| |netrw-start|) + NETRW VARIABLES AND SETTINGS *netrw-variables* {{{2 (Also see: |netrw-browser-var| : netrw browser option variables @@ -927,6 +929,7 @@ itself: endfunction endif > +(Related topics: |ftp| |netrw-userpass| |netrw-start|) ============================================================================== 9. Browsing *netrw-browsing* *netrw-browse* *netrw-help* {{{1 @@ -2125,6 +2128,10 @@ your browsing preferences. (see also: |netrw-settings|) NOTE: suppressing the banner is a new feature which may cause problems. + *g:netrw_bannerbackslash* if this variable exists and is not zero, the + banner will be displayed with backslashes + rather than forward slashes. + *g:netrw_browse_split* when browsing, <cr> will open the file by: =0: re-using the same window =1: horizontally splitting the window first @@ -2306,14 +2313,14 @@ your browsing preferences. (see also: |netrw-settings|) Copies marked files (|netrw-mf|) to target directory (|netrw-mt|, |netrw-mc|) + *g:netrw_localmkdir* command for making a local directory + default: "mkdir" + *g:netrw_localmovecmd* ="mv" Linux/Unix/MacOS/Cygwin ="move" Windows Moves marked files (|netrw-mf|) to target directory (|netrw-mt|, |netrw-mm|) - *g:netrw_localmkdir* command for making a local directory - default: "mkdir" - *g:netrw_localrmdir* remove directory command (rmdir) default: "rmdir" @@ -2416,11 +2423,6 @@ your browsing preferences. (see also: |netrw-settings|) < into one's <.vimrc> to use one's own preferences. - *g:netrw_ssh_cmd* One may specify an executable command - to use instead of ssh for remote actions - such as listing, file removal, etc. - default: ssh - *g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines, messages, banners, and whatnot that one doesn't want masquerading as "directories" and "files". @@ -2428,6 +2430,11 @@ your browsing preferences. (see also: |netrw-settings|) messages. By default its value is: '^total\s\+\d\+$' + *g:netrw_ssh_cmd* One may specify an executable command + to use instead of ssh for remote actions + such as listing, file removal, etc. + default: ssh + *g:netrw_tmpfile_escape* =' &;' escape() is applied to all temporary files @@ -2990,6 +2997,19 @@ which is loaded automatically at startup (assuming :set nocp). ============================================================================== 12. History *netrw-history* {{{1 + v149: Apr 18, 2013 * in wide listing format, now have maps for + w and b to move to next/previous file + Apr 26, 2013 * one may now copy files in the same + directory; netrw will issue requests for + what names the files should be copied under + Apr 29, 2013 * Trying Benzinger's problem again. Seems + that commenting out the BufEnter and + installing VimEnter (only) works. Weird + problem! (tree listing, vim -O Dir1 Dir2) + May 01, 2013 * :Explore ftp://... wasn't working. Fixed. + May 02, 2013 * introduced |g:netrw_bannerbackslash| as + requested by Paul Domaskis. + May 18, 2013 * More fixes for windows (not cygwin) v148: Apr 16, 2013 * changed Netrw's Style menu to allow direct choice of listing style, hiding style, and sorting style diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index 268898539..ebb87cd9c 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -1,4 +1,4 @@ -*quickref.txt* For Vim version 7.3. Last change: 2013 Apr 05 +*quickref.txt* For Vim version 7.3. Last change: 2013 May 20 VIM REFERENCE MANUAL by Bram Moolenaar @@ -824,6 +824,7 @@ Short explanation of each option: *option-list* 'quoteescape' 'qe' escape characters used in a string 'readonly' 'ro' disallow writing the buffer 'redrawtime' 'rdt' timeout for 'hlsearch' and |:match| highlighting +'regexpengine' 're' default regexp engine to use 'relativenumber' 'rnu' show relative line number in front of each line 'remap' allow mappings to work recursively 'report' threshold for reporting nr. of lines changed diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 84dc78b31..86fb491e4 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -1,4 +1,4 @@ -*starting.txt* For Vim version 7.3. Last change: 2012 Mar 16 +*starting.txt* For Vim version 7.3. Last change: 2013 May 20 VIM REFERENCE MANUAL by Bram Moolenaar @@ -438,6 +438,8 @@ a slash. Thus "-R" means recovery and "-/R" readonly. option should be used when Vim is started by a program that will wait for the edit session to finish (e.g., mail or readnews). See |amiga-window|. + + MS-Windows: This option is not always supported. {not in Vi} diff --git a/runtime/doc/tags b/runtime/doc/tags index 2f40a4cb9..df53a50bb 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -4261,7 +4261,6 @@ E858 eval.txt /*E858* E859 eval.txt /*E859* E86 windows.txt /*E86* E860 eval.txt /*E860* -E861 eval.txt /*E861* E862 eval.txt /*E862* E863 if_pyth.txt /*E863* E864 pattern.txt /*E864* @@ -5903,6 +5902,7 @@ g:html_whole_filler syntax.txt /*g:html_whole_filler* g:netrw_alto pi_netrw.txt /*g:netrw_alto* g:netrw_altv pi_netrw.txt /*g:netrw_altv* g:netrw_banner pi_netrw.txt /*g:netrw_banner* +g:netrw_bannerbackslash pi_netrw.txt /*g:netrw_bannerbackslash* g:netrw_browse_split pi_netrw.txt /*g:netrw_browse_split* g:netrw_browsex_viewer pi_netrw.txt /*g:netrw_browsex_viewer* g:netrw_bufsettings pi_netrw.txt /*g:netrw_bufsettings* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 8b417de1b..5dd5798c9 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.3. Last change: 2013 May 17 +*todo.txt* For Vim version 7.3. Last change: 2013 May 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -34,8 +34,18 @@ not be repeated below, unless there is extra information. *known-bugs* -------------------- Known bugs and current work ----------------------- +Rename src/Makefile and create a new one like toplevel Makefile that creates +auto/config.mk when it's not there? (Ben Schmidt, 2011 Feb 11) + --- Python interface +Python: thread with refactoring patches. (ZyX, May 19, 16:46 and later) +9 +10 +11 + +Configure doesn't find Python 3 on Ubuntu 13.04. (Ken Takata, Apr 13) + Python SystemExit exception is not handled properly. Patch to catch the exception and give an error. (Yasuhiro Matsumoto) Does not work, tests fail. @@ -45,9 +55,10 @@ Patch to print the result of a :python command. (Maxim Philippov Patch no longer applies. ":python os.chdir('/tmp')" makes short buffer names invalid. (Xavier de Gaye) -Check directory and call shorten_fnames()? Better: make os.chdir() -invoke the interal :cd implementation, that takes care of all side -effects. +Patch to make os.chdir() handle side effects. (Xavier de Gaye, 2013 May 17) +Update May 19, also for os.fchdir(). +Adds a $VIMRUNTIME/python directory. +ZyX: OK to add python and python3 directory. Mac: OS/X 10.4 with Python 2.5 installed: configure finds an extra argument that breaks the build. (Brian Victor, 2008 Sep 1) @@ -65,34 +76,74 @@ Vim script. Requires converting the arguments and return value. --- runtime files Syntax file for protocol buffers. (Feng Xiao, 2013 May 9) -Has an ugly copyright notice. No conflict with Vim license? +Has an ugly copyright notice. +Add statement that it does not conflict with Vim license. Patch for JavaScript syntax. (Kevin Locke, 2013 May 9) Claudio didn't respond yet. --- Fast regexp engine -Including NFA regexp code. Latest version probably is: -https://code.google.com/p/vim-soc2008-regexp/source/browse/trunk/vim72-re/src/regexp_nfa.c -Patch updated by Ken Takata. (May 13) +Duplicate condition in line 1094. (Ken Takata) Should be 'r'? + +Multi-byte problem? Marc Weber + echo matchlist('1', '\%#=1\o{\?\Z') + echo matchlist('1', '\%#=2\o{\?\Z') + +Difference in matching this pattern: (Marc Weber) + echo matchlist("t", '\%#=1炭\Z') + echo matchlist("t", '\%#=2炭\Z') + +Difference in matching this pattern: + echo matchlist('google', '\%#=1\<go*\|go') + echo matchlist('google', '\%#=2\<go*\|go') + +Difference in matching this pattern: (Marc Weber) + echo matchlist("\na", '\%#=1\_F') + echo matchlist("\na", '\%#=0\_F') + echo matchlist("\na", '\%#=2\_F') + +Don't set curbuf, use reg_buf. -To be able to run tests: -- set defaultre=old / nfa / auto -- In pattern use "\%#= to set the engine: 0 = automatic, 1 = old 2 = nfa +Estimation of number of items is wrong, can be much larger. +When running out of space, retry with more space? + +nfa_regcomp() should not use nstate_max but the actual number of states for +allocating the prog? Get example files for many languages. Compare syntax highlighting with old and new regexp, find regexp constructs where NFA does not work correctly. -Idea for comparing output: use format.vim (ZyX, 2013 May 12) -MakeSynChk from Charles Campbell. (May 14) - +source ~/vim/regexp/runold.vim to update the "old" files. +source ~/vim/regexp/runnew.vim to update the "new" files +source ~/vim/regexp/diff.vim to find differences +Diffs in these files: +- csh02: line 2, "13" is not highlighted after -misc-fixed-bold-r-normal- + as cshNumber +- csh02: line 7, similar problem. +- tst28.tex line 8 \alpha in texStatement instead of texGreek + +It's very slow compared to the old engine... Performance tests: -- ~/vim/test/veryslow.js (file from Daniel Fetchinson) +- ~/vim/test/veryslow.js display last line (file from Daniel Fetchinson) - ~/vim/test/slowsearch - ~/vim/test/rgb.vim - ~/vim/text/FeiqCfg.xml (file from Netjune) - ~/vim/text/edl.svg (also XML) - search for a.*e*exn in the vim executable. Go to last line to use 'hlsearch'. +- Slow combination of folding and PHP syntax highlighting. Script to + reproduce it. Caused by "syntax sync fromstart" in combination with patch + 7.2.274. (Christian Brabandt, 2010 May 27) Generally, folding with + 'foldmethod' set to "syntax" is slow. Do profiling to find out why. +- Does not use any of the optimizations, such as required start pattern. +- When lists are empty in nfa_regmatch() and match is true, it keeps looping + without doing anything. + +"\ze" is currently disabled for NFA, can this be fixed? + +"\_[0-9]\?\>" does not match at end of line, disabled. + +Items with \%u, \%x, \%o, \%d do not work with the new engine. --- bug fixes @@ -145,6 +196,12 @@ Patch by Christian Brabandt, Feb 16. 'cursorline' is drawn incorrectly in diff mode. Patch by Christian Brabandt, 2012 Apr 2. +When someone does a silly thing such as setting rows and columns to 65535, +handle the out-of-memory and set them to sane values? (jimmywang, 2013 May 17) + +InsertEnter doesn't prevent the cursor from moving when it goes to another +line. + --- slightly incompatible changes Patch to load ~/.vim/vimrc when ~/.vimrc isn't found. (Lech Lorens, 2013 Apr @@ -203,9 +260,11 @@ Patch to invert characters differently in GTK. (Yukihiro Nakadaira, 2013 May 5) Patch to add the bufferlist() function. (Yegappan Lakshmanan, 2013 May 5) +May 17: with winlist() and tabpagelist(). +May 19: with local variables. Patch to allow setting w:quickfix_title via setqflist() and setloclist() -functions. (Christian Brabandt, 2013 May 8, update May 11) +functions. (Christian Brabandt, 2013 May 8, update May 21) Patch to support 'u' in interactive substitute. (Christian Brabandt, 2012 Sep 28) With tests: Oct 9. @@ -779,12 +838,6 @@ Problem with stop directory in findfile(). (Adam Simpkins, 2009 Aug 26) Using ']' as the end of a range in a pattern requires double escaping: /[@-\\]] (Andy Wokula, 2011 Jun 28) -Slow combination of folding and PHP syntax highlighting. Script to reproduce -it. Caused by "syntax sync fromstart" in combination with patch 7.2.274. -(Christian Brabandt, 2010 May 27) -Generally, folding with 'foldmethod' set to "syntax" is slow. Do profiling to -find out why. - Syntax priority problem. (Charles Campbell, 2011 Sep 15) When completion inserts the first match, it may trigger the line to be folded. @@ -1737,10 +1790,8 @@ Patch to support horizontal scroll wheel in GTK. Untested. (Bjorn Winckler, 2010 Jun 30) -At next release 7.4: +At next release: - Build a huge version by default. -- Rename src/Makefile and create a new one like toplevel Makefile that - creates auto/config.mk when it's not there? (Ben Schmidt, 2011 Feb 11) - Improve plugin handling: Automatic updates, handle dependencies? E.g. Vundle: https://github.com/gmarik/vundle diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index d602af692..98eaf45b6 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -1,4 +1,4 @@ -*various.txt* For Vim version 7.3. Last change: 2012 Dec 06 +*various.txt* For Vim version 7.3. Last change: 2013 May 18 VIM REFERENCE MANUAL by Bram Moolenaar @@ -368,7 +368,7 @@ N *+mouse_sysmouse* Unix only: *BSD console mouse handling |sysmouse| B *+mouse_sgr* Unix only: sgr mouse handling |sgr-mouse| B *+mouse_urxvt* Unix only: urxvt mouse handling |urxvt-mouse| N *+mouse_xterm* Unix only: xterm mouse handling |xterm-mouse| -B *+multi_byte* 16 and 32 bit characters |multibyte| +N *+multi_byte* 16 and 32 bit characters |multibyte| *+multi_byte_ime* Win32 input method for multibyte chars |multibyte-ime| N *+multi_lang* non-English language support |multi-lang| m *+mzscheme* Mzscheme interface |mzscheme| diff --git a/runtime/indent/php.vim b/runtime/indent/php.vim index bc196ed3c..6241f4b19 100644 --- a/runtime/indent/php.vim +++ b/runtime/indent/php.vim @@ -2,21 +2,23 @@ " Language: PHP " Author: John Wellesz <John.wellesz (AT) teaser (DOT) fr> " URL: http://www.2072productions.com/vim/indent/php.vim -" Last Change: 2010 Jully 26th -" Newsletter: http://www.2072productions.com/?to=php-indent-for-vim-newsletter.php -" Version: 1.33 +" Home: https://github.com/2072/PHP-Indenting-for-VIm +" Last Change: 2013 May 10th +" Version: 1.37 " " -" If you find a bug, please report it on GitHub: -" http://github.com/2072/PHP-Indenting-for-VIm/issues -" with an example of code that breaks the algorithm. +" Type :help php-indent for available options " +" A fully commented version of this file is available on github " -" Thanks a lot for using this script. " +" If you find a bug, please open a ticket on github.org +" ( https://github.com/2072/PHP-Indenting-for-VIm/issues ) with an example of +" code that breaks the algorithm. " + " NOTE: This script must be used with PHP syntax ON and with the php syntax -" script by Lutz Eymers (http://www.ipdienste.net/data/php.vim ) or with the +" script by Lutz Eymers (http://www.isp.de/data/php.vim ) or with the " script by Peter Hodge (http://www.vim.org/scripts/script.php?script_id=1571 ) " the later is bunbdled by default with Vim 7. " @@ -26,7 +28,7 @@ " script will automatically put HereDoc end identifiers at col 1 if " they are followed by a ';'). " -" + " NOTE: If you are editing files in Unix file format and that (by accident) " there are '\r' before new lines, this script won't be able to proceed " correctly and will make many mistakes because it won't be able to match @@ -38,8 +40,6 @@ " or simply 'let' the option PHP_removeCRwhenUnix to 1 and the script will " silently remove them when VIM load this script (at each bufread). " -" Options: See :help php-indent for available options. - if exists("b:did_indent") finish @@ -50,12 +50,19 @@ let b:did_indent = 1 let php_sync_method = 0 + if exists("PHP_default_indenting") let b:PHP_default_indenting = PHP_default_indenting * &sw else let b:PHP_default_indenting = 0 endif +if exists("PHP_outdentSLComments") + let b:PHP_outdentSLComments = PHP_outdentSLComments * &sw +else + let b:PHP_outdentSLComments = 0 +endif + if exists("PHP_BracesAtCodeLevel") let b:PHP_BracesAtCodeLevel = PHP_BracesAtCodeLevel else @@ -116,13 +123,20 @@ endif if exists("*GetPhpIndent") call ResetPhpOptions() - finish + finish " XXX -- comment this line for easy dev endif let s:endline= '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$' let s:PHP_startindenttag = '<?\%(.*?>\)\@!\|<script[^>]*>\%(.*<\/script>\)\@!' +function! DebugPrintReturn(scriptLine) + + echo "debug:" . a:scriptLine + call getchar() + +endfunction + function! GetLastRealCodeLNum(startline) " {{{ let lnum = a:startline @@ -189,8 +203,6 @@ function! GetLastRealCodeLNum(startline) " {{{ let b:InPHPcode_and_script = 0 endif - - return lnum endfunction " }}} @@ -198,11 +210,11 @@ function! Skippmatch2() let line = getline(".") - if line =~ '\%(".*\)\@<=/\*\%(.*"\)\@=' || line =~ '\%(\%(//\|#\).*\)\@<=/\*' - return 1 - else - return 0 - endif + if line =~ "\\([\"']\\).*/\\*.*\\1" || line =~ '\%(//\|#\).*/\*' + return 1 + else + return 0 + endif endfun function! Skippmatch() " {{{ @@ -314,7 +326,7 @@ function! IslinePHP (lnum, tofind) " {{{ endif endfunction " }}} -let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\|else\)' +let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\|die\|else\)' let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|else\>\|while\>\|switch\>\|case\>\|default\>\|for\%(each\)\=\>\|declare\>\|class\>\|interface\>\|abstract\>\|try\>\|catch\>\)' let s:autoresetoptions = 0 @@ -361,14 +373,12 @@ function! GetPhpIndent() if !b:PHP_indentinghuge && b:PHP_lastindented > b:PHP_indentbeforelast if b:PHP_indentbeforelast let b:PHP_indentinghuge = 1 - echom 'Large indenting detected, speed optimizations engaged (v1.33)' endif let b:PHP_indentbeforelast = b:PHP_lastindented endif if b:InPHPcode_checked && prevnonblank(v:lnum - 1) != b:PHP_lastindented if b:PHP_indentinghuge - echom 'Large indenting deactivated' let b:PHP_indentinghuge = 0 let b:PHP_CurrentIndentLevel = b:PHP_default_indenting endif @@ -425,7 +435,7 @@ function! GetPhpIndent() else let b:InPHPcode = 0 let b:UserIsTypingComment = 0 - let b:InPHPcode_tofind = '<?\%(.*?>\)\@!\|<script.*>' + let b:InPHPcode_tofind = s:PHP_startindenttag endif endif "!b:InPHPcode_checked }}} @@ -493,7 +503,9 @@ function! GetPhpIndent() endif " Indent successive // or # comment the same way the first is {{{ + let addSpecial = 0 if cline =~ '^\s*\%(//\|#\|/\*.*\*/\s*$\)' + let addSpecial = b:PHP_outdentSLComments if b:PHP_LastIndentedWasComment == 1 return indent(real_PHP_lastindented) endif @@ -550,7 +562,7 @@ function! GetPhpIndent() endif if lnum == 0 - return b:PHP_default_indenting + return b:PHP_default_indenting + addSpecial endif @@ -577,17 +589,17 @@ function! GetPhpIndent() endif - if last_line =~ '[;}]'.endline && last_line !~ '^)' && last_line !~# s:defaultORcase + if last_line =~ '[;}]'.endline && last_line !~ '^[)\]]' && last_line !~# s:defaultORcase if ind==b:PHP_default_indenting - return b:PHP_default_indenting + return b:PHP_default_indenting + addSpecial elseif b:PHP_indentinghuge && ind==b:PHP_CurrentIndentLevel && cline !~# '^\s*\%(else\|\%(case\|default\).*:\|[})];\=\)' && last_line !~# '^\s*\%(\%(}\s*\)\=else\)' && getline(GetLastRealCodeLNum(lnum - 1))=~';'.endline - return b:PHP_CurrentIndentLevel + return b:PHP_CurrentIndentLevel + addSpecial endif endif let LastLineClosed = 0 - let terminated = '\%(;\%(\s*?>\)\=\|<<<''\=\a\w*''\=$\|^\s*}\)'.endline + let terminated = '\%(;\%(\s*\%(?>\|}\)\)\=\|<<<''\=\a\w*''\=$\|^\s*}\)'.endline let unstated = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.endline @@ -618,19 +630,23 @@ function! GetPhpIndent() endwhile elseif last_line =~# unstated && cline !~ '^\s*);\='.endline - let ind = ind + &sw - return ind + let ind = ind + &sw " we indent one level further when the preceding line is not stated + return ind + addSpecial - elseif (ind != b:PHP_default_indenting || last_line =~ '^)' ) && last_line =~ terminated + elseif (ind != b:PHP_default_indenting || last_line =~ '^[)\]]' ) && last_line =~ terminated " Added || last_line =~ '^)' on 2007-12-30 (array indenting problem broke other things) let previous_line = last_line let last_line_num = lnum let LastLineClosed = 1 while 1 - if previous_line =~ '^\s*}' - let last_line_num = FindOpenBracket(last_line_num) + if previous_line =~ '^\s*}\|;\s*}'.endline " XXX + + call cursor(last_line_num, 1) + call search('}\|;\s*}'.endline, 'W') + let oldLastLine = last_line_num + let last_line_num = searchpair('{', '', '}', 'bW', 'Skippmatch()') - if getline(last_line_num) =~ '^\s*{' + if oldLastLine == last_line_num || getline(last_line_num) =~ '^\s*{' let last_line_num = GetLastRealCodeLNum(last_line_num - 1) endif @@ -674,7 +690,7 @@ function! GetPhpIndent() let ind = indent(last_match) let b:PHP_CurrentIndentLevel = b:PHP_default_indenting - return ind + return ind + addSpecial endif endif @@ -693,7 +709,7 @@ function! GetPhpIndent() if !LastLineClosed - if last_line =~# '[{(]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(]'.endline + if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(]'.endline if !b:PHP_BracesAtCodeLevel || last_line !~# '^\s*{' let ind = ind + &sw @@ -702,7 +718,7 @@ function! GetPhpIndent() if b:PHP_BracesAtCodeLevel || b:PHP_vintage_case_default_indent == 1 let b:PHP_CurrentIndentLevel = ind - return ind + return ind + addSpecial endif elseif last_line =~ '\S\+\s*),'.endline @@ -712,22 +728,21 @@ function! GetPhpIndent() if openedparent != lnum let ind = indent(openedparent) endif - + elseif last_line =~ '^\s*'.s:blockstart let ind = ind + &sw - - elseif AntepenultimateLine =~ '\%(;\%(\s*?>\)\=\|<<<''\=\a\w*''\=$\|^\s*}\|{\)'.endline . '\|' . s:defaultORcase + elseif AntepenultimateLine =~ '\%(;\%(\s*\%(?>\|}\)\)\=\|<<<''\=\a\w*''\=$\|^\s*}\|{\)'.endline . '\|' . s:defaultORcase let ind = ind + &sw endif endif - if cline =~ '^\s*);\=' + if cline =~ '^\s*[)\]];\=' let ind = ind - &sw endif let b:PHP_CurrentIndentLevel = ind - return ind + return ind + addSpecial endfunction diff --git a/runtime/lang/menu_ja_jp.euc-jp.vim b/runtime/lang/menu_ja_jp.euc-jp.vim index d3961b90c..ba622a6a3 100644 --- a/runtime/lang/menu_ja_jp.euc-jp.vim +++ b/runtime/lang/menu_ja_jp.euc-jp.vim @@ -2,9 +2,9 @@ " " Menu Translations: Japanese (EUC-JP) " Translated By: MURAOKA Taro <koron.kaoriya@gmail.com> -" Last Change: 24-Feb-2013. +" Last Change: 12-May-2013. " -" Copyright (C) 2001-12 MURAOKA Taro <koron.kaoriya@gmail.com> +" Copyright (C) 2001-13 MURAOKA Taro <koron.kaoriya@gmail.com> " THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. " Quit when menu translations have already been done. @@ -299,50 +299,6 @@ menutrans Co&lor\ test カラーテスト(&L) menutrans &Highlight\ test ハイライトテスト(&H) menutrans &Convert\ to\ HTML HTMLへコンバート(&C) -" Japanese specific menu -" 成否はiconv次第、必ずしも指定したエンコードになるわけではないことに注意 -if has('iconv') - " iconvのバージョン判定 - let s:support_jisx0213 = (iconv("\x87\x64\x87\x6a", 'cp932', 'euc-jisx0213') ==# "\xad\xc5\xad\xcb") ? 1 : 0 - - " 読み込み - an 10.395 &File.-SEPICONV- <Nop> - an 10.396.100.100 &File.エンコード指定(&E)\.\.\..開く(&O)\.\.\..SJIS(&S)<Tab>fenc=cp932 :browse confirm e ++enc=cp932<CR> - if !s:support_jisx0213 - an 10.396.100.110 &File.エンコード指定(&E)\.\.\..開く(&O)\.\.\..EUC(&E)<Tab>fenc=euc-jp :browse confirm e ++enc=euc-jp<CR> - an 10.396.100.120 &File.エンコード指定(&E)\.\.\..開く(&O)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :browse confirm e ++enc=iso-2022-jp<CR> - else - an 10.396.100.110 &File.エンコード指定(&E)\.\.\..開く(&O)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :browse confirm e ++enc=euc-jisx0213<CR> - an 10.396.100.120 &File.エンコード指定(&E)\.\.\..開く(&O)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :browse confirm e ++enc=iso-2022-jp-3<CR> - endif - an 10.396.100.130 &File.エンコード指定(&E)\.\.\..開く(&O)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :browse confirm e ++enc=utf-8<CR> - - " 再読込 - an 10.396.110.100 &File.エンコード指定(&E)\.\.\..再読込(&R)\.\.\..SJIS(&S)<Tab>fenc=cp932 :e ++enc=cp932<CR> - if !s:support_jisx0213 - an 10.396.110.110 &File.エンコード指定(&E)\.\.\..再読込(&R)\.\.\..EUC(&E)<Tab>fenc=euc-jp :e ++enc=euc-jp<CR> - an 10.396.110.120 &File.エンコード指定(&E)\.\.\..再読込(&R)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :e ++enc=iso-2022-jp<CR> - else - an 10.396.110.110 &File.エンコード指定(&E)\.\.\..再読込(&R)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :e ++enc=euc-jisx0213<CR> - an 10.396.110.120 &File.エンコード指定(&E)\.\.\..再読込(&R)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :e ++enc=iso-2022-jp-3<CR> - endif - an 10.396.110.130 &File.エンコード指定(&E)\.\.\..再読込(&R)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :e ++enc=utf-8<CR> - - " 保存 - an 10.396.115 &File.エンコード指定(&E)\.\.\..-SEP1- <Nop> - an 10.396.120.100 &File.エンコード指定(&E)\.\.\..保存(&S)\.\.\..SJIS(&S)<Tab>fenc=cp932 :set fenc=cp932 \| w<CR> - if !s:support_jisx0213 - an 10.396.120.110 &File.エンコード指定(&E)\.\.\..保存(&S)\.\.\..EUC(&E)<Tab>fenc=euc-jp :set fenc=euc-jp \| w<CR> - an 10.396.120.120 &File.エンコード指定(&E)\.\.\..保存(&S)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :set fenc=iso-2022-jp \| w<CR> - else - an 10.396.120.110 &File.エンコード指定(&E)\.\.\..保存(&S)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :set fenc=euc-jisx0213 \| w<CR> - an 10.396.120.120 &File.エンコード指定(&E)\.\.\..保存(&S)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :set fenc=iso-2022-jp-3 \| w<CR> - endif - an 10.396.120.130 &File.エンコード指定(&E)\.\.\..保存(&S)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :set fenc=utf-8 \| w<CR> - - unlet s:support_jisx0213 -endif - let &cpo = s:keepcpo unlet s:keepcpo diff --git a/runtime/lang/menu_ja_jp.utf-8.vim b/runtime/lang/menu_ja_jp.utf-8.vim index 0e48fcf52..7c3431d0f 100644 --- a/runtime/lang/menu_ja_jp.utf-8.vim +++ b/runtime/lang/menu_ja_jp.utf-8.vim @@ -2,9 +2,9 @@ " " Menu Translations: Japanese (UTF-8) " Translated By: MURAOKA Taro <koron.kaoriya@gmail.com> -" Last Change: 24-Feb-2013. +" Last Change: 12-May-2013. " -" Copyright (C) 2001-12 MURAOKA Taro <koron.kaoriya@gmail.com> +" Copyright (C) 2001-13 MURAOKA Taro <koron.kaoriya@gmail.com> " THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. " Quit when menu translations have already been done. @@ -299,50 +299,6 @@ menutrans Co&lor\ test 若鴻(&L) menutrans &Highlight\ test ゃゃ鴻(&H) menutrans &Convert\ to\ HTML HTML吾潟潟若(&C) -" Japanese specific menu -" iconv罨∞綽絎潟潟若с羈 -if has('iconv') - " iconv若吾с喝ゅ - let s:support_jisx0213 = (iconv("\x87\x64\x87\x6a", 'cp932', 'euc-jisx0213') ==# "\xad\xc5\xad\xcb") ? 1 : 0 - - " 茯粋昭 - an 10.395 &File.-SEPICONV- <Nop> - an 10.396.100.100 &File.潟潟若絎(&E)\.\.\..(&O)\.\.\..SJIS(&S)<Tab>fenc=cp932 :browse confirm e ++enc=cp932<CR> - if !s:support_jisx0213 - an 10.396.100.110 &File.潟潟若絎(&E)\.\.\..(&O)\.\.\..EUC(&E)<Tab>fenc=euc-jp :browse confirm e ++enc=euc-jp<CR> - an 10.396.100.120 &File.潟潟若絎(&E)\.\.\..(&O)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :browse confirm e ++enc=iso-2022-jp<CR> - else - an 10.396.100.110 &File.潟潟若絎(&E)\.\.\..(&O)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :browse confirm e ++enc=euc-jisx0213<CR> - an 10.396.100.120 &File.潟潟若絎(&E)\.\.\..(&O)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :browse confirm e ++enc=iso-2022-jp-3<CR> - endif - an 10.396.100.130 &File.潟潟若絎(&E)\.\.\..(&O)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :browse confirm e ++enc=utf-8<CR> - - " 茯莨 - an 10.396.110.100 &File.潟潟若絎(&E)\.\.\..茯莨(&R)\.\.\..SJIS(&S)<Tab>fenc=cp932 :e ++enc=cp932<CR> - if !s:support_jisx0213 - an 10.396.110.110 &File.潟潟若絎(&E)\.\.\..茯莨(&R)\.\.\..EUC(&E)<Tab>fenc=euc-jp :e ++enc=euc-jp<CR> - an 10.396.110.120 &File.潟潟若絎(&E)\.\.\..茯莨(&R)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :e ++enc=iso-2022-jp<CR> - else - an 10.396.110.110 &File.潟潟若絎(&E)\.\.\..茯莨(&R)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :e ++enc=euc-jisx0213<CR> - an 10.396.110.120 &File.潟潟若絎(&E)\.\.\..茯莨(&R)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :e ++enc=iso-2022-jp-3<CR> - endif - an 10.396.110.130 &File.潟潟若絎(&E)\.\.\..茯莨(&R)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :e ++enc=utf-8<CR> - - " 篆絖 - an 10.396.115 &File.潟潟若絎(&E)\.\.\..-SEP1- <Nop> - an 10.396.120.100 &File.潟潟若絎(&E)\.\.\..篆絖(&S)\.\.\..SJIS(&S)<Tab>fenc=cp932 :set fenc=cp932 \| w<CR> - if !s:support_jisx0213 - an 10.396.120.110 &File.潟潟若絎(&E)\.\.\..篆絖(&S)\.\.\..EUC(&E)<Tab>fenc=euc-jp :set fenc=euc-jp \| w<CR> - an 10.396.120.120 &File.潟潟若絎(&E)\.\.\..篆絖(&S)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :set fenc=iso-2022-jp \| w<CR> - else - an 10.396.120.110 &File.潟潟若絎(&E)\.\.\..篆絖(&S)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :set fenc=euc-jisx0213 \| w<CR> - an 10.396.120.120 &File.潟潟若絎(&E)\.\.\..篆絖(&S)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :set fenc=iso-2022-jp-3 \| w<CR> - endif - an 10.396.120.130 &File.潟潟若絎(&E)\.\.\..篆絖(&S)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :set fenc=utf-8 \| w<CR> - - unlet s:support_jisx0213 -endif - let &cpo = s:keepcpo unlet s:keepcpo diff --git a/runtime/lang/menu_japanese_japan.932.vim b/runtime/lang/menu_japanese_japan.932.vim index eee7e7640..7b775cb2c 100644 --- a/runtime/lang/menu_japanese_japan.932.vim +++ b/runtime/lang/menu_japanese_japan.932.vim @@ -2,9 +2,9 @@ " " Menu Translations: Japanese (CP932) " Translated By: MURAOKA Taro <koron.kaoriya@gmail.com> -" Last Change: 24-Feb-2013. +" Last Change: 12-May-2013. " -" Copyright (C) 2001-12 MURAOKA Taro <koron.kaoriya@gmail.com> +" Copyright (C) 2001-13 MURAOKA Taro <koron.kaoriya@gmail.com> " THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. " Quit when menu translations have already been done. @@ -299,50 +299,6 @@ menutrans Co&lor\ test J[eXg(&L) menutrans &Highlight\ test nCCgeXg(&H) menutrans &Convert\ to\ HTML HTMLRo[g(&C) -" Japanese specific menu -" iconvAKwGR[h -if has('iconv') - " iconvo[W - let s:support_jisx0213 = (iconv("\x87\x64\x87\x6a", 'cp932', 'euc-jisx0213') ==# "\xad\xc5\xad\xcb") ? 1 : 0 - - " - an 10.395 &File.-SEPICONV- <Nop> - an 10.396.100.100 &File.GR[hw(&E)\.\.\..J(&O)\.\.\..SJIS(&S)<Tab>fenc=cp932 :browse confirm e ++enc=cp932<CR> - if !s:support_jisx0213 - an 10.396.100.110 &File.GR[hw(&E)\.\.\..J(&O)\.\.\..EUC(&E)<Tab>fenc=euc-jp :browse confirm e ++enc=euc-jp<CR> - an 10.396.100.120 &File.GR[hw(&E)\.\.\..J(&O)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :browse confirm e ++enc=iso-2022-jp<CR> - else - an 10.396.100.110 &File.GR[hw(&E)\.\.\..J(&O)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :browse confirm e ++enc=euc-jisx0213<CR> - an 10.396.100.120 &File.GR[hw(&E)\.\.\..J(&O)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :browse confirm e ++enc=iso-2022-jp-3<CR> - endif - an 10.396.100.130 &File.GR[hw(&E)\.\.\..J(&O)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :browse confirm e ++enc=utf-8<CR> - - " - an 10.396.110.100 &File.GR[hw(&E)\.\.\..(&R)\.\.\..SJIS(&S)<Tab>fenc=cp932 :e ++enc=cp932<CR> - if !s:support_jisx0213 - an 10.396.110.110 &File.GR[hw(&E)\.\.\..(&R)\.\.\..EUC(&E)<Tab>fenc=euc-jp :e ++enc=euc-jp<CR> - an 10.396.110.120 &File.GR[hw(&E)\.\.\..(&R)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :e ++enc=iso-2022-jp<CR> - else - an 10.396.110.110 &File.GR[hw(&E)\.\.\..(&R)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :e ++enc=euc-jisx0213<CR> - an 10.396.110.120 &File.GR[hw(&E)\.\.\..(&R)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :e ++enc=iso-2022-jp-3<CR> - endif - an 10.396.110.130 &File.GR[hw(&E)\.\.\..(&R)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :e ++enc=utf-8<CR> - - " - an 10.396.115 &File.GR[hw(&E)\.\.\..-SEP1- <Nop> - an 10.396.120.100 &File.GR[hw(&E)\.\.\..(&S)\.\.\..SJIS(&S)<Tab>fenc=cp932 :set fenc=cp932 \| w<CR> - if !s:support_jisx0213 - an 10.396.120.110 &File.GR[hw(&E)\.\.\..(&S)\.\.\..EUC(&E)<Tab>fenc=euc-jp :set fenc=euc-jp \| w<CR> - an 10.396.120.120 &File.GR[hw(&E)\.\.\..(&S)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :set fenc=iso-2022-jp \| w<CR> - else - an 10.396.120.110 &File.GR[hw(&E)\.\.\..(&S)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :set fenc=euc-jisx0213 \| w<CR> - an 10.396.120.120 &File.GR[hw(&E)\.\.\..(&S)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :set fenc=iso-2022-jp-3 \| w<CR> - endif - an 10.396.120.130 &File.GR[hw(&E)\.\.\..(&S)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :set fenc=utf-8 \| w<CR> - - unlet s:support_jisx0213 -endif - let &cpo = s:keepcpo unlet s:keepcpo diff --git a/runtime/optwin.vim b/runtime/optwin.vim index 048f7eec9..24ed92d0f 100644 --- a/runtime/optwin.vim +++ b/runtime/optwin.vim @@ -1,7 +1,7 @@ " These commands create the option window. " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2013 Apr 05 +" Last Change: 2013 May 20 " If there already is an option window, jump to that one. if bufwinnr("option-window") > 0 @@ -258,6 +258,8 @@ call append("$", "incsearch\tshow match for partly typed search command") call <SID>BinOptionG("is", &is) call append("$", "magic\tchange the way backslashes are used in search patterns") call <SID>BinOptionG("magic", &magic) +call append("$", "regexpengine\tselect the default regexp engine used") +call <SID>OptionG("re", &re) call append("$", "ignorecase\tignore case when using a search pattern") call <SID>BinOptionG("ic", &ic) call append("$", "smartcase\toverride 'ignorecase' when pattern has upper case characters") diff --git a/runtime/plugin/netrwPlugin.vim b/runtime/plugin/netrwPlugin.vim index cff812b44..718bb663e 100644 --- a/runtime/plugin/netrwPlugin.vim +++ b/runtime/plugin/netrwPlugin.vim @@ -1,6 +1,6 @@ " netrwPlugin.vim: Handles file transfer and remote directory listing across a network " PLUGIN SECTION -" Date: Dec 06, 2012 +" Date: Apr 30, 2013 " Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM> " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 1999-2012 Charles E. Campbell {{{1 @@ -20,13 +20,15 @@ if &cp || exists("g:loaded_netrwPlugin") finish endif -let g:loaded_netrwPlugin = "v148" +"DechoTabOn +let g:loaded_netrwPlugin = "v149" if v:version < 702 echohl WarningMsg | echo "***netrw*** you need vim version 7.2 for this version of netrw" | echohl None finish endif let s:keepcpo = &cpo set cpo&vim +"DechoTabOn " --------------------------------------------------------------------- " Public Interface: {{{1 @@ -34,9 +36,7 @@ set cpo&vim " Local Browsing: {{{2 augroup FileExplorer au! -" au BufReadCmd *[/\\] sil! call s:LocalBrowse(expand("<amatch>")) -" au BufEnter *[^/\\] sil! call s:LocalBrowse(expand("<amatch>")) -" au VimEnter *[^/\\] sil! call s:VimEnter(expand("<amatch>")) + " SEE Benzinger problem... au BufEnter * sil! call s:LocalBrowse(expand("<amatch>")) au VimEnter * sil! call s:VimEnter(expand("<amatch>")) if has("win32") || has("win95") || has("win64") || has("win16") @@ -47,7 +47,7 @@ augroup END " Network Browsing Reading Writing: {{{2 augroup Network au! - au BufReadCmd file://* call netrw#FileUrlRead(expand("<amatch>")) + au BufReadCmd file://* call netrw#FileUrlRead(expand("<amatch>")) au BufReadCmd ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(2,expand("<amatch>"))|exe "sil doau BufReadPost ".fnameescape(expand("<amatch>")) au FileReadCmd ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(1,expand("<amatch>"))|exe "sil doau FileReadPost ".fnameescape(expand("<amatch>")) au BufWriteCmd ftp://*,rcp://*,scp://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufWritePre ".fnameescape(expand("<amatch>"))|exe 'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau BufWritePost ".fnameescape(expand("<amatch>")) @@ -92,27 +92,37 @@ fun! s:LocalBrowse(dirname) " unfortunate interaction -- debugging calls can't be used here; " the BufEnter event causes triggering when attempts to write to " the DBG buffer are made. + if !exists("s:vimentered") + return + endif +" call Decho("s:LocalBrowse(dirname<".a:dirname.">){") " echomsg "dirname<".a:dirname.">" if has("amiga") " The check against '' is made for the Amiga, where the empty " string is the current directory and not checking would break " things such as the help command. +" call Decho("(LocalBrowse) dirname<".a:dirname."> (amiga)") if a:dirname != '' && isdirectory(a:dirname) sil! call netrw#LocalBrowseCheck(a:dirname) endif elseif isdirectory(a:dirname) " echomsg "dirname<".dirname."> isdir" +" call Decho("(LocalBrowse) dirname<".a:dirname."> (not amiga)") sil! call netrw#LocalBrowseCheck(a:dirname) endif " not a directory, ignore it +" call Decho("|return s:LocalBrowse }") endfun " --------------------------------------------------------------------- " s:VimEnter: {{{2 fun! s:VimEnter(dirname) - let curwin= winnr() +" call Decho("VimEnter(dirname<".a:dirname.">){") + let curwin = winnr() + let s:vimentered = 1 windo if a:dirname != expand("%")|call s:LocalBrowse(expand("%:p"))|endif exe curwin."wincmd w" +" call Decho("|return VimEnter }") endfun " --------------------------------------------------------------------- diff --git a/runtime/syntax/debcontrol.vim b/runtime/syntax/debcontrol.vim index 06a519723..3ca17a86e 100644 --- a/runtime/syntax/debcontrol.vim +++ b/runtime/syntax/debcontrol.vim @@ -3,7 +3,7 @@ " Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> " Former Maintainers: Gerfried Fuchs <alfie@ist.org> " Wichert Akkerman <wakkerma@debian.org> -" Last Change: 2012 Dec 31 +" Last Change: 2013 May 05 " URL: http://anonscm.debian.org/hg/pkg-vim/vim/raw-file/unstable/runtime/syntax/debcontrol.vim " Standard syntax initialization @@ -38,7 +38,7 @@ syn match debcontrolDmUpload contained "\cyes" syn match debcontrolHTTPUrl contained "\vhttps?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$" syn match debcontrolVcsSvn contained "\vsvn%(\+ssh)?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$" syn match debcontrolVcsCvs contained "\v%(\-d *)?:pserver:[^@]+\@[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?:/[^[:space:]]*%( [^[:space:]]+)?$" -syn match debcontrolVcsGit contained "\v%(git|http)://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$" +syn match debcontrolVcsGit contained "\v%(git|http)://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?%(\s+-b\s+[^ ~^:?*[\\]+)?$" " An email address syn match debcontrolEmail "[_=[:alnum:]\.+-]\+@[[:alnum:]\./\-]\+" diff --git a/runtime/syntax/fstab.vim b/runtime/syntax/fstab.vim index 9bee89433..3006d21fe 100644 --- a/runtime/syntax/fstab.vim +++ b/runtime/syntax/fstab.vim @@ -1,9 +1,9 @@ " Vim syntax file " Language: fstab file -" Maintaner: Radu Dineiu <radu.dineiu@gmail.com> -" URL: http://ld.yi.org/vim/fstab.vim -" Last Change: 2009 Feb 04 -" Version: 0.93 +" Maintainer: Radu Dineiu <radu.dineiu@gmail.com> +" URL: https://raw.github.com/rid9/vim-fstab/master/fstab.vim +" Last Change: 2013 May 21 +" Version: 1.0 " " Credits: " David Necas (Yeti) <yeti@physics.muni.cz> @@ -11,10 +11,13 @@ " Georgi Georgiev <chutz@gg3.net> " James Vega <jamessan@debian.org> " Elias Probst <mail@eliasprobst.eu> -" + " Options: " let fstab_unknown_fs_errors = 1 " highlight unknown filesystems as errors +" +" let fstab_unknown_device_errors = 0 +" do not highlight unknown devices as errors if version < 600 syntax clear @@ -22,15 +25,18 @@ elseif exists("b:current_syntax") finish endif +let s:cpo_save = &cpo +set cpo&vim + " General syn cluster fsGeneralCluster contains=fsComment -syn match fsComment /\s*#.*/ +syn match fsComment /\s*#.*/ contains=@Spell syn match fsOperator /[,=:#]/ " Device syn cluster fsDeviceCluster contains=fsOperator,fsDeviceKeyword,fsDeviceError syn match fsDeviceError /\%([^a-zA-Z0-9_\/#@:\.-]\|^\w\{-}\ze\W\)/ contained -syn keyword fsDeviceKeyword contained none proc linproc tmpfs devpts sysfs usbfs +syn keyword fsDeviceKeyword contained none proc linproc tmpfs devpts devtmpfs sysfs usbfs syn keyword fsDeviceKeyword contained LABEL nextgroup=fsDeviceLabel syn keyword fsDeviceKeyword contained UUID nextgroup=fsDeviceUUID syn keyword fsDeviceKeyword contained sshfs nextgroup=fsDeviceSshfs @@ -47,7 +53,7 @@ syn keyword fsMountPointKeyword contained none swap " Type syn cluster fsTypeCluster contains=fsTypeKeyword,fsTypeUnknown syn match fsTypeUnknown /\s\+\zs\w\+/ contained -syn keyword fsTypeKeyword contained adfs ados affs atfs audiofs auto autofs befs bfs cd9660 cfs cifs coda cramfs devfs devpts e2compr efs ext2 ext2fs ext3 ext4 fdesc ffs filecore fuse hfs hpfs iso9660 jffs jffs2 jfs kernfs lfs linprocfs mfs minix msdos ncpfs nfs none ntfs null nwfs overlay ovlfs portal proc procfs ptyfs qnx4 reiserfs romfs shm smbfs sshfs std subfs swap sysfs sysv tcfs tmpfs udf ufs umap umsdos union usbfs userfs vfat vs3fs vxfs wrapfs wvfs xfs zisofs +syn keyword fsTypeKeyword contained adfs ados affs anon_inodefs atfs audiofs auto autofs bdev befs bfs btrfs binfmt_misc cd9660 cfs cgroup cifs coda configfs cpuset cramfs devfs devpts devtmpfs e2compr efs ext2 ext2fs ext3 ext4 fdesc ffs filecore fuse fuseblk fusectl hfs hpfs hugetlbfs iso9660 jffs jffs2 jfs kernfs lfs linprocfs mfs minix mqueue msdos ncpfs nfs nfsd nilfs2 none ntfs null nwfs overlay ovlfs pipefs portal proc procfs pstore ptyfs qnx4 reiserfs ramfs romfs securityfs shm smbfs squashfs sockfs sshfs std subfs swap sysfs sysv tcfs tmpfs udf ufs umap umsdos union usbfs userfs vfat vs3fs vxfs wrapfs wvfs xenfs xfs zisofs " Options " ------- @@ -71,6 +77,11 @@ syn match fsOptionsKeywords contained /\<\%(prefix\|volume\|root\)=/ nextgroup=f syn match fsOptionsKeywords contained /\<bs=/ nextgroup=fsOptionsSize syn keyword fsOptionsKeywords contained protect usemp verbose +" Options: btrfs +syn match fsOptionsKeywords contained /\<\%(subvol\|subvolid\|subvolrootid\|device\|compress\|compress-force\|fatal_errors\)=/ nextgroup=fsOptionsString +syn match fsOptionsKeywords contained /\<\%(max_inline\|alloc_start\|thread_pool\|metadata_ratio\|check_int_print_mask\)=/ nextgroup=fsOptionsNumber +syn keyword fsOptionsKeywords contained degraded nodatasum nodatacow nobarrier ssd ssd_spread noacl notreelog flushoncommit space_cache nospace_cache clear_cache user_subvol_rm_allowed autodefrag inode_cache enospc_debug recovery check_int check_int_data skip_balance discard + " Options: cd9660 syn keyword fsOptionsKeywords contained extatt gens norrip nostrictjoilet @@ -84,7 +95,7 @@ syn match fsOptionsKeywords contained /\<\%(res[gu]id\|sb\)=/ nextgroup=fsOption syn keyword fsOptionsExt2Check contained none normal strict syn keyword fsOptionsExt2Errors contained continue panic syn match fsOptionsExt2Errors contained /\<remount-ro\>/ -syn keyword fsOptionsKeywords contained acl bsddf minixdf debug grpid bsdgroups minixdf noacl nocheck nogrpid oldalloc orlov sysvgroups nouid32 nobh user_xattr nouser_xattr +syn keyword fsOptionsKeywords contained acl bsddf minixdf debug grpid bsdgroups minixdf nocheck nogrpid oldalloc orlov sysvgroups nouid32 nobh user_xattr nouser_xattr " Options: ext3 syn match fsOptionsKeywords contained /\<journal=/ nextgroup=fsOptionsExt3Journal @@ -92,7 +103,7 @@ syn match fsOptionsKeywords contained /\<data=/ nextgroup=fsOptionsExt3Data syn match fsOptionsKeywords contained /\<commit=/ nextgroup=fsOptionsNumber syn keyword fsOptionsExt3Journal contained update inum syn keyword fsOptionsExt3Data contained journal ordered writeback -syn keyword fsOptionsKeywords contained noload user_xattr nouser_xattr acl noacl +syn keyword fsOptionsKeywords contained noload user_xattr nouser_xattr acl " Options: ext4 syn match fsOptionsKeywords contained /\<journal=/ nextgroup=fsOptionsExt4Journal @@ -216,7 +227,7 @@ syn match fsOptions /\s\+.\{-}\s/me=e-1 nextgroup=fsFreqPass contains=@fsOptions syn match fsFreqPass /\s\+.\{-}$/ contains=@fsFreqPassCluster,@fsGeneralCluster contained " Whole line comments -syn match fsCommentLine /^#.*$/ +syn match fsCommentLine /^#.*$/ contains=@Spell if version >= 508 || !exists("did_config_syntax_inits") if version < 508 @@ -241,7 +252,10 @@ if version >= 508 || !exists("did_config_syntax_inits") HiLink fsTypeUnknown Error endif - HiLink fsDeviceError Error + if !exists('fstab_unknown_device_errors') || fstab_unknown_device_errors == 1 + HiLink fsDeviceError Error + endif + HiLink fsMountPointError Error HiLink fsMountPointKeyword Keyword HiLink fsFreqPassError Error @@ -277,4 +291,7 @@ endif let b:current_syntax = "fstab" +let &cpo = s:cpo_save +unlet s:cpo_save + " vim: ts=8 ft=vim diff --git a/runtime/syntax/r.vim b/runtime/syntax/r.vim index 8912ba191..d92f5c5bd 100644 --- a/runtime/syntax/r.vim +++ b/runtime/syntax/r.vim @@ -102,12 +102,11 @@ syn match rComplex "\<\d\+[Ee][-+]\=\d\+i" syn match rOperator "&" syn match rOperator '-' -syn match rOperator '*' +syn match rOperator '\*' syn match rOperator '+' syn match rOperator '=' syn match rOperator "[|!<>^~`/:@]" syn match rOperator "%\{2}\|%\*%\|%\/%\|%in%\|%o%\|%x%" -syn match rOpError '*\{3}' syn match rOpError '//' syn match rOpError '&&&' syn match rOpError '|||' diff --git a/runtime/syntax/resolv.vim b/runtime/syntax/resolv.vim index cbb9105d2..06d6885c1 100644 --- a/runtime/syntax/resolv.vim +++ b/runtime/syntax/resolv.vim @@ -1,10 +1,13 @@ " Vim syntax file " Language: resolver configuration file -" Maintainer: David Necas (Yeti) <yeti@physics.muni.cz> -" Original Maintaner: Radu Dineiu <littledragon@altern.org> -" License: This file can be redistributed and/or modified under the same terms -" as Vim itself. -" Last Change: 2012-05-24 +" Maintainer: Radu Dineiu <radu.dineiu@gmail.com> +" URL: https://raw.github.com/rid9/vim-resolv/master/resolv.vim +" Last Change: 2013 May 21 +" Version: 1.0 +" +" Credits: +" David Necas (Yeti) <yeti@physics.muni.cz> +" Stefano Zacchiroli <zack@debian.org> if version < 600 syntax clear @@ -14,18 +17,18 @@ endif " Errors, comments and operators syn match resolvError /./ -syn match resolvComment /\s*[#;].*$/ contains=@Spell -syn match resolvOperator /[/:]/ contained +syn match resolvComment /\s*[#;].*$/ +syn match resolvOperator /[\/:]/ contained " IP syn cluster resolvIPCluster contains=resolvIPError,resolvIPSpecial -syn match resolvIPError /\%(\d\{4,}\|25[6-9]\|2[6-9]\d\|[3-9]\d\{2}\)[.0-9]*/ contained +syn match resolvIPError /\%(\d\{4,}\|25[6-9]\|2[6-9]\d\|[3-9]\d\{2}\)[\.0-9]*/ contained syn match resolvIPSpecial /\%(127\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\)/ contained " General syn match resolvIP contained /\%(\d\{1,4}\.\)\{3}\d\{1,4}/ contains=@resolvIPCluster syn match resolvIPNetmask contained /\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\/\%(\%(\d\{1,4}\.\)\{,3}\d\{1,4}\)\)\?/ contains=resolvOperator,@resolvIPCluster -syn match resolvHostname contained /\w\{-}\.[-0-9A-Za-z_.]*/ +syn match resolvHostname contained /\w\{-}\.[-0-9A-Za-z_\.]*/ " Particular syn match resolvIPNameserver contained /\%(\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\s\|$\)\)\+/ contains=@resolvIPCluster @@ -41,8 +44,6 @@ syn match resolvSortList /^\s*sortlist\>/ nextgroup=resolvIPNetmaskSortList skip syn match resolvOptions /^\s*options\>/ nextgroup=resolvOption skipwhite " Options -" FIXME: The manual page and the source code do not exactly agree on the set -" of allowed options syn match resolvOption /\<\%(debug\|no_tld_query\|rotate\|no-check-names\|inet6\)\>/ contained nextgroup=resolvOption skipwhite syn match resolvOption /\<\%(ndots\|timeout\|attempts\):\d\+\>/ contained contains=resolvOperator nextgroup=resolvOption skipwhite |