From b84ff7ccdf4363cd89f71d90d0b4023f00145272 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 12 Jan 2010 23:33:36 +0100 Subject: [PATCH] update runtime files --- runtime/autoload/getscript.vim | 273 +++++++++-------- runtime/autoload/netrw.vim | 600 +++++++++++++++++++++++++------------ runtime/autoload/tar.vim | 253 ++++++++++------ runtime/autoload/vimball.vim | 141 ++++----- runtime/doc/eval.txt | 7 +- runtime/doc/options.txt | 8 +- runtime/doc/pi_getscript.txt | 48 ++- runtime/doc/pi_netrw.txt | 281 ++++++++++++----- runtime/doc/pi_tar.txt | 41 ++- runtime/doc/pi_vimball.txt | 70 +++-- runtime/doc/starting.txt | 5 +- runtime/doc/tags | 18 +- runtime/doc/todo.txt | 34 ++- runtime/doc/uganda.txt | 13 +- runtime/getdos.aap | 57 ++-- runtime/getunix.aap | 57 ++-- runtime/indent/sh.vim | 16 +- runtime/plugin/getscriptPlugin.vim | 2 +- runtime/plugin/netrwPlugin.vim | 2 +- runtime/plugin/tarPlugin.vim | 16 +- runtime/plugin/vimballPlugin.vim | 14 +- runtime/syntax/asm.vim | 20 +- runtime/syntax/netrc.vim | 21 +- runtime/syntax/netrw.vim | 24 +- runtime/syntax/screen.vim | 327 +++++++++++++++----- runtime/syntax/sh.vim | 33 +- runtime/syntax/tex.vim | 14 +- runtime/syntax/vim.vim | 17 +- runtime/tools/README.txt | 2 + runtime/tools/unicode.vim | 280 +++++++++++++++++ 30 files changed, 1839 insertions(+), 855 deletions(-) rewrite runtime/syntax/screen.vim (71%) create mode 100644 runtime/tools/unicode.vim diff --git a/runtime/autoload/getscript.vim b/runtime/autoload/getscript.vim index 5a466cb8..6e019764 100644 --- a/runtime/autoload/getscript.vim +++ b/runtime/autoload/getscript.vim @@ -1,8 +1,8 @@ " --------------------------------------------------------------------- " getscript.vim " Author: Charles E. Campbell, Jr. -" Date: Jul 10, 2008 -" Version: 31 +" Date: Dec 28, 2009 +" Version: 32 " Installing: :help glvs-install " Usage: :help glvs " @@ -12,19 +12,24 @@ " Initialization: {{{1 " if you're sourcing this file, surely you can't be " expecting vim to be in its vi-compatible mode! +if exists("g:loaded_getscript") + finish +endif +let g:loaded_getscript= "v32" if &cp echoerr "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)" finish endif +if v:version < 702 + echohl WarningMsg + echo "***warning*** this version of getscript needs vim 7.2" + echohl Normal + finish +endif let s:keepcpo = &cpo set cpo&vim "DechoTabOn -if exists("g:loaded_getscript") - finish -endif -let g:loaded_getscript= "v31" - " --------------------------- " Global Variables: {{{1 " --------------------------- @@ -40,25 +45,6 @@ if !exists("g:getscript_cygwin") let g:getscript_cygwin= 0 endif endif -" shell quoting character {{{2 -if exists("g:netrw_shq") && !exists("g:getscript_shq") - let g:getscript_shq= g:netrw_shq -elseif !exists("g:getscript_shq") - if exists("&shq") && &shq != "" - let g:getscript_shq= &shq - elseif exists("&sxq") && &sxq != "" - let g:getscript_shq= &sxq - elseif has("win32") || has("win95") || has("win64") || has("win16") - if g:getscript_cygwin - let g:getscript_shq= "'" - else - let g:getscript_shq= '"' - endif - else - let g:getscript_shq= "'" - endif -" call Decho("g:getscript_shq<".g:getscript_shq.">") -endif " wget vs curl {{{2 if !exists("g:GetLatestVimScripts_wget") @@ -112,7 +98,9 @@ if g:GetLatestVimScripts_allowautoinstall endif endif - if exists('$HOME') && isdirectory(expand("$HOME")."/".s:dotvim) + if exists("g:GetLatestVimScripts_autoinstalldir") && isdirectory(g:GetLatestVimScripts_autoinstalldir) + let s:autoinstall= g:GetLatestVimScripts_autoinstalldir" + elseif exists('$HOME') && isdirectory(expand("$HOME")."/".s:dotvim) let s:autoinstall= $HOME."/".s:dotvim endif " call Decho("s:autoinstall<".s:autoinstall.">") @@ -165,7 +153,6 @@ fun! getscript#GetLatestVimScripts() " call Dret("GetLatestVimScripts : unable to find a GetLatest subdirectory") return endif - if filewritable(datadir) != 2 echoerr "(getLatestVimScripts) Your ".datadir." isn't writable" " call Dret("GetLatestVimScripts : non-writable directory<".datadir.">") @@ -182,21 +169,29 @@ fun! getscript#GetLatestVimScripts() " call Dret("GetLatestVimScripts : non-writable datafile<".datafile.">") return endif + " -------------------- + " Passed sanity checks + " -------------------- + " call Decho("datadir <".datadir.">") " call Decho("datafile <".datafile.">") - " don't let any events interfere (like winmanager's, taglist's, etc) - let eikeep= &ei - let hlskeep= &hls - set ei=all hls&vim - - " record current directory, change to datadir, open split window with - " datafile + " don't let any event handlers interfere (like winmanager's, taglist's, etc) + let eikeep = &ei + let hlskeep = &hls + let acdkeep = &acd + set ei=all hls&vim noacd + + " Edit the datafile (ie. GetLatestVimScripts.dat): + " 1. record current directory (origdir), + " 2. change directory to datadir, + " 3. split window + " 4. edit datafile let origdir= getcwd() " call Decho("exe cd ".fnameescape(substitute(datadir,'\','/','ge'))) exe "cd ".fnameescape(substitute(datadir,'\','/','ge')) split -" call Decho("exe e ".fnameescape(substitute(datafile,'\','/','ge'))) +" call Decho("exe e ".fnameescape(substitute(datafile,'\','/','ge'))) exe "e ".fnameescape(substitute(datafile,'\','/','ge')) res 1000 let s:downloads = 0 @@ -207,69 +202,68 @@ fun! getscript#GetLatestVimScripts() " call Decho("searching plugins for GetLatestVimScripts dependencies") let lastline = line("$") " call Decho("lastline#".lastline) - let plugins = split(globpath(&rtp,"plugin/*.vim"),'\n') + let firstdir = substitute(&rtp,',.*$','','') + let plugins = split(globpath(firstdir,"plugin/*.vim"),'\n') + let plugins = plugins + split(globpath(firstdir,"AsNeeded/*.vim"),'\n') let foundscript = 0 - let firstdir= "" + " this loop updates the GetLatestVimScripts.dat file + " with dependencies explicitly mentioned in the plugins + " via GetLatestVimScripts: ... lines + " It reads the plugin script at the end of the GetLatestVimScripts.dat + " file, examines it, and then removes it. for plugin in plugins +" call Decho(" ") " call Decho("plugin<".plugin.">") - " don't process plugins in system directories - if firstdir == "" - let firstdir= substitute(plugin,'[/\\][^/\\]\+$','','') -" call Decho("setting firstdir<".firstdir.">") - else - let curdir= substitute(plugin,'[/\\][^/\\]\+$','','') -" call Decho("curdir<".curdir.">") - if curdir != firstdir -" call Decho("skipping subsequent plugins: curdir<".curdir."> != firstdir<".firstdir.">") - break - endif - endif - " read plugin in " evidently a :r creates a new buffer (the "#" buffer) that is subsequently unused -- bwiping it $ -" call Decho(" ") " call Decho(".dependency checking<".plugin."> line$=".line("$")) -" call Decho("exe silent r ".fnameescape(plugin)) +" call Decho("..exe silent r ".fnameescape(plugin)) exe "silent r ".fnameescape(plugin) exe "silent bwipe ".bufnr("#") while search('^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+','W') != 0 - let newscript= substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+\s\+\(.*\)$','\1','e') - let llp1 = lastline+1 -" call Decho("..newscript<".newscript.">") - - " don't process ""GetLatestVimScripts lines -- those that have been doubly-commented out - if newscript !~ '^"' - " found a "GetLatestVimScripts: # #" line in the script; check if its already in the datafile - let curline = line(".") - let noai_script = substitute(newscript,'\s*:AutoInstall:\s*','','e') - exe llp1 - let srchline = search('\<'.noai_script.'\>','bW') -" call Decho("..noai_script<".noai_script."> srch=".srchline."curline#".line(".")." lastline#".lastline) - - if srchline == 0 - " found a new script to permanently include in the datafile - let keep_rega = @a - let @a = substitute(getline(curline),'^"\s\+GetLatestVimScripts:\s\+','','') - exe lastline."put a" - echomsg "Appending <".@a."> to ".datafile." for ".newscript -" call Decho("..APPEND (".noai_script.")<".@a."> to GetLatestVimScripts.dat") - let @a = keep_rega - let lastline = llp1 - let curline = curline + 1 - let foundscript = foundscript + 1 -" else " Decho -" call Decho("..found <".noai_script."> (already in datafile at line#".srchline.")") - endif - - let curline = curline + 1 - exe curline + let depscript = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+\s\+\(.*\)$','\1','e') + let depscriptid = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\(\d\+\)\s\+.*$','\1','') + let llp1 = lastline+1 +" call Decho("..depscript<".depscript.">") + + " found a "GetLatestVimScripts: # #" line in the script; + " check if its already in the datafile by searching backwards from llp1, + " the (prior to reading in the plugin script) last line plus one of the GetLatestVimScripts.dat file, + " for the script-id with no wrapping allowed. + let curline = line(".") + let noai_script = substitute(depscript,'\s*:AutoInstall:\s*','','e') + exe llp1 + let srchline = search('^\s*'.depscriptid.'\s\+\d\+\s\+.*$','bW') + if srchline == 0 + " this second search is taken when, for example, a 0 0 scriptname is to be skipped over + let srchline= search('\<'.noai_script.'\>','bW') + endif +" call Decho("..noai_script<".noai_script."> depscriptid#".depscriptid." srchline#".srchline." curline#".line(".")." lastline#".lastline) + + if srchline == 0 + " found a new script to permanently include in the datafile + let keep_rega = @a + let @a = substitute(getline(curline),'^"\s\+GetLatestVimScripts:\s\+','','') + echomsg "Appending <".@a."> to ".datafile." for ".depscript +" call Decho("..Appending <".@a."> to ".datafile." for ".depscript) + exe lastline."put a" + let @a = keep_rega + let lastline = llp1 + let curline = curline + 1 + let foundscript = foundscript + 1 +" else " Decho +" call Decho("..found <".noai_script."> (already in datafile at line#".srchline.")") endif + + let curline = curline + 1 + exe curline endwhile + " llp1: last line plus one let llp1= lastline + 1 " call Decho(".deleting lines: ".llp1.",$d") exe "silent! ".llp1.",$d" @@ -282,7 +276,9 @@ fun! getscript#GetLatestVimScripts() setlocal nomod endif + " -------------------------------------------------------------------- " Check on out-of-date scripts using GetLatest/GetLatestVimScripts.dat + " -------------------------------------------------------------------- " call Decho("begin: checking out-of-date scripts using datafile<".datafile.">") setlocal lz 1 @@ -322,8 +318,9 @@ fun! getscript#GetLatestVimScripts() " restore events and current directory exe "cd ".fnameescape(substitute(origdir,'\','/','ge')) - let &ei= eikeep - let &hls= hlskeep + let &ei = eikeep + let &hls = hlskeep + let &acd = acdkeep setlocal nolz " call Dredir("BUFFER TEST (GetLatestVimScripts 2)","ls!") " call Dret("GetLatestVimScripts : did ".s:downloads." downloads") @@ -333,7 +330,7 @@ endfun " GetOneScript: (Get Latest Vim Script) this function operates {{{1 " on the current line, interpreting two numbers and text as " ScriptID, SourceID, and Filename. -" It downloads any scripts that have newer versions from vim.sf.net. +" It downloads any scripts that have newer versions from vim.sourceforge.net. fun! s:GetOneScript(...) " call Dfunc("GetOneScript()") @@ -391,6 +388,7 @@ fun! s:GetOneScript(...) " call Decho("fname <".fname.">") endif + " plugin author protection from downloading his/her own scripts atop their latest work if scriptid == 0 || srcid == 0 " When looking for :AutoInstall: lines, skip scripts that have 0 0 scriptname let @a= rega @@ -416,21 +414,21 @@ fun! s:GetOneScript(...) " call Decho('considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid) echo 'considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid - " grab a copy of the plugin's vim.sf.net webpage - let scriptaddr = 'http://vim.sf.net/script.php?script_id='.scriptid + " grab a copy of the plugin's vim.sourceforge.net webpage + let scriptaddr = 'http://vim.sourceforge.net/script.php?script_id='.scriptid let tmpfile = tempname() let v:errmsg = "" " make up to three tries at downloading the description let itry= 1 while itry <= 3 -" call Decho("try#".itry." to download description of <".aicmmnt."> with addr=".scriptaddr) +" call Decho(".try#".itry." to download description of <".aicmmnt."> with addr=".scriptaddr) if has("win32") || has("win16") || has("win95") -" call Decho("new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(tmpfile).' '.s:Escape(scriptaddr)."|bw!") - new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(tmpfile).' '.s:Escape(scriptaddr)|bw! +" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)."|bw!") + new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)|bw! else -" call Decho("exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(tmpfile)." ".s:Escape(scriptaddr)) - exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(tmpfile)." ".s:Escape(scriptaddr) +" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr)) + exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr) endif if itry == 1 exe "silent vsplit ".fnameescape(tmpfile) @@ -495,8 +493,7 @@ fun! s:GetOneScript(...) let latestsrcid = latestsrcid + 0 " call Decho("srcid=".srcid." latestsrcid=".latestsrcid." sname<".sname.">") - " has the plugin's most-recent srcid increased, which indicates - " that it has been updated + " has the plugin's most-recent srcid increased, which indicates that it has been updated if latestsrcid > srcid " call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."]: need to update <".sname.">") @@ -506,65 +503,103 @@ fun! s:GetOneScript(...) let sname= "NEW_".sname endif + " ----------------------------------------------------------------------------- " the plugin has been updated since we last obtained it, so download a new copy -" call Decho("...downloading new <".sname.">") - echomsg "...downloading new <".sname.">" + " ----------------------------------------------------------------------------- +" call Decho(".downloading new <".sname.">") + echomsg ".downloading new <".sname.">" if has("win32") || has("win16") || has("win95") -" call Decho("new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid)."|q") - new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid)|q +" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id='.latestsrcid)."|q") + new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id='.latestsrcid)|q else -" call Decho("exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.net/scripts/download_script.php?src_id=')) - exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.net/scripts/download_script.php?src_id=').latestsrcid +" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id=')) + exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id=').latestsrcid endif + " -------------------------------------------------------------------------- " AutoInstall: only if doautoinstall has been requested by the plugin itself + " -------------------------------------------------------------------------- if doautoinstall -" call Decho("attempting to do autoinstall: getcwd<".getcwd()."> filereadable(".sname.")=".filereadable(sname)) +" call Decho(" ") +" call Decho("Autoinstall: getcwd<".getcwd()."> filereadable(".sname.")=".filereadable(sname)) if filereadable(sname) -" call Decho("exe silent !".g:GetLatestVimScripts_mv." ".s:Escape(sname)." ".s:Escape(s:autoinstall)) - exe "silent !".g:GetLatestVimScripts_mv." ".s:Escape(sname)." ".s:Escape(s:autoinstall) +" call Decho("<".sname."> is readable") +" call Decho("exe silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall)) + exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall) let curdir = escape(substitute(getcwd(),'\','/','ge'),"|[]*'\" #") let installdir= curdir."/Installed" if !isdirectory(installdir) call mkdir(installdir) endif -" call Decho("exe cd ".fnameescape(s:autoinstall)) +" call Decho("curdir<".curdir."> installdir<".installdir.">") +" call Decho("exe cd ".fnameescape(s:autoinstall)) exe "cd ".fnameescape(s:autoinstall) + + " determine target directory for moves + let firstdir= substitute(&rtp,',.*$','','') + let pname = substitute(sname,'\..*','.vim','') +" call Decho("determine tgtdir: is <".firstdir.'/AsNeeded/'.pname." readable?") + if filereadable(firstdir.'/AsNeeded/'.pname) + let tgtdir= "AsNeeded" + else + let tgtdir= "plugin" + endif +" call Decho("tgtdir<".tgtdir."> pname<".pname.">") " decompress if sname =~ '\.bz2$' " call Decho("decompress: attempt to bunzip2 ".sname) - exe "silent !bunzip2 ".s:Escape(sname) + exe "silent !bunzip2 ".shellescape(sname) let sname= substitute(sname,'\.bz2$','','') " call Decho("decompress: new sname<".sname."> after bunzip2") elseif sname =~ '\.gz$' " call Decho("decompress: attempt to gunzip ".sname) - exe "silent !gunzip ".s:Escape(sname) + exe "silent !gunzip ".shellescape(sname) let sname= substitute(sname,'\.gz$','','') " call Decho("decompress: new sname<".sname."> after gunzip") + else +" call Decho("no decompression needed") endif " distribute archive(.zip, .tar, .vba) contents if sname =~ '\.zip$' " call Decho("dearchive: attempt to unzip ".sname) - exe "silent !unzip -o ".s:Escape(sname) + exe "silent !unzip -o ".shellescape(sname) elseif sname =~ '\.tar$' " call Decho("dearchive: attempt to untar ".sname) - exe "silent !tar -xvf ".s:Escape(sname) + exe "silent !tar -xvf ".shellescape(sname) elseif sname =~ '\.vba$' " call Decho("dearchive: attempt to handle a vimball: ".sname) silent 1split + if exists("g:vimball_home") + let oldvimballhome= g:vimball_home + endif + let g:vimball_home= s:autoinstall exe "silent e ".fnameescape(sname) silent so % silent q + if exists("oldvimballhome") + let g:vimball_home= oldvimballhome + else + unlet g:vimball_home + endif + else +" call Decho("no dearchiving needed") endif + " --------------------------------------------- + " move plugin to plugin/ or AsNeeded/ directory + " --------------------------------------------- if sname =~ '.vim$' -" call Decho("dearchive: attempt to simply move ".sname." to plugin") - exe "silent !".g:GetLatestVimScripts_mv." ".s:Escape(sname)." plugin" +" call Decho("dearchive: attempt to simply move ".sname." to ".tgtdir) + exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".tgtdir else " call Decho("dearchive: move <".sname."> to installdir<".installdir.">") - exe "silent !".g:GetLatestVimScripts_mv." ".s:Escape(sname)." ".installdir + exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".installdir + endif + if tgtdir != "plugin" +" call Decho("exe silent !".g:GetLatestVimScripts_mv." plugin/".shellescape(pname)." ".tgtdir) + exe "silent !".g:GetLatestVimScripts_mv." plugin/".shellescape(pname)." ".tgtdir endif " helptags step @@ -600,20 +635,6 @@ fun! s:GetOneScript(...) endfun " --------------------------------------------------------------------- -" s:Escape: makes a string safe&suitable for the shell {{{2 -fun! s:Escape(name) -" call Dfunc("s:Escape(name<".a:name.">)") - if exists("*shellescape") - " shellescape() was added by patch 7.0.111 - let name= shellescape(a:name) - else - let name= g:getscript_shq . a:name . g:getscript_shq - endif -" call Dret("s:Escape ".name) - return name -endfun - -" --------------------------------------------------------------------- " Restore Options: {{{1 let &cpo= s:keepcpo unlet s:keepcpo diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index 2dadcfaa..dff8afd8 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -1,10 +1,10 @@ " netrw.vim: Handles file transfer and remote directory listing across " AUTOLOAD SECTION -" Date: Jan 14, 2009 -" Version: 135 +" Date: Dec 28, 2009 +" Version: 136 " Maintainer: Charles E Campbell, Jr " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim -" Copyright: Copyright (C) 1999-2008 Charles E. Campbell, Jr. {{{1 +" Copyright: Copyright (C) 1999-2009 Charles E. Campbell, Jr. {{{1 " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright " notice is copied with it. Like anything else that's free, @@ -22,7 +22,7 @@ if &cp || exists("g:loaded_netrw") finish endif -let g:loaded_netrw = "v135" +let g:loaded_netrw = "v136" if v:version < 702 echohl WarningMsg echo "***warning*** this version of netrw needs vim 7.2" @@ -51,7 +51,8 @@ setlocal cpo&vim " ====================== " --------------------------------------------------------------------- -" NetrwInit: function to initialize variables {{{2 +" NetrwInit: initializes variables if they haven't been defined {{{2 +" Loosely, varname = value. fun s:NetrwInit(varname,value) if !exists(a:varname) if type(a:value) == 0 @@ -60,8 +61,8 @@ fun s:NetrwInit(varname,value) exe "let ".a:varname."="."'".a:value."'" else exe "let ".a:varname."=".a:value + endif endif - endif endfun " --------------------------------------------------------------------- @@ -99,19 +100,13 @@ endif if !exists("g:netrw_http_cmd") if executable("elinks") let g:netrw_http_cmd = "elinks" - if !exists("g:netrw_http_xcmd") - let g:netrw_http_xcmd= "-dump >" - endif + call s:NetrwInit("g:netrw_http_xcmd","-source >") elseif executable("links") let g:netrw_http_cmd = "links" - if !exists("g:netrw_http_xcmd") - let g:netrw_http_xcmd= "-dump >" - endif + call s:NetrwInit("g:netrw_http_xcmd","-source >") elseif executable("curl") let g:netrw_http_cmd = "curl" - if !exists("g:netrw_http_xcmd") - let g:netrw_http_xcmd= "-o" - endif + call s:NetrwInit("g:netrw_http_xcmd","-o") elseif executable("wget") let g:netrw_http_cmd = "wget" call s:NetrwInit("g:netrw_http_xcmd","-q -O") @@ -156,6 +151,7 @@ endif " Default values - a-c ---------- {{{3 call s:NetrwInit("g:netrw_alto" , &sb) call s:NetrwInit("g:netrw_altv" , &spr) +call s:NetrwInit("g:netrw_banner" , 1) call s:NetrwInit("g:netrw_browse_split", 0) call s:NetrwInit("g:netrw_chgwin" , -1) call s:NetrwInit("g:netrw_compress" , "gzip") @@ -253,6 +249,13 @@ call s:NetrwInit("g:netrw_menu" , 1) call s:NetrwInit("g:netrw_mkdir_cmd" , g:netrw_ssh_cmd." USEPORT HOSTNAME mkdir") call s:NetrwInit("g:netrw_mousemaps" , (exists("&mouse") && &mouse =~ '[anh]')) call s:NetrwInit("g:netrw_retmap" , 0) +if has("unix") || (exists("g:netrw_cygwin") && g:netrw_cygwin) + call s:NetrwInit("g:netrw_chgperm" , "chmod PERM FILENAME") +elseif has("win32") || has("win95") || has("win64") || has("win16") + call s:NetrwInit("g:netrw_chgperm" , "cacls FILENAME /e /p PERM") +else + call s:NetrwInit("g:netrw_chgperm" , "chmod PERM FILENAME") +endif call s:NetrwInit("g:netrw_preview" , 0) call s:NetrwInit("g:netrw_scpport" , "-P") call s:NetrwInit("g:netrw_sshport" , "-p") @@ -443,7 +446,9 @@ fun! s:NetrwSafeOptions() endif " allow the user to override safe options - silent keepalt keepjumps doau FileType netrw + if &ft == "netrw" + silent keepalt keepjumps doau FileType netrw + endif " call Decho("fo=".&fo.(exists("&acd")? " acd=".&acd : " acd doesn't exist")) " call Dret("s:NetrwSafeOptions") @@ -761,7 +766,7 @@ fun! netrw#NetRead(mode,...) else let useport= "" endif -" call Decho("exe s:netrw_silentxfer.!".g:netrw_scp_cmd.useport." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1)) +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1)) exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1) let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method) let b:netrw_lastfile = choice @@ -1057,8 +1062,14 @@ fun! netrw#NetWrite(...) range " NetWrite: (ftp + <.netrc>) NetWrite Method #2 {{{3 elseif b:netrw_method == 2 " call Decho("write via ftp+.netrc (method #2)") - let netrw_fname= b:netrw_fname - new + let netrw_fname = b:netrw_fname + + " formerly just a "new...bd!", that changed the window sizes when equalalways. Using enew workaround instead + let bhkeep = &l:bh + let curbuf = bufnr("%") + setlocal bh=hide + enew + " call Decho("filter input window#".winnr()) setlocal ff=unix put =g:netrw_ftpmode @@ -1084,17 +1095,29 @@ fun! netrw#NetWrite(...) range endif let mod=1 endif - bd! + + " remove enew buffer (quietly) + let filtbuf= bufnr("%") + exe curbuf."b!" + let &l:bh = bhkeep + exe filtbuf."bw!" + let b:netrw_lastfile = choice "......................................... " NetWrite: (ftp + machine, id, passwd, filename) NetWrite Method #3 {{{3 elseif b:netrw_method == 3 - " Construct execution string (four lines) which will be passed through filter + " Construct execution string (three or more lines) which will be passed through filter " call Decho("read via ftp+mipf (method #3)") - let netrw_fname= b:netrw_fname - new + let netrw_fname = b:netrw_fname + let bhkeep = &l:bh + + " formerly just a "new...bd!", that changed the window sizes when equalalways. Using enew workaround instead + let curbuf = bufnr("%") + setlocal bh=hide + enew setlocal ff=unix + if exists("g:netrw_port") && g:netrw_port != "" put ='open '.g:netrw_machine.' '.g:netrw_port " call Decho("filter input: ".getline('.')) @@ -1111,6 +1134,12 @@ fun! netrw#NetWrite(...) range put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"' " call Decho("filter input: ".getline('.')) endif + put =g:netrw_ftpmode +" call Decho("filter input: ".getline('$')) + if exists("g:netrw_ftpextracmd") + put =g:netrw_ftpextracmd +" call Decho("filter input: ".getline("$")) + endif put ='put \"'.tmpfile.'\" \"'.netrw_fname.'\"' " call Decho("filter input: ".getline('.')) " save choice/id/password for future use @@ -1130,7 +1159,12 @@ fun! netrw#NetWrite(...) range endif let mod=1 endif - bd! + + " remove enew buffer (quietly) + let filtbuf= bufnr("%") + exe curbuf."b!" + let &l:bh= bhkeep + exe filtbuf."bw!" "......................................... " NetWrite: (scp) NetWrite Method #4 {{{3 @@ -1159,8 +1193,14 @@ fun! netrw#NetWrite(...) range " call Decho("write via cadaver (method #6)") " Construct execution string (four lines) which will be passed through filter - let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) - new + let netrw_fname = escape(b:netrw_fname,g:netrw_fname_escape) + let bhkeep = &l:bh + + " formerly just a "new...bd!", that changed the window sizes when equalalways. Using enew workaround instead + let curbuf = bufnr("%") + setlocal bh=hide + enew + setlocal ff=unix if exists("g:netrw_port") && g:netrw_port != "" put ='open '.g:netrw_machine.' '.g:netrw_port @@ -1176,7 +1216,13 @@ fun! netrw#NetWrite(...) range norm! 1Gdd " call Decho("executing: %!".g:netrw_dav_cmd) exe s:netrw_silentxfer."%!".g:netrw_dav_cmd - bd! + + " remove enew buffer (quietly) + let filtbuf= bufnr("%") + exe curbuf."b!" + let &l:bh = bhkeep + exe filtbuf."bw!" + let b:netrw_lastfile = choice "......................................... @@ -1197,15 +1243,23 @@ fun! netrw#NetWrite(...) range else let uid_machine = g:netrw_machine endif - new + + " formerly just a "new...bd!", that changed the window sizes when equalalways. Using enew workaround instead + let bhkeep = &l:bh + let curbuf = bufnr("%") + setlocal bh=hide + enew + setlocal ff=unix - put ='put \"'.escape(tmpfile,'\').'\" '.netrw_fname + call setline(1,'put "'.escape(tmpfile,'\').'" '.netrw_fname) " call Decho("filter input: ".getline('.')) - norm! 1Gdd " call Decho("executing: %!".g:netrw_sftp_cmd.' '.shellescape(uid_machine,1)) exe s:netrw_silentxfer."%!".g:netrw_sftp_cmd.' '.shellescape(uid_machine,1) - bd! - let b:netrw_lastfile= choice + let filtbuf= bufnr("%") + exe curbuf."b!" + let &l:bh = bhkeep + exe filtbuf."bw!" + let b:netrw_lastfile = choice "......................................... " NetWrite: Complain {{{3 @@ -1227,6 +1281,7 @@ fun! netrw#NetWrite(...) range let &mod= mod endif + " restore equalalways " call Dret("netrw#NetWrite") endfun @@ -1328,11 +1383,7 @@ fun! s:NetrwGetFile(readcmd, tfile, method) " rename buffer back to remote filename " call Decho("exe silent! keepalt file ".fnameescape(rfile)) exe "silent! keepalt file ".fnameescape(rfile) - if a:method == 5 - set ft=html - else - filetype detect - endif + filetype detect " call Dredir("renamed buffer back to remote filename<".rfile."> : expand(%)<".expand("%").">","ls!") let line1 = 1 let line2 = line("$") @@ -1364,7 +1415,7 @@ fun! s:NetrwGetFile(readcmd, tfile, method) " call Decho("NetReadFixup() not called, doesn't exist (line1=".line1." line2=".line2.")") endif - if has("gui") && has("menu") && has("gui_running") && &go =~ 'm' + if has("gui") && has("menu") && has("gui_running") && &go =~ 'm' && g:netrw_menu " update the Buffers menu call s:UpdateBuffersMenu() endif @@ -1689,10 +1740,12 @@ fun! s:BrowserMaps(islocal) nnoremap mz :call NetrwMarkFileCompress(1) nnoremap gb :call NetrwBookHistHandler(1,b:netrw_curdir) nnoremap gh :call NetrwHidden(1) + nnoremap gp :call NetrwChgPerm(1,b:netrw_curdir) nnoremap c :exe "keepjumps lcd ".fnameescape(b:netrw_curdir) nnoremap C :let g:netrw_chgwin= winnr() nnoremap d :call NetrwMakeDir("") nnoremap i :call NetrwListStyle(1) + nnoremap I :call NetrwBannerCtrl(1) nnoremap o :call NetrwSplit(3) nnoremap O :call NetrwObtain(1) nnoremap p :call NetrwPreview(NetrwBrowseChgDir(1,NetrwGetWord(),1)) @@ -1704,6 +1757,7 @@ fun! s:BrowserMaps(islocal) nnoremap s :call NetrwSortStyle(1) nnoremap S :call NetSortSequence(1) nnoremap t :call NetrwSplit(4) + nnoremap T :call NetrwSplit(4)norm! gT nnoremap u :call NetrwBookHistHandler(4,expand("%")) nnoremap U :call NetrwBookHistHandler(5,expand("%")) nnoremap v :call NetrwSplit(5) @@ -1765,8 +1819,10 @@ fun! s:BrowserMaps(islocal) nnoremap mz :call NetrwMarkFileCompress(0) nnoremap gb :call NetrwBookHistHandler(1,b:netrw_cur) nnoremap gh :call NetrwHidden(0) + nnoremap gp :call NetrwChgPerm(0,b:netrw_curdir) nnoremap C :let g:netrw_chgwin= winnr() nnoremap i :call NetrwListStyle(0) + nnoremap I :call NetrwBannerCtrl(1) nnoremap o :call NetrwSplit(0) nnoremap O :call NetrwObtain(0) nnoremap p :call NetrwPreview(NetrwBrowseChgDir(1,NetrwGetWord(),1)) @@ -1778,6 +1834,7 @@ fun! s:BrowserMaps(islocal) nnoremap s :call NetrwSortStyle(0) nnoremap S :call NetSortSequence(0) nnoremap t :call NetrwSplit(1) + nnoremap T :call NetrwSplit(1)norm! gT nnoremap u :call NetrwBookHistHandler(4,b:netrw_curdir) nnoremap U :call NetrwBookHistHandler(5,b:netrw_curdir) nnoremap v :call NetrwSplit(2) @@ -2063,6 +2120,7 @@ fun! s:NetrwBrowse(islocal,dirname) if !exists("s:netrw_initbookhist") call s:NetrwBookHistRead() endif +" call FOTEST(7) " simplify the dirname (especially for ".."s in dirnames) if a:dirname !~ '^\a\+://' @@ -2070,6 +2128,7 @@ fun! s:NetrwBrowse(islocal,dirname) else let dirname= a:dirname endif +" call FOTEST(8) if exists("s:netrw_skipbrowse") unlet s:netrw_skipbrowse @@ -2089,12 +2148,14 @@ fun! s:NetrwBrowse(islocal,dirname) endif call s:NetrwOptionSave("w:") +" call FOTEST(9) " re-instate any marked files if exists("s:netrwmarkfilelist_{bufnr('%')}") " call Decho("clearing marked files") exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/" endif +" call FOTEST(10) if a:islocal && exists("w:netrw_acdkeep") && w:netrw_acdkeep " call Decho("handle w:netrw_acdkeep:") @@ -2139,6 +2200,7 @@ fun! s:NetrwBrowse(islocal,dirname) " call Dret("s:NetrwBrowse : file<".s:fname.">") return endif +" call FOTEST(11) " use buffer-oriented WinVars if buffer ones exist but window ones don't {{{3 call s:UseBufWinVars() @@ -2150,6 +2212,7 @@ fun! s:NetrwBrowse(islocal,dirname) " set up menu {{{3 call s:NetrwMenu(1) +" call FOTEST(12) " set up buffer {{{3 let reusing= s:NetrwGetBuffer(a:islocal,dirname) @@ -2169,6 +2232,7 @@ fun! s:NetrwBrowse(islocal,dirname) " call Dret("s:NetrwBrowse : re-using buffer") return endif +"" call FOTEST(13) " PROBLEM WITH LISTING " set b:netrw_curdir to the new directory name {{{3 " call Decho("set b:netrw_curdir to the new directory name:") @@ -2190,6 +2254,7 @@ fun! s:NetrwBrowse(islocal,dirname) let b:netrw_curdir= b:netrw_curdir.'/' endif " call Decho("b:netrw_curdir<".b:netrw_curdir.">") +"" call FOTEST(14) " PROBLEM WITH LISTING " ------------ " (local only) {{{3 @@ -2261,12 +2326,15 @@ fun! s:NetrwBrowse(islocal,dirname) let b:netrw_curdir= dirname " call Decho("b:netrw_curdir<".b:netrw_curdir."> (remote)") endif " (additional remote handling) +"" call FOTEST(15) " PROBLEM WITH LISTING " ----------------------- " Directory Listing: {{{3 " ----------------------- call s:BrowserMaps(a:islocal) +"" call FOTEST(16) " PROBLEM WITH LISTING call s:PerformListing(a:islocal) +" call FOTEST(17) " The s:LocalBrowseShellCmdRefresh() function is called by an autocmd " installed by s:LocalFastBrowser() when g:netrw_fastbrowse <= 1 (ie. slow, medium speed). @@ -2329,6 +2397,7 @@ fun! s:NetrwGetBuffer(islocal,dirname) " call Decho("--re-use a buffer if possible--") if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST " find NetrwTreeList buffer if there is one +" call Decho("find NetrwTreeList buffer if there is one") if exists("w:netrw_treebufnr") && w:netrw_treebufnr > 0 " call Decho(" re-use w:netrw_treebufnr=".w:netrw_treebufnr) let eikeep= &ei @@ -2352,7 +2421,7 @@ fun! s:NetrwGetBuffer(islocal,dirname) " call Decho(" bufnr(dirname<".escape(dirname,'\').">)=".bufnum) if bufnum < 0 && dirname !~ '/$' - " trying appending a trailing / + " try appending a trailing / " call Decho(" try appending a trailing / to dirname<".dirname.">") let bufnum= bufnr(escape(dirname.'/','\')) if bufnum > 0 @@ -2361,7 +2430,7 @@ fun! s:NetrwGetBuffer(islocal,dirname) endif if bufnum < 0 && dirname =~ '/$' - " trying removing a trailing / + " try removing a trailing / " call Decho(" try removing a trailing / from dirname<".dirname.">") let bufnum= bufnr(escape(substitute(dirname,'/$','',''),'\')) if bufnum > 0 @@ -2373,17 +2442,26 @@ fun! s:NetrwGetBuffer(islocal,dirname) " note: !~ was used just below, but that means using ../ to go back would match (ie. abc/def/ and abc/ matches) if bufnum > 0 && bufname(bufnum) != dirname && bufname(bufnum) != '.' " handle approximate matches -" call Decho(" handling approx match: bufnum#%d<".bufname(bufnum)."> approx=dirname<".dirname.">") +" call Decho(" handling approx match: bufnum#".bufnum."<".bufname(bufnum)."> approx-dirname<".dirname.">") let ibuf = 1 let buflast = bufnr("$") " call Decho(" findbuf2: buflast=".buflast) while ibuf <= buflast let bname= substitute(bufname(ibuf),'\\','/','g') let bname= substitute(bname,'.\zs/$','','') -" call Decho(" findbuf3: dirname<".dirname."> bufname(".ibuf.")<".bname.">") - if bname != '' && dirname =~ '/'.bname.'/\=$' | break | endif - if bname =~ '^'.dirname.'/\=$' | break | endif - if dirname =~ '^'.bname.'/$' | break | endif +" call Decho(" findbuf3: while [ibuf=",ibuf."]<=[buflast=".buflast."]: dirname<".dirname."> bufname(".ibuf.")<".bname.">") + if bname != '' && dirname =~ '/'.bname.'/\=$' && dirname !~ '^/' +" call Decho(" findbuf3: passes test 1 : dirname<".dirname.'> =~ /'.bname.'/\=$ && dirname !~ ^/') + break + endif + if bname =~ '^'.dirname.'/\=$' +" call Decho(' findbuf3: passes test 2 : bname<'.bname.'>=~^'.dirname.'/\=$') + break + endif + if dirname =~ '^'.bname.'/$' +" call Decho(' findbuf3: passes test 3 : dirname<'.dirname.'>=~^'.bname.'/$') + break + endif let ibuf= ibuf + 1 endwhile if ibuf > buflast @@ -2706,6 +2784,29 @@ fun! s:NetrwListStyle(islocal) endfun " --------------------------------------------------------------------- +" s:NetrwBannerCtrl: toggles the display of the banner {{{2 +fun! s:NetrwBannerCtrl(islocal) +" call Dfunc("s:NetrwBannerCtrl(islocal=".a:islocal.") g:netrw_banner=".g:netrw_banner) + + " toggle the banner (enable/suppress) + let g:netrw_banner= !g:netrw_banner + + " refresh the listing + let svpos= netrw#NetrwSavePosn() + call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) + + " keep cursor on the filename + let fname= s:NetrwGetWord() + silent keepjumps $ + let result= search('\%(^\%(|\+\s\)\=\|\s\{2,}\)\zs'.escape(fname,'.\[]*$^').'\%(\s\{2,}\|$\)','bc') +" call Decho("search result=".result." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'N/A')) + if result <= 0 && exists("w:netrw_bannercnt") + exe "keepjumps ".w:netrw_bannercnt + endif +" call Dret("s:NetrwBannerCtrl : g:netrw_banner=".g:netrw_banner) +endfun + +" --------------------------------------------------------------------- " s:NetrwBookmarkMenu: Uses menu priorities {{{2 " .2.[cnt] for bookmarks, and " .3.[cnt] for history @@ -2785,6 +2886,19 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) return endif + " check if the status bar was clicked on instead of a file/directory name + call feedkeys("\") + let c= getchar() + let mouse_lnum = v:mouse_lnum + let wlastline = line('w$') + let lastline = line('$') +" call Decho("v:mouse_lnum=".mouse_lnum." line(w$)=".wlastline." line($)=".lastline) + if mouse_lnum == wlastline + 1 +" call Decho("appears to be a status bar leftmouse click") + " appears to be a status bar leftmouse click + return + endif + call s:NetrwOptionSave("s:") call s:NetrwSafeOptions() let nbcd_curpos = netrw#NetrwSavePosn() @@ -2835,10 +2949,14 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) if !exists("s:didsplit") if g:netrw_browse_split == 1 new - wincmd _ + if !&ea + wincmd _ + endif elseif g:netrw_browse_split == 2 rightb vert new - wincmd | + if !&ea + wincmd | + endif elseif g:netrw_browse_split == 3 tabnew elseif g:netrw_browse_split == 4 @@ -2865,9 +2983,22 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) " call Decho("remote file: NetrwBrowse will edit it") endif let dolockout= 1 - endif - if exists("g:Netrw_funcref") - call g:Netrw_funcref() + + " handle g:Netrw_funcref -- call external-to-netrw functions + " This code will handle g:Netrw_funcref as an individual function reference + " or as a list of function references. It will ignore anything that's not + " a function reference. See :help Funcref for information about function references. + if exists("g:Netrw_funcref") + if type(g:Netrw_funcref) == 2 + call g:Netrw_funcref() + elseif type(g:Netrw_funcref) == 3 + for Fncref in g:Netrw_funcref + if type(FncRef) == 2 + call FncRef() + endif + endfor + endif + endif endif elseif newdir =~ '^/' @@ -3004,11 +3135,33 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) endfun " --------------------------------------------------------------------- -" s:NetrwBrowseX: allows users to write custom functions to operate on {{{2 -" files given their extension. Passes 0=local, 1=remote +" s:NetrwBrowseX: (implements "x") executes a special "viewer" script or program for the {{{2 +" given filename; typically this means given their extension. +" 0=local, 1=remote fun! netrw#NetrwBrowseX(fname,remote) " call Dfunc("NetrwBrowseX(fname<".a:fname."> remote=".a:remote.")") + " special core dump handler + if a:fname =~ '/core\(\.\d\+\)\=$' + if exists("g:Netrw_corehandler") + if type(g:Netrw_corehandler) == 2 + " g:Netrw_corehandler is a function reference (see :help Funcref) +" call Decho("g:Netrw_corehandler is a funcref") + call g:Netrw_corehandler(a:fname) + elseif type(g:netrw_corehandler) == 3) + " g:Netrw_corehandler is a List of function references (see :help Funcref) +" call Decho("g:Netrw_corehandler is a List") + for Fncref in g:Netrw_corehandler + if type(FncRef) == 2 + call FncRef(a:fname) + endif + endfor + endif +" call Dret("NetrwBrowseX : coredump handler invoked") + return + endif + endif + " set up the filename " (lower case the extension, make a local copy of a remote file) let exten= substitute(a:fname,'.*\.\(.\{-}\)','\1','e') @@ -3071,6 +3224,7 @@ fun! netrw#NetrwBrowseX(fname,remote) " extract any viewing options. Assumes that they're set apart by quotes. if exists("g:netrw_browsex_viewer") +" call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">") if g:netrw_browsex_viewer =~ '\s' let viewer = substitute(g:netrw_browsex_viewer,'\s.*$','','') let viewopt = substitute(g:netrw_browsex_viewer,'^\S\+\s*','','')." " @@ -3102,8 +3256,15 @@ fun! netrw#NetrwBrowseX(fname,remote) let ret= v:shell_error elseif has("win32") || has("win64") -" call Decho('exe silent !start rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1)) - exe 'silent !start rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1) + if executable("start") +" call Decho('exe silent !start rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1)) + exe 'silent !start rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1) + elseif executable("rundll32") +" call Decho('exe silent !rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1)) + exe 'silent !rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1) + else + call netrw#ErrorMsg(s:WARNING,"rundll32 not on path",74) + endif call inputsave()|call input("Press to continue")|call inputrestore() let ret= v:shell_error @@ -3158,6 +3319,46 @@ fun! netrw#NetrwBrowseX(fname,remote) endfun " --------------------------------------------------------------------- +" s:NetrwChgPerm: (implements "gp") change file permission {{{2 +fun! s:NetrwChgPerm(islocal,curdir) +" call Dfunc("s:NetrwChgPerm(islocal=".a:islocal." curdir<".a:curdir.">)") + call inputsave() + let newperm= input("Enter new permission: ") + call inputrestore() + let chgperm= substitute(g:netrw_chgperm,'\',shellescape(expand("")),'') + let chgperm= substitute(chgperm,'\',shellescape(newperm),'') +" call Decho("chgperm<".chgperm.">") + call system(chgperm) + if v:shell_error != 0 + call netrw#ErrorMsg(1,"changing permission on file<".expand("")."> seems to have failed",75) + endif + if a:islocal + call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) + endif +" call Dret("s:NetrwChgPerm") +endfun + +" --------------------------------------------------------------------- +" s:NetrwClearExplore: clear explore variables (if any) {{{2 +fun! s:NetrwClearExplore() +" call Dfunc("s:NetrwClearExplore()") + 2match none + if exists("s:explore_match") |unlet s:explore_match |endif + if exists("s:explore_indx") |unlet s:explore_indx |endif + if exists("s:netrw_explore_prvdir") |unlet s:netrw_explore_prvdir |endif + if exists("s:dirstarstar") |unlet s:dirstarstar |endif + if exists("s:explore_prvdir") |unlet s:explore_prvdir |endif + if exists("w:netrw_explore_indx") |unlet w:netrw_explore_indx |endif + if exists("w:netrw_explore_listlen")|unlet w:netrw_explore_listlen|endif + if exists("w:netrw_explore_list") |unlet w:netrw_explore_list |endif + if exists("w:netrw_explore_bufnr") |unlet w:netrw_explore_bufnr |endif +" redraw! + echo " " + echo " " +" call Dret("s:NetrwClearExplore") +endfun + +" --------------------------------------------------------------------- " netrw#Explore: launch the local browser in the directory of the current file {{{2 " indx: == -1: Nexplore " == -2: Pexplore @@ -3180,8 +3381,10 @@ fun! netrw#Explore(indx,dosplit,style,...) let b:netrw_curdir= getcwd() " call Decho("set b:netrw_curdir<".b:netrw_curdir."> (used getcwd)") endif - let curfile= b:netrw_curdir -" call Decho("curfile<".curfile.">") + let curdir = b:netrw_curdir + let curfiledir = substitute(expand("%:p"),'^\(.*[/\\]\)[^/\\]*$','\1','e') +" call Decho("curdir<".curdir."> curfiledir<".curfiledir.">") +" call FOTEST(1) " save registers silent! let keepregstar = @* @@ -3230,6 +3433,7 @@ fun! netrw#Explore(indx,dosplit,style,...) call s:RestoreWinVars() endif norm! 0 +" call FOTEST(2) if a:0 > 0 " call Decho("case [a:0=".a:0."]>0: a:1<".a:1.">") @@ -3244,9 +3448,10 @@ fun! netrw#Explore(indx,dosplit,style,...) " call Decho("using dirname<".dirname."> (case: ".(exists("b:netrw_curdir")? "b:netrw_curdir" : "getcwd()").")") elseif a:1 =~ '\$' let dirname= expand(a:1) +" call Decho("using user-specified dirname<".dirname."> with $env-var") else let dirname= a:1 -" call Decho("using dirname<".dirname.">") +" call Decho("using user-specified dirname<".dirname.">") endif else " clear explore @@ -3254,6 +3459,7 @@ fun! netrw#Explore(indx,dosplit,style,...) " call Dret("netrw#Explore : cleared list") return endif +" call FOTEST(3) if dirname =~ '/\*\*/' " handle .../**/.../filepat @@ -3293,15 +3499,19 @@ fun! netrw#Explore(indx,dosplit,style,...) " starpat=4: Explore **/filepat (recursive descent search for filenames matching filepat) let starpat= 4 " call Decho("case Explore **/filepat (starpat=".starpat.")") + else let starpat= 0 +" call Decho("default case: starpat=".starpat) endif +" call FOTEST(4) if starpat == 0 && a:indx >= 0 " [Explore Hexplore Vexplore Sexplore] [dirname] -" call Decho("case dirname<".dirname."> a:indx=".a:indx.": Explore Hexplore Vexplore Sexplore") +" call Decho("case starpat==0 && a:indx=".a:indx.": dirname<".dirname."> Explore Hexplore Vexplore Sexplore") if dirname == "" - let dirname= substitute(expand("%:p"),'^\(.*[/\\]\)[^/\\]*$','\1','e') + let dirname= curfiledir +" call Decho("empty dirname, using current file's directory<".dirname.">") endif if dirname =~ '^scp:' || dirname =~ '^ftp:' " call Decho("calling NetrwBrowse(0,dirname<".dirname.">)") @@ -3312,11 +3522,11 @@ fun! netrw#Explore(indx,dosplit,style,...) call netrw#LocalBrowseCheck(dirname) endif -" call Decho("curfile<".curfile.">") +" call Decho("curdir<".curdir.">") if has("win32") || has("win95") || has("win64") || has("win16") - call search('\<'.substitute(curfile,'^.*[/\\]','','e').'\>','cW') + call search('\<'.substitute(curdir,'^.*[/\\]','','e').'\>','cW') else - call search('\<'.substitute(curfile,'^.*/','','e').'\>','cW') + call search('\<'.substitute(curdir,'^.*/','','e').'\>','cW') endif " starpat=1: Explore *//pattern (current directory only search for files containing pattern) @@ -3325,7 +3535,7 @@ fun! netrw#Explore(indx,dosplit,style,...) " starpat=4: Explore **/filepat (recursive descent search for filenames matching filepat) elseif a:indx <= 0 " Nexplore, Pexplore, Explore: handle starpat -" call Decho("case Nexplore, Pexplore, , : starpat=".starpat." a:indx=".a:indx) +" call Decho("case a:indx<=0: Nexplore, Pexplore, , starpat=".starpat." a:indx=".a:indx) if !mapcheck("","n") && !mapcheck("","n") && exists("b:netrw_curdir") " call Decho("set up and maps") let s:didstarstar= 1 @@ -3404,7 +3614,13 @@ fun! netrw#Explore(indx,dosplit,style,...) " starpat=1: Explore *//pattern (current directory only search for files containing pattern) " call Decho("starpat=".starpat.": build *//pattern list") " call Decho("pattern<".pattern.">") - exe "vimgrep /".pattern."/gj ".fnameescape(b:netrw_curdir)."/*" + try + exe "noautocmd vimgrep /".pattern."/gj ".fnameescape(b:netrw_curdir)."/*" + catch /^Vim\%((\a\+)\)\=:E480/ + call netrw#ErrorMsg(s:WARNING,"no match with pattern<".pattern.">",76) +" call Dret("netrw#Explore : unable to find pattern<".pattern.">") + return + endtry let w:netrw_explore_list = s:NetrwExploreListUniq(map(getqflist(),'bufname(v:val.bufnr)')) if &hls | let keepregslash= s:ExplorePatHls(pattern) | endif @@ -3412,9 +3628,9 @@ fun! netrw#Explore(indx,dosplit,style,...) " starpat=2: Explore **//pattern (recursive descent search for files containing pattern) " call Decho("starpat=".starpat.": build **//pattern list") try - exe "silent vimgrep /".pattern."/gj "."**/*" + exe "silent noautocmd vimgrep /".pattern."/gj "."**/*" catch /^Vim\%((\a\+)\)\=:E480/ - call netrw#ErrorMsg(s:WARNING,'no files matched pattern<'.pattern.'>',45) + call netrw#ErrorMsg(s:WARNING,'no files matched pattern<'.pattern.'>',45) if &hls | let keepregslash= s:ExplorePatHls(pattern) | endif silent! let @* = keepregstar silent! let @+ = keepregstar @@ -3503,7 +3719,7 @@ fun! netrw#Explore(indx,dosplit,style,...) endif else -" call Decho("case Explore newdir<".dirname.">") +" call Decho("default case: Explore newdir<".dirname.">") if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && dirname =~ '/' silent! unlet w:netrw_treedict silent! unlet w:netrw_treetop @@ -3515,10 +3731,11 @@ fun! netrw#Explore(indx,dosplit,style,...) call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,newdir)) endif endif +" call FOTEST(5) " visual display of **/ **// */ Exploration files -" call Decho("w:netrw_explore_indx=".w:netrw_explore_indx) -" call Decho("b:netrw_curdir<".b:netrw_curdir.">") +" call Decho("w:netrw_explore_indx=".(exists("w:netrw_explore_indx")? w:netrw_explore_indx : "doesn't exist")) +" call Decho("b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "n/a").">") if exists("w:netrw_explore_indx") && exists("b:netrw_curdir") " call Decho("s:explore_prvdir<".(exists("s:explore_prvdir")? s:explore_prvdir : "-doesn't exist-")) if !exists("s:explore_prvdir") || s:explore_prvdir != b:netrw_curdir @@ -3559,6 +3776,7 @@ fun! netrw#Explore(indx,dosplit,style,...) echo " " " call Decho("cleared explore match list") endif +" call FOTEST(6) silent! let @* = keepregstar silent! let @+ = keepregstar @@ -3567,26 +3785,6 @@ fun! netrw#Explore(indx,dosplit,style,...) endfun " --------------------------------------------------------------------- -" s:NetrwClearExplore: clear explore variables (if any) {{{2 -fun! s:NetrwClearExplore() -" call Dfunc("s:NetrwClearExplore()") - 2match none - if exists("s:explore_match") |unlet s:explore_match |endif - if exists("s:explore_indx") |unlet s:explore_indx |endif - if exists("s:netrw_explore_prvdir") |unlet s:netrw_explore_prvdir |endif - if exists("s:dirstarstar") |unlet s:dirstarstar |endif - if exists("s:explore_prvdir") |unlet s:explore_prvdir |endif - if exists("w:netrw_explore_indx") |unlet w:netrw_explore_indx |endif - if exists("w:netrw_explore_listlen")|unlet w:netrw_explore_listlen|endif - if exists("w:netrw_explore_list") |unlet w:netrw_explore_list |endif - if exists("w:netrw_explore_bufnr") |unlet w:netrw_explore_bufnr |endif -" redraw! - echo " " - echo " " -" call Dret("s:NetrwClearExplore") -endfun - -" --------------------------------------------------------------------- " s:NetrwExploreListUniq: {{{2 fun! s:NetrwExploreListUniq(explist) " call Dfunc("s:NetrwExploreListUniq(explist)") @@ -3683,7 +3881,6 @@ endfun " --------------------------------------------------------------------- " s:NetrwHome: this function determines a "home" for saving bookmarks and history {{{2 fun! s:NetrwHome() -" call Dfunc("s:NetrwHome()") if exists("g:netrw_home") let home= g:netrw_home else @@ -3698,7 +3895,6 @@ fun! s:NetrwHome() endfor if home == "" " just pick the first directory -" call Decho("just pick first directory in &rtp") let home= substitute(&rtp,',.*$','','') endif if (has("win32") || has("win95") || has("win64") || has("win16")) @@ -3706,19 +3902,14 @@ fun! s:NetrwHome() endif endif " insure that the home directory exists -" call Decho("picked home<".home.">") if !isdirectory(home) if exists("g:netrw_mkdir") -" call Decho("home<".home."> isn't a directory -- making it now with g:netrw_mkdir<".g:netrw_mkdir.">") -" call Decho("system(".g:netrw_mkdir." ".s:Escape(home).")") - call system(g:netrw_mkdir." ".s:Escape(home)) + call system(g:netrw_mkdir." ".shellescape(home)) else -" call Decho("home<".home."> isn't a directory -- making it now with mkdir()") call mkdir(home) endif endif let g:netrw_home= home -" call Dret("s:NetrwHome <".home.">") return home endfun @@ -3937,6 +4128,7 @@ fun! s:NetrwMarkFile(islocal,fname) " call Dfunc("s:NetrwMarkFile(islocal=".a:islocal." fname<".a:fname.">)") let curbufnr= bufnr("%") let curdir = b:netrw_curdir + let trailer = '[@=|\/\*]\=\>' if exists("s:netrwmarkfilelist_{curbufnr}") " markfile list exists " call Decho("starting s:netrwmarkfilelist_{curbufnr}<".string(s:netrwmarkfilelist_{curbufnr}).">") @@ -3947,7 +4139,7 @@ fun! s:NetrwMarkFile(islocal,fname) " append filename to buffer's markfilelist " call Decho("append filename<".a:fname."> to local markfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}).">") call add(s:netrwmarkfilelist_{curbufnr},a:fname) - let s:netrwmarkfilemtch_{curbufnr}= s:netrwmarkfilemtch_{curbufnr}.'\|\<'.escape(a:fname,g:netrw_markfileesc."'".g:netrw_markfileesc."'").'\>' + let s:netrwmarkfilemtch_{curbufnr}= s:netrwmarkfilemtch_{curbufnr}.'\|\<'.escape(a:fname,g:netrw_markfileesc."'".g:netrw_markfileesc."'").trailer else " remove filename from buffer's markfilelist @@ -3964,9 +4156,9 @@ fun! s:NetrwMarkFile(islocal,fname) let first = 1 for fname in s:netrwmarkfilelist_{curbufnr} if first - let s:netrwmarkfilemtch_{curbufnr}= s:netrwmarkfilemtch_{curbufnr}.'\<'.escape(fname,g:netrw_markfileesc."'".g:netrw_markfileesc."'").'\>' + let s:netrwmarkfilemtch_{curbufnr}= s:netrwmarkfilemtch_{curbufnr}.'\<'.escape(fname,g:netrw_markfileesc."'".g:netrw_markfileesc."'").trailer else - let s:netrwmarkfilemtch_{curbufnr}= s:netrwmarkfilemtch_{curbufnr}.'\|\<'.escape(fname,g:netrw_markfileesc."'".g:netrw_markfileesc."'").'\>' + let s:netrwmarkfilemtch_{curbufnr}= s:netrwmarkfilemtch_{curbufnr}.'\|\<'.escape(fname,g:netrw_markfileesc."'".g:netrw_markfileesc."'").trailer endif let first= 0 endfor @@ -3987,7 +4179,7 @@ fun! s:NetrwMarkFile(islocal,fname) if a:fname =~ '/$' let s:netrwmarkfilemtch_{curbufnr}= '\<'.escape(a:fname,g:netrw_markfileesc) else - let s:netrwmarkfilemtch_{curbufnr}= '\<'.escape(a:fname,g:netrw_markfileesc).'\>' + let s:netrwmarkfilemtch_{curbufnr}= '\<'.escape(a:fname,g:netrw_markfileesc).trailer endif " call Decho("ending s:netrwmarkfilemtch_".curbufnr."<".s:netrwmarkfilemtch_{curbufnr}.">") endif @@ -4018,7 +4210,9 @@ fun! s:NetrwMarkFile(islocal,fname) " set up 2match'ing to netrwmarkfilemtch list if exists("s:netrwmarkfilemtch_{curbufnr}") && s:netrwmarkfilemtch_{curbufnr} != "" " call Decho("exe 2match netrwMarkFile /".s:netrwmarkfilemtch_{curbufnr}."/") - exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{curbufnr}."/" + if exists("g:did_drchip_netrwlist_syntax") + exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{curbufnr}."/" + endif else " call Decho("2match none") 2match none @@ -4046,7 +4240,7 @@ fun! s:NetrwMarkFileCompress(islocal) for sfx in sort(keys(g:netrw_decompress)) if fname =~ '\'.sfx.'$' " fname has a suffix indicating that its compressed; apply associated decompression routine - let exe= s:WinPath(g:netrw_decompress[sfx]) + let exe= netrw#WinPath(g:netrw_decompress[sfx]) " call Decho("fname<".fname."> is compressed so decompress with <".exe.">") if a:islocal if g:netrw_keepdir @@ -4071,10 +4265,10 @@ fun! s:NetrwMarkFileCompress(islocal) unlet exe elseif a:islocal " fname not a compressed file, so compress it - call system(s:WinPath(g:netrw_compress)." ".shellescape(s:ComposePath(b:netrw_curdir,fname))) + call system(netrw#WinPath(g:netrw_compress)." ".shellescape(s:ComposePath(b:netrw_curdir,fname))) else " fname not a compressed file, so compress it - call s:RemoteSystem(s:WinPath(g:netrw_compress)." ".shellescape(fname)) + call s:RemoteSystem(netrw#WinPath(g:netrw_compress)." ".shellescape(fname)) endif endfor call s:NetrwUnmarkList(curbufnr,curdir) @@ -4115,7 +4309,7 @@ fun! s:NetrwMarkFileCopy(islocal) " call Decho("copy from local to local") let args= join(map(deepcopy(s:netrwmarkfilelist_{bufnr('%')}),"shellescape(b:netrw_curdir.\"/\".v:val)")) " call Decho("system(".g:netrw_localcopycmd." ".args." ".shellescape(s:netrwmftgt).")") - call system(s:WinPath(g:netrw_localcopycmd)." ".args." ".shellescape(s:netrwmftgt)) + call system(netrw#WinPath(g:netrw_localcopycmd)." ".args." ".shellescape(s:netrwmftgt)) elseif a:islocal && !s:netrwmftgt_islocal " Copy marked files, local directory to remote directory @@ -4254,10 +4448,10 @@ fun! s:NetrwMarkFileExe(islocal) for fname in s:netrwmarkfilelist_{curbufnr} if a:islocal if g:netrw_keepdir - let fname= shellescape(s:WinPath(s:ComposePath(curdir,fname))) + let fname= shellescape(netrw#WinPath(s:ComposePath(curdir,fname))) endif else - let fname= shellescape(s:WinPath(b:netrw_curdir.fname)) + let fname= shellescape(netrw#WinPath(b:netrw_curdir.fname)) endif if cmd =~ '%' let xcmd= substitute(cmd,'%',fname,'g') @@ -4375,7 +4569,13 @@ fun! s:NetrwMarkFileGrep(islocal) " use vimgrep for both local and remote " call Decho("exe vimgrep".pat." ".netrwmarkfilelist) - exe "vimgrep".pat." ".netrwmarkfilelist + try + exe "noautocmd vimgrep".pat." ".netrwmarkfilelist + catch /^Vim\%((\a\+)\)\=:E480/ + call netrw#ErrorMsg(s:WARNING,"no match with pattern<".pattern.">",76) +" call Dret("s:NetrwMarkFileGrep : unable to find pattern<".pattern.">") + return + endtry 2match none call netrw#NetrwRestorePosn(svpos) @@ -4534,24 +4734,15 @@ fun! s:NetrwMarkFileRegexp(islocal) " get the matching list of files using local glob() " call Decho("handle local regexp") let dirname = escape(b:netrw_curdir,g:netrw_glob_escape) - let filelist = glob(s:ComposePath(dirname,regexp)) - if filelist != "" - let filelist= filelist."\n" - endif + let files = glob(s:ComposePath(dirname,regexp)) +" call Decho("files<".files.">") + let filelist= split(files,"\n") " mark the list of files - while filelist != "" - if filelist =~ '\n' - let filename = substitute(filelist,'\n.*$','','e') - let filelist = substitute(filelist,'^.\{-}\n\(.*\)$','\1','e') - else - let filename = filelist - let filelist = "" - endif -" call Decho("filelist<".filelist.">") -" call Decho("filename<".filename.">") - call s:NetrwMarkFile(a:islocal,substitute(filename,'^.*/','','')) - endwhile + for fname in filelist +" call Decho("fname<".fname.">") + call s:NetrwMarkFile(a:islocal,substitute(fname,'^.*/','','')) + endfor else " call Decho("handle remote regexp") @@ -4873,8 +5064,8 @@ fun! s:NetrwMenu(domenu) exe 'silent! menu '.g:NetrwMenuPriority.'.12.1 '.g:NetrwTopLvlMenu.'Explore.Directory\ Name :Explore ' exe 'silent! menu '.g:NetrwMenuPriority.'.12.2 '.g:NetrwTopLvlMenu.'Explore.Filenames\ Matching\ Pattern\ (curdir\ only):Explore\ */ :Explore */' exe 'silent! menu '.g:NetrwMenuPriority.'.12.2 '.g:NetrwTopLvlMenu.'Explore.Filenames\ Matching\ Pattern\ (+subdirs):Explore\ **/ :Explore **/' - exe 'silent! menu '.g:NetrwMenuPriority.'.12.3 '.g:NetrwTopLvlMenu.'Explore.Files\ Containing\ Pattern\ (curdir\ only):Explore\ *// :Explore *//' - exe 'silent! menu '.g:NetrwMenuPriority.'.12.4 '.g:NetrwTopLvlMenu.'Explore.Files\ Containing\ Pattern\ (+subdirs):Explore\ **// :Explore **//' + exe 'silent! menu '.g:NetrwMenuPriority.'.12.3 '.g:NetrwTopLvlMenu.'Explore.Files\ Containing\ String\ Pattern\ (curdir\ only):Explore\ *// :Explore *//' + exe 'silent! menu '.g:NetrwMenuPriority.'.12.4 '.g:NetrwTopLvlMenu.'Explore.Files\ Containing\ String\ Pattern\ (+subdirs):Explore\ **// :Explore **//' exe 'silent! menu '.g:NetrwMenuPriority.'.12.4 '.g:NetrwTopLvlMenu.'Explore.Next\ Match:Nexplore :Nexplore' exe 'silent! menu '.g:NetrwMenuPriority.'.12.4 '.g:NetrwTopLvlMenu.'Explore.Prev\ Match:Pexplore :Pexplore' exe 'silent! menu '.g:NetrwMenuPriority.'.13 '.g:NetrwTopLvlMenu.'Make\ Subdirectoryd d' @@ -5194,8 +5385,8 @@ fun! s:NetrwPrevWinOpen(islocal) let &ei= eikeep " call Decho("bnr=".bnr." bnrcnt=".bnrcnt." buftype=".&bt." winnr#".winnr()) if bnrcnt == 1 - let bufname= bufname(winbufnr(winnr())) - let choice= confirm("Save modified file<".bufname.">?","&Yes\n&No\n&Cancel") + let bufname = bufname(winbufnr(winnr())) + let choice = confirm("Save modified file<".bufname.">?","&Yes\n&No\n&Cancel") " call Decho("bufname<".bufname."> choice=".choice." winnr#".winnr()) if choice == 1 @@ -5948,13 +6139,18 @@ fun! s:PerformListing(islocal) call s:NetrwBookHistHandler(3,b:netrw_curdir) " Set up the banner {{{3 -" call Decho("set up banner") - keepjumps put ='\" ============================================================================' - keepjumps put ='\" Netrw Directory Listing (netrw '.g:loaded_netrw.')' - keepjumps put ='\" '.b:netrw_curdir - keepjumps 1d - let w:netrw_bannercnt= 3 - exe "keepjumps ".w:netrw_bannercnt + if g:netrw_banner +" call Decho("set up banner") + keepjumps put ='\" ============================================================================' + keepjumps put ='\" Netrw Directory Listing (netrw '.g:loaded_netrw.')' + keepjumps put ='\" '.b:netrw_curdir + keepjumps 1d + let w:netrw_bannercnt= 3 + exe "keepjumps ".w:netrw_bannercnt + else + keepjumps 1 + let w:netrw_bannercnt= 1 + endif let sortby= g:netrw_sort_by if g:netrw_sort_direction =~ "^r" @@ -5962,55 +6158,63 @@ fun! s:PerformListing(islocal) endif " Sorted by... {{{3 -" call Decho("handle specified sorting: g:netrw_sort_by<".g:netrw_sort_by.">") - if g:netrw_sort_by =~ "^n" + if g:netrw_banner +" call Decho("handle specified sorting: g:netrw_sort_by<".g:netrw_sort_by.">") + if g:netrw_sort_by =~ "^n" " call Decho("directories will be sorted by name") - " sorted by name - keepjumps put ='\" Sorted by '.sortby - keepjumps put ='\" Sort sequence: '.g:netrw_sort_sequence - let w:netrw_bannercnt= w:netrw_bannercnt + 2 - else + " sorted by name + keepjumps put ='\" Sorted by '.sortby + keepjumps put ='\" Sort sequence: '.g:netrw_sort_sequence + let w:netrw_bannercnt= w:netrw_bannercnt + 2 + else " call Decho("directories will be sorted by size or time") - " sorted by size or date - keepjumps put ='\" Sorted by '.sortby - let w:netrw_bannercnt= w:netrw_bannercnt + 1 + " sorted by size or date + keepjumps put ='\" Sorted by '.sortby + let w:netrw_bannercnt= w:netrw_bannercnt + 1 + endif + exe "keepjumps ".w:netrw_bannercnt endif - exe "keepjumps ".w:netrw_bannercnt " show copy/move target, if any - if exists("s:netrwmftgt") && exists("s:netrwmftgt_islocal") -" call Decho("show copy/move target<".s:netrwmftgt.">") - keepjumps put ='' - if s:netrwmftgt_islocal - call setline(line("."),'" Copy/Move Tgt: '.s:netrwmftgt.' (local)') + if g:netrw_banner + if exists("s:netrwmftgt") && exists("s:netrwmftgt_islocal") +" call Decho("show copy/move target<".s:netrwmftgt.">") + keepjumps put ='' + if s:netrwmftgt_islocal + call setline(line("."),'" Copy/Move Tgt: '.s:netrwmftgt.' (local)') + else + call setline(line("."),'" Copy/Move Tgt: '.s:netrwmftgt.' (remote)') + endif + let w:netrw_bannercnt= w:netrw_bannercnt + 1 else - call setline(line("."),'" Copy/Move Tgt: '.s:netrwmftgt.' (remote)') +" call Decho("s:netrwmftgt does not exist, don't make Copy/Move Tgt") endif - let w:netrw_bannercnt= w:netrw_bannercnt + 1 - else -" call Decho("s:netrwmftgt does not exist, don't make Copy/Move Tgt") + exe "keepjumps ".w:netrw_bannercnt endif - exe "keepjumps ".w:netrw_bannercnt " Hiding... -or- Showing... {{{3 -" call Decho("handle hiding/showing (g:netrw_hide=".g:netrw_list_hide." g:netrw_list_hide<".g:netrw_list_hide.">)") - if g:netrw_list_hide != "" && g:netrw_hide - if g:netrw_hide == 1 - keepjumps put ='\" Hiding: '.g:netrw_list_hide - else - keepjumps put ='\" Showing: '.g:netrw_list_hide + if g:netrw_banner +" call Decho("handle hiding/showing (g:netrw_hide=".g:netrw_list_hide." g:netrw_list_hide<".g:netrw_list_hide.">)") + if g:netrw_list_hide != "" && g:netrw_hide + if g:netrw_hide == 1 + keepjumps put ='\" Hiding: '.g:netrw_list_hide + else + keepjumps put ='\" Showing: '.g:netrw_list_hide + endif + let w:netrw_bannercnt= w:netrw_bannercnt + 1 endif - let w:netrw_bannercnt= w:netrw_bannercnt + 1 + exe "keepjumps ".w:netrw_bannercnt + keepjumps put ='\" Quick Help: :help -:go up dir D:delete R:rename s:sort-by x:exec' + keepjumps put ='\" ============================================================================' + let w:netrw_bannercnt= w:netrw_bannercnt + 2 endif - exe "keepjumps ".w:netrw_bannercnt - keepjumps put ='\" Quick Help: :help -:go up dir D:delete R:rename s:sort-by x:exec' - keepjumps put ='\" ============================================================================' - let w:netrw_bannercnt= w:netrw_bannercnt + 2 " bannercnt should index the line just after the banner - let w:netrw_bannercnt= w:netrw_bannercnt + 1 - exe "keepjumps ".w:netrw_bannercnt -" call Decho("bannercnt=".w:netrw_bannercnt." (should index line just after banner) line($)=".line("$")) + if g:netrw_banner + let w:netrw_bannercnt= w:netrw_bannercnt + 1 + exe "keepjumps ".w:netrw_bannercnt +" call Decho("bannercnt=".w:netrw_bannercnt." (should index line just after banner) line($)=".line("$")) + endif " set up syntax highlighting {{{3 " call Decho("set up syntax highlighting") @@ -6028,23 +6232,23 @@ fun! s:PerformListing(islocal) else " remote call s:NetrwRemoteListing() endif -" call Decho("w:netrw_bannercnt=".w:netrw_bannercnt." (banner complete)") +" call Decho("g:netrw_banner=".g:netrw_banner." w:netrw_bannercnt=".w:netrw_bannercnt." (banner complete)") " manipulate the directory listing (hide, sort) {{{3 - if line("$") >= w:netrw_bannercnt + if !g:netrw_banner || line("$") >= w:netrw_bannercnt " call Decho("manipulate directory listing (hide)") " call Decho("g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">") if g:netrw_hide && g:netrw_list_hide != "" call s:NetrwListHide() endif - if line("$") >= w:netrw_bannercnt + if !g:netrw_banner || line("$") >= w:netrw_bannercnt " call Decho("manipulate directory listing (sort) : g:netrw_sort_by<".g:netrw_sort_by.">") if g:netrw_sort_by =~ "^n" " sort by name call s:NetrwSetSort() - if w:netrw_bannercnt < line("$") + if !g:netrw_banner || w:netrw_bannercnt < line("$") " call Decho("g:netrw_sort_direction=".g:netrw_sort_direction." (bannercnt=".w:netrw_bannercnt.")") if g:netrw_sort_direction =~ 'n' " normal direction sorting @@ -6060,7 +6264,7 @@ fun! s:PerformListing(islocal) call histdel("/",-1) elseif a:islocal - if w:netrw_bannercnt < line("$") + if !g:netrw_banner || w:netrw_bannercnt < line("$") " call Decho("g:netrw_sort_direction=".g:netrw_sort_direction) if g:netrw_sort_direction =~ 'n' " call Decho('exe silent keepjumps '.w:netrw_bannercnt.',$sort') @@ -6076,7 +6280,7 @@ fun! s:PerformListing(islocal) elseif g:netrw_sort_direction =~ 'r' " call Decho('reverse the sorted listing') - if w:netrw_bannercnt < line('$') + if !g:netrw_banner || w:netrw_bannercnt < line('$') exe 'silent keepjumps '.w:netrw_bannercnt.',$g/^/m '.w:netrw_bannercnt call histdel("/",-1) endif @@ -6088,7 +6292,7 @@ fun! s:PerformListing(islocal) call s:NetrwWideListing() call s:NetrwTreeListing(b:netrw_curdir) - if exists("w:netrw_bannercnt") && line("$") > w:netrw_bannercnt + if exists("w:netrw_bannercnt") && (line("$") > w:netrw_bannercnt || !g:netrw_banner) " place cursor on the top-left corner of the file listing " call Decho("place cursor on top-left corner of file listing") exe 'silent keepjumps '.w:netrw_bannercnt @@ -6475,14 +6679,14 @@ fun! s:NetrwRemoteRmFile(path,rmfile,all) call s:NetrwRemoteFtpCmd(a:path,"rmdir ".a:rmfile) else let rmfile = substitute(a:path.a:rmfile,'/$','','') - let netrw_rmdir_cmd = s:MakeSshCmd(s:WinPath(g:netrw_rmdir_cmd)).' '.shellescape(s:WinPath(rmfile)) + let netrw_rmdir_cmd = s:MakeSshCmd(netrw#WinPath(g:netrw_rmdir_cmd)).' '.shellescape(netrw#WinPath(rmfile)) " call Decho("attempt to remove dir: system(".netrw_rmdir_cmd.")") let ret= system(netrw_rmdir_cmd) " call Decho("returned=".ret." errcode=".v:shell_error) if v:shell_error != 0 " call Decho("v:shell_error not 0") - let netrw_rmf_cmd= s:MakeSshCmd(s:WinPath(g:netrw_rmf_cmd)).' '.shellescape(s:WinPath(substitute(rmfile,'[\/]$','','e'))) + let netrw_rmf_cmd= s:MakeSshCmd(netrw#WinPath(g:netrw_rmf_cmd)).' '.shellescape(netrw#WinPath(substitute(rmfile,'[\/]$','','e'))) " call Decho("2nd attempt to remove dir: system(".netrw_rmf_cmd.")") let ret= system(netrw_rmf_cmd) " call Decho("returned=".ret." errcode=".v:shell_error) @@ -6646,8 +6850,8 @@ fun! s:NetrwRemoteRename(usrhost,path) range else let oldname= shellescape(a:path.oldname) let newname= shellescape(a:path.newname) -" call Decho("system(s:WinPath(".rename_cmd.") ".oldname.' '.newname.")") - let ret = system(s:WinPath(rename_cmd).' '.oldname.' '.newname) +" call Decho("system(netrw#WinPath(".rename_cmd.") ".oldname.' '.newname.")") + let ret = system(netrw#WinPath(rename_cmd).' '.oldname.' '.newname) endif endfor @@ -6671,8 +6875,8 @@ fun! s:NetrwRemoteRename(usrhost,path) range else let oldname= shellescape(a:path.oldname) let newname= shellescape(a:path.newname) -" call Decho("system(s:WinPath(".rename_cmd.") ".oldname.' '.newname.")") - let ret = system(s:WinPath(rename_cmd).' '.oldname.' '.newname) +" call Decho("system(netrw#WinPath(".rename_cmd.") ".oldname.' '.newname.")") + let ret = system(netrw#WinPath(rename_cmd).' '.oldname.' '.newname) endif let ctr= ctr + 1 @@ -6876,6 +7080,7 @@ fun! s:LocalListing() endwhile " cleanup any windows mess at end-of-line + silent! keepjumps g/^$/d silent! keepjumps %s/\r$//e call histdel("/",-1) exe "setlocal ts=".g:netrw_maxfilenamelen @@ -7061,8 +7266,8 @@ fun! s:NetrwLocalRmFile(path,fname,all) let rmfile= substitute(rmfile,'[\/]$','','e') if all || ok =~ 'y\%[es]' || ok == "" -" call Decho("1st attempt: system(s:WinPath(".g:netrw_local_rmdir.') '.shellescape(rmfile).')') - call system(s:WinPath(g:netrw_local_rmdir).' '.shellescape(rmfile)) +" call Decho("1st attempt: system(netrw#WinPath(".g:netrw_local_rmdir.') '.shellescape(rmfile).')') + call system(netrw#WinPath(g:netrw_local_rmdir).' '.shellescape(rmfile)) " call Decho("v:shell_error=".v:shell_error) if v:shell_error != 0 @@ -7230,7 +7435,7 @@ endfun " 0=note = s:NOTE " 1=warning = s:WARNING " 2=error = s:ERROR -" Oct 12, 2008 : max errnum currently is 73 +" Dec 03, 2009 : max errnum currently is 76 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) @@ -7348,6 +7553,7 @@ fun! netrw#NetrwSavePosn() let w:netrw_winnr= winnr() let w:netrw_line = line(".") let w:netrw_col = virtcol(".") +" call Decho("currently, win#".w:netrw_winnr." line#".w:netrw_line." col#".w:netrw_col) " Save top-of-screen line norm! H0 @@ -7388,6 +7594,14 @@ fun! s:ComposePath(base,subdir) " call Decho("windows") let ret= a:subdir + elseif a:base =~ '^\a:[/\\][^/\\]' && (has("win32") || has("win95") || has("win64") || has("win16")) +" call Decho("windows") + if a:base =~ '[/\\]$' + let ret= a:base.a:subdir + else + let ret= a:base."/".a:subdir + endif + elseif a:base =~ '^\a\+://' " call Decho("remote linux/macos") let urlbase = substitute(a:base,'^\(\a\+://.\{-}/\)\(.*\)$','\1','') @@ -7548,7 +7762,7 @@ endfun fun! s:NetrwDelete(path) " call Dfunc("s:NetrwDelete(path<".a:path.">)") - let path = s:WinPath(a:path) + let path = netrw#WinPath(a:path) if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16")) if exists("+shellslash") let sskeep= &shellslash @@ -7958,7 +8172,7 @@ endfun " Buffers.Refresh; hence, s:NetrwBMShow() utilizes a "cheat" to call that function anyway. fun! s:UpdateBuffersMenu() " call Dfunc("s:UpdateBuffersMenu()") - if has("gui") && has("menu") && has("gui_running") && &go =~ 'm' + if has("gui") && has("menu") && has("gui_running") && &go =~ 'm' && g:netrw_menu try silent emenu Buffers.Refresh\ menu catch /^Vim\%((\a\+)\)\=:E/ @@ -7988,9 +8202,9 @@ fun! s:UseBufWinVars() endfun " --------------------------------------------------------------------- -" s:WinPath: tries to insure that the path is windows-acceptable, whether cygwin is used or not {{{2 -fun! s:WinPath(path) -" call Dfunc("s:WinPath(path<".a:path.">)") +" 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 !~ '\%(\\|\\)\%(\.exe\)\=$') && (has("win32") || has("win95") || has("win64") || has("win16")) " remove cygdrive prefix, if present let path = substitute(a:path,'/cygdrive/\(.\)','\1:','') @@ -8003,7 +8217,7 @@ fun! s:WinPath(path) else let path= a:path endif -" call Dret("s:WinPath <".path.">") +" call Dret("netrw#WinPath <".path.">") return path endfun diff --git a/runtime/autoload/tar.vim b/runtime/autoload/tar.vim index af6fbca2..3e44579c 100644 --- a/runtime/autoload/tar.vim +++ b/runtime/autoload/tar.vim @@ -1,13 +1,13 @@ " tar.vim: Handles browsing tarfiles " AUTOLOAD PORTION -" Date: Aug 08, 2008 -" Version: 23 + modifications by Bram +" Date: Dec 28, 2009 +" Version: 24 " Maintainer: Charles E Campbell, Jr " License: Vim License (see vim's :help license) " " Contains many ideas from Michael Toren's " -" Copyright: Copyright (C) 2005-2008 Charles E. Campbell, Jr. {{{1 +" Copyright: Copyright (C) 2005-2009 Charles E. Campbell, Jr. {{{1 " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright " notice is copied with it. Like anything else that's free, @@ -16,19 +16,22 @@ " By using this plugin, you agree that in no event will the " copyright holder be liable for any damages resulting from " the use of this software. - +" call inputsave()|call input("Press to continue")|call inputrestore() " --------------------------------------------------------------------- " Load Once: {{{1 -let s:keepcpo= &cpo -set cpo&vim -if &cp || exists("g:loaded_tar") || v:version < 700 +if &cp || exists("g:loaded_tar") finish endif -let g:loaded_tar= "v23b" -"call Decho("loading autoload/tar.vim") -if v:version < 701 || (v:version == 701 && !has("patch299")) - echoerr "(autoload/tar.vim) need vim v7.1 with patchlevel 299" +let g:loaded_tar= "v24" +if v:version < 702 + echohl WarningMsg + echo "***warning*** this version of tar needs vim 7.2" + echohl Normal + finish endif +let s:keepcpo= &cpo +set cpo&vim +"call Decho("loading autoload/tar.vim") " --------------------------------------------------------------------- " Default Settings: {{{1 @@ -44,7 +47,22 @@ endif if !exists("g:tar_writeoptions") let g:tar_writeoptions= "uf" endif - +if !exists("g:tar_copycmd") + if !exists("g:netrw_localcopycmd") + if has("win32") || has("win95") || has("win64") || has("win16") + if g:netrw_cygwin + let g:netrw_localcopycmd= "cp" + else + let g:netrw_localcopycmd= "copy" + endif + elseif has("unix") || has("macunix") + let g:netrw_localcopycmd= "cp" + else + let g:netrw_localcopycmd= "" + endif + endif + let g:tar_copycmd= g:netrw_localcopycmd +endif if !exists("g:netrw_cygwin") if has("win32") || has("win95") || has("win64") || has("win16") if &shell =~ '\%(\\|\\)\%(\.exe\)\=$' @@ -56,6 +74,9 @@ if !exists("g:netrw_cygwin") let g:netrw_cygwin= 0 endif endif +if !exists("g:tar_extractcmd") + let g:tar_extractcmd= "tar -xf" +endif " set up shell quoting character if !exists("g:tar_shq") @@ -88,7 +109,6 @@ fun! tar#Browse(tarfile) if !executable(g:tar_cmd) redraw! echohl Error | echo '***error*** (tar#Browse) "'.g:tar_cmd.'" not available on your system' -" call inputsave()|call input("Press to continue")|call inputrestore() let &report= repkeep " call Dret("tar#Browse") return @@ -99,7 +119,6 @@ fun! tar#Browse(tarfile) " if its an url, don't complain, let url-handlers such as vim do its thing redraw! echohl Error | echo "***error*** (tar#Browse) File not readable<".a:tarfile.">" | echohl None -" call inputsave()|call input("Press to continue")|call inputrestore() endif let &report= repkeep " call Dret("tar#Browse : file<".a:tarfile."> not readable") @@ -130,37 +149,38 @@ fun! tar#Browse(tarfile) let tarfile= a:tarfile if has("win32") && executable("cygpath") " assuming cygwin - let tarfile=substitute(system("cygpath -u ".s:Escape(tarfile,0)),'\n$','','e') + let tarfile=substitute(system("cygpath -u ".shellescape(tarfile,0)),'\n$','','e') endif let curlast= line("$") if tarfile =~# '\.\(gz\|tgz\)$' -" call Decho("1: exe silent r! gzip -d -c -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") - exe "silent r! gzip -d -c -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " +" call Decho("1: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") + exe "silent r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " elseif tarfile =~# '\.lrp' -" call Decho("2: exe silent r! cat -- ".s:Escape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - ") - exe "silent r! cat -- ".s:Escape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - " +" call Decho("2: exe silent r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - ") + exe "silent r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - " elseif tarfile =~# '\.bz2$' -" call Decho("3: exe silent r! bzip2 -d -c -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") - exe "silent r! bzip2 -d -c -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " +" call Decho("3: exe silent r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") + exe "silent r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " + elseif tarfile =~# '\.lzma$' +" call Decho("3: exe silent r! lzma -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") + exe "silent r! lzma -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " else if tarfile =~ '^\s*-' - " A file name starting with a dash may be taken as an option. Prepend ./ to avoid that. + " A file name starting with a dash is taken as an option. Prepend ./ to avoid that. let tarfile = substitute(tarfile, '-', './-', '') endif -" call Decho("4: exe silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".s:Escape(tarfile,1)) - exe "silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".s:Escape(tarfile,1) +" call Decho("4: exe silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".shellescape(tarfile,0)) + exe "silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".shellescape(tarfile,1) endif if v:shell_error != 0 redraw! echohl WarningMsg | echo "***warning*** (tar#Browse) please check your g:tar_browseoptions<".g:tar_browseoptions.">" -" call inputsave()|call input("Press to continue")|call inputrestore() " call Dret("tar#Browse : a:tarfile<".a:tarfile.">") return endif if line("$") == curlast || ( line("$") == (curlast + 1) && getline("$") =~ '\c\%(warning\|error\|inappropriate\|unrecognized\)') redraw! echohl WarningMsg | echo "***warning*** (tar#Browse) ".a:tarfile." doesn't appear to be a tar file" | echohl None -" call inputsave()|call input("Press to continue")|call inputrestore() silent %d let eikeep= &ei set ei=BufReadCmd,FileReadCmd @@ -189,7 +209,7 @@ fun! s:TarBrowseSelect() if !exists("g:tar_secure") && fname =~ '^\s*-\|\s\+-' redraw! - echohl WarningMsg | echo '***error*** (tar#BrowseSelect) rejecting tarfile member<'.fname.'> because of embedded "-"; See :help tar-options' + echohl WarningMsg | echo '***warning*** (tar#BrowseSelect) rejecting tarfile member<'.fname.'> because of embedded "-"' " call Dret('tar#BrowseSelect : rejecting tarfile member<'.fname.'> because of embedded "-"') return endif @@ -206,7 +226,7 @@ fun! s:TarBrowseSelect() let curfile= expand("%") if has("win32") && executable("cygpath") " assuming cygwin - let tarfile=substitute(system("cygpath -u ".s:Escape(tarfile,0)),'\n$','','e') + let tarfile=substitute(system("cygpath -u ".shellescape(tarfile,0)),'\n$','','e') endif new @@ -231,21 +251,24 @@ fun! tar#Read(fname,mode) let fname = substitute(a:fname,'tarfile:.\{-}::\(.*\)$','\1','') if has("win32") && executable("cygpath") " assuming cygwin - let tarfile=substitute(system("cygpath -u ".s:Escape(tarfile,0)),'\n$','','e') + let tarfile=substitute(system("cygpath -u ".shellescape(tarfile,0)),'\n$','','e') endif " call Decho("tarfile<".tarfile.">") " call Decho("fname<".fname.">") - if fname =~ '\.gz$' && executable("zcat") + if fname =~ '\.bz2$' && executable("bzcat") + let decmp= "|bzcat" + let doro = 1 + elseif fname =~ '\.gz$' && executable("zcat") let decmp= "|zcat" let doro = 1 - elseif fname =~ '\.bz2$' && executable("bzcat") - let decmp= "|bzcat" + elseif fname =~ '\.lzma$' && executable("lzcat") + let decmp= "|lzcat" let doro = 1 else let decmp="" let doro = 0 - if fname =~ '\.gz$\|\.bz2$\|\.Z$\|\.zip$' + if fname =~ '\.bz2$\|\.gz$\|\.lzma$\|\.zip$\|\.Z$' setlocal bin endif endif @@ -255,22 +278,25 @@ fun! tar#Read(fname,mode) else let tar_secure= " " endif - if tarfile =~# '\.\(gz\|tgz\)$' -" call Decho("5: exe silent r! gzip -d -c -- ".s:Escape(tarfile,1)."| ".g:tar_cmd.' -'.g:tar_readoptions.' - '.tar_secure.s:Escape(fname,1)) - exe "silent r! gzip -d -c -- ".s:Escape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp + if tarfile =~# '\.bz2$' +" call Decho("7: exe silent r! bzip2 -d -c ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) + exe "silent r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + elseif tarfile =~# '\.\(gz\|tgz\)$' +" call Decho("5: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd.' -'.g:tar_readoptions.' - '.tar_secure.shellescape(fname,1)) + exe "silent r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp elseif tarfile =~# '\.lrp$' -" call Decho("6: exe silent r! cat ".s:Escape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp) - exe "silent r! cat -- ".s:Escape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp - elseif tarfile =~# '\.bz2$' -" call Decho("7: exe silent r! bzip2 -d -c ".s:Escape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp) - exe "silent r! bzip2 -d -c -- ".s:Escape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp +" call Decho("6: exe silent r! cat ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) + exe "silent r! cat -- ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + elseif tarfile =~# '\.lzma$' +" call Decho("7: exe silent r! lzma -d -c ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) + exe "silent r! lzma -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp else if tarfile =~ '^\s*-' - " A file name starting with a dash may be taken as an option. Prepend ./ to avoid that. + " A file name starting with a dash is taken as an option. Prepend ./ to avoid that. let tarfile = substitute(tarfile, '-', './-', '') endif -" call Decho("8: exe silent r! ".g:tar_cmd." -".g:tar_readoptions." "s:Escape(tarfile,1).tar_secure..s:Escape(fname,1).decmp) - exe "silent r! ".g:tar_cmd." -".g:tar_readoptions." ".s:Escape(tarfile,1).tar_secure.s:Escape(fname,1).decmp +" call Decho("8: exe silent r! ".g:tar_cmd." -".g:tar_readoptions.tar_secure.shellescape(tarfile,1)." ".shellescape(fname,1).decmp) + exe "silent r! ".g:tar_cmd." -".g:tar_readoptions.shellescape(tarfile,1)." ".tar_secure.shellescape(fname,1).decmp endif if doro @@ -298,7 +324,7 @@ fun! tar#Write(fname) if !exists("g:tar_secure") && a:fname =~ '^\s*-\|\s\+-' redraw! - echohl WarningMsg | echo '***error*** (tar#Write) rejecting tarfile member<'.a:fname.'> because of embedded "-"; See :help tar-options' + echohl WarningMsg | echo '***warning*** (tar#Write) rejecting tarfile member<'.a:fname.'> because of embedded "-"' " call Dret('tar#Write : rejecting tarfile member<'.fname.'> because of embedded "-"') return endif @@ -307,7 +333,6 @@ fun! tar#Write(fname) if !executable(g:tar_cmd) redraw! echohl Error | echo '***error*** (tar#Browse) "'.g:tar_cmd.'" not available on your system' -" call inputsave()|call input("Press to continue")|call inputrestore() let &report= repkeep " call Dret("tar#Write") return @@ -315,7 +340,6 @@ fun! tar#Write(fname) if !exists("*mkdir") redraw! echohl Error | echo "***error*** (tar#Write) sorry, mkdir() doesn't work on your system" | echohl None -" call inputsave()|call input("Press to continue")|call inputrestore() let &report= repkeep " call Dret("tar#Write") return @@ -336,7 +360,6 @@ fun! tar#Write(fname) catch /^Vim\%((\a\+)\)\=:E344/ redraw! echohl Error | echo "***error*** (tar#Write) cannot cd to temporary directory" | Echohl None -" call inputsave()|call input("Press to continue")|call inputrestore() let &report= repkeep " call Dret("tar#Write") return @@ -355,29 +378,33 @@ fun! tar#Write(fname) let fname = substitute(w:tarfile,'tarfile:.\{-}::\(.*\)$','\1','') " handle compressed archives - if tarfile =~# '\.gz' - call system("gzip -d -- ".s:Escape(tarfile,0)) + if tarfile =~# '\.bz2' + call system("bzip2 -d -- ".shellescape(tarfile,0)) + let tarfile = substitute(tarfile,'\.bz2','','e') + let compress= "bzip2 -- ".shellescape(tarfile,0) +" call Decho("compress<".compress.">") + elseif tarfile =~# '\.gz' + call system("gzip -d -- ".shellescape(tarfile,0)) let tarfile = substitute(tarfile,'\.gz','','e') - let compress= "gzip -- ".s:Escape(tarfile,0) + let compress= "gzip -- ".shellescape(tarfile,0) +" call Decho("compress<".compress.">") + elseif tarfile =~# '\.lzma' + call system("lzma -d -- ".shellescape(tarfile,0)) + let tarfile = substitute(tarfile,'\.lzma','','e') + let compress= "lzma -- ".shellescape(tarfile,0) " call Decho("compress<".compress.">") elseif tarfile =~# '\.tgz' - call system("gzip -d -- ".s:Escape(tarfile,0)) + call system("gzip -d -- ".shellescape(tarfile,0)) let tarfile = substitute(tarfile,'\.tgz','.tar','e') - let compress= "gzip -- ".s:Escape(tarfile,0) + let compress= "gzip -- ".shellescape(tarfile,0) let tgz = 1 " call Decho("compress<".compress.">") - elseif tarfile =~# '\.bz2' - call system("bzip2 -d -- ".s:Escape(tarfile,0)) - let tarfile = substitute(tarfile,'\.bz2','','e') - let compress= "bzip2 -- ".s:Escape(tarfile,0) -" call Decho("compress<".compress.">") endif " call Decho("tarfile<".tarfile.">") if v:shell_error != 0 redraw! echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".tarfile." with ".fname | echohl None -" call inputsave()|call input("Press to continue")|call inputrestore() else " call Decho("tarfile<".tarfile."> fname<".fname.">") @@ -385,7 +412,7 @@ fun! tar#Write(fname) if fname =~ '/' let dirpath = substitute(fname,'/[^/]\+$','','e') if executable("cygpath") - let dirpath = substitute(system("cygpath ".s:Escape(dirpath, 0)),'\n','','e') + let dirpath = substitute(system("cygpath ".shellescape(dirpath, 0)),'\n','','e') endif call mkdir(dirpath,"p") endif @@ -405,25 +432,23 @@ fun! tar#Write(fname) endif exe "w! ".fnameescape(fname) if executable("cygpath") - let tarfile = substitute(system("cygpath ".s:Escape(tarfile,0)),'\n','','e') + let tarfile = substitute(system("cygpath ".shellescape(tarfile,0)),'\n','','e') endif " delete old file from tarfile -" call Decho("system(".g:tar_cmd." --delete -f ".s:Escape(tarfile,0)." -- ".s:Escape(fname,0).")") - call system(g:tar_cmd." --delete -f ".s:Escape(tarfile,0).tar_secure.s:Escape(fname,0)) +" call Decho("system(".g:tar_cmd." --delete -f ".shellescape(tarfile,0)." -- ".shellescape(fname,0).")") + call system(g:tar_cmd." --delete -f ".shellescape(tarfile,0).tar_secure.shellescape(fname,0)) if v:shell_error != 0 redraw! echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".fnameescape(tarfile)." with ".fnameescape(fname) | echohl None -" call inputsave()|call input("Press to continue")|call inputrestore() else " update tarfile with new file -" call Decho(g:tar_cmd." -".g:tar_writeoptions." ".s:Escape(tarfile,0).tar_secure.s:Escape(fname,0)) - call system(g:tar_cmd." -".g:tar_writeoptions." ".s:Escape(tarfile,0).tar_secure.s:Escape(fname,0)) +" call Decho(g:tar_cmd." -".g:tar_writeoptions." ".shellescape(tarfile,0).tar_secure.shellescape(fname,0)) + call system(g:tar_cmd." -".g:tar_writeoptions." ".shellescape(tarfile,0).tar_secure.shellescape(fname,0)) if v:shell_error != 0 redraw! echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".fnameescape(tarfile)." with ".fnameescape(fname) | echohl None -" call inputsave()|call input("Press to continue")|call inputrestore() elseif exists("compress") " call Decho("call system(".compress.")") call system(compress) @@ -439,13 +464,13 @@ fun! tar#Write(fname) " call Decho("handle writing <".tarfile."> across network to <".s:tblfile_{winnr()}.">") let tblfile= s:tblfile_{winnr()} 1split|enew - let binkeep= &binary + let binkeep= &l:binary let eikeep = &ei set binary ei=all exe "e! ".fnameescape(tarfile) call netrw#NetWrite(tblfile) - let &ei = eikeep - let &binary = binkeep + let &ei = eikeep + let &l:binary = binkeep q! unlet s:tblfile_{winnr()} endif @@ -462,38 +487,98 @@ fun! tar#Write(fname) endfun " --------------------------------------------------------------------- -" Rmdir: {{{2 +" s:Rmdir: {{{2 fun! s:Rmdir(fname) " call Dfunc("Rmdir(fname<".a:fname.">)") if has("unix") - call system("/bin/rm -rf -- ".s:Escape(a:fname,0)) + call system("/bin/rm -rf -- ".shellescape(a:fname,0)) elseif has("win32") || has("win95") || has("win64") || has("win16") if &shell =~? "sh$" - call system("/bin/rm -rf -- ".s:Escape(a:fname,0)) + call system("/bin/rm -rf -- ".shellescape(a:fname,0)) else - call system("del /S ".s:Escape(a:fname,0)) + call system("del /S ".shellescape(a:fname,0)) endif endif " call Dret("Rmdir") endfun " --------------------------------------------------------------------- -" s:Escape: {{{2 -fun s:Escape(name,isfilt) - " shellescape() was added by patch 7.0.111 - if exists("*shellescape") - if a:isfilt - let qnameq= shellescape(a:name,1) +" tar#Vimuntar: installs a tarball in the user's .vim / vimfiles directory {{{2 +fun! tar#Vimuntar(...) +" call Dfunc("tar#Vimuntar() a:0=".a:0." a:1<".(exists("a:1")? a:1 : "-n/a-").">") + let tarball = expand("%") +" call Decho("tarball<".tarball.">") + let tarbase = substitute(tarball,'\..*$','','') +" call Decho("tarbase<".tarbase.">") + let tarhome = expand("%:p") + if has("win32") || has("win95") || has("win64") || has("win16") + let tarhome= substitute(tarhome,'\\','/','g') + endif + let tarhome= substitute(tarhome,'/[^/]*$','','') +" call Decho("tarhome<".tarhome.">") + let tartail = expand("%:t") +" call Decho("tartail<".tartail.">") + let curdir = getcwd() +" call Decho("curdir <".curdir.">") + " set up vimhome + if a:0 > 0 && a:1 != "" + let vimhome= a:1 + else + let vimhome= vimball#VimballHome() + endif +" call Decho("vimhome<".vimhome.">") + +" call Decho("curdir<".curdir."> vimhome<".vimhome.">") + if simplify(curdir) != simplify(vimhome) + " copy (possibly compressed) tarball to .vim/vimfiles +" call Decho(netrw#WinPath(g:tar_copycmd)." ".shellescape(tartail)." ".shellescape(vimhome)) + call system(netrw#WinPath(g:tar_copycmd)." ".shellescape(tartail)." ".shellescape(vimhome)) +" call Decho("exe cd ".fnameescape(vimhome)) + exe "cd ".fnameescape(vimhome) + endif +" call Decho("getcwd<".getcwd().">") + + " if necessary, decompress the tarball; then, extract it + if tartail =~ '\.tgz' + if executable("gunzip") + silent exe "!gunzip ".shellescape(tartail) + elseif executable("gzip") + silent exe "!gzip -d ".shellescape(tartail) else - let qnameq= shellescape(a:name) + echoerr "unable to decompress<".tartail."> on this sytem" + if simplify(curdir) != simplify(tarhome) + " remove decompressed tarball, restore directory +" call Decho("delete(".tartail.".tar)") + call delete(tartail.".tar") +" call Decho("exe cd ".fnameescape(curdir)) + exe "cd ".fnameescape(curdir) + endif +" call Dret("tar#Vimuntar") + return endif else - let qnameq= g:tar_shq . a:name . g:tar_shq + call vimball#Decompress(tartail,0) endif - return qnameq + let extractcmd= netrw#WinPath(g:tar_extractcmd) +" call Decho("system(".extractcmd." ".shellescape(tarbase.".tar").")") + call system(extractcmd." ".shellescape(tarbase.".tar")) + + " set up help + if filereadable("doc/".tarbase.".txt") +" call Decho("exe helptags ".getcwd()."/doc") + exe "helptags ".getcwd()."/doc" + endif + + if simplify(tarhome) != simplify(vimhome) + " remove decompressed tarball, restore directory + call delete(vimhome."/".tarbase.".tar") + exe "cd ".fnameescape(curdir) + endif + +" call Dret("tar#Vimuntar") endfun -" --------------------------------------------------------------------- +" ===================================================================== " Modelines And Restoration: {{{1 let &cpo= s:keepcpo unlet s:keepcpo diff --git a/runtime/autoload/vimball.vim b/runtime/autoload/vimball.vim index 4f6292b9..b97c3a53 100644 --- a/runtime/autoload/vimball.vim +++ b/runtime/autoload/vimball.vim @@ -1,9 +1,9 @@ " vimball.vim : construct a file containing both paths and files " Author: Charles E. Campbell, Jr. -" Date: Jul 30, 2008 -" Version: 29 +" Date: Dec 28, 2009 +" Version: 30 " GetLatestVimScripts: 1502 1 :AutoInstall: vimball.vim -" Copyright: (c) 2004-2008 by Charles E. Campbell, Jr. +" Copyright: (c) 2004-2009 by Charles E. Campbell, Jr. " The VIM LICENSE applies to Vimball.vim, and Vimball.txt " (see |copyright|) except use "Vimball" instead of "Vim". " No warranty, express or implied. @@ -11,11 +11,17 @@ " --------------------------------------------------------------------- " Load Once: {{{1 -if &cp || exists("g:loaded_vimball") || v:version < 700 +if &cp || exists("g:loaded_vimball") finish endif -let s:keepcpo = &cpo -let g:loaded_vimball = "v29" +let g:loaded_vimball = "v30" +if v:version < 702 + echohl WarningMsg + echo "***warning*** this version of vimball needs vim 7.2" + echohl Normal + finish +endif +let s:keepcpo= &cpo set cpo&vim "DechoTabOn @@ -52,30 +58,6 @@ if !exists("s:USAGE") call vimball#ShowMesg(s:WARNING,"(vimball) g:vimball_mkdir undefined") endif endif - - " set up shell quoting character - if exists("g:vimball_shq") && !exists("g:netrw_shq") - let g:netrw_shq= g:vimball_shq - endif - if !exists("g:netrw_shq") - if exists("&shq") && &shq != "" - let g:netrw_shq= &shq - elseif has("win32") || has("win95") || has("win64") || has("win16") - if g:netrw_cygwin - let g:netrw_shq= "'" - else - let g:netrw_shq= '"' - endif - else - let g:netrw_shq= "'" - endif -" call Decho("g:netrw_shq<".g:netrw_shq.">") - endif - - " set up escape string (used to protect paths) - if !exists("g:vimball_path_escape") - let g:vimball_path_escape= ' ;#%' - endif endif " ===================================================================== @@ -106,8 +88,8 @@ fun! vimball#MkVimball(line1,line2,writelevel,...) range let vbname= vbname.'.vba' endif " call Decho("vbname<".vbname.">") - if a:1 =~ '[\/]' - call vimball#ShowMesg(s:ERROR,"(MkVimball) vimball name<".a:1."> should not include slashes") + if !a:writelevel && a:1 =~ '[\/]' + call vimball#ShowMesg(s:ERROR,"(MkVimball) vimball name<".a:1."> should not include slashes; use ! to insist") " call Dret("MkVimball : vimball name<".a:1."> should not include slashes") return endif @@ -125,7 +107,7 @@ fun! vimball#MkVimball(line1,line2,writelevel,...) range let home= expand(a:2) else " use first existing directory from rtp - let home= s:VimballHome() + let home= vimball#VimballHome() endif " save current directory @@ -218,7 +200,7 @@ fun! vimball#Vimball(really,...) return endif - if getline(1) !~ '^" Vimball Archiver by Charles E. Campbell, Jr., Ph.D.$' + if getline(1) !~ '^" Vimball Archiver' echoerr "(Vimball) The current file does not appear to be a Vimball!" " call Dret("vimball#Vimball") return @@ -240,7 +222,7 @@ fun! vimball#Vimball(really,...) if a:0 > 0 let home= expand(a:1) else - let home= s:VimballHome() + let home= vimball#VimballHome() endif " call Decho("home<".home.">") @@ -272,7 +254,9 @@ fun! vimball#Vimball(really,...) while 1 < linenr && linenr < line("$") let fname = substitute(getline(linenr),'\t\[\[\[1$','','') let fname = substitute(fname,'\\','/','g') - let fsize = getline(linenr+1)+0 +" let fsize = getline(linenr+1)+0 + let fsize = substitute(getline(linenr+1),'^\(\d\+\).\{-}$','\1','')+0 + let fenc = substitute(getline(linenr+1),'^\d\+\s*\(\S\+\)$','\1','') let filecnt = filecnt + 1 " call Decho("fname<".fname."> fsize=".fsize." filecnt=".filecnt) @@ -307,7 +291,7 @@ fun! vimball#Vimball(really,...) if !isdirectory(dirname) " call Decho("making <".dirname.">") if exists("g:vimball_mkdir") - call system(g:vimball_mkdir." ".s:Escape(dirname)) + call system(g:vimball_mkdir." ".shellescape(dirname)) else call mkdir(dirname) endif @@ -337,9 +321,13 @@ fun! vimball#Vimball(really,...) if a:really let fnamepath= home."/".fname " call Decho("exe w! ".fnameescape(fnamepath)) - exe "silent w! ".fnameescape(fnamepath) - echo "wrote ".fnamepath - call s:RecordInVar(home,"call delete('".fnameescape(fnamepath)."')") + if fenc != "" + exe "silent w! ++enc=".fnameescape(fenc)." ".fnameescape(fnamepath) + else + exe "silent w! ".fnameescape(fnamepath) + endif + echo "wrote ".fnameescape(fnamepath) + call s:RecordInVar(home,"call delete('".fnamepath."')") endif " return to tab with vimball @@ -418,7 +406,7 @@ fun! vimball#RmVimball(...) if a:0 >= 2 let home= expand(a:2) else - let home= s:VimballHome() + let home= vimball#VimballHome() endif let curdir = getcwd() " call Decho("home <".home.">") @@ -432,19 +420,20 @@ fun! vimball#RmVimball(...) keepalt keepjumps 1split silent! keepalt keepjumps e .VimballRecord let keepsrch= @/ -" call Decho("search for ^".curfile.".vba:") -" call Decho("search for ^".curfile."[-0-9.]*.vba:") - if search('^'.curfile.": ".'cw') +" call Decho('search for ^\M'.curfile.'.\m: ') +" call Decho('search for ^\M'.curfile.'.\mvba: ') +" call Decho('search for ^\M'.curfile.'\m[-0-9.]*\.vba: ') + if search('^\M'.curfile."\m: ".'cw') let foundit= 1 - elseif search('^'.curfile.".vba: ",'cw') + elseif search('^\M'.curfile.".\mvba: ",'cw') let foundit= 1 - elseif search('^'.curfile.'[-0-9.]*.vba: ','cw') + elseif search('^\M'.curfile.'\m[-0-9.]*\.vba: ','cw') let foundit= 1 else let foundit = 0 endif if foundit - let exestring = substitute(getline("."),'^'.curfile.'\S\{-}\.vba: ','','') + let exestring = substitute(getline("."),'^\M'.curfile.'\m\S\{-}\.vba: ','','') let s:VBRstring= substitute(exestring,'call delete(','','g') let s:VBRstring= substitute(s:VBRstring,"[')]",'','g') " call Decho("exe ".exestring) @@ -472,62 +461,62 @@ endfun " --------------------------------------------------------------------- " vimball#Decompress: attempts to automatically decompress vimballs {{{2 -fun! vimball#Decompress(fname) -" call Dfunc("Decompress(fname<".a:fname.">)") +fun! vimball#Decompress(fname,...) +" call Dfunc("Decompress(fname<".a:fname.">) a:0=".a:0) " decompression: if expand("%") =~ '.*\.gz' && executable("gunzip") " handle *.gz with gunzip - silent exe "!gunzip ".s:Escape(a:fname) + silent exe "!gunzip ".shellescape(a:fname) if v:shell_error != 0 call vimball#ShowMesg(s:WARNING,"(vimball#Decompress) gunzip may have failed with <".a:fname.">") endif let fname= substitute(a:fname,'\.gz$','','') exe "e ".escape(fname,' \') - call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") + if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif elseif expand("%") =~ '.*\.gz' && executable("gzip") " handle *.gz with gzip -d - silent exe "!gzip -d ".s:Escape(a:fname) + silent exe "!gzip -d ".shellescape(a:fname) if v:shell_error != 0 call vimball#ShowMesg(s:WARNING,'(vimball#Decompress) "gzip -d" may have failed with <'.a:fname.">") endif let fname= substitute(a:fname,'\.gz$','','') exe "e ".escape(fname,' \') - call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") + if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif elseif expand("%") =~ '.*\.bz2' && executable("bunzip2") " handle *.bz2 with bunzip2 - silent exe "!bunzip2 ".s:Escape(a:fname) + silent exe "!bunzip2 ".shellescape(a:fname) if v:shell_error != 0 call vimball#ShowMesg(s:WARNING,"(vimball#Decompress) bunzip2 may have failed with <".a:fname.">") endif let fname= substitute(a:fname,'\.bz2$','','') exe "e ".escape(fname,' \') - call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") + if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif elseif expand("%") =~ '.*\.bz2' && executable("bzip2") " handle *.bz2 with bzip2 -d - silent exe "!bzip2 -d ".s:Escape(a:fname) + silent exe "!bzip2 -d ".shellescape(a:fname) if v:shell_error != 0 call vimball#ShowMesg(s:WARNING,'(vimball#Decompress) "bzip2 -d" may have failed with <'.a:fname.">") endif let fname= substitute(a:fname,'\.bz2$','','') exe "e ".escape(fname,' \') - call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") + if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif elseif expand("%") =~ '.*\.zip' && executable("unzip") " handle *.zip with unzip - silent exe "!unzip ".s:Escape(a:fname) + silent exe "!unzip ".shellescape(a:fname) if v:shell_error != 0 call vimball#ShowMesg(s:WARNING,"(vimball#Decompress) unzip may have failed with <".a:fname.">") endif let fname= substitute(a:fname,'\.zip$','','') exe "e ".escape(fname,' \') - call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") + if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif endif - set noma bt=nofile fmr=[[[,]]] fdm=marker + if a:0 == 0| setlocal noma bt=nofile fmr=[[[,]]] fdm=marker | endif " call Dret("Decompress") endfun @@ -536,20 +525,21 @@ endfun " vimball#ShowMesg: {{{2 fun! vimball#ShowMesg(level,msg) " call Dfunc("vimball#ShowMesg(level=".a:level." msg<".a:msg.">)") + let rulerkeep = &ruler let showcmdkeep = &showcmd set noruler noshowcmd redraw! if &fo =~ '[ta]' - echomsg "***vimball*** " a:msg + echomsg "***vimball*** ".a:msg else if a:level == s:WARNING || a:level == s:USAGE echohl WarningMsg elseif a:level == s:ERROR echohl Error endif - echomsg "***vimball*** " a:msg + echomsg "***vimball*** ".a:msg echohl None endif @@ -646,9 +636,9 @@ fun! s:RecordInFile(home) endfun " --------------------------------------------------------------------- -" s:VimballHome: determine/get home directory path (usually from rtp) {{{2 -fun! s:VimballHome() -" call Dfunc("VimballHome()") +" vimball#VimballHome: determine/get home directory path (usually from rtp) {{{2 +fun! vimball#VimballHome() +" call Dfunc("vimball#VimballHome()") if exists("g:vimball_home") let home= g:vimball_home else @@ -674,14 +664,14 @@ fun! s:VimballHome() if !isdirectory(home) if exists("g:vimball_mkdir") " call Decho("home<".home."> isn't a directory -- making it now with g:vimball_mkdir<".g:vimball_mkdir.">") -" call Decho("system(".g:vimball_mkdir." ".s:Escape(home).")") - call system(g:vimball_mkdir." ".s:Escape(home)) +" call Decho("system(".g:vimball_mkdir." ".shellescape(home).")") + call system(g:vimball_mkdir." ".shellescape(home)) else " call Decho("home<".home."> isn't a directory -- making it now with mkdir()") call mkdir(home) endif endif -" call Dret("VimballHome <".home.">") +" call Dret("vimball#VimballHome <".home.">") return home endfun @@ -743,20 +733,5 @@ fun! vimball#RestoreSettings() endfun " --------------------------------------------------------------------- -" s:Escape: {{{2 -fun s:Escape(name) - " shellescape() was added by patch 7.0.111 - if exists("*shellescape") - return shellescape(a:name) - endif - return g:netrw_shq . a:name . g:netrw_shq -endfun - -" --------------------------------------------------------------------- -" Restore: -let &cpo= s:keepcpo -unlet s:keepcpo - -" --------------------------------------------------------------------- " Modelines: {{{1 " vim: fdm=marker diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 1b4c0907..b813706a 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.2. Last change: 2009 Nov 17 +*eval.txt* For Vim version 7.2. Last change: 2010 Jan 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -3731,7 +3731,7 @@ libcall({libname}, {funcname}, {argument}) the DLL is not in the usual places. For Unix: When compiling your own plugins, remember that the object code must be compiled as position-independent ('PIC'). - {only in Win32 on some Unix versions, when the |+libcall| + {only in Win32 and some Unix versions, when the |+libcall| feature is present} Examples: > :echo libcall("libc.so", "getenv", "HOME") @@ -4882,7 +4882,8 @@ setpos({expr}, {list}) Does not change the jumplist. "lnum" and "col" are the position in the buffer. The first - column is 1. Use a zero "lnum" to delete a mark. + column is 1. Use a zero "lnum" to delete a mark. If "col" is + smaller than 1 then 1 is used. The "off" number is only used when 'virtualedit' is set. Then it is the offset in screen columns from the start of the diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 2be368e2..e1786133 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.2. Last change: 2009 Nov 09 +*options.txt* For Vim version 7.2. Last change: 2010 Jan 06 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1760,8 +1760,8 @@ A jump table for the options with a short description can be found at |Q_op|. set and to the Vim default value when 'compatible' is reset. NOTE: This option is set to the POSIX default value at startup when the Vi default value would be used and the $VIM_POSIX environment - variable exists |posix|. This means tries to behave like the POSIX - specification. + variable exists |posix|. This means Vim tries to behave like the + POSIX specification. contains behavior ~ *cpo-a* @@ -3250,7 +3250,7 @@ A jump table for the options with a short description can be found at |Q_op|. the case of X). The font names given should be "normal" fonts. Vim will try to find the related bold and italic fonts. - For Win32, GTK, Mac OS and Photon: > + For Win32, GTK, Motif, Mac OS and Photon: > :set guifont=* < will bring up a font requester, where you can pick the font you want. diff --git a/runtime/doc/pi_getscript.txt b/runtime/doc/pi_getscript.txt index c434ec55..1ea67c2b 100644 --- a/runtime/doc/pi_getscript.txt +++ b/runtime/doc/pi_getscript.txt @@ -1,11 +1,11 @@ -*pi_getscript.txt* For Vim version 7.2. Last change: 2008 Jun 29 +*pi_getscript.txt* For Vim version 7.0. Last change: 2009 Oct 14 > GETSCRIPT REFERENCE MANUAL by Charles E. Campbell, Jr. < Authors: Charles E. Campbell, Jr. (remove NOSPAM from the email address) *GetLatestVimScripts-copyright* -Copyright: (c) 2004-2006 by Charles E. Campbell, Jr. *glvs-copyright* +Copyright: (c) 2004-2009 by Charles E. Campbell, Jr. *glvs-copyright* The VIM LICENSE applies to getscript.vim and pi_getscript.txt (see |copyright|) except use "getscript" instead of "Vim". No warranty, express or implied. @@ -51,7 +51,7 @@ The GetLatestVimScripts.dist file serves as an example and a template for your own personal list. Feel free to remove all the scripts mentioned within it; the "important" part of it is the first two lines. -Your computer needs to have wget for GetLatestVimScripts to do its work. +Your computer needs to have wget or curl for GetLatestVimScripts to do its work. 1. if compressed: gunzip getscript.vba.gz 2. Unix: @@ -76,7 +76,7 @@ Your computer needs to have wget for GetLatestVimScripts to do its work. ============================================================================== 3. GetLatestVimScripts Usage *glvs-usage* *:GLVS* -Unless it's been defined elsewhere, > +Unless it has been defined elsewhere, > :GLVS will invoke GetLatestVimScripts(). If some other plugin has defined that command, then you may type @@ -136,7 +136,7 @@ insures that GetLatestVimScripts will assume that the script it has is out-of-date. The SourceID is extracted by GetLatestVimScripts from the script's page on -vim.sf.net; whenever it's greater than the one stored in the +vim.sf.net; whenever it is greater than the one stored in the GetLatestVimScripts.dat file, the script will be downloaded (see |GetLatestVimScripts_dat|). @@ -176,6 +176,8 @@ Note: the first two lines are required, but essentially act as comments. ============================================================================== 5. GetLatestVimScripts Friendly Plugins *getscript-plugins* *glvs-plugins* + (this section is for plugin authors)~ + If a plugin author includes the following comment anywhere in their plugin, GetLatestVimScripts will find it and use it to automatically build the user's GetLatestVimScripts.dat files: @@ -191,11 +193,20 @@ plus any additional lines describing any plugin dependencies it may have. Same format, of course! If your command is auto-installable (see |glvs-autoinstall|), and most scripts -are, then you may include :AutoInstall: at the start of "yourscriptname". +are, then you may include :AutoInstall: just before "yourscriptname": +> + src_id + v + " GetLatestVimScripts: ### ### :AutoInstall: yourscriptname + ^ + scriptid +< +NOTE: :AutoInstall: is a plugin-author option, not a GetLatestVimScripts.dat~ + entry!~ GetLatestVimScripts commands for those scripts are then appended, if not -already present, to the user's GetLatest/GetLatestVimScripts.dat file. It's a -relatively painless way to automate the acquisition of any scripts your +already present, to the user's GetLatest/GetLatestVimScripts.dat file. It is +a relatively painless way to automate the acquisition of any scripts your plugins depend upon. Now, as an author, you probably don't want GetLatestVimScripts to download @@ -290,14 +301,19 @@ after/syntax/c.vim contained in it to overwrite a user's c.vim. This variable holds the options to be used with the g:GetLatestVimScripts_wget command. > - g:getLatestVimScripts_allowautoinstall + g:GetLatestVimScripts_allowautoinstall < default= 1 This variable indicates whether GetLatestVimScripts is allowed - to attempt to automatically install scripts. Note that it - doesn't understand vimballs (yet). Furthermore, the plugin - author has to have explicitly indicated that his/her plugin - is automatically installable. - + to attempt to automatically install scripts. Furthermore, the + plugin author has to have explicitly indicated that his/her + plugin is automatically installable (via the :AutoInstall: + keyword in the GetLatestVimScripts comment line). +> + g:GetLatestVimScripts_autoinstalldir +< default= $HOME/.vim (linux) + default= $HOME/vimfiles (windows) + Override where :AutoInstall: scripts will be installed. + Doesn't override vimball installation. ============================================================================== 8. GetLatestVimScripts Algorithm *glvs-algorithm* *glvs-alg* @@ -336,8 +352,10 @@ The AutoInstall process will: 9. GetLatestVimScripts History *getscript-history* *glvs-hist* {{{1 v31 Jun 29, 2008 : * (Bill McCarthy) fixed having hls enabled with getscript + * (David Schaefer) the acd option interferes with vimballs + Solution: bypass the acd option v30 Jun 13, 2008 : * GLVS now checks for existence of fnameescape() and will - issue an error message if it's not supported + issue an error message if it is not supported v29 Jan 07, 2008 : * Bram M pointed out that cpo is a global option and that getscriptPlugin.vim was setting it but not restoring it. v28 Jan 02, 2008 : * improved shell quoting character handling, cygwin diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 428baf8d..7635af28 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -1,8 +1,22 @@ -*pi_netrw.txt* For Vim version 7.2. Last change: 2009 Jan 15 +*pi_netrw.txt* For Vim version 7.2. Last change: 2009 Dec 28 ----------------------------------------------------- NETRW REFERENCE MANUAL by Charles E. Campbell, Jr. ----------------------------------------------------- +Author: Charles E. Campbell, Jr. + (remove NOSPAM from Campbell's email first) + +Copyright: Copyright (C) 2009 Charles E Campbell, Jr *netrw-copyright* + Permission is hereby granted to use and distribute this code, with + or without modifications, provided that this copyright notice is + copied with it. Like anything else that's free, netrw.vim, + netrwPlugin.vim, netrwFileHandlers.vim, netrwSettings.vim, + syntax/netrw.vim, and pi_netrw.txt are provided *as is* and comes + with no warranty of any kind, either expressed or implied. No + guarantees of merchantability. No guarantees of suitability for + any purpose. By using this plugin, you agree that in no event will + the copyright holder be liable for any damages resulting from the + use of this software. *dav* *ftp* *netrw-file* *Nread* *rcp* *scp* @@ -18,6 +32,7 @@ EXTERNAL APPLICATIONS AND PROTOCOLS................|netrw-externapp| READING............................................|netrw-read| WRITING............................................|netrw-write| + SOURCING...........................................|netrw-source| DIRECTORY LISTING..................................|netrw-dirlist| CHANGING THE USERID AND PASSWORD...................|netrw-chgup| VARIABLES AND SETTINGS.............................|netrw-variables| @@ -38,7 +53,7 @@ Browsing With A Horizontally Split Window..........|netrw-o| Browsing With A New Tab............................|netrw-t| Browsing With A Vertically Split Window............|netrw-v| - Change Listing Style...............................|netrw-i| + Change Listing Style.(thin wide long tree).........|netrw-i| Changing To A Bookmarked Directory.................|netrw-gb| Changing To A Predecessor Directory................|netrw-u| Changing To A Successor Directory..................|netrw-U| @@ -85,7 +100,8 @@ 10. Problems and Fixes...................................|netrw-problems| 11. Debugging Netrw Itself...............................|netrw-debug| 12. History..............................................|netrw-history| -13. Credits..............................................|netrw-credits| +13. Todo.................................................|netrw-todo| +14. Credits..............................................|netrw-credits| {Vi does not have any of this} @@ -93,7 +109,7 @@ 2. Starting With Netrw *netrw-start* {{{1 Netrw makes reading files, writing files, browsing over a network, and -browsing locally easy! First, make sure that you have plugins enabled, so +local browsing easy! First, make sure that you have plugins enabled, so you'll need to have at least the following in your <.vimrc>: (or see |netrw-activate|) > @@ -138,8 +154,11 @@ the directory name is followed by a "/"): > < See |netrw-browse| for more! -There are more protocols supported by netrw just than scp and ftp, too: see the -next section, |netrw-externapp|, for how to use these external applications. +There are more protocols supported by netrw than just scp and ftp, too: see the +next section, |netrw-externapp|, on how to use these external applications with +netrw and vim. + +PREVENTING LOADING If you want to use plugins, but for some reason don't wish to use netrw, then you need to avoid loading both the plugin and the autoload portions of netrw. @@ -152,7 +171,7 @@ You may do so by placing the following two lines in your <.vimrc>: > ============================================================================== 3. Netrw Reference *netrw-ref* {{{1 - Netrw supports several protocols in addition to scp and ftp mentioned + Netrw supports several protocols in addition to scp and ftp as mentioned in |netrw-start|. These include dav, fetch, http,... well, just look at the list in |netrw-externapp|. Each protocol is associated with a variable which holds the default command supporting that protocol. @@ -176,17 +195,19 @@ EXTERNAL APPLICATIONS AND PROTOCOLS *netrw-externapp* {{{2 sftp: *g:netrw_sftp_cmd* = "sftp" *g:netrw_http_xcmd* : the option string for http://... protocols are - specified via this variable and may be independently oveerridden. + specified via this variable and may be independently overridden. By + default, the option arguments for the http-handling commands are: > - elinks : "-dump >" - links : "-dump >" + elinks : "-source >" + links : "-source >" curl : "-o" wget : "-q -O" fetch : "-o" - - For example, if your system has elinks but you want to see the html - source in detail rather than a text rendering thereof, you may wish - to have let g:netrw_http_xcmd= "-source >" in your .vimrc. +< + For example, if your system has elinks, and you'd rather see the + page using an attempt at rendering the text, you may wish to have > + let g:netrw_http_xcmd= "-dump >" +< in your .vimrc. READING *netrw-read* *netrw-nread* {{{2 @@ -260,8 +281,8 @@ DIRECTORY LISTING *netrw-dirlist* {{{2 :e ftp://[user]@hostname/path/ < For remote directories (ie. those using scp or ftp), that trailing - "/" is necessary (it tells netrw that it's to treat it as a directory - to browse instead of a file to download). + "/" is necessary (the slash tells netrw to treat the argument as a + directory to browse instead of a file to download). However, the Nread command can also be used to accomplish this: @@ -294,8 +315,8 @@ preferences. One way to look at them is via the command :NetrwSettings (see settings are described below, in |netrw-browser-options|, and in |netrw-externapp|: - *b:netrw_lastfile* last file Network-read/written retained on a per-buffer - basis (supports plain :Nw ) + *b:netrw_lastfile* last file Network-read/written retained on a + per-buffer basis (supports plain :Nw ) *g:netrw_chgwin* specifies a window number where file edits will take place. (also see |netrw-C|) @@ -313,7 +334,7 @@ settings are described below, in |netrw-browser-options|, and in value of this variable to see if the alternate ftp method works for your setup. - *g:netrw_extracmd* default: doesn't exist + *g:netrw_ftpextracmd* default: doesn't exist If this variable exists, then any string it contains will be placed into the commands set to your ftp client. As an example: @@ -333,8 +354,8 @@ settings are described below, in |netrw-browser-options|, and in *g:netrw_nogx* if this variable exists, then the "gx" map will not be available (see |netrw-gx|) - *g:netrw_uid* (ftp) user-id, retained on a per-session basis - *s:netrw_passwd* (ftp) password, retained on a per-session basis + *g:netrw_uid* (ftp) user-id, retained on a per-vim-session basis + *s:netrw_passwd* (ftp) password, retained on a per-vim-session basis *g:netrw_preview* =0 (default) preview window shown in a horizontally split window @@ -415,6 +436,30 @@ series of commands (typically ftp) which it issues to an external program from/written to a temporary file (under Unix/Linux, /tmp/...) which the script will clean up. +Now, a word about Jan Minář's "FTP User Name and Password Disclosure"; first, +ftp is not a secure protocol. User names and passwords are transmitted "in +the clear" over the internet; any snooper tool can pick these up; this is not +a netrw thing, this is a ftp thing. If you're concerned about this, please +try to use scp or sftp instead. + +Netrw re-uses the user id and password during the same vim session and so long +as the remote hostname remains the same. + +Jan seems to be a bit confused about how netrw handles ftp; normally multiple +commands are performed in a "ftp session", and he seems to feel that the +uid/password should only be retained over one ftp session. However, netrw +does every ftp operation in a separate "ftp session"; so remembering the +uid/password for just one "ftp session" would be the same as not remembering +the uid/password at all. IMHO this would rapidly grow tiresome as one +browsed remote directories, for example. + +On the other hand, thanks go to Jan M. for pointing out the many +vulnerabilities that netrw (and vim itself) had had in handling "crafted" +filenames. The |shellescape()| and |fnameescape()| functions were written in +response by Bram Moolenaar to handle these sort of problems, and netrw has +been modified to use them. Still, my advice is, if the "filename" looks like +a vim command that you aren't comfortable with having executed, don't open it. + *netrw-putty* *netrw-pscp* *netrw-psftp* One may modify any protocol's implementing external application by setting a variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to @@ -431,8 +476,8 @@ file). Thus, concerned users may decide to write a NetReadFixup() function that will clean up after reading with their ftp. Some Unix systems (ie., FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is not noisy and more convenient, actually, for to use. -Consequently, if "fetch" is executable, it will be used to do reads for -ftp://... (and http://...) . See |netrw-var| for more about this. +Consequently, if "fetch" is available (ie. executable), it may be preferable +to use it for ftp://... based transfers. For rcp, scp, sftp, and http, one may use network-oriented file transfers transparently; ie. @@ -440,7 +485,7 @@ transparently; ie. vim rcp://[user@]machine/path vim scp://[user@]machine/path < -If your ftp supports <.netrc>, then it too can be just as transparently used +If your ftp supports <.netrc>, then it too can be transparently used if the needed triad of machine name, user id, and password are present in that file. Your ftp must be able to use the <.netrc> file on its own, however. > @@ -603,9 +648,8 @@ below, a {netfile} is an url to a remote file. :[range]Nw[rite] {netfile} [{netfile}]... Write the specified lines to the {netfile}. -:Nr[ead] Read the specified lines into the current - buffer from the file specified in - b:netrw_lastfile. +:Nr[ead] Read the lines from the file specified in b:netrw_lastfile + into the current buffer. :Nr[ead] {netfile} {netfile}... Read the {netfile} after the current line. @@ -668,12 +712,9 @@ set in the user's <.vimrc> file: (see also |netrw-settings| |netrw-protocol|) to be ignored. b:netrw_lastfile Holds latest method/machine/path. b:netrw_line Holds current line number (during NetWrite) - g:netrw_passwd Holds current password for ftp. g:netrw_silent =0 transfers done normally =1 transfers done silently g:netrw_uid Holds current user-id for ftp. - =1 use alternate ftp (user uid password) - (see |netrw-options|) g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default) =1 use WinNT/2K/XP's rcp, binary mode g:netrw_win95ftp =0 use unix-style ftp even if win95/98/ME/etc @@ -689,9 +730,10 @@ temporarily. Variable Meaning -------- ------------------------------------ < - g:netrw_method Index indicating rcp/ftp+.netrc/ftp + b:netrw_method Index indicating rcp/ftp+.netrc/ftp + w:netrw_method (same as b:netrw_method) g:netrw_machine Holds machine name parsed from input - g:netrw_fname Holds filename being accessed > + b:netrw_fname Holds filename being accessed > ------------------------------------------------------------ < *netrw-protocol* @@ -781,7 +823,7 @@ renders the server treatment as "trusted". *netrw-fixup* *netreadfixup* If your ftp for whatever reason generates unwanted lines (such as AUTH -messages) you may write a NetReadFixup(tmpfile) function: +messages) you may write a NetReadFixup() function: > function! NetReadFixup(method,line1,line2) " a:line1: first new line in current file @@ -866,6 +908,7 @@ There are several things you can do to affect the browser's display of files: * To change the listing style, press the "i" key (|netrw-i|). Currently there are four styles: thin, long, wide, and tree. + To make that change "permanent", see |g:netrw_liststyle|. * To hide files (don't want to see those xyz~ files anymore?) see |netrw-ctrl-h|. @@ -929,7 +972,6 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2 D Attempt to remove the file(s)/directory(ies) |netrw-D| gb Go to previous bookmarked directory |netrw-gb| gh Quick hide/unhide of dot-files |netrw-gh| - gi Display information on file |netrw-qf| Edit file hiding list |netrw-ctrl-h| i Cycle between thin, long, wide, and tree listings |netrw-i| Causes Netrw to refresh the directory listing |netrw-ctrl-l| @@ -941,7 +983,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2 mh Toggle marked file suffices' presence on hiding list |netrw-mh| mm Move marked files to marked-file target directory |netrw-mm| mp Print marked files |netrw-mp| - mr Mark files satisfying a |regexp| |netrw-mr| + mr Mark files satisfying a shell-style |regexp| |netrw-mr| mt Current browsing directory becomes markfile target |netrw-mt| mT Apply ctags to marked files |netrw-mT| mu Unmark all marked files |netrw-mu| @@ -952,7 +994,8 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2 O Obtain a file specified by cursor |netrw-O| p Preview the file |netrw-p| P Browse in the previously used window |netrw-P| - q List bookmarked directories and history |netrw-qb| + qb List bookmarked directories and history |netrw-qb| + qf Display information on file |netrw-qf| r Reverse sorting order |netrw-r| R Rename the designed file(s)/directory(ies) |netrw-R| s Select sorting style: by name, time, or file size |netrw-s| @@ -966,6 +1009,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2 % Open a new file in netrw's current directory |netrw-%| + *netrw-mouse* *netrw-leftmouse* *netrw-middlemouse* *netrw-rightmouse* (gvim only) selects word under mouse as if a had been pressed (ie. edit file, change directory) (gvim only) same as P selecting word under mouse; @@ -1000,7 +1044,7 @@ One may easily "bookmark" a directory by using > mb < -Bookmarks are retained in between sesions in a $HOME/.netrwbook file, and are +Bookmarks are retained in between sessions in a $HOME/.netrwbook file, and are kept in sorted order. Related Topics: @@ -1029,8 +1073,8 @@ horizontally or vertically, respectively. When the option is set to three, a will cause the file to appear in a new tab. -When using the gui (gvim) one may select a file by pressing the -button. In addtion, if +When using the gui (gvim), one may select a file by pressing the +button. In addition, if *|g:netrw_retmap| == 1 AND (its default value is 0) * in a netrw-selected file, AND @@ -1071,19 +1115,19 @@ new window and cursor at the bottom, have let g:netrw_alto = 1 -in your <.vimrc>. (also see |netrw-t| |netrw-v|) - -There is only one tree listing buffer; using "o" on a displayed subdirectory -will split the screen, but the same buffer will be shown twice. +in your <.vimrc>. (also see |netrw-t| |netrw-T| |netrw-v|) Associated setting variables: |g:netrw_alto| |g:netrw_winsize| -BROWSING WITH A NEW TAB *netrw-t* {{{2 +BROWSING WITH A NEW TAB *netrw-t* *netrw-T* {{{2 Normally one enters a file or directory using the . The "t" map -allows one to open a new window hold the new directory listing or file in a -new tab. (also see: |netrw-o| |netrw-v|) +allows one to open a new window holding the new directory listing or file in +a new tab. The "T" version puts the file or directory into a background tab +(see |gT|) + +Related actions: |netrw-o| |netrw-v| BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v* {{{2 @@ -1098,18 +1142,19 @@ window and cursor at the right, have let g:netrw_altv = 1 -in your <.vimrc>. (also see: |netrw-o| |netrw-t|) +in your <.vimrc>. (also see: |netrw-o| |netrw-t| |netrw-T|) There is only one tree listing buffer; using "v" on a displayed subdirectory will split the screen, but the same buffer will be shown twice. Associated setting variable: |g:netrw_altv| |g:netrw_winsize| -CHANGE LISTING STYLE *netrw-i* {{{2 + +CHANGE LISTING STYLE (THIN LONG WIDE TREE) *netrw-i* {{{2 The "i" map cycles between the thin, long, wide, and tree listing formats. -The short listing format gives just the files' and directories' names. +The thin listing format gives just the files' and directories' names. The long listing is either based on the "ls" command via ssh for remote directories or displays the filename, file size (in bytes), and the time and @@ -1125,13 +1170,23 @@ This listing format is the most compact. The tree listing format has a top directory followed by files and directories preceded by a "|". One may open and close directories by pressing the -key while atop the directory name. There is only one tree listing buffer; -hence, using "v" or "o" on a subdirectory will only show the same buffer, -twice. +key while atop the directory name. + +One may make a preferred listing style your default; see |g:netrw_liststyle|. +As an example, by putting the following line in your .vimrc, > + let g:netrw_liststyle= 4 +the tree style will become your default listing style. Associated setting variables: |g:netrw_liststyle| |g:netrw_maxfilenamelen| |g:netrw_timefmt| |g:netrw_list_cmd| +CHANGE FILE PERMISSION *netrw-gp* {{{2 + +"gp" will ask you for a new permission for the file named under the cursor. +Currently, this only works for local files. + +Associated setting variables: |g:netrw_chgperm| + CHANGING TO A BOOKMARKED DIRECTORY *netrw-gb* {{{2 @@ -1143,7 +1198,7 @@ Any count may be used to reference any of the bookmarks. Related Topics: |netrw-mB| how to delete bookmarks - |netrw-mb| how to return to a bookmark + |netrw-mb| how to make a bookmark |netrw-qb| how to list bookmarks @@ -1219,7 +1274,7 @@ the handler function must exist for it to be called! NFH_html("scp://user@host/some/path/mypgm.html") < Users may write their own netrw File Handler functions to support more -suffixes with special handling. See for +suffixes with special handling. See for examples on how to make file handler functions. As an example: > " NFH_suffix(filename) @@ -1302,12 +1357,12 @@ Associated setting variable: |g:netrw_local_rmdir| |g:netrw_rm_cmd| *netrw-rexplore* *netrw-sexplore* *netrw-texplore* *netrw-vexplore* DIRECTORY EXPLORATION COMMANDS {{{2 - :[N]Explore[!] [dir]... Explore directory of current file *:Explore* - :[N]Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore* - :Rexplore ... Return to Explorer *:Rexplore* - :[N]Sexplore[!] [dir]... Split&Explore current file's directory*:Sexplore* - :Texplore [dir]... Tab & Explore *:Texplore* - :[N]Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore* + :[N]Explore[!] [dir]... Explore directory of current file *:Explore* + :[N]Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore* + :Rexplore ... Return to Explorer *:Rexplore* + :[N]Sexplore[!] [dir]... Split&Explore current file's directory *:Sexplore* + :Texplore [dir]... Tab & Explore *:Texplore* + :[N]Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore* Used with :Explore **/pattern : (also see |netrw-starstar|) :Nexplore............. go to next matching file *:Nexplore* @@ -1342,8 +1397,8 @@ windows should have. :Rexplore This command is a little different from the others. When one edits a file, for example by pressing when atop a file in a netrw browser window, :Rexplore will return the display to - that of the last netrw browser window. It's a command version - of <2-leftmouse> (which is only available under gvim and + that of the last netrw browser window. It is a command version + of the <2-leftmouse> map (which is only available under gvim and cooperative terms). @@ -1413,6 +1468,18 @@ be the only ones displayed (see |netrw-a|). The "gh" mapping (see |netrw-gh|) quickly alternates between the usual hiding list and the hiding of files or directories that begin with ".". +As an example, > + let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+' +Effectively, this makes the effect of a |netrw-gh| command the initial setting. +What it means: + + \(^\|\s\s\) : if the line begins with the following, -or- + two consecutive spaces are encountered + \zs : start the hiding match now + \. : if it now begins with a dot + \S\+ : and is followed by one or more non-whitespace + characters + Associated setting variables: |g:netrw_hide| |g:netrw_list_hide| Associated topics: |netrw-a| |netrw-gh| |netrw-mh| @@ -1667,10 +1734,11 @@ MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2 (also see |netrw-mf|) One may also mark files by pressing "mr"; netrw will then issue a prompt, -"Enter regexp: ". You may then enter a regular expression such as \.c$ . -All files in the current directory will then be marked. Note that the -regular expressions are vim-style |regexp| ones, not shell ones. So -entering *.c probably isn't what you want! +"Enter regexp: ". You may then enter a shell-style regular expression such +as *.c$ (see |glob()|). For remote systems, glob() doesn't work -- so netrw +converts "*" into ".*" (see |regexp|) and marks files based on that. In the +future I may make it possible to use |regexp|s instead of glob()-style +expressions (yet-another-option). MARKED FILES: ARBITRARY COMMAND *netrw-mx* {{{2 @@ -1753,7 +1821,7 @@ MARKED FILES: MOVING *netrw-mm* {{{2 first or do the copy and then delete yourself using mc and D. Use at your own risk! -Select a target directory with mT (|netrw-mt|). Then change directory, +Select a target directory with mt (|netrw-mt|). Then change directory, select file(s) (see |netrw-mf|), and press "mm". Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd| @@ -1778,7 +1846,7 @@ MARKED FILES: TAGGING *netrw-mT* {{{2 (See |netrw-mf| and |netrw-mr| for how to mark files) (uses the global marked file list) -The "mt" mapping will apply the command in |g:netrw_ctags| (by default, it's +The "mT" mapping will apply the command in |g:netrw_ctags| (by default, it is "ctags") to marked files. For remote browsing, in order to create a tags file netrw will use ssh (see |g:netrw_ssh_cmd|), and so ssh must be available for this to work on remote systems. For your local system, see |ctags| on how to @@ -1826,7 +1894,7 @@ The "mu" mapping will unmark all currently marked files. NETRW BROWSER VARIABLES *netrw-browser-options* *netrw-browser-var* {{{2 -(if you're interestd in the netrw file transfer settings, see |netrw-options|) +(if you're interested in the netrw file transfer settings, see |netrw-options|) The browser provides settings in the form of variables which you may modify; by placing these settings in your <.vimrc>, you may customize @@ -1843,12 +1911,21 @@ your browsing preferences. (see also: |netrw-settings|) by setting this variable (see |netrw-v|) default: =&spr (see |'spr'|) + *g:netrw_banner* enable/suppress the banner + =0: suppress the banner + =1: banner is enabled (default) + NOTE: suppressing the banner is a new feature + which may cause problems. + *g:netrw_browse_split* when browsing, will open the file by: =0: re-using the same window =1: horizontally splitting the window first =2: vertically splitting the window first =3: open file in new tab =4: act like "P" (ie. open previous window) + Note that |g:netrw_preview| may be used + to get vertical splitting instead of + horizontal splitting. *g:netrw_browsex_viewer* specify user's preference for a viewer: > "kfmclient exec" @@ -1859,6 +1936,10 @@ your browsing preferences. (see also: |netrw-settings|) a script/function to handle the given extension. (see |netrw_filehandler|). + *g:netrw_chgperm* Unix/Linux: "chmod PERM FILENAME" + Windows: "cacls FILENAME /e /p PERM" + Used to change access permission for a file. + *g:netrw_compress* ="gzip" Will compress marked files with this command @@ -1871,10 +1952,10 @@ your browsing preferences. (see also: |netrw-settings|) |g:netrw_liststyle| ==0 (thin listing) or |g:netrw_liststyle| ==1 (long listing) or |g:netrw_liststyle| ==3 (tree listing) + (ie. doesn't affect the wide listing) =0: off =2: like ==1, but the wide listing gets both cursorline and |'cursorcolumn'|locally set - (ie. doesn't affect the wide listing) *g:netrw_decompress* = { ".gz" : "gunzip" , ".bz2" : "bunzip2" , @@ -2002,6 +2083,14 @@ your browsing preferences. (see also: |netrw-settings|) *g:netrw_mkdir_cmd* command for making a remote directory default: "ssh USEPORT HOSTNAME mkdir" + *g:netrw_mousemaps* =1 (default) enables the mouse buttons + while browsing: + leftmouse : open file/directory + shift-leftmouse : mark file + middlemouse : same as P + rightmouse : remove file/directory + =0: disables mouse maps + *g:netrw_retmap* if it exists and is set to one, then: * if in a netrw-selected file, AND * no normal-mode <2-leftmouse> mapping exists, @@ -2117,14 +2206,14 @@ your browsing preferences. (see also: |netrw-settings|) including multi-byte characters' string length. (thanks to N Weibull, T Mechelynck) =0: uses Vim's built-in strlen() - =1: number of codepoints (Latin + a combining + =1: number of codepoints (Latin a + combining circumflex is two codepoints) (DEFAULT) =2: number of spacing codepoints (Latin a + combining circumflex is one spacing codepoint; a hard tab is one; wide and narrow CJK are one each; etc.) =3: virtual length (counting tabs as anything - between 1 and |'tabstop'|, wide CJJK as 2 + between 1 and |'tabstop'|, wide CJK as 2 rather than 1, Arabic alif as zero when immediately preceded by lam, one otherwise, etc) @@ -2306,7 +2395,7 @@ Associated setting variables: |g:netrw_chgwin| Windows' ftp has a minimal support for ls (ie. it doesn't accept sorting options). It doesn't support the -F which gives an explanatory character (ABC/ for "ABC is a directory"). - Netrw then uses "dir" to get both its short and long listings. + Netrw then uses "dir" to get both its thin and long listings. If you think your ftp does support a full-up ls, put the following into your <.vimrc>: > @@ -2553,7 +2642,7 @@ which is loaded automatically at startup (assuming :set nocp). read/write your file over the network in a separate tab. To save the file, use > - :wincmd j + :tabnext :set bt= :w! DBG < Please send that information to 's maintainer, > @@ -2567,6 +2656,31 @@ which is loaded automatically at startup (assuming :set nocp). Jan 14, 2009 * (reported by Marvin Renich) with spell check enabled, some filenamess will still being displayed as spelling errors. + Apr 13, 2009 * (Björn Winckler) writing a file using + remote scp caused syntax highlighting problem. + Solution: avoid syntax/syntax.vim's + au Filetype * syntax setting autocommand by + checking that the current buffer has the + netrw filetype before attempting a doau + in s:NetrwSafeOptions(). + Apr 14, 2009 * (asgeo1) suggested the "T" map (|netrw-T|) + Apr 14, 2009 * marking wasn't working on executable and + other special filenames + Apr 20, 2009 * (Dennis Benzinger) files opened via http have + their syntax filetype auto-detected + Jun 19, 2009 * (Yukihiro Nakadaira) help document improvements + Jul 22, 2009 * g:netrw_browse_split will honor the + |'equalalways'| setting. + Jul 29, 2009 * implemented "I" mapping to toggle banner + (this is experimental and still being debugged) + Sep 19, 2009 * (Mike McEwan) writes via ftp now send both + g:netrw_ftpmode and g:netrw_ftpextracmd (if the + latter exists) + Dec 02, 2009 * netrw uses vimgrep several places; it now uses + "noautocmd vimgrep" (should be speedier). + Dec 03, 2009 * changed back to using -source instead of -dump + for elinks-using commands. (requested by James + Vega and Karsten Hopp) v135: Oct 29, 2008 * using |simplify()| on directory names (supporting handling ".."s in directory names) Oct 31, 2008 * added special file highlighting for core dumps @@ -2576,7 +2690,7 @@ which is loaded automatically at startup (assuming :set nocp). to avoid having to use fnameescape() * fixed a tree redrawing problem (open directory, open subdir, close subdir, close dir) - Nov 19, 2008 * sprinked some histdel("/",-1)s through the code + Nov 19, 2008 * sprinkled some histdel("/",-1)s through the code in an attempt to prevent netrw from changing the search history. Jan 02, 2009 * |g:Netrw_funcref| included @@ -2739,8 +2853,8 @@ which is loaded automatically at startup (assuming :set nocp). * executable files now displayed with trailing (*) * symbolically linked files now displayed with trailing (@) - * Somewhen, s:NetrwMarkFileMove() got damaged. It's - now restored (missing an endif, for example). + * Somewhen, s:NetrwMarkFileMove() got damaged. It + * is now restored (missing an endif, for example). * |netrw-mu| implemented (unmarking marked files) * many bugs have been removed from the marked file system (tnx to Mark S. for feedback) @@ -2848,7 +2962,7 @@ which is loaded automatically at startup (assuming :set nocp). marked files. v110: May 10, 2007 * added [ and ] maps to NetrwTreeListing May 25, 2007 * |g:netrw_preview| included - May 29, 2007 * modifed netrw#NetBrowseX to consistently use + May 29, 2007 * modified netrw#NetBrowseX to consistently use g:netrw_shq instead of hardcoded quotes, and modified the snippet that sets up redir so Windows machines use "nul" instead of @@ -3309,7 +3423,16 @@ which is loaded automatically at startup (assuming :set nocp). ============================================================================== -12. Credits *netrw-credits* {{{1 +13. Todo *netrw-todo* {{{1 + +07/29/09 : banner :|g:netrw_banner| can be used to suppress the + suppression banner. This feature is new and experimental, + so its in the process of being debugged. +09/04/09 : "gp" : See if it can be made to work for remote systems. + : See if it can be made to work with marked files. + +============================================================================== +14. Credits *netrw-credits* {{{1 Vim editor by Bram Moolenaar (Thanks, Bram!) dav support by C Campbell diff --git a/runtime/doc/pi_tar.txt b/runtime/doc/pi_tar.txt index 582a25d6..30cc5dde 100644 --- a/runtime/doc/pi_tar.txt +++ b/runtime/doc/pi_tar.txt @@ -1,4 +1,4 @@ -*pi_tar.txt* For Vim version 7.2. Last change: 2008 Aug 09 +*pi_tar.txt* For Vim version 7.2. Last change: 2009 Dec 28 +====================+ | Tar File Interface | @@ -26,6 +26,33 @@ Copyright 2005-2008: The GPL (gnu public license) applies to *tar-copyright* also write to the file. Currently, one may not make a new file in tar archives via the plugin. + *:Untarvim* + UNTARVIM~ + + :Untarvim [vimhome] + + This command copies, if necessary, the tarball to the .vim or vimfiles + directory using the first writable directory in the |'runtimepath'| + when no [vimhome] is specified. Otherwise, the [vimhome] argument + allows the user to specify that directory, instead. + + The copy is done using the command in *g:tar_copycmd* , which is > + cp for cygwin, unix, macunix + copy for windows (32, 95, 64, 16) +< The extraction is done with the command specified with + *g:tar_extractcmd* , which by default is > + "tar -xf" +< + PREVENTING LOADING~ + + If for some reason you do not wish to use vim to examine tar'd files, + you may put the following two variables into your <.vimrc> to prevent + the tar plugin from loading: > + + let g:loaded_tarPlugin= 1 + let g:loaded_tar = 1 +< + ============================================================================== 3. Options *tar-options* @@ -38,14 +65,15 @@ Copyright 2005-2008: The GPL (gnu public license) applies to *tar-copyright* *g:tar_cmd* "tar" the name of the tar program *g:tar_nomax* 0 if true, file window will not be maximized *g:tar_secure* undef if exists: - "--" will be used to prevent unwanted + "--"s will be used to prevent unwanted option expansion in tar commands. Please be sure that your tar command accepts "--"; Posix compliant tar - utilities do accept it. + utilities do accept them. if not exists: - The tar plugin will reject any member - files that begin with "-" + The tar plugin will reject any tar + files or member files that begin with + "-" Not all tar's support the "--" which is why it isn't default. *g:tar_writeoptions* "uf" used to update/replace a file @@ -54,6 +82,9 @@ Copyright 2005-2008: The GPL (gnu public license) applies to *tar-copyright* ============================================================================== 4. History *tar-history* + + v24 Apr 07, 2009 * :Untarvim command implemented + Sep 28, 2009 * Added lzma support v22 Aug 08, 2008 * security fixes v16 Jun 06, 2008 * tarfile:: used instead of tarfile: when editing files inside tarballs. Fixes a problem with tarballs called diff --git a/runtime/doc/pi_vimball.txt b/runtime/doc/pi_vimball.txt index 143396e0..885131e2 100644 --- a/runtime/doc/pi_vimball.txt +++ b/runtime/doc/pi_vimball.txt @@ -1,4 +1,4 @@ -*pi_vimball.txt* For Vim version 7.2. Last change: 2008 Jul 30 +*pi_vimball.txt* For Vim version 7.2. Last change: 2009 Dec 28 ---------------- Vimball Archiver @@ -6,7 +6,7 @@ Author: Charles E. Campbell, Jr. (remove NOSPAM from Campbell's email first) -Copyright: (c) 2004-2008 by Charles E. Campbell, Jr. *Vimball-copyright* +Copyright: (c) 2004-2009 by Charles E. Campbell, Jr. *Vimball-copyright* The VIM LICENSE applies to Vimball.vim, and Vimball.txt (see |copyright|) except use "Vimball" instead of "Vim". No warranty, express or implied. @@ -55,7 +55,7 @@ Copyright: (c) 2004-2008 by Charles E. Campbell, Jr. *Vimball-copyright* ============================================================================== 3. Vimball Manual *vimball-manual* - *:MkVimball* +MAKING A VIMBALL *:MkVimball* :[range]MkVimball[!] filename [path] The range is composed of lines holding paths to files to be included @@ -79,28 +79,33 @@ Copyright: (c) 2004-2008 by Charles E. Campbell, Jr. *Vimball-copyright* "filename.vba" file, overwriting it if it already exists. This behavior resembles that for |:w|. - *g:vimball_mkdir* + If you wish to force slashes into the filename, that can also be done + by using the exclamation mark (ie. :MkVimball! path/filename). + + The tip at http://vim.wikia.com/wiki/Using_VimBall_with_%27Make%27 + has a good idea on how to automate the production of vimballs using + make. + + +MAKING DIRECTORIES VIA VIMBALLS *g:vimball_mkdir* + First, the |mkdir()| command is tried (not all systems support it). - If it doesn't exist, then g:vimball_mkdir doesn't exist, it is set to: + If it doesn't exist, then if g:vimball_mkdir doesn't exist, it is set + as follows: > |g:netrw_local_mkdir|, if it exists - "mkdir", if it is executable - "makedir", if it is executable - Otherwise, it is undefined. - One may explicitly specify the directory making command using + "mkdir" , if it is executable + "makedir" , if it is executable + Otherwise , it is undefined. +< One may explicitly specify the directory making command using g:vimball_mkdir. This command is used to make directories that are needed as indicated by the vimball. - *g:vimball_home* - You may override the use of the |'runtimepath'| by specifying a - variable, g:vimball_home. - Path Preprocessing *g:vimball_path_escape* +CONTROLLING THE VIMBALL EXTRACTION DIRECTORY *g:vimball_home* - Paths used in vimball are preprocessed by s:Path(); in addition, - certain characters are escaped (by prepending a backslash). The - characters are in g:vimball_path_escape, and may be overridden by - the user in his/her .vimrc initialization script. + You may override the use of the |'runtimepath'| by specifying a + variable, g:vimball_home. *vimball-extract* vim filename.vba @@ -112,12 +117,16 @@ Copyright: (c) 2004-2008 by Charles E. Campbell, Jr. *Vimball-copyright* file holds the "Vimball Archiver by Charles E. Campbell, Jr., Ph.D." line. - :VimballList *:VimballList* +LISTING FILES IN A VIMBALL *:VimballList* + + :VimballList This command will tell Vimball to list the files in the archive, along with their lengths in lines. - :UseVimball [path] *:UseVimball* +MANUALLY INVOKING VIMBALL EXTRACTION *:UseVimball* + + :UseVimball [path] This command is contained within the vimball itself; it invokes the vimball#Vimball() routine which is responsible for unpacking the @@ -126,7 +135,9 @@ Copyright: (c) 2004-2008 by Charles E. Campbell, Jr. *Vimball-copyright* installation, thereby overriding the automatic choice of the first existing directory on the |'runtimepath'|. - :RmVimball vimballfile [path] *:RmVimball* +REMOVING A VIMBALL *:RmVimball* + + :RmVimball vimballfile [path] This command removes all files generated by the specified vimball (but not any directories it may have made). One may choose a path @@ -136,10 +147,29 @@ Copyright: (c) 2004-2008 by Charles E. Campbell, Jr. *Vimball-copyright* containing a record of what files need to be removed for all vimballs used thus far. +PREVENTING LOADING + + If for some reason you don't want to be able to extract plugins + using vimballs: you may prevent the loading of vimball.vim by + putting the following two variables in your <.vimrc>: > + + let g:loaded_vimballPlugin= 1 + let g:loaded_vimball = 1 +< ============================================================================== 4. Vimball History *vimball-history* {{{1 + 30 : Dec 08, 2008 * fnameescape() inserted to protect error + messaging using corrupted filenames from + causing problems + * RmVimball supports filenames that would + otherwise be considered to have "magic" + characters (ie. Abc[1].vba) + Feb 18, 2009 * s:Escape(), g:vimball_shq, and g:netrw_shq + removed (shellescape() used directly) + Oct 05, 2009 * (Nikolai Weibull) suggested that MkVimball + be allowed to use slashes in the filename. 26 : May 27, 2008 * g:vimball_mkdir usage installed. Makes the $HOME/.vim (or $HOME\vimfiles) directory if necessary. diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index dec5be4a..868ac0a3 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -1,4 +1,4 @@ -*starting.txt* For Vim version 7.2. Last change: 2009 Nov 11 +*starting.txt* For Vim version 7.2. Last change: 2009 Dec 31 VIM REFERENCE MANUAL by Bram Moolenaar @@ -970,7 +970,8 @@ part of the line in the tags file) is always done in secure mode. This works just like executing a command from a vimrc/exrc in the current directory. *slow-start* -If Vim takes a long time to start up, there may be a few causes: +If Vim takes a long time to start up, use the |--startuptime| argument to find +out what happens. There are a few common causes: - If the Unix version was compiled with the GUI and/or X11 (check the output of ":version" for "+GUI" and "+X11"), it may need to load shared libraries and connect to the X11 server. Try compiling a version with GUI and X11 diff --git a/runtime/doc/tags b/runtime/doc/tags index a8c8a676..a36ceb85 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -1772,8 +1772,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* :Print various.txt /*:Print* :Rexplore pi_netrw.txt /*:Rexplore* :RmVimball pi_vimball.txt /*:RmVimball* +:Sexplore pi_netrw.txt /*:Sexplore* :TOhtml syntax.txt /*:TOhtml* :Texplore pi_netrw.txt /*:Texplore* +:Untarvim pi_tar.txt /*:Untarvim* :UseVimball pi_vimball.txt /*:UseVimball* :Vexplore pi_netrw.txt /*:Vexplore* :VimballList pi_vimball.txt /*:VimballList* @@ -5617,8 +5619,10 @@ g:gnat.Tags() ft_ada.txt /*g:gnat.Tags()* g:gnat.Tags_Command ft_ada.txt /*g:gnat.Tags_Command* 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_browse_split pi_netrw.txt /*g:netrw_browse_split* g:netrw_browsex_viewer pi_netrw.txt /*g:netrw_browsex_viewer* +g:netrw_chgperm pi_netrw.txt /*g:netrw_chgperm* g:netrw_chgwin pi_netrw.txt /*g:netrw_chgwin* g:netrw_compress pi_netrw.txt /*g:netrw_compress* g:netrw_ctags pi_netrw.txt /*g:netrw_ctags* @@ -5626,7 +5630,6 @@ g:netrw_cursorline pi_netrw.txt /*g:netrw_cursorline* g:netrw_cygwin pi_netrw.txt /*g:netrw_cygwin* g:netrw_dav_cmd pi_netrw.txt /*g:netrw_dav_cmd* g:netrw_decompress pi_netrw.txt /*g:netrw_decompress* -g:netrw_extracmd pi_netrw.txt /*g:netrw_extracmd* g:netrw_fastbrowse pi_netrw.txt /*g:netrw_fastbrowse* g:netrw_fetch_cmd pi_netrw.txt /*g:netrw_fetch_cmd* g:netrw_fname_escape pi_netrw.txt /*g:netrw_fname_escape* @@ -5636,6 +5639,7 @@ g:netrw_ftp_cmd pi_netrw.txt /*g:netrw_ftp_cmd* g:netrw_ftp_list_cmd pi_netrw.txt /*g:netrw_ftp_list_cmd* g:netrw_ftp_sizelist_cmd pi_netrw.txt /*g:netrw_ftp_sizelist_cmd* g:netrw_ftp_timelist_cmd pi_netrw.txt /*g:netrw_ftp_timelist_cmd* +g:netrw_ftpextracmd pi_netrw.txt /*g:netrw_ftpextracmd* g:netrw_ftpmode pi_netrw.txt /*g:netrw_ftpmode* g:netrw_glob_escape pi_netrw.txt /*g:netrw_glob_escape* g:netrw_hide pi_netrw.txt /*g:netrw_hide* @@ -5654,6 +5658,7 @@ g:netrw_localmovecmd pi_netrw.txt /*g:netrw_localmovecmd* g:netrw_maxfilenamelen pi_netrw.txt /*g:netrw_maxfilenamelen* g:netrw_menu pi_netrw.txt /*g:netrw_menu* g:netrw_mkdir_cmd pi_netrw.txt /*g:netrw_mkdir_cmd* +g:netrw_mousemaps pi_netrw.txt /*g:netrw_mousemaps* g:netrw_nogx pi_netrw.txt /*g:netrw_nogx* g:netrw_preview pi_netrw.txt /*g:netrw_preview* g:netrw_rcp_cmd pi_netrw.txt /*g:netrw_rcp_cmd* @@ -5686,6 +5691,8 @@ g:netrw_winsize pi_netrw.txt /*g:netrw_winsize* g:netrw_xstrlen pi_netrw.txt /*g:netrw_xstrlen* g:tar_browseoptions pi_tar.txt /*g:tar_browseoptions* g:tar_cmd pi_tar.txt /*g:tar_cmd* +g:tar_copycmd pi_tar.txt /*g:tar_copycmd* +g:tar_extractcmd pi_tar.txt /*g:tar_extractcmd* g:tar_nomax pi_tar.txt /*g:tar_nomax* g:tar_readoptions pi_tar.txt /*g:tar_readoptions* g:tar_secure pi_tar.txt /*g:tar_secure* @@ -5693,7 +5700,6 @@ g:tar_writeoptions pi_tar.txt /*g:tar_writeoptions* g:var eval.txt /*g:var* g:vimball_home pi_vimball.txt /*g:vimball_home* g:vimball_mkdir pi_vimball.txt /*g:vimball_mkdir* -g:vimball_path_escape pi_vimball.txt /*g:vimball_path_escape* g:vimsyn_embed syntax.txt /*g:vimsyn_embed* g:vimsyn_folding syntax.txt /*g:vimsyn_folding* g:vimsyn_maxlines syntax.txt /*g:vimsyn_maxlines* @@ -6527,6 +6533,7 @@ netrw-O pi_netrw.txt /*netrw-O* netrw-P pi_netrw.txt /*netrw-P* netrw-R pi_netrw.txt /*netrw-R* netrw-S pi_netrw.txt /*netrw-S* +netrw-T pi_netrw.txt /*netrw-T* netrw-U pi_netrw.txt /*netrw-U* netrw-a pi_netrw.txt /*netrw-a* netrw-activate pi_netrw.txt /*netrw-activate* @@ -6544,6 +6551,7 @@ netrw-cadaver pi_netrw.txt /*netrw-cadaver* netrw-chgup pi_netrw.txt /*netrw-chgup* netrw-clean pi_netrw.txt /*netrw-clean* netrw-contents pi_netrw.txt /*netrw-contents* +netrw-copyright pi_netrw.txt /*netrw-copyright* netrw-cr pi_netrw.txt /*netrw-cr* netrw-credits pi_netrw.txt /*netrw-credits* netrw-ctrl-h pi_netrw.txt /*netrw-ctrl-h* @@ -6570,6 +6578,7 @@ netrw-ftype pi_netrw.txt /*netrw-ftype* netrw-gb pi_netrw.txt /*netrw-gb* netrw-getftype pi_netrw.txt /*netrw-getftype* netrw-gh pi_netrw.txt /*netrw-gh* +netrw-gp pi_netrw.txt /*netrw-gp* netrw-gx pi_netrw.txt /*netrw-gx* netrw-handler pi_netrw.txt /*netrw-handler* netrw-help pi_netrw.txt /*netrw-help* @@ -6581,6 +6590,7 @@ netrw-horiz pi_netrw.txt /*netrw-horiz* netrw-i pi_netrw.txt /*netrw-i* netrw-incompatible pi_netrw.txt /*netrw-incompatible* netrw-intro-browse pi_netrw.txt /*netrw-intro-browse* +netrw-leftmouse pi_netrw.txt /*netrw-leftmouse* netrw-list pi_netrw.txt /*netrw-list* netrw-listbookmark pi_netrw.txt /*netrw-listbookmark* netrw-listhack pi_netrw.txt /*netrw-listhack* @@ -6594,8 +6604,10 @@ netrw-me pi_netrw.txt /*netrw-me* netrw-mf pi_netrw.txt /*netrw-mf* netrw-mg pi_netrw.txt /*netrw-mg* netrw-mh pi_netrw.txt /*netrw-mh* +netrw-middlemouse pi_netrw.txt /*netrw-middlemouse* netrw-ml_get pi_netrw.txt /*netrw-ml_get* netrw-mm pi_netrw.txt /*netrw-mm* +netrw-mouse pi_netrw.txt /*netrw-mouse* netrw-move pi_netrw.txt /*netrw-move* netrw-mp pi_netrw.txt /*netrw-mp* netrw-mr pi_netrw.txt /*netrw-mr* @@ -6647,6 +6659,7 @@ netrw-ref pi_netrw.txt /*netrw-ref* netrw-rename pi_netrw.txt /*netrw-rename* netrw-reverse pi_netrw.txt /*netrw-reverse* netrw-rexplore pi_netrw.txt /*netrw-rexplore* +netrw-rightmouse pi_netrw.txt /*netrw-rightmouse* netrw-s pi_netrw.txt /*netrw-s* netrw-settings pi_netrw.txt /*netrw-settings* netrw-sexplore pi_netrw.txt /*netrw-sexplore* @@ -6661,6 +6674,7 @@ netrw-starstarpat pi_netrw.txt /*netrw-starstarpat* netrw-start pi_netrw.txt /*netrw-start* netrw-t pi_netrw.txt /*netrw-t* netrw-texplore pi_netrw.txt /*netrw-texplore* +netrw-todo pi_netrw.txt /*netrw-todo* netrw-transparent pi_netrw.txt /*netrw-transparent* netrw-u pi_netrw.txt /*netrw-u* netrw-uidpass pi_netrw.txt /*netrw-uidpass* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 340dcd96..e888ebe9 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.2. Last change: 2009 Dec 24 +*todo.txt* For Vim version 7.2. Last change: 2010 Jan 12 VIM REFERENCE MANUAL by Bram Moolenaar @@ -30,15 +30,15 @@ be worked on, but only if you sponsor Vim development. See |sponsor|. *known-bugs* -------------------- Known bugs and current work ----------------------- -Extention for MzScheme interface. (Sergey Khorev, 2009 Dec 21) +Patch from Dominique Pelle, documentation fixes. (2010 Jan 9) +Another patch for README files. -Suggestion for more verbose test output and exit status. (Petr Splichal) -Lech: later version already does this. +Extention for MzScheme interface. (Sergey Khorev, 2009 Dec 21, update Dec 26) -When there is a stray "w" in the .vimrc file, the edited file is overwritten -with an empty file. (Stone Kang). -Detect that the file was not read and either read it first or give an error -message. +patch from Sergey Khorev for "*" command escaping. (2010 Jan 5) + +Patch: :compiler command doesn't function properly when invoked in a function +(Yukihiro Nakadaira) iconv() doesn't fail on an illegal character, as documented. (Yongwei Wu, 2009 Nov 15, example Nov 26) Add argument to specify whether iconv() should fail @@ -49,10 +49,24 @@ Michael Wookey, 2009 Oct 16) Better: if the window offset was negative before changing something, then don't change it. +Patch to make CTRL-] work on scheme keywords. (Sergey Khorev, 2010 Jan 5) + +Omni menu position one column too far to the right, double-wide chars split to +next line. (Jiang Ma, 2010 Jan 10) +Explicit example from Dominique. +Need to check that the last character fits? +Patch from Dominique Pelle. (2010 Jan 12) + +has("win64") returns zero. Patch from Sergey Khorev, 2009 Jan 5. +Or define WIN64 when _WIN64 is defined, change all _WIN64 to WIN64. + Add local time at start of --startuptime output. Requires configure check for localtime(). Use format year-month-day hr:min:sec. +Patch to support netbeans in Unix console Vim. (Xaview de Gaye, 2009 Apr 26) +Now with Mercurial repository (2010 Jan 2) + Shell not recognized properly if it ends in "csh -f". (James Vega, 2009 Nov 3) Find tail? Might have a / in argument. Find space? Might have space in path. @@ -447,8 +461,6 @@ Backreference not cleared when retrying after \@<= fails? Problem with remote_send(). (Charles Campbell, 2008 Aug 12) -Patch to support netbeans in Unix console Vim. (Xaview de Gaye, 2009 Apr 26) - ftplugin for help file should set 'isk' to help file value. Win32: remote editing fails when the current directory name contains "[". @@ -1131,7 +1143,7 @@ restored. (Luc St-Louis) Vim 7.3: -- Use latest autoconf (3.64) +- Use latest autoconf (2.65) - Use NSIS 2.45, it includes Windows 7 support. - Include all files in distro, no "extra" and "lang" package. - Create Mercurial repository. diff --git a/runtime/doc/uganda.txt b/runtime/doc/uganda.txt index 8f684e83..64d52971 100644 --- a/runtime/doc/uganda.txt +++ b/runtime/doc/uganda.txt @@ -1,4 +1,4 @@ -*uganda.txt* For Vim version 7.2. Last change: 2008 Jun 21 +*uganda.txt* For Vim version 7.2. Last change: 2009 Dec 27 VIM REFERENCE MANUAL by Bram Moolenaar @@ -194,11 +194,12 @@ child, you should have the intention to do this for at least one year. How do you know that the money will be spent right? First of all you have my personal guarantee as the author of Vim. I trust the people that are working -at the centre, I know them personally. Further more, the centre is -co-sponsored and inspected by World Vision, Save the Children Fund and -International Child Care Fund. The centre is visited about once a year to -check the progress (at our own cost). I have visited the centre myself in -1996, 1998, 2000, 2001 and 2003. The visit reports are on the ICCF web site. +at the centre, I know them personally. Further more, the centre has been +co-sponsored and inspected by World Vision, Save the Children Fund and is now +under the supervision of Pacific Academy Outreach Society. The centre is +visited about once a year to check the progress (at our own cost). I have +visited the centre myself many times, starting in 1993. The visit reports are +on the ICCF web site. If you have any further questions, send me e-mail: . diff --git a/runtime/getdos.aap b/runtime/getdos.aap index 0aa2ba67..779280dc 100644 --- a/runtime/getdos.aap +++ b/runtime/getdos.aap @@ -52,7 +52,7 @@ all fetch: @if get_md5(file) != "e837d0bd941a19b70b2ca802b31612dc": :fetch {fetch = $fetcha} $file file = doc/pi_vimball.txt - @if get_md5(file) != "a212535a2a8d5c6a85f57ff229e6936a": + @if get_md5(file) != "5cbc17be15ea203ea0da2a6295bb1543": :fetch {fetch = $fetcha} $file file = doc/if_sniff.txt @if get_md5(file) != "79202f98c95f78a6a67e35434b46b44c": @@ -94,7 +94,7 @@ all fetch: @if get_md5(file) != "1b9855a44b9feb444d792c59bd7f7edb": :fetch {fetch = $fetcha} $file file = doc/todo.txt - @if get_md5(file) != "6731f1f3274a616491ff26d65f299f2d": + @if get_md5(file) != "c6dc7fefdf6841c514434c38ac2acef4": :fetch {fetch = $fetcha} $file file = doc/usr_25.txt @if get_md5(file) != "f6b5a9c09cdedc9bce3216322a6cc68b": @@ -112,7 +112,7 @@ all fetch: @if get_md5(file) != "d3c46b60c831f019b768ef024738b9ab": :fetch {fetch = $fetcha} $file file = doc/pi_netrw.txt - @if get_md5(file) != "31bd166a411234e937961650213e16b9": + @if get_md5(file) != "4f1b861c548e44418071a4592279419a": :fetch {fetch = $fetcha} $file file = doc/if_mzsch.txt @if get_md5(file) != "282598c4010127e2182ac8e8842fdfb8": @@ -136,13 +136,13 @@ all fetch: @if get_md5(file) != "22ff4577aa52b2341df58f7879920760": :fetch {fetch = $fetcha} $file file = doc/eval.txt - @if get_md5(file) != "a76f1ee19ee2106885f7540158220874": + @if get_md5(file) != "74317120639d0be9a5b9ee3e8f7b7cfd": :fetch {fetch = $fetcha} $file file = doc/os_beos.txt @if get_md5(file) != "39cfffc1588db699e71c3826fe455482": :fetch {fetch = $fetcha} $file file = doc/starting.txt - @if get_md5(file) != "8ed75b32304ecd36ec86d65e26758c2f": + @if get_md5(file) != "885a3a617d6d03c7e9423b13fbb3a977": :fetch {fetch = $fetcha} $file file = doc/workshop.txt @if get_md5(file) != "6aec1ae9fe97867bb3439a775f4d995b": @@ -223,7 +223,7 @@ all fetch: @if get_md5(file) != "96b4b4638a6bf87c717ed1272bdb05ff": :fetch {fetch = $fetcha} $file file = doc/pi_tar.txt - @if get_md5(file) != "a71b9090608ebedd3d2d285e8035e82e": + @if get_md5(file) != "c407b5dbe043746fc58213d39d645a0c": :fetch {fetch = $fetcha} $file file = doc/os_os2.txt @if get_md5(file) != "b5312691ef15c19b98aa952a0bc9f3cc": @@ -262,7 +262,7 @@ all fetch: @if get_md5(file) != "02dd25cb7a9be1e597e30977a007f8ce": :fetch {fetch = $fetcha} $file file = doc/options.txt - @if get_md5(file) != "1c74e7d2e50ecc786b415e6dbee85930": + @if get_md5(file) != "ee79325fee2d4a52d9e38fdbddadab84": :fetch {fetch = $fetcha} $file file = doc/recover.txt @if get_md5(file) != "5fa27261a8a8696d844407d9d0de6654": @@ -322,7 +322,7 @@ all fetch: @if get_md5(file) != "c641b9d0d481c01856fd590c240ec6fd": :fetch {fetch = $fetcha} $file file = doc/pi_getscript.txt - @if get_md5(file) != "fbdc5af7e241ad41ebabada81df334bd": + @if get_md5(file) != "c31f08ffcc946808e8f727dba111be97": :fetch {fetch = $fetcha} $file file = doc/usr_24.txt @if get_md5(file) != "bc76dd81312c845766e7952ab25391bd": @@ -361,7 +361,7 @@ all fetch: @if get_md5(file) != "8b2aa3d3baa7c32c9a57802c99265fd6": :fetch {fetch = $fetcha} $file file = doc/uganda.txt - @if get_md5(file) != "b639f685802cc8fc4091711f752bba72": + @if get_md5(file) != "f89fb695114630759faebbb46667910e": :fetch {fetch = $fetcha} $file file = doc/remote.txt @if get_md5(file) != "47b5561b58e6de0115ecea6228043cad": @@ -544,7 +544,10 @@ all fetch: :fetch {fetch = $fetcha} $file :mkdir {f} tools file = tools/README.txt - @if get_md5(file) != "8ed9e3ab8578b57bc9f4ed02bd3a6547": + @if get_md5(file) != "9e1b7426c3f92955d6f798f3982f70ff": + :fetch {fetch = $fetcha} $file + file = tools/unicode.vim + @if get_md5(file) != "6cbb4596df64098ca4a58955937eeb46": :fetch {fetch = $fetcha} $file file = tools/vimspell.txt @if get_md5(file) != "cd06b37cc90c041147c4cec9d727ffe1": @@ -645,13 +648,13 @@ all fetch: @if get_md5(file) != "596171ad6a5ad77cd799af17f2bb69b0": :fetch {fetch = $fetcha} $file file = autoload/tar.vim - @if get_md5(file) != "796328c2dc21abf6f0727c975b187056": + @if get_md5(file) != "f1d1cf0fe907a720654da5357ca88cbf": :fetch {fetch = $fetcha} $file file = autoload/decada.vim @if get_md5(file) != "e92836527f258c3b933edfacc3b5ea33": :fetch {fetch = $fetcha} $file file = autoload/netrw.vim - @if get_md5(file) != "7389e5b650207bfc60549874c89cd39d": + @if get_md5(file) != "47a46053b1a13a2d2066721e931d7a45": :fetch {fetch = $fetcha} $file file = autoload/phpcomplete.vim @if get_md5(file) != "8709ea94420dfb37ba33f7d8e0780fdd": @@ -666,7 +669,7 @@ all fetch: @if get_md5(file) != "27ba98ce8382fe7a7bae140518fabae1": :fetch {fetch = $fetcha} $file file = autoload/vimball.vim - @if get_md5(file) != "28055c585ab4fcf688a74fdc56f965c6": + @if get_md5(file) != "1095af815084aa6f8926130e6b855dd1": :fetch {fetch = $fetcha} $file file = autoload/zip.vim @if get_md5(file) != "3e099ccf05465dadcc690f5b098385ad": @@ -690,7 +693,7 @@ all fetch: @if get_md5(file) != "cb4c668cbe26f1b8f896caff9a4cf2c8": :fetch {fetch = $fetcha} $file file = autoload/getscript.vim - @if get_md5(file) != "583629b228eb0ee9ae2a84545290a24b": + @if get_md5(file) != "8b1c90b698b542ab9deb2a712fd8d3bd": :fetch {fetch = $fetcha} $file file = autoload/xmlcomplete.vim @if get_md5(file) != "162431c8ad7e4bd183d460bc9736aef1": @@ -1144,7 +1147,7 @@ all fetch: @if get_md5(file) != "1971d1e2bb7fd8ba27d8d4d35daf9782": :fetch {fetch = $fetcha} $file file = indent/sh.vim - @if get_md5(file) != "5930ac7711d64c2f3efff55c8542851b": + @if get_md5(file) != "d923392f549a0b3cbca30aa94fb79475": :fetch {fetch = $fetcha} $file file = indent/html.vim @if get_md5(file) != "2e0da1e50c79736efa91d644d03f8c5b": @@ -1740,7 +1743,7 @@ all fetch: @if get_md5(file) != "2b3dc0d481bf35fbcd9c3d29f9fc04f8": :fetch {fetch = $fetcha} $file file = plugin/netrwPlugin.vim - @if get_md5(file) != "d04d142b2809265e99aed19bd02a1e17": + @if get_md5(file) != "25b9725a37fb1ec38bae876b81fc81a4": :fetch {fetch = $fetcha} $file file = plugin/zipPlugin.vim @if get_md5(file) != "c0f44364b7de88783a4b48963ab87e96": @@ -1755,13 +1758,13 @@ all fetch: @if get_md5(file) != "78a26299e645b91f831e66c34c2b61cb": :fetch {fetch = $fetcha} $file file = plugin/vimballPlugin.vim - @if get_md5(file) != "1f09c8729d82991b8ee280b2f5897494": + @if get_md5(file) != "4ed426d724f1fe016b6c958e107aaaf4": :fetch {fetch = $fetcha} $file file = plugin/tarPlugin.vim - @if get_md5(file) != "2ee624b686c369eddcbf5d17371413d8": + @if get_md5(file) != "f15e92d562428e94ef9f52130095fe7e": :fetch {fetch = $fetcha} $file file = plugin/getscriptPlugin.vim - @if get_md5(file) != "089d7175dcc05539edca7ad79a190a65": + @if get_md5(file) != "773379c786b40f24ce37238f3f54e8ba": :fetch {fetch = $fetcha} $file file = plugin/matchparen.vim @if get_md5(file) != "2134e664165128ef80011bfe1e9ec527": @@ -1894,7 +1897,7 @@ all fetch: @if get_md5(file) != "f71ac691567c4c565318bfb2fd4f4e95": :fetch {fetch = $fetcha} $file file = syntax/netrc.vim - @if get_md5(file) != "6ff38bd5114faa25cc02f513d6e0802b": + @if get_md5(file) != "5a3e5f65a2bc1cb67192d3309de8d809": :fetch {fetch = $fetcha} $file file = syntax/snnsres.vim @if get_md5(file) != "8a2abb36991f8449fc0ee6dd5ef5bab6": @@ -2005,7 +2008,7 @@ all fetch: @if get_md5(file) != "0db375dd7ce310cfa284f30887b7a932": :fetch {fetch = $fetcha} $file file = syntax/tex.vim - @if get_md5(file) != "0041ab0e3a597f178ab65d523c84f017": + @if get_md5(file) != "91863e17729280fc37ef3d01335b812b": :fetch {fetch = $fetcha} $file file = syntax/sed.vim @if get_md5(file) != "86a1df1069d3802fa1e59ca50f3696d8": @@ -2104,7 +2107,7 @@ all fetch: @if get_md5(file) != "e2aee541a85ac52c3e77d7d5f08ab9cf": :fetch {fetch = $fetcha} $file file = syntax/netrw.vim - @if get_md5(file) != "530608f555798744640d3dcdebebd905": + @if get_md5(file) != "4b544b7516ec57d79a5787c359112ea7": :fetch {fetch = $fetcha} $file file = syntax/conf.vim @if get_md5(file) != "23abccf483e0756cce09636eb57cb0ab": @@ -2581,7 +2584,7 @@ all fetch: @if get_md5(file) != "6f726f41220b88ed5211302a95dcb681": :fetch {fetch = $fetcha} $file file = syntax/vim.vim - @if get_md5(file) != "8fdb5a6cf2beff59020afaeca7c610d8": + @if get_md5(file) != "cf3b5a5ec6be244daf6be8b256a14a09": :fetch {fetch = $fetcha} $file file = syntax/msidl.vim @if get_md5(file) != "835f2f1c100a434ba8eac461781849b7": @@ -2824,7 +2827,7 @@ all fetch: @if get_md5(file) != "a9bdaa62aaebadc705155b8945c7d3ad": :fetch {fetch = $fetcha} $file file = syntax/asm.vim - @if get_md5(file) != "3298deec550e755f600a741bdceb08e7": + @if get_md5(file) != "5f6d76056ad4fdee1d14ee7f921ec0c3": :fetch {fetch = $fetcha} $file file = syntax/javacc.vim @if get_md5(file) != "ef7e9e58ed0c491b89062d1423ed034a": @@ -2872,7 +2875,7 @@ all fetch: @if get_md5(file) != "36466cacc48f3cd6a0291b3341be4cb3": :fetch {fetch = $fetcha} $file file = syntax/sh.vim - @if get_md5(file) != "9d1c33947ffeaff9adde84a19bbeaf51": + @if get_md5(file) != "1aac6993077af948452df76bf2e4bf70": :fetch {fetch = $fetcha} $file file = syntax/html.vim @if get_md5(file) != "4b96fe0bec800facfa9a21d7ffe8605d": @@ -3316,7 +3319,7 @@ all fetch: @if get_md5(file) != "0b7106e6a1980ac5928443213cc2dd5a": :fetch {fetch = $fetcha} $file file = syntax/screen.vim - @if get_md5(file) != "2a29f9a4a2e6ec37da4bd43ca05729b4": + @if get_md5(file) != "fd29d6cbd3fe9aa14fd3507a0373dcf9": :fetch {fetch = $fetcha} $file file = syntax/tsscl.vim @if get_md5(file) != "4777ea8bd5b1e714f3e7ce423a81ce88": @@ -4249,7 +4252,7 @@ all fetch: @if get_md5(file) != "af0da03b5c998a8f8ed94a66763febd9": :fetch {fetch = $fetcha} $file file = doc/tags - @if get_md5(file) != "14f5993ce477a57a34c563cab2613b32": + @if get_md5(file) != "f576842cf89a3729d88e558578923453": :fetch {fetch = $fetcha} $file :mkdir {f} print file = print/jis_roman.ps diff --git a/runtime/getunix.aap b/runtime/getunix.aap index d5c742be..70e7034a 100644 --- a/runtime/getunix.aap +++ b/runtime/getunix.aap @@ -52,7 +52,7 @@ all fetch: @if get_md5(file) != "4bc293abab39bc31b8e60dfee4d96753": :fetch {fetch = $fetcha} $file file = doc/pi_vimball.txt - @if get_md5(file) != "eba8440acfe0e0b3e9e1e616ac2250d3": + @if get_md5(file) != "356af962c1ca6a1b66ec150b9e53ab1c": :fetch {fetch = $fetcha} $file file = doc/if_sniff.txt @if get_md5(file) != "4d449d06dacfb50929f09e9b9e35a640": @@ -94,7 +94,7 @@ all fetch: @if get_md5(file) != "701bb75ecd83ea0588c89d4efc62b0ec": :fetch {fetch = $fetcha} $file file = doc/todo.txt - @if get_md5(file) != "5eaa698fd659e956bcfb17ea8b0aa7c9": + @if get_md5(file) != "939c6e65bf26e81c82c66c694cdb1d0b": :fetch {fetch = $fetcha} $file file = doc/usr_25.txt @if get_md5(file) != "525e8f47371e991590d1afcc5b1a1490": @@ -112,7 +112,7 @@ all fetch: @if get_md5(file) != "248a7f496274ff411301e843f0c991d7": :fetch {fetch = $fetcha} $file file = doc/pi_netrw.txt - @if get_md5(file) != "af45f38fa96e32fc201138e236aad684": + @if get_md5(file) != "ddf203097d08efad157b25b7ff064df7": :fetch {fetch = $fetcha} $file file = doc/if_mzsch.txt @if get_md5(file) != "74467b06036149f00b7e30165638645c": @@ -136,13 +136,13 @@ all fetch: @if get_md5(file) != "c564aa21efc9a54eee203f47daab956f": :fetch {fetch = $fetcha} $file file = doc/eval.txt - @if get_md5(file) != "b0787a72350372172bbef7b44e60ace2": + @if get_md5(file) != "bcc1f34dc3a72eee323de55391b39a31": :fetch {fetch = $fetcha} $file file = doc/os_beos.txt @if get_md5(file) != "21cbefe42c374a13c1eb541c4254d2a6": :fetch {fetch = $fetcha} $file file = doc/starting.txt - @if get_md5(file) != "6eaf79544cd931943f5442636499e3cc": + @if get_md5(file) != "0c52d4bfec9025cf30a613e21dd6d2eb": :fetch {fetch = $fetcha} $file file = doc/workshop.txt @if get_md5(file) != "219e66a64511610faebdc8db4c6fe960": @@ -223,7 +223,7 @@ all fetch: @if get_md5(file) != "5ca3ce8eaca47588e1bc9bf16a1afcd0": :fetch {fetch = $fetcha} $file file = doc/pi_tar.txt - @if get_md5(file) != "898b6fec4886595d66b5c7ff304c98bd": + @if get_md5(file) != "1a9cd6042de87dc278a7069b69069dd9": :fetch {fetch = $fetcha} $file file = doc/os_os2.txt @if get_md5(file) != "da7a3725eea68d0f8874c7f2847326f8": @@ -262,7 +262,7 @@ all fetch: @if get_md5(file) != "fcae6fb97538151b2d4c4346cecfc08d": :fetch {fetch = $fetcha} $file file = doc/options.txt - @if get_md5(file) != "dd77f93d230b2c83fb5a6a93ca8bcf19": + @if get_md5(file) != "54dd34ad393268ed2294c38ae047898f": :fetch {fetch = $fetcha} $file file = doc/recover.txt @if get_md5(file) != "fcb01435557cdc480587cf32fe919ffb": @@ -322,7 +322,7 @@ all fetch: @if get_md5(file) != "1d38b3d80a3db4e71059855c26915cdf": :fetch {fetch = $fetcha} $file file = doc/pi_getscript.txt - @if get_md5(file) != "5644deb8826c1f7b3421aa88b07c5d13": + @if get_md5(file) != "28a01dc120395149422963df6e818863": :fetch {fetch = $fetcha} $file file = doc/usr_24.txt @if get_md5(file) != "a9f897ebadd1d88dd7382b9d6cf33797": @@ -361,7 +361,7 @@ all fetch: @if get_md5(file) != "5565c3ca74312a8780248dd8fa571dac": :fetch {fetch = $fetcha} $file file = doc/uganda.txt - @if get_md5(file) != "cd49910a3dde6fe0a7e24ebe8cbf7066": + @if get_md5(file) != "d6c419f26a6c02392eed1243bf81fa34": :fetch {fetch = $fetcha} $file file = doc/remote.txt @if get_md5(file) != "edf35da5c8b17fdc90539b219e8359be": @@ -544,7 +544,10 @@ all fetch: :fetch {fetch = $fetcha} $file :mkdir {f} tools file = tools/README.txt - @if get_md5(file) != "46b5996890be341dc40c5e8d1474a8dd": + @if get_md5(file) != "735fb2b96c24248203bfc84202ff098d": + :fetch {fetch = $fetcha} $file + file = tools/unicode.vim + @if get_md5(file) != "c17cf862a5bc34dba8a4e1a73cd3bbfb": :fetch {fetch = $fetcha} $file file = tools/vimspell.txt @if get_md5(file) != "de927b7bc390f47063d23d0d9d4e144f": @@ -645,13 +648,13 @@ all fetch: @if get_md5(file) != "9edb84845c5f6b2c8bf9cb4814091b4b": :fetch {fetch = $fetcha} $file file = autoload/tar.vim - @if get_md5(file) != "131fc15bfca3fbf53c90bc5e69149e26": + @if get_md5(file) != "b096aadbaba470f9b3eeb8ad07aa724a": :fetch {fetch = $fetcha} $file file = autoload/decada.vim @if get_md5(file) != "852a3d8c5283c21d0710458c40c6f477": :fetch {fetch = $fetcha} $file file = autoload/netrw.vim - @if get_md5(file) != "6bbbd7eff82e2952c5872fa4c0867cb2": + @if get_md5(file) != "1ca5c02b67ccd673d824aa564f421050": :fetch {fetch = $fetcha} $file file = autoload/phpcomplete.vim @if get_md5(file) != "3038d5b696be03eec87ec9bf51fdd452": @@ -666,7 +669,7 @@ all fetch: @if get_md5(file) != "ba739ccee94f56862bbc2526cf7dc390": :fetch {fetch = $fetcha} $file file = autoload/vimball.vim - @if get_md5(file) != "9d528b4d33c3efdb8a4861bc9cceb92b": + @if get_md5(file) != "d1be8a5f3b2e2bcf5975857335e299ca": :fetch {fetch = $fetcha} $file file = autoload/zip.vim @if get_md5(file) != "1a4f70b2747396454da418853372a87b": @@ -690,7 +693,7 @@ all fetch: @if get_md5(file) != "27369cb36bebd758286dc4fcff2b046c": :fetch {fetch = $fetcha} $file file = autoload/getscript.vim - @if get_md5(file) != "347e1d4fd65c49848eaf622a08c95ed1": + @if get_md5(file) != "22891219d43b197d5b38f3e7ff2dabb6": :fetch {fetch = $fetcha} $file file = autoload/xmlcomplete.vim @if get_md5(file) != "beca52b0d638c14d259a4c68417d6470": @@ -1144,7 +1147,7 @@ all fetch: @if get_md5(file) != "1057c3812cd98eaeed5c03da2b9650b4": :fetch {fetch = $fetcha} $file file = indent/sh.vim - @if get_md5(file) != "43b8d1871805989e5e4df5a1618d7324": + @if get_md5(file) != "dc42e3e98c396dd9273857916596617e": :fetch {fetch = $fetcha} $file file = indent/html.vim @if get_md5(file) != "0298938797abe6d71d3007a42d1c9afb": @@ -1740,7 +1743,7 @@ all fetch: @if get_md5(file) != "3a0229858bdf46cbe700e99259c72908": :fetch {fetch = $fetcha} $file file = plugin/netrwPlugin.vim - @if get_md5(file) != "99d31fbc5d0584f96850294b0e59f38d": + @if get_md5(file) != "0bc994bbed06f02765696d7391ee21ac": :fetch {fetch = $fetcha} $file file = plugin/zipPlugin.vim @if get_md5(file) != "1e2bf815f7c635c8929f73cc87bbec6b": @@ -1755,13 +1758,13 @@ all fetch: @if get_md5(file) != "561f55a478fee8efcce9313fc26c5f90": :fetch {fetch = $fetcha} $file file = plugin/vimballPlugin.vim - @if get_md5(file) != "00317c756b7a7431a66408832718fcb5": + @if get_md5(file) != "2387f2b525133dd6a05396c1ee2fdab6": :fetch {fetch = $fetcha} $file file = plugin/tarPlugin.vim - @if get_md5(file) != "1ea213b60347709680caf3a533ce011d": + @if get_md5(file) != "a728f6dabc3bfce8e27fa32c606571b0": :fetch {fetch = $fetcha} $file file = plugin/getscriptPlugin.vim - @if get_md5(file) != "fd94b1bc7c7f89a82a54e2d69a56c5a5": + @if get_md5(file) != "da5ae7e14a9dc230cc29d95be6e469ce": :fetch {fetch = $fetcha} $file file = plugin/matchparen.vim @if get_md5(file) != "49453aada55c0848800f757fc61098c6": @@ -1894,7 +1897,7 @@ all fetch: @if get_md5(file) != "6a7275ef2849a6aa8dfe32fbd7273afe": :fetch {fetch = $fetcha} $file file = syntax/netrc.vim - @if get_md5(file) != "e282ece4a77bfae75ea14babe801e226": + @if get_md5(file) != "b61072b620503c62508b67dd104cc901": :fetch {fetch = $fetcha} $file file = syntax/snnsres.vim @if get_md5(file) != "5a980a36850bad480de07f027a44cc3e": @@ -2005,7 +2008,7 @@ all fetch: @if get_md5(file) != "86e87f1f842d84a35658b64b985324fd": :fetch {fetch = $fetcha} $file file = syntax/tex.vim - @if get_md5(file) != "a1b33425b98352acf45a1ef259571ff1": + @if get_md5(file) != "0d7afab2c87dc3880509cabc1c7efb48": :fetch {fetch = $fetcha} $file file = syntax/sed.vim @if get_md5(file) != "ea092330610b916eec1907c93544f5ca": @@ -2104,7 +2107,7 @@ all fetch: @if get_md5(file) != "6a76c5afa8d3cc092866b13ff63b4df5": :fetch {fetch = $fetcha} $file file = syntax/netrw.vim - @if get_md5(file) != "590564bf0210dbfd1546657614daa615": + @if get_md5(file) != "c1ec2815c74959c4a559f6469ce1447c": :fetch {fetch = $fetcha} $file file = syntax/conf.vim @if get_md5(file) != "a9881c410f91621ac8dfb9e710fb4c43": @@ -2581,7 +2584,7 @@ all fetch: @if get_md5(file) != "46c52921e8b81cb500658375e5701c3e": :fetch {fetch = $fetcha} $file file = syntax/vim.vim - @if get_md5(file) != "95d29ad685ad6847b48a1949dd9b8539": + @if get_md5(file) != "9a12e095c9902f6345574e429b45769f": :fetch {fetch = $fetcha} $file file = syntax/msidl.vim @if get_md5(file) != "eb037e35662ac8ccabcd078af3af66ec": @@ -2824,7 +2827,7 @@ all fetch: @if get_md5(file) != "c1ace03caefa6de925314eb12ad27f8d": :fetch {fetch = $fetcha} $file file = syntax/asm.vim - @if get_md5(file) != "dda6c624d218ceb94483ea9ea8f3706f": + @if get_md5(file) != "8c1a1d07f3e2034f26fbbc3dd6a3ee08": :fetch {fetch = $fetcha} $file file = syntax/javacc.vim @if get_md5(file) != "7b156ea71037e54fe736b0ae11c00a82": @@ -2872,7 +2875,7 @@ all fetch: @if get_md5(file) != "f7703d6a07b474137cfe145997f3a04c": :fetch {fetch = $fetcha} $file file = syntax/sh.vim - @if get_md5(file) != "c7b63842d993cfcc7e648e8c78cdfdf8": + @if get_md5(file) != "339225d22e7cd26ef6946215aa6fdc70": :fetch {fetch = $fetcha} $file file = syntax/html.vim @if get_md5(file) != "d0edaa2f92df84778a7ab6f45a8b4092": @@ -3316,7 +3319,7 @@ all fetch: @if get_md5(file) != "4d4a3816178066451167360799475daf": :fetch {fetch = $fetcha} $file file = syntax/screen.vim - @if get_md5(file) != "73b380e73882dc4b8bbfc527b8c4c9a1": + @if get_md5(file) != "44755ad520910ad0ab593aa2e97936a0": :fetch {fetch = $fetcha} $file file = syntax/tsscl.vim @if get_md5(file) != "c63cf7695e0fc4f06a405c127b81af24": @@ -4624,7 +4627,7 @@ all fetch: @if get_md5(file) != "af0da03b5c998a8f8ed94a66763febd9": :fetch {fetch = $fetcha} $file file = doc/tags - @if get_md5(file) != "539fbbd0281a86016c0908fb909f2bc6": + @if get_md5(file) != "f576842cf89a3729d88e558578923453": :fetch {fetch = $fetcha} $file :mkdir {f} print file = print/jis_roman.ps diff --git a/runtime/indent/sh.vim b/runtime/indent/sh.vim index 9bc59eef..49146c7e 100644 --- a/runtime/indent/sh.vim +++ b/runtime/indent/sh.vim @@ -1,7 +1,7 @@ " Vim indent file " Language: Shell Script " Maintainer: Nikolai Weibull -" Latest Revision: 2009-11-12 +" Latest Revision: 2010-01-06 if exists("b:did_indent") finish @@ -58,7 +58,7 @@ function! GetShIndent() let ind += s:indent_value('default') endif elseif s:is_case_label(line, pnum) - if line !~ ';[;&]\s*\%(#.*\)\=$' + if !s:is_case_ended(line) let ind += s:indent_value('case-statements') endif elseif line =~ '^\s*\<\k\+\>\s*()\s*{' || line =~ '^\s*{' @@ -78,7 +78,9 @@ function! GetShIndent() if line =~ '^\s*\%(then\|do\|else\|elif\|fi\|done\)\>' || line =~ '^\s*}' let ind -= s:indent_value('default') elseif line =~ '^\s*esac\>' - let ind -= s:indent_value('case-statements') + s:indent_value('case-labels') + let ind -= (s:is_case_label(pine, lnum) && s:is_case_ended(pine) ? + \ 0 : s:indent_value('case-statements')) + + \ s:indent_value('case-labels') if s:is_case_break(pine) let ind += s:indent_value('case-breaks') endif @@ -108,13 +110,13 @@ function! s:find_continued_lnum(lnum) endfunction function! s:is_case_label(line, pnum) - if a:line !~ '^\s*(\=.*)\s*$' + if a:line !~ '^\s*(\=.*)' return 0 endif if a:pnum > 0 let pine = getline(a:pnum) - if !(s:is_case(pine) || s:is_case_break(pine)) + if !(s:is_case(pine) || s:is_case_ended(pine)) return 0 endif endif @@ -148,5 +150,9 @@ function! s:is_case_break(line) return a:line =~ '^\s*;[;&]' endfunction +function! s:is_case_ended(line) + return s:is_case_break(a:line) || a:line =~ ';[;&]\s*\%(#.*\)\=$' +endfunction + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/plugin/getscriptPlugin.vim b/runtime/plugin/getscriptPlugin.vim index 4fd36db5..7ae35cb4 100644 --- a/runtime/plugin/getscriptPlugin.vim +++ b/runtime/plugin/getscriptPlugin.vim @@ -19,7 +19,7 @@ if &cp || exists("g:loaded_getscriptPlugin") endif finish endif -let g:loaded_getscriptPlugin = "v31" +let g:loaded_getscriptPlugin = "v32" let s:keepcpo = &cpo set cpo&vim diff --git a/runtime/plugin/netrwPlugin.vim b/runtime/plugin/netrwPlugin.vim index 02ba2864..13798b03 100644 --- a/runtime/plugin/netrwPlugin.vim +++ b/runtime/plugin/netrwPlugin.vim @@ -20,7 +20,7 @@ if &cp || exists("g:loaded_netrwPlugin") finish endif -let g:loaded_netrwPlugin = "v135" +let g:loaded_netrwPlugin = "v136" if v:version < 702 echohl WarningMsg | echo "***netrw*** you need vim version 7.2 for this version of netrw" | echohl None finish diff --git a/runtime/plugin/tarPlugin.vim b/runtime/plugin/tarPlugin.vim index 2ddf7f34..8232b46d 100644 --- a/runtime/plugin/tarPlugin.vim +++ b/runtime/plugin/tarPlugin.vim @@ -14,7 +14,7 @@ if &cp || exists("g:loaded_tarPlugin") finish endif -let g:loaded_tarPlugin = "v23" +let g:loaded_tarPlugin = "v24" let s:keepcpo = &cpo set cpo&vim @@ -34,13 +34,15 @@ augroup tar au FileWriteCmd tarfile::*/* call tar#Write(expand("")) endif - au BufReadCmd *.tar.gz call tar#Browse(expand("")) - au BufReadCmd *.tar call tar#Browse(expand("")) - au BufReadCmd *.lrp call tar#Browse(expand("")) - au BufReadCmd *.tar.bz2 call tar#Browse(expand("")) - au BufReadCmd *.tar.Z call tar#Browse(expand("")) - au BufReadCmd *.tgz call tar#Browse(expand("")) + au BufReadCmd *.tar.gz call tar#Browse(expand("")) + au BufReadCmd *.tar call tar#Browse(expand("")) + au BufReadCmd *.lrp call tar#Browse(expand("")) + au BufReadCmd *.tar.bz2 call tar#Browse(expand("")) + au BufReadCmd *.tar.Z call tar#Browse(expand("")) + au BufReadCmd *.tgz call tar#Browse(expand("")) + au BufReadCmd *.tar.lzma call tar#Browse(expand("")) augroup END +com! -nargs=? -complete=file Vimuntar call tar#Vimuntar() " --------------------------------------------------------------------- " Restoration And Modelines: {{{1 diff --git a/runtime/plugin/vimballPlugin.vim b/runtime/plugin/vimballPlugin.vim index 630bb9fb..1192a6b8 100644 --- a/runtime/plugin/vimballPlugin.vim +++ b/runtime/plugin/vimballPlugin.vim @@ -1,6 +1,6 @@ " vimballPlugin : construct a file containing both paths and files " Author: Charles E. Campbell, Jr. -" Copyright: (c) 2004-2007 by Charles E. Campbell, Jr. +" Copyright: (c) 2004-2009 by Charles E. Campbell, Jr. " The VIM LICENSE applies to Vimball.vim, and Vimball.txt " (see |copyright|) except use "Vimball" instead of "Vim". " No warranty, express or implied. @@ -16,18 +16,18 @@ if &cp || exists("g:loaded_vimballPlugin") finish endif -let g:loaded_vimballPlugin = "v29" +let g:loaded_vimballPlugin = "v30" let s:keepcpo = &cpo set cpo&vim " ------------------------------------------------------------------------------ " Public Interface: {{{1 com! -ra -complete=file -na=+ -bang MkVimball call vimball#MkVimball(,,0,) -com! -na=? -complete=dir UseVimball call vimball#Vimball(1,) -com! -na=0 VimballList call vimball#Vimball(0) -com! -na=* -complete=dir RmVimball call vimball#SaveSettings()|call vimball#RmVimball()|call vimball#RestoreSettings() -au BufEnter *.vba.gz,*.vba.bz2,*.vba.zip call vimball#Decompress(expand("")) -au BufEnter *.vba setlocal ff=unix noma bt=nofile fmr=[[[,]]] fdm=marker|call vimball#ShowMesg(0,"Source this file to extract it! (:so %)") +com! -na=? -complete=dir UseVimball call vimball#Vimball(1,) +com! -na=0 VimballList call vimball#Vimball(0) +com! -na=* -complete=dir RmVimball call vimball#SaveSettings()|call vimball#RmVimball()|call vimball#RestoreSettings() +au SourceCmd *.vba.gz,*.vba.bz2,*.vba.zip call vimball#Decompress(expand(""))|call vimball#Vimball(1) +au BufEnter *.vba,*.vba.gz,*.vba.bz2,*.vba.zip setlocal bt=nofile fmr=[[[,]]] fdm=marker|if &ff != 'unix'| setlocal ff=unix|endif|call vimball#ShowMesg(0,"Source this file to extract it! (:so %)") " ===================================================================== " Restoration And Modelines: {{{1 diff --git a/runtime/syntax/asm.vim b/runtime/syntax/asm.vim index 09bfe4fa..40756de9 100644 --- a/runtime/syntax/asm.vim +++ b/runtime/syntax/asm.vim @@ -1,10 +1,12 @@ " Vim syntax file " Language: GNU Assembler -" Maintainer: Kevin Dahlhausen -" Last Change: 2002 Sep 19 +" Maintainer: Erik Wognsen +" Previous maintainer: +" Kevin Dahlhausen +" Last Change: 2010 Jan 9 " For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded +" For version 6.0 and later: Quit when a syntax file was already loaded if version < 600 syntax clear elseif exists("b:current_syntax") @@ -13,7 +15,6 @@ endif syn case ignore - " storage types syn match asmType "\.long" syn match asmType "\.ascii" @@ -44,9 +45,8 @@ syn match octNumber "0[0-7][0-7]\+" syn match hexNumber "0[xX][0-9a-fA-F]\+" syn match binNumber "0[bB][0-1]*" - -syn match asmSpecialComment ";\*\*\*.*" -syn match asmComment ";.*"hs=s+1 +syn match asmComment "#.*" +syn region asmComment start="/\*" end="\*/" syn match asmInclude "\.include" syn match asmCond "\.if" @@ -86,15 +86,9 @@ if version >= 508 || !exists("did_asm_syntax_inits") HiLink octNumber Number HiLink binNumber Number - HiLink asmSpecialComment Comment HiLink asmIdentifier Identifier HiLink asmType Type - " My default color overrides: - " hi asmSpecialComment ctermfg=red - " hi asmIdentifier ctermfg=lightcyan - " hi asmType ctermbg=black ctermfg=brown - delcommand HiLink endif diff --git a/runtime/syntax/netrc.vim b/runtime/syntax/netrc.vim index d8eba30a..9f15d166 100644 --- a/runtime/syntax/netrc.vim +++ b/runtime/syntax/netrc.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: netrc(5) configuration file " Maintainer: Nikolai Weibull -" Latest Revision: 2006-04-19 +" Latest Revision: 2010-01-03 if exists("b:current_syntax") finish @@ -11,12 +11,13 @@ let s:cpo_save = &cpo set cpo&vim syn keyword netrcKeyword machine nextgroup=netrcMachine skipwhite skipnl -syn keyword netrcKeyword login nextgroup=netrcLogin,netrcSpecial - \ skipwhite skipnl +syn keyword netrcKeyword account + \ login + \ nextgroup=netrcLogin,netrcSpecial skipwhite skipnl syn keyword netrcKeyword password nextgroup=netrcPassword skipwhite skipnl syn keyword netrcKeyword default -syn keyword netrcKeyword macdef nextgroup=netrcInit,netrcMacroName - \ skipwhite skipnl +syn keyword netrcKeyword macdef + \ nextgroup=netrcInit,netrcMacroName skipwhite skipnl syn region netrcMacro contained start='.' end='^$' syn match netrcMachine contained display '\S\+' @@ -25,14 +26,14 @@ syn match netrcLogin contained display '\S\+' syn match netrcLogin contained display '"[^\\"]*\(\\.[^\\"]*\)*"' syn match netrcPassword contained display '\S\+' syn match netrcPassword contained display '"[^\\"]*\(\\.[^\\"]*\)*"' -syn match netrcMacroName contained display '\S\+' nextgroup=netrcMacro - \ skipwhite skipnl +syn match netrcMacroName contained display '\S\+' + \ nextgroup=netrcMacro skipwhite skipnl syn match netrcMacroName contained display '"[^\\"]*\(\\.[^\\"]*\)*"' - \ nextgroup=netrcMacro skipwhite skipnl + \ nextgroup=netrcMacro skipwhite skipnl syn keyword netrcSpecial contained anonymous -syn match netrcInit contained '\ -" Latest Revision: 2006-04-19 - -if exists("b:current_syntax") - finish -endif - -let s:cpo_save = &cpo -set cpo&vim - -syn match screenEscape '\\.' - -syn keyword screenTodo contained TODO FIXME XXX NOTE - -syn region screenComment display oneline start='#' end='$' - \ contains=screenTodo,@Spell - -syn region screenString display oneline start=+"+ skip=+\\"+ end=+"+ - \ contains=screenVariable,screenSpecial - -syn region screenLiteral display oneline start=+'+ skip=+\\'+ end=+'+ - -syn match screenVariable contained display '$\(\h\w*\|{\h\w*}\)' - -syn keyword screenBoolean on off - -syn match screenNumbers display '\<\d\+\>' - -syn match screenSpecials contained - \ '%\([%aAdDhlmMstuwWyY?:{]\|[0-9]*n\|0?cC\)' - -syn keyword screenCommands acladd aclchg acldel aclgrp aclumask activity - \ addacl allpartial at attrcolor autodetach - \ bell_msg bind bindkey bufferfile caption chacl - \ chdir clear colon command compacthist console - \ copy copy_regcrlf debug detach digraph dinfo - \ crlf displays dumptermcap echo exec fit focus - \ height help history info kill lastmsg license - \ lockscreen markkeys meta msgminwait msgwait - \ multiuser nethack next nonblock number only - \ other partial_state password paste pastefont - \ pow_break pow_detach_msg prev printcmd process - \ quit readbuf readreg redisplay register - \ remove removebuf reset resize screen select - \ sessionname setenv shelltitle silencewait - \ verbose sleep sorendition split startup_message - \ stuff su suspend time title umask version wall - \ width writebuf xoff xon defmode hardstatus - \ altscreen break breaktype copy_reg defbreaktype - \ defencoding deflog encoding eval ignorecase - \ ins_reg maxwin partial pow_detach setsid source - \ unsetenv windowlist windows defautonuke autonuke - \ defbce bce defc1 c1 defcharset charset defescape - \ escape defflow flow defkanji kanji deflogin - \ login defmonitor monitor defhstatus hstatus - \ defobuflimit obuflimit defscrollback scrollback - \ defshell shell defsilence silence defslowpaste - \ slowpaste defutf8 utf8 defwrap wrap defwritelock - \ writelock defzombie zombie defgr gr hardcopy - \ hardcopy_append hardcopydir hardstatus log - \ logfile login logtstamp mapdefault mapnotnext - \ maptimeout term termcap terminfo termcapinfo - \ vbell vbell_msg vbellwait - -hi def link screenEscape Special -hi def link screenComment Comment -hi def link screenTodo Todo -hi def link screenString String -hi def link screenLiteral String -hi def link screenVariable Identifier -hi def link screenBoolean Boolean -hi def link screenNumbers Number -hi def link screenSpecials Special -hi def link screenCommands Keyword - -let b:current_syntax = "screen" - -let &cpo = s:cpo_save -unlet s:cpo_save +" Vim syntax file +" Language: screen(1) configuration file +" Maintainer: Nikolai Weibull +" Latest Revision: 2010-01-03 + +if exists("b:current_syntax") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +syn match screenEscape '\\.' + +syn keyword screenTodo contained TODO FIXME XXX NOTE + +syn region screenComment display oneline start='#' end='$' + \ contains=screenTodo,@Spell + +syn region screenString display oneline start=+"+ skip=+\\"+ end=+"+ + \ contains=screenVariable,screenSpecial + +syn region screenLiteral display oneline start=+'+ skip=+\\'+ end=+'+ + +syn match screenVariable contained display '$\%(\h\w*\|{\h\w*}\)' + +syn keyword screenBoolean on off + +syn match screenNumbers display '\<\d\+\>' + +syn match screenSpecials contained + \ '%\%([%aAdDhlmMstuwWyY?:{]\|[0-9]*n\|0?cC\)' + +syn keyword screenCommands + \ acladd + \ aclchg + \ acldel + \ aclgrp + \ aclumask + \ activity + \ addacl + \ allpartial + \ altscreen + \ at + \ attrcolor + \ autodetach + \ autonuke + \ backtick + \ bce + \ bd_bc_down + \ bd_bc_left + \ bd_bc_right + \ bd_bc_up + \ bd_bell + \ bd_braille_table + \ bd_eightdot + \ bd_info + \ bd_link + \ bd_lower_left + \ bd_lower_right + \ bd_ncrc + \ bd_port + \ bd_scroll + \ bd_skip + \ bd_start_braille + \ bd_type + \ bd_upper_left + \ bd_upper_right + \ bd_width + \ bell + \ bell_msg + \ bind + \ bindkey + \ blanker + \ blankerprg + \ break + \ breaktype + \ bufferfile + \ c1 + \ caption + \ chacl + \ charset + \ chdir + \ clear + \ colon + \ command + \ compacthist + \ console + \ copy + \ crlf + \ debug + \ defautonuke + \ defbce + \ defbreaktype + \ defc1 + \ defcharset + \ defencoding + \ defescape + \ defflow + \ defgr + \ defhstatus + \ defkanji + \ deflog + \ deflogin + \ defmode + \ defmonitor + \ defnonblock + \ defobuflimit + \ defscrollback + \ defshell + \ defsilence + \ defslowpaste + \ defutf8 + \ defwrap + \ defwritelock + \ detach + \ digraph + \ dinfo + \ displays + \ dumptermcap + \ echo + \ encoding + \ escape + \ eval + \ exec + \ fit + \ flow + \ focus + \ gr + \ hardcopy + \ hardcopy_append + \ hardcopydir + \ hardstatus + \ height + \ help + \ history + \ hstatus + \ idle + \ ignorecase + \ info + \ kanji + \ kill + \ lastmsg + \ layout + \ license + \ lockscreen + \ log + \ logfile + \ login + \ logtstamp + \ mapdefault + \ mapnotnext + \ maptimeout + \ markkeys + \ maxwin + \ meta + \ monitor + \ msgminwait + \ msgwait + \ multiuser + \ nethack + \ next + \ nonblock + \ number + \ obuflimit + \ only + \ other + \ partial + \ password + \ paste + \ pastefont + \ pow_break + \ pow_detach + \ pow_detach_msg + \ prev + \ printcmd + \ process + \ quit + \ readbuf + \ readreg + \ redisplay + \ register + \ remove + \ removebuf + \ reset + \ resize + \ screen + \ scrollback + \ select + \ sessionname + \ setenv + \ setsid + \ shell + \ shelltitle + \ silence + \ silencewait + \ sleep + \ slowpaste + \ sorendition + \ source + \ split + \ startup_message + \ stuff + \ su + \ suspend + \ term + \ termcap + \ termcapinfo + \ terminfo + \ time + \ title + \ umask + \ unsetenv + \ utf8 + \ vbell + \ vbell_msg + \ vbellwait + \ verbose + \ version + \ wall + \ width + \ windowlist + \ windows + \ wrap + \ writebuf + \ writelock + \ xoff + \ xon + \ zmodem + \ zombie + +hi def link screenEscape Special +hi def link screenComment Comment +hi def link screenTodo Todo +hi def link screenString String +hi def link screenLiteral String +hi def link screenVariable Identifier +hi def link screenBoolean Boolean +hi def link screenNumbers Number +hi def link screenSpecials Special +hi def link screenCommands Keyword + +let b:current_syntax = "screen" + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index 5ae09804..6ef4fba1 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -2,8 +2,8 @@ " Language: shell (sh) Korn shell (ksh) bash (sh) " Maintainer: Dr. Charles E. Campbell, Jr. " Previous Maintainer: Lennart Schultz -" Last Change: Sep 01, 2009 -" Version: 109 +" Last Change: Nov 17, 2009 +" Version: 110 " URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax " For options and settings, please use: :help ft-sh-syntax " This file includes many ideas from Éric Brunet (eric.brunet@ens.fr) @@ -71,9 +71,9 @@ syn cluster shErrorList contains=shDoError,shIfError,shInError,shCaseError,shEsa if exists("b:is_kornshell") syn cluster ErrorList add=shDTestError endif -syn cluster shArithParenList contains=shArithmetic,shDeref,shDerefSimple,shEcho,shEscape,shNumber,shOperator,shPosnParm,shExSingleQuote,shRedir,shSingleQuote,shDoubleQuote,shStatement,shVariable,shAlias,shTest,shCtrlSeq,shSpecial,shParen,bashSpecialVariables,bashStatement +syn cluster shArithParenList contains=shArithmetic,shCaseEsac,shDeref,shDerefSimple,shEcho,shEscape,shNumber,shOperator,shPosnParm,shExSingleQuote,shRedir,shSingleQuote,shDoubleQuote,shStatement,shVariable,shAlias,shTest,shCtrlSeq,shSpecial,shParen,bashSpecialVariables,bashStatement syn cluster shArithList contains=@shArithParenList,shParenError -syn cluster shCaseEsacList contains=shCaseStart,shCase,shCaseBar,shCaseIn,shComment,shDeref,shDerefSimple,shCaseCommandSub,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote,shCtrlSeq,@shErrorList,shStringSpecial,shExpr +syn cluster shCaseEsacList contains=shCaseStart,shCase,shCaseBar,shCaseIn,shComment,shDeref,shDerefSimple,shCaseCommandSub,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote,shCtrlSeq,@shErrorList,shStringSpecial,shCaseRange syn cluster shCaseList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq syn cluster shColonList contains=@shCaseList syn cluster shCommandSubList contains=shArithmetic,shDeref,shDerefSimple,shEscape,shNumber,shOperator,shPosnParm,shExSingleQuote,shSingleQuote,shDoubleQuote,shStatement,shVariable,shSubSh,shAlias,shTest,shCtrlSeq,shSpecial @@ -97,13 +97,12 @@ syn cluster shLoopList contains=@shCaseList,shTestOpr,shExpr,shDblBrace,shCondit syn cluster shSubShList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq,shOperator syn cluster shTestList contains=shCharClass,shComment,shCommandSub,shDeref,shDerefSimple,shDoubleQuote,shExpr,shExpr,shNumber,shOperator,shExSingleQuote,shSingleQuote,shTestOpr,shTest,shCtrlSeq - " Echo: {{{1 " ==== " This one is needed INSIDE a CommandSub, so that `echo bla` be correct syn region shEcho matchgroup=shStatement start="\" skip="\\$" matchgroup=shOperator end="$" matchgroup=NONE end="[<>;&|()]"me=e-1 end="\d[<>]"me=e-2 end="\s#"me=e-2 contains=@shEchoList skipwhite nextgroup=shQuickComment syn region shEcho matchgroup=shStatement start="\" skip="\\$" matchgroup=shOperator end="$" matchgroup=NONE end="[<>;&|()]"me=e-1 end="\d[<>]"me=e-2 end="\s#"me=e-2 contains=@shEchoList skipwhite nextgroup=shQuickComment -syn match shEchoQuote contained '\%(\\\\\)*\\["`']' +syn match shEchoQuote contained '\%(\\\\\)*\\["`'()]' " This must be after the strings, so that ... \" will be correct syn region shEmbeddedEcho contained matchgroup=shStatement start="\" skip="\\$" matchgroup=shOperator end="$" matchgroup=NONE end="[<>;&|`)]"me=e-1 end="\d[<>]"me=e-2 end="\s#"me=e-2 contains=shNumber,shExSingleQuote,shSingleQuote,shDeref,shDerefSimple,shSpecialVar,shOperator,shDoubleQuote,shCharClass,shCtrlSeq @@ -159,7 +158,7 @@ syn region shSubSh transparent matchgroup=shSubShRegion start="(" end=")" contai " Tests: {{{1 "======= syn region shExpr matchgroup=shRange start="\[" skip=+\\\\\|\\$+ end="\]" contains=@shTestList,shSpecial -syn region shTest transparent matchgroup=shStatement start="\" skip=+\\\\\|\\$+ matchgroup=NONE end="[;&|]"me=e-1 end="$" contains=@shExprList1 +syn region shTest transparent matchgroup=shStatement start="\=\|!=\|==\|-.\>\|-\(nt\|ot\|ef\|eq\|ne\|lt\|le\|gt\|ge\)\>\|[!<>]" syn match shTestOpr contained '=' skipwhite nextgroup=shTestDoubleQuote,shTestSingleQuote,shTestPattern syn match shTestPattern contained '\w\+' @@ -219,6 +218,7 @@ endif syn region shCaseSingleQuote matchgroup=shOperator start=+'+ end=+'+ contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained syn region shCaseDoubleQuote matchgroup=shOperator start=+"+ skip=+\\\\\|\\.+ end=+"+ contains=@shDblQuoteList,shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained syn region shCaseCommandSub start=+`+ skip=+\\\\\|\\.+ end=+`+ contains=@shCommandSubList skipwhite skipnl nextgroup=shCaseBar contained +syn region shCaseRange matchgroup=Delimiter start=+\[+ skip=+\\\\+ end=+]+ contained " Misc: {{{1 "====== @@ -257,21 +257,22 @@ endif syn match shSource "^\.\s" syn match shSource "\s\.\s" -syn region shColon start="^\s*:" end="$\|" end="\s#"me=e-2 contains=@shColonList +"syn region shColon start="^\s*:" end="$" end="\s#"me=e-2 contains=@shColonList +syn region shColon start="^\s*\zs:" end="$" end="\s#"me=e-2 " String And Character Constants: {{{1 "================================ syn match shNumber "-\=\<\d\+\>#\=" syn match shCtrlSeq "\\\d\d\d\|\\[abcfnrtv0]" contained if exists("b:is_bash") - syn match shSpecial "\\\o\o\o\|\\x\x\x\|\\c.\|\\[abefnrtv]" contained + syn match shSpecial "\\\o\o\o\|\\x\x\x\|\\c[^"]\|\\[abefnrtv]" contained endif if exists("b:is_bash") syn region shExSingleQuote matchgroup=shOperator start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial else syn region shExSingleQuote matchGroup=Error start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial endif -syn region shSingleQuote matchgroup=shOperator start=+'+ end=+'+ contains=shStringSpecial,@Spell +syn region shSingleQuote matchgroup=shOperator start=+'+ end=+'+ contains=@Spell syn region shDoubleQuote matchgroup=shOperator start=+"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,@Spell syn match shStringSpecial "[^[:print:] \t]" contained syn match shStringSpecial "\%(\\\\\)*\\[\\"'`$()#]" @@ -281,11 +282,11 @@ syn match shMoreSpecial "\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shMoreSpecial cont " Comments: {{{1 "========== -syn cluster shCommentGroup contains=shTodo,@Spell -syn keyword shTodo contained COMBAK FIXME TODO XXX -syn match shComment "^\s*\zs#.*$" contains=@shCommentGroup -syn match shComment "\s\zs#.*$" contains=@shCommentGroup -syn match shQuickComment contained "#.*$" +syn cluster shCommentGroup contains=shTodo,@Spell +syn keyword shTodo contained COMBAK FIXME TODO XXX +syn match shComment "^\s*\zs#.*$" contains=@shCommentGroup +syn match shComment "\s\zs#.*$" contains=@shCommentGroup +syn match shQuickComment contained "#.*$" " Here Documents: {{{1 " ========================================= @@ -494,7 +495,7 @@ hi def link shCaseIn shConditional hi def link shCaseSingleQuote shSingleQuote hi def link shCaseStart shConditional hi def link shCmdSubRegion shShellVariables -hi def link shColon shStatement +hi def link shColon shComment hi def link shDerefOp shOperator hi def link shDerefPOL shDerefOp hi def link shDerefPPS shDerefOp diff --git a/runtime/syntax/tex.vim b/runtime/syntax/tex.vim index d9e81bc2..ff171d37 100644 --- a/runtime/syntax/tex.vim +++ b/runtime/syntax/tex.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: TeX " Maintainer: Dr. Charles E. Campbell, Jr. -" Last Change: Feb 05, 2009 -" Version: 45 +" Last Change: Dec 28, 2009 +" Version: 46 " URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax " " Notes: {{{1 @@ -180,12 +180,12 @@ syn match texLigature "\\\([ijolL]\|ae\|oe\|ss\|AA\|AE\|OE\)$" " \begin{}/\end{} section markers: {{{1 syn match texSectionMarker "\\begin\>\|\\end\>" nextgroup=texSectionName -syn region texSectionName matchgroup=Delimiter start="{" end="}" contained nextgroup=texSectionModifier -syn region texSectionModifier matchgroup=Delimiter start="\[" end="]" contained +syn region texSectionName matchgroup=Delimiter start="{" end="}" contained nextgroup=texSectionModifier contains=texComment +syn region texSectionModifier matchgroup=Delimiter start="\[" end="]" contained contains=texComment " \documentclass, \documentstyle, \usepackage: {{{1 syn match texDocType "\\documentclass\>\|\\documentstyle\>\|\\usepackage\>" nextgroup=texSectionName,texDocTypeArgs -syn region texDocTypeArgs matchgroup=Delimiter start="\[" end="]" contained nextgroup=texSectionName +syn region texDocTypeArgs matchgroup=Delimiter start="\[" end="]" contained nextgroup=texSectionName contains=texComment " Preamble syntax-based folding support: {{{1 if g:tex_fold_enabled && has("folding") @@ -194,10 +194,10 @@ endif " TeX input: {{{1 syn match texInput "\\input\s\+[a-zA-Z/.0-9_^]\+"hs=s+7 contains=texStatement -syn match texInputFile "\\include\(graphics\|list\)\=\(\[.\{-}\]\)\=\s*{.\{-}}" contains=texStatement,texInputCurlies +syn match texInputFile "\\include\(graphics\|list\)\=\(\[.\{-}\]\)\=\s*{.\{-}}" contains=texStatement,texInputCurlies,texInputFileOpt syn match texInputFile "\\\(epsfig\|input\|usepackage\)\s*\(\[.*\]\)\={.\{-}}" contains=texStatement,texInputCurlies,texInputFileOpt syn match texInputCurlies "[{}]" contained -syn region texInputFileOpt matchgroup=Delimiter start="\[" end="\]" contained +syn region texInputFileOpt matchgroup=Delimiter start="\[" end="\]" contained contains=texComment " Type Styles (LaTeX 2.09): {{{1 syn match texTypeStyle "\\rm\>" diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 4dc193ed..22afcf40 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: Vim 7.2 script " Maintainer: Dr. Charles E. Campbell, Jr. -" Last Change: Aug 17, 2009 -" Version: 7.2-93 +" Last Change: Nov 18, 2009 +" Version: 7.2-95 " Automatically generated keyword lists: {{{1 " Quit when a syntax file was already loaded {{{2 @@ -62,7 +62,7 @@ syn case ignore syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre Cmd-event CmdwinEnter CmdwinLeave ColorScheme CursorHold CursorHoldI CursorMoved CursorMovedI EncodingChanged FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertEnter InsertLeave MenuPopup QuickFixCmdPost QuickFixCmdPre RemoteReply SessionLoadPost ShellCmdPost ShellFilterPost SourceCmd SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabEnter TabLeave TermChanged TermResponse User UserGettingBored VimEnter VimLeave VimLeavePre VimResized WinEnter WinLeave " Highlight commonly used Groupnames {{{2 -syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo +syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo None " Default highlighting groups {{{2 syn keyword vimHLGroup contained Cursor CursorColumn CursorIM CursorLine DiffAdd DiffChange DiffDelete DiffText Directory ErrorMsg FoldColumn Folded IncSearch LineNr MatchParen Menu ModeMsg MoreMsg NonText Normal Pmenu PmenuSbar PmenuSel PmenuThumb Question Scrollbar Search SignColumn SpecialKey SpellBad SpellCap SpellLocal SpellRare StatusLine StatusLineNC TabLine TabLineFill TabLineSel Title Tooltip VertSplit Visual VisualNOS WarningMsg WildMenu @@ -360,7 +360,8 @@ syn match vimNotFunc "\\|\\|\\|\" " Errors And Warnings: {{{2 " ==================== if !exists("g:vimsyn_noerror") - syn match vimFunctionError "\s\zs\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=[a-z0-9]\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank + syn match vimFunctionError "\s\zs[a-z0-9]\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank +" syn match vimFunctionError "\s\zs\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)[0-9]\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank syn match vimElseIfErr "\" syn match vimBufnrWarn /\" if has("conceal") syn match vimSynMtchOpt contained "\\s*\a\+" transparent contains=vimCommand,vimNotatio " Highlighting {{{2 " ============ syn cluster vimHighlightCluster contains=vimHiLink,vimHiClear,vimHiKeyList,vimComment -syn match vimHighlight "\" skipwhite nextgroup=vimHiBang,vimGroup,@vimHighlightCluster +syn match vimHighlight "\" skipwhite nextgroup=vimHiBang,@vimHighlightCluster syn match vimHiBang contained "!" skipwhite nextgroup=@vimHighlightCluster syn match vimHiGroup contained "\i\+" @@ -487,7 +488,7 @@ if !exists("g:vimsyn_noerror") endif " Highlighting: hi group key=arg ... {{{2 -syn cluster vimHiCluster contains=vimHiGroup,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation +syn cluster vimHiCluster contains=vimGroup,vimHiGroup,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation syn region vimHiKeyList contained oneline start="\i\+" skip="\\\\\|\\|" end="$\||" contains=@vimHiCluster if !exists("g:vimsyn_noerror") syn match vimHiKeyError contained "\i\+="he=e-1 diff --git a/runtime/tools/README.txt b/runtime/tools/README.txt index f5274df2..fa176c77 100644 --- a/runtime/tools/README.txt +++ b/runtime/tools/README.txt @@ -32,4 +32,6 @@ vim_vs_net.cmd: MS-Windows command file to use Vim with MS Visual Studio 7 and xcmdsrv_client.c: Example for a client program that communicates with a Vim server through the X-Windows interface. +unicode.vim Vim script to generate tables for src/mbyte.c. + [xxd (and tee for OS/2) can be found in the src directory] diff --git a/runtime/tools/unicode.vim b/runtime/tools/unicode.vim new file mode 100644 index 00000000..f33df420 --- /dev/null +++ b/runtime/tools/unicode.vim @@ -0,0 +1,280 @@ +" Script to extract tables from Unicode .txt files, to be used in src/mbyte.c. +" The format of the UnicodeData.txt file is explained here: +" http://www.unicode.org/Public/5.1.0/ucd/UCD.html +" For the other files see the header. +" +" Usage: Vim -S +" +" Author: Bram Moolenaar +" Last Update: 2010 Jan 12 + +" Parse lines of UnicodeData.txt. Creates a list of lists in s:dataprops. +func! ParseDataToProps() + let s:dataprops = [] + let lnum = 1 + while lnum <= line('$') + let l = split(getline(lnum), '\s*;\s*', 1) + if len(l) != 15 + echoerr 'Found ' . len(l) . ' items in line ' . lnum . ', expected 15' + return + endif + call add(s:dataprops, l) + let lnum += 1 + endwhile +endfunc + +" Parse lines of CaseFolding.txt. Creates a list of lists in s:foldprops. +func! ParseFoldProps() + let s:foldprops = [] + let lnum = 1 + while lnum <= line('$') + let line = getline(lnum) + if line !~ '^#' && line !~ '^\s*$' + let l = split(line, '\s*;\s*', 1) + if len(l) != 4 + echoerr 'Found ' . len(l) . ' items in line ' . lnum . ', expected 4' + return + endif + call add(s:foldprops, l) + endif + let lnum += 1 + endwhile +endfunc + +" Parse lines of EastAsianWidth.txt. Creates a list of lists in s:widthprops. +func! ParseWidthProps() + let s:widthprops = [] + let lnum = 1 + while lnum <= line('$') + let line = getline(lnum) + if line !~ '^#' && line !~ '^\s*$' + let l = split(line, '\s*;\s*', 1) + if len(l) != 2 + echoerr 'Found ' . len(l) . ' items in line ' . lnum . ', expected 2' + return + endif + call add(s:widthprops, l) + endif + let lnum += 1 + endwhile +endfunc + +" Build the toLower or toUpper table in a new buffer. +" Uses s:dataprops. +func! BuildCaseTable(name, index) + let start = -1 + let end = -1 + let step = 0 + let add = -1 + let ranges = [] + for p in s:dataprops + if p[a:index] != '' + let n = ('0x' . p[0]) + 0 + let nl = ('0x' . p[a:index]) + 0 + if start >= 0 && add == nl - n && (step == 0 || n - end == step) + " continue with same range. + let step = n - end + let end = n + else + if start >= 0 + " produce previous range + call Range(ranges, start, end, step, add) + endif + let start = n + let end = n + let step = 0 + let add = nl - n + endif + endif + endfor + if start >= 0 + call Range(ranges, start, end, step, add) + endif + + " New buffer to put the result in. + new + exe "file to" . a:name + call setline(1, "static convertStruct to" . a:name . "[] =") + call setline(2, "{") + call append('$', ranges) + call setline('$', getline('$')[:-2]) " remove last comma + call setline(line('$') + 1, "};") + wincmd p +endfunc + +" Build the foldCase table in a new buffer. +" Uses s:foldprops. +func! BuildFoldTable() + let start = -1 + let end = -1 + let step = 0 + let add = -1 + let ranges = [] + for p in s:foldprops + if p[1] == 'C' || p[1] == 'S' + let n = ('0x' . p[0]) + 0 + let nl = ('0x' . p[2]) + 0 + if start >= 0 && add == nl - n && (step == 0 || n - end == step) + " continue with same range. + let step = n - end + let end = n + else + if start >= 0 + " produce previous range + call Range(ranges, start, end, step, add) + endif + let start = n + let end = n + let step = 0 + let add = nl - n + endif + endif + endfor + if start >= 0 + call Range(ranges, start, end, step, add) + endif + + " New buffer to put the result in. + new + file foldCase + call setline(1, "static convertStruct foldCase[] =") + call setline(2, "{") + call append('$', ranges) + call setline('$', getline('$')[:-2]) " remove last comma + call setline(line('$') + 1, "};") + wincmd p +endfunc + +func! Range(ranges, start, end, step, add) + let s = printf("\t{0x%x,0x%x,%d,%d},", a:start, a:end, a:step == 0 ? -1 : a:step, a:add) + call add(a:ranges, s) +endfunc + +" Build the combining table. +" Uses s:dataprops. +func! BuildCombiningTable() + let start = -1 + let end = -1 + let ranges = [] + for p in s:dataprops + if p[2] == 'Mn' || p[2] == 'Mc' || p[2] == 'Me' + let n = ('0x' . p[0]) + 0 + if start >= 0 && end + 1 == n + " continue with same range. + let end = n + else + if start >= 0 + " produce previous range + call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end)) + endif + let start = n + let end = n + endif + endif + endfor + if start >= 0 + call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end)) + endif + + " New buffer to put the result in. + new + file combining + call setline(1, " static struct interval combining[] =") + call setline(2, " {") + call append('$', ranges) + call setline('$', getline('$')[:-2]) " remove last comma + call setline(line('$') + 1, " };") + wincmd p +endfunc + +" Build the ambiguous table in a new buffer. +" Uses s:widthprops and s:dataprops. +func! BuildAmbiguousTable() + let start = -1 + let end = -1 + let ranges = [] + let dataidx = 0 + for p in s:widthprops + if p[1][0] == 'A' + let n = ('0x' . p[0]) + 0 + " Find this char in the data table. + while 1 + let dn = ('0x' . s:dataprops[dataidx][0]) + 0 + if dn >= n + break + endif + let dataidx += 1 + endwhile + if dn != n + echoerr "Cannot find character " . n . " in data table" + endif + " Only use the char when it's not a composing char. + let dp = s:dataprops[dataidx] + if dp[2] != 'Mn' && dp[2] != 'Mc' && dp[2] != 'Me' + if start >= 0 && end + 1 == n + " continue with same range. + let end = n + else + if start >= 0 + " produce previous range + call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end)) + endif + let start = n + if p[0] =~ '\.\.' + let end = ('0x' . substitute(p[0], '.*\.\.', '', '')) + 0 + else + let end = n + endif + endif + endif + endif + endfor + if start >= 0 + call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end)) + endif + + " New buffer to put the result in. + new + file ambiguous + call setline(1, " static struct interval ambiguous[] =") + call setline(2, " {") + call append('$', ranges) + call setline('$', getline('$')[:-2]) " remove last comma + call setline(line('$') + 1, " };") + wincmd p +endfunc + + + +" Edit the Unicode text file. Requires the netrw plugin. +edit http://unicode.org/Public/UNIDATA/UnicodeData.txt + +" Parse each line, create a list of lists. +call ParseDataToProps() + +" Build the toLower table. +call BuildCaseTable("Lower", 13) + +" Build the toUpper table. +call BuildCaseTable("Upper", 12) + +" Build the ranges of composing chars. +call BuildCombiningTable() + +" Edit the case folding text file. Requires the netrw plugin. +edit http://www.unicode.org/Public/UNIDATA/CaseFolding.txt + +" Parse each line, create a list of lists. +call ParseFoldProps() + +" Build the foldCase table. +call BuildFoldTable() + +" Edit the width text file. Requires the netrw plugin. +edit http://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt + +" Parse each line, create a list of lists. +call ParseWidthProps() + +" Build the ambiguous table. +call BuildAmbiguousTable() -- 2.11.4.GIT