diff options
Diffstat (limited to 'runtime')
192 files changed, 2769 insertions, 1491 deletions
diff --git a/runtime/autoload/ada.vim b/runtime/autoload/ada.vim index 46257010d..ffd0ff84c 100644 --- a/runtime/autoload/ada.vim +++ b/runtime/autoload/ada.vim @@ -2,13 +2,15 @@ " Description: Perform Ada specific completion & tagging. " Language: Ada (2005) " $Id$ -" Maintainer: Martin Krischik +" Maintainer: Martin Krischik <krischik@users.sourceforge.net> +" Taylor Venable <taylor@metasyntax.net> " Neil Bird <neil@fnxweb.com> +" Ned Okie <nokie@radford.edu> " $Author$ " $Date$ -" Version: 4.2 +" Version: 4.6 " $Revision$ -" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/ada.vim $ +" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/ada.vim $ " History: 24.05.2006 MK Unified Headers " 26.05.2006 MK ' should not be in iskeyword. " 16.07.2006 MK Ada-Mode as vim-ball @@ -17,6 +19,10 @@ " 05.11.2006 MK Bram suggested not to use include protection for " autoload " 05.11.2006 MK Bram suggested to save on spaces +" 08.07.2007 TV fix mapleader problems. +" 09.05.2007 MK Session just won't work no matter how much +" tweaking is done +" 19.09.2007 NO still some mapleader problems " Help Page: ft-ada-functions "------------------------------------------------------------------------------ @@ -425,30 +431,49 @@ function ada#Create_Tags (option) execute '!ctags --excmd=number ' . l:Filename endfunction ada#Create_Tags -function ada#Switch_Session (New_Session) "{{{1 - if a:New_Session != v:this_session - " - " We actualy got a new session - otherwise there - " is nothing to do. - " - if strlen (v:this_session) > 0 - execute 'mksession! ' . v:this_session - endif +" Section: ada#Switch_Session {{{1 +" +function ada#Switch_Session (New_Session) + " + " you should not save to much date into the seession since they will + " be sourced + " + let l:sessionoptions=&sessionoptions - let v:this_session = a:New_Session + try + set sessionoptions=buffers,curdir,folds,globals,resize,slash,tabpages,tabpages,unix,winpos,winsize - if filereadable (v:this_session) - execute 'source ' . v:this_session - endif + if a:New_Session != v:this_session + " + " We actualy got a new session - otherwise there + " is nothing to do. + " + if strlen (v:this_session) > 0 + execute 'mksession! ' . v:this_session + endif - augroup ada_session - autocmd! - autocmd VimLeavePre * execute 'mksession! ' . v:this_session - augroup END - endif + let v:this_session = a:New_Session + + "if filereadable (v:this_session) + "execute 'source ' . v:this_session + "endif + + augroup ada_session + autocmd! + autocmd VimLeavePre * execute 'mksession! ' . v:this_session + augroup END + + "if exists ("g:Tlist_Auto_Open") && g:Tlist_Auto_Open + "TlistOpen + "endif + + endif + finally + let &sessionoptions=l:sessionoptions + endtry return -endfunction ada#Switch_Session "}}}1 +endfunction ada#Switch_Session " Section: GNAT Pretty Printer folding {{{1 " @@ -546,18 +571,23 @@ function ada#Map_Menu (Text, Keys, Command) \ a:Keys . \" <C-O>:" . a:Command . "<CR>" else + if exists("g:mapleader") + let l:leader = g:mapleader + else + let l:leader = '\' + endif execute \ "50amenu " . \ "Ada." . escape(a:Text, ' ') . - \ "<Tab>" . escape(g:mapleader . "a" . a:Keys , '\') . + \ "<Tab>" . escape(l:leader . "a" . a:Keys , '\') . \ " :" . a:Command . "<CR>" execute \ "nnoremap <buffer>" . - \ escape(g:mapleader . "a" . a:Keys , '\') . + \ escape(l:leader . "a" . a:Keys , '\') . \" :" . a:Command execute \ "inoremap <buffer>" . - \ escape(g:mapleader . "a" . a:Keys , '\') . + \ escape(l:leader . "a" . a:Keys , '\') . \" <C-O>:" . a:Command endif return @@ -566,10 +596,15 @@ endfunction " Section: ada#Map_Popup {{{2 " function ada#Map_Popup (Text, Keys, Command) + if exists("g:mapleader") + let l:leader = g:mapleader + else + let l:leader = '\' + endif execute \ "50amenu " . \ "PopUp." . escape(a:Text, ' ') . - \ "<Tab>" . escape(g:mapleader . "a" . a:Keys , '\') . + \ "<Tab>" . escape(l:leader . "a" . a:Keys , '\') . \ " :" . a:Command . "<CR>" call ada#Map_Menu (a:Text, a:Keys, a:Command) diff --git a/runtime/autoload/adacomplete.vim b/runtime/autoload/adacomplete.vim index 28d68f63d..8db4351ff 100644 --- a/runtime/autoload/adacomplete.vim +++ b/runtime/autoload/adacomplete.vim @@ -5,9 +5,9 @@ " Maintainer: Martin Krischik " $Author$ " $Date$ -" Version: 4.2 +" Version: 4.6 " $Revision$ -" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/adacomplete.vim $ +" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/adacomplete.vim $ " History: 24.05.2006 MK Unified Headers " 26.05.2006 MK improved search for begin of word. " 16.07.2006 MK Ada-Mode as vim-ball diff --git a/runtime/autoload/decada.vim b/runtime/autoload/decada.vim index 9f8aaf260..fb5400e17 100644 --- a/runtime/autoload/decada.vim +++ b/runtime/autoload/decada.vim @@ -3,12 +3,12 @@ " Language: Ada (Dec Ada) " $Id$ " Copyright: Copyright (C) 2006 Martin Krischik -" Maintainer: Martin Krischik +" Maintainer: Martin Krischik <krischik@users.sourceforge.net> " $Author$ " $Date$ -" Version: 4.2 +" Version: 4.6 " $Revision$ -" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/decada.vim $ +" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/decada.vim $ " History: 21.07.2006 MK New Dec Ada " 15.10.2006 MK Bram's suggestion for runtime integration " 05.11.2006 MK Bram suggested not to use include protection for @@ -45,7 +45,7 @@ function decada#Set_Session (...) dict " {{{1 call ada#Switch_Session (a:1) elseif argc() == 0 && strlen (v:servername) > 0 call ada#Switch_Session ( - \ expand('~')[0:-2] . ".vimfiles.session]" . + \ expand('~')[0:-2] . ".vimfiles.session]decada_" . \ v:servername . ".vim") endif return diff --git a/runtime/autoload/getscript.vim b/runtime/autoload/getscript.vim index c1e1aa34a..5a466cb88 100644 --- a/runtime/autoload/getscript.vim +++ b/runtime/autoload/getscript.vim @@ -1,8 +1,8 @@ " --------------------------------------------------------------------- " getscript.vim " Author: Charles E. Campbell, Jr. -" Date: May 30, 2008 -" Version: 30 +" Date: Jul 10, 2008 +" Version: 31 " Installing: :help glvs-install " Usage: :help glvs " @@ -23,7 +23,7 @@ set cpo&vim if exists("g:loaded_getscript") finish endif -let g:loaded_getscript= "v30" +let g:loaded_getscript= "v31" " --------------------------- " Global Variables: {{{1 @@ -140,6 +140,12 @@ fun! getscript#GetLatestVimScripts() return endif + " insure that fnameescape() is available + if !exists("*fnameescape") + echoerr "GetLatestVimScripts needs fnameescape() (provided by 7.1.299 or later)" + return + endif + " Find the .../GetLatest subdirectory under the runtimepath for datadir in split(&rtp,',') + [''] if isdirectory(datadir."/GetLatest") @@ -181,7 +187,8 @@ fun! getscript#GetLatestVimScripts() " don't let any events interfere (like winmanager's, taglist's, etc) let eikeep= &ei - set ei=all + let hlskeep= &hls + set ei=all hls&vim " record current directory, change to datadir, open split window with " datafile @@ -316,6 +323,7 @@ fun! getscript#GetLatestVimScripts() " restore events and current directory exe "cd ".fnameescape(substitute(origdir,'\','/','ge')) let &ei= eikeep + let &hls= hlskeep setlocal nolz " call Dredir("BUFFER TEST (GetLatestVimScripts 2)","ls!") " call Dret("GetLatestVimScripts : did ".s:downloads." downloads") @@ -506,14 +514,14 @@ fun! s:GetOneScript(...) 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 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=') + exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.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)) if filereadable(sname) - call Decho("exe silent !".g:GetLatestVimScripts_mv." ".s:Escape(sname)." ".s:Escape(s:autoinstall)) +" 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) let curdir = escape(substitute(getcwd(),'\','/','ge'),"|[]*'\" #") let installdir= curdir."/Installed" diff --git a/runtime/autoload/gnat.vim b/runtime/autoload/gnat.vim index 5f99450ef..cebde8e1a 100644 --- a/runtime/autoload/gnat.vim +++ b/runtime/autoload/gnat.vim @@ -3,12 +3,13 @@ " Language: Ada (GNAT) " $Id$ " Copyright: Copyright (C) 2006 Martin Krischik -" Maintainer: Martin Krischik +" Maintainer: Martin Krischi <krischik@users.sourceforge.net>k +" Ned Okie <nokie@radford.edu> " $Author$ " $Date$ -" Version: 4.2 +" Version: 4.6 " $Revision$ -" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/gnat.vim $ +" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/gnat.vim $ " History: 24.05.2006 MK Unified Headers " 16.07.2006 MK Ada-Mode as vim-ball " 05.08.2006 MK Add session support @@ -16,6 +17,7 @@ " 05.11.2006 MK Bram suggested not to use include protection for " autoload " 05.11.2006 MK Bram suggested to save on spaces +" 19.09.2007 NO use project file only when there is a project " Help Page: compiler-gnat "------------------------------------------------------------------------------ @@ -71,13 +73,19 @@ function gnat#Set_Project_File (...) dict " {{{1 execute 'mksession! ' . v:this_session endif - if strlen (self.Project_File) > 0 - call ada#Switch_Session ( - \ expand('~') . "/vimfiles/session/" . - \ fnamemodify (self.Project_File, ":t:r") . ".vim") - else - call ada#Switch_Session ('') - endif + "if strlen (self.Project_File) > 0 + "if has("vms") + "call ada#Switch_Session ( + "\ expand('~')[0:-2] . ".vimfiles.session]gnat_" . + "\ fnamemodify (self.Project_File, ":t:r") . ".vim") + "else + "call ada#Switch_Session ( + "\ expand('~') . "/vimfiles/session/gnat_" . + "\ fnamemodify (self.Project_File, ":t:r") . ".vim") + "endif + "else + "call ada#Switch_Session ('') + "endif return endfunction gnat#Set_Project_File " }}}1 diff --git a/runtime/autoload/gzip.vim b/runtime/autoload/gzip.vim index 1ad29eaaa..1245fdddc 100644 --- a/runtime/autoload/gzip.vim +++ b/runtime/autoload/gzip.vim @@ -1,6 +1,6 @@ " Vim autoload file for editing compressed files. " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2008 May 29 +" Last Change: 2008 Jul 04 " These functions are used by the gzip plugin. @@ -153,9 +153,9 @@ fun gzip#write(cmd) let nmt = s:tempname(nm) if rename(nm, nmt) == 0 if exists("b:gzip_comp_arg") - call system(a:cmd . " " . b:gzip_comp_arg . " " . s:escape(nmt)) + call system(a:cmd . " " . b:gzip_comp_arg . " -- " . s:escape(nmt)) else - call system(a:cmd . " " . s:escape(nmt)) + call system(a:cmd . " -- " . s:escape(nmt)) endif call rename(nmt . "." . expand("<afile>:e"), nm) endif @@ -180,10 +180,10 @@ fun gzip#appre(cmd) if rename(nm, nmte) == 0 if &patchmode != "" && getfsize(nm . &patchmode) == -1 " Create patchmode file by creating the decompressed file new - call system(a:cmd . " -c " . s:escape(nmte) . " > " . s:escape(nmt)) + call system(a:cmd . " -c -- " . s:escape(nmte) . " > " . s:escape(nmt)) call rename(nmte, nm . &patchmode) else - call system(a:cmd . " " . s:escape(nmte)) + call system(a:cmd . " -- " . s:escape(nmte)) endif call rename(nmt, nm) endif diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index 6064a6570..6221294bb 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -1,7 +1,7 @@ " netrw.vim: Handles file transfer and remote directory listing across " AUTOLOAD SECTION -" Date: Jun 12, 2008 -" Version: 125 +" Date: Jul 12, 2008 +" Version: 127 " Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM> " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 1999-2008 Charles E. Campbell, Jr. {{{1 @@ -27,19 +27,13 @@ if !exists("s:NOTE") let s:WARNING = 1 let s:ERROR = 2 endif -let g:loaded_netrw = "v125" +let g:loaded_netrw = "v127" " sanity checks if v:version < 700 call netrw#ErrorMsg(s:WARNING,"you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw",1) finish endif -if !exists("*shellescape") - call netrw#ErrorMsg(s:ERROR,"you need to upgade your vim so that it has shellescape()",64) -endif -if !exists("*fnameescape") - call netrw#ErrorMsg(s:ERROR,"you need to upgade your vim so that it has fnameescape()",65) -endif let s:keepcpo= &cpo setlocal cpo&vim @@ -312,6 +306,9 @@ if !exists("g:netrw_sort_by") " alternatives: date size let g:netrw_sort_by= "name" endif +if !exists("g:netrw_sort_options") + let g:netrw_sort_options= "" +endif if !exists("g:netrw_sort_direction") " alternative: reverse (z y x ...) let g:netrw_sort_direction= "normal" @@ -415,7 +412,7 @@ fun! s:NetrwOptionSave(vt) let {a:vt}netrw_twkeep = &l:tw " textwidth let {a:vt}netrw_wigkeep = &l:wig " wildignore if has("win32") && !has("win95") - let {a:vt}netrw_swfkeep= &l:swf " swapfile + let {a:vt}netrw_swfkeep = &l:swf " swapfile endif if &go =~ 'a' | silent! let {a:vt}netrw_regstar = @* | endif silent! let {a:vt}netrw_regslash= @/ @@ -428,7 +425,7 @@ endfun fun! s:NetrwOptionRestore(vt) " call Dfunc("s:NetrwOptionRestore(vt<".a:vt.">) win#".winnr()." buf#".bufnr("%")) if !exists("{a:vt}netrw_optionsave") -" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap) +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) " call Dret("s:NetrwOptionRestore : ".a:vt."netrw_optionsave doesn't exist") return endif @@ -492,7 +489,7 @@ fun! s:NetrwOptionRestore(vt) " call Decho("g:netrw_keepdir=".g:netrw_keepdir.": getcwd<".getcwd()."> acd=".&acd) " call Decho("fo=".&fo.(exists("&acd")? " acd=".&acd : " acd doesn't exist")) -" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap) +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) " call Dret("s:NetrwOptionRestore : win#".winnr()." buf#".bufnr("%")) endfun @@ -536,12 +533,12 @@ fun! netrw#NetrwClean(sys) for dir in split(&rtp,',') if filereadable(dir."/plugin/netrwPlugin.vim") " call Decho("removing netrw-related files from ".dir) - if s:System("delete",dir."/plugin/netrwPlugin.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/plugin/netrwPlugin.vim",55) |endif - if s:System("delete",dir."/autoload/netrwFileHandlers.vim")|call netrw#ErrorMsg(1,"unable to remove ".dir."/autoload/netrwFileHandlers.vim",55)|endif - if s:System("delete",dir."/autoload/netrwSettings.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/autoload/netrwSettings.vim",55) |endif - if s:System("delete",dir."/autoload/netrw.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/autoload/netrw.vim",55) |endif - if s:System("delete",dir."/syntax/netrw.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/syntax/netrw.vim",55) |endif - if s:System("delete",dir."/syntax/netrwlist.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/syntax/netrwlist.vim",55) |endif + if s:NetrwDelete(dir."/plugin/netrwPlugin.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/plugin/netrwPlugin.vim",55) |endif + if s:NetrwDelete(dir."/autoload/netrwFileHandlers.vim")|call netrw#ErrorMsg(1,"unable to remove ".dir."/autoload/netrwFileHandlers.vim",55)|endif + if s:NetrwDelete(dir."/autoload/netrwSettings.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/autoload/netrwSettings.vim",55) |endif + if s:NetrwDelete(dir."/autoload/netrw.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/autoload/netrw.vim",55) |endif + if s:NetrwDelete(dir."/syntax/netrw.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/syntax/netrw.vim",55) |endif + if s:NetrwDelete(dir."/syntax/netrwlist.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/syntax/netrwlist.vim",55) |endif let diddir= dir let diddel= diddel + 1 if !a:sys|break|endif @@ -704,8 +701,8 @@ fun! netrw#NetRead(mode,...) let uid_machine = g:netrw_machine endif endif -" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(uid_machine.":".escape(b:netrw_fname,' ?&;')." ".tmpfile) - exe s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(uid_machine.":".escape(b:netrw_fname,' ?&;')." ".tmpfile) +" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(uid_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1)) + exe s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(uid_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1)) let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method) let b:netrw_lastfile = choice @@ -725,18 +722,18 @@ fun! netrw#NetRead(mode,...) exe "put ='".'get \"'.netrw_fname.'\" '.tmpfile."'" " call Decho("filter input: ".getline('.')) if exists("g:netrw_port") && g:netrw_port != "" -" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port) - exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port +" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine." ".g:netrw_port,1)) + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine." ".g:netrw_port,1) else -" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine) - exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine +" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)) + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1) endif " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar) if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying ' - let debugkeep= &debug + let debugkeep = &debug setlocal debug=msg call netrw#ErrorMsg(s:ERROR,getline(1),4) - let &debug= debugkeep + let &debug = debugkeep endif call s:SaveBufVars()|bd!|call s:RestoreBufVars() let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method) @@ -806,8 +803,8 @@ fun! netrw#NetRead(mode,...) else let useport= "" endif -" call Decho("exe s:netrw_silentxfer.!".g:netrw_scp_cmd.useport." ".shellescape(g:netrw_machine.":".escape(b:netrw_fname,g:netrw_fname_escape))." ".tmpfile) - exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(g:netrw_machine.":".escape(b:netrw_fname,g:netrw_fname_escape))." ".tmpfile +" 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 @@ -823,23 +820,22 @@ fun! netrw#NetRead(mode,...) return endif - let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) if match(b:netrw_fname,"#") == -1 - " simple wget -" call Decho('using simple wget (# not in b:netrw_fname<'.b:netrw_fname.">)") -" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile)." ".shellescape("http://".g:netrw_machine.netrw_fname)) - exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile)." ".shellescape("http://".g:netrw_machine.netrw_fname) + " using g:netrw_http_cmd (usually wget or curl) +" call Decho('using '.g:netrw_http_cmd.' (# not in b:netrw_fname<'.b:netrw_fname.">)") +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape("http://".g:netrw_machine.netrw_fname,1)) + exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape("http://".g:netrw_machine.b:netrw_fname,1) let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method) else - " wget plus a jump to an in-page marker (ie. http://abc/def.html#aMarker) + " wget/curl plus a jump to an in-page marker (ie. http://abc/def.html#aMarker) " call Decho(("wget/curl plus jump (# in b:netrw_fname<".b:netrw_fname.">)") - let netrw_html= substitute(netrw_fname,"#.*$","","") - let netrw_tag = substitute(netrw_fname,"^.*#","","") + let netrw_html= substitute(b:netrw_fname,"#.*$","","") + let netrw_tag = substitute(b:netrw_fname,"^.*#","","") " call Decho("netrw_html<".netrw_html.">") " call Decho("netrw_tag <".netrw_tag.">") -" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile)." ".shellescape("http://".g:netrw_machine.netrw_html)) - exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile)." ".shellescape("http://".g:netrw_machine.netrw_html) +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape("http://".g:netrw_machine.netrw_html,1)) + exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape("http://".g:netrw_machine.netrw_html,1) let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method) " call Decho('<\s*a\s*name=\s*"'.netrw_tag.'"/') exe 'norm! 1G/<\s*a\s*name=\s*"'.netrw_tag.'"/'."\<CR>" @@ -877,9 +873,8 @@ fun! netrw#NetRead(mode,...) " rsync: NetRead Method #7 {{{3 elseif b:netrw_method == 7 " call Decho("read via rsync (method #7)") - let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) -" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(g:netrw_machine.":".netrw_fname)." ".tmpfile) - exe s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(g:netrw_machine.":".netrw_fname)." ".tmpfile +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1)) + exe s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".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 @@ -888,7 +883,6 @@ fun! netrw#NetRead(mode,...) " fetch://[user@]host[:http]/path elseif b:netrw_method == 8 " call Decho("read via fetch (method #8)") - let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) if g:netrw_fetch_cmd == "" if !exists("g:netrw_quiet") call netrw#ErrorMsg(s:ERROR,"fetch command not available",7) @@ -903,11 +897,11 @@ fun! netrw#NetRead(mode,...) " call Decho("read via fetch for ".netrw_option) if exists("g:netrw_uid") && g:netrw_uid != "" && exists("s:netrw_passwd") && s:netrw_passwd != "" -" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".shellescape(netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".netrw_fname)) - exe s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".shellescape(netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".netrw_fname) +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".b:netrw_fname,1)) + exe s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".b:netrw_fname,1) else -" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".shellescape(netrw_option."://".g:netrw_machine."/".netrw_fname)) - exe s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".shellescape(netrw_option."://".g:netrw_machine."/".netrw_fname) +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_machine."/".b:netrw_fname,1)) + exe s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_machine."/".b:netrw_fname,1) endif let result = s:NetrwGetFile(readcmd,tmpfile, b:netrw_method) @@ -918,9 +912,8 @@ fun! netrw#NetRead(mode,...) " sftp: NetRead Method #9 {{{3 elseif b:netrw_method == 9 " call Decho("read via sftp (method #9)") - let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) -" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".netrw_fname)." ".tmpfile) - exe s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".netrw_fname)." ".tmpfile +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".tmpfile) + exe s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".tmpfile let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method) let b:netrw_lastfile = choice @@ -939,7 +932,7 @@ fun! netrw#NetRead(mode,...) endif if s:FileReadable(tmpfile) && tmpfile !~ '.tar.bz2$' && tmpfile !~ '.tar.gz$' && tmpfile !~ '.zip' && tmpfile !~ '.tar' && readcmd != 't' " call Decho("cleanup by deleting tmpfile<".tmpfile.">") - call s:System("delete",fnameescape(tmpfile)) + call s:NetrwDelete(fnameescape(tmpfile)) endif call s:NetrwOptionRestore("w:") @@ -975,17 +968,17 @@ fun! netrw#NetWrite(...) range " For binary writes, always write entire file. " (line numbers don't really make sense for that). " Also supports the writing of tar and zip files. -" call Decho("(write entire file) silent exe w! ".v:cmdarg." ".tmpfile) - silent exe "w! ".v:cmdarg." ".tmpfile +" call Decho("(write entire file) silent exe w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile)) + silent exe "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile) elseif g:netrw_cygwin " write (selected portion of) file to temporary let cygtmpfile= substitute(tmpfile,'/cygdrive/\(.\)','\1:','') -" call Decho("(write selected portion) silent exe ".a:firstline."," . a:lastline . "w! ".v:cmdarg." ".cygtmpfile) - silent exe a:firstline."," . a:lastline . "w! ".v:cmdarg." ".cygtmpfile +" call Decho("(write selected portion) silent exe ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(cygtmpfile)) + silent exe a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(cygtmpfile) else " write (selected portion of) file to temporary -" call Decho("(write selected portion) silent exe ".a:firstline."," . a:lastline . "w! ".v:cmdarg." ".tmpfile) - silent exe a:firstline."," . a:lastline . "w! ".v:cmdarg." ".tmpfile +" call Decho("(write selected portion) silent exe ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile)) + silent exe a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile) endif if curbufname == "" @@ -1079,9 +1072,8 @@ fun! netrw#NetWrite(...) range let uid_machine = g:netrw_machine endif endif - let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) -" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(tmpfile)." ".shellescape(uid_machine.":".netrw_fname)) - exe s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(tmpfile)." ".shellescape(uid_machine.":".netrw_fname) +" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(tmpfile,1)." ".shellescape(uid_machine.":".b:netrw_fname,1)) + exe s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(tmpfile,1)." ".shellescape(uid_machine.":".b:netrw_fname,1) let b:netrw_lastfile = choice "......................................... @@ -1101,12 +1093,12 @@ fun! netrw#NetWrite(...) range exe "put ='".'put \"'.tmpfile.'\" \"'.netrw_fname.'\"'."'" " call Decho("filter input: ".getline('.')) if exists("g:netrw_port") && g:netrw_port != "" -" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port) - exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port +" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)) + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1) else " call Decho("filter input window#".winnr()) -" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine) - exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine +" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)) + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1) endif " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar) if getline(1) !~ "^$" @@ -1167,14 +1159,13 @@ fun! netrw#NetWrite(...) range " scp: NetWrite Method #4 {{{4 elseif b:netrw_method == 4 " call Decho("write via scp (method #4)") - let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) if exists("g:netrw_port") && g:netrw_port != "" - let useport= " ".g:netrw_scpport." ".g:netrw_port + let useport= " ".g:netrw_scpport." ".fnameescape(g:netrw_port) else let useport= "" endif -" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(tmpfile)." ".shellescape(g:netrw_machine.":".netrw_fname)) - exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(tmpfile)." ".shellescape(g:netrw_machine.":".netrw_fname) +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)) + exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1) let b:netrw_lastfile = choice "......................................... @@ -1215,9 +1206,8 @@ fun! netrw#NetWrite(...) range " rsync: NetWrite Method #7 {{{4 elseif b:netrw_method == 7 " call Decho("write via rsync (method #7)") - let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) -" call Decho("executing: !".g:netrw_rsync_cmd." ".tmpfile." ".g:netrw_machine.":".netrw_fname) - exe s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".tmpfile." ".g:netrw_machine.":".netrw_fname +" call Decho("executing: !".g:netrw_rsync_cmd." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)) + exe s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1) let b:netrw_lastfile = choice "......................................... @@ -1235,8 +1225,8 @@ fun! netrw#NetWrite(...) range put ='put \"'.escape(tmpfile,'\').'\" '.netrw_fname " call Decho("filter input: ".getline('.')) norm! 1Gdd -" call Decho("executing: %!".g:netrw_sftp_cmd.' '.uid_machine) - exe s:netrw_silentxfer."%!".g:netrw_sftp_cmd.' '.uid_machine +" 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 @@ -1251,7 +1241,7 @@ fun! netrw#NetWrite(...) range " call Decho("cleanup") if s:FileReadable(tmpfile) " call Decho("tmpfile<".tmpfile."> readable, will now delete it") - call s:System("delete",tmpfile) + call s:NetrwDelete(tmpfile) endif call s:NetrwOptionRestore("w:") @@ -1312,7 +1302,7 @@ fun! s:NetrwGetFile(readcmd, tfile, method) " readcmd=='t': simply do nothing if a:readcmd == 't' -" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap) +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) " call Dret("NetrwGetFile : skip read of <".a:tfile.">") return endif @@ -1336,8 +1326,8 @@ fun! s:NetrwGetFile(readcmd, tfile, method) else let tfile= a:tfile endif -" " call Decho("exe silent! keepalt file ".tfile) - exe "silent! keepalt file ".tfile +" call Decho("exe silent! keepalt file ".fnameescape(tfile)) + exe "silent! keepalt file ".fnameescape(tfile) " edit temporary file (ie. read the temporary file in) if rfile =~ '\.zip$' @@ -1358,8 +1348,8 @@ fun! s:NetrwGetFile(readcmd, tfile, method) endif " rename buffer back to remote filename -" call Decho("exe silent! keepalt file ".escape(rfile,' ')) - exe "silent! keepalt file ".escape(rfile,' ') +" call Decho("exe silent! keepalt file ".fnameescape(rfile)) + exe "silent! keepalt file ".fnameescape(rfile) if a:method == 5 set ft=html else @@ -1374,14 +1364,14 @@ fun! s:NetrwGetFile(readcmd, tfile, method) " call Decho("read file<".a:tfile."> after current line") let curline = line(".") let lastline= line("$") -" call Decho("exe<".a:readcmd." ".v:cmdarg." ".a:tfile."> line#".curline) - exe a:readcmd." ".v:cmdarg." ".a:tfile +" call Decho("exe<".a:readcmd." ".fnameescape(v:cmdarg)." ".fnameescape(a:tfile)."> line#".curline) + exe a:readcmd." ".fnameescape(v:cmdarg)." ".fnameescape(a:tfile) let line1= curline + 1 let line2= line("$") - lastline + 1 else " not readable -" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap) +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) " call Decho("tfile<".a:tfile."> not readable") call netrw#ErrorMsg(s:WARNING,"file <".a:tfile."> not readable",9) " call Dret("NetrwGetFile : tfile<".a:tfile."> not readable") @@ -1406,7 +1396,7 @@ fun! s:NetrwGetFile(readcmd, tfile, method) " make sure file is being displayed " redraw! -" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap) +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) " call Dret("NetrwGetFile") endfun @@ -1704,6 +1694,7 @@ fun! s:BrowserMaps(islocal) nnoremap <buffer> <silent> U :<c-u>call <SID>NetrwBookmarkDir(5,expand("%"))<cr> nnoremap <buffer> <silent> v :call <SID>NetrwSplit(5)<cr> nnoremap <buffer> <silent> x :call netrw#NetrwBrowseX(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),0),0)"<cr> + nnoremap <buffer> <silent> % :call <SID>NetrwOpenFile(1)<cr> if !hasmapto('<Plug>NetrwHideEdit') nmap <buffer> <unique> <c-h> <Plug>NetrwHideEdit endif @@ -1775,6 +1766,7 @@ fun! s:BrowserMaps(islocal) nnoremap <buffer> <silent> U :<c-u>call <SID>NetrwBookmarkDir(5,b:netrw_curdir)<cr> nnoremap <buffer> <silent> v :call <SID>NetrwSplit(2)<cr> nnoremap <buffer> <silent> x :call netrw#NetrwBrowseX(<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()),1)<cr> + nnoremap <buffer> <silent> % :call <SID>NetrwOpenFile(0)<cr> if !hasmapto('<Plug>NetrwHideEdit') nmap <buffer> <c-h> <Plug>NetrwHideEdit endif @@ -1797,7 +1789,7 @@ fun! s:BrowserMaps(islocal) exe 'vnoremap <buffer> <silent> D :call <SID>NetrwRemoteRm("'.s:user.s:machine.'","'.s:path.'")<cr>' exe 'nnoremap <buffer> <silent> R :call <SID>NetrwRemoteRename("'.s:user.s:machine.'","'.s:path.'")<cr>' exe 'vnoremap <buffer> <silent> R :call <SID>NetrwRemoteRename("'.s:user.s:machine.'","'.s:path.'")<cr>' - nnoremap <buffer> <F1> :he netrw-browse-cmds<cr> + nnoremap <buffer> <F1> :he netrw-quickhelp<cr> endif call s:SetRexDir(a:islocal,b:netrw_curdir) " call Dret("s:BrowserMaps") @@ -1921,8 +1913,8 @@ fun! s:NetrwBookmarkDir(chg,curdir) setlocal nomod " call Decho("setlocal nomod") endif -" call Decho("exe e! ".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}) - exe "e! ".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT} +" " call Decho("exe e! ".fnameescape(g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT})) + exe "e! ".fnameescape(g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}) else let g:NETRW_DIRHIST_CNT= ( g:NETRW_DIRHIST_CNT + 1 ) % g:netrw_dirhistmax echo "Sorry, no predecessor directory exists yet" @@ -1942,8 +1934,8 @@ fun! s:NetrwBookmarkDir(chg,curdir) setlocal nomod " call Decho("setlocal nomod") endif -" call Decho("exe e! ".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}) - exe "e! ".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT} +" call Decho("exe e! ".fnameescape(g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT})) + exe "e! ".fnameescape(g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}) else let g:NETRW_DIRHIST_CNT= ( g:NETRW_DIRHIST_CNT - 1 ) % g:netrw_dirhistmax if g:NETRW_DIRHIST_CNT < 0 @@ -2008,7 +2000,7 @@ fun! s:NetrwBrowse(islocal,dirname) if exists("s:netrw_skipbrowse") unlet s:netrw_skipbrowse -" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap) +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) " call Dret("s:NetrwBrowse : s:netrw_skipbrowse=".s:netrw_skipbrowse) return endif @@ -2055,13 +2047,13 @@ fun! s:NetrwBrowse(islocal,dirname) setlocal ma noro " call Decho("setlocal ma noro") let b:netrw_curdir= a:dirname -" call Decho("exe silent! keepalt file ".s:method."://".s:user.s:machine."/".fnameescape(s:path)." (bt=".&bt.")") - exe "silent! keepalt file ".s:method."://".s:user.s:machine."/".fnameescape(s:path) - exe "silent keepalt doau BufReadPre ".s:fname +" call Decho("exe silent! keepalt file ".fnameescape(s:method."://".s:user.s:machine."/".s:path)." (bt=".&bt.")") + exe "silent! keepalt file ".fnameescape(s:method."://".s:user.s:machine."/".s:path) + exe "silent keepalt doau BufReadPre ".fnameescape(s:fname) silent call netrw#NetRead(2,s:method."://".s:user.s:machine."/".s:path) if s:path !~ '.tar.bz2$' && s:path !~ '.tar.gz' " netrw.vim and tar.vim have already handled decompression of the tarball; avoiding gzip.vim error - exe "silent keepalt doau BufReadPost ".s:fname + exe "silent keepalt doau BufReadPost ".fnameescape(s:fname) endif " save certain window-oriented variables into buffer-oriented variables {{{3 @@ -2069,7 +2061,7 @@ fun! s:NetrwBrowse(islocal,dirname) call s:NetrwOptionRestore("w:") setlocal ma nomod -" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap) +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) " call Dret("s:NetrwBrowse : file<".s:fname.">") return endif @@ -2099,7 +2091,7 @@ fun! s:NetrwBrowse(islocal,dirname) if reusing call s:NetrwOptionRestore("w:") setlocal noma nomod nowrap -" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap) +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) " call Dret("s:NetrwBrowse : re-using buffer") return endif @@ -2150,7 +2142,7 @@ fun! s:NetrwBrowse(islocal,dirname) call s:NetrwOptionRestore("w:") setlocal noma nomod nowrap let b:netrw_curdir= dirname -" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap) +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) " call Dret("s:NetrwBrowse : reusing buffer#".(exists("bufnum")? bufnum : 'N/A')."<".dirname."> getcwd<".getcwd().">") return endif @@ -2188,7 +2180,7 @@ fun! s:NetrwBrowse(islocal,dirname) endif call s:NetrwOptionRestore("w:") setlocal noma nomod nowrap -" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap) +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) " call Dret("s:NetrwBrowse : badly formatted dirname<".dirname.">") return endif @@ -2202,7 +2194,7 @@ fun! s:NetrwBrowse(islocal,dirname) call s:BrowserMaps(a:islocal) call s:PerformListing(a:islocal) -" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap) +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) " call Dret("s:NetrwBrowse : did PerformListing") return endfun @@ -2299,14 +2291,15 @@ 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#%d<".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 != '' && bname !~ '/' && dirname =~ '/'.bname.'/\=$' | break | endif + if bname != '' && dirname =~ '/'.bname.'/\=$' | break | endif if bname =~ '^'.dirname.'/\=$' | break | endif if dirname =~ '^'.bname.'/$' | break | endif let ibuf= ibuf + 1 @@ -2336,8 +2329,8 @@ fun! s:NetrwGetBuffer(islocal,dirname) let s:netrw_treelistnum= s:netrw_treelistnum + 1 endif let w:netrw_treebufnr= bufnr("%") -" call Decho(" exe silent! keepalt file NetrwTreeListing ".s:netrw_treelistnum) - exe 'silent! keepalt file NetrwTreeListing\ '.s:netrw_treelistnum +" call Decho(" exe silent! keepalt file NetrwTreeListing ".fnameescape(s:netrw_treelistnum)) + exe 'silent! keepalt file NetrwTreeListing\ '.fnameescape(s:netrw_treelistnum) nnoremap <silent> <buffer> [ :silent call <SID>TreeListMove('[')<cr> nnoremap <silent> <buffer> ] :silent call <SID>TreeListMove(']')<cr> nnoremap <silent> <buffer> [[ :silent call <SID>TreeListMove('[')<cr> @@ -2347,8 +2340,8 @@ fun! s:NetrwGetBuffer(islocal,dirname) " let v:errmsg= "" " Decho let escdirname= fnameescape(dirname) " call Decho(" errmsg<".v:errmsg."> bufnr(".escdirname.")=".bufnr(escdirname)."<".bufname(bufnr(escdirname)).">") -" call Decho(' exe silent! keepalt file '.escdirname) - exe 'silent! keepalt file '.escdirname +" call Decho(' exe silent! keepalt file '.fnameescape(escdirname)) + exe 'silent! keepalt file '.fnameescape(escdirname) " call Decho(" errmsg<".v:errmsg."> bufnr(".escdirname.")=".bufnr(escdirname)."<".bufname(bufnr(escdirname)).">") endif " call Decho(" named enew buffer#".bufnr("%")."<".bufname("%").">") @@ -2365,7 +2358,8 @@ fun! s:NetrwGetBuffer(islocal,dirname) exe "b ".bufnum endif if bufname("%") == '.' - exe "silent! keepalt file ".escape(getcwd(),' ') +" call Decho("exe silent! keepalt file ".fnameescape(getcwd())) + exe "silent! keepalt file ".fnameescape(getcwd()) endif let &ei= eikeep if line("$") <= 1 @@ -2393,7 +2387,8 @@ fun! s:NetrwGetBuffer(islocal,dirname) " call Decho("--do netrw settings: make this buffer not-a-file, modifiable, not line-numbered, etc--") let fname= expand("%") call s:NetrwListSettings(a:islocal) - exe "keepalt file ".escape(fname,' ') +" call Decho("exe keepalt file ".fnameescape(fname)) + exe "keepalt file ".fnameescape(fname) " delete all lines from buffer {{{3 " call Decho("--delete all lines from buffer--") @@ -2502,8 +2497,13 @@ fun! s:NetrwGetWord() norm! ma endif let rega= @a - call cursor(line("."),filestart+b:netrw_cpf+1) - norm! "ay`a + let eofname= filestart + b:netrw_cpf + 1 + if eofname <= col("$") + call cursor(line("."),filestart+b:netrw_cpf+1) + norm! "ay`a + else + norm! "ay$ + endif let dirname = @a let @a = rega " call Decho("2: dirname<".dirname.">") @@ -2526,9 +2526,10 @@ endfun fun! s:NetrwListSettings(islocal) " call Dfunc("s:NetrwListSettings(islocal=".a:islocal.")") let fname= bufname("%") - setlocal bt=nofile nobl ma nonu nowrap noro " call Decho("setlocal bt=nofile nobl ma nonu nowrap noro") - exe "keepalt file ".escape(fname,' ') + setlocal bt=nofile nobl ma nonu nowrap noro +" call Decho("exe keepalt file ".fnameescape(fname)) + exe "keepalt file ".fnameescape(fname) if g:netrw_use_noswf setlocal noswf endif @@ -2642,7 +2643,7 @@ fun! s:NetrwBookmarkMenu() let histcnt = histcnt + 1 let priority = g:NETRW_DIRHIST_CNT + histcnt if exists("g:NETRW_DIRHIST_{cnt}") - let bmdir= escape(g:NETRW_DIRHIST_{cnt},'. ') + let bmdir= escape(g:NETRW_DIRHIST_{cnt},'/&? ') " call Decho('silent! menu '.g:NetrwMenuPriority.".3.".priority." ".g:NetrwTopLvlMenu.'History.'.bmdir.' :e '.bmdir) exe 'silent! menu '.g:NetrwMenuPriority.".3.".priority." ".g:NetrwTopLvlMenu.'History.'.bmdir.' :e '.bmdir."\<cr>" endif @@ -2718,7 +2719,6 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) " call Decho("handling a file: dirname<".dirname."> (a:0=".a:0.")") " this lets NetrwBrowseX avoid the edit if a:0 < 1 -" call Decho("dirname<".dirname."> netrw_cd_escape<".g:netrw_cd_escape."> browse_split=".g:netrw_browse_split) " call Decho("set up windows for editing<".fnameescape(dirname)."> didsplit=".(exists("s:didsplit")? s:didsplit : "doesn't exist")) call s:NetrwOptionRestore("s:") if !exists("s:didsplit") @@ -2900,15 +2900,13 @@ fun! netrw#NetrwBrowseX(fname,remote) if has("win32") || has("win95") || has("win64") || has("win16") let exten= substitute(exten,'^.*$','\L&\E','') endif - let fname= escape(a:fname,"%#") -" call Decho("fname<".fname."> after escape()") " seems kde systems often have gnome-open due to dependencies, even though " gnome-open's subsidiary display tools are largely absent. Kde systems " usually have "kdeinit" running, though... (tnx Mikolaj Machowski) if !exists("s:haskdeinit") if has("unix") - let s:haskdeinit= s:System("system",'ps -e') =~ 'kdeinit' + let s:haskdeinit= system("ps -e") =~ 'kdeinit' if v:shell_error let s:haskdeinit = 0 endif @@ -2921,12 +2919,14 @@ fun! netrw#NetrwBrowseX(fname,remote) if a:remote == 1 " create a local copy let fname= fnamemodify(tempname(),":r").".".exten -" call Decho("a:remote=".a:remote.": create a local copy of <".a:fname."> as <".fname.">") - exe "silent keepjumps bot 1new ".a:fname +" call Decho("a:remote=".a:remote.": create a local copy of <".fname."> as <".fname.">") + exe "silent keepjumps bot 1new ".fnameescape(fname) setlocal bh=delete -" call Decho("read <".fname.">, now writing: exe w! ".fname) - exe "silent! w! ".fname +" call Decho("read <".fnameescape(fname).">, now writing: exe w! ".fnameescape(fname)) + exe "silent! w! ".fnameescape(fname) q + else + let fname= a:fname endif " call Decho("exten<".exten."> "."netrwFileHandlers#NFH_".exten."():exists=".exists("*netrwFileHandlers#NFH_".exten)) @@ -2972,29 +2972,29 @@ fun! netrw#NetrwBrowseX(fname,remote) elseif exists("g:netrw_browsex_viewer") && executable(viewer) " call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">") -" call Decho("exe silent !".viewer." ".viewopt.shellescape(fname).redir) - exe "silent !".viewer." ".viewopt.shellescape(fname).redir +" call Decho("exe silent !".viewer." ".viewopt.shellescape(fname,1).redir) + exe "silent !".viewer." ".viewopt.shellescape(fname,1).redir let ret= v:shell_error elseif has("win32") || has("win64") -" call Decho('exe silent !start rundll32 url.dll,FileProtocolHandler '.shellescape(fname)) - exe 'silent !start rundll32 url.dll,FileProtocolHandler '.shellescape(fname) +" call Decho('exe silent !start rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1)) + exe 'silent !start rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1) call inputsave()|call input("Press <cr> to continue")|call inputrestore() let ret= v:shell_error elseif has("unix") && executable("gnome-open") && !s:haskdeinit -" call Decho("exe silent !gnome-open ".shellescape(fname)." ".redir) - exe "silent !gnome-open ".shellescape(fname).redir +" call Decho("exe silent !gnome-open ".shellescape(fname,1)." ".redir) + exe "silent !gnome-open ".shellescape(fname,1).redir let ret= v:shell_error elseif has("unix") && executable("kfmclient") && s:haskdeinit -" call Decho("exe silent !kfmclient exec ".shellescape(fname)." ".redir) - exe "silent !kfmclient exec ".shellescape(fname)." ".redir +" call Decho("exe silent !kfmclient exec ".shellescape(fname,1)." ".redir) + exe "silent !kfmclient exec ".shellescape(fname,1)." ".redir let ret= v:shell_error elseif has("macunix") && executable("open") -" call Decho("exe silent !open ".shellescape(fname)." ".redir) - exe "silent !open ".shellescape(fname)." ".redir +" call Decho("exe silent !open ".shellescape(fname,1)." ".redir) + exe "silent !open ".shellescape(fname,1)." ".redir let ret= v:shell_error else @@ -3007,7 +3007,8 @@ fun! netrw#NetrwBrowseX(fname,remote) let ret= netrwFileHandlers#Invoke(exten,fname) endif -" redraw! + " restoring redraw! after external file handlers + redraw! " cleanup: remove temporary file, " delete current buffer if success with handler, @@ -3016,7 +3017,7 @@ fun! netrw#NetrwBrowseX(fname,remote) " temporary file because it wasn't getting seen. " if a:remote == 1 && fname != a:fname " call Decho("deleting temporary file<".fname.">") -" call s:System("delete",fname) +" call s:NetrwDelete(fname) " endif if a:remote == 1 @@ -3652,8 +3653,8 @@ fun! s:NetrwMakeDir(usrhost) let netrw_origdir= s:NetrwGetcwd(1) exe 'keepjumps lcd '.fnameescape(b:netrw_curdir) " call Decho("netrw_origdir<".netrw_origdir.">: lcd b:netrw_curdir<".fnameescape(b:netrw_curdir).">") -" call Decho("exe silent! !".g:netrw_local_mkdir.' '.shellescape(newdirname)) - exe "silent! !".g:netrw_local_mkdir.' '.shellescape(newdirname) +" call Decho("exe silent! !".g:netrw_local_mkdir.' '.shellescape(newdirname,1)) + exe "silent! !".g:netrw_local_mkdir.' '.shellescape(newdirname,1) if !g:netrw_keepdir exe 'keepjumps lcd '.fnameescape(netrw_origdir) " call Decho("netrw_keepdir=".g:netrw_keepdir.": keepjumps lcd ".fnameescape(netrw_origdir)." getcwd<".getcwd().">") @@ -3676,8 +3677,8 @@ fun! s:NetrwMakeDir(usrhost) " call Decho("remote mkdir") let mkdircmd = s:MakeSshCmd(g:netrw_mkdir_cmd) let newdirname= substitute(b:netrw_curdir,'^\%(.\{-}/\)\{3}\(.*\)$','\1','').newdirname -" call Decho("exe silent! !".mkdircmd." ".shellescape(newdirname)) - exe "silent! !".mkdircmd." ".shellescape(newdirname) +" call Decho("exe silent! !".mkdircmd." ".shellescape(newdirname,1)) + exe "silent! !".mkdircmd." ".shellescape(newdirname,1) if v:shell_error == 0 " refresh listing let svpos= netrw#NetrwSavePosn() @@ -3818,14 +3819,14 @@ 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= g:netrw_decompress[sfx] + let exe= s:WinPath(g:netrw_decompress[sfx]) " call Decho("fname<".fname."> is compressed so decompress with <".exe.">") if a:islocal if g:netrw_keepdir - let fname= s:ComposePath(curdir,fname) + let fname= shellescape(s:ComposePath(curdir,fname)) endif else - let fname= b:netrw_curdir.fname + let fname= shellescape(b:netrw_curdir.fname) endif if executable(exe) if a:islocal @@ -3843,10 +3844,10 @@ fun! s:NetrwMarkFileCompress(islocal) unlet exe elseif a:islocal " fname not a compressed file, so compress it - call system(g:netrw_compress." ".s:ComposePath(b:netrw_curdir,fname)) + call system(s:WinPath(g:netrw_compress)." ".shellescape(s:ComposePath(b:netrw_curdir,fname))) else " fname not a compressed file, so compress it - call s:RemoteSystem(g:netrw_compress." ".fname) + call s:RemoteSystem(s:WinPath(g:netrw_compress)." ".shellescape(fname)) endif endfor call s:NetrwUnmarkList(curbufnr,curdir) @@ -3887,7 +3888,7 @@ fun! s:NetrwMarkFileCopy(islocal) " call Decho("copy from local to local") let args= join(map(copy(s:netrwmarkfilelist_{bufnr('%')}),"b:netrw_curdir.\"/\".shellescape(v:val)")) " call Decho("system(".g:netrw_localcopycmd." ".args." ".shellescape(s:netrwmftgt).")") - call system(g:netrw_localcopycmd." ".args." ".shellescape(s:netrwmftgt)) + call system(s:WinPath(g:netrw_localcopycmd)." ".args." ".shellescape(s:netrwmftgt)) elseif a:islocal && !s:netrwmftgt_islocal " Copy marked files, local directory to remote directory @@ -3908,7 +3909,7 @@ fun! s:NetrwMarkFileCopy(islocal) if exists("*mkdir") call mkdir(tmpdir) else - exe "silent! !".g:netrw_local_mkdir.' '.shellescape(tmpdir) + exe "silent! !".g:netrw_local_mkdir.' '.shellescape(tmpdir,1) endif if isdirectory(tmpdir) exe "keepjumps lcd ".fnameescape(tmpdir) @@ -3917,10 +3918,10 @@ fun! s:NetrwMarkFileCopy(islocal) call s:NetrwUpload(localfiles,s:netrwmftgt) if getcwd() == tmpdir for fname in s:netrwmarkfilelist_{bufnr('%')} - call s:System("delete",fname) + call s:NetrwDelete(fname) endfor exe "keepjumps lcd ".fnameescape(curdir) - exe "silent !".g:netrw_local_rmdir." ".fnameescape(tmpdir) + exe "silent !".g:netrw_local_rmdir." ".shellescape(tmpdir,1) else exe "keepjumps lcd ".fnameescape(curdir) endif @@ -4036,10 +4037,10 @@ fun! s:NetrwMarkFileExe(islocal) for fname in s:netrwmarkfilelist_{curbufnr} if a:islocal if g:netrw_keepdir - let fname= s:ComposePath(curdir,fname) + let fname= shellescape(s:WinPath(s:ComposePath(curdir,fname))) endif else - let fname= b:netrw_curdir.fname + let fname= shellescape(s:WinPath(b:netrw_curdir.fname)) endif if cmd =~ '%' let xcmd= substitute(cmd,'%',fname,'g') @@ -4399,8 +4400,8 @@ fun! s:NetrwMarkFileSource(islocal) let fname= curdir.fname endif " the autocmds will handle sourcing both local and remote files -" call Decho("exe so ".escape(fname,' ')) - exe "so ".escape(fname,' ') +" call Decho("exe so ".fnameescape(fname)) + exe "so ".fnameescape(fname) endfor 2match none endif @@ -4439,7 +4440,7 @@ fun! s:NetrwMarkFileTag(islocal) call netrw#ErrorMsg(s:ERROR,"g:netrw_ctags<".g:netrw_ctags."> is not executable!",51) endif else - let cmd= s:RemoteSystem(g:netrw_ctags." ".netrwmarkfilelist) + let cmd = s:RemoteSystem(g:netrw_ctags." ".netrwmarkfilelist) call netrw#NetrwObtain(a:islocal,"tags") let curdir= b:netrw_curdir 1split @@ -4519,6 +4520,36 @@ fun! s:NetrwMarkFileTgt(islocal) endfun " --------------------------------------------------------------------- +" s:NetrwOpenFile: query user for a filename and open it {{{2 +fun! s:NetrwOpenFile(islocal) +" call Dfunc("s:NetrwOpenFile(islocal=".a:islocal.")") + call inputsave() + let fname= input("Enter filename: ") + call inputrestore() + if fname !~ '[/\\]' + if exists("b:netrw_curdir") + if exists("g:netrw_quiet") + let netrw_quiet_keep = g:netrw_quiet + endif + let g:netrw_quiet = 1 + if b:netrw_curdir =~ '/$' + exe "e ".fnameescape(b:netrw_curdir.fname) + else + exe "e ".fnameescape(b:netrw_curdir."/".fname) + endif + if exists("netrw_quiet_keep") + let g:netrw_quiet= netrw_quiet_keep + else + unlet g:netrw_quiet + endif + endif + else + exe "e ".fnameescape(fname) + endif +" call Dret("s:NetrwOpenFile") +endfun + +" --------------------------------------------------------------------- " s:NetrwUnmarkList: delete local marked file lists and remove their contents from the global marked-file list {{{2 fun! s:NetrwUnmarkList(curbufnr,curdir) " call Dfunc("s:NetrwUnmarkList(curbufnr=".a:curbufnr." curdir<".a:curdir.">)") @@ -4735,8 +4766,8 @@ fun! netrw#NetrwObtain(islocal,fname,...) if (has("win32") || has("win95") || has("win64") || has("win16")) " transfer files one at time for fname in fnamelist -" call Decho("system(".g:netrw_localcopycmd." ".fname." ".shellescape(topath).")") - call system(g:netrw_localcopycmd." ".fname." ".shellescape(topath)) +" call Decho("system(".g:netrw_localcopycmd." ".shellescape(fname)." ".shellescape(topath).")") + call system(g:netrw_localcopycmd." ".shellescape(fname)." ".shellescape(topath)) endfor else " transfer files with one command @@ -4770,9 +4801,9 @@ fun! netrw#NetrwObtain(islocal,fname,...) else let path= "" endif - let filelist= join(map(copy(fnamelist),'shellescape(g:netrw_machine.":".escape(path.v:val,g:netrw_fname_escape))')) -" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".filelist." ".shellescape(tgtdir)) - exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".filelist." ".shellescape(tgtdir) + let filelist= join(map(copy(fnamelist),'shellescape(g:netrw_machine.":".path.v:val,1))')) +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".filelist." ".shellescape(tgtdir,1)) + exe s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".filelist." ".shellescape(tgtdir,1) elseif b:netrw_method == 2 " obtain file using ftp + .netrc @@ -4799,11 +4830,11 @@ fun! netrw#NetrwObtain(islocal,fname,...) " call Decho("filter input: ".getline('$')) endfor if exists("g:netrw_port") && g:netrw_port != "" -" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port) - exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port +" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)) + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1) else -" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine) - exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine +" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)) + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1) endif " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar) if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying ' @@ -5029,12 +5060,11 @@ fun! s:NetrwUpload(fname,tgt,...) if a:tgt =~ '/$' let wfname= substitute(a:fname,'^.*/','','') let wfname= escape(a:tgt.wfname,g:netrw_fname_escape) -" call Decho("exe w! ".wfname) - exe "w! ".wfname +" call Decho("exe w! ".fnameescape(wfname)) + exe "w! ".fnameescape(wfname) else - let wfname= escape(a:tgt,g:netrw_fname_escape) -" call Decho("writing local->remote: exe w ".wfname) - exe "w ".wfname +" call Decho("writing local->remote: exe w ".fnameescape(a:tgt)) + exe "w ".fnameescape(a:tgt) " call Decho("done writing local->remote") endif q! @@ -5054,8 +5084,8 @@ fun! s:NetrwUpload(fname,tgt,...) endif let machine = substitute(a:tgt,'^scp://\([^/:]\+\).*$','\1','') let tgt = substitute(a:tgt,'^scp://[^/]\+/\(.*\)$','\1','') -" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".args." ".shellescape(machine.":".escape(tgt,g:netrw_fname_escape))) - exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".args." ".shellescape(machine.":".escape(tgt,g:netrw_fname_escape)) +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".args." ".shellescape(machine.":".tgt,1)) + exe s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".args." ".shellescape(machine.":".tgt,1) exe "keepjumps silent lcd ".fnameescape(curdir) elseif a:tgt =~ '^ftp:' @@ -5087,12 +5117,12 @@ fun! s:NetrwUpload(fname,tgt,...) endfor if exists("g:netrw_port") && g:netrw_port != "" -" call Decho("executing: ".s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port) - exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port +" call Decho("executing: ".s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)) + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1) else " call Decho("filter input window#".winnr()) -" call Decho("executing: ".s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine) - exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine +" call Decho("executing: ".s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)) + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1) endif " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar) silent g/Local directory now/d @@ -5794,10 +5824,10 @@ fun! s:PerformListing(islocal) " call Decho("g:netrw_sort_direction=".g:netrw_sort_direction." (bannercnt=".w:netrw_bannercnt.")") if g:netrw_sort_direction =~ 'n' " normal direction sorting - exe 'silent keepjumps '.w:netrw_bannercnt.',$sort' + exe 'silent keepjumps '.w:netrw_bannercnt.',$sort'.' '.g:netrw_sort_options else " reverse direction sorting - exe 'silent keepjumps '.w:netrw_bannercnt.',$sort!' + exe 'silent keepjumps '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options endif endif " remove priority pattern prefix @@ -5810,10 +5840,10 @@ fun! s:PerformListing(islocal) " call Decho("g:netrw_sort_direction=".g:netrw_sort_direction) if g:netrw_sort_direction =~ 'n' " call Decho('exe silent keepjumps '.w:netrw_bannercnt.',$sort') - exe 'silent keepjumps '.w:netrw_bannercnt.',$sort' + exe 'silent keepjumps '.w:netrw_bannercnt.',$sort'.' '.g:netrw_sort_options else " call Decho('exe silent keepjumps '.w:netrw_bannercnt.',$sort!') - exe 'silent keepjumps '.w:netrw_bannercnt.',$sort!' + exe 'silent keepjumps '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options endif endif exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\d\{-}\///e' @@ -5997,8 +6027,8 @@ fun! s:NetrwRemoteListing() let listcmd= s:MakeSshCmd(g:netrw_list_cmd) " call Decho("listcmd<".listcmd."> (using g:netrw_list_cmd)") if g:netrw_scp_cmd =~ '^pscp' -" call Decho("1: exe silent r! ".listcmd.shellescape(s:path)) - exe "silent r! ".listcmd.shellescape(s:path) +" call Decho("1: exe silent r! ".listcmd.s:path) + exe "silent r! ".listcmd.s:path " remove rubbish and adjust listing format of 'pscp' to 'ssh ls -FLa' like g/^Listing directory/d g/^d[-rwx][-rwx][-rwx]/s+$+/+e @@ -6011,8 +6041,8 @@ fun! s:NetrwRemoteListing() " call Decho("2: exe silent r! ".listcmd) exe "silent r! ".listcmd else -" call Decho("3: exe silent r! ".listcmd.' "'.shellescape(s:path).'"') - exe "silent r! ".listcmd.' "'.shellescape(s:path).'"' +" call Decho("3: exe silent r! ".listcmd.' '.shellescape(s:path,1)) + exe "silent r! ".listcmd.' '.shellescape(s:path,1) " call Decho("listcmd<".listcmd."> path<".s:path.">") endif endif @@ -6203,17 +6233,17 @@ 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(g:netrw_rmdir_cmd).' '.rmfile + let netrw_rmdir_cmd = s:MakeSshCmd(s:WinPath(g:netrw_rmdir_cmd)).' '.shellescape(s:WinPath(rmfile)) " call Decho("attempt to remove dir: system(".netrw_rmdir_cmd.")") - let ret= s:System("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(g:netrw_rmf_cmd).' '.substitute(rmfile,'[\/]$','','e') -" call Decho("2nd attempt to remove dir: system(".netrw_rmf_cmd.")") - let ret= s:System("system",netrw_rmf_cmd) -" call Decho("returned=".ret." errcode=".v:shell_error) +" 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'))) +" 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) if v:shell_error != 0 && !exists("g:netrw_quiet") call netrw#ErrorMsg(s:ERROR,"unable to remove directory<".rmfile."> -- is it empty?",22) @@ -6262,11 +6292,11 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd) call setline(line("$")+1,a:listcmd) " exe "keepjumps ".w:netrw_bannercnt.',$g/^./call Decho("ftp#".line(".").": ".getline("."))' if exists("g:netrw_port") && g:netrw_port != "" -" call Decho("exe ".s:netrw_silentxfer.w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port) - exe s:netrw_silentxfer." keepjumps ".w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port +" call Decho("exe ".s:netrw_silentxfer.w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)) + exe s:netrw_silentxfer." keepjumps ".w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1) else -" call Decho("exe ".s:netrw_silentxfer.w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine) - exe s:netrw_silentxfer." keepjumps ".w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine +" call Decho("exe ".s:netrw_silentxfer.w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)) + exe s:netrw_silentxfer." keepjumps ".w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1) endif "......................................... @@ -6368,10 +6398,10 @@ fun! s:NetrwRemoteRename(usrhost,path) range if exists("w:netrw_method") && (w:netrw_method == 2 || w:netrw_method == 3) call s:NetrwRemoteFtpCmd(a:path,"rename ".oldname." ".newname) else - let oldname= a:path.oldname - let newname= a:path.newname -" call Decho("system(rename_cmd".' "'.fnameescape(oldname," ").'" "'.escape(newname).'"') - let ret= s:System("system",rename_cmd.' "'.fnameescape(oldname).'" "'.fnameescape(newname).'"') + 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) endif endfor @@ -6393,10 +6423,10 @@ fun! s:NetrwRemoteRename(usrhost,path) range if exists("w:netrw_method") && (w:netrw_method == 2 || w:netrw_method == 3) call s:NetrwRemoteFtpCmd(a:path,"rename ".oldname." ".newname) else - let oldname= a:path.oldname - let newname= a:path.newname -" call Decho("system(rename_cmd".' "'.fnameescape(oldname," ").'" "'.escape(newname).'"') - let ret= s:System("system",rename_cmd.' "'.fnameescape(oldname).'" "'.fnameescape(newname).'"') + 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) endif let ctr= ctr + 1 @@ -6751,7 +6781,7 @@ fun! s:NetrwLocalRmFile(path,fname,all) endif if all || ok =~ 'y\%[es]' || ok == "" - let ret= s:System("delete",rmfile) + let ret= s:NetrwDelete(rmfile) " call Decho("errcode=".v:shell_error." ret=".ret) endif @@ -6773,19 +6803,19 @@ fun! s:NetrwLocalRmFile(path,fname,all) let rmfile= substitute(rmfile,'[\/]$','','e') if all || ok =~ 'y\%[es]' || ok == "" -" call Decho("1st attempt: system(".g:netrw_local_rmdir.' '.shellescape(rmfile).')') - call s:System("system",g:netrw_local_rmdir.' '.shellescape(rmfile)) +" 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("v:shell_error=".v:shell_error) if v:shell_error != 0 " call Decho("2nd attempt to remove directory<".rmfile.">") - let errcode= s:System("delete",rmfile) + let errcode= s:NetrwDelete(rmfile) " call Decho("errcode=".errcode) if errcode != 0 if has("unix") " call Decho("3rd attempt to remove directory<".rmfile.">") - call s:System("system","rm ".shellescape(rmfile)) + call system("rm ".shellescape(rmfile)) if v:shell_error != 0 && !exists("g:netrw_quiet") call netrw#ErrorMsg(s:ERROR,"unable to remove directory<".rmfile."> -- is it empty?",34) let ok="no" @@ -6938,99 +6968,11 @@ endfun " Support Functions: {{{1 " --------------------------------------------------------------------- -" s:UpdateBuffersMenu: does emenu Buffers.Refresh (but due to locale, the menu item may not be called that) {{{2 -" The Buffers.Refresh menu calls s:BMShow(); unfortunately, that means that that function -" can't be called except via emenu. But due to locale, that menu line may not be called -" 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' - try - silent emenu Buffers.Refresh\ menu - catch /^Vim\%((\a\+)\)\=:E/ - let v:errmsg= "" - silent call s:NetrwBMShow() - endtry - endif -" call Dret("s:UpdateBuffersMenu") -endfun - -" --------------------------------------------------------------------- -" s:NetrwBMShow: {{{2 -fun! s:NetrwBMShow() -" call Dfunc("s:NetrwBMShow()") - redir => bmshowraw - menu - redir END - let bmshowlist = split(bmshowraw,'\n') - if bmshowlist != [] - let bmshowfuncs= filter(bmshowlist,'v:val =~ "<SNR>\\d\\+_BMShow()"') - if bmshowfuncs != [] - let bmshowfunc = substitute(bmshowfuncs[0],'^.*:\(call.*BMShow()\).*$','\1','') - if bmshowfunc =~ '^call.*BMShow()' - exe "silent! ".bmshowfunc - endif - endif - endif -" call Dret("s:NetrwBMShow : bmshowfunc<".(exists("bmshowfunc")? bmshowfunc : 'n/a').">") -endfun - -" --------------------------------------------------------------------- -" s:ComposePath: Appends a new part to a path taking different systems into consideration {{{2 -fun! s:ComposePath(base,subdir) -" call Dfunc("s:ComposePath(base<".a:base."> subdir<".a:subdir.">)") - - if(has("amiga")) -" call Decho("amiga") - let ec = a:base[strlen(a:base)-1] - if ec != '/' && ec != ':' - let ret = a:base . "/" . a:subdir - else - let ret = a:base . a:subdir - endif - - elseif a:subdir =~ '^\a:[/\\][^/\\]' && (has("win32") || has("win95") || has("win64") || has("win16")) -" call Decho("windows") - let ret= a:subdir - - elseif a:base =~ '^\a\+://' -" call Decho("remote linux/macos") - let urlbase = substitute(a:base,'^\(\a\+://.\{-}/\)\(.*\)$','\1','') - let curpath = substitute(a:base,'^\(\a\+://.\{-}/\)\(.*\)$','\2','') - if a:subdir == '../' - if curpath =~ '[^/]/[^/]\+/$' - let curpath= substitute(curpath,'[^/]\+/$','','') - else - let curpath="" - endif - let ret= urlbase.curpath - else - let ret= urlbase.curpath.a:subdir - endif -" call Decho("urlbase<".urlbase.">") -" call Decho("curpath<".curpath.">") -" call Decho("ret<".ret.">") - - else -" call Decho("local linux/macos") - let ret = substitute(a:base."/".a:subdir,"//","/","g") - if a:base =~ '^//' - " keeping initial '//' for the benefit of network share listing support - let ret= '/'.ret - endif - let ret= simplify(ret) - endif - -" call Dret("s:ComposePath ".ret) - return ret -endfun - -" --------------------------------------------------------------------- " netrw#ErrorMsg: {{{2 " 0=note = s:NOTE " 1=warning = s:WARNING " 2=error = s:ERROR -" Jun 11, 2008 : max errnum currently is 70 +" Jul 08, 2008 : max errnum currently is 71 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) @@ -7099,6 +7041,68 @@ fun! netrw#ErrorMsg(level,msg,errnum) endfun " --------------------------------------------------------------------- +" netrw#NetrwRestorePosn: restores the cursor and file position as saved by NetrwSavePosn() {{{2 +fun! netrw#NetrwRestorePosn(...) +" call Dfunc("netrw#NetrwRestorePosn() a:0=".a:0." winnr=".(exists("w:netrw_winnr")? w:netrw_winnr : -1)." line=".(exists("w:netrw_line")? w:netrw_line : -1)." col=".(exists("w:netrw_col")? w:netrw_col : -1)." hline=".(exists("w:netrw_hline")? w:netrw_hline : -1)) + let eikeep= &ei + set ei=all + if expand("%") == "NetrwMessage" + exe s:winBeforeErr."wincmd w" + endif + + if a:0 > 0 + exe a:1 + endif + + " restore window + if exists("w:netrw_winnr") +" call Decho("restore window: exe silent! ".w:netrw_winnr."wincmd w") + exe "silent! ".w:netrw_winnr."wincmd w" + endif + if v:shell_error == 0 + " as suggested by Bram M: redraw on no error + " allows protocol error messages to remain visible +" redraw! + endif + + " restore top-of-screen line + if exists("w:netrw_hline") +" call Decho("restore topofscreen: exe norm! ".w:netrw_hline."G0z") + exe "norm! ".w:netrw_hline."G0z\<CR>" + endif + + " restore position + if exists("w:netrw_line") && exists("w:netrw_col") +" call Decho("restore posn: exe norm! ".w:netrw_line."G0".w:netrw_col."|") + exe "norm! ".w:netrw_line."G0".w:netrw_col."\<bar>" + endif + + let &ei= eikeep +" call Dret("netrw#NetrwRestorePosn") +endfun + +" --------------------------------------------------------------------- +" netrw#NetrwSavePosn: saves position of cursor on screen {{{2 +fun! netrw#NetrwSavePosn() +" call Dfunc("netrw#NetrwSavePosn()") + " Save current line and column + let w:netrw_winnr= winnr() + let w:netrw_line = line(".") + let w:netrw_col = virtcol(".") + + " Save top-of-screen line + norm! H0 + let w:netrw_hline= line(".") + + " set up string holding position parameters + let ret = "let w:netrw_winnr=".w:netrw_winnr."|let w:netrw_line=".w:netrw_line."|let w:netrw_col=".w:netrw_col."|let w:netrw_hline=".w:netrw_hline + + call netrw#NetrwRestorePosn() +" call Dret("netrw#NetrwSavePosn : winnr=".w:netrw_winnr." line=".w:netrw_line." col=".w:netrw_col." hline=".w:netrw_hline) + return ret +endfun + +" ------------------------------------------------------------------------ " netrw#RFC2396: converts %xx into characters {{{2 fun! netrw#RFC2396(fname) " call Dfunc("netrw#RFC2396(fname<".a:fname.">)") @@ -7108,6 +7112,56 @@ fun! netrw#RFC2396(fname) endfun " --------------------------------------------------------------------- +" s:ComposePath: Appends a new part to a path taking different systems into consideration {{{2 +fun! s:ComposePath(base,subdir) +" call Dfunc("s:ComposePath(base<".a:base."> subdir<".a:subdir.">)") + + if(has("amiga")) +" call Decho("amiga") + let ec = a:base[strlen(a:base)-1] + if ec != '/' && ec != ':' + let ret = a:base . "/" . a:subdir + else + let ret = a:base . a:subdir + endif + + elseif a:subdir =~ '^\a:[/\\][^/\\]' && (has("win32") || has("win95") || has("win64") || has("win16")) +" call Decho("windows") + let ret= a:subdir + + elseif a:base =~ '^\a\+://' +" call Decho("remote linux/macos") + let urlbase = substitute(a:base,'^\(\a\+://.\{-}/\)\(.*\)$','\1','') + let curpath = substitute(a:base,'^\(\a\+://.\{-}/\)\(.*\)$','\2','') + if a:subdir == '../' + if curpath =~ '[^/]/[^/]\+/$' + let curpath= substitute(curpath,'[^/]\+/$','','') + else + let curpath="" + endif + let ret= urlbase.curpath + else + let ret= urlbase.curpath.a:subdir + endif +" call Decho("urlbase<".urlbase.">") +" call Decho("curpath<".curpath.">") +" call Decho("ret<".ret.">") + + else +" call Decho("local linux/macos") + let ret = substitute(a:base."/".a:subdir,"//","/","g") + if a:base =~ '^//' + " keeping initial '//' for the benefit of network share listing support + let ret= '/'.ret + endif + let ret= simplify(ret) + endif + +" call Dret("s:ComposePath ".ret) + return ret +endfun + +" --------------------------------------------------------------------- " s:FileReadable: o/s independent filereadable {{{2 fun! s:FileReadable(fname) " call Dfunc("s:FileReadable(fname<".a:fname.">)") @@ -7134,12 +7188,12 @@ fun! s:GetTempfile(fname) let tmpfile= tempname() " call Decho("tmpfile<".tmpfile."> : from tempname()") - let tmpfile= escape(substitute(tmpfile,'\','/','ge'),g:netrw_tmpfile_escape) + let tmpfile= substitute(tmpfile,'\','/','ge') " call Decho("tmpfile<".tmpfile."> : chgd any \\ -> /") " sanity check -- does the temporary file's directory exist? if !isdirectory(substitute(tmpfile,'[^/]\+$','','e')) -" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap) +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) call netrw#ErrorMsg(s:ERROR,"your <".substitute(tmpfile,'[^/]\+$','','e')."> directory is missing!",2) " call Dret("s:GetTempfile getcwd<".getcwd().">") return "" @@ -7176,7 +7230,6 @@ fun! s:GetTempfile(fname) else let suffix = substitute(a:fname,'^.*\(\.[^./]\+\)$','\1','e') endif - let suffix = escape(suffix,g:netrw_tmpfile_escape) " call Decho("suffix<".suffix.">") let tmpfile= substitute(tmpfile,'\.tmp$','','e') " call Decho("chgd tmpfile<".tmpfile."> (removed any .tmp suffix)") @@ -7186,14 +7239,14 @@ fun! s:GetTempfile(fname) endif endif -" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap) +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) " call Dret("s:GetTempfile <".tmpfile.">") return tmpfile endfun " --------------------------------------------------------------------- " s:MakeSshCmd: transforms input command using USEPORT HOSTNAME into {{{2 -" a correct command +" a correct command for use with a system() call fun! s:MakeSshCmd(sshcmd) " call Dfunc("s:MakeSshCmd(sshcmd<".a:sshcmd.">) user<".s:user."> machine<".s:machine.">") let sshcmd = substitute(a:sshcmd,'\<HOSTNAME\>',s:user.s:machine,'') @@ -7209,28 +7262,54 @@ fun! s:MakeSshCmd(sshcmd) endfun " --------------------------------------------------------------------- -" s:RemoteSystem: runs a command on a remote host using ssh {{{2 -" Returns status -fun! s:RemoteSystem(cmd) -" call Dfunc("s:RemoteSystem(cmd<".a:cmd.">)") - if !executable(g:netrw_ssh_cmd) - call netrw#ErrorMsg(s:ERROR,"g:netrw_ssh_cmd<".g:netrw_ssh_cmd."> is not executable!",52) - elseif !exists("b:netrw_curdir") - call netrw#ErrorMsg(s:ERROR,"for some reason b:netrw_curdir doesn't exist!",53) - else - let cmd = s:MakeSshCmd(g:netrw_ssh_cmd." USEPORT HOSTNAME") - let remotedir= substitute(b:netrw_curdir,'^.*//[^/]\+/\(.*\)$','\1','') - if remotedir != "" - let cmd= cmd.' "cd '.shellescape(remotedir).";" +" s:NetrwBMShow: {{{2 +fun! s:NetrwBMShow() +" call Dfunc("s:NetrwBMShow()") + redir => bmshowraw + menu + redir END + let bmshowlist = split(bmshowraw,'\n') + if bmshowlist != [] + let bmshowfuncs= filter(bmshowlist,'v:val =~ "<SNR>\\d\\+_BMShow()"') + if bmshowfuncs != [] + let bmshowfunc = substitute(bmshowfuncs[0],'^.*:\(call.*BMShow()\).*$','\1','') + if bmshowfunc =~ '^call.*BMShow()' + exe "silent! ".bmshowfunc + endif + endif + endif +" call Dret("s:NetrwBMShow : bmshowfunc<".(exists("bmshowfunc")? bmshowfunc : 'n/a').">") +endfun + +" --------------------------------------------------------------------- +" s:NetrwDelete: Deletes a file. {{{2 +" Uses Steve Hall's idea to insure that Windows paths stay +" acceptable. No effect on Unix paths. +" Examples of use: let result= s:NetrwDelete(path) +fun! s:NetrwDelete(path) +" call Dfunc("s:NetrwDelete(path<".a:path.">)") + + let path = s:WinPath(a:path) + if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16")) + if exists("+shellslash") + let sskeep= &shellslash + setlocal noshellslash + let result = delete(path) + let &shellslash = sskeep else - let cmd= cmd.' "' +" call Decho("exe let result= ".a:cmd."('".path."')") + let result= delete(path) endif - let cmd= cmd.a:cmd.'"' -" call Decho("call system(".cmd.")") - let ret= system(cmd) + else +" call Decho("let result= delete(".path.")") + let result= delete(path) endif -" call Dret("s:RemoteSystem ".ret) - return ret + if result < 0 + call Netrw#ErrorMsg(s:WARNING,"delete(".path.") failed!",71) + endif + +" call Dret("s:NetrwDelete ".result) + return result endfun " --------------------------------------------------------------------- @@ -7286,7 +7365,7 @@ fun! s:NetrwEnew(curdir) nno <silent> <buffer> [ :silent call <SID>TreeListMove('[')<cr> nno <silent> <buffer> ] :silent call <SID>TreeListMove(']')<cr> else - exe "silent! keepalt file ".b:netrw_curdir + exe "silent! keepalt file ".fnameescape(b:netrw_curdir) endif endif @@ -7294,68 +7373,6 @@ fun! s:NetrwEnew(curdir) endfun " ------------------------------------------------------------------------ -" netrw#NetrwSavePosn: saves position of cursor on screen {{{2 -fun! netrw#NetrwSavePosn() -" call Dfunc("netrw#NetrwSavePosn()") - " Save current line and column - let w:netrw_winnr= winnr() - let w:netrw_line = line(".") - let w:netrw_col = virtcol(".") - - " Save top-of-screen line - norm! H0 - let w:netrw_hline= line(".") - - " set up string holding position parameters - let ret = "let w:netrw_winnr=".w:netrw_winnr."|let w:netrw_line=".w:netrw_line."|let w:netrw_col=".w:netrw_col."|let w:netrw_hline=".w:netrw_hline - - call netrw#NetrwRestorePosn() -" call Dret("netrw#NetrwSavePosn : winnr=".w:netrw_winnr." line=".w:netrw_line." col=".w:netrw_col." hline=".w:netrw_hline) - return ret -endfun - -" ------------------------------------------------------------------------ -" netrw#NetrwRestorePosn: restores the cursor and file position as saved by NetrwSavePosn() {{{2 -fun! netrw#NetrwRestorePosn(...) -" call Dfunc("netrw#NetrwRestorePosn() a:0=".a:0." winnr=".(exists("w:netrw_winnr")? w:netrw_winnr : -1)." line=".(exists("w:netrw_line")? w:netrw_line : -1)." col=".(exists("w:netrw_col")? w:netrw_col : -1)." hline=".(exists("w:netrw_hline")? w:netrw_hline : -1)) - let eikeep= &ei - set ei=all - if expand("%") == "NetrwMessage" - exe s:winBeforeErr."wincmd w" - endif - - if a:0 > 0 - exe a:1 - endif - - " restore window - if exists("w:netrw_winnr") -" call Decho("restore window: exe silent! ".w:netrw_winnr."wincmd w") - exe "silent! ".w:netrw_winnr."wincmd w" - endif - if v:shell_error == 0 - " as suggested by Bram M: redraw on no error - " allows protocol error messages to remain visible -" redraw! - endif - - " restore top-of-screen line - if exists("w:netrw_hline") -" call Decho("restore topofscreen: exe norm! ".w:netrw_hline."G0z") - exe "norm! ".w:netrw_hline."G0z\<CR>" - endif - - " restore position - if exists("w:netrw_line") && exists("w:netrw_col") -" call Decho("restore posn: exe norm! ".w:netrw_line."G0".w:netrw_col."|") - exe "norm! ".w:netrw_line."G0".w:netrw_col."\<bar>" - endif - - let &ei= eikeep -" call Dret("netrw#NetrwRestorePosn") -endfun - -" --------------------------------------------------------------------- " s:NetrwSaveWordPosn: used to keep cursor on same word after refresh, {{{2 " changed sorting, etc. Also see s:NetrwRestoreWordPosn(). fun! s:NetrwSaveWordPosn() @@ -7374,6 +7391,21 @@ fun! s:NetrwRestoreWordPosn() endfun " --------------------------------------------------------------------- +" s:RestoreBufVars: {{{2 +fun! s:RestoreBufVars() +" call Dfunc("s:RestoreBufVars()") + + if exists("s:netrw_curdir") |let b:netrw_curdir = s:netrw_curdir |endif + if exists("s:netrw_lastfile") |let b:netrw_lastfile = s:netrw_lastfile |endif + if exists("s:netrw_method") |let b:netrw_method = s:netrw_method |endif + if exists("s:netrw_fname") |let b:netrw_fname = s:netrw_fname |endif + if exists("s:netrw_machine") |let b:netrw_machine = s:netrw_machine |endif + if exists("s:netrw_browser_active")|let b:netrw_browser_active = s:netrw_browser_active|endif + +" call Dret("s:RestoreBufVars") +endfun + +" --------------------------------------------------------------------- " s:RemotePathAnalysis: {{{2 fun! s:RemotePathAnalysis(dirname) " call Dfunc("s:RemotePathAnalysis()") @@ -7397,18 +7429,31 @@ fun! s:RemotePathAnalysis(dirname) endfun " --------------------------------------------------------------------- -" s:RestoreBufVars: {{{2 -fun! s:RestoreBufVars() -" call Dfunc("s:RestoreBufVars()") - - if exists("s:netrw_curdir") |let b:netrw_curdir = s:netrw_curdir |endif - if exists("s:netrw_lastfile") |let b:netrw_lastfile = s:netrw_lastfile |endif - if exists("s:netrw_method") |let b:netrw_method = s:netrw_method |endif - if exists("s:netrw_fname") |let b:netrw_fname = s:netrw_fname |endif - if exists("s:netrw_machine") |let b:netrw_machine = s:netrw_machine |endif - if exists("s:netrw_browser_active")|let b:netrw_browser_active = s:netrw_browser_active|endif - -" call Dret("s:RestoreBufVars") +" s:RemoteSystem: runs a command on a remote host using ssh {{{2 +" Returns status +" Runs system() on +" [cd REMOTEDIRPATH;] a:cmd +" Note that it doesn't do shellescape(a:cmd)! +fun! s:RemoteSystem(cmd) +" call Dfunc("s:RemoteSystem(cmd<".a:cmd.">)") + if !executable(g:netrw_ssh_cmd) + call netrw#ErrorMsg(s:ERROR,"g:netrw_ssh_cmd<".g:netrw_ssh_cmd."> is not executable!",52) + elseif !exists("b:netrw_curdir") + call netrw#ErrorMsg(s:ERROR,"for some reason b:netrw_curdir doesn't exist!",53) + else + let cmd = s:MakeSshCmd(g:netrw_ssh_cmd." USEPORT HOSTNAME") + let remotedir= substitute(b:netrw_curdir,'^.*//[^/]\+/\(.*\)$','\1','') + if remotedir != "" + let cmd= cmd.' cd '.shellescape(remotedir).";" + else + let cmd= cmd.' ' + endif + let cmd= cmd.a:cmd +" call Decho("call system(".cmd.")") + let ret= system(cmd) + endif +" call Dret("s:RemoteSystem ".ret) + return ret endfun " --------------------------------------------------------------------- @@ -7586,44 +7631,6 @@ fun! s:Strlen(x) endfun " --------------------------------------------------------------------- -" s:System: using Steve Hall's idea to insure that Windows paths stay {{{2 -" acceptable. No effect on Unix paths. -" Examples of use: let result= s:System("rm",path) -" let result= s:System("delete",path) -fun! netrw#System(cmd,path) - echomsg s:System(a:cmd,a:path) -endfun -fun! s:System(cmd,path) -" call Dfunc("s:System(cmd<".a:cmd."> path<".a:path.">)") - - let path = a:path - if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16")) - " system call prep - " remove trailing slash (Win95) - let path = substitute(path, '\(\\\|/\)$', '', 'g') - " remove escaped spaces - let path = substitute(path, '\ ', ' ', 'g') - " convert slashes to backslashes - let path = substitute(path, '/', '\', 'g') - if exists("+shellslash") - let sskeep= &shellslash - setlocal noshellslash - exe "let result= ".a:cmd."('".path."')" - let &shellslash = sskeep - else -" call Decho("exe let result= ".a:cmd."('".path."')") - exe "let result= ".a:cmd."('".path."')" - endif - else -" call Decho("exe let result= ".a:cmd."('".path."')") - exe "let result= ".a:cmd."('".path."')" - endif - -" call Dret("s:System result<".result.">") - return result -endfun - -" --------------------------------------------------------------------- " s:TreeListMove: {{{2 fun! s:TreeListMove(dir) " call Dfunc("s:TreeListMove(dir<".a:dir.">)") @@ -7680,6 +7687,24 @@ fun! s:TreeListMove(dir) endfun " --------------------------------------------------------------------- +" s:UpdateBuffersMenu: does emenu Buffers.Refresh (but due to locale, the menu item may not be called that) {{{2 +" The Buffers.Refresh menu calls s:BMShow(); unfortunately, that means that that function +" can't be called except via emenu. But due to locale, that menu line may not be called +" 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' + try + silent emenu Buffers.Refresh\ menu + catch /^Vim\%((\a\+)\)\=:E/ + let v:errmsg= "" + silent call s:NetrwBMShow() + endtry + endif +" call Dret("s:UpdateBuffersMenu") +endfun + +" --------------------------------------------------------------------- " s:UseBufWinVars: (used by NetrwBrowse() and LocalBrowseCheck() {{{2 " Matching function to BufferWinVars() fun! s:UseBufWinVars() @@ -7698,6 +7723,24 @@ fun! s:UseBufWinVars() endfun " --------------------------------------------------------------------- +" s:WinPath: {{{2 +fun! s:WinPath(path) +" call Dfunc("s:WinPath(path<".a:path.">)") + if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16")) + " remove trailing slash (Win95) + let path = substitute(a:path, '\(\\\|/\)$', '', 'g') + " remove escaped spaces + let path = substitute(path, '\ ', ' ', 'g') + " convert slashes to backslashes + let path = substitute(path, '/', '\', 'g') + else + let path= a:path + endif +" call Dret("s:WinPath <".path.">") + return path +endfun + +" --------------------------------------------------------------------- " Settings Restoration: {{{2 let &cpo= s:keepcpo unlet s:keepcpo diff --git a/runtime/autoload/netrwSettings.vim b/runtime/autoload/netrwSettings.vim index d6a936247..c0704d4ef 100644 --- a/runtime/autoload/netrwSettings.vim +++ b/runtime/autoload/netrwSettings.vim @@ -1,7 +1,7 @@ " netrwSettings.vim: makes netrw settings simpler -" Date: Mar 11, 2008 +" Date: Jul 02, 2008 " Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz> -" Version: 11 +" Version: 12 " Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1 " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright @@ -19,7 +19,7 @@ if exists("g:loaded_netrwSettings") || &cp finish endif -let g:loaded_netrwSettings = "v11" +let g:loaded_netrwSettings = "v12" " --------------------------------------------------------------------- " NetrwSettings: {{{1 @@ -82,8 +82,6 @@ fun! netrwSettings#NetrwSettings() put = 'let g:netrw_ftpmode = '.g:netrw_ftpmode put = 'let g:netrw_ignorenetrc = '.g:netrw_ignorenetrc put = 'let g:netrw_sshport = '.g:netrw_sshport - let shqline= line("$") - put = 'let g:netrw_shq...' put = 'let g:netrw_use_nt_rcp = '.g:netrw_use_nt_rcp put = 'let g:netrw_win95ftp = '.g:netrw_win95ftp let s:netrw_xfer_stop= line(".") @@ -101,8 +99,6 @@ fun! netrwSettings#NetrwSettings() else put = 'let g:netrw_browsex_viewer = (not defined)' endif - let cdescline= line("$") - put ='let g:netrw_cd_escape...' put = 'let g:netrw_compress = '.g:netrw_compress let decompressline= line("$") put ='let g:netrw_decompress...' @@ -137,6 +133,7 @@ fun! netrwSettings#NetrwSettings() put = 'let g:netrw_silent = '.g:netrw_silent put = 'let g:netrw_sort_by = '.g:netrw_sort_by put = 'let g:netrw_sort_direction = '.g:netrw_sort_direction + put = 'let g:netrw_sort_options = '.g:netrw_sort_options put = 'let g:netrw_sort_sequence = '.g:netrw_sort_sequence put = 'let g:netrw_special_syntax = '.g:netrw_special_syntax put = 'let g:netrw_ssh_browse_reject = '.g:netrw_ssh_browse_reject @@ -159,14 +156,6 @@ fun! netrwSettings#NetrwSettings() silent %s/= $/= ''/e 1 - " Put in g:netrw_shq setting and g:netrw_cd_escape - " (deferred so as to avoid the quote manipulation just preceding) - if g:netrw_shq == "'" - call setline(shqline, 'let g:netrw_shq = "'.g:netrw_shq.'"') - else - call setline(shqline, "let g:netrw_shq = '".g:netrw_shq."'") - endif - call setline(cdescline, "let g:netrw_cd_escape = ".'"'.escape(g:netrw_cd_escape,'\"').'"') call setline(decompressline,"let g:netrw_decompress = ".substitute(string(g:netrw_decompress),"^'\\(.*\\)'$",'\1','')) call setline(fnameescline, "let g:netrw_fname_escape = '".escape(g:netrw_fname_escape,"'")."'") call setline(globescline, "let g:netrw_glob_escape = '".escape(g:netrw_glob_escape,"'")."'") diff --git a/runtime/autoload/rubycomplete.vim b/runtime/autoload/rubycomplete.vim index 47c77d93d..87e6c9a0f 100644 --- a/runtime/autoload/rubycomplete.vim +++ b/runtime/autoload/rubycomplete.vim @@ -301,7 +301,7 @@ class VimRubyCompletion def get_buffer_entity(name, vimfun) loading_allowed = VIM::evaluate("exists('g:rubycomplete_buffer_loading') && g:rubycomplete_buffer_loading") - return nil if loading_allowed != '1' + return nil if loading_allowed.to_i.zero? return nil if /(\"|\')+/.match( name ) buf = VIM::Buffer.current nums = eval( VIM::evaluate( vimfun % name ) ) @@ -368,7 +368,7 @@ class VimRubyCompletion # this will be a little expensive. loading_allowed = VIM::evaluate("exists('g:rubycomplete_buffer_loading') && g:rubycomplete_buffer_loading") allow_aggressive_load = VIM::evaluate("exists('g:rubycomplete_classes_in_global') && g:rubycomplete_classes_in_global") - return [] if allow_aggressive_load != '1' || loading_allowed != '1' + return [] if allow_aggressive_load.to_i.zero? || loading_allowed.to_i.zero? buf = VIM::Buffer.current eob = buf.length @@ -401,7 +401,7 @@ class VimRubyCompletion def load_rails allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails") - return if allow_rails != '1' + return if allow_rails.to_i.zero? buf_path = VIM::evaluate('expand("%:p")') file_name = VIM::evaluate('expand("%:t")') @@ -461,7 +461,7 @@ class VimRubyCompletion def get_rails_helpers allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails") rails_loaded = VIM::evaluate('s:rubycomplete_rails_loaded') - return [] if allow_rails != '1' || rails_loaded != '1' + return [] if allow_rails.to_i.zero? || rails_loaded.to_i.zero? buf_path = VIM::evaluate('expand("%:p")') buf_path.gsub!( /\\/, "/" ) @@ -511,7 +511,7 @@ class VimRubyCompletion def add_rails_columns( cls ) allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails") rails_loaded = VIM::evaluate('s:rubycomplete_rails_loaded') - return [] if allow_rails != '1' || rails_loaded != '1' + return [] if allow_rails.to_i.zero? || rails_loaded.to_i.zero? begin eval( "#{cls}.establish_connection" ) @@ -534,7 +534,7 @@ class VimRubyCompletion def get_rails_view_methods allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails") rails_loaded = VIM::evaluate('s:rubycomplete_rails_loaded') - return [] if allow_rails != '1' || rails_loaded != '1' + return [] if allow_rails.to_i.zero? || rails_loaded.to_i.zero? buf_path = VIM::evaluate('expand("%:p")') buf_path.gsub!( /\\/, "/" ) @@ -580,7 +580,7 @@ class VimRubyCompletion def get_completions(base) loading_allowed = VIM::evaluate("exists('g:rubycomplete_buffer_loading') && g:rubycomplete_buffer_loading") - if loading_allowed == '1' + if loading_allowed.to_i == 1 load_requires load_rails end diff --git a/runtime/autoload/tar.vim b/runtime/autoload/tar.vim index 35ef7fd25..b1529d60f 100644 --- a/runtime/autoload/tar.vim +++ b/runtime/autoload/tar.vim @@ -1,7 +1,7 @@ " tar.vim: Handles browsing tarfiles " AUTOLOAD PORTION -" Date: Jun 12, 2008 -" Version: 16 +" Date: Jul 12, 2008 +" Version: 19 + changes by Bram " Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM> " License: Vim License (see vim's :help license) " @@ -24,7 +24,7 @@ set cpo&vim if &cp || exists("g:loaded_tar") || v:version < 700 finish endif -let g:loaded_tar= "v16" +let g:loaded_tar= "v19+b" "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" @@ -130,21 +130,21 @@ fun! tar#Browse(tarfile) let tarfile= a:tarfile if has("win32") && executable("cygpath") " assuming cygwin - let tarfile=substitute(system("cygpath -u ".s:Escape(tarfile)),'\n$','','e') + let tarfile=substitute(system("cygpath -u ".s:Escape(tarfile,0)),'\n$','','e') endif let curlast= line("$") if tarfile =~# '\.\(gz\|tgz\)$' -" call Decho("1: exe silent r! gzip -d -c ".s:Escape(tarfile)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") - exe "silent r! gzip -d -c -- ".s:Escape(tarfile)." | ".g:tar_cmd." -".g:tar_browseoptions." - " +" 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." - " elseif tarfile =~# '\.lrp' -" call Decho("2: exe silent r! cat -- ".s:Escape(tarfile)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - ") - exe "silent r! cat -- ".s:Escape(tarfile)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - " +" 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." - " elseif tarfile =~# '\.bz2$' -" call Decho("3: exe silent r! bzip2 -d -c ".s:Escape(tarfile)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") - exe "silent r! bzip2 -d -c -- ".s:Escape(tarfile)." | ".g:tar_cmd." -".g:tar_browseoptions." - " +" 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." - " else -" call Decho("4: exe silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".s:Escape(tarfile)) - exe "silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".s:Escape(tarfile) +" call Decho("4: exe silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".s:Escape(tarfile,0)) + exe "silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".s:Escape(tarfile,1) endif if v:shell_error != 0 redraw! @@ -160,7 +160,7 @@ fun! tar#Browse(tarfile) silent %d let eikeep= &ei set ei=BufReadCmd,FileReadCmd - exe "r ".a:tarfile + exe "r ".fnameescape(a:tarfile) let &ei= eikeep 1d " call Dret("tar#Browse : a:tarfile<".a:tarfile.">") @@ -195,7 +195,7 @@ fun! s:TarBrowseSelect() let curfile= expand("%") if has("win32") && executable("cygpath") " assuming cygwin - let tarfile=substitute(system("cygpath -u ".s:Escape(tarfile)),'\n$','','e') + let tarfile=substitute(system("cygpath -u ".s:Escape(tarfile,0)),'\n$','','e') endif new @@ -220,7 +220,7 @@ 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)),'\n$','','e') + let tarfile=substitute(system("cygpath -u ".s:Escape(tarfile,0)),'\n$','','e') endif " call Decho("tarfile<".tarfile.">") " call Decho("fname<".fname.">") @@ -240,17 +240,17 @@ fun! tar#Read(fname,mode) endif if tarfile =~# '\.\(gz\|tgz\)$' -" call Decho("5: exe silent r! gzip -d -c -- ".s:Escape(tarfile)."| ".g:tar_cmd.' -'.g:tar_readoptions.' - '.s:Escape(fname)) - exe "silent r! gzip -d -c -- ".s:Escape(tarfile)."| ".g:tar_cmd." -".g:tar_readoptions." - ".s:Escape(fname).decmp +" call Decho("5: exe silent r! gzip -d -c -- ".s:Escape(tarfile,1)."| ".g:tar_cmd.' -'.g:tar_readoptions.' - '.s:Escape(fname,1)) + exe "silent r! gzip -d -c -- ".s:Escape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".s:Escape(fname,1).decmp elseif tarfile =~# '\.lrp$' -" call Decho("6: exe silent r! cat ".s:Escape(tarfile)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".s:Escape(fname).decmp) - exe "silent r! cat -- ".s:Escape(tarfile)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".s:Escape(fname).decmp +" call Decho("6: exe silent r! cat ".s:Escape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".s:Escape(fname,1).decmp) + exe "silent r! cat -- ".s:Escape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".s:Escape(fname,1).decmp elseif tarfile =~# '\.bz2$' -" call Decho("7: exe silent r! bzip2 -d -c ".s:Escape(tarfile)."| ".g:tar_cmd." -".g:tar_readoptions." - ".s:Escape(fname).decmp) - exe "silent r! bzip2 -d -c -- ".s:Escape(tarfile)."| ".g:tar_cmd." -".g:tar_readoptions." - ".s:Escape(fname).decmp +" call Decho("7: exe silent r! bzip2 -d -c ".s:Escape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".s:Escape(fname,1).decmp) + exe "silent r! bzip2 -d -c -- ".s:Escape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".s:Escape(fname,1).decmp else -" call Decho("8: exe silent r! ".g:tar_cmd." -".g:tar_readoptions." -- ".s:Escape(tarfile)." ".s:Escape(fname)) - exe "silent r! ".g:tar_cmd." -".g:tar_readoptions." ".s:Escape(tarfile)." -- ".s:Escape(fname).decmp +" call Decho("8: exe silent r! ".g:tar_cmd." -".g:tar_readoptions." -- ".s:Escape(tarfile,1)." ".s:Escape(fname,1)) + exe "silent r! ".g:tar_cmd." -".g:tar_readoptions." ".s:Escape(tarfile,1)." -- ".s:Escape(fname,1).decmp endif if doro @@ -259,7 +259,7 @@ fun! tar#Read(fname,mode) endif let w:tarfile= a:fname - exe "file tarfile::".fname + exe "file tarfile::".fnameescape(fname) " cleanup 0d @@ -329,18 +329,18 @@ fun! tar#Write(fname) " handle compressed archives if tarfile =~# '\.gz' - call system("gzip -d -- ".tarfile) + call system("gzip -d -- ".s:Escape(tarfile,0)) let tarfile = substitute(tarfile,'\.gz','','e') - let compress= "gzip ".s:Escape(tarfile) + let compress= "gzip ".s:Escape(tarfile,0) elseif tarfile =~# '\.tgz' - call system("gzip -d -- ".s:Escape(tarfile)) + call system("gzip -d -- ".s:Escape(tarfile,0)) let tarfile = substitute(tarfile,'\.tgz','.tar','e') - let compress= "gzip -- ".s:Escape(tarfile) + let compress= "gzip -- ".s:Escape(tarfile,0) let tgz = 1 elseif tarfile =~# '\.bz2' - call system("bzip2 -d -- ".s:Escape(tarfile)) + call system("bzip2 -d -- ".s:Escape(tarfile,0)) let tarfile = substitute(tarfile,'\.bz2','','e') - let compress= "bzip2 -- ".s:Escape(tarfile) + let compress= "bzip2 -- ".s:Escape(tarfile,0) endif " call Decho("tarfile<".tarfile.">") " call Decho("compress<".compress.">") @@ -356,7 +356,7 @@ fun! tar#Write(fname) if fname =~ '/' let dirpath = substitute(fname,'/[^/]\+$','','e') if executable("cygpath") - let dirpath = substitute(system("cygpath ".dirpath),'\n','','e') + let dirpath = substitute(system("cygpath ".s:Escape(dirpath, 0)),'\n','','e') endif call mkdir(dirpath,"p") endif @@ -367,12 +367,12 @@ fun! tar#Write(fname) exe "w! ".fnameescape(fname) if executable("cygpath") - let tarfile = substitute(system("cygpath ".s:Escape(tarfile)),'\n','','e') + let tarfile = substitute(system("cygpath ".s:Escape(tarfile,0)),'\n','','e') endif " delete old file from tarfile -" call Decho("system(tar --delete -f ".s:Escape(tarfile)." -- ".s:Escape(fname).")") - call system("tar --delete -f ".s:Escape(tarfile)." -- ".s:Escape(fname)) +" call Decho("system(tar --delete -f ".s:Escape(tarfile,0)." -- ".s:Escape(fname,0).")") + call system("tar --delete -f ".s:Escape(tarfile,0)." -- ".s:Escape(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 @@ -380,8 +380,8 @@ fun! tar#Write(fname) else " update tarfile with new file -" call Decho("tar -".g:tar_writeoptions." ".s:Escape(tarfile)." -- ".s:Escape(fname)) - call system("tar -".g:tar_writeoptions." ".s:Escape(tarfile)." -- ".s:Escape(fname)) +" call Decho("tar -".g:tar_writeoptions." ".s:Escape(tarfile,0)." -- ".s:Escape(fname,0)) + call system("tar -".g:tar_writeoptions." ".s:Escape(tarfile,0)." -- ".s:Escape(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 @@ -404,7 +404,7 @@ fun! tar#Write(fname) let binkeep= &binary let eikeep = &ei set binary ei=all - exe "e! ".tarfile + exe "e! ".fnameescape(tarfile) call netrw#NetWrite(tblfile) let &ei = eikeep let &binary = binkeep @@ -416,7 +416,7 @@ fun! tar#Write(fname) " cleanup and restore current directory cd .. call s:Rmdir("_ZIPVIM_") - exe "cd ".escape(curdir,' \') + exe "cd ".fnameescape(curdir) setlocal nomod let &report= repkeep @@ -428,12 +428,12 @@ endfun fun! s:Rmdir(fname) " call Dfunc("Rmdir(fname<".a:fname.">)") if has("unix") - call system("/bin/rm -rf -- ".s:Escape(a:fname)) + call system("/bin/rm -rf -- ".s:Escape(a:fname,0)) elseif has("win32") || has("win95") || has("win64") || has("win16") if &shell =~? "sh$" - call system("/bin/rm -rf -- ".s:Escape(a:fname)) + call system("/bin/rm -rf -- ".s:Escape(a:fname,0)) else - call system("del /S ".s:Escape(a:fname)) + call system("del /S ".s:Escape(a:fname,0)) endif endif " call Dret("Rmdir") @@ -441,10 +441,14 @@ endfun " --------------------------------------------------------------------- " s:Escape: {{{2 -fun s:Escape(name) +fun s:Escape(name,isfilt) " shellescape() was added by patch 7.0.111 if exists("*shellescape") - let qnameq= shellescape(a:name) + if a:isfilt + let qnameq= shellescape(a:name,1) + else + let qnameq= shellescape(a:name) + endif else let qnameq= g:tar_shq . a:name . g:tar_shq endif diff --git a/runtime/autoload/zip.vim b/runtime/autoload/zip.vim index 5842741b7..b35a411d7 100644 --- a/runtime/autoload/zip.vim +++ b/runtime/autoload/zip.vim @@ -1,7 +1,7 @@ " zip.vim: Handles browsing zipfiles " AUTOLOAD PORTION -" Date: Jun 12, 2008 -" Version: 18 +" Date: Jul 12, 2008 +" Version: 21 (modified by Bram) " Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM> " License: Vim License (see vim's :help license) " Copyright: Copyright (C) 2005-2008 Charles E. Campbell, Jr. {{{1 @@ -22,7 +22,7 @@ if &cp || exists("g:loaded_zip") || v:version < 700 finish endif -let g:loaded_zip = "v18" +let g:loaded_zip = "v21+b" let s:zipfile_escape = ' ?&;\' let s:ERROR = 2 let s:WARNING = 1 @@ -91,23 +91,24 @@ fun! zip#Browse(zipfile) set ft=tar " give header - exe "$put ='".'\"'." zip.vim version ".g:loaded_zip."'" - exe "$put ='".'\"'." Browsing zipfile ".a:zipfile."'" - exe "$put ='".'\"'." Select a file with cursor and press ENTER"."'" + let lastline= line("$") + call setline(lastline+1,'" zip.vim version '.g:loaded_zip) + call setline(lastline+2,'" Browsing zipfile '.a:zipfile) + call setline(lastline+3,'" Select a file with cursor and press ENTER') $put ='' 0d $ -" call Decho("exe silent r! ".g:zip_unzipcmd." -l ".s:QuoteFileDir(a:zipfile)) - exe "silent r! ".g:zip_unzipcmd." -l ".s:QuoteFileDir(a:zipfile) +" call Decho("exe silent r! ".g:zip_unzipcmd." -l ".s:Escape(a:zipfile,1)) + exe "silent r! ".g:zip_unzipcmd." -l ".s:Escape(a:zipfile,1) if v:shell_error != 0 redraw! - echohl WarningMsg | echo "***warning*** (zip#Browse) ".a:zipfile." is not a zip file" | echohl None + echohl WarningMsg | echo "***warning*** (zip#Browse) ".fnameescape(a:zipfile)." is not a zip file" | echohl None " call inputsave()|call input("Press <cr> to continue")|call inputrestore() silent %d let eikeep= &ei set ei=BufReadCmd,FileReadCmd - exe "r ".a:zipfile + exe "r ".fnameescape(a:zipfile) let &ei= eikeep 1d " call Dret("zip#Browse") @@ -166,8 +167,8 @@ fun! s:ZipBrowseSelect() wincmd _ endif let s:zipfile_{winnr()}= curfile -" call Decho("exe e zipfile:".escape(zipfile,s:zipfile_escape).'::'.escape(fname,s:zipfile_escape)) - exe "e zipfile:".escape(zipfile,s:zipfile_escape).'::'.escape(fname,s:zipfile_escape) +" call Decho("exe e ".fnameescape("zipfile:".zipfile.'::'.fname)) + exe "e ".fnameescape("zipfile:".zipfile.'::'.fname) filetype detect let &report= repkeep @@ -192,8 +193,8 @@ fun! zip#Read(fname,mode) " call Decho("zipfile<".zipfile.">") " call Decho("fname <".fname.">") -" call Decho("exe r! ".g:zip_unzipcmd." -p ".s:QuoteFileDir(zipfile)." ".s:QuoteFileDir(fname)) - exe "silent r! ".g:zip_unzipcmd." -p ".s:QuoteFileDir(zipfile)." ".s:QuoteFileDir(fname) +" call Decho("exe r! ".g:zip_unzipcmd." -p ".s:Escape(zipfile,1)." ".s:Escape(fname,1)) + exe "silent r! ".g:zip_unzipcmd." -p ".s:Escape(zipfile,1)." ".s:Escape(fname,1) " cleanup 0d @@ -266,7 +267,7 @@ fun! zip#Write(fname) if fname =~ '/' let dirpath = substitute(fname,'/[^/]\+$','','e') if executable("cygpath") - let dirpath = substitute(system("cygpath ".dirpath),'\n','','e') + let dirpath = substitute(system("cygpath ".s:Escape(dirpath,0)),'\n','','e') endif " call Decho("mkdir(dirpath<".dirpath.">,p)") call mkdir(dirpath,"p") @@ -276,17 +277,17 @@ fun! zip#Write(fname) endif " call Decho("zipfile<".zipfile."> fname<".fname.">") - exe "w! ".escape(fname,s:zipfile_escape) + exe "w! ".fnameescape(fname) if executable("cygpath") - let zipfile = substitute(system("cygpath ".zipfile),'\n','','e') + let zipfile = substitute(system("cygpath ".s:Escape(zipfile,0)),'\n','','e') endif if (has("win32") || has("win95") || has("win64") || has("win16")) && &shell !~? 'sh$' let fname = substitute(fname, '[', '[[]', 'g') endif -" call Decho(g:zip_zipcmd." -u ".s:QuoteFileDir(zipfile)." ".s:QuoteFileDir(fname)) - call system(g:zip_zipcmd." -u ".s:QuoteFileDir(zipfile)." ".s:QuoteFileDir(fname)) +" call Decho(g:zip_zipcmd." -u ".s:Escape(zipfile,0)." ".s:Escape(fname,0)) + call system(g:zip_zipcmd." -u ".s:Escape(zipfile,0)." ".s:Escape(fname,0)) if v:shell_error != 0 redraw! echohl Error | echo "***error*** (zip#Write) sorry, unable to update ".zipfile." with ".fname | echohl None @@ -300,7 +301,7 @@ fun! zip#Write(fname) let binkeep= &binary let eikeep = &ei set binary ei=all - exe "e! ".zipfile + exe "e! ".fnameescape(zipfile) call netrw#NetWrite(netzipfile) let &ei = eikeep let &binary = binkeep @@ -320,11 +321,15 @@ fun! zip#Write(fname) endfun " --------------------------------------------------------------------- -" QuoteFileDir: {{{2 -fun! s:QuoteFileDir(fname) -" call Dfunc("QuoteFileDir(fname<".a:fname.">)") - if has("*shellescape") - let qnameq= shellescape(a:fname) +" s:Escape: {{{2 +fun! s:Escape(fname,isfilt) +" call Dfunc("QuoteFileDir(fname<".a:fname."> isfilt=".a:isfilt.")") + if exists("*shellescape") + if a:isfilt + let qnameq= shellescape(a:fname,1) + else + let qnameq= shellescape(a:fname) + endif else let qnameq= g:zip_shq.escape(a:fname,g:zip_shq).g:zip_shq endif @@ -337,14 +342,9 @@ endfun fun! s:ChgDir(newdir,errlvl,errmsg) " call Dfunc("ChgDir(newdir<".a:newdir."> errlvl=".a:errlvl." errmsg<".a:errmsg.">)") - if (has("win32") || has("win95") || has("win64") || has("win16")) && &shell !~? 'sh$' - let newdir= escape(a:newdir,' ') - else - let newdir= escape(a:newdir,'\ ') - endif try - exe "cd ".newdir + exe "cd ".fnameescape(newdir) catch /^Vim\%((\a\+)\)\=:E344/ redraw! if a:errlvl == s:NOTE @@ -364,13 +364,13 @@ fun! s:ChgDir(newdir,errlvl,errmsg) endfun " --------------------------------------------------------------------- -" Rmdir: {{{2 +" s:Rmdir: {{{2 fun! s:Rmdir(fname) " call Dfunc("Rmdir(fname<".a:fname.">)") if (has("win32") || has("win95") || has("win64") || has("win16")) && &shell !~? 'sh$' - call system("rmdir /S/Q ".s:QuoteFileDir(a:fname)) + call system("rmdir /S/Q ".s:Escape(a:fname,0)) else - call system("/bin/rm -rf ".s:QuoteFileDir(a:fname)) + call system("/bin/rm -rf ".s:Escape(a:fname,0)) endif " call Dret("Rmdir") endfun diff --git a/runtime/compiler/decada.vim b/runtime/compiler/decada.vim index 1b09d390f..4c777fe7e 100644 --- a/runtime/compiler/decada.vim +++ b/runtime/compiler/decada.vim @@ -3,14 +3,15 @@ " Language: Ada (Dec Ada) " $Id$ " Copyright: Copyright (C) 2006 Martin Krischik -" Maintainer: Martin Krischik +" Maintainer: Martin Krischik <krischik@users.sourceforge.net> " $Author$ " $Date$ -" Version: 4.2 +" Version: 4.6 " $Revision$ -" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/compiler/decada.vim $ +" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/compiler/decada.vim $ " History: 21.07.2006 MK New Dec Ada " 15.10.2006 MK Bram's suggestion for runtime integration +" 08.09.2006 MK Correct double load protection. " Help Page: compiler-decada "------------------------------------------------------------------------------ @@ -24,6 +25,13 @@ let current_compiler = "decada" if !exists("g:decada") let g:decada = decada#New () + + call ada#Map_Menu ( + \'Dec Ada.Build', + \'<F7>', + \'call decada.Make ()') + + call g:decada.Set_Session () endif if exists(":CompilerSet") != 2 @@ -33,16 +41,9 @@ if exists(":CompilerSet") != 2 command -nargs=* CompilerSet setlocal <args> endif -call g:decada.Set_Session () - execute "CompilerSet makeprg=" . escape (g:decada.Make_Command, ' ') execute "CompilerSet errorformat=" . escape (g:decada.Error_Format, ' ') -call ada#Map_Menu ( - \'Dec Ada.Build', - \'<F7>', - \'call decada.Make ()') - finish " 1}}} "------------------------------------------------------------------------------ diff --git a/runtime/compiler/eruby.vim b/runtime/compiler/eruby.vim index f30fcc3b8..44194f5c9 100644 --- a/runtime/compiler/eruby.vim +++ b/runtime/compiler/eruby.vim @@ -38,4 +38,4 @@ CompilerSet errorformat= let &cpo = s:cpo_save unlet s:cpo_save -" vim: nowrap sw=2 sts=2: +" vim: nowrap sw=2 sts=2 ts=8: diff --git a/runtime/compiler/gnat.vim b/runtime/compiler/gnat.vim index 58e9ce831..ad1697a06 100644 --- a/runtime/compiler/gnat.vim +++ b/runtime/compiler/gnat.vim @@ -3,15 +3,17 @@ " Language: Ada (GNAT) " $Id$ " Copyright: Copyright (C) 2006 Martin Krischik -" Maintainer: Martin Krischik +" Maintainer: Martin Krischi <krischik@users.sourceforge.net>k +" Ned Okie <nokie@radford.edu> " $Author$ " $Date$ -" Version: 4.2 +" Version: 4.6 " $Revision$ -" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/compiler/gnat.vim $ +" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/compiler/gnat.vim $ " History: 24.05.2006 MK Unified Headers " 16.07.2006 MK Ada-Mode as vim-ball " 15.10.2006 MK Bram's suggestion for runtime integration +" 19.09.2007 NO use project file only when there is a project " Help Page: compiler-gnat "------------------------------------------------------------------------------ @@ -46,6 +48,8 @@ if !exists("g:gnat") \ 'GNAT.Set Projectfile\.\.\.', \ ':SetProject', \ 'call gnat.Set_Project_File ()') + + call g:gnat.Set_Session () endif if exists(":CompilerSet") != 2 @@ -55,8 +59,6 @@ if exists(":CompilerSet") != 2 command -nargs=* CompilerSet setlocal <args> endif -call g:gnat.Set_Session () - execute "CompilerSet makeprg=" . escape (g:gnat.Get_Command('Make'), ' ') execute "CompilerSet errorformat=" . escape (g:gnat.Error_Format, ' ') diff --git a/runtime/compiler/rspec.vim b/runtime/compiler/rspec.vim new file mode 100644 index 000000000..19c410f81 --- /dev/null +++ b/runtime/compiler/rspec.vim @@ -0,0 +1,41 @@ +" Vim compiler file +" Language: RSpec +" Maintainer: Tim Pope <vimNOSPAM@tpope.info> +" Info: $Id$ +" URL: http://vim-ruby.rubyforge.org +" Anon CVS: See above site +" Release Coordinator: Doug Kearns <dougkearns@gmail.com> + +if exists("current_compiler") + finish +endif +let current_compiler = "rspec" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal <args> +endif + +let s:cpo_save = &cpo +set cpo-=C + +CompilerSet makeprg=spec + +CompilerSet errorformat= + \%+W'%.%#'\ FAILED, + \%+I'%.%#'\ FIXED, + \%-Cexpected:%.%#, + \%-C\ \ \ \ \ got:%.%#, + \%E%.%#:in\ `load':\ %f:%l:%m, + \%C%f:%l:, + \%W%f:%l:\ warning:\ %m, + \%E%f:%l:in\ %*[^:]:\ %m, + \%E%f:%l:\ %m, + \%-Z%\tfrom\ %f:%l, + \%-Z%p^%.%#, + \%-C%.%#, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8: diff --git a/runtime/doc/arabic.txt b/runtime/doc/arabic.txt index 9445f2e09..dc8e9b173 100644 --- a/runtime/doc/arabic.txt +++ b/runtime/doc/arabic.txt @@ -1,4 +1,4 @@ -*arabic.txt* For Vim version 7.2a. Last change: 2005 Mar 29 +*arabic.txt* For Vim version 7.2b. Last change: 2005 Mar 29 VIM REFERENCE MANUAL by Nadim Shaikli diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 80032e038..e892f4c49 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim version 7.2a. Last change: 2008 Jun 24 +*autocmd.txt* For Vim version 7.2b. Last change: 2008 Jun 27 VIM REFERENCE MANUAL by Bram Moolenaar @@ -406,9 +406,10 @@ BufWinEnter After a buffer is displayed in a window. This Does not happen for |:split| without arguments, since you keep editing the same buffer, or ":split" with a file that's already - open in a window. But it does happen for - a ":split" with the name of the current - buffer, since it reloads that buffer. + open in a window, because it re-uses an + existing buffer. But it does happen for a + ":split" with the name of the current buffer, + since it reloads that buffer. *BufWinLeave* BufWinLeave Before a buffer is removed from a window. Not when it's still visible in another window. diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index 24cf3fe9c..65af5fc1c 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1,4 +1,4 @@ -*change.txt* For Vim version 7.2a. Last change: 2008 Jun 22 +*change.txt* For Vim version 7.2b. Last change: 2008 Jul 09 VIM REFERENCE MANUAL by Bram Moolenaar @@ -772,9 +772,9 @@ expression. This does not work recursively: a substitute() function inside the expression cannot use "\=" for the substitute string. The special meaning for characters as mentioned at |sub-replace-special| does -not apply except "<CR>", "\<CR>" and "\\". Thus in the result of the -expression you need to use two backslashes get one, put a backslash before a -<CR> you want to insert and use a <CR> without a backslash where you want to +not apply except for "<CR>", "\<CR>" and "\\". Thus in the result of the +expression you need to use two backslashes to get one, put a backslash before a +<CR> you want to insert, and use a <CR> without a backslash where you want to break the line. For convenience a <NL> character is also used as a line break. Prepend a @@ -797,7 +797,7 @@ Examples: > This replaces an end-of-line with a new line containing the value of $HOME. > s/E/\="\<Char-0x20ac>"/g -This replaces 'E' characters with an euro sign. Read more in |<Char->|. +This replaces each 'E' character with a euro sign. Read more in |<Char->|. 4.3 Search and replace *search-replace* diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index bc6bbd74d..8f577c87a 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -1,4 +1,4 @@ -*cmdline.txt* For Vim version 7.2a. Last change: 2008 Jun 21 +*cmdline.txt* For Vim version 7.2b. Last change: 2008 Jul 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -369,7 +369,9 @@ word before the cursor. This is available for: - Variable and function names: Only after a ":if", ":call" or similar command. When Vim was compiled with the |+cmdline_compl| feature disabled, only file -names, directories and help items can be completed. +names, directories and help items can be completed. The number of help item +matches is limited (currently to 300) to avoid a long delay when there are +very many matches. These are the commands that can be used: diff --git a/runtime/doc/debug.txt b/runtime/doc/debug.txt index 0e83ec715..1eb20afbf 100644 --- a/runtime/doc/debug.txt +++ b/runtime/doc/debug.txt @@ -1,4 +1,4 @@ -*debug.txt* For Vim version 7.2a. Last change: 2006 May 01 +*debug.txt* For Vim version 7.2b. Last change: 2006 May 01 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/debugger.txt b/runtime/doc/debugger.txt index 0a152a61d..ea9858a7d 100644 --- a/runtime/doc/debugger.txt +++ b/runtime/doc/debugger.txt @@ -1,4 +1,4 @@ -*debugger.txt* For Vim version 7.2a. Last change: 2005 Mar 29 +*debugger.txt* For Vim version 7.2b. Last change: 2005 Mar 29 VIM REFERENCE MANUAL by Gordon Prieur diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index 67adcb8f9..85bf1c577 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -1,4 +1,4 @@ -*develop.txt* For Vim version 7.2a. Last change: 2007 May 11 +*develop.txt* For Vim version 7.2b. Last change: 2007 May 11 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt index 1adef600c..379f6a6be 100644 --- a/runtime/doc/diff.txt +++ b/runtime/doc/diff.txt @@ -1,4 +1,4 @@ -*diff.txt* For Vim version 7.2a. Last change: 2006 Oct 02 +*diff.txt* For Vim version 7.2b. Last change: 2006 Oct 02 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/digraph.txt b/runtime/doc/digraph.txt index f5b5ce742..b15651d79 100644 --- a/runtime/doc/digraph.txt +++ b/runtime/doc/digraph.txt @@ -1,4 +1,4 @@ -*digraph.txt* For Vim version 7.2a. Last change: 2007 Sep 10 +*digraph.txt* For Vim version 7.2b. Last change: 2007 Sep 10 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 2ef3f96bc..65a11344c 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -1,4 +1,4 @@ -*editing.txt* For Vim version 7.2a. Last change: 2008 Apr 29 +*editing.txt* For Vim version 7.2b. Last change: 2008 Jul 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -302,9 +302,9 @@ CTRL-^ Edit the alternate file (equivalent to ":e #"). Uses the 'isfname' option to find out which characters are supposed to be in a file name. Trailing punctuation characters ".,:;!" are ignored. - Uses the 'path' option as a list of directory names - to look for the file. Also looks for the file - relative to the current file. + Uses the 'path' option as a list of directory names to + look for the file. See the 'path' option for details + about relative directories and wildcards. Uses the 'suffixesadd' option to check for file names with a suffix added. If the file can't be found, 'includeexpr' is used to @@ -367,13 +367,13 @@ current file name. Besides the things mentioned here, more special items for where a filename is expected are mentioned at |cmdline-special|. -Note for systems other than Unix and MS-DOS: When using a command that -accepts a single file name (like ":edit file") spaces in the file name are -allowed, but trailing spaces are ignored. This is useful on systems that -allow file names with embedded spaces (like MS-Windows and the Amiga). -Example: The command ":e Long File Name " will edit the file "Long File -Name". When using a command that accepts more than one file name (like ":next -file1 file2") embedded spaces must be escaped with a backslash. +Note for systems other than Unix: When using a command that accepts a single +file name (like ":edit file") spaces in the file name are allowed, but +trailing spaces are ignored. This is useful on systems that regularly embed +spaces in file names (like MS-Windows and the Amiga). Example: The command +":e Long File Name " will edit the file "Long File Name". When using a +command that accepts more than one file name (like ":next file1 file2") +embedded spaces must be escaped with a backslash. *wildcard* *wildcards* Wildcards in {file} are expanded. Which wildcards are supported depends on @@ -391,6 +391,8 @@ is to use "path\[[]abc]". Then the file "path[abc]" literally. *starstar-wildcard* Expanding "**" is possible on Unix, Win32, Mac OS/X and a few other systems. This allows searching a directory tree. This goes up to 100 directories deep. +Note there are some commands where this works slightly different, see +|file-searching|. Example: > :n **/*.txt Finds files: @@ -1476,14 +1478,16 @@ problem goes away the next day. {not available when compiled without the |+path_extra| feature} The file searching is currently used for the 'path', 'cdpath' and 'tags' -options, for |finddir()| and |findfile()|. +options, for |finddir()| and |findfile()|. Other commands use |wildcards| +which is slightly different. There are three different types of searching: 1) Downward search: *starstar* Downward search uses the wildcards '*', '**' and possibly others - supported by your operating system. '*' and '**' are handled inside Vim, so - they work on all operating systems. + supported by your operating system. '*' and '**' are handled inside Vim, + so they work on all operating systems. Note that "**" only acts as a + special wildcard when it is at the start of a name. The usage of '*' is quite simple: It matches 0 or more characters. In a search pattern this would be ".*". Note that the "." is not used for file @@ -1491,8 +1495,8 @@ There are three different types of searching: '**' is more sophisticated: - It ONLY matches directories. - - It matches up to 30 directories deep, so you can use it to search an - entire directory tree + - It matches up to 30 directories deep by default, so you can use it to + search an entire directory tree - The maximum number of levels matched can be given by appending a number to '**'. Thus '/usr/**2' can match: > @@ -1505,15 +1509,16 @@ There are three different types of searching: .... < It does NOT match '/usr/include/g++/std' as this would be three levels. - The allowed number range is 0 ('**0' is removed) to 255. + The allowed number range is 0 ('**0' is removed) to 100 If the given number is smaller than 0 it defaults to 30, if it's - bigger than 255 then 255 is used. + bigger than 100 then 100 is used. The system also has a limit on the + path length, usually 256 or 1024 bytes. - '**' can only be at the end of the path or be followed by a path separator or by a number and a path separator. You can combine '*' and '**' in any order: > /usr/**/sys/* - /usr/*/sys/** + /usr/*tory/sys/** /usr/**2/sys/* 2) Upward search: diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 6fd0ae171..20fa361da 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.2a. Last change: 2008 Jun 24 +*eval.txt* For Vim version 7.2b. Last change: 2008 Jul 09 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2524,9 +2524,15 @@ exists({expr}) The result is a Number, which is non-zero if {expr} is |internal-variables|). Also works for |curly-braces-names|, |Dictionary| entries, |List| items, etc. Beware - that this may cause functions to be - invoked cause an error message for an - invalid expression. + that evaluating an index may cause an + error message for an invalid + expression. E.g.: > + :let l = [1, 2, 3] + :echo exists("l[5]") +< 0 > + :echo exists("l[xx]") +< E121: Undefined variable: xx + 0 :cmdname Ex command: built-in command, user command or command modifier |:command|. Returns: @@ -2945,6 +2951,8 @@ getbufvar({expr}, {varname}) *getbufvar()* The result is the value of option or local buffer variable {varname} in buffer {expr}. Note that the name without "b:" must be used. + When {varname} is empty returns a dictionary with all the + buffer-local variables. This also works for a global or buffer-local option, but it doesn't work for a global variable, window-local variable or window-local option. @@ -3296,7 +3304,9 @@ globpath({path}, {expr}) *globpath()* For example, to find all "README.txt" files in the directories in 'runtimepath' and below: > :echo globpath(&rtp, "**/README.txt") -< +< Upwards search and limiting the depth of "**" is not + supported, thus using 'path' will not always work properly. + *has()* has({feature}) The result is a Number, which is 1 if the feature {feature} is supported, zero otherwise. The {feature} argument is a @@ -3361,13 +3371,13 @@ histdel({history} [, {item}]) *histdel()* Clear {history}, i.e. delete all its entries. See |hist-names| for the possible values of {history}. - If the parameter {item} is given as String, this is seen - as regular expression. All entries matching that expression - will be removed from the history (if there are any). + If the parameter {item} evaluates to a String, it is used as a + regular expression. All entries matching that expression will + be removed from the history (if there are any). Upper/lowercase must match, unless "\c" is used |/\c|. - If {item} is a Number, it will be interpreted as index, see - |:history-indexing|. The respective entry will be removed - if it exists. + If {item} evaluates to a Number, it will be interpreted as + an index, see |:history-indexing|. The respective entry will + be removed if it exists. The result is a Number: 1 for a successful operation, otherwise 0 is returned. @@ -4278,9 +4288,11 @@ printf({fmt}, {expr1} ...) *printf()* % A '%' is written. No argument is converted. The complete conversion specification is "%%". - Each argument can be Number or String and is converted - automatically to fit the conversion specifier. Any other - argument type results in an error message. + When a Number argument is expected a String argument is also + accepted and automatically converted. + When a Float or String argument is expected a Number argument + is also accepted and automatically converted. + Any other argument type results in an error message. *E766* *E767* The number of {exprN} arguments must exactly match the number @@ -4506,7 +4518,7 @@ reverse({list}) Reverse the order of items in {list} in-place. Returns :let revlist = reverse(copy(mylist)) round({expr}) *round()* - Round off {expr} to a the nearest integral value and return it + Round off {expr} to the nearest integral value and return it as a |Float|. If {expr} lies halfway between two integral values, then use the larger one (away from zero). {expr} must evaluate to a |Float| or a |Number|. @@ -5098,6 +5110,7 @@ sqrt({expr}) *sqrt()* < 10.0 > :echo sqrt(-4.01) < nan + "nan" may be different, it depends on system libraries. {only available when compiled with the |+float| feature} @@ -5484,7 +5497,7 @@ tr({src}, {fromstr}, {tostr}) *tr()* < returns "{blob}" trunc({expr}) *trunc()* - Return the largest integral value with magnituted less than or + Return the largest integral value with magnitude less than or equal to {expr} as a |Float| (truncate towards zero). {expr} must evaluate to a |Float| or a |Number|. Examples: > @@ -6394,6 +6407,11 @@ This would call the function "my_func_whizz(parameter)". < One item from a |Dictionary| can be removed at a time: > :unlet dict['two'] :unlet dict.two +< This is especially useful to clean up used global + variables and script-local variables (these are not + deleted when the script ends). Function-local + variables are automatically deleted when the function + ends. :lockv[ar][!] [depth] {name} ... *:lockvar* *:lockv* Lock the internal variable {name}. Locking means that diff --git a/runtime/doc/farsi.txt b/runtime/doc/farsi.txt index f489a7a06..5a42e439f 100644 --- a/runtime/doc/farsi.txt +++ b/runtime/doc/farsi.txt @@ -1,4 +1,4 @@ -*farsi.txt* For Vim version 7.2a. Last change: 2005 Mar 29 +*farsi.txt* For Vim version 7.2b. Last change: 2005 Mar 29 VIM REFERENCE MANUAL by Mortaza Ghassab Shiran diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index db3fe4e5e..4bff42d5b 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -1,4 +1,4 @@ -*filetype.txt* For Vim version 7.2a. Last change: 2008 Jun 21 +*filetype.txt* For Vim version 7.2b. Last change: 2008 Jun 27 VIM REFERENCE MANUAL by Bram Moolenaar @@ -55,7 +55,7 @@ filetype prepend "ft-" and optionally append "-syntax", "-indent" or If the file type is not detected automatically, or it finds the wrong type, you can either set the 'filetype' option manually, or add a modeline to your -file. Example, for in an IDL file use the command: > +file. Example, for an IDL file use the command: > :set filetype=idl or add this |modeline| to the file: @@ -284,8 +284,8 @@ match in angle brackets in place of a pattern, like this: > This will match: -- Any file whose name ends in `.html' -- Any file whose type is `&faf' or 'HTML', where the meaning of these types +- Any file whose name ends in ".html" +- Any file whose type is "&faf" or "HTML", where the meaning of these types depends on which version of Vim you are using. Unknown types are considered NOT to match. @@ -294,7 +294,7 @@ must both match): > :au BufRead <&fff>diff* -This will match files of type `&fff' whose names start with `diff'. +This will match files of type "&fff" whose names start with "diff". Note that osfiletype checking is skipped if Vim is compiled without the |+osfiletype| feature. diff --git a/runtime/doc/fold.txt b/runtime/doc/fold.txt index c81409398..8a8d800e6 100644 --- a/runtime/doc/fold.txt +++ b/runtime/doc/fold.txt @@ -1,4 +1,4 @@ -*fold.txt* For Vim version 7.2a. Last change: 2007 May 11 +*fold.txt* For Vim version 7.2b. Last change: 2007 May 11 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/ft_ada.txt b/runtime/doc/ft_ada.txt index bec0f78fb..621d58342 100644 --- a/runtime/doc/ft_ada.txt +++ b/runtime/doc/ft_ada.txt @@ -1,4 +1,4 @@ -*ft_ada.txt* For Vim version 7.2a. Last change: 2008 Jun 21 +*ft_ada.txt* For Vim version 7.2b. Last change: 2008 Jun 21 ADA FILE TYPE PLUG-INS REFERENCE MANUAL~ diff --git a/runtime/doc/ft_sql.txt b/runtime/doc/ft_sql.txt index 7946c4f70..8d236a10e 100644 --- a/runtime/doc/ft_sql.txt +++ b/runtime/doc/ft_sql.txt @@ -1,4 +1,4 @@ -*ft_sql.txt* For Vim version 7.2a. Last change: Wed Apr 26 2006 3:05:33 PM +*ft_sql.txt* For Vim version 7.2b. Last change: Wed Apr 26 2006 3:05:33 PM by David Fishburn diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt index d191bb098..58123b1e9 100644 --- a/runtime/doc/gui.txt +++ b/runtime/doc/gui.txt @@ -1,4 +1,4 @@ -*gui.txt* For Vim version 7.2a. Last change: 2008 Jun 14 +*gui.txt* For Vim version 7.2b. Last change: 2008 Jun 14 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/gui_w16.txt b/runtime/doc/gui_w16.txt index 954e138d9..db1f83110 100644 --- a/runtime/doc/gui_w16.txt +++ b/runtime/doc/gui_w16.txt @@ -1,4 +1,4 @@ -*gui_w16.txt* For Vim version 7.2a. Last change: 2005 Mar 29 +*gui_w16.txt* For Vim version 7.2b. Last change: 2005 Mar 29 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/gui_w32.txt b/runtime/doc/gui_w32.txt index 78d696e0c..85b910f5b 100644 --- a/runtime/doc/gui_w32.txt +++ b/runtime/doc/gui_w32.txt @@ -1,4 +1,4 @@ -*gui_w32.txt* For Vim version 7.2a. Last change: 2007 Aug 30 +*gui_w32.txt* For Vim version 7.2b. Last change: 2007 Aug 30 VIM REFERENCE MANUAL by Bram Moolenaar @@ -129,7 +129,7 @@ the makefile by double clicking it and use the "Edit with Vim" entry to edit the makefile. You can select any files and right-click to see a menu option called "Edit -with gvim". Chosing this menu option will invoke gvim with the file you have +with gvim". Choosing this menu option will invoke gvim with the file you have selected. If you select multiple files, you will find two gvim-related menu options: "Edit with multiple gvims" -- one gvim for each file in the selection diff --git a/runtime/doc/gui_x11.txt b/runtime/doc/gui_x11.txt index 457d2ccfa..ff848564d 100644 --- a/runtime/doc/gui_x11.txt +++ b/runtime/doc/gui_x11.txt @@ -1,4 +1,4 @@ -*gui_x11.txt* For Vim version 7.2a. Last change: 2007 Dec 09 +*gui_x11.txt* For Vim version 7.2b. Last change: 2007 Dec 09 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/hangulin.txt b/runtime/doc/hangulin.txt index f1fa3b3dc..29a828a74 100644 --- a/runtime/doc/hangulin.txt +++ b/runtime/doc/hangulin.txt @@ -1,4 +1,4 @@ -*hangulin.txt* For Vim version 7.2a. Last change: 2006 Apr 02 +*hangulin.txt* For Vim version 7.2b. Last change: 2006 Apr 02 VIM REFERENCE MANUAL by Chi-Deok Hwang and Sung-Hyun Nam diff --git a/runtime/doc/hebrew.txt b/runtime/doc/hebrew.txt index 600f27718..d28c33d63 100644 --- a/runtime/doc/hebrew.txt +++ b/runtime/doc/hebrew.txt @@ -1,4 +1,4 @@ -*hebrew.txt* For Vim version 7.2a. Last change: 2007 Jun 14 +*hebrew.txt* For Vim version 7.2b. Last change: 2007 Jun 14 VIM REFERENCE MANUAL by Ron Aaron (and Avner Lottem) diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt index 5cad2bf20..e81dd3a4e 100644 --- a/runtime/doc/help.txt +++ b/runtime/doc/help.txt @@ -1,4 +1,4 @@ -*help.txt* For Vim version 7.2a. Last change: 2008 Jun 21 +*help.txt* For Vim version 7.2b. Last change: 2008 Jun 21 VIM - main help file k diff --git a/runtime/doc/howto.txt b/runtime/doc/howto.txt index 3ad8f4fdd..fbad7beb9 100644 --- a/runtime/doc/howto.txt +++ b/runtime/doc/howto.txt @@ -1,4 +1,4 @@ -*howto.txt* For Vim version 7.2a. Last change: 2006 Apr 02 +*howto.txt* For Vim version 7.2b. Last change: 2006 Apr 02 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/if_cscop.txt b/runtime/doc/if_cscop.txt index 744806214..97bb4b12a 100644 --- a/runtime/doc/if_cscop.txt +++ b/runtime/doc/if_cscop.txt @@ -1,4 +1,4 @@ -*if_cscop.txt* For Vim version 7.2a. Last change: 2005 Mar 29 +*if_cscop.txt* For Vim version 7.2b. Last change: 2005 Mar 29 VIM REFERENCE MANUAL by Andy Kahn diff --git a/runtime/doc/if_mzsch.txt b/runtime/doc/if_mzsch.txt index dd538accc..559c43966 100644 --- a/runtime/doc/if_mzsch.txt +++ b/runtime/doc/if_mzsch.txt @@ -1,4 +1,4 @@ -*if_mzsch.txt* For Vim version 7.2a. Last change: 2007 May 03 +*if_mzsch.txt* For Vim version 7.2b. Last change: 2008 Jun 28 VIM REFERENCE MANUAL by Sergey Khorev @@ -55,7 +55,7 @@ In the case of :mzscheme, the code to execute is in the command-line. In the case of :mzfile, the code to execute is the contents of the given file. Each buffer has its own MzScheme namespace. Global namespace is bound to -the `global-namespace' value from the 'vimext' module. +the "global-namespace" value from the 'vimext' module. MzScheme interface defines exception exn:vim, derived from exn. It is raised for various Vim errors. @@ -218,7 +218,7 @@ Buffers *mzscheme-buffer* {linenr}. If {linenr} is 0, lines will be inserted at start. (curr-buff) Get the current buffer. Use procedures - from `vimcmd' module to change it. + from "vimcmd" module to change it. (buff-count) Get count of total buffers in the editor. (get-next-buff [buffer]) Get next buffer. (get-prev-buff [buffer]) Get previous buffer. Return #f when there diff --git a/runtime/doc/if_ole.txt b/runtime/doc/if_ole.txt index 08b4c492d..d1a306342 100644 --- a/runtime/doc/if_ole.txt +++ b/runtime/doc/if_ole.txt @@ -1,4 +1,4 @@ -*if_ole.txt* For Vim version 7.2a. Last change: 2007 May 10 +*if_ole.txt* For Vim version 7.2b. Last change: 2007 May 10 VIM REFERENCE MANUAL by Paul Moore diff --git a/runtime/doc/if_perl.txt b/runtime/doc/if_perl.txt index 675ed37f2..97e99b988 100644 --- a/runtime/doc/if_perl.txt +++ b/runtime/doc/if_perl.txt @@ -1,4 +1,4 @@ -*if_perl.txt* For Vim version 7.2a. Last change: 2006 Mar 06 +*if_perl.txt* For Vim version 7.2b. Last change: 2006 Mar 06 VIM REFERENCE MANUAL by Sven Verdoolaege diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt index f8b0f8683..efdc37ef0 100644 --- a/runtime/doc/if_pyth.txt +++ b/runtime/doc/if_pyth.txt @@ -1,4 +1,4 @@ -*if_pyth.txt* For Vim version 7.2a. Last change: 2006 Apr 30 +*if_pyth.txt* For Vim version 7.2b. Last change: 2006 Apr 30 VIM REFERENCE MANUAL by Paul Moore diff --git a/runtime/doc/if_ruby.txt b/runtime/doc/if_ruby.txt index c381a6342..6de1f10da 100644 --- a/runtime/doc/if_ruby.txt +++ b/runtime/doc/if_ruby.txt @@ -1,4 +1,4 @@ -*if_ruby.txt* For Vim version 7.2a. Last change: 2006 Apr 30 +*if_ruby.txt* For Vim version 7.2b. Last change: 2006 Apr 30 VIM REFERENCE MANUAL by Shugo Maeda diff --git a/runtime/doc/if_sniff.txt b/runtime/doc/if_sniff.txt index 956895d9b..3129c140d 100644 --- a/runtime/doc/if_sniff.txt +++ b/runtime/doc/if_sniff.txt @@ -1,4 +1,4 @@ -*if_sniff.txt* For Vim version 7.2a. Last change: 2005 Mar 29 +*if_sniff.txt* For Vim version 7.2b. Last change: 2005 Mar 29 VIM REFERENCE MANUAL diff --git a/runtime/doc/if_tcl.txt b/runtime/doc/if_tcl.txt index 344592b3b..a9f5af78a 100644 --- a/runtime/doc/if_tcl.txt +++ b/runtime/doc/if_tcl.txt @@ -1,4 +1,4 @@ -*if_tcl.txt* For Vim version 7.2a. Last change: 2006 Mar 06 +*if_tcl.txt* For Vim version 7.2b. Last change: 2008 Jun 26 VIM REFERENCE MANUAL by Ingo Wilken @@ -407,7 +407,7 @@ Options: < See |tcl-window-cmds| for the available options. $buf command [-quiet] {cmd} *tcl-buffer-command* - $buf expr {exr} *tcl-buffer-expr* + $buf expr {expr} *tcl-buffer-expr* $buf option {opt} [val] *tcl-buffer-option* These are similar to "::vim::command" etc., except that everything is done in the context of the buffer represented by $buf, instead of the diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt index 8e5b7a397..542e03d7b 100644 --- a/runtime/doc/indent.txt +++ b/runtime/doc/indent.txt @@ -1,4 +1,4 @@ -*indent.txt* For Vim version 7.2a. Last change: 2008 Jun 21 +*indent.txt* For Vim version 7.2b. Last change: 2008 Jun 30 VIM REFERENCE MANUAL by Bram Moolenaar @@ -506,6 +506,81 @@ to get do loops indented in .f90 files and left alone in Fortran files with other extensions such as .for. +PHP *ft-php-indent* *php-indent* *php-indenting* + +NOTE: PHP files will be indented correctly only if PHP |syntax| is active. + +If you are editing a file in Unix 'fileformat' and '\r' characters are present +before new lines, indentation won't proceed correctly ; you have to remove +those useless characters first with a command like: > + + :%s /\r$//g + +Or, you can simply |:let| the variable PHP_removeCRwhenUnix to 1 and the +script will silently remove them when Vim loads a PHP file (at each|BufRead|). + +OPTIONS: ~ + +PHP indenting can be altered in several ways by modifying the values of some +variables: + + *php-comment* +To not enable auto-formating of comments by default (if you want to use your +own 'formatoptions'): > + :let g:PHP_autoformatcomment = 0 + +Else, 't' will be removed from the 'formatoptions' string and "qrowcb" will be +added, see|fo-table|for more information. +------------- + +To add an extra indent to every PHP lines with N being the number of +'shiftwidth' to add: > + :let g:PHP_default_indenting = N + +For example, with N = 1, this will give: +> + <?php + if (!isset($History_lst_sel)) + if (!isset($History_lst_sel)) + if (!isset($History_lst_sel)) { + $History_lst_sel=0; + } else + $foo="bar"; + + $command_hist = TRUE; + ?> +(Notice the extra indent between the PHP container markers and the code) +------------- + +To automatically remove '\r' characters when the 'fileformat' is set to Unix: > + :let g:PHP_removeCRwhenUnix = 1 +------------- + +To indent braces at the same level than the code they contain: > + :let g:PHP_BracesAtCodeLevel = 1 + +This will give the following result: > + if ($foo) + { + foo(); + } +Instead of: > + if ($foo) + { + foo(); + } + +NOTE: Indenting will be a bit slower if this option is used because some + optimizations won't be available. +------------- + +To indent 'case:' and 'default:' statements in switch() blocks: > + :let g:PHP_vintage_case_default_indent = 1 + +(By default they are indented at the same level than the 'switch()' to avoid +unnecessary indentation) + + PYTHON *ft-python-indent* The amount of indent can be set for the following situations. The examples diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index f494328df..35f504478 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1,4 +1,4 @@ -*index.txt* For Vim version 7.2a. Last change: 2008 May 04 +*index.txt* For Vim version 7.2b. Last change: 2008 May 04 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index db0ba0e65..6752ba60e 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1,4 +1,4 @@ -*insert.txt* For Vim version 7.2a. Last change: 2008 Jun 21 +*insert.txt* For Vim version 7.2b. Last change: 2008 Jun 21 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index b830c57a0..ac750eee7 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -1,4 +1,4 @@ -*intro.txt* For Vim version 7.2a. Last change: 2008 Jun 24 +*intro.txt* For Vim version 7.2b. Last change: 2008 Jun 24 VIM REFERENCE MANUAL by Bram Moolenaar @@ -208,7 +208,7 @@ Vim would never have become what it is now, without the help of these people! Bill Foster Athena GUI port Google Lets me work on Vim one day a week Loic Grenie xvim (ideas for multi windows version) - Sven Guckes Vim promotor and previous WWW page maintainer + Sven Guckes Vim promoter and previous WWW page maintainer Darren Hiebert Exuberant ctags Jason Hildebrand GTK+ 2 port Bruce Hunsaker improvements for VMS port diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index 41b96151c..131e1bdf0 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -1,4 +1,4 @@ -*map.txt* For Vim version 7.2a. Last change: 2008 Jun 21 +*map.txt* For Vim version 7.2b. Last change: 2008 Jul 09 VIM REFERENCE MANUAL by Bram Moolenaar @@ -162,8 +162,8 @@ be used in any order. They must appear right after the command, before any other arguments. *:map-local* *:map-<buffer>* *E224* *E225* -If the first argument to one of these commands is "<buffer>" it will apply to -mappings locally to the current buffer only. Example: > +If the first argument to one of these commands is "<buffer>" the mapping will +be effective in the current buffer only. Example: > :map <buffer> ,w /[.,;]<CR> Then you can map ",w" to something else in another buffer: > :map <buffer> ,w /[#&!]<CR> diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt index 4eabcf790..60445d14d 100644 --- a/runtime/doc/mbyte.txt +++ b/runtime/doc/mbyte.txt @@ -1,4 +1,4 @@ -*mbyte.txt* For Vim version 7.2a. Last change: 2008 Jun 21 +*mbyte.txt* For Vim version 7.2b. Last change: 2008 Jun 21 VIM REFERENCE MANUAL by Bram Moolenaar et al. diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt index 9f8bbfb90..4731a71b0 100644 --- a/runtime/doc/message.txt +++ b/runtime/doc/message.txt @@ -1,4 +1,4 @@ -*message.txt* For Vim version 7.2a. Last change: 2007 Aug 19 +*message.txt* For Vim version 7.2b. Last change: 2007 Aug 19 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/mlang.txt b/runtime/doc/mlang.txt index 2e94d85d6..d214c27ae 100644 --- a/runtime/doc/mlang.txt +++ b/runtime/doc/mlang.txt @@ -1,4 +1,4 @@ -*mlang.txt* For Vim version 7.2a. Last change: 2008 Jun 08 +*mlang.txt* For Vim version 7.2b. Last change: 2008 Jun 08 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt index cdeb4f92a..c1b8d38c5 100644 --- a/runtime/doc/motion.txt +++ b/runtime/doc/motion.txt @@ -1,4 +1,4 @@ -*motion.txt* For Vim version 7.2a. Last change: 2008 May 02 +*motion.txt* For Vim version 7.2b. Last change: 2008 May 02 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/netbeans.txt b/runtime/doc/netbeans.txt index 353911166..b8074c780 100644 --- a/runtime/doc/netbeans.txt +++ b/runtime/doc/netbeans.txt @@ -1,4 +1,4 @@ -*netbeans.txt* For Vim version 7.2a. Last change: 2008 Jun 22 +*netbeans.txt* For Vim version 7.2b. Last change: 2008 Jun 28 VIM REFERENCE MANUAL by Gordon Prieur et al. @@ -69,7 +69,7 @@ Initially just a Java IDE, NetBeans has had C, C++, and Fortran support added in recent releases. For more information visit the main NetBeans web site http://www.netbeans.org. -The External Editor is now, unfortunately, declared Obsolte. See +The External Editor is now, unfortunately, declared obsolete. See http://externaleditor.netbeans.org. Sun Microsystems, Inc. also ships NetBeans under the name Sun ONE Studio. @@ -418,7 +418,7 @@ moveAnnoToFront serNum Not implemented. netbeansBuffer isNetbeansBuffer - If "isNetbeansBuffer" is "T" then this buffer is ``owned'' by + If "isNetbeansBuffer" is "T" then this buffer is "owned" by NetBeans. New in version 2.2. diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 568dab683..22c04196a 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.2a. Last change: 2008 Jun 24 +*options.txt* For Vim version 7.2b. Last change: 2008 Jul 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1280,7 +1280,8 @@ A jump table for the options with a short description can be found at |Q_op|. |+file_in_path| feature} This is a list of directories which will be searched when using the |:cd| and |:lcd| commands, provided that the directory being searched - for has a relative path (not starting with "/", "./" or "../"). + for has a relative path, not an absolute part starting with "/", "./" + or "../", the 'cdpath' option is not used then. The 'cdpath' option's value has the same form and semantics as |'path'|. Also see |file-searching|. The default value is taken from $CDPATH, with a "," prepended to look @@ -5011,9 +5012,10 @@ A jump table for the options with a short description can be found at |Q_op|. global or local to buffer |global-local| {not in Vi} This is a list of directories which will be searched when using the - |gf|, [f, ]f, ^Wf, |:find| and other commands, provided that the file - being searched for has a relative path (not starting with '/'). The - directories in the 'path' option may be relative or absolute. + |gf|, [f, ]f, ^Wf, |:find|, |:sfind|, |:tabfind| and other commands, + provided that the file being searched for has a relative path (not + starting with "/", "./" or "../"). The directories in the 'path' + option may be relative or absolute. - Use commas to separate directory names: > :set path=.,/usr/local/include,/usr/include < - Spaces can also be used to separate directory names (for backwards @@ -5032,19 +5034,8 @@ A jump table for the options with a short description can be found at |Q_op|. - Environment variables are expanded |:set_env|. - When using |netrw.vim| URLs can be used. For example, adding "http://www.vim.org" will make ":find index.html" work. - - Search upwards and downwards in a directory tree: - 1) "*" matches a sequence of characters, e.g.: > - :set path=/usr/include/* -< means all subdirectories in /usr/include (but not /usr/include - itself). > - :set path=/usr/*c -< matches /usr/doc and /usr/src. - 2) "**" matches a subtree, up to 100 directories deep. Example: > - :set path=/home/user_x/src/** -< means search in the whole subtree under "/home/usr_x/src". - 3) If the path ends with a ';', this path is the startpoint - for upward search. - See |file-searching| for more info and exact syntax. + - Search upwards and downwards in a directory tree using "*", "**" and + ";". See |file-searching| for info and syntax. {not available when compiled without the |+path_extra| feature} - Careful with '\' characters, type two to get one in the option: > :set path=.,c:\\include diff --git a/runtime/doc/os_390.txt b/runtime/doc/os_390.txt index 9c7c0dcc7..59074a690 100644 --- a/runtime/doc/os_390.txt +++ b/runtime/doc/os_390.txt @@ -1,4 +1,4 @@ -*os_390.txt* For Vim version 7.2a. Last change: 2005 Mar 29 +*os_390.txt* For Vim version 7.2b. Last change: 2005 Mar 29 VIM REFERENCE MANUAL by Ralf Schandl diff --git a/runtime/doc/os_amiga.txt b/runtime/doc/os_amiga.txt index 3f2647f31..1e21121e7 100644 --- a/runtime/doc/os_amiga.txt +++ b/runtime/doc/os_amiga.txt @@ -1,4 +1,4 @@ -*os_amiga.txt* For Vim version 7.2a. Last change: 2005 Mar 29 +*os_amiga.txt* For Vim version 7.2b. Last change: 2005 Mar 29 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/os_beos.txt b/runtime/doc/os_beos.txt index 6ad3a5019..c7bbf372f 100644 --- a/runtime/doc/os_beos.txt +++ b/runtime/doc/os_beos.txt @@ -1,4 +1,4 @@ -*os_beos.txt* For Vim version 7.2a. Last change: 2005 Mar 29 +*os_beos.txt* For Vim version 7.2b. Last change: 2005 Mar 29 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/os_dos.txt b/runtime/doc/os_dos.txt index 2156f65e8..e4cfb7077 100644 --- a/runtime/doc/os_dos.txt +++ b/runtime/doc/os_dos.txt @@ -1,4 +1,4 @@ -*os_dos.txt* For Vim version 7.2a. Last change: 2006 Mar 30 +*os_dos.txt* For Vim version 7.2b. Last change: 2006 Mar 30 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/os_mac.txt b/runtime/doc/os_mac.txt index 7c88f9e4d..68dbcfb7b 100644 --- a/runtime/doc/os_mac.txt +++ b/runtime/doc/os_mac.txt @@ -1,4 +1,4 @@ -*os_mac.txt* For Vim version 7.2a. Last change: 2006 Apr 30 +*os_mac.txt* For Vim version 7.2b. Last change: 2006 Apr 30 VIM REFERENCE MANUAL by Bram Moolenaar et al. diff --git a/runtime/doc/os_mint.txt b/runtime/doc/os_mint.txt index bda358603..1afd335f9 100644 --- a/runtime/doc/os_mint.txt +++ b/runtime/doc/os_mint.txt @@ -1,4 +1,4 @@ -*os_mint.txt* For Vim version 7.2a. Last change: 2005 Mar 29 +*os_mint.txt* For Vim version 7.2b. Last change: 2005 Mar 29 VIM REFERENCE MANUAL by Jens M. Felderhoff diff --git a/runtime/doc/os_msdos.txt b/runtime/doc/os_msdos.txt index 6aa807248..a9fd7bed4 100644 --- a/runtime/doc/os_msdos.txt +++ b/runtime/doc/os_msdos.txt @@ -1,4 +1,4 @@ -*os_msdos.txt* For Vim version 7.2a. Last change: 2005 Mar 29 +*os_msdos.txt* For Vim version 7.2b. Last change: 2005 Mar 29 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/os_os2.txt b/runtime/doc/os_os2.txt index 1374346c1..fbae5f96b 100644 --- a/runtime/doc/os_os2.txt +++ b/runtime/doc/os_os2.txt @@ -1,4 +1,4 @@ -*os_os2.txt* For Vim version 7.2a. Last change: 2007 Apr 22 +*os_os2.txt* For Vim version 7.2b. Last change: 2007 Apr 22 VIM REFERENCE MANUAL by Paul Slootman diff --git a/runtime/doc/os_qnx.txt b/runtime/doc/os_qnx.txt index 6d15e5157..c199a9751 100644 --- a/runtime/doc/os_qnx.txt +++ b/runtime/doc/os_qnx.txt @@ -1,4 +1,4 @@ -*os_qnx.txt* For Vim version 7.2a. Last change: 2005 Mar 29 +*os_qnx.txt* For Vim version 7.2b. Last change: 2005 Mar 29 VIM REFERENCE MANUAL by Julian Kinraid diff --git a/runtime/doc/os_risc.txt b/runtime/doc/os_risc.txt index 0f6d2bba1..e7fb80613 100644 --- a/runtime/doc/os_risc.txt +++ b/runtime/doc/os_risc.txt @@ -1,4 +1,4 @@ -*os_risc.txt* For Vim version 7.2a. Last change: 2005 Mar 29 +*os_risc.txt* For Vim version 7.2b. Last change: 2008 Jun 28 VIM REFERENCE MANUAL by Thomas Leonard @@ -7,7 +7,7 @@ *riscos* *RISCOS* *RISC-OS* This file contains the particularities for the RISC OS version of Vim. -The RISC OS port is a completely new port and is not based on the old `archi' +The RISC OS port is a completely new port and is not based on the old "archi" port. 1. File locations |riscos-locations| @@ -46,7 +46,7 @@ run the command-line versions of Vim (see |riscos-commandline|). distribution, but modified slightly to work within the limits of ADFS, plus some extra files such as the window templates. -User choices are read from `Choices:*' and are saved to `<Choices$Write>.*'. +User choices are read from "Choices:*" and are saved to "<Choices$Write>.*". If you have the new !Boot structure then these should be set up already. If not, set Choices$Path to a list of directories to search when looking for user configuration files. Set Choices$Write to the directory you want files @@ -58,22 +58,22 @@ sessions). 2. Filename munging All pathname munging is disabled by default, so Vim should behave like a -normal RISC OS application now. So, if you want to edit `doc/html' then you -actually type `*vi doc/html'. +normal RISC OS application now. So, if you want to edit "doc/html" then you +actually type "*vi doc/html". The only times munging is done is when: - Searching included files from C programs, since these are always munged. See |[I|. Note: make sure you are in the right directory when you use this - command (i.e. the one with subdirectories 'c' and 'h'). + command (i.e. the one with subdirectories "c" and "h"). - Sourcing files using |:so|. - Paths starting `$VIM/' are munged like this: + Paths starting "$VIM/" are munged like this: $VIM/syntax/help.vim -> Vim:syntax.help - Also, files ending in `.vim' have their extensions removed, and slashes + Also, files ending in ".vim" have their extensions removed, and slashes replaced with dots. Some tag files and script files may have to be edited to work under this port. @@ -82,10 +82,10 @@ Some tag files and script files may have to be edited to work under this port. *riscos-commandline* 3. Command-line use -To use Vim from the command-line use the `*vi' command (or '*ex' for +To use Vim from the command-line use the "*vi" command (or "*ex" for |Ex-mode|). -Type `*vi -h' for a list of options. +Type "*vi -h" for a list of options. Running the command-line version of Vim in a large high-color mode may cause the scrolling to be very slow. Either change to a mode with fewer colors or @@ -149,7 +149,7 @@ font via ZapRedraw and any of the Zap fonts via ZapRedraw: > point is used. Thanks to John Kortink, Vim can use the ZapRedraw module. Start the font name -with '!' (or '!!' for double height), like this: > +with "!" (or "!!" for double height), like this: > :set guifont=!! < Use the system font, but via ZapRedraw. This gives a @@ -158,13 +158,13 @@ with '!' (or '!!' for double height), like this: > > :set guifont=!script < Uses the named Zap font (a directory in VimFont$Path). - The redraw is the same speed as for '!!', but you get + The redraw is the same speed as for "!!", but you get a nicer looking font. Only the "man+" and "script" fonts are supplied currently, but you can use any of the Zap fonts if they are in VimFont$Path. - Vim will try to load font files '0', 'B', 'I' and 'IB' - from the named directory. Only '0' (normal style) MUST + Vim will try to load font files "0", "B", "I" and "IB" + from the named directory. Only "0" (normal style) MUST be present. Link files are not currently supported. Note that when using ZapRedraw the edit bar is drawn in front of the character @@ -191,7 +191,7 @@ allow other codes to be used if you want to use Vim from a remote terminal. Although I do not have an internet connection to my Acorn, I have managed to run Vim in a FreeTerm window using the loopback connection. -It seems to work pretty well now, using '*vi -T ansi'. +It seems to work pretty well now, using "*vi -T ansi". ============================================================================== *riscos-temp-files* @@ -203,7 +203,7 @@ files are in <Wimp$ScrapDir> (i.e. inside !Scrap) and backups are in the directory you were saving to. Vim will allow you to try and recover the file when you next try to edit it. -To see a list of swap files, press <F12> and type `*vi -r'. +To see a list of swap files, press <F12> and type "*vi -r". Vim no longer brings up ATTENTION warnings if you try to edit two files with the same name in different directories. @@ -228,8 +228,8 @@ older machines then edit the !RunTxt and GVim files. I don't know what UnixLib does by default on these machines so I'm playing safe. It doesn't work at all well without dynamic areas, since it can't change its -memory allocation once running. Hence you should edit `!Vim.GVim' and -`!Vim.!RunTxt' to choose the best size for you. You probably need at least +memory allocation once running. Hence you should edit "!Vim.GVim" and +"!Vim.!RunTxt" to choose the best size for you. You probably need at least about 1400K. ============================================================================== @@ -252,7 +252,7 @@ The system has changed from version 5.3. The new sequence of events is: Some examples may make this clearer: Kind of file loaded osfiletype filetype ~ - C code 'c.hellow' Text (&fff) C + C code "c.hellow" Text (&fff) C LaTeX document LaTeX (&2a8) TeX Draw document DrawFile (&aff) (not changed) @@ -263,7 +263,7 @@ Some examples may make this clearer: - Bangs (!s) are only replaced if they are followed by a space or end-of-line, since many pathnames contain them. -- You can prefix the command with '~', which stops any output from being +- You can prefix the command with "~", which stops any output from being displayed. This also means that you don't have to press <Enter> afterwards, and stops the screen from being redrawn. {only in the GUI version} @@ -275,7 +275,7 @@ Downloading everything you need: - Get the latest source distribution (see www.vim.org) - Get the runtime environment files (e.g. these help files) -- Get the `extra' archive (contains the RISC OS specific bits) +- Get the "extra" archive (contains the RISC OS specific bits) - Get the RISC OS binary distribution (if possible) @@ -289,19 +289,19 @@ Unarchiving: Recompiling the sources: - Create c, s, and h directories. -- Put all the header files in 'h'. \ -- Put all the C files in `c'. | And lose the extensions -- Put the assembler file (`swis/s') in 's'. / -- Rename all the files in `proto' to `h', like this: +- Put all the header files in "h". \ +- Put all the C files in "c". | And lose the extensions +- Put the assembler file ("swis/s") in "s". / +- Rename all the files in "proto" to "h", like this: raFS::VimSrc.source.proto.file/pro becomes raFS::VimSrc.source.h.file_pro -- In the files `h.proto' and `c.termlib', search and replace +- In the files "h.proto" and "c.termlib", search and replace .pro" with _pro.h" -- Create a simple Makefile if desired and do '*make -k'. - Use 'CC = gcc -DRISCOS -DUSE_GUI -O2 -x c' in the Makefile. +- Create a simple Makefile if desired and do "*make -k". + Use "CC = gcc -DRISCOS -DUSE_GUI -O2 -x c" in the Makefile. - Save the binary as !Vim.Vim in the binary distribution. @@ -309,15 +309,15 @@ Updating the run-time environment: - Replace old or missing files inside !Vim.Resources with the new files. -- Remove files in `doc' not ending in `/txt', except for `tags'. -- Lose the extensions from the files in `doc'. -- Edit the `doc.tags' file. Remove extensions from the second column: > +- Remove files in "doc" not ending in "/txt", except for "tags". +- Lose the extensions from the files in "doc". +- Edit the "doc.tags" file. Remove extensions from the second column: > :%s/^\(.[^\t]*\t.*\)\.txt\t/\1\t/ - Remove extensions from the syntax files. Split them into two directories to avoid the 77 entry limit on old ADFS filesystems. -- Edit `Vim:FileType' to match `*.c.*' as well as `*/c' and so on. +- Edit "Vim:FileType" to match "*.c.*" as well as "*/c" and so on. Add filetype checking too. -- Edit `Vim:Menu' and remove all the keys from the menus: > +- Edit "Vim:Menu" and remove all the keys from the menus: > :%s/<Tab>[^ \t]*// < vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/os_unix.txt b/runtime/doc/os_unix.txt index cf200f0c7..036f59707 100644 --- a/runtime/doc/os_unix.txt +++ b/runtime/doc/os_unix.txt @@ -1,4 +1,4 @@ -*os_unix.txt* For Vim version 7.2a. Last change: 2005 Mar 29 +*os_unix.txt* For Vim version 7.2b. Last change: 2005 Mar 29 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/os_vms.txt b/runtime/doc/os_vms.txt index 6208d636c..8b9692943 100644 --- a/runtime/doc/os_vms.txt +++ b/runtime/doc/os_vms.txt @@ -1,4 +1,4 @@ -*os_vms.txt* For Vim version 7.2a. Last change: 2006 Nov 18 +*os_vms.txt* For Vim version 7.2b. Last change: 2006 Nov 18 VIM REFERENCE MANUAL diff --git a/runtime/doc/os_win32.txt b/runtime/doc/os_win32.txt index afc05ddea..73d55e947 100644 --- a/runtime/doc/os_win32.txt +++ b/runtime/doc/os_win32.txt @@ -1,4 +1,4 @@ -*os_win32.txt* For Vim version 7.2a. Last change: 2008 May 02 +*os_win32.txt* For Vim version 7.2b. Last change: 2008 May 02 VIM REFERENCE MANUAL by George Reilly diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index cb367d07b..ae60b83ba 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -1,4 +1,4 @@ -*pattern.txt* For Vim version 7.2a. Last change: 2008 Jun 21 +*pattern.txt* For Vim version 7.2b. Last change: 2008 Jun 21 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/pi_getscript.txt b/runtime/doc/pi_getscript.txt index 5f46de006..2d7edb881 100644 --- a/runtime/doc/pi_getscript.txt +++ b/runtime/doc/pi_getscript.txt @@ -1,4 +1,4 @@ -*pi_getscript.txt* For Vim version 7.2a. Last change: 2008 Jan 07 +*pi_getscript.txt* For Vim version 7.2b. Last change: 2008 Jun 29 > GETSCRIPT REFERENCE MANUAL by Charles E. Campbell, Jr. < @@ -335,6 +335,9 @@ The AutoInstall process will: ============================================================================== 9. GetLatestVimScripts History *getscript-history* *glvs-hist* {{{1 +v31 Jun 29, 2008 : * (Bill McCarthy) fixed having hls enabled with getscript +v30 Jun 13, 2008 : * GLVS now checks for existence of fnameescape() and will + issue an error message if its 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_gzip.txt b/runtime/doc/pi_gzip.txt index 333437916..e9e224bea 100644 --- a/runtime/doc/pi_gzip.txt +++ b/runtime/doc/pi_gzip.txt @@ -1,4 +1,4 @@ -*pi_gzip.txt* For Vim version 7.2a. Last change: 2002 Oct 29 +*pi_gzip.txt* For Vim version 7.2b. Last change: 2002 Oct 29 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 68a0299ce..7e0c597cc 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -1,4 +1,4 @@ -*pi_netrw.txt* For Vim version 7.2a. Last change: 2008 Jun 21 +*pi_netrw.txt* For Vim version 7.2b. Last change: 2008 Jul 13 ----------------------------------------------------- NETRW REFERENCE MANUAL by Charles E. Campbell, Jr. @@ -314,13 +314,6 @@ settings are described below, in |netrw-browser-options|, and in Also affects the "previous window" (see |netrw-P|) in the same way. - *g:netrw_shq* = "'" for Unix/Linux systems (ie. a single quote) - = "'" for Windows + cygwin systems (ie. a single quote) - = '"' for Windows systems, not using cygwin - (ie. a double quote) - Controls the quoting character used during scp and ftp - commands. - *g:netrw_scpport* = "-P" : option to use to set port for scp *g:netrw_sshport* = "-p" : option to use to set port for ssh @@ -864,6 +857,7 @@ QUICK HELP *netrw-quickhelp* {{{2 Sorted by Select sorting style (name/time/size).........|netrw-s| Editing the sorting sequence..................|netrw-S| + Sorting options...............................|g:netrw_sort_options| Associated setting variable...................|g:netrw_sort_sequence| Reverse sorting order.........................|netrw-r| @@ -921,6 +915,8 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2 browser window. A vertical split is used. x View file with an associated program |netrw-x| + % Open a new file in netrw's current directory |netrw-%| + <leftmouse> (gvim only) selects word under mouse as if a <cr> had been pressed (ie. edit file, change directory) <middlemouse> (gvim only) same as P selecting word under mouse; @@ -1362,8 +1358,8 @@ will end up. One may change the sorting sequence by modifying the g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by using the "S" map. -Related topics: |netrw-s| -Associated setting variable: |g:netrw_sort_sequence| +Related topics: |netrw-s| |netrw-S| +Associated setting variables: |g:netrw_sort_sequence| |g:netrw_sort_options| GOING UP *netrw--* {{{2 @@ -1657,7 +1653,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, its +The "mt" mapping will apply the command in |g:netrw_ctags| (by default, its "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 @@ -1676,7 +1672,7 @@ preceded by the netrw-compatible url used to obtain it. When one subsequently uses one of the go to tag actions (|tags|), the url will be used by netrw to edit the desired file and go to the tag. -Associated setting variables: |g:netrw_ssh_cmd| +Associated setting variables: |g:netrw_ctags| |g:netrw_ssh_cmd| MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2 @@ -1738,14 +1734,13 @@ your browsing preferences. (see also: |netrw-settings|) a script/function to handle the given extension. (see |netrw_filehandler|). - *g:netrw_cd_escape* ="[]#*$%'\" ?`!&();<>\\" - This option is used to escape directory names - before changing directory to them. - *g:netrw_compress* ="gzip" Will compress marked files with this command + *g:netrw_ctags* ="ctags" + The default external program used to create tags + *g:netrw_decompress* = { ".gz" : "gunzip" , ".bz2" : "bunzip2" , ".zip" : "unzip" , @@ -1888,6 +1883,14 @@ your browsing preferences. (see also: |netrw-settings|) *g:netrw_sort_direction* sorting direction: "normal" or "reverse" default: "normal" + *g:netrw_sort_options* sorting is done using |:sort|; this + variable's value is appended to the + sort command. Thus one may ignore case, + for example, with the following in your + .vimrc: > + let g:netrw_sort_options="i" +< default: "" + *g:netrw_sort_sequence* when sorting by name, first sort by the comma-separated pattern sequence default: '[\/]$,*,\.bak$,\.o$,\.h$, @@ -2031,6 +2034,13 @@ Related topics: directory, see |g:netrw_keepdir|. +OPEN A NEW FILE IN NETRW'S CURRENT DIRECTORY *netrw-%* + +To open a file in netrw's current directory, press "%". This map will +query the user for a new filename; an empty file by that name will be +placed in the netrw's current directory (ie. b:netrw_curdir). + + PREVIEW WINDOW *netrw-p* *netrw-preview* {{{2 One may use a preview window by using the "p" key when the cursor is atop the @@ -2377,6 +2387,23 @@ which is loaded automatically at startup (assuming :set nocp). ============================================================================== 12. History *netrw-history* {{{1 + v126: Jun 30, 2008 * after having gone to a remote directory, + <f1> was no longer taking one to the correct + entry in the help (|netrw-quickhelp|). Fixed. + Jul 01, 2008 * extracting the last filename from a wide listing + missed the last letter when |'virtualedit'| not + enabled. + Jul 01, 2008 * vim foo/bar was creating [Scratch] buffers, + where bar was also a directory + Jul 01, 2008 * numerous additional changes were made to netrw + to use fnameescape() and shellescape() instead + of escape(). Not all changes have been tested + as yet... + Jul 01, 2008 * (James Vega reported) some problems with + :NetrwSettings (due to no longer used setting + variables). + Jul 07, 2008 * Additional numerous changes to support security; + shellescape(arg,1), etc. v125: Apr 07, 2008 * (Cristian Rigamonti) CR provides a patch; he noted that gx was failing since its call to netrw#NetBrowseX() wasn't updated to @@ -2570,7 +2597,7 @@ which is loaded automatically at startup (assuming :set nocp). 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 - |g:netrw_shq| instead of hardcoded quotes, + g:netrw_shq instead of hardcoded quotes, and modified the snippet that sets up redir so Windows machines use "nul" instead of "/dev/null". diff --git a/runtime/doc/pi_paren.txt b/runtime/doc/pi_paren.txt index 810532797..faa889bc1 100644 --- a/runtime/doc/pi_paren.txt +++ b/runtime/doc/pi_paren.txt @@ -1,4 +1,4 @@ -*pi_paren.txt* For Vim version 7.2a. Last change: 2008 Jun 16 +*pi_paren.txt* For Vim version 7.2b. Last change: 2008 Jun 16 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/pi_spec.txt b/runtime/doc/pi_spec.txt index 900e768fc..e5cb3daf3 100644 --- a/runtime/doc/pi_spec.txt +++ b/runtime/doc/pi_spec.txt @@ -1,4 +1,4 @@ -*pi_spec.txt* For Vim version 7.2a. Last change: 2006 Apr 24 +*pi_spec.txt* For Vim version 7.2b. Last change: 2006 Apr 24 by Gustavo Niemeyer ~ diff --git a/runtime/doc/pi_tar.txt b/runtime/doc/pi_tar.txt index c50e0d13f..c6926cdd0 100644 --- a/runtime/doc/pi_tar.txt +++ b/runtime/doc/pi_tar.txt @@ -1,4 +1,4 @@ -*pi_tar.txt* For Vim version 7.2a. Last change: 2008 Jun 12 +*pi_tar.txt* For Vim version 7.2b. Last change: 2008 Jul 13 +====================+ | Tar File Interface | diff --git a/runtime/doc/pi_vimball.txt b/runtime/doc/pi_vimball.txt index e31f8a7c3..7220d0ed9 100644 --- a/runtime/doc/pi_vimball.txt +++ b/runtime/doc/pi_vimball.txt @@ -1,4 +1,4 @@ -*pi_vimball.txt* For Vim version 7.2a. Last change: 2008 Jun 05 +*pi_vimball.txt* For Vim version 7.2b. Last change: 2008 Jun 05 ---------------- Vimball Archiver @@ -164,7 +164,7 @@ Copyright: (c) 2004-2008 by Charles E. Campbell, Jr. *Vimball-copyright* will extract plugin/somefile to the AsNeeded/ directory 17 : Jun 28, 2006 * changes all \s to /s internally for Windows - 16 : Jun 15, 2006 * A. Mechylynck's idea to allow users to specify + 16 : Jun 15, 2006 * A. Mechelynck's idea to allow users to specify installation root paths implemented for UseVimball, MkVimball, and RmVimball. * RmVimball implemented diff --git a/runtime/doc/pi_zip.txt b/runtime/doc/pi_zip.txt index 830d5c612..d4e3f67a6 100644 --- a/runtime/doc/pi_zip.txt +++ b/runtime/doc/pi_zip.txt @@ -1,4 +1,4 @@ -*pi_zip.txt* For Vim version 7.2a. Last change: 2008 Jun 12 +*pi_zip.txt* For Vim version 7.2b. Last change: 2008 Jun 29 +====================+ | Zip File Interface | @@ -70,7 +70,7 @@ Copyright: Copyright (C) 2005-2008 Charles E Campbell, Jr *zip-copyright* au BufReadCmd *.jar,*.xpi call zip#Browse(expand("<amatch>")) < - One simply can extend this line to accomodate additional extensions that + One can simply extend this line to accommodate additional extensions that should be treated as zip files. ============================================================================== diff --git a/runtime/doc/print.txt b/runtime/doc/print.txt index cb4de4318..af1e2c0aa 100644 --- a/runtime/doc/print.txt +++ b/runtime/doc/print.txt @@ -1,4 +1,4 @@ -*print.txt* For Vim version 7.2a. Last change: 2008 Apr 30 +*print.txt* For Vim version 7.2b. Last change: 2008 Apr 30 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index 26e2e7e88..5c48e6716 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1,4 +1,4 @@ -*quickfix.txt* For Vim version 7.2a. Last change: 2008 Mar 14 +*quickfix.txt* For Vim version 7.2b. Last change: 2008 Mar 14 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index fc49cfa8e..230a110f9 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -1,4 +1,4 @@ -*quickref.txt* For Vim version 7.2a. Last change: 2008 Jan 22 +*quickref.txt* For Vim version 7.2b. Last change: 2008 Jan 22 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/quotes.txt b/runtime/doc/quotes.txt index 07b212616..af874514d 100644 --- a/runtime/doc/quotes.txt +++ b/runtime/doc/quotes.txt @@ -1,4 +1,4 @@ -*quotes.txt* For Vim version 7.2a. Last change: 2006 Apr 24 +*quotes.txt* For Vim version 7.2b. Last change: 2006 Apr 24 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/recover.txt b/runtime/doc/recover.txt index 578c8011d..75f5d7e96 100644 --- a/runtime/doc/recover.txt +++ b/runtime/doc/recover.txt @@ -1,4 +1,4 @@ -*recover.txt* For Vim version 7.2a. Last change: 2006 Apr 24 +*recover.txt* For Vim version 7.2b. Last change: 2006 Apr 24 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/remote.txt b/runtime/doc/remote.txt index 85b050762..bbf1c1277 100644 --- a/runtime/doc/remote.txt +++ b/runtime/doc/remote.txt @@ -1,4 +1,4 @@ -*remote.txt* For Vim version 7.2a. Last change: 2008 May 24 +*remote.txt* For Vim version 7.2b. Last change: 2008 May 24 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index 38a485753..577c0de81 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -1,4 +1,4 @@ -*repeat.txt* For Vim version 7.2a. Last change: 2007 Aug 12 +*repeat.txt* For Vim version 7.2b. Last change: 2007 Aug 12 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/rileft.txt b/runtime/doc/rileft.txt index d270740e2..40f00bca7 100644 --- a/runtime/doc/rileft.txt +++ b/runtime/doc/rileft.txt @@ -1,4 +1,4 @@ -*rileft.txt* For Vim version 7.2a. Last change: 2006 Apr 24 +*rileft.txt* For Vim version 7.2b. Last change: 2006 Apr 24 VIM REFERENCE MANUAL by Avner Lottem diff --git a/runtime/doc/russian.txt b/runtime/doc/russian.txt index dabca4289..0ba9be791 100644 --- a/runtime/doc/russian.txt +++ b/runtime/doc/russian.txt @@ -1,4 +1,4 @@ -*russian.txt* For Vim version 7.2a. Last change: 2006 Apr 24 +*russian.txt* For Vim version 7.2b. Last change: 2006 Apr 24 VIM REFERENCE MANUAL by Vassily Ragosin diff --git a/runtime/doc/scroll.txt b/runtime/doc/scroll.txt index 91fc4c8fe..141eee6e6 100644 --- a/runtime/doc/scroll.txt +++ b/runtime/doc/scroll.txt @@ -1,4 +1,4 @@ -*scroll.txt* For Vim version 7.2a. Last change: 2006 Aug 27 +*scroll.txt* For Vim version 7.2b. Last change: 2006 Aug 27 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/sign.txt b/runtime/doc/sign.txt index 5434279ec..7e2952038 100644 --- a/runtime/doc/sign.txt +++ b/runtime/doc/sign.txt @@ -1,4 +1,4 @@ -*sign.txt* For Vim version 7.2a. Last change: 2006 Apr 24 +*sign.txt* For Vim version 7.2b. Last change: 2006 Apr 24 VIM REFERENCE MANUAL by Gordon Prieur diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt index e6c40c83a..ea4da257d 100644 --- a/runtime/doc/spell.txt +++ b/runtime/doc/spell.txt @@ -1,4 +1,4 @@ -*spell.txt* For Vim version 7.2a. Last change: 2008 Jun 21 +*spell.txt* For Vim version 7.2b. Last change: 2008 Jun 21 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/sponsor.txt b/runtime/doc/sponsor.txt index ac25f49f1..9e67ec469 100644 --- a/runtime/doc/sponsor.txt +++ b/runtime/doc/sponsor.txt @@ -1,4 +1,4 @@ -*sponsor.txt* For Vim version 7.2a. Last change: 2008 Jun 21 +*sponsor.txt* For Vim version 7.2b. Last change: 2008 Jun 21 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index c017fb4b7..dfb403bc8 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -1,4 +1,4 @@ -*starting.txt* For Vim version 7.2a. Last change: 2008 Jun 21 +*starting.txt* For Vim version 7.2b. Last change: 2008 Jun 21 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 0a0c0a887..839ab3442 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 7.2a. Last change: 2008 Jun 21 +*syntax.txt* For Vim version 7.2b. Last change: 2008 Jun 21 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt index 6410b117b..518f9802c 100644 --- a/runtime/doc/tabpage.txt +++ b/runtime/doc/tabpage.txt @@ -1,4 +1,4 @@ -*tabpage.txt* For Vim version 7.2a. Last change: 2007 Mar 11 +*tabpage.txt* For Vim version 7.2b. Last change: 2007 Mar 11 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/tags b/runtime/doc/tags index 4f94fe53e..b955aaf06 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -5460,6 +5460,7 @@ ft-papp-syntax syntax.txt /*ft-papp-syntax* ft-pascal-syntax syntax.txt /*ft-pascal-syntax* ft-pdf-plugin filetype.txt /*ft-pdf-plugin* ft-perl-syntax syntax.txt /*ft-perl-syntax* +ft-php-indent indent.txt /*ft-php-indent* ft-php-omni insert.txt /*ft-php-omni* ft-php-syntax syntax.txt /*ft-php-syntax* ft-php3-syntax syntax.txt /*ft-php3-syntax* @@ -5583,8 +5584,8 @@ g:netrw_alto pi_netrw.txt /*g:netrw_alto* g:netrw_altv pi_netrw.txt /*g:netrw_altv* g:netrw_browse_split pi_netrw.txt /*g:netrw_browse_split* g:netrw_browsex_viewer pi_netrw.txt /*g:netrw_browsex_viewer* -g:netrw_cd_escape pi_netrw.txt /*g:netrw_cd_escape* g:netrw_compress pi_netrw.txt /*g:netrw_compress* +g:netrw_ctags pi_netrw.txt /*g:netrw_ctags* 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* @@ -5625,10 +5626,10 @@ g:netrw_rsync_cmd pi_netrw.txt /*g:netrw_rsync_cmd* g:netrw_scp_cmd pi_netrw.txt /*g:netrw_scp_cmd* g:netrw_scpport pi_netrw.txt /*g:netrw_scpport* g:netrw_sftp_cmd pi_netrw.txt /*g:netrw_sftp_cmd* -g:netrw_shq pi_netrw.txt /*g:netrw_shq* g:netrw_silent pi_netrw.txt /*g:netrw_silent* g:netrw_sort_by pi_netrw.txt /*g:netrw_sort_by* g:netrw_sort_direction pi_netrw.txt /*g:netrw_sort_direction* +g:netrw_sort_options pi_netrw.txt /*g:netrw_sort_options* g:netrw_sort_sequence pi_netrw.txt /*g:netrw_sort_sequence* g:netrw_special_syntax pi_netrw.txt /*g:netrw_special_syntax* g:netrw_ssh_browse_reject pi_netrw.txt /*g:netrw_ssh_browse_reject* @@ -6475,6 +6476,7 @@ netbeans-support netbeans.txt /*netbeans-support* netbeans.txt netbeans.txt /*netbeans.txt* netreadfixup pi_netrw.txt /*netreadfixup* netrw pi_netrw.txt /*netrw* +netrw-% pi_netrw.txt /*netrw-%* netrw-- pi_netrw.txt /*netrw--* netrw-D pi_netrw.txt /*netrw-D* netrw-O pi_netrw.txt /*netrw-O* @@ -6707,6 +6709,7 @@ nice todo.txt /*nice* no-eval-feature eval.txt /*no-eval-feature* no_buffers_menu gui.txt /*no_buffers_menu* non-greedy pattern.txt /*non-greedy* +non-zero-arg eval.txt /*non-zero-arg* normal-index index.txt /*normal-index* not-compatible usr_01.txt /*not-compatible* not-edited editing.txt /*not-edited* @@ -6812,6 +6815,9 @@ pfn-option print.txt /*pfn-option* pheader-option print.txt /*pheader-option* photon-fonts os_qnx.txt /*photon-fonts* photon-gui os_qnx.txt /*photon-gui* +php-comment indent.txt /*php-comment* +php-indent indent.txt /*php-indent* +php-indenting indent.txt /*php-indenting* php.vim syntax.txt /*php.vim* php3.vim syntax.txt /*php3.vim* phtml.vim syntax.txt /*phtml.vim* diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt index 46dc18e91..952bb96f0 100644 --- a/runtime/doc/tagsrch.txt +++ b/runtime/doc/tagsrch.txt @@ -1,4 +1,4 @@ -*tagsrch.txt* For Vim version 7.2a. Last change: 2006 Apr 24 +*tagsrch.txt* For Vim version 7.2b. Last change: 2006 Apr 24 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index 55a9ae100..cf960bd53 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -1,4 +1,4 @@ -*term.txt* For Vim version 7.2a. Last change: 2008 Jun 21 +*term.txt* For Vim version 7.2b. Last change: 2008 Jun 21 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/tips.txt b/runtime/doc/tips.txt index 0bdcfa077..ffeea0fbf 100644 --- a/runtime/doc/tips.txt +++ b/runtime/doc/tips.txt @@ -1,4 +1,4 @@ -*tips.txt* For Vim version 7.2a. Last change: 2006 Jul 24 +*tips.txt* For Vim version 7.2b. Last change: 2006 Jul 24 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index b60696897..03e49813d 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.2a. Last change: 2008 Jun 24 +*todo.txt* For Vim version 7.2b. Last change: 2008 Jul 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -30,10 +30,20 @@ be worked on, but only if you sponsor Vim development. See |sponsor|. *known-bugs* -------------------- Known bugs and current work ----------------------- +":pedit %" with a BufReadPre autocommand causes the cursor to move to the +first line. (Ingo Karkat, 2008 Jul 1) + Have a look at patch for utf-8 line breaking. (Yongwei Wu, 2008 Mar 1, Mar 23) -Drawing popup menu isn't quite right when there are double-wide characters. -Yukihiro Nakadaira is working on a solution (2008 Jun 22). Use mb_fix_col(). +Runtime files for Clojure. (Toralf Wittner, 2008 Jun 25) + +Patch to add extra argument to glob() and globpath() to ignore 'wildignore'. +(Ingo Karkat, 2008 Jun 25) + +Crash with dragn-n-drop of file combined with netrw (Marius Gedminas, 2008 Jun +11) I can't reproduce it. It's probably caused by a handle_drop() call +in combination with autocommands that invoke a ":redraw" command. +Another valgrind output Jun 30. When reallocating cmdline xp_pattern becomes invalid. Move expand_T xpc into ccline? (Dominique Pelle) @@ -44,14 +54,9 @@ Works OK with Vim in an xterm. Fix for matchparen HL doesn't work. beep. -Crash with dragn-n-drop of file combined with netrw (Marius Gedminas, 2008 Jun -11) I can't reproduce it. - Win32: associating a type with Vim doesn't take care of space after a backslash? (Robert Vibrant, 2008 Jun 5) -":let &g:tw = 44" sets the local option value. (Cyril Slobin, 2008 Apr 25) - After using <Tab> for command line completion after ":ta blah" and getting E33 (no tags file), further editing the command to e.g., ":echo 'blah'", the command is not executed. @@ -69,10 +74,8 @@ Win32: remote editing fails when the current directory name contains "[". (Ivan Tishchenko, Liu Yubao) Suggested patch by Chris Lubinski: Avoid escaping characters where the backslash is not removed later. Asked Chris for an alternate solution, also for src/ex_getln.c. - -When adding path to 'tags' with a wildcard, it appears only a first match is -used. (Erik Falor, 2008 April 18) Or is it that a wildcard in the file name -is not supported, only in the path? +This also fails when the file or directory name contains "%". (Thoml, 2008 +July 7) The str2special() function doesn't handle multi-byte characters properly. Patch from Vladimir Vichniakov, 2007 Apr 24. @@ -102,8 +105,6 @@ line doesn't fit. (Dasn, 2008 May 1) GUI: In Normal mode can't yank the modeless selection. Make "gy" do this? Works like CTRL-Y in Command line mode. -Mac: patch for mouse wheel scroll under Leopard. (Eckehard Berns, 2007 Dec 7) - Mac: After a ":vsplit" the left scrollbar doesn't appear until 'columns' is changed or the window is resized. @@ -167,9 +168,6 @@ Asked about latest version: 0.77.1 is on www.vim.org. More AmigaOS4 patches. (Peter Bengtsson, Nov 9) -globpath() doesn't work as expected. The example shows using 'path', but the -"**8" form and upwards search are not supported. - Error when cancelling completion menu and auto-formatting. (Tim Weber, 2008 Apr 17) @@ -205,6 +203,12 @@ isn't right? Completion: Scanning for tags doesn't check for typed key now and then? Hangs for about 5 seconds. Appears to be caused by finding include files with "foo/**" in 'path'. (Kalisiak, 2006 July 15) +Additional info: When using the |wildcards| ** globing, vim hangs +indefinitely on lots of directories. The |file-searching| globing, like in +":set path=/**" does not hang as often as with globing with |wildcards|, like +in ":1find /**/file". This is for a files that unix "find" can find very +quick. Merging the 2 kinds of globing might make this an easier fix. (Ian +Kelling, 2008 July 4) When the file name has parenthesis, e.g., "foo (bar).txt", ":!ls '%'" has the parenthesis escaped but not the space. That's inconsistent. Either escape @@ -309,7 +313,7 @@ C++ indenting wrong with "=". (James Kanze, 2007 Jan 26) ":lockvar" should use copyID to avoid endless loop. When using --remote-silent and the file name matches 'wildignore' get an E479 -error. without --remoete-silent it works fine. (Ben Fritz, 2008 Jun 20) +error. without --remote-silent it works fine. (Ben Fritz, 2008 Jun 20) Gvim: dialog for closing Vim should check if Vim is busy writing a file. Then use a different dialog: "busy saving, really quit? yes / no". @@ -332,7 +336,7 @@ name literally, and esp. if there is only one name. Test 61 fails sometimes. This is a timing problem: "sleep 2" sometimes takes longer than 2 seconds. -Changing 'guifont' in the console causes an uneccessary redraw. +Changing 'guifont' in the console causes an unnecessary redraw. "vim -C" often has 'nocompatible', because it's set in some startup script. Set 'compatible' after startup is done? Patch by James Vega, 2008 Feb 7. @@ -368,7 +372,7 @@ Windows installer could add a "open in new tab of existing Vim" menu entry. Gvimext: patch to add "Edit with single Vim &tabbed" menu entry. Just have two choices, always using one Vim and selecting between using an argument list or opening each file in a separate tab. -(Erik Falor, 2008 May 21) +(Erik Falor, 2008 May 21, 2008 Jun 26) GUI: When combining fg en bg make sure they are not equal. @@ -581,6 +585,9 @@ In gvim the backspace key produces a backspace character, but on Linux the VERASE key is Delete. Set VERASE to Backspace? (patch by Stephane Chazelas, 2007 Oct 16) +When entering a C /* comment, after typing <Enter> for 70 times the indent +disappears. (Vincent Beffara, 2008 Jul 3) + TermResponse autocommand isn't always triggered when using vimdiff. (Aron Griffis, 2007 Sep 19) @@ -590,7 +597,7 @@ Create a gvimtutor.1 file and change Makefiles to install it. Vim 7.3: -- Add patch for 'relativenumber' option? Markus Heidelberg, 2008 Feb 21 +- Add patch for 'relativenumber' option? Markus Heidelberg, 2008 Jun 27. - Add blowfish encryption. Openssl has an implementation. Also by Paul Kocher (LGPL), close to original. Mohsin also has some ideas. Take four bytes and turn them into unsigned to avoid byte-order problems. @@ -671,6 +678,8 @@ Awaiting updated patches: Search in 'runtimepath'? More docs needed about how to use this. How to get the messages into the .po files? + charlen() Like strlen() but counting characters instead of + bytes. confirm() add "flags" argument, with 'v' for vertical layout and 'c' for console dialog. (Haegg) Flemming Madsen has a patch for the 'c' flag @@ -1189,7 +1198,8 @@ Macintosh: 9 For Turkish vim_tolower() and vim_toupper() also need to use utf_ functions for characters below 0x80. (Sertacyildiz) 9 When the last edited file is a help file, using '0 in a new Vim doesn't - edit the file as a help file. + edit the file as a help file. 'filetype' is OK, but 'iskeyword' isn't, + file isn't readonly, etc. 8 When an ":edit" is inside a try command and the ATTENTION prompt is used, the :catch commands are always executed, also when the file is edited normally. Should reset did_emsg and undo side effects. Also make sure @@ -1198,6 +1208,7 @@ Macintosh: 'fileencoding' set to "bar", then do_ecmd() uses that buffer, even though the fileencoding differs. Reload the buffer in this situation? Need to check for the buffer to be unmodified. + Unfinished patch by Ian Kelling, 2008 Jul 11. 8 ":g//" gives "Pattern not found error" with E486. Should not use the error number, it's not a regular error message. 7 Vimtutor leaves escape sequence in terminal. This is the xterm response to @@ -1296,15 +1307,13 @@ Macintosh: 9 When editing a file with 'readonly' set, there is no check for an existing swap file. Then using ":write" (without making any changes) doesn't give a warning either. Should check for an existing swap file without creating - one. + one. Unfinished patch by Ian Kelling, 2008 July 7. 7 When 'showbreak' is set, the amount of space a Tab occupies changes. Should work like 'showbreak' is inserted without changing the Tabs. 7 When 'mousefocus' is set and switching to another window with a typed command, the mouse pointer may be moved to a part of the window that's covered by another window and we lose focus. Only move in the y direction, not horizontally? -8 When using CTRL-D after ":help", restrict the number of matches to a - thousand, otherwise using CTRL-D without an argument takes too long. 8 ":hardcopy": - Using the cterm_color[] table is wrong when t_colors is > 16. - Need to handle unprintable characters. @@ -1703,6 +1712,10 @@ Tab pages: Spell checking: +- have some way not to give spelling errors for a range of characters. + E.g. for Chinese and other languages with specific characters for which we + don't have a spell file. Useful when there is also text in other + languages in the file. - Support more regions? Caolan McNamara argues it's needed for es_XX. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=219777 - Unicode defines another quote character: 0x2019. Use it as an equivalent @@ -1727,7 +1740,7 @@ Spell checking: WFP_COMPPERMIT and WFP_COMPFORBID 8 implement use of <compoptions> in .spl file: implement CHECKCOMPOUNDREP: when a compound word seems to be OK apply REP - items and theck if the result is a valid word. + items and check if the result is a valid word. implement CHECKCOMPOUNDDUP implement CHECKCOMPOUNDTRIPLE Add CHECKCOMPOUNDCASE: when compounding make leading capital lower case. @@ -2251,8 +2264,12 @@ Robustness: Performance: -7 For strings up to 3 bytes don't allocate memory, use v_list itself as a - character array. Use VAR_SSTRING (short string). +7 For string variables up to 3 bytes don't allocate memory, use v_list + itself as a character array. Use VAR_SSTRING (short string). +8 move_lines() copies every line into allocated memory, making reloading a + buffer a lot slower than re-editing the file. Can the memline be locked + so that we don't need to make a copy? Or avoid invoking ml_updatechunk(), + that is taking a lot of time. (Ralf Wildenhues, 2008 Jul 7) 8 Instead of loading rgb.txt every time a color wasn't recognized load it once and keep it in memory. Move the code to a common place to avoid repeating it in various system files. @@ -2471,6 +2488,11 @@ Tags: match. Remove tag_fname from the match and combine it with the fname in the match (without expanding or other things that take time). When 'tagrelative' is off tag_fname isn't needed at all. +8 For 'tags' wildcard in the file name is not supported, only in the path. + This is due to it using |file-searching|. Suboptimal solution would be to + make the filename or the whole option use |wildcards| globing, better + would be to merge the 2 kinds of globing. originall (Erik Falor, 2008 + April 18), updated (Ian Kelling, 2008 July 4) 8 Use a mechanism similar to omni completion to figure out the kind of tab for CTRL-] and jump to the appropriate matching tag (if there are several). @@ -2724,6 +2746,8 @@ Autocommands: Omni completion: +- Add a flag to 'complete' to be able to do omni completion with CTRL-N (and + mix it with other kinds of completion). - Ideas from the Vim 7 BOF at SANE: - For interpreted languages, use the interpreter to obtain information. Should work for Java (Eclipse does this), Python, Tcl, etc. @@ -2755,6 +2779,9 @@ Insert mode completion/expansion: - GUI implementation of the popup menu. 7 When searching in other files the name flash by, too fast to read. Only display a name every second or so, like with ":vimgrep". +7 When expanding file names with an environment variable, add the match with + the unexpanded var. So $HOME/tm expands to "/home/guy/tmp" and + "$HOME/tmp" 8 When there is no word before the cursor but something like "sys." complete with "sys.". Works well for C and similar languages. 9 ^X^L completion doesn't repeat correctly. It uses the first match with @@ -2903,6 +2930,7 @@ Insert mode: same change, so that "." repeats the whole insert. 7 Use CTRL-G <count> to repeat what follows. Useful for inserting a character multiple times or repeating CTRL-Y. +- Make 'revins' work in Replace mode. 7 Use 'matchpairs' for 'showmatch': When inserting a character check if it appears in the rhs of 'matchpairs'. - In Insert mode (and command line editing?): Allow undo of the last typed @@ -3558,6 +3586,8 @@ Multiple Windows: 7 Use CTRL-W <Tab>, like alt-tab, to switch between buffers. Repeat <Tab> to select another buffer (only loaded ones?), <BS> to go back, <Enter> to select buffer, <Esc> to go back to original buffer. +7 Make it possible to edit a new buffer in the preview window. A script can + then fill it with something. ":popen"? 7 Add a 'tool' window: behaves like a preview window but there can be several. Don't count it in only_one_window(). (Alexei Alexandrov) 6 Add an option to resize the shell when splitting and/or closing a window. diff --git a/runtime/doc/uganda.txt b/runtime/doc/uganda.txt index 4842769d5..655725f41 100644 --- a/runtime/doc/uganda.txt +++ b/runtime/doc/uganda.txt @@ -1,4 +1,4 @@ -*uganda.txt* For Vim version 7.2a. Last change: 2008 Jun 21 +*uganda.txt* For Vim version 7.2b. Last change: 2008 Jun 21 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/undo.txt b/runtime/doc/undo.txt index 33d4e3178..6940102f4 100644 --- a/runtime/doc/undo.txt +++ b/runtime/doc/undo.txt @@ -1,4 +1,4 @@ -*undo.txt* For Vim version 7.2a. Last change: 2006 Apr 30 +*undo.txt* For Vim version 7.2b. Last change: 2006 Apr 30 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/usr_01.txt b/runtime/doc/usr_01.txt index 1e00a110c..3a56abedc 100644 --- a/runtime/doc/usr_01.txt +++ b/runtime/doc/usr_01.txt @@ -1,4 +1,4 @@ -*usr_01.txt* For Vim version 7.2a. Last change: 2008 May 07 +*usr_01.txt* For Vim version 7.2b. Last change: 2008 May 07 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_02.txt b/runtime/doc/usr_02.txt index 44907b0e2..f47c63e21 100644 --- a/runtime/doc/usr_02.txt +++ b/runtime/doc/usr_02.txt @@ -1,4 +1,4 @@ -*usr_02.txt* For Vim version 7.2a. Last change: 2007 Feb 28 +*usr_02.txt* For Vim version 7.2b. Last change: 2007 Feb 28 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_03.txt b/runtime/doc/usr_03.txt index c5f114c9c..47d24d455 100644 --- a/runtime/doc/usr_03.txt +++ b/runtime/doc/usr_03.txt @@ -1,4 +1,4 @@ -*usr_03.txt* For Vim version 7.2a. Last change: 2006 Jun 21 +*usr_03.txt* For Vim version 7.2b. Last change: 2006 Jun 21 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_04.txt b/runtime/doc/usr_04.txt index b8f9c4ddb..dd6a84c0e 100644 --- a/runtime/doc/usr_04.txt +++ b/runtime/doc/usr_04.txt @@ -1,4 +1,4 @@ -*usr_04.txt* For Vim version 7.2a. Last change: 2006 Jun 21 +*usr_04.txt* For Vim version 7.2b. Last change: 2006 Jun 21 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt index bfa3926de..93c34ded3 100644 --- a/runtime/doc/usr_05.txt +++ b/runtime/doc/usr_05.txt @@ -1,4 +1,4 @@ -*usr_05.txt* For Vim version 7.2a. Last change: 2007 May 11 +*usr_05.txt* For Vim version 7.2b. Last change: 2007 May 11 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_06.txt b/runtime/doc/usr_06.txt index 626af3d00..8ee32c43d 100644 --- a/runtime/doc/usr_06.txt +++ b/runtime/doc/usr_06.txt @@ -1,4 +1,4 @@ -*usr_06.txt* For Vim version 7.2a. Last change: 2006 Apr 24 +*usr_06.txt* For Vim version 7.2b. Last change: 2006 Apr 24 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_07.txt b/runtime/doc/usr_07.txt index 86a46ecad..ac2164961 100644 --- a/runtime/doc/usr_07.txt +++ b/runtime/doc/usr_07.txt @@ -1,4 +1,4 @@ -*usr_07.txt* For Vim version 7.2a. Last change: 2006 Apr 24 +*usr_07.txt* For Vim version 7.2b. Last change: 2006 Apr 24 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_08.txt b/runtime/doc/usr_08.txt index 144f6cc8d..5c3a93e54 100644 --- a/runtime/doc/usr_08.txt +++ b/runtime/doc/usr_08.txt @@ -1,4 +1,4 @@ -*usr_08.txt* For Vim version 7.2a. Last change: 2006 Jul 18 +*usr_08.txt* For Vim version 7.2b. Last change: 2006 Jul 18 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_09.txt b/runtime/doc/usr_09.txt index 69a431c3c..d2c652e90 100644 --- a/runtime/doc/usr_09.txt +++ b/runtime/doc/usr_09.txt @@ -1,4 +1,4 @@ -*usr_09.txt* For Vim version 7.2a. Last change: 2006 Apr 24 +*usr_09.txt* For Vim version 7.2b. Last change: 2006 Apr 24 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_10.txt b/runtime/doc/usr_10.txt index 168b089b3..b41976f50 100644 --- a/runtime/doc/usr_10.txt +++ b/runtime/doc/usr_10.txt @@ -1,4 +1,4 @@ -*usr_10.txt* For Vim version 7.2a. Last change: 2006 Nov 05 +*usr_10.txt* For Vim version 7.2b. Last change: 2006 Nov 05 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_11.txt b/runtime/doc/usr_11.txt index edb45981f..d23743afe 100644 --- a/runtime/doc/usr_11.txt +++ b/runtime/doc/usr_11.txt @@ -1,4 +1,4 @@ -*usr_11.txt* For Vim version 7.2a. Last change: 2006 Apr 24 +*usr_11.txt* For Vim version 7.2b. Last change: 2006 Apr 24 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_12.txt b/runtime/doc/usr_12.txt index 7e2f413d4..3988de8f4 100644 --- a/runtime/doc/usr_12.txt +++ b/runtime/doc/usr_12.txt @@ -1,4 +1,4 @@ -*usr_12.txt* For Vim version 7.2a. Last change: 2007 May 11 +*usr_12.txt* For Vim version 7.2b. Last change: 2007 May 11 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_20.txt b/runtime/doc/usr_20.txt index 84c58f7d0..864559c5f 100644 --- a/runtime/doc/usr_20.txt +++ b/runtime/doc/usr_20.txt @@ -1,4 +1,4 @@ -*usr_20.txt* For Vim version 7.2a. Last change: 2006 Apr 24 +*usr_20.txt* For Vim version 7.2b. Last change: 2006 Apr 24 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_21.txt b/runtime/doc/usr_21.txt index 3eabb6866..b15e7f011 100644 --- a/runtime/doc/usr_21.txt +++ b/runtime/doc/usr_21.txt @@ -1,4 +1,4 @@ -*usr_21.txt* For Vim version 7.2a. Last change: 2007 May 01 +*usr_21.txt* For Vim version 7.2b. Last change: 2007 May 01 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_22.txt b/runtime/doc/usr_22.txt index 5a13b871e..a642c59b3 100644 --- a/runtime/doc/usr_22.txt +++ b/runtime/doc/usr_22.txt @@ -1,4 +1,4 @@ -*usr_22.txt* For Vim version 7.2a. Last change: 2007 Aug 14 +*usr_22.txt* For Vim version 7.2b. Last change: 2007 Aug 14 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_23.txt b/runtime/doc/usr_23.txt index e0aa05dcb..ead8711c9 100644 --- a/runtime/doc/usr_23.txt +++ b/runtime/doc/usr_23.txt @@ -1,4 +1,4 @@ -*usr_23.txt* For Vim version 7.2a. Last change: 2006 Apr 24 +*usr_23.txt* For Vim version 7.2b. Last change: 2006 Apr 24 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_24.txt b/runtime/doc/usr_24.txt index 35911bde5..eab8a36dd 100644 --- a/runtime/doc/usr_24.txt +++ b/runtime/doc/usr_24.txt @@ -1,4 +1,4 @@ -*usr_24.txt* For Vim version 7.2a. Last change: 2006 Jul 23 +*usr_24.txt* For Vim version 7.2b. Last change: 2006 Jul 23 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_25.txt b/runtime/doc/usr_25.txt index 633787149..22ddddf1a 100644 --- a/runtime/doc/usr_25.txt +++ b/runtime/doc/usr_25.txt @@ -1,4 +1,4 @@ -*usr_25.txt* For Vim version 7.2a. Last change: 2007 May 11 +*usr_25.txt* For Vim version 7.2b. Last change: 2007 May 11 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_26.txt b/runtime/doc/usr_26.txt index 0c9f2c8cf..b8252dd4d 100644 --- a/runtime/doc/usr_26.txt +++ b/runtime/doc/usr_26.txt @@ -1,4 +1,4 @@ -*usr_26.txt* For Vim version 7.2a. Last change: 2006 Apr 24 +*usr_26.txt* For Vim version 7.2b. Last change: 2006 Apr 24 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_27.txt b/runtime/doc/usr_27.txt index 71bfdda98..d2d0cc4ef 100644 --- a/runtime/doc/usr_27.txt +++ b/runtime/doc/usr_27.txt @@ -1,4 +1,4 @@ -*usr_27.txt* For Vim version 7.2a. Last change: 2007 Nov 10 +*usr_27.txt* For Vim version 7.2b. Last change: 2007 Nov 10 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_28.txt b/runtime/doc/usr_28.txt index 76644bb67..045aef8fd 100644 --- a/runtime/doc/usr_28.txt +++ b/runtime/doc/usr_28.txt @@ -1,4 +1,4 @@ -*usr_28.txt* For Vim version 7.2a. Last change: 2008 Jun 14 +*usr_28.txt* For Vim version 7.2b. Last change: 2008 Jun 14 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_29.txt b/runtime/doc/usr_29.txt index a314256c1..20f72ea28 100644 --- a/runtime/doc/usr_29.txt +++ b/runtime/doc/usr_29.txt @@ -1,4 +1,4 @@ -*usr_29.txt* For Vim version 7.2a. Last change: 2007 Nov 10 +*usr_29.txt* For Vim version 7.2b. Last change: 2008 Jun 28 VIM USER MANUAL - by Bram Moolenaar @@ -594,8 +594,8 @@ use this command: > This will go back to the start of the current function and find the first occurrence of the word under the cursor. Actually, it searches backwards to -an empty line above the a "{" in the first column. From there it searches -forward for the identifier. Example (cursor on "idx"): +an empty line above a "{" in the first column. From there it searches forward +for the identifier. Example (cursor on "idx"): int find_entry(char *name) { diff --git a/runtime/doc/usr_30.txt b/runtime/doc/usr_30.txt index 499851135..51ffcdfae 100644 --- a/runtime/doc/usr_30.txt +++ b/runtime/doc/usr_30.txt @@ -1,4 +1,4 @@ -*usr_30.txt* For Vim version 7.2a. Last change: 2007 Nov 10 +*usr_30.txt* For Vim version 7.2b. Last change: 2007 Nov 10 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_31.txt b/runtime/doc/usr_31.txt index 941ab6895..403086fb8 100644 --- a/runtime/doc/usr_31.txt +++ b/runtime/doc/usr_31.txt @@ -1,4 +1,4 @@ -*usr_31.txt* For Vim version 7.2a. Last change: 2007 May 08 +*usr_31.txt* For Vim version 7.2b. Last change: 2007 May 08 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_32.txt b/runtime/doc/usr_32.txt index ed95a0d15..b049540bc 100644 --- a/runtime/doc/usr_32.txt +++ b/runtime/doc/usr_32.txt @@ -1,4 +1,4 @@ -*usr_32.txt* For Vim version 7.2a. Last change: 2006 Apr 30 +*usr_32.txt* For Vim version 7.2b. Last change: 2006 Apr 30 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_40.txt b/runtime/doc/usr_40.txt index dd90ba925..cc8acc184 100644 --- a/runtime/doc/usr_40.txt +++ b/runtime/doc/usr_40.txt @@ -1,4 +1,4 @@ -*usr_40.txt* For Vim version 7.2a. Last change: 2006 Jun 21 +*usr_40.txt* For Vim version 7.2b. Last change: 2006 Jun 21 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 38e511fa7..25e911ac7 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -1,4 +1,4 @@ -*usr_41.txt* For Vim version 7.2a. Last change: 2008 Jun 21 +*usr_41.txt* For Vim version 7.2b. Last change: 2008 Jun 21 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_42.txt b/runtime/doc/usr_42.txt index a40bf3b77..b8c4eea0e 100644 --- a/runtime/doc/usr_42.txt +++ b/runtime/doc/usr_42.txt @@ -1,4 +1,4 @@ -*usr_42.txt* For Vim version 7.2a. Last change: 2008 May 05 +*usr_42.txt* For Vim version 7.2b. Last change: 2008 May 05 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_43.txt b/runtime/doc/usr_43.txt index 65ac9b64b..dbf3b8671 100644 --- a/runtime/doc/usr_43.txt +++ b/runtime/doc/usr_43.txt @@ -1,4 +1,4 @@ -*usr_43.txt* For Vim version 7.2a. Last change: 2006 Apr 24 +*usr_43.txt* For Vim version 7.2b. Last change: 2006 Apr 24 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_44.txt b/runtime/doc/usr_44.txt index b9f29e3d2..19165d473 100644 --- a/runtime/doc/usr_44.txt +++ b/runtime/doc/usr_44.txt @@ -1,4 +1,4 @@ -*usr_44.txt* For Vim version 7.2a. Last change: 2006 Apr 24 +*usr_44.txt* For Vim version 7.2b. Last change: 2006 Apr 24 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_45.txt b/runtime/doc/usr_45.txt index 5c83d1ce4..5f6a14f05 100644 --- a/runtime/doc/usr_45.txt +++ b/runtime/doc/usr_45.txt @@ -1,4 +1,4 @@ -*usr_45.txt* For Vim version 7.2a. Last change: 2008 Apr 30 +*usr_45.txt* For Vim version 7.2b. Last change: 2008 Apr 30 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_90.txt b/runtime/doc/usr_90.txt index f80c0af32..24efda2e3 100644 --- a/runtime/doc/usr_90.txt +++ b/runtime/doc/usr_90.txt @@ -1,4 +1,4 @@ -*usr_90.txt* For Vim version 7.2a. Last change: 2006 Apr 24 +*usr_90.txt* For Vim version 7.2b. Last change: 2006 Apr 24 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/usr_toc.txt b/runtime/doc/usr_toc.txt index d649aca99..75f29ce6a 100644 --- a/runtime/doc/usr_toc.txt +++ b/runtime/doc/usr_toc.txt @@ -1,4 +1,4 @@ -*usr_toc.txt* For Vim version 7.2a. Last change: 2006 Apr 24 +*usr_toc.txt* For Vim version 7.2b. Last change: 2006 Apr 24 VIM USER MANUAL - by Bram Moolenaar diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index 16b2d0d1a..e8f4de16f 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -1,4 +1,4 @@ -*various.txt* For Vim version 7.2a. Last change: 2008 Jun 08 +*various.txt* For Vim version 7.2b. Last change: 2008 Jun 08 VIM REFERENCE MANUAL by Bram Moolenaar @@ -816,7 +816,7 @@ The second one finds the English user manual, even when 'helplang' is set to "it". When using command-line completion for the ":help" command, the "@en" -extention is only shown when a tag exists for multiple languages. When the +extension is only shown when a tag exists for multiple languages. When the tag only exists for English "@en" is omitted. When using |CTRL-]| or ":help!" in a non-English help file Vim will try to diff --git a/runtime/doc/version4.txt b/runtime/doc/version4.txt index 8211a8d1c..5eb624124 100644 --- a/runtime/doc/version4.txt +++ b/runtime/doc/version4.txt @@ -1,4 +1,4 @@ -*version4.txt* For Vim version 7.2a. Last change: 2006 Apr 24 +*version4.txt* For Vim version 7.2b. Last change: 2006 Apr 24 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/version5.txt b/runtime/doc/version5.txt index 538c24572..81205778d 100644 --- a/runtime/doc/version5.txt +++ b/runtime/doc/version5.txt @@ -1,4 +1,4 @@ -*version5.txt* For Vim version 7.2a. Last change: 2007 May 11 +*version5.txt* For Vim version 7.2b. Last change: 2008 Jun 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1992,7 +1992,7 @@ because the compare with other tags was wrong. E.g., when "mnuFileSave" was already there, "mnuFile" would be skipped. (Negri) When scrolling up/down, a syntax item with "keepend" didn't work properly. -Now the flags are also stored for the syntax state a the start of each line. +Now the flags are also stored for the syntax state at the start of each line. When 'ic' was changed while 'hlsearch' is on, there was no redraw to show the effect. @@ -3067,7 +3067,7 @@ character in the line, instead of just after it. 5.2.7: Win32 GUI: scrollbar was one pixel too big. -5.2.8: Completion of "PopUp" menu showed the derivates "PopUpc", "PopUPi", +5.2.8: Completion of "PopUp" menu showed the derivatives "PopUpc", "PopUPi", etc. ":menu" also showed these. 5.2.9: When using two input() functions on a row, the prompt would not be diff --git a/runtime/doc/version6.txt b/runtime/doc/version6.txt index 1f3699c1f..0ab4d1deb 100644 --- a/runtime/doc/version6.txt +++ b/runtime/doc/version6.txt @@ -1,4 +1,4 @@ -*version6.txt* For Vim version 7.2a. Last change: 2007 May 11 +*version6.txt* For Vim version 7.2b. Last change: 2007 May 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -13235,7 +13235,7 @@ Files: src/fileio.c Patch 6.2.499 Problem: When writing a file and halting the system, the file might be lost - when using a journalling file system. + when using a journaling file system. Solution: Use fsync() to flush the file data to disk after writing a file. (Radim Kolar) Files: src/fileio.c diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt index 786a0b325..7f450f427 100644 --- a/runtime/doc/version7.txt +++ b/runtime/doc/version7.txt @@ -1,4 +1,4 @@ -*version7.txt* For Vim version 7.2a. Last change: 2008 Jun 24 +*version7.txt* For Vim version 7.2b. Last change: 2008 Jul 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -263,7 +263,7 @@ Currently supported languages: Ruby |ft-ruby-omni| SQL |ft-sql-omni| XML |ft-xml-omni| - any language wih syntax highligting |ft-syntax-omni| + any language with syntax highlighting |ft-syntax-omni| You can add your own omni completion scripts. @@ -3397,7 +3397,7 @@ Solution: Include vim.h as before. (Mark S. Williams) Files: src/if_ole.cpp Patch 7.0.058 -Problem: The gbk and and gb18030 encodings are not recognized. +Problem: The gbk and gb18030 encodings are not recognized. Solution: Add aliases to cp936. (Edward L. Fox) Files: src/mbyte.c @@ -4655,27 +4655,35 @@ Moved including fcntl.h to vim.h and removed it from all .c files. Introduce macro STRMOVE(d, s), like STRCPY() for overlapping strings. Use it instead of mch_memmove(p, p + x, STRLEN(p + x) + 1). +Removed the bulgarian.vim keymap file, two more standard ones replace it. +(Boyko Bantchev) + +Increased the maximum number of tag matches for command line completion from +200 to 300. + Added *added-7.2* ----- New syntax files: + CUDA (Timothy B. Terriberry) Cdrdao config (Nikolai Weibull) Coco/R (Ashish Shukla) - CUDA (Timothy B. Terriberry) - denyhosts config (Nikolai Weibull) Dtrace script (Nicolas Weber) Git output, commit, config, rebase, send-email (Tim Pope) - HASTE (M. Tranchero) + HASTE and HastePreProc (M. Tranchero) + Haml (Tim Pope) Host conf (Nikolai Weibull) Linden script (Timo Frenay) - Symbian meta-makefile, MMP (Ron Aaron) MS messages (Kevin Locke) PDF (Tim Pope) ProMeLa (Maurizio Tranchero) Reva Foth (Ron Aaron) + Sass (Tim Pope) + Symbian meta-makefile, MMP (Ron Aaron) VOS CM macro (Andrew McGill) XBL (Doug Kearns) + denyhosts config (Nikolai Weibull) New tutor files: Made UTF-8 versions of all the tutor files. @@ -4690,21 +4698,31 @@ New filetype plugins: Dos .ini file (Nikolai Weibull) Dtrace script (Nicolas Weber) Git, Git config, Git commit, Git rebase, Git send-email (Tim Pope) + Haml (Tim Pope) Host conf (Nikolai Weibull) + Logtalk (Paulo Moura) MS messages (Kevin Locke) PDF (Tim Pope) Reva Forth (Ron Aaron) + Sass (Tim Pope) New indent files: Dtrace script (Nicolas Weber) Erlang (Csaba Hoch) Git config (Tim Pope) + Haml (Tim Pope) + Logtalk (Paulo Moura) + Sass (Tim Pope) Tiny Fugue (Christian J. Robinson) +New compiler plugins: + RSpec (Tim Pope) + New keymap files: Croatian (Paul B. Mahol) Russian Dvorak (Serhiy Boiko) Ukrainian Dvorak (Serhiy Boiko) + Removed plain Bulgarian, "bds" and phonetic are sufficient. Other new runtime files: Esperanto menus and message translations. (Dominique Pelle) @@ -5116,7 +5134,7 @@ Solution: Adjust ind_len. (Chris Lubinski) Files: src/misc1.c Patch 7.1.063 (after 7.1.040) -Problem: Warning for unitialized variable. +Problem: Warning for uninitialized variable. Solution: Initialise it to NULL. Files: src/ex_docmd.c @@ -5184,7 +5202,7 @@ Solution: Handle the situation that we start without indent. (Chris Files: src/misc1.c Patch 7.1.074 -Problem: Crash when calling string() on a recurively nested List. +Problem: Crash when calling string() on a recursively nested List. Solution: Check result value for being NULL. (Yukihiro Nakadaira) Files: src/eval.c @@ -5487,7 +5505,7 @@ Patch 7.1.124 (extra) Problem: Mac: When dropping a file on Vim.app that is already in the buffer list (from .viminfo) results in editing an empty, unnamed buffer. (Axel Kielhorn) Also: warning for unused variable. -Solution: Move to the buffer of the first agument. Delete unused variable. +Solution: Move to the buffer of the first argument. Delete unused variable. Files: src/gui_mac.c Patch 7.1.125 @@ -6098,7 +6116,7 @@ Solution: use set_option_value() to set 'rightleft'. Files: src/main.c Patch 7.1.225 -Problem: Using unitialized value when XGetWMNormalHints() fails. +Problem: Using uninitialized value when XGetWMNormalHints() fails. Solution: Check the return value. (Dominique Pelle) Files: src/os_unix.c @@ -6195,7 +6213,7 @@ Problem: When "gUe" turns a German sharp s into SS the operation stops not changed to SS there. Solution: Make sure all the characters are operated upon. Detect the sharp s in latin2. Also fixes that changing case of a multi-byte - character that changes the byte cound doesn't always work. + character that changes the byte count doesn't always work. Files: src/ops.c Patch 7.1.241 @@ -6350,7 +6368,7 @@ Solution: Assume the escape sequence ends in a letter. Files: src/term.c Patch 7.1.267 -Problem: When changing folds cursor may be posioned in the wrong place. +Problem: When changing folds cursor may be positioned in the wrong place. Solution: Call changed_window_setting_win() instead of changed_window_setting(). Files: src/fold.c @@ -6676,7 +6694,7 @@ Solution: Add the 'v' argument to getpos(). Files: runtime/doc/eval.txt, src/eval.c Patch 7.1.323 -Problem: Test 19 fails with some termcaps. (Dominque Pelle) +Problem: Test 19 fails with some termcaps. (Dominique Pelle) Solution: Set the t_kb and t_kD termcap values. Files: src/testdir/test19.in, src/testdir/test38.in @@ -6771,5 +6789,152 @@ Setting 'pastetoggle' to "jj" didn't work. 'ic' and 'smartcase' don't work properly when using \%V in a search pattern. (Kana Natsuno) +Patch 7.2a.001 +Problem: On some systems X11/Xlib.h exists (from X11-dev package) but + X11/Intrinsic.h does not (in Xt-dev package). This breaks the + build. Also, on Solaris 9 sys/ptem.h isn't found. +Solution: Have configure only accept X11 when X11/Intrinsic.h exists. + Check for sys/ptem.h while including sys/stream.h. (Vladimir + Marek) +Files: src/auto/configure, src/configure.in + +Patch 7.2a.002 +Problem: getbufvar(N, "") gets the dictionary of the current buffer instead + of buffer N. +Solution: Set curbuf before calling find_var_in_ht(). (Kana Natsuno) +Files: src/eval.c + +Patch 7.2a.003 +Problem: Leaking memory when using ":file name" and using access control + lists. +Solution: Invoke mch_free_acl() in vim_rename(). (Dominique Pelle) +Files: src/fileio.c + +Patch 7.2a.004 +Problem: Some systems can't get spell files by ftp. +Solution: Use http when it looks like it's possible. (James Vega) +Files: runtime/autoload/spellfile.vim + +Patch 7.2a.005 +Problem: A few error messages use confusing names. Misspelling. +Solution: Change "dissallows" to "disallows". (Dominique Pelle) Change + "number" to "Number". +Files: src/eval.c, src/fileio.c + +Patch 7.2a.006 +Problem: Reading past NUL in a string. +Solution: Check for invalid utf-8 byte sequence. (Dominique Pelle) +Files: src/charset.c + +Patch 7.2a.007 +Problem: ":let v = 1.2.3" was OK in Vim 7.1, now it gives an error. +Solution: Don't look for a floating point number after the "." operator. +Files: src/eval.c + +Patch 7.2a.008 +Problem: printf("%g", 1) doesn't work. +Solution: Convert Number to Float when needed. +Files: src/message.c + +Patch 7.2a.009 +Problem: cygwin_conv_to_posix_path() does not specify buffer size. +Solution: Use new Cygwin function: cygwin_conv_path(). (Corinna Vinschen) +Files: src/main.c, src/os_unix.c + +Patch 7.2a.010 +Problem: When a file name has an illegal byte sequence Vim may read + uninitialised memory. +Solution: Don't use UTF_COMPOSINGLIKE() on an illegal byte. In + msg_outtrans_len_attr() use char2cells() instead of ptr2cells(). + In utf_ptr2char() don't check second byte when first byte is + illega. (Dominique Pelle) +Files: src/mbyte.c, src/message.c + +Patch 7.2a.011 +Problem: The Edit/Startup Settings menu doesn't work. +Solution: Expand environment variables. (Ben Schmidt) +Files: runtime/menu.vim + +Patch 7.2a.012 +Problem: Compiler warnings for casting int to pointer. +Solution: Add cast to long in between. (Martin Toft) +Files: src/gui_gtk_x11.c + +Patch 7.2a.013 +Problem: shellescape() does not escape "%" and "#" characters. +Solution: Add find_cmdline_var() and use it when the second argument to + shellescape() is non-zero. +Files: runtime/doc/eval.txt, src/eval.c, src/ex_docmd.c, + src/proto/ex_docmd.pro, src/proto/misc2.pro, src/misc2.c + +Patch 7.2a.014 +Problem: Problem with % in message. +Solution: Put % in single quotes. +Files: src/eval.c + +Patch 7.2a.015 (after 7.2a.010) +Problem: Misaligned messages. +Solution: Compute length of unprintable chars correctly. +Files: src/message.c + +Patch 7.2a.016 +Problem: Using CTRL-W v in the quickfix window results in two quickfix + windows, which is not allowed. ":tab split" should be allowed to + open a new quickfix window in another tab. +Solution: For CTRL-W v instead of splitting the window open a new one. + When using ":tab" do allow splitting the quickfix window (was + already included in patch 7.2a.013). +Files: src/window.c + +Patch 7.2a.017 +Problem: ":doautoall" executes autocommands for all buffers instead of just + for loaded buffers. +Solution: Change "curbuf" to "buf". +Files: src/fileio.c + +Patch 7.2a.018 +Problem: Compiler warnings when compiling with Gnome. (Tony Mechelynck) +Solution: Add type casts. +Files: src/gui_gtk_x11.c + +Patch 7.2a.019 +Problem: ":let &g:tw = 44" sets the local option value. (Cyril Slobin) +Solution: Use get_varp_scope() instead of get_varp(). (Ian Kelling) +Files: src/option.c + +There is no way to avoid adding /usr/local/{include|lib} to the build +commands. Add the --with-local-dir argument to configure. (Michael +Haubenwallner) + +When using CTRL-D after ":help", the number of matches could be thousands. +Restrict to TAG_MANY to avoid this taking too long. (Ian Kelling) + +The popup menu could be placed at a weird location. Caused by w_wcol computed +by curs_columns(). (Dominique Pelle) + +Overlapping STRCPY() arguments when using %r item in 'errorformat'. Use +STRMOVE() instead. (Ralf Wildenhues) + +Mac: On Leopard gvim, when using the mouse wheel nothing would happen until +another event occures, such as moving the mouse. Then the recorded scrolling +would take place all at once. (Eckehard Berns) + +Solution for cursor color not reflecting IM status for GTK 2. Add +preedit_is_active flag. (SungHyun Nam) + +filereadable() can hang on a FIFO on Linux. Use open() instead of fopen(), +with O_NONBLOCK. (suggested by Lars Kotthoff) + +Included patch to support Perl 5.10. (Yasuhiro Matsumoto) + +When files are dropped on gvim while the screen is being updated, ignore the +drop command to avoid freeing memory that is being used. + +In a terminal, when drawing the popup menu over double-wide characters, half +characters may not be cleared properly. (Yukihiro Nakadaira) + +The #ifdef for including "vimio.h" was inconsistent. In a few files it +depended on MSWIN, which isn't defined until later. + vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt index df1452d2c..bd5df64dc 100644 --- a/runtime/doc/vi_diff.txt +++ b/runtime/doc/vi_diff.txt @@ -1,4 +1,4 @@ -*vi_diff.txt* For Vim version 7.2a. Last change: 2008 May 05 +*vi_diff.txt* For Vim version 7.2b. Last change: 2008 Jun 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -383,7 +383,7 @@ Improved indenting for programs. |'cindent'| Searching for words in included files. |include-search| The |[i| command can be used to search for a match of the word under the cursor in the current and included files. The 'include' option - can be set the a pattern that describes a command to include a file + can be set to a pattern that describes a command to include a file (the default is for C programs). The |[I| command lists all matches, the |[_CTRL-I| command jumps to a match. diff --git a/runtime/doc/visual.txt b/runtime/doc/visual.txt index 4858bb88b..fca71f360 100644 --- a/runtime/doc/visual.txt +++ b/runtime/doc/visual.txt @@ -1,4 +1,4 @@ -*visual.txt* For Vim version 7.2a. Last change: 2006 Sep 26 +*visual.txt* For Vim version 7.2b. Last change: 2006 Sep 26 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index dc9c20ccb..40e98c441 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -1,4 +1,4 @@ -*windows.txt* For Vim version 7.2a. Last change: 2007 Oct 07 +*windows.txt* For Vim version 7.2b. Last change: 2008 Jul 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -190,8 +190,8 @@ CTRL-W CTRL_N *CTRL-W_CTRL-N* Same as ":split", but set 'readonly' option for this buffer. :[N]sf[ind] [++opt] [+cmd] {file} *:sf* *:sfind* *splitfind* - Same as ":split", but search for {file} in 'path'. Doesn't - split if {file} is not found. + Same as ":split", but search for {file} in 'path' like in + |:find|. Doesn't split if {file} is not found. CTRL-W CTRL-^ *CTRL-W_CTRL-^* *CTRL-W_^* CTRL-W ^ Does ":split #", split window in two and edit alternate file. diff --git a/runtime/doc/workshop.txt b/runtime/doc/workshop.txt index c14bf718a..e67685256 100644 --- a/runtime/doc/workshop.txt +++ b/runtime/doc/workshop.txt @@ -1,4 +1,4 @@ -*workshop.txt* For Vim version 7.2a. Last change: 2006 Apr 24 +*workshop.txt* For Vim version 7.2b. Last change: 2006 Apr 24 VIM REFERENCE MANUAL by Gordon Prieur diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 89af04cce..2ba2bfe69 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2008 Jun 20 +" Last Change: 2008 Jul 08 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -17,7 +17,7 @@ augroup filetypedetect " Ignored extensions if exists("*fnameescape") -au BufNewFile,BufRead ?\+.orig,?\+.bak,?\+.old,?\+.new,?\+.rpmsave,?\+.rpmnew +au BufNewFile,BufRead ?\+.orig,?\+.bak,?\+.old,?\+.new,?\+.dpkg-dist,?\+.dpkg-old,?\+.rpmsave,?\+.rpmnew \ exe "doau filetypedetect BufRead " . fnameescape(expand("<afile>:r")) au BufNewFile,BufRead *~ \ let s:name = expand("<afile>") | @@ -633,7 +633,7 @@ func! s:FTe() endfunc " ERicsson LANGuage; Yaws is erlang too -au BufNewFile,BufRead *.erl,*.yaws setf erlang +au BufNewFile,BufRead *.erl,*.hrl,*.yaws setf erlang " Elm Filter Rules file au BufNewFile,BufRead filter-rules setf elmfilt @@ -739,11 +739,14 @@ au BufNewFile,BufRead *.groovy setf groovy au BufNewFile,BufRead *.gsp setf gsp " Group file -au BufNewFile,BufRead /etc/group setf group +au BufNewFile,BufRead /etc/group,/etc/group-,/etc/group.edit,/etc/gshadow,/etc/gshadow-,/etc/gshadow.edit,/var/backups/group.bak,/var/backups/gshadow.bak setf group " GTK RC au BufNewFile,BufRead .gtkrc,gtkrc setf gtkrc +" Haml +au BufNewFile,BufRead *.haml setf haml + " Hamster Classic | Playground files au BufNewFile,BufRead *.hsc,*.hsm setf hamster @@ -754,6 +757,7 @@ au BufNewFile,BufRead *.chs setf chaskell " Haste au BufNewFile,BufRead *.ht setf haste +au BufNewFile,BufRead *.htpp setf hastepreproc " Hercules au BufNewFile,BufRead *.vc,*.ev,*.rs,*.sum,*.errsum setf hercules @@ -1016,6 +1020,9 @@ au BufNewFile,BufRead /etc/man.conf,man.config setf manconf " Maple V au BufNewFile,BufRead *.mv,*.mpl,*.mws setf maple +" Map (UMN mapserver config file) +au BufNewFile,BufRead *.map setf map + " Mason au BufNewFile,BufRead *.mason,*.mhtml setf mason @@ -1226,7 +1233,7 @@ au BufNewFile,BufRead /etc/pam.conf setf pamconf au BufNewFile,BufRead *.papp,*.pxml,*.pxsl setf papp " Password file -au BufNewFile,BufRead /etc/passwd,/etc/shadow,/etc/shadow- setf passwd +au BufNewFile,BufRead /etc/passwd,/etc/passwd-,/etc/passwd.edit,/etc/shadow,/etc/shadow-,/var/backups/passwd.bak,/var/backups/shadow.bak setf passwd " Pascal (also *.p) au BufNewFile,BufRead *.pas setf pascal @@ -1572,6 +1579,9 @@ au BufNewFile,BufRead smb.conf setf samba " SAS script au BufNewFile,BufRead *.sas setf sas +" Sass +au BufNewFile,BufRead *.sass setf sass + " Sather au BufNewFile,BufRead *.sa setf sather @@ -1796,7 +1806,7 @@ au BufNewFile,BufRead *.rules call s:FTRules() let s:ft_rules_udev_rules_pattern = '^\s*\cudev_rules\s*=\s*"\([^"]\{-1,}\)/*".*' func! s:FTRules() - if expand('<amatch>:p') =~ '^/etc/udev/rules\.d/.*\.rules$' + if expand('<amatch>:p') =~ '^/etc/udev/\%(rules\.d/\)\=.*\.rules$' setf udevrules return endif @@ -2257,6 +2267,9 @@ au StdinReadPost * if !did_filetype() | runtime! scripts.vim | endif " Most of these should call s:StarSetf() to avoid names ending in .gz and the " like are used. +" More Apache files. +au BufNewFile,BufRead /etc/apache2/conf.*/*,/etc/apache2/sites-*/*,/etc/apache2/mods-*/* call s:StarSetf('apache') + " Asterisk config file au BufNewFile,BufRead *asterisk/*.conf* call s:StarSetf('asterisk') au BufNewFile,BufRead *asterisk*/*voicemail.conf* call s:StarSetf('asteriskvm') @@ -2276,7 +2289,7 @@ au BufNewFile,BufRead [cC]hange[lL]og* \|endif " Crontab -au BufNewFile,BufRead crontab,crontab.* call s:StarSetf('crontab') +au BufNewFile,BufRead crontab,crontab.*,/etc/cron.d/* call s:StarSetf('crontab') " Debian Sources.list au BufNewFile,BufRead /etc/apt/sources.list.d/* call s:StarSetf('debsources') diff --git a/runtime/ftplugin/ada.vim b/runtime/ftplugin/ada.vim index 688cf97f7..045645dda 100644 --- a/runtime/ftplugin/ada.vim +++ b/runtime/ftplugin/ada.vim @@ -2,13 +2,14 @@ " Description: Perform Ada specific completion & tagging. " Language: Ada (2005) " $Id$ -" Maintainer: Martin Krischik +" Maintainer: Martin Krischik <krischik@users.sourceforge.net> +" Taylor Venable <taylor@metasyntax.net> " Neil Bird <neil@fnxweb.com> " $Author$ " $Date$ -" Version: 4.2 +" Version: 4.6 " $Revision$ -" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/ftplugin/ada.vim $ +" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/ftplugin/ada.vim $ " History: 24.05.2006 MK Unified Headers " 26.05.2006 MK ' should not be in iskeyword. " 16.07.2006 MK Ada-Mode as vim-ball @@ -17,6 +18,7 @@ " 05.11.2006 MK Bram suggested not to use include protection for " autoload " 05.11.2006 MK Bram suggested to save on spaces +" 08.07.2007 TV fix default compiler problems. " Help Page: ft-ada-plugin "------------------------------------------------------------------------------ " Provides mapping overrides for tag jumping that figure out the current @@ -30,7 +32,7 @@ if exists ("b:did_ftplugin") || version < 700 endif " Don't load another plugin for this buffer -let b:did_ftplugin = 38 +let b:did_ftplugin = 45 " " Temporarily set cpoptions to ensure the script loads OK @@ -38,12 +40,21 @@ let b:did_ftplugin = 38 let s:cpoptions = &cpoptions set cpoptions-=C -" Section: Comments {{{1 +" Section: Comments {{{1 " setlocal comments=O:--,:--\ \ setlocal commentstring=--\ \ %s setlocal complete=.,w,b,u,t,i +" Section: case {{{1 +" +setlocal nosmartcase +setlocal ignorecase + +" Section: formatoptions {{{1 +" +setlocal formatoptions+=ron + " Section: Tagging {{{1 " if exists ("g:ada_extended_tagging") @@ -104,8 +115,17 @@ if !exists ("b:match_words") && \ s:notend . '\<record\>:\<end\>\s\+\<record\>' endif + " Section: Compiler {{{1 " +if ! exists("g:ada_default_compiler") + if has("vms") + let g:ada_default_compiler = 'decada' + else + let g:ada_default_compiler = 'gnat' + endif +endif + if ! exists("current_compiler") || \ current_compiler != g:ada_default_compiler execute "compiler " . g:ada_default_compiler diff --git a/runtime/ftplugin/debchangelog.vim b/runtime/ftplugin/debchangelog.vim index cd5b07162..00a025b47 100644 --- a/runtime/ftplugin/debchangelog.vim +++ b/runtime/ftplugin/debchangelog.vim @@ -7,6 +7,9 @@ " License: GNU GPL, version 2.0 or later " URL: http://git.debian.org/?p=pkg-vim/vim.git;a=blob_plain;f=runtime/ftplugin/debchangelog.vim;hb=debian +" Bug completion requires apt-listbugs installed for Debian packages or +" python-launchpad-bugs installed for Ubuntu packages + if exists("b:did_ftplugin") finish endif @@ -116,7 +119,9 @@ function NewVersion() normal h normal call setline(1, substitute(getline(1), '-\$\$', '-', '')) - normal zo + if exists("g:debchangelog_fold_enable") + foldopen + endif call AddEntry() endfunction @@ -279,7 +284,9 @@ function! DebGetChangelogFold(lnum) return '=' endfunction -silent! foldopen! " unfold the entry the cursor is on (usually the first one) +if exists("g:debchangelog_fold_enable") + silent! foldopen! " unfold the entry the cursor is on (usually the first one) +endif " }}} @@ -291,27 +298,65 @@ endif fun! DebCompleteBugs(findstart, base) if a:findstart - " it we are just after an '#', the completion should start at the '#', - " otherwise no completion is possible let line = getline('.') - let colidx = col('.') - if colidx > 1 && line[colidx - 2] =~ '#' - let colidx = colidx - 2 - else - let colidx = -1 - endif + + " try to detect whether this is closes: or lp: + let g:debchangelog_complete_mode = 'debbugs' + let try_colidx = col('.') - 1 + let colidx = -1 " default to no-completion-possible + + while try_colidx > 0 && line[try_colidx - 1] =~ '\s\|\d\|#\|,\|:' + let try_colidx = try_colidx - 1 + if line[try_colidx] == '#' && colidx == -1 + " found hash, where we complete from: + let colidx = try_colidx + elseif line[try_colidx] == ':' + if try_colidx > 1 && strpart(line, try_colidx - 2, 3) =~ '\clp:' + let g:debchangelog_complete_mode = 'lp' + endif + break + endif + endwhile return colidx - else - if ! filereadable('/usr/sbin/apt-listbugs') - echoerr 'apt-listbugs not found, you should install it to use Closes bug completion' - return + else " return matches: + let bug_lines = [] + if g:debchangelog_complete_mode == 'lp' + if ! has('python') + echoerr 'vim must be built with Python support to use LP bug completion' + return + endif + let pkgsrc = DebGetPkgSrcName(line('.')) + python << EOF +import vim +try: + from launchpadbugs import connector + buglist = connector.ConnectBugList() + bl = list(buglist('https://bugs.launchpad.net/ubuntu/+source/%s' % vim.eval('pkgsrc'))) + bl.sort(None, int) + liststr = '[' + for bug in bl: + liststr += "'#%d - %s'," % (int(bug), bug.summary.replace('\'', '\'\'')) + liststr += ']' + vim.command('silent let bug_lines = %s' % liststr) +except ImportError: + vim.command('echoerr \'python-launchpad-bugs needs to be installed to use Launchpad bug completion\'') +EOF + else + if ! filereadable('/usr/sbin/apt-listbugs') + echoerr 'apt-listbugs not found, you should install it to use Closes bug completion' + return + endif + let pkgsrc = DebGetPkgSrcName(line('.')) + let listbugs_output = system('/usr/sbin/apt-listbugs -s ' . g:debchangelog_listbugs_severities . ' list ' . pkgsrc . ' | grep "^ #" 2> /dev/null') + let bug_lines = split(listbugs_output, '\n') endif - let pkgsrc = DebGetPkgSrcName(line('.')) - let listbugs_output = system('apt-listbugs -s ' . g:debchangelog_listbugs_severities . ' list ' . pkgsrc . ' | grep "^ #" 2> /dev/null') - let bug_lines = split(listbugs_output, '\n') let completions = [] for line in bug_lines let parts = matchlist(line, '^\s*\(#\S\+\)\s*-\s*\(.*\)$') + " filter only those which match a:base: + if parts[1] !~ "^" . a:base + continue + endif let completion = {} let completion['word'] = parts[1] let completion['menu'] = parts[2] diff --git a/runtime/ftplugin/eruby.vim b/runtime/ftplugin/eruby.vim index 8b189df52..802f596e3 100644 --- a/runtime/ftplugin/eruby.vim +++ b/runtime/ftplugin/eruby.vim @@ -27,7 +27,7 @@ if !exists("b:eruby_subtype") let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+') if b:eruby_subtype == '' - let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\)\+$','',''),'\.\zs\w\+$') + let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\)\+$','',''),'\.\zs\w\+$') endif if b:eruby_subtype == 'rhtml' let b:eruby_subtype = 'html' diff --git a/runtime/ftplugin/git.vim b/runtime/ftplugin/git.vim index 37888b15b..f8d331faf 100644 --- a/runtime/ftplugin/git.vim +++ b/runtime/ftplugin/git.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: generic git output " Maintainer: Tim Pope <vimNOSPAM@tpope.info> -" Last Change: 2008 Feb 27 +" Last Change: 2008 Jun 20 " Only do this when not done yet for this buffer if (exists("b:did_ftplugin")) @@ -15,7 +15,7 @@ if !exists('b:git_dir') elseif $GIT_DIR != '' let b:git_dir = $GIT_DIR endif - if has('win32') || has('win64') + if (has('win32') || has('win64')) && exists('b:git_dir') let b:git_dir = substitute(b:git_dir,'\\','/','g') endif endif diff --git a/runtime/ftplugin/haml.vim b/runtime/ftplugin/haml.vim new file mode 100644 index 000000000..0a39d5ef3 --- /dev/null +++ b/runtime/ftplugin/haml.vim @@ -0,0 +1,66 @@ +" Vim filetype plugin +" Language: Haml +" Maintainer: Tim Pope <vimNOSPAM@tpope.info> + +" Only do this when not done yet for this buffer +if exists("b:did_ftplugin") + finish +endif + +let s:save_cpo = &cpo +set cpo-=C + +" Define some defaults in case the included ftplugins don't set them. +let s:undo_ftplugin = "" +let s:browsefilter = "All Files (*.*)\t*.*\n" +let s:match_words = "" + +runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim +unlet! b:did_ftplugin + +" Override our defaults if these were set by an included ftplugin. +if exists("b:undo_ftplugin") + let s:undo_ftplugin = b:undo_ftplugin + unlet b:undo_ftplugin +endif +if exists("b:browsefilter") + let s:browsefilter = b:browsefilter + unlet b:browsefilter +endif +if exists("b:match_words") + let s:match_words = b:match_words + unlet b:match_words +endif + +runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim +let b:did_ftplugin = 1 + +" Combine the new set of values with those previously included. +if exists("b:undo_ftplugin") + let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin +endif +if exists ("b:browsefilter") + let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter +endif +if exists("b:match_words") + let s:match_words = b:match_words . ',' . s:match_words +endif + +" Change the browse dialog on Win32 to show mainly Haml-related files +if has("gui_win32") + let b:browsefilter="Haml Files (*.haml)\t*.haml\nSass Files (*.sass)\t*.sass\n" . s:browsefilter +endif + +" Load the combined list of match_words for matchit.vim +if exists("loaded_matchit") + let b:match_words = s:match_words +endif + +setlocal commentstring=-#\ %s + +let b:undo_ftplugin = "setl cms< com< " + \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin + +let &cpo = s:save_cpo + +" vim:set sw=2: diff --git a/runtime/ftplugin/logtalk.dict b/runtime/ftplugin/logtalk.dict new file mode 100644 index 000000000..e3b9e6f2a --- /dev/null +++ b/runtime/ftplugin/logtalk.dict @@ -0,0 +1,164 @@ +encoding +calls +category +dynamic +end_category +end_object +end_protocol +info +initialization +object +protocol +synchronized +threaded +uses +alias +discontiguous +meta_predicate +mode +op +private +protected +public +current_object +current_protocol +current_category +object_property +protocol_property +category_property +create_object +create_protocol +create_category +abolish_object +abolish_protocol +abolish_category +complements +complements_object +extends +extends_object +extends_protocol +extends_category +implements +implements_protocol +imports +imports_category +instantiates +instantiates_class +specializes +specializes_class +abolish_events +current_event +define_events +logtalk_load +logtalk_compile +logtalk_library_path +current_logtalk_flag +set_logtalk_flag +threaded_call +threaded_once +threaded_ignore +threaded_exit +threaded_peek +threaded_wait +threaded_notify +self +this +sender +parameter +before +after +phrase +expand_term +goal_expansion +term_expansion +true +fail +call +catch +throw +unify_with_occurs_check +var +atom +integer +float +atomic +compound +nonvar +number +arg +copy_term +functor +current_predicate +predicate_property +abolish +assertz +asserta +clause +retract +retractall +bagof +findall +forall +setof +current_input +current_output +set_input +set_output +open +close +flush_output +stream_property +at_end_of_stream +set_stream_position +get_char +get_code +peek_char +peek_code +put_char +put_code +nl +get_byte +peek_byte +put_byte +read +read_term +write +writeq +write_canonical +atom_chars +atom_codes +atom_concat +number_chars +number_codes +current_op +char_conversion +current_char_conversion +once +repeat +atom_length +atom_concat +sub_atom +atom_chars +atom_codes +char_code +number_chars +number_codes +set_prolog_flag +current_prolog_flag +halt +abs +atan +ceiling +cos +exp +float_fractional_part +float_integer_part +floor +log +mod +rem +round +sign +sin +sqrt +truncate diff --git a/runtime/ftplugin/logtalk.vim b/runtime/ftplugin/logtalk.vim new file mode 100644 index 000000000..e71307a39 --- /dev/null +++ b/runtime/ftplugin/logtalk.vim @@ -0,0 +1,18 @@ +" Logtalk filetype plugin file +" Language: Logtalk +" Maintainer: Paulo Moura <pmoura@logtalk.org> +" Latest Revision: 2007-07-06 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let b:undo_ftplugin = "setl ts< sw< fdm< fdc< ai< dict<" + +"setlocal ts=4 +setlocal sw=4 +setlocal fdm=syntax +setlocal fdc=2 +setlocal autoindent +setlocal dict=$VIMRUNTIME/ftplugin/logtalk.dict diff --git a/runtime/ftplugin/sass.vim b/runtime/ftplugin/sass.vim new file mode 100644 index 000000000..ad039772a --- /dev/null +++ b/runtime/ftplugin/sass.vim @@ -0,0 +1,18 @@ +" Vim filetype plugin +" Language: Sass +" Maintainer: Tim Pope <vimNOSPAM@tpope.info> + +" Only do this when not done yet for this buffer +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let b:undo_ftplugin = "setl cms< inc< ofu<" + +setlocal commentstring=//\ %s +setlocal omnifunc=csscomplete#CompleteCSS + +let &l:include = '^\s*@import\s\+\%(url(\)\=' + +" vim:set sw=2: diff --git a/runtime/indent/ada.vim b/runtime/indent/ada.vim index f2fc1ab4b..e56aaffec 100644 --- a/runtime/indent/ada.vim +++ b/runtime/indent/ada.vim @@ -3,17 +3,19 @@ " Language: Ada (2005) " $Id$ " Copyright: Copyright (C) 2006 Martin Krischik -" Maintainer: Martin Krischik +" Maintainer: Martin Krischik <krischik@users.sourceforge.net> " Neil Bird <neil@fnxweb.com> +" Ned Okie <nokie@radford.edu> " $Author$ " $Date$ -" Version: 4.2 +" Version: 4.6 " $Revision$ -" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/indent/ada.vim $ +" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/indent/ada.vim $ " History: 24.05.2006 MK Unified Headers " 16.07.2006 MK Ada-Mode as vim-ball " 15.10.2006 MK Bram's suggestion for runtime integration " 05.11.2006 MK Bram suggested to save on spaces +" 19.09.2007 NO g: missing before ada#Comment " Help Page: ft-vim-indent "------------------------------------------------------------------------------ " ToDo: @@ -27,7 +29,7 @@ if exists("b:did_indent") || version < 700 finish endif -let b:did_indent = 1 +let b:did_indent = 45 setlocal indentexpr=GetAdaIndent() setlocal indentkeys-=0{,0} @@ -58,7 +60,7 @@ endif " Seems to work OK as it 'starts' with the indent of the /previous/ line. function s:MainBlockIndent (prev_indent, prev_lnum, blockstart, stop_at) let lnum = a:prev_lnum - let line = substitute( getline(lnum), ada#Comment, '', '' ) + let line = substitute( getline(lnum), g:ada#Comment, '', '' ) while lnum > 1 if a:stop_at != '' && line =~ '^\s*' . a:stop_at && indent(lnum) < a:prev_indent return a:prev_indent @@ -72,7 +74,7 @@ function s:MainBlockIndent (prev_indent, prev_lnum, blockstart, stop_at) let lnum = prevnonblank(lnum - 1) " Get previous non-blank/non-comment-only line while 1 - let line = substitute( getline(lnum), ada#Comment, '', '' ) + let line = substitute( getline(lnum), g:ada#Comment, '', '' ) if line !~ '^\s*$' && line !~ '^\s*#' break endif @@ -116,7 +118,7 @@ function s:EndBlockIndent( prev_indent, prev_lnum, blockstart, blockend ) " Get previous non-blank/non-comment-only line while 1 let line = getline(lnum) - let line = substitute( line, ada#Comment, '', '' ) + let line = substitute( line, g:ada#Comment, '', '' ) if line !~ '^\s*$' break endif @@ -143,7 +145,8 @@ function s:StatementIndent( current_indent, prev_lnum ) let lnum = prevnonblank(lnum - 1) " Get previous non-blank/non-comment-only line while 1 - let line = substitute( getline(lnum), ada#Comment, '', '' ) + let line = substitute( getline(lnum), g:ada#Comment, '', '' ) + if line !~ '^\s*$' && line !~ '^\s*#' break endif @@ -222,7 +225,7 @@ function GetAdaIndent() exe lnum exe 'normal! $F)%' if getline('.') =~ '^\s*(' - " Dire layout - use previous indent (could check for ada#Comment here) + " Dire layout - use previous indent (could check for g:ada#Comment here) let ind = indent( prevnonblank( line('.')-1 ) ) else let ind = indent('.') diff --git a/runtime/indent/eruby.vim b/runtime/indent/eruby.vim index 83d010ef6..31cbb8b01 100644 --- a/runtime/indent/eruby.vim +++ b/runtime/indent/eruby.vim @@ -12,7 +12,7 @@ endif runtime! indent/ruby.vim unlet! b:did_indent -set indentexpr= +setlocal indentexpr= if exists("b:eruby_subtype") exe "runtime! indent/".b:eruby_subtype.".vim" @@ -40,12 +40,17 @@ if exists("*GetErubyIndent") finish endif -function! GetErubyIndent() +function! GetErubyIndent(...) + if a:0 && a:1 == '.' + let v:lnum = line('.') + elseif a:0 && a:1 =~ '^\d' + let v:lnum = a:1 + endif let vcol = col('.') call cursor(v:lnum,1) let inruby = searchpair('<%','','%>','W') call cursor(v:lnum,vcol) - if inruby && getline(v:lnum) !~ '^<%' + if inruby && getline(v:lnum) !~ '^<%\|^\s*-\=%>' let ind = GetRubyIndent() else exe "let ind = ".b:eruby_subtype_indentexpr @@ -53,15 +58,15 @@ function! GetErubyIndent() let lnum = prevnonblank(v:lnum-1) let line = getline(lnum) let cline = getline(v:lnum) - if cline =~# '<%\s*\%(end\|else\|\%(ensure\|rescue\|elsif\|when\).\{-\}\)\s*\%(-\=%>\|$\)' + if cline =~# '<%-\=\s*\%(}\|end\|else\|\%(ensure\|rescue\|elsif\|when\).\{-\}\)\s*\%(-\=%>\|$\)' let ind = ind - &sw endif - if line =~# '\<do\%(\s*|[^|]*|\)\=\s*-\=%>' + if line =~# '\%({\|\<do\)\%(\s*|[^|]*|\)\=\s*-\=%>' let ind = ind + &sw - elseif line =~# '<%\s*\%(module\|class\|def\|if\|for\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\)\>.*%>' + elseif line =~# '<%-\=\s*\%(module\|class\|def\|if\|for\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\)\>.*%>' let ind = ind + &sw endif - if line =~# '^\s*<%[=#]\=\s*$' && cline !~# '^\s*end\>' + if line =~# '^\s*<%[=#-]\=\s*$' && cline !~# '^\s*end\>' let ind = ind + &sw endif if cline =~# '^\s*-\=%>\s*$' diff --git a/runtime/indent/haml.vim b/runtime/indent/haml.vim new file mode 100644 index 000000000..c1feee09a --- /dev/null +++ b/runtime/indent/haml.vim @@ -0,0 +1,73 @@ +" Vim indent file +" Language: HAML +" Maintainer: Tim Pope <vimNOSPAM@tpope.info> +" Last Change: 2007 Dec 16 + +if exists("b:did_indent") + finish +endif +runtime! indent/ruby.vim +unlet! b:did_indent +let b:did_indent = 1 + +setlocal autoindent sw=2 et +setlocal indentexpr=GetHamlIndent() +setlocal indentkeys=o,O,*<Return>,},],0),!^F,=end,=else,=elsif,=rescue,=ensure,=when + +" Only define the function once. +if exists("*GetHamlIndent") + finish +endif + +let s:attributes = '\%({.\{-\}}\|\[.\{-\}\]\)' +let s:tag = '\%([%.#][[:alnum:]_-]\+\|'.s:attributes.'\)*[<>]*' + +if !exists('g:haml_self_closing_tags') + let g:haml_self_closing_tags = 'meta|link|img|hr|br' +endif + +function! GetHamlIndent() + let lnum = prevnonblank(v:lnum-1) + if lnum == 0 + return 0 + endif + let line = substitute(getline(lnum),'\s\+$','','') + let cline = substitute(substitute(getline(v:lnum),'\s\+$','',''),'^\s\+','','') + let lastcol = strlen(line) + let line = substitute(line,'^\s\+','','') + let indent = indent(lnum) + let cindent = indent(v:lnum) + if cline =~# '\v^-\s*%(elsif|else|when)>' + let indent = cindent < indent ? cindent : indent - &sw + endif + let increase = indent + &sw + if indent == indent(lnum) + let indent = cindent <= indent ? -1 : increase + endif + "let indent = indent == indent(lnum) ? -1 : indent + "let indent = indent > indent(lnum) + &sw ? indent(lnum) + &sw : indent + + let group = synIDattr(synID(lnum,lastcol,1),'name') + + if line =~ '^!!!' + return indent + elseif line =~ '^/\%(\[[^]]*\]\)\=$' + return increase + elseif line =~ '^:' + return increase + elseif line =~ '^'.s:tag.'[=~-]\s*\%(\%(if\|else\|elsif\|unless\|case\|when\|while\|until\|for\|begin\|module\|class\|def\)\>\%(.*\<end\>\)\@!\|.*do |[^|]*|\s*$\)' + return increase + elseif line == '-#' + return increase + elseif group =~? '\v^(hamlSelfCloser)$' || line =~? '^%\v%('.g:haml_self_closing_tags.')>' + return indent + elseif group =~? '\v^%(hamlTag|hamlAttributesDelimiter|hamlObjectDelimiter|hamlClass|hamlId|htmlTagName|htmlSpecialTagName)$' + return increase + elseif synIDattr(synID(v:lnum,1,1),'name') ==? 'hamlRubyFilter' + return GetRubyIndent() + else + return indent + endif +endfunction + +" vim:set sw=2: diff --git a/runtime/indent/logtalk.vim b/runtime/indent/logtalk.vim new file mode 100644 index 000000000..99e6ec896 --- /dev/null +++ b/runtime/indent/logtalk.vim @@ -0,0 +1,61 @@ +" Maintainer: Paulo Moura <pmoura@logtalk.org> +" Revised on: 2008.06.02 +" Language: Logtalk + +" This Logtalk indent file is a modified version of the Prolog +" indent file written by Gergely Kontra + +" Only load this indent file when no other was loaded. +if exists("b:did_indent") + finish +endif + +let b:did_indent = 1 + +setlocal indentexpr=GetLogtalkIndent() +setlocal indentkeys-=:,0# +setlocal indentkeys+=0%,-,0;,>,0) + +" Only define the function once. +if exists("*GetLogtalkIndent") + finish +endif + +function! GetLogtalkIndent() + " Find a non-blank line above the current line. + let pnum = prevnonblank(v:lnum - 1) + " Hit the start of the file, use zero indent. + if pnum == 0 + return 0 + endif + let line = getline(v:lnum) + let pline = getline(pnum) + + let ind = indent(pnum) + " Previous line was comment -> use previous line's indent + if pline =~ '^\s*%' + retu ind + endif + " Check for entity opening directive on previous line + if pline =~ '^\s*:-\s\(object\|protocol\|category\)\ze(.*,$' + let ind = ind + &sw + " Check for clause head on previous line + elseif pline =~ ':-\s*\(%.*\)\?$' + let ind = ind + &sw + " Check for entity closing directive on previous line + elseif pline =~ '^\s*:-\send_\(object\|protocol\|category\)\.\(%.*\)\?$' + let ind = ind - &sw + " Check for end of clause on previous line + elseif pline =~ '\.\s*\(%.*\)\?$' + let ind = ind - &sw + endif + " Check for opening conditional on previous line + if pline =~ '^\s*\([(;]\|->\)' && pline !~ '\.\s*\(%.*\)\?$' && pline !~ '^.*\([)][,]\s*\(%.*\)\?$\)' + let ind = ind + &sw + endif + " Check for closing an unclosed paren, or middle ; or -> + if line =~ '^\s*\([);]\|->\)' + let ind = ind - &sw + endif + return ind +endfunction diff --git a/runtime/indent/php.vim b/runtime/indent/php.vim index d73460d07..6124eb2f6 100644 --- a/runtime/indent/php.vim +++ b/runtime/indent/php.vim @@ -2,11 +2,14 @@ " Language: PHP " Author: John Wellesz <John.wellesz (AT) teaser (DOT) fr> " URL: http://www.2072productions.com/vim/indent/php.vim -" Last Change: 2007 Jun 24 +" Last Change: 2008 June 7th " Newsletter: http://www.2072productions.com/?to=php-indent-for-vim-newsletter.php -" Version: 1.24 +" Version: 1.28 " -" The change log and all the comments have been removed from this file. +" If you find a bug, please e-mail me at John.wellesz (AT) teaser (DOT) fr +" with an example of code that breaks the algorithm. +" +" ---> The change log and all the comments have been removed from this file. " " For a complete change log and fully commented code, download the script on " 2072productions.com at the URI provided above. @@ -19,12 +22,15 @@ " " " NOTE: This script must be used with PHP syntax ON and with the php syntax -" script by Lutz Eymers ( http://www.isp.de/data/php.vim ) that's the script bundled with Vim. +" script by Lutz Eymers (http://www.isp.de/data/php.vim ) or with the +" script by Peter Hodge (http://www.vim.org/scripts/script.php?script_id=1571 ) +" the later is bunbdled by default with vim 7. " " -" In the case you have syntax errors in your script such as end of HereDoc -" tags not at col 1 you'll have to indent your file 2 times (This script -" will automatically put HereDoc end tags at col 1). +" In the case you have syntax errors in your script such as HereDoc end +" identifiers not at col 1 you'll have to indent your file 2 times (This +" script will automatically put HereDoc end identifiers at col 1 if +" they are followed by a ';'). " " " NOTE: If you are editing file in Unix file format and that (by accident) @@ -37,8 +43,8 @@ " " or simply 'let' the option PHP_removeCRwhenUnix to 1 and the script will " silently remove them when VIM load this script (at each bufread). - - +" +" " Options: PHP_autoformatcomment = 0 to not enable autoformating of comment by " default, if set to 0, this script will let the 'formatoptions' setting intact. " @@ -48,7 +54,7 @@ " Options: PHP_removeCRwhenUnix = 1 to make the script automatically remove CR " at end of lines (by default this option is unset), NOTE that you " MUST remove CR when the fileformat is UNIX else the indentation -" won't be correct... +" won't be correct! " " Options: PHP_BracesAtCodeLevel = 1 to indent the '{' and '}' at the same " level than the code they contain. @@ -67,6 +73,10 @@ " " NOTE: The script will be a bit slower if you use this option because " some optimizations won't be available. +" +" Options: PHP_vintage_case_default_indent = 1 (defaults to 0) to add a meaningless indent +" befaore 'case:' and 'default":' statement in switch block +" if exists("b:did_indent") finish @@ -89,12 +99,21 @@ else let b:PHP_BracesAtCodeLevel = 0 endif + if exists("PHP_autoformatcomment") let b:PHP_autoformatcomment = PHP_autoformatcomment else let b:PHP_autoformatcomment = 1 endif +if exists("PHP_vintage_case_default_indent") + let b:PHP_vintage_case_default_indent = PHP_vintage_case_default_indent +else + let b:PHP_vintage_case_default_indent = 0 +endif + + + let b:PHP_lastindented = 0 let b:PHP_indentbeforelast = 0 let b:PHP_indentinghuge = 0 @@ -182,8 +201,8 @@ function! GetLastRealCodeLNum(startline) " {{{ endif - elseif lastline =~? '^\a\w*;$' && lastline !~? s:notPhpHereDoc - let tofind=substitute( lastline, '\([^;]\+\);', '<<<\1$', '') + elseif lastline =~? '^\a\w*;\=$' && lastline !~? s:notPhpHereDoc " XXX 0607 + let tofind=substitute( lastline, '\(\a\w*\);\=', '<<<''\\=\1''\\=$', '') " XXX 0607 while getline(lnum) !~? tofind && lnum > 1 let lnum = lnum - 1 endwhile @@ -209,7 +228,7 @@ function! Skippmatch2() let line = getline(".") - if line =~ '\%(".*\)\@<=/\*\%(.*"\)\@=' || line =~ '\%(//.*\)\@<=/\*' + if line =~ '\%(".*\)\@<=/\*\%(.*"\)\@=' || line =~ '\%(\%(//\|#\).*\)\@<=/\*' return 1 else return 0 @@ -218,7 +237,7 @@ endfun function! Skippmatch() " {{{ let synname = synIDattr(synID(line("."), col("."), 0), "name") - if synname == "Delimiter" || synname == "phpRegionDelimiter" || synname =~# "^phpParent" || synname == "phpArrayParens" || synname =~# '^php\%(Block\|Brace\)' || synname == "javaScriptBraces" || synname == "phpComment" && b:UserIsTypingComment + if synname == "Delimiter" || synname == "phpRegionDelimiter" || synname =~# "^phpParent" || synname == "phpArrayParens" || synname =~# '^php\%(Block\|Brace\)' || synname == "javaScriptBraces" || synname =~# "^phpComment" && b:UserIsTypingComment return 0 else return 1 @@ -295,8 +314,8 @@ function! IslinePHP (lnum, tofind) " {{{ endif endfunction " }}} -let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\);' -let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|else\>\|while\>\|switch\>\|for\%(each\)\=\>\|declare\>\|class\>\|interface\>\|abstract\>\|try\>\|catch\>\|[|&]\)' +let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\|else\)' +let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|else\>\|while\>\|switch\>\|for\%(each\)\=\>\|declare\>\|class\>\|interface\>\|abstract\>\|try\>\|catch\>\)' let s:autorestoptions = 0 if ! s:autorestoptions @@ -310,11 +329,11 @@ function! ResetOptions() setlocal comments=s1:/*,mb:*,ex:*/,://,:# - " setlocal formatoptions-=t + setlocal formatoptions-=t setlocal formatoptions+=q setlocal formatoptions+=r setlocal formatoptions+=o - " setlocal formatoptions+=w + setlocal formatoptions+=w setlocal formatoptions+=c setlocal formatoptions+=b endif @@ -341,7 +360,7 @@ function! GetPhpIndent() if !b:PHP_indentinghuge && b:PHP_lastindented > b:PHP_indentbeforelast if b:PHP_indentbeforelast let b:PHP_indentinghuge = 1 - echom 'Large indenting detected, speed optimizations engaged' + echom 'Large indenting detected, speed optimizations engaged (v1.28)' endif let b:PHP_indentbeforelast = b:PHP_lastindented endif @@ -381,7 +400,7 @@ function! GetPhpIndent() let b:InPHPcode = 1 let b:InPHPcode_tofind = "" - if synname == "phpComment" + if synname =~# "^phpComment" let b:UserIsTypingComment = 1 else let b:UserIsTypingComment = 0 @@ -396,11 +415,11 @@ function! GetPhpIndent() let b:UserIsTypingComment = 0 let lnum = v:lnum - 1 - while getline(lnum) !~? '<<<\a\w*$' && lnum > 1 + while getline(lnum) !~? '<<<''\=\a\w*''\=$' && lnum > 1 let lnum = lnum - 1 endwhile - let b:InPHPcode_tofind = substitute( getline(lnum), '^.*<<<\(\a\w*\)\c', '^\\s*\1;$', '') + let b:InPHPcode_tofind = substitute( getline(lnum), '^.*<<<''\=\(\a\w*\)''\=$', '^\\s*\1;\\=$', '') " XXX 0607 endif else let b:InPHPcode = 0 @@ -453,9 +472,9 @@ function! GetPhpIndent() let b:InPHPcode_and_script = 1 endif - elseif last_line =~? '<<<\a\w*$' + elseif last_line =~? '<<<''\=\a\w*''\=$' " XXX 0607 let b:InPHPcode = 0 - let b:InPHPcode_tofind = substitute( last_line, '^.*<<<\(\a\w*\)\c', '^\\s*\1;$', '') + let b:InPHPcode_tofind = substitute( last_line, '^.*<<<''\=\(\a\w*\)''\=$', '^\\s*\1;\\=$', '') " XXX 0607 elseif !UserIsEditing && cline =~ '^\s*/\*\%(.*\*/\)\@!' && getline(v:lnum + 1) !~ '^\s*\*' let b:InPHPcode = 0 @@ -513,7 +532,7 @@ function! GetPhpIndent() return 0 endif - if cline =~? '^\s*\a\w*;$' && cline !~? s:notPhpHereDoc + if cline =~? '^\s*\a\w*;$\|^\a\w*$' && cline !~? s:notPhpHereDoc " XXX 0607 return 0 endif " }}} @@ -558,7 +577,7 @@ function! GetPhpIndent() let defaultORcase = '^\s*\%(default\|case\).*:' - if last_line =~ '[;}]'.endline && last_line !~# defaultORcase + if last_line =~ '[;}]'.endline && last_line !~ '^)' && last_line !~# defaultORcase " Added && last_line !~ '^)' on 2007-12-30 if ind==b:PHP_default_indenting return b:PHP_default_indenting elseif b:PHP_indentinghuge && ind==b:PHP_CurrentIndentLevel && cline !~# '^\s*\%(else\|\%(case\|default\).*:\|[})];\=\)' && last_line !~# '^\s*\%(\%(}\s*\)\=else\)' && getline(GetLastRealCodeLNum(lnum - 1))=~';'.endline @@ -568,20 +587,20 @@ function! GetPhpIndent() let LastLineClosed = 0 - let terminated = '\%(;\%(\s*?>\)\=\|<<<\a\w*\|}\)'.endline + let terminated = '\%(;\%(\s*?>\)\=\|<<<''\=\a\w*''\=$\|^\s*}\)'.endline " XXX 0607 let unstated = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.endline if ind != b:PHP_default_indenting && cline =~# '^\s*else\%(if\)\=\>' let b:PHP_CurrentIndentLevel = b:PHP_default_indenting return indent(FindTheIfOfAnElse(v:lnum, 1)) - elseif cline =~ '^\s*{' + elseif cline =~ '^\s*)\=\s*{' let previous_line = last_line let last_line_num = lnum while last_line_num > 1 - if previous_line =~ '^\s*\%(' . s:blockstart . '\|\%([a-zA-Z]\s*\)*function\)' && previous_line !~ '^\s*[|&]' + if previous_line =~ '^\s*\%(' . s:blockstart . '\|\%([a-zA-Z]\s*\)*function\)' let ind = indent(last_line_num) @@ -596,11 +615,11 @@ function! GetPhpIndent() let previous_line = getline(last_line_num) endwhile - elseif last_line =~# unstated && cline !~ '^\s*{\|^\s*);\='.endline - let ind = ind + &sw + elseif last_line =~# unstated && cline !~ '^\s*);\='.endline + let ind = ind + &sw " we indent one level further when the preceding line is not stated return ind - elseif ind != b:PHP_default_indenting && last_line =~ terminated + elseif (ind != b:PHP_default_indenting || last_line =~ '^)' ) && last_line =~ terminated " Added || last_line =~ '^)' on 2007-12-30 (array indenting [rpblem broke other things) let previous_line = last_line let last_line_num = lnum let LastLineClosed = 1 @@ -642,7 +661,7 @@ function! GetPhpIndent() endif if one_ahead_indent == two_ahead_indent || last_line_num < 1 - if previous_line =~# '[;}]'.endline || last_line_num < 1 + if previous_line =~# '\%(;\|^\s*}\)'.endline || last_line_num < 1 break endif endif @@ -680,8 +699,9 @@ function! GetPhpIndent() let ind = ind + &sw endif - if b:PHP_BracesAtCodeLevel || cline !~# defaultORcase + if b:PHP_BracesAtCodeLevel || b:PHP_vintage_case_default_indent == 1 || cline !~# defaultORcase let b:PHP_CurrentIndentLevel = ind + return ind endif @@ -692,21 +712,23 @@ function! GetPhpIndent() if openedparent != lnum let ind = indent(openedparent) endif + elseif last_line =~ '^\s*'.s:blockstart + let ind = ind + &sw + elseif last_line =~# defaultORcase + let ind = ind + &sw - elseif cline !~ '^\s*{' && pline =~ '\%(;\%(\s*?>\)\=\|<<<\a\w*\|{\|^\s*'.s:blockstart.'\s*(.*)\)'.endline.'\|^\s*}\|'.defaultORcase - let ind = ind + &sw + elseif pline =~ '\%(;\%(\s*?>\)\=\|<<<''\=\a\w*''\=$\|^\s*}\|{\)'.endline . '\|' . defaultORcase + let ind = ind + &sw endif - elseif last_line =~# defaultORcase - let ind = ind + &sw endif if cline =~ '^\s*);\=' let ind = ind - &sw - elseif cline =~# defaultORcase + elseif cline =~# defaultORcase && last_line !~# defaultORcase let ind = ind - &sw endif diff --git a/runtime/indent/ruby.vim b/runtime/indent/ruby.vim index 0f2de567d..8a56e54c0 100644 --- a/runtime/indent/ruby.vim +++ b/runtime/indent/ruby.vim @@ -34,26 +34,26 @@ set cpo&vim " ============ " Regex of syntax group names that are or delimit string or are comments. -let s:syng_strcom = '\<ruby\%(String\|StringDelimiter\|ASCIICode' . - \ '\|Interpolation\|NoInterpolation\|Escape\|Comment\|Documentation\)\>' +let s:syng_strcom = '\<ruby\%(String\|StringEscape\|ASCIICode' . + \ '\|Interpolation\|NoInterpolation\|Comment\|Documentation\)\>' " Regex of syntax group names that are strings. let s:syng_string = - \ '\<ruby\%(String\|StringDelimiter\|Interpolation\|NoInterpolation\|Escape\)\>' + \ '\<ruby\%(String\|Interpolation\|NoInterpolation\|StringEscape\)\>' " Regex of syntax group names that are strings or documentation. let s:syng_stringdoc = - \'\<ruby\%(String\|StringDelimiter\|Interpolation\|NoInterpolation\|Escape\|Documentation\)\>' + \'\<ruby\%(String\|Interpolation\|NoInterpolation\|StringEscape\|Documentation\)\>' " Expression used to check whether we should skip a match with searchpair(). let s:skip_expr = - \ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '".s:syng_strcom."'" + \ "synIDattr(synID(line('.'),col('.'),1),'name') =~ '".s:syng_strcom."'" " Regex used for words that, at the start of a line, add a level of indent. let s:ruby_indent_keywords = '^\s*\zs\<\%(module\|class\|def\|if\|for' . \ '\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure' . \ '\|rescue\)\>' . - \ '\|\%([*+/,=:-]\|<<\|>>\)\s*\zs' . + \ '\|\%([*+/,=-]\|<<\|>>\|:\s\)\s*\zs' . \ '\<\%(if\|for\|while\|until\|case\|unless\|begin\)\>' " Regex used for words that, at the start of a line, remove a level of indent. @@ -65,7 +65,7 @@ let s:ruby_deindent_keywords = " TODO: the do here should be restricted somewhat (only at end of line)? let s:end_start_regex = '^\s*\zs\<\%(module\|class\|def\|if\|for' . \ '\|while\|until\|case\|unless\|begin\)\>' . - \ '\|\%([*+/,=:-]\|<<\|>>\)\s*\zs' . + \ '\|\%([*+/,=-]\|<<\|>>\|:\s\)\s*\zs' . \ '\<\%(if\|for\|while\|until\|case\|unless\|begin\)\>' . \ '\|\<do\>' @@ -78,15 +78,15 @@ let s:end_end_regex = '\%(^\|[^.:@$]\)\@<=\<end\>' " Expression used for searchpair() call for finding match for 'end' keyword. let s:end_skip_expr = s:skip_expr . \ ' || (expand("<cword>") == "do"' . - \ ' && getline(".") =~ "^\\s*\\<while\\|until\\|for\\>")' + \ ' && getline(".") =~ "^\\s*\\<\\(while\\|until\\|for\\)\\>")' " Regex that defines continuation lines, not including (, {, or [. -let s:continuation_regex = '\%([\\*+/.,=:-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$' +let s:continuation_regex = '\%([\\*+/.,:]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$' " Regex that defines continuation lines. " TODO: this needs to deal with if ...: and so on let s:continuation_regex2 = - \ '\%([\\*+/.,=:({[-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$' + \ '\%([\\*+/.,:({[]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$' " Regex that defines blocks. let s:block_regex = @@ -97,17 +97,17 @@ let s:block_regex = " Check if the character at lnum:col is inside a string, comment, or is ascii. function s:IsInStringOrComment(lnum, col) - return synIDattr(synID(a:lnum, a:col, 0), 'name') =~ s:syng_strcom + return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_strcom endfunction " Check if the character at lnum:col is inside a string. function s:IsInString(lnum, col) - return synIDattr(synID(a:lnum, a:col, 0), 'name') =~ s:syng_string + return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_string endfunction " Check if the character at lnum:col is inside a string or documentation. function s:IsInStringOrDocumentation(lnum, col) - return synIDattr(synID(a:lnum, a:col, 0), 'name') =~ s:syng_stringdoc + return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_stringdoc endfunction " Find line above 'lnum' that isn't empty, in a comment, or in a string. @@ -259,6 +259,11 @@ function GetRubyIndent() " Find a non-blank, non-multi-line string line above the current line. let lnum = s:PrevNonBlankNonString(v:lnum - 1) + " If the line is empty and inside a string, use the previous line. + if line =~ '^\s*$' && lnum != prevnonblank(v:lnum - 1) + return indent(prevnonblank(v:lnum)) + endif + " At the start of the file use zero indent. if lnum == 0 return 0 diff --git a/runtime/indent/sass.vim b/runtime/indent/sass.vim new file mode 100644 index 000000000..45ca50f68 --- /dev/null +++ b/runtime/indent/sass.vim @@ -0,0 +1,39 @@ +" Vim indent file +" Language: SASS +" Maintainer: Tim Pope <vimNOSPAM@tpope.info> +" Last Change: 2007 Dec 16 + +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +setlocal autoindent sw=2 et +setlocal indentexpr=GetSassIndent() +setlocal indentkeys=o,O,*<Return>,<:>,!^F + +" Only define the function once. +if exists("*GetSassIndent") + finish +endif + +let s:property = '^\s*:\|^\s*[[:alnum:]-]\+:' + +function! GetSassIndent() + let lnum = prevnonblank(v:lnum-1) + let line = substitute(getline(lnum),'\s\+$','','') + let cline = substitute(substitute(getline(v:lnum),'\s\+$','',''),'^\s\+','','') + let lastcol = strlen(line) + let line = substitute(line,'^\s\+','','') + let indent = indent(lnum) + let cindent = indent(v:lnum) + if line !~ s:property && cline =~ s:property + return indent + &sw + "elseif line =~ s:property && cline !~ s:property + "return indent - &sw + else + return -1 + endif +endfunction + +" vim:set sw=2: diff --git a/runtime/keymap/bulgarian-bds.vim b/runtime/keymap/bulgarian-bds.vim index bb789a9af..bf837c864 100644 --- a/runtime/keymap/bulgarian-bds.vim +++ b/runtime/keymap/bulgarian-bds.vim @@ -1,31 +1,39 @@ -" Vim keymap file for Bulgarian and Russian characters, `bds' layout. -" Can be used with utf-8 or cp1251 file encodings. -" This file itself is in utf-8 +" Vim keymap file for Bulgarian and Russian characters, "bds" layout. +" Most of it can be used with both utf-8 and cp1251 file encodings, except +" the accented vowels which can only be stored in utf-8. +" This file itself is in utf-8. " Maintainer: Boyko Bantchev <boykobb@gmail.com> -" URI: http://www.math.bas.bg/softeng/bantchev/misc/vim/bulgarian-bds.vim -" Last Changed: 2006 Oct 18 +" URI: http://www.math.bas.bg/bantchev/vim/bulgarian-bds.vim +" Last Changed: 2008 June 28 -" This keymap corresponds to what is called Bulgarian standard, -" or BDS (БДС) typewriter keyboard layout. -" In addition to the Bulgarian alphabet, BDS prescribes the presence -" of the following characters: -" — The Cyrillic letters Đ (capital), and Ń‹ and ŃŤ (small) -" (these are present in the Russian alphabet). -" — The latin capital letters I and V (these are used to type -" Roman numerals without having to leave Cyrillic mode). -" — „ and “ (Bulgarian quotation style), and « and » (Russian quotation -" style). -" — §, â„–, —, •, ·, ±, ¬, ¤, and € +" This keymap corresponds to what is called Bulgarian standard typewriter +" keyboard layout (BDS, БДС). " -" Some punctuation characters that are present in ascii are mapped in BDS -" to keys different from the ones they occupy in the qwerty layout, because -" the latter are used to type other characters. +" Note that, in addition to the Bulgarian alphabet, the BDS layout prescribes +" the presence of the following characters: +" — The Russian letters Ń‹ (small), and Đ and ŃŤ (capital and small). +" — The latin capital letters I and V – used to type Roman numerals +" without having to leave Cyrillic mode. " -" In this keymap also defined (not in BDS) are the Russian letters Đ (capital) -" and Ń‘ (small), as well as the Russian capital letter Đ« (see above the small -" counterpart). This way, using the bulgarian-bds keymap, one can access both -" the Bulgarian and the Russian alphabets. +" Some punctuation characters present in ascii are mapped in BDS to keys +" different from the ones they occupy in the qwerty layout, because the latter +" keys are used to type other characters. +" +" In this keymap, also defined (besides BDS) are: +" — The Russian letters Đ and Ń‘ (capital and small), as well as the +" Russian capital letter Đ« (see above for the small counterpart). +" This way, using the bulgarian-bds keymap, one can access both +" the Bulgarian and the Russian alphabets. +" — The quotation marks „ “ ” †’ (used in the Bulgarian and English +" quotation styles), as well as « » (Russian quotation style). +" — The characters §, â„–, – (en-dash), — (em-dash), …, •, ·, ±, °, ¬, +" ¤, and €. +" +" The keymap also defines key combinations for accented vowels in Bulgarian. +" +" For details of what key or key combination maps to what character, please +" see below the map table itself. scriptencoding utf-8 @@ -114,14 +122,38 @@ q , COMMA @ ? QUESTION MARK } § SECTION SIGN (PARAGRAPH SIGN) ) â„– NUMERO SIGN --- — EM DASH +-- – EN DASH +--- — EM DASH +.. … HORIZONTAL ELLIPSIS +`` “ LEFT DOUBLE QUOTATION MARK +'' ” RIGHT DOUBLE QUOTATION MARK ,, „ DOUBLE LOW-9 QUOTATION MARK -`` “ LEFT DOUBLE QUOTATION MARK +`. †LEFT SINGLE QUOTATION MARK +'. ’ RIGHT SINGLE QUOTATION MARK << « LEFT-POINTING DOUBLE ANGLE QUOTATION MARK >> » RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -00 • BULLET -.. · MIDDLE DOT +** • BULLET +,. · MIDDLE DOT +- ± PLUS-MINUS SIGN +^o ° DEGREE SIGN ~~ ¬ NOT SIGN @@ ¤ CURRENCY SIGN $$ € EURO SIGN + +" accented vowels cannot map onto cp1251 – use utf-8 file encoding +`D ĐĚ€ CYRILLIC CAPITAL LETTER A + GRAVE ACCENT (COMPOSED) +`d Đ°Ě€ CYRILLIC SMALL LETTER A + GRAVE ACCENT (COMPOSED) +`E Đ•Ě€ CYRILLIC CAPITAL LETTER IE + GRAVE ACCENT (COMPOSED) +`e ѐ CYRILLIC SMALL LETTER IE + GRAVE ACCENT (COMPOSED) +`R ĐĚ€ CYRILLIC CAPITAL LETTER I + GRAVE ACCENT (COMPOSED) +`r ѝ CYRILLIC SMALL LETTER I + GRAVE ACCENT (COMPOSED) +`F О̀ CYRILLIC CAPITAL LETTER O + GRAVE ACCENT (COMPOSED) +`f о̀ CYRILLIC SMALL LETTER O + GRAVE ACCENT (COMPOSED) +`W ĐŁĚ€ CYRILLIC CAPITAL LETTER U + GRAVE ACCENT (COMPOSED) +`w ŃĚ€ CYRILLIC SMALL LETTER U + GRAVE ACCENT (COMPOSED) +`C ĐŞĚ€ CYRILLIC CAPITAL LETTER HARD SIGN + GRAVE ACCENT (COMPOSED) +`c ŃŠĚ€ CYRILLIC SMALL LETTER HARD SIGN + GRAVE ACCENT (COMPOSED) +`Z Ю̀ CYRILLIC CAPITAL LETTER YU + GRAVE ACCENT (COMPOSED) +`z ŃŽĚ€ CYRILLIC SMALL LETTER YU + GRAVE ACCENT (COMPOSED) +`S ĐŻĚ€ CYRILLIC CAPITAL LETTER YA + GRAVE ACCENT (COMPOSED) +`s ŃŹĚ€ CYRILLIC SMALL LETTER YA + GRAVE ACCENT (COMPOSED) diff --git a/runtime/keymap/bulgarian-phonetic.vim b/runtime/keymap/bulgarian-phonetic.vim index feec587b7..bac2e7ebe 100644 --- a/runtime/keymap/bulgarian-phonetic.vim +++ b/runtime/keymap/bulgarian-phonetic.vim @@ -1,26 +1,35 @@ -" Vim keymap file for Bulgarian and Russian characters, `phonetic' layout. -" Can be used with utf-8 or cp1251 file encodings. -" This file itself is in utf-8 +" Vim keymap file for Bulgarian and Russian characters, "phonetic" layout. +" Most of it can be used with both utf-8 and cp1251 file encodings, except +" the accented vowels which can only be stored in utf-8. +" This file itself is in utf-8. " Maintainer: Boyko Bantchev <boykobb@gmail.com> -" URI: http://www.math.bas.bg/softeng/bantchev/misc/vim/bulgarian-phonetic.vim -" Last Changed: 2006 Oct 18 +" URI: http://www.math.bas.bg/bantchev/vim/bulgarian-phonetic.vim +" Last Changed: 2008 June 28 -" This keymap corresponds to what is called `phonetic layout' in Bulgaria: -" Cyrillic letters homophonous with Latin letters tend to take the same -" places as the latter ones. Most of the keys corresponding to punctuation -" characters are left unmapped, so they retain their usual (qwerty) meanings -" while typing in Cyrillic. +" For a rationale for the layout and additional info on typing in Bulgarian +" using Unicode Cyrillic please see: + +" This keymap corresponds to what is called "phonetic layout" in Bulgaria: +" Cyrillic letters tend to be mapped to their Latin homophones, if present. +" Most keys corresponding to punctuation characters are left unmapped, so +" they retain their usual (qwerty) meanings in Cyrillic typing. +" +" In addition to the Bulgarian alphabet, the keymap makes accessible the +" following characters: +" — The letters Đ and Ń‘, Đ and ŃŤ, and Đ« and Ń‹ (in pairs of capital and +" small). These are the letters in the Russian alphabet that are not +" present in Bulgarian, so using the bulgarian-phonetic keymap one can +" type in Russian, too. +" — The quotation marks „ “ ” †’ (used in the Bulgarian and English +" quotation styles), as well as « » (Russian quotation style). +" — The characters §, â„–, – (en-dash), — (em-dash), …, •, ·, ±, °, ¬, +" ¤, and €. +" +" The keymap also defines key combinations for accented vowels in Bulgarian. " -" In addition to the Bulgarian alphabet, the keymap defines the following -" characters: -" — The Cyrillic letters Đ and Ń‘, Đ and ŃŤ, and Đ« and Ń‹ (in pairs of -" capital and small). These are the letters in the Russian alphabet -" that are not present in Bulgarian, so using the bulgarian-phonetic -" keymap one can type in Russian, too. -" — „ and “ (Bulgarian quotation style), and « and » (Russian quotation -" style). -" — §, â„–, —, •, ·, ±, ¬, ¤, and € +" For details of what key or key combination maps to what character, please +" see below the map table itself. scriptencoding utf-8 @@ -55,7 +64,7 @@ C Ц CYRILLIC CAPITAL LETTER TSE { Ш CYRILLIC CAPITAL LETTER SHA } Đ© CYRILLIC CAPITAL LETTER SHCHA Y ĐŞ CYRILLIC CAPITAL LETTER HARD SIGN -YJ Đ« CYRILLIC CAPITAL LETTER YERU +YI Đ« CYRILLIC CAPITAL LETTER YERU X Ь CYRILLIC CAPITAL LETTER SOFT SIGN YE Đ CYRILLIC CAPITAL LETTER REVERSED E | Đ® CYRILLIC CAPITAL LETTER YU @@ -88,21 +97,45 @@ c ц CYRILLIC SMALL LETTER TSE [ Ń CYRILLIC SMALL LETTER SHA ] щ CYRILLIC SMALL LETTER SHCHA y ŃŠ CYRILLIC SMALL LETTER HARD SIGN -yj Ń‹ CYRILLIC SMALL LETTER YERU +yi Ń‹ CYRILLIC SMALL LETTER YERU x ŃŚ CYRILLIC SMALL LETTER SOFT SIGN ye ŃŤ CYRILLIC SMALL LETTER REVERSED E \\ ŃŽ CYRILLIC SMALL LETTER YU q ŃŹ CYRILLIC SMALL LETTER YA !! § SECTION SIGN (PARAGRAPH SIGN) ## â„– NUMERO SIGN --- — EM DASH -,, „ DOUBLE LOW-9 QUOTATION MARK +-- – EN DASH +--- — EM DASH +.. … HORIZONTAL ELLIPSIS `` “ LEFT DOUBLE QUOTATION MARK +'' ” RIGHT DOUBLE QUOTATION MARK +,, „ DOUBLE LOW-9 QUOTATION MARK +`. †LEFT SINGLE QUOTATION MARK +'. ’ RIGHT SINGLE QUOTATION MARK << « LEFT-POINTING DOUBLE ANGLE QUOTATION MARK >> » RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -00 • BULLET -.. · MIDDLE DOT +** • BULLET +,. · MIDDLE DOT +- ± PLUS-MINUS SIGN +^o ° DEGREE SIGN ~~ ¬ NOT SIGN @@ ¤ CURRENCY SIGN $$ € EURO SIGN + +" accented vowels cannot map onto cp1251 – use utf-8 file encoding +'A ĐĚ€ CYRILLIC CAPITAL LETTER A + GRAVE ACCENT (COMPOSED) +'a Đ°Ě€ CYRILLIC SMALL LETTER A + GRAVE ACCENT (COMPOSED) +'E Đ•Ě€ CYRILLIC CAPITAL LETTER IE + GRAVE ACCENT (COMPOSED) +'e ѐ CYRILLIC SMALL LETTER IE + GRAVE ACCENT (COMPOSED) +'I ĐĚ€ CYRILLIC CAPITAL LETTER I + GRAVE ACCENT (COMPOSED) +'i ѝ CYRILLIC SMALL LETTER I + GRAVE ACCENT (COMPOSED) +'O О̀ CYRILLIC CAPITAL LETTER O + GRAVE ACCENT (COMPOSED) +'o о̀ CYRILLIC SMALL LETTER O + GRAVE ACCENT (COMPOSED) +'U ĐŁĚ€ CYRILLIC CAPITAL LETTER U + GRAVE ACCENT (COMPOSED) +'u ŃĚ€ CYRILLIC SMALL LETTER U + GRAVE ACCENT (COMPOSED) +'Y ĐŞĚ€ CYRILLIC CAPITAL LETTER HARD SIGN + GRAVE ACCENT (COMPOSED) +'y ŃŠĚ€ CYRILLIC SMALL LETTER HARD SIGN + GRAVE ACCENT (COMPOSED) +'| Ю̀ CYRILLIC CAPITAL LETTER YU + GRAVE ACCENT (COMPOSED) +'\\ ŃŽĚ€ CYRILLIC SMALL LETTER YU + GRAVE ACCENT (COMPOSED) +'Q ĐŻĚ€ CYRILLIC CAPITAL LETTER YA + GRAVE ACCENT (COMPOSED) +'q ŃŹĚ€ CYRILLIC SMALL LETTER YA + GRAVE ACCENT (COMPOSED) diff --git a/runtime/keymap/bulgarian.vim b/runtime/keymap/bulgarian.vim deleted file mode 100644 index 3c80c9ffe..000000000 --- a/runtime/keymap/bulgarian.vim +++ /dev/null @@ -1,90 +0,0 @@ -" Vim Keymap file for russian characters, phonetic layout 'yawerty' -" Useful mainly with utf-8 but may work with other encodings - -" Maintainer: Alberto Mardegan <mardy@despammed.com> -" Last Changed: 2004 Oct 17 - -" All characters are given literally, conversion to another encoding (e.g., -" UTF-8) should work. -scriptencoding utf-8 - -let b:keymap_name = "bg" - -loadkeymap -A Đ CYRILLIC CAPITAL LETTER A -B Đ‘ CYRILLIC CAPITAL LETTER BE -W Đ’ CYRILLIC CAPITAL LETTER VE -V Đ’ CYRILLIC CAPITAL LETTER VE -G Đ“ CYRILLIC CAPITAL LETTER GHE -D Đ” CYRILLIC CAPITAL LETTER DE -E Đ• CYRILLIC CAPITAL LETTER IE -Zh Đ– CYRILLIC CAPITAL LETTER ZHE -ZH Đ– CYRILLIC CAPITAL LETTER ZHE -Z Đ— CYRILLIC CAPITAL LETTER ZE -I Đ CYRILLIC CAPITAL LETTER I -J Đ™ CYRILLIC CAPITAL LETTER SHORT I -K Đš CYRILLIC CAPITAL LETTER KA -L Đ› CYRILLIC CAPITAL LETTER EL -M Đś CYRILLIC CAPITAL LETTER EM -N Đť CYRILLIC CAPITAL LETTER EN -O Đž CYRILLIC CAPITAL LETTER O -P Đź CYRILLIC CAPITAL LETTER PE -R Đ CYRILLIC CAPITAL LETTER ER -S С CYRILLIC CAPITAL LETTER ES -T Т CYRILLIC CAPITAL LETTER TE -U ĐŁ CYRILLIC CAPITAL LETTER U -F Ф CYRILLIC CAPITAL LETTER EF -H ĐĄ CYRILLIC CAPITAL LETTER HA -C Ц CYRILLIC CAPITAL LETTER TSE -Ch Ч CYRILLIC CAPITAL LETTER CHE -CH Ч CYRILLIC CAPITAL LETTER CHE -Sh Ш CYRILLIC CAPITAL LETTER SHA -SH Ш CYRILLIC CAPITAL LETTER SHA -Sht Đ© CYRILLIC CAPITAL LETTER SHCHA -SHt Đ© CYRILLIC CAPITAL LETTER SHCHA -SHT Đ© CYRILLIC CAPITAL LETTER SHCHA -Sj Đ© CYRILLIC CAPITAL LETTER SHCHA -SJ Đ© CYRILLIC CAPITAL LETTER SHCHA -Y ĐŞ CYRILLIC CAPITAL LETTER HARD SIGN -X Ь CYRILLIC CAPITAL LETTER SOFT SIGN -~ Đ® CYRILLIC CAPITAL LETTER YU -Ju Đ® CYRILLIC CAPITAL LETTER YU -JU Đ® CYRILLIC CAPITAL LETTER YU -Q ĐŻ CYRILLIC CAPITAL LETTER YA -Ja ĐŻ CYRILLIC CAPITAL LETTER YA -JA ĐŻ CYRILLIC CAPITAL LETTER YA -a Đ° CYRILLIC SMALL LETTER A -b б CYRILLIC SMALL LETTER BE -w в CYRILLIC SMALL LETTER VE -v в CYRILLIC SMALL LETTER VE -g Đł CYRILLIC SMALL LETTER GHE -d Đ´ CYRILLIC SMALL LETTER DE -e е CYRILLIC SMALL LETTER IE -zh ж CYRILLIC SMALL LETTER ZHE -w ж CYRILLIC SMALL LETTER ZHE -z Đ· CYRILLIC SMALL LETTER ZE -i и CYRILLIC SMALL LETTER I -j Đą CYRILLIC SMALL LETTER SHORT I -k Đş CYRILLIC SMALL LETTER KA -l Đ» CYRILLIC SMALL LETTER EL -m ĐĽ CYRILLIC SMALL LETTER EM -n Đ˝ CYRILLIC SMALL LETTER EN -o Đľ CYRILLIC SMALL LETTER O -p Đż CYRILLIC SMALL LETTER PE -r Ń€ CYRILLIC SMALL LETTER ER -s Ń CYRILLIC SMALL LETTER ES -t Ń‚ CYRILLIC SMALL LETTER TE -u Ń CYRILLIC SMALL LETTER U -f Ń„ CYRILLIC SMALL LETTER EF -h Ń… CYRILLIC SMALL LETTER HA -c ц CYRILLIC SMALL LETTER TSE -ch ч CYRILLIC SMALL LETTER CHE -sh Ń CYRILLIC SMALL LETTER SHA -sht щ CYRILLIC SMALL LETTER SHCHA -sj щ CYRILLIC SMALL LETTER SHCHA -y ŃŠ CYRILLIC SMALL LETTER HARD SIGN -x ŃŚ CYRILLIC SMALL LETTER SOFT SIGN -` ŃŽ CYRILLIC SMALL LETTER YU -ju ŃŽ CYRILLIC SMALL LETTER YU -q ŃŹ CYRILLIC SMALL LETTER YA -ja ŃŹ CYRILLIC SMALL LETTER YA diff --git a/runtime/macros/justify.vim b/runtime/macros/justify.vim index 41d0591fe..aa4a9ca58 100644 --- a/runtime/macros/justify.vim +++ b/runtime/macros/justify.vim @@ -256,17 +256,18 @@ function! Justify(...) range let str = substitute(str, '\s\+$', '', '') let str = substitute(str, '^\s\+', '', '') let str = substitute(str, '\s\+', ' ', 'g') - let str_n = strlen(str) + " Use substitute() hack to get strlen in characters instead of bytes + let str_n = strlen(substitute(str, '.', 'x', 'g')) " Possible addition of space after punctuation if exists("join_str") let str = substitute(str, join_str, '\1 ', 'g') endif - let join_n = strlen(str) - str_n + let join_n = strlen(substitute(str, '.', 'x', 'g')) - str_n " Can extraspaces be added? " Note that str_n may be less than strlen(str) [joinspaces above] - if strlen(str) < tw - indent_n && str_n > 0 + if strlen(substitute(str, '.', 'x', 'g')) < tw - indent_n && str_n > 0 " How many spaces should be added let s_add = tw - str_n - indent_n - join_n let s_nr = strlen(substitute(str, '\S', '', 'g') ) - join_n diff --git a/runtime/makemenu.vim b/runtime/makemenu.vim index 6fa34e536..5f7883c79 100644 --- a/runtime/makemenu.vim +++ b/runtime/makemenu.vim @@ -1,6 +1,6 @@ " Script to define the syntax menu in synmenu.vim " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2008 Jun 24 +" Last Change: 2008 Jul 13 " This is used by "make menu" in the src directory. edit <sfile>:p:h/synmenu.vim @@ -228,11 +228,13 @@ SynMenu FG.Groff:groff SynMenu FG.Groovy:groovy SynMenu FG.GTKrc:gtkrc +SynMenu HIJK.Haml:haml SynMenu HIJK.Hamster:hamster SynMenu HIJK.Haskell.Haskell:haskell SynMenu HIJK.Haskell.Haskell-c2hs:chaskell SynMenu HIJK.Haskell.Haskell-literate:lhaskell SynMenu HIJK.HASTE:haste +SynMenu HIJK.HASTE\ preproc:hastepreproc SynMenu HIJK.Hercules:hercules SynMenu HIJK.Hex\ dump.XXD:xxd SynMenu HIJK.Hex\ dump.Intel\ MCS51:hex @@ -426,6 +428,7 @@ SynMenu R-Sg.Ruby:ruby SynMenu R-Sg.S-Lang:slang SynMenu R-Sg.Samba\ config:samba SynMenu R-Sg.SAS:sas +SynMenu R-Sg.Sass:sass SynMenu R-Sg.Sather:sather SynMenu R-Sg.Scheme:scheme SynMenu R-Sg.Scilab:scilab diff --git a/runtime/plugin/getscriptPlugin.vim b/runtime/plugin/getscriptPlugin.vim index 7fe103d61..4fd36db59 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 = "v30" +let g:loaded_getscriptPlugin = "v31" let s:keepcpo = &cpo set cpo&vim diff --git a/runtime/plugin/netrwPlugin.vim b/runtime/plugin/netrwPlugin.vim index b0a29ad78..f84aadcf1 100644 --- a/runtime/plugin/netrwPlugin.vim +++ b/runtime/plugin/netrwPlugin.vim @@ -22,7 +22,7 @@ if &cp || exists("g:loaded_netrwPlugin") finish endif -let g:loaded_netrwPlugin = "v125" +let g:loaded_netrwPlugin = "v127" let s:keepcpo = &cpo if v:version < 700 echohl WarningMsg | echo "***netrw*** you need vim version 7.0 for this version of netrw" | echohl None diff --git a/runtime/plugin/tarPlugin.vim b/runtime/plugin/tarPlugin.vim index 42fd96a31..412ceed7b 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 = "v16" +let g:loaded_tarPlugin = "v19" let s:keepcpo = &cpo set cpo&vim diff --git a/runtime/plugin/zipPlugin.vim b/runtime/plugin/zipPlugin.vim index e98686bbd..e198c66e2 100644 --- a/runtime/plugin/zipPlugin.vim +++ b/runtime/plugin/zipPlugin.vim @@ -20,7 +20,16 @@ if &cp || exists("g:loaded_zipPlugin") finish endif -let g:loaded_zipPlugin = "v18" + +" Don't use the plugin if fnameescape() is not available +if !exists("*fnameescape") + if &verbose > 1 + echoerr "zipPlugin not loaded because fnameescape() is not available" + endif + finish +endif + +let g:loaded_zipPlugin = "v21+b" let s:keepcpo = &cpo set cpo&vim diff --git a/runtime/scripts.vim b/runtime/scripts.vim index 936f508e7..201c37569 100644 --- a/runtime/scripts.vim +++ b/runtime/scripts.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types in scripts " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last change: 2008 Apr 28 +" Last change: 2008 Jun 30 " This file is called by an autocommand for every file that has just been " loaded into a buffer. It checks if the type of file can be recognized by @@ -168,7 +168,7 @@ else set ft=zsh " ELM Mail files - elseif s:line1 =~ '^From [a-zA-Z][a-zA-Z_0-9\.=-]*\(@[^ ]*\)\= .*[12][09]\d\d$' + elseif s:line1 =~ '^From \([a-zA-Z][a-zA-Z_0-9\.=-]*\(@[^ ]*\)\=\|-\) .* \(19\|20\)\d\d$' set ft=mail " Mason diff --git a/runtime/synmenu.vim b/runtime/synmenu.vim index 68a841e25..c2159771e 100644 --- a/runtime/synmenu.vim +++ b/runtime/synmenu.vim @@ -208,50 +208,52 @@ an 50.40.400 &Syntax.FG.Gretl :cal SetSyn("gretl")<CR> an 50.40.410 &Syntax.FG.Groff :cal SetSyn("groff")<CR> an 50.40.420 &Syntax.FG.Groovy :cal SetSyn("groovy")<CR> an 50.40.430 &Syntax.FG.GTKrc :cal SetSyn("gtkrc")<CR> -an 50.50.100 &Syntax.HIJK.Hamster :cal SetSyn("hamster")<CR> -an 50.50.110 &Syntax.HIJK.Haskell.Haskell :cal SetSyn("haskell")<CR> -an 50.50.120 &Syntax.HIJK.Haskell.Haskell-c2hs :cal SetSyn("chaskell")<CR> -an 50.50.130 &Syntax.HIJK.Haskell.Haskell-literate :cal SetSyn("lhaskell")<CR> -an 50.50.140 &Syntax.HIJK.HASTE :cal SetSyn("haste")<CR> -an 50.50.150 &Syntax.HIJK.Hercules :cal SetSyn("hercules")<CR> -an 50.50.160 &Syntax.HIJK.Hex\ dump.XXD :cal SetSyn("xxd")<CR> -an 50.50.170 &Syntax.HIJK.Hex\ dump.Intel\ MCS51 :cal SetSyn("hex")<CR> -an 50.50.180 &Syntax.HIJK.HTML.HTML :cal SetSyn("html")<CR> -an 50.50.190 &Syntax.HIJK.HTML.HTML\ with\ M4 :cal SetSyn("htmlm4")<CR> -an 50.50.200 &Syntax.HIJK.HTML.HTML\ with\ Ruby\ (eRuby) :cal SetSyn("eruby")<CR> -an 50.50.210 &Syntax.HIJK.HTML.Cheetah\ HTML\ template :cal SetSyn("htmlcheetah")<CR> -an 50.50.220 &Syntax.HIJK.HTML.Django\ HTML\ template :cal SetSyn("htmldjango")<CR> -an 50.50.230 &Syntax.HIJK.HTML.HTML/OS :cal SetSyn("htmlos")<CR> -an 50.50.240 &Syntax.HIJK.HTML.XHTML :cal SetSyn("xhtml")<CR> -an 50.50.250 &Syntax.HIJK.Host\.conf :cal SetSyn("hostconf")<CR> -an 50.50.260 &Syntax.HIJK.Hyper\ Builder :cal SetSyn("hb")<CR> -an 50.50.280 &Syntax.HIJK.Icewm\ menu :cal SetSyn("icemenu")<CR> -an 50.50.290 &Syntax.HIJK.Icon :cal SetSyn("icon")<CR> -an 50.50.300 &Syntax.HIJK.IDL\Generic\ IDL :cal SetSyn("idl")<CR> -an 50.50.310 &Syntax.HIJK.IDL\Microsoft\ IDL :cal SetSyn("msidl")<CR> -an 50.50.320 &Syntax.HIJK.Indent\ profile :cal SetSyn("indent")<CR> -an 50.50.330 &Syntax.HIJK.Inform :cal SetSyn("inform")<CR> -an 50.50.340 &Syntax.HIJK.Informix\ 4GL :cal SetSyn("fgl")<CR> -an 50.50.350 &Syntax.HIJK.Initng :cal SetSyn("initng")<CR> -an 50.50.360 &Syntax.HIJK.Inittab :cal SetSyn("inittab")<CR> -an 50.50.370 &Syntax.HIJK.Inno\ setup :cal SetSyn("iss")<CR> -an 50.50.380 &Syntax.HIJK.InstallShield\ script :cal SetSyn("ishd")<CR> -an 50.50.390 &Syntax.HIJK.Interactive\ Data\ Lang :cal SetSyn("idlang")<CR> -an 50.50.400 &Syntax.HIJK.IPfilter :cal SetSyn("ipfilter")<CR> -an 50.50.420 &Syntax.HIJK.JAL :cal SetSyn("jal")<CR> -an 50.50.430 &Syntax.HIJK.JAM :cal SetSyn("jam")<CR> -an 50.50.440 &Syntax.HIJK.Jargon :cal SetSyn("jargon")<CR> -an 50.50.450 &Syntax.HIJK.Java.Java :cal SetSyn("java")<CR> -an 50.50.460 &Syntax.HIJK.Java.JavaCC :cal SetSyn("javacc")<CR> -an 50.50.470 &Syntax.HIJK.Java.Java\ Server\ Pages :cal SetSyn("jsp")<CR> -an 50.50.480 &Syntax.HIJK.Java.Java\ Properties :cal SetSyn("jproperties")<CR> -an 50.50.490 &Syntax.HIJK.JavaScript :cal SetSyn("javascript")<CR> -an 50.50.500 &Syntax.HIJK.Jess :cal SetSyn("jess")<CR> -an 50.50.510 &Syntax.HIJK.Jgraph :cal SetSyn("jgraph")<CR> -an 50.50.530 &Syntax.HIJK.Kconfig :cal SetSyn("kconfig")<CR> -an 50.50.540 &Syntax.HIJK.KDE\ script :cal SetSyn("kscript")<CR> -an 50.50.550 &Syntax.HIJK.Kimwitu++ :cal SetSyn("kwt")<CR> -an 50.50.560 &Syntax.HIJK.KixTart :cal SetSyn("kix")<CR> +an 50.50.100 &Syntax.HIJK.Haml :cal SetSyn("haml")<CR> +an 50.50.110 &Syntax.HIJK.Hamster :cal SetSyn("hamster")<CR> +an 50.50.120 &Syntax.HIJK.Haskell.Haskell :cal SetSyn("haskell")<CR> +an 50.50.130 &Syntax.HIJK.Haskell.Haskell-c2hs :cal SetSyn("chaskell")<CR> +an 50.50.140 &Syntax.HIJK.Haskell.Haskell-literate :cal SetSyn("lhaskell")<CR> +an 50.50.150 &Syntax.HIJK.HASTE :cal SetSyn("haste")<CR> +an 50.50.160 &Syntax.HIJK.HASTE\ preproc :cal SetSyn("hastepreproc")<CR> +an 50.50.170 &Syntax.HIJK.Hercules :cal SetSyn("hercules")<CR> +an 50.50.180 &Syntax.HIJK.Hex\ dump.XXD :cal SetSyn("xxd")<CR> +an 50.50.190 &Syntax.HIJK.Hex\ dump.Intel\ MCS51 :cal SetSyn("hex")<CR> +an 50.50.200 &Syntax.HIJK.HTML.HTML :cal SetSyn("html")<CR> +an 50.50.210 &Syntax.HIJK.HTML.HTML\ with\ M4 :cal SetSyn("htmlm4")<CR> +an 50.50.220 &Syntax.HIJK.HTML.HTML\ with\ Ruby\ (eRuby) :cal SetSyn("eruby")<CR> +an 50.50.230 &Syntax.HIJK.HTML.Cheetah\ HTML\ template :cal SetSyn("htmlcheetah")<CR> +an 50.50.240 &Syntax.HIJK.HTML.Django\ HTML\ template :cal SetSyn("htmldjango")<CR> +an 50.50.250 &Syntax.HIJK.HTML.HTML/OS :cal SetSyn("htmlos")<CR> +an 50.50.260 &Syntax.HIJK.HTML.XHTML :cal SetSyn("xhtml")<CR> +an 50.50.270 &Syntax.HIJK.Host\.conf :cal SetSyn("hostconf")<CR> +an 50.50.280 &Syntax.HIJK.Hyper\ Builder :cal SetSyn("hb")<CR> +an 50.50.300 &Syntax.HIJK.Icewm\ menu :cal SetSyn("icemenu")<CR> +an 50.50.310 &Syntax.HIJK.Icon :cal SetSyn("icon")<CR> +an 50.50.320 &Syntax.HIJK.IDL\Generic\ IDL :cal SetSyn("idl")<CR> +an 50.50.330 &Syntax.HIJK.IDL\Microsoft\ IDL :cal SetSyn("msidl")<CR> +an 50.50.340 &Syntax.HIJK.Indent\ profile :cal SetSyn("indent")<CR> +an 50.50.350 &Syntax.HIJK.Inform :cal SetSyn("inform")<CR> +an 50.50.360 &Syntax.HIJK.Informix\ 4GL :cal SetSyn("fgl")<CR> +an 50.50.370 &Syntax.HIJK.Initng :cal SetSyn("initng")<CR> +an 50.50.380 &Syntax.HIJK.Inittab :cal SetSyn("inittab")<CR> +an 50.50.390 &Syntax.HIJK.Inno\ setup :cal SetSyn("iss")<CR> +an 50.50.400 &Syntax.HIJK.InstallShield\ script :cal SetSyn("ishd")<CR> +an 50.50.410 &Syntax.HIJK.Interactive\ Data\ Lang :cal SetSyn("idlang")<CR> +an 50.50.420 &Syntax.HIJK.IPfilter :cal SetSyn("ipfilter")<CR> +an 50.50.440 &Syntax.HIJK.JAL :cal SetSyn("jal")<CR> +an 50.50.450 &Syntax.HIJK.JAM :cal SetSyn("jam")<CR> +an 50.50.460 &Syntax.HIJK.Jargon :cal SetSyn("jargon")<CR> +an 50.50.470 &Syntax.HIJK.Java.Java :cal SetSyn("java")<CR> +an 50.50.480 &Syntax.HIJK.Java.JavaCC :cal SetSyn("javacc")<CR> +an 50.50.490 &Syntax.HIJK.Java.Java\ Server\ Pages :cal SetSyn("jsp")<CR> +an 50.50.500 &Syntax.HIJK.Java.Java\ Properties :cal SetSyn("jproperties")<CR> +an 50.50.510 &Syntax.HIJK.JavaScript :cal SetSyn("javascript")<CR> +an 50.50.520 &Syntax.HIJK.Jess :cal SetSyn("jess")<CR> +an 50.50.530 &Syntax.HIJK.Jgraph :cal SetSyn("jgraph")<CR> +an 50.50.550 &Syntax.HIJK.Kconfig :cal SetSyn("kconfig")<CR> +an 50.50.560 &Syntax.HIJK.KDE\ script :cal SetSyn("kscript")<CR> +an 50.50.570 &Syntax.HIJK.Kimwitu++ :cal SetSyn("kwt")<CR> +an 50.50.580 &Syntax.HIJK.KixTart :cal SetSyn("kix")<CR> an 50.60.100 &Syntax.L-Ma.Lace :cal SetSyn("lace")<CR> an 50.60.110 &Syntax.L-Ma.LamdaProlog :cal SetSyn("lprolog")<CR> an 50.60.120 &Syntax.L-Ma.Latte :cal SetSyn("latte")<CR> @@ -402,24 +404,25 @@ an 50.90.330 &Syntax.R-Sg.Ruby :cal SetSyn("ruby")<CR> an 50.90.350 &Syntax.R-Sg.S-Lang :cal SetSyn("slang")<CR> an 50.90.360 &Syntax.R-Sg.Samba\ config :cal SetSyn("samba")<CR> an 50.90.370 &Syntax.R-Sg.SAS :cal SetSyn("sas")<CR> -an 50.90.380 &Syntax.R-Sg.Sather :cal SetSyn("sather")<CR> -an 50.90.390 &Syntax.R-Sg.Scheme :cal SetSyn("scheme")<CR> -an 50.90.400 &Syntax.R-Sg.Scilab :cal SetSyn("scilab")<CR> -an 50.90.410 &Syntax.R-Sg.Screen\ RC :cal SetSyn("screen")<CR> -an 50.90.420 &Syntax.R-Sg.SDL :cal SetSyn("sdl")<CR> -an 50.90.430 &Syntax.R-Sg.Sed :cal SetSyn("sed")<CR> -an 50.90.440 &Syntax.R-Sg.Sendmail\.cf :cal SetSyn("sm")<CR> -an 50.90.450 &Syntax.R-Sg.Send-pr :cal SetSyn("sendpr")<CR> -an 50.90.460 &Syntax.R-Sg.Sensors\.conf :cal SetSyn("sensors")<CR> -an 50.90.470 &Syntax.R-Sg.Service\ Location\ config :cal SetSyn("slpconf")<CR> -an 50.90.480 &Syntax.R-Sg.Service\ Location\ registration :cal SetSyn("slpreg")<CR> -an 50.90.490 &Syntax.R-Sg.Service\ Location\ SPI :cal SetSyn("slpspi")<CR> -an 50.90.500 &Syntax.R-Sg.Services :cal SetSyn("services")<CR> -an 50.90.510 &Syntax.R-Sg.Setserial\ config :cal SetSyn("setserial")<CR> -an 50.90.520 &Syntax.R-Sg.SGML.SGML\ catalog :cal SetSyn("catalog")<CR> -an 50.90.530 &Syntax.R-Sg.SGML.SGML\ DTD :cal SetSyn("sgml")<CR> -an 50.90.540 &Syntax.R-Sg.SGML.SGML\ Declaration :cal SetSyn("sgmldecl")<CR> -an 50.90.550 &Syntax.R-Sg.SGML.SGML-linuxdoc :cal SetSyn("sgmllnx")<CR> +an 50.90.380 &Syntax.R-Sg.Sass :cal SetSyn("sass")<CR> +an 50.90.390 &Syntax.R-Sg.Sather :cal SetSyn("sather")<CR> +an 50.90.400 &Syntax.R-Sg.Scheme :cal SetSyn("scheme")<CR> +an 50.90.410 &Syntax.R-Sg.Scilab :cal SetSyn("scilab")<CR> +an 50.90.420 &Syntax.R-Sg.Screen\ RC :cal SetSyn("screen")<CR> +an 50.90.430 &Syntax.R-Sg.SDL :cal SetSyn("sdl")<CR> +an 50.90.440 &Syntax.R-Sg.Sed :cal SetSyn("sed")<CR> +an 50.90.450 &Syntax.R-Sg.Sendmail\.cf :cal SetSyn("sm")<CR> +an 50.90.460 &Syntax.R-Sg.Send-pr :cal SetSyn("sendpr")<CR> +an 50.90.470 &Syntax.R-Sg.Sensors\.conf :cal SetSyn("sensors")<CR> +an 50.90.480 &Syntax.R-Sg.Service\ Location\ config :cal SetSyn("slpconf")<CR> +an 50.90.490 &Syntax.R-Sg.Service\ Location\ registration :cal SetSyn("slpreg")<CR> +an 50.90.500 &Syntax.R-Sg.Service\ Location\ SPI :cal SetSyn("slpspi")<CR> +an 50.90.510 &Syntax.R-Sg.Services :cal SetSyn("services")<CR> +an 50.90.520 &Syntax.R-Sg.Setserial\ config :cal SetSyn("setserial")<CR> +an 50.90.530 &Syntax.R-Sg.SGML.SGML\ catalog :cal SetSyn("catalog")<CR> +an 50.90.540 &Syntax.R-Sg.SGML.SGML\ DTD :cal SetSyn("sgml")<CR> +an 50.90.550 &Syntax.R-Sg.SGML.SGML\ Declaration :cal SetSyn("sgmldecl")<CR> +an 50.90.560 &Syntax.R-Sg.SGML.SGML-linuxdoc :cal SetSyn("sgmllnx")<CR> an 50.100.100 &Syntax.Sh-S.Shell\ script.sh\ and\ ksh :cal SetSyn("sh")<CR> an 50.100.110 &Syntax.Sh-S.Shell\ script.csh :cal SetSyn("csh")<CR> an 50.100.120 &Syntax.Sh-S.Shell\ script.tcsh :cal SetSyn("tcsh")<CR> diff --git a/runtime/syntax/ada.vim b/runtime/syntax/ada.vim index f31770077..8d76fb8f4 100644 --- a/runtime/syntax/ada.vim +++ b/runtime/syntax/ada.vim @@ -9,9 +9,9 @@ " Contributors: Preben Randhol. " $Author$ " $Date$ -" Version: 4.2 +" Version: 4.6 " $Revision$ -" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/syntax/ada.vim $ +" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/syntax/ada.vim $ " http://www.dwheeler.com/vim " History: 24.05.2006 MK Unified Headers " 26.05.2006 MK ' should not be in iskeyword. @@ -38,8 +38,6 @@ let b:current_syntax = "ada" " Section: Ada is entirely case-insensitive. {{{1 " syntax case ignore -setlocal nosmartcase -setlocal ignorecase " Section: Highlighting commands {{{1 " @@ -98,7 +96,8 @@ syntax keyword adaSpecial <> " if exists("g:ada_rainbow_color") syntax match adaSpecial "[:;.,]" - runtime plugin/Rainbow_Parenthsis.vim + call rainbow_parenthsis#LoadRound () + call rainbow_parenthsis#Activate () else syntax match adaSpecial "[:;().,]" endif @@ -159,7 +158,7 @@ endif " Section: end {{{1 " Unless special ("end loop", "end if", etc.), "end" marks the end of a " begin, package, task etc. Assiging it to adaEnd. -syntax match adaEnd "\<end\>" +syntax match adaEnd /\<end\>/ syntax keyword adaPreproc pragma @@ -346,9 +345,6 @@ else endif -" Section: formatoptions {{{1 -" -setlocal formatoptions+=ron " Section: sync {{{1 " diff --git a/runtime/syntax/debchangelog.vim b/runtime/syntax/debchangelog.vim index 28fe85472..e751fbc72 100644 --- a/runtime/syntax/debchangelog.vim +++ b/runtime/syntax/debchangelog.vim @@ -19,7 +19,7 @@ syn case ignore " Define some common expressions we can use later on syn match debchangelogName contained "^[[:alpha:]][[:alnum:].+-]\+ " syn match debchangelogUrgency contained "; urgency=\(low\|medium\|high\|critical\|emergency\)\( \S.*\)\=" -syn match debchangelogTarget contained "\( \(old\)\=stable\| frozen\| unstable\| testing-proposed-updates\| experimental\| \%(sarge\|etch\|lenny\)-\%(backports\|-volatile\)\| \(old\)\=stable-security\| testing-security\| \(dapper\|edgy\|feisty\|gutsy\|hardy\)\(-\(security\|proposed\|updates\|backports\|commercial\|partner\)\)\?\)\+" +syn match debchangelogTarget contained "\v %(%(old)=stable|frozen|unstable|%(testing-|%(old)=stable-)=proposed-updates|experimental|%(sarge|etch|lenny)-%(backports|volatile)|%(testing|%(old)=stable)-security|%(dapper|feisty|gutsy|hardy|intrepid)%(-%(security|proposed|updates|backports|commercial|partner))=)+" syn match debchangelogVersion contained "(.\{-})" syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*" syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*" diff --git a/runtime/syntax/debcontrol.vim b/runtime/syntax/debcontrol.vim index 3b01fb50a..d56a34232 100644 --- a/runtime/syntax/debcontrol.vim +++ b/runtime/syntax/debcontrol.vim @@ -34,6 +34,7 @@ syn match debcontrolPriority contained "\(extra\|important\|optional\|required\| syn match debcontrolSection contained "\(\(contrib\|non-free\|non-US/main\|non-US/contrib\|non-US/non-free\|restricted\|universe\|multiverse\)/\)\=\(admin\|base\|comm\|devel\|doc\|editors\|electronics\|embedded\|games\|gnome\|graphics\|hamradio\|interpreters\|kde\|libs\|libdevel\|mail\|math\|misc\|net\|news\|oldlibs\|otherosfs\|perl\|python\|science\|shells\|sound\|text\|tex\|utils\|web\|x11\|debian-installer\)" syn match debcontrolPackageType contained "u\?deb" syn match debcontrolVariable contained "\${.\{-}}" +syn match debcontrolDmUpload contained "\cyes" " A URL (using the domain name definitions from RFC 1034 and 1738), right now " only enforce protocol and some sanity on the server/path part; @@ -52,7 +53,7 @@ syn match debcontrolComment "^#.*$" syn case ignore " List of all legal keys -syn match debcontrolKey contained "^\(Source\|Package\|Section\|Priority\|Maintainer\|Uploaders\|Build-Depends\|Build-Conflicts\|Build-Depends-Indep\|Build-Conflicts-Indep\|Standards-Version\|Pre-Depends\|Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Essential\|Architecture\|Description\|Bugs\|Origin\|Enhances\|Homepage\|\(XS-\)\=Vcs-\(Browser\|Arch\|Bzr\|Cvs\|Darcs\|Git\|Hg\|Mtn\|Svn\)\|XC-Package-Type\): *" +syn match debcontrolKey contained "^\(Source\|Package\|Section\|Priority\|Maintainer\|Uploaders\|Build-Depends\|Build-Conflicts\|Build-Depends-Indep\|Build-Conflicts-Indep\|Standards-Version\|Pre-Depends\|Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Essential\|Architecture\|Description\|Bugs\|Origin\|Enhances\|Homepage\|\(XS-\)\=Vcs-\(Browser\|Arch\|Bzr\|Cvs\|Darcs\|Git\|Hg\|Mtn\|Svn\)\|XC-Package-Type\|\%(XS-\)\=DM-Upload-Allowed\): *" " Fields for which we do strict syntax checking syn region debcontrolStrictField start="^Architecture" end="$" contains=debcontrolKey,debcontrolArchitecture,debcontrolSpace oneline @@ -65,6 +66,7 @@ syn region debcontrolStrictField start="^\%(XS-\)\?Vcs-\%(Browser\|Arch\|Bzr\|Da syn region debcontrolStrictField start="^\%(XS-\)\?Vcs-Svn" end="$" contains=debcontrolKey,debcontrolVcsSvn,debcontrolHTTPUrl oneline keepend syn region debcontrolStrictField start="^\%(XS-\)\?Vcs-Cvs" end="$" contains=debcontrolKey,debcontrolVcsCvs oneline keepend syn region debcontrolStrictField start="^\%(XS-\)\?Vcs-Git" end="$" contains=debcontrolKey,debcontrolVcsGit oneline keepend +syn region debcontrolStrictField start="^\%(XS-\)\?DM-Upload-Allowed" end="$" contains=debcontrolKey,debcontrolDmUpload oneline " Catch-all for the other legal fields syn region debcontrolField start="^\(Maintainer\|Standards-Version\|Essential\|Bugs\|Origin\|X\(S\|B\)-Python-Version\|XSBC-Original-Maintainer\|\(XS-\)\?Vcs-Mtn\):" end="$" contains=debcontrolKey,debcontrolVariable,debcontrolEmail oneline @@ -94,6 +96,7 @@ if version >= 508 || !exists("did_debcontrol_syn_inits") HiLink debcontrolVcsCvs Identifier HiLink debcontrolVcsGit Identifier HiLink debcontrolHTTPUrl Identifier + HiLink debcontrolDmUpload Identifier HiLink debcontrolComment Comment HiLink debcontrolElse Special diff --git a/runtime/syntax/debsources.vim b/runtime/syntax/debsources.vim index c952ed82c..0ae05abd6 100644 --- a/runtime/syntax/debsources.vim +++ b/runtime/syntax/debsources.vim @@ -1,12 +1,9 @@ " Vim syntax file -" Language: Debian sources.list -" Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl> -" Last Change: $Date$ -" URL: http://www.cacholong.nl/~matthijs/vim/syntax/debsources.vim -" $Revision$ - -" this is a very simple syntax file - I will be improving it -" add entire DEFINE syntax +" Language: Debian sources.list +" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> +" Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl> +" Last Change: 2008-04-25 +" URL: http://git.debian.org/?p=pkg-vim/vim.git;a=blob_plain;f=runtime/syntax/debsources.vim;hb=debian " Standard syntax initialization if version < 600 @@ -19,14 +16,14 @@ endif syn case match " A bunch of useful keywords -syn match debsourcesKeyword /\(deb-src\|deb\|main\|contrib\|non-free\)/ +syn match debsourcesKeyword /\(deb-src\|deb\|main\|contrib\|non-free\|restricted\|universe\|multiverse\)/ " Match comments syn match debsourcesComment /#.*/ " Match uri's -syn match debsourcesUri +\(http://\|ftp://\|file:///\)[^' <>"]\++ -syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\(woody\|sarge\|etch\|old-stable\|stable\|testing\|unstable\|sid\|experimental\|warty\|hoary\|breezy\)\([[:alnum:]_./]*\)+ +syn match debsourcesUri +\(http://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\++ +syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\(sarge\|etch\|lenny\|\(old\)\=stable\|testing\|unstable\|sid\|experimental\|dapper\|feisty\|gutsy\|hardy\|intrepid\)\([-[:alnum:]_./]*\)+ " Associate our matches and regions with pretty colours hi def link debsourcesLine Error diff --git a/runtime/syntax/eruby.vim b/runtime/syntax/eruby.vim index 22a84537c..46e570405 100644 --- a/runtime/syntax/eruby.vim +++ b/runtime/syntax/eruby.vim @@ -22,7 +22,7 @@ if !exists("b:eruby_subtype") && main_syntax == 'eruby' let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+') if b:eruby_subtype == '' - let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\)\+$','',''),'\.\zs\w\+$') + let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\)\+$','',''),'\.\zs\w\+$') endif if b:eruby_subtype == 'rhtml' let b:eruby_subtype = 'html' @@ -55,31 +55,20 @@ syn include @rubyTop syntax/ruby.vim syn cluster erubyRegions contains=erubyOneLiner,erubyBlock,erubyExpression,erubyComment -exe 'syn region erubyOneLiner matchgroup=erubyDelimiter start="^%\{1,'.b:eruby_nest_level.'\}%\@!" end="$" contains=@rubyTop containedin=ALLBUT,@erbRegions keepend oneline' -exe 'syn region erubyBlock matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}%\@!-\=" end="-\=%>" contains=@rubyTop containedin=ALLBUT,@erbRegions' -exe 'syn region erubyExpression matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}=" end="-\=%>" contains=@rubyTop containedin=ALLBUT,@erbRegions' -exe 'syn region erubyComment matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}#" end="-\=%>" contains=rubyTodo,@Spell containedin=ALLBUT,@erbRegions keepend' +exe 'syn region erubyOneLiner matchgroup=erubyDelimiter start="^%\{1,'.b:eruby_nest_level.'\}%\@!" end="$" contains=@rubyTop containedin=ALLBUT,@erubyRegions keepend oneline' +exe 'syn region erubyBlock matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}%\@!-\=" end="-\=%\@<!%\{1,'.b:eruby_nest_level.'\}>" contains=@rubyTop containedin=ALLBUT,@erubyRegions keepend' +exe 'syn region erubyExpression matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}=" end="-\=%\@<!%\{1,'.b:eruby_nest_level.'\}>" contains=@rubyTop containedin=ALLBUT,@erubyRegions keepend' +exe 'syn region erubyComment matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}#" end="-\=%\@<!%\{1,'.b:eruby_nest_level.'\}>" contains=rubyTodo,@Spell containedin=ALLBUT,@erubyRegions keepend' " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_eruby_syntax_inits") - if version < 508 - let did_ruby_syntax_inits = 1 - command -nargs=+ HiLink hi link <args> - else - command -nargs=+ HiLink hi def link <args> - endif - HiLink erubyDelimiter Delimiter - HiLink erubyComment Comment +hi def link erubyDelimiter Delimiter +hi def link erubyComment Comment - delcommand HiLink -endif let b:current_syntax = 'eruby' if main_syntax == 'eruby' unlet main_syntax endif -" vim: nowrap sw=2 sts=2 ts=8 : +" vim: nowrap sw=2 sts=2 ts=8: diff --git a/runtime/syntax/haml.vim b/runtime/syntax/haml.vim new file mode 100644 index 000000000..8b22d8c48 --- /dev/null +++ b/runtime/syntax/haml.vim @@ -0,0 +1,85 @@ +" Vim syntax file +" Language: Haml +" Maintainer: Tim Pope <vimNOSPAM@tpope.info> +" Filenames: *.haml + +if exists("b:current_syntax") + finish +endif + +if !exists("main_syntax") + let main_syntax = 'haml' +endif +let b:ruby_no_expensive = 1 + +runtime! syntax/html.vim +unlet! b:current_syntax +silent! syn include @hamlSassTop syntax/sass.vim +unlet! b:current_syntax +syn include @hamlRubyTop syntax/ruby.vim + +syn case match + +syn cluster hamlComponent contains=hamlAttributes,hamlClassChar,hamlIdChar,hamlObject,hamlDespacer,hamlSelfCloser,hamlRuby,hamlPlainChar,hamlInterpolatable +syn cluster hamlEmbeddedRuby contains=hamlAttributes,hamlObject,hamlRuby,hamlRubyFilter +syn cluster hamlTop contains=hamlBegin,hamlPlainFilter,hamlRubyFilter,hamlSassFilter,hamlComment,hamlHtmlComment + +syn match hamlBegin "^\s*[<>&]\@!" nextgroup=hamlTag,hamlAttributes,hamlClassChar,hamlIdChar,hamlObject,hamlRuby,hamlPlainChar,hamlInterpolatable + +syn match hamlTag "%\w\+" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@hamlComponent +syn region hamlAttributes matchgroup=hamlAttributesDelimiter start="{" end="}" contained contains=@hamlRubyTop nextgroup=@hamlComponent +syn region hamlObject matchgroup=hamlObjectDelimiter start="\[" end="\]" contained contains=@hamlRubyTop nextgroup=@hamlComponent +syn match hamlDespacer "[<>]" contained nextgroup=hamlDespacer,hamlSelfCloser,hamlRuby,hamlPlainChar,hamlInterpolatable +syn match hamlSelfCloser "/" contained +syn match hamlClassChar "\." contained nextgroup=hamlClass +syn match hamlIdChar "#" contained nextgroup=hamlId +syn match hamlClass "\%(\w\|-\)\+" contained nextgroup=@hamlComponent +syn match hamlId "\%(\w\|-\)\+" contained nextgroup=@hamlComponent +syn region hamlDocType start="^\s*!!!" end="$" + +syn region hamlRuby matchgroup=hamlRubyOutputChar start="[=~]" end="$" contained contains=@hamlRubyTop keepend +syn region hamlRuby matchgroup=hamlRubyChar start="-" end="$" contained contains=@hamlRubyTop keepend +syn match hamlPlainChar "\\" contained +syn region hamlInterpolatable matchgroup=hamlInterpolatableChar start="==" end="$" keepend contained contains=hamlInterpolation +syn region hamlInterpolation matchgroup=hamlInterpolationDelimiter start="#{" end="}" contained contains=@hamlRubyTop + +syn match hamlHelper "\<action_view?\|\.\@<!\<\%(flatten\|open\|puts\)" contained containedin=@hamlEmbeddedRuby,@hamlRubyTop,rubyInterpolation +syn keyword hamlHelper capture_haml find_and_preserve html_attrs init_haml_helpers list_of preced preserve succeed surround tab_down tab_up page_class contained containedin=@hamlEmbeddedRuby,@hamlRubyTop,rubyInterpolation + +syn region hamlPlainFilter matchgroup=hamlFilter start="^\z(\s*\):\%(plain\|preserve\|erb\|redcloth\|textile\|markdown\)\s*$" end="^\%(\z1 \)\@!" contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlComment,@htmlTop +syn region hamlRubyFilter matchgroup=hamlFilter start="^\z(\s*\):ruby\s*$" end="^\%(\z1 \)\@!" contains=@hamlRubyTop +syn region hamlSassFilter matchgroup=hamlFilter start="^\z(\s*\):sass\s*$" end="^\%(\z1 \)\@!" contains=@hamlSassTop + +syn region hamlJavascriptBlock start="^\z(\s*\)%script" nextgroup=@hamlComponent,hamlError end="^\%(\z1 \)\@!" contains=@hamlTop,@htmlJavaScript keepend +syn region hamlCssBlock start="^\z(\s*\)%style" nextgroup=@hamlComponent,hamlError end="^\%(\z1 \)\@!" contains=@hamlTop,@htmlCss keepend +syn match hamlError "\$" contained + +syn region hamlComment start="^\z(\s*\)-#" end="^\%(\z1 \)\@!" contains=rubyTodo +syn region hamlHtmlComment start="^\z(\s*\)/" end="^\%(\z1 \)\@!" contains=@hamlTop,rubyTodo +syn match hamlIEConditional "\%(^\s*/\)\@<=\[if\>[^]]*]" contained containedin=hamlHtmlComment + +hi def link hamlSelfCloser Special +hi def link hamlDespacer Special +hi def link hamlClassChar Special +hi def link hamlIdChar Special +hi def link hamlTag Special +hi def link hamlClass Type +hi def link hamlId Identifier +hi def link hamlPlainChar Special +hi def link hamlInterpolatableChar hamlRubyChar +hi def link hamlRubyOutputChar hamlRubyChar +hi def link hamlRubyChar Special +hi def link hamlInterpolationDelimiter Delimiter +hi def link hamlDocType PreProc +hi def link hamlFilter PreProc +hi def link hamlAttributesDelimiter Delimiter +hi def link hamlObjectDelimiter Delimiter +hi def link hamlHelper Function +hi def link hamlHtmlComment hamlComment +hi def link hamlComment Comment +hi def link hamlIEConditional SpecialComment +hi def link hamlError Error + +let b:current_syntax = "haml" + +" vim:set sw=2: diff --git a/runtime/syntax/haste.vim b/runtime/syntax/haste.vim index cf943f108..b889c5c59 100644 --- a/runtime/syntax/haste.vim +++ b/runtime/syntax/haste.vim @@ -1,9 +1,12 @@ " Vim syntax file -" Language: HASTE +" Language: HASTE - a language for VLSI IC programming " Maintainer: M. Tranchero - maurizio.tranchero?gmail.com " Credits: some parts have been taken from vhdl, verilog, and C syntax " files -" version: 0.5 +" Version: 0.9 +" Last Change: 0.9 improvement of haste numbers detection +" Change: 0.8 error matching for wrong hierarchical connections +" Change: 0.7 added more rules to highlight pre-processor directives " HASTE if exists("b:current_syntax") @@ -50,6 +53,7 @@ syn match hasteStatement "\<\(for\|do\|od\)\>" syn match hasteStatement "\<\(do\|or\|od\)\>" syn match hasteStatement "\<\(sel\|les\)\>" syn match hasteError "\<\d\+[_a-zA-Z]\+\>" +syn match hasteError "\(\([[:alnum:]]\+\s*(\s\+\|)\s*,\)\)\s*\([[:alnum:]]\+\s*(\)" " Predifined Haste types syn keyword hasteType bool @@ -60,39 +64,28 @@ syn keyword hasteType bool syn match hasteVector "0b\"[01_]\+\"" syn match hasteVector "0x\"[0-9a-f_]\+\"" syn match hasteCharacter "'.'" -syn region hasteString start=+"+ end=+"+ -" C pre-processor directives -"syn region hasteIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ +" syn region hasteString start=+"+ end=+"+ syn match hasteIncluded display contained "<[^>]*>" syn match hasteIncluded display contained "<[^"]*>" -syn match hasteInclude display "^\s*#include\>\s*["<]" contains=hasteIncluded -syn region hasteDefine start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@hastePreProcGroup,@Spell -syn region hasteDefine start="^\s*\(%:\|#\)\s*\(ifndef\|ifdef\|endif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=@Spell -syn region hastePreCondit start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=hasteComment,hasteCppString,hasteCharacter,hasteCppParen,hasteParenError,hasteNumbers,hasteCommentError,hasteSpaceError -syn region hastePreProc start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@hastePreProcGroup,@Spell -syn cluster hastePreProcGroup contains=hasteIncluded,hasteInclude,hasteDefine -syn region hasteCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=hasteSpaceError,hasteCppSkip +syn region hasteInclude start="^\s*#include\>\s*" end="$" contains=hasteIncluded,hasteString -" floating numbers -syn match hasteNumber "-\=\<\d\+\.\d\+\(E[+\-]\=\d\+\)\>" -syn match hasteNumber "-\=\<\d\+\.\d\+\>" -syn match hasteNumber "0*2#[01_]\+\.[01_]\+#\(E[+\-]\=\d\+\)\=" -syn match hasteNumber "0*16#[0-9a-f_]\+\.[0-9a-f_]\+#\(E[+\-]\=\d\+\)\=" " integer numbers -syn match hasteNumber "-\=\<\d\+\(E[+\-]\=\d\+\)\>" +syn match hasteNumber "\d\+\^[[:alnum:]]*[-+]\{0,1\}[[:alnum:]]*" +syn match hasteNumber "-\=\<\d\+\(\^[+\-]\=\d\+\)\>" syn match hasteNumber "-\=\<\d\+\>" -syn match hasteNumber "0*2#[01_]\+#\(E[+\-]\=\d\+\)\=" -syn match hasteNumber "0*16#[0-9a-f_]\+#\(E[+\-]\=\d\+\)\=" +" syn match hasteNumber "0*2#[01_]\+#\(\^[+\-]\=\d\+\)\=" +" syn match hasteNumber "0*16#[0-9a-f_]\+#\(\^[+\-]\=\d\+\)\=" " operators -syn keyword hasteSeparators & , . \| : +syn keyword hasteSeparators & , . \| syn keyword hasteExecution \|\| ; @ -syn keyword hasteOperator := ? ! +syn keyword hasteOperator := ? ! : syn keyword hasteTypeConstr "[" << >> .. "]" ~ syn keyword hasteExprOp < <= >= > = # <> + - * == ## syn keyword hasteMisc ( ) 0x 0b " syn match hasteSeparators "[&:\|,.]" syn match hasteOperator ":=" +syn match hasteOperator ":" syn match hasteOperator "?" syn match hasteOperator "!" syn match hasteExecution "||" @@ -110,7 +103,7 @@ syn match hasteExprOp "<>" syn match hasteExprOp "=" syn match hasteExprOp "==" syn match hasteExprOp "##" -syn match hasteExprOp "#" +" syn match hasteExprOp "#" syn match hasteExprOp "*" syn match hasteExprOp "+" @@ -133,6 +126,7 @@ hi def link hasteType Type hi def link hasteGlobal Error hi def link hasteError Error hi def link hasteAttribute Type +" hi def link hasteSeparators Special hi def link hasteExecution Special hi def link hasteTypeConstr Special @@ -143,7 +137,8 @@ hi def link hasteFutureExt Error hi def link hasteVerilog Error hi def link hasteDefine Macro hi def link hasteInclude Include -hi def link hastePreProc PreProc +" hi def link hastePreProc Preproc +" hi def link hastePreProcVar Special let b:current_syntax = "haste" diff --git a/runtime/syntax/hastepreproc.vim b/runtime/syntax/hastepreproc.vim new file mode 100644 index 000000000..3fcb8ddd3 --- /dev/null +++ b/runtime/syntax/hastepreproc.vim @@ -0,0 +1,49 @@ +" Vim syntax file +" Language: Haste preprocessor files +" Maintainer: M. Tranchero - maurizio.tranchero@gmail.com +" Credits: some parts have been taken from vhdl, verilog, and C syntax +" files +" Version: 0.5 + +" HASTE +if exists("b:current_syntax") + finish +endif +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif +" Read the C syntax to start with +if version < 600 + so <sfile>:p:h/haste.vim +else + runtime! syntax/haste.vim + unlet b:current_syntax +endif + +" case is significant +syn case match + +" C pre-processor directives +syn match hastepreprocVar display "\$[[:alnum:]_]*" +syn region hastepreprocVar start="\${" end="}" contains=hastepreprocVar +" +"syn region hastepreproc start="#\[\s*tg[:alnum:]*" end="]#" contains=hastepreprocVar,hastepreproc,hastepreprocError,@Spell +syn region hastepreproc start="#\[\s*\(\|tgfor\|tgif\)" end="$" contains=hastepreprocVar,hastepreproc,@Spell +syn region hastepreproc start="}\s\(else\)\s{" end="$" contains=hastepreprocVar,hastepreproc,@Spell +syn region hastepreproc start="^\s*#\s*\(ifndef\|ifdef\|else\|endif\)\>" end="$" contains=@hastepreprocGroup,@Spell +syn region hastepreproc start="\s*##\s*\(define\|undef\)\>" end="$" contains=@hastepreprocGroup,@Spell +syn match hastepreproc "}\{0,1}\s*]#" + +" Define the default highlighting. +" Only when an item doesn't have highlighting yet +hi def link hastepreproc Preproc +hi def link hastepreprocVar Special +hi def link hastepreprocError Error + +let b:current_syntax = "hastepreproc" + +" vim: ts=8 diff --git a/runtime/syntax/lhaskell.vim b/runtime/syntax/lhaskell.vim index d6f21ae7c..7ff09e7b3 100644 --- a/runtime/syntax/lhaskell.vim +++ b/runtime/syntax/lhaskell.vim @@ -4,8 +4,8 @@ " \begin{code} \end{code} blocks " Maintainer: Haskell Cafe mailinglist <haskell-cafe@haskell.org> " Original Author: Arthur van Leeuwen <arthurvl@cs.uu.nl> -" Last Change: 2004 Aug 31 -" Version: 1.01 +" Last Change: 2008 Jul 01 +" Version: 1.02 " " Thanks to Ian Lynagh for thoughtful comments on initial versions and " for the inspiration for writing this in the first place. @@ -29,6 +29,8 @@ " 2004 February 20: Cleaned up the guessing and overriding a bit " 2004 February 23: Cleaned up syntax highlighting for \begin{code} and " \end{code}, added some clarification to the attributions +" 2008 July 1: Removed % from guess list, as it totally breaks plain +" text markup guessing " @@ -71,14 +73,14 @@ call cursor(1,1) " - \begin{env} (for env != code) " - \part, \chapter, \section, \subsection, \subsubsection, etc if b:lhs_markup == "unknown" - if search('%\|\\documentclass\|\\begin{\(code}\)\@!\|\\\(sub\)*section\|\\chapter|\\part','W') != 0 + if search('\\documentclass\|\\begin{\(code}\)\@!\|\\\(sub \)*section\|\\chapter|\\part','W') != 0 let b:lhs_markup = "tex" else let b:lhs_markup = "plain" endif endif -" If user wants us to highlight TeX syntax, read it. +" If user wants us to highlight TeX syntax or guess thinks it's TeX, read it. if b:lhs_markup == "tex" if version < 600 source <sfile>:p:h/tex.vim diff --git a/runtime/syntax/logtalk.vim b/runtime/syntax/logtalk.vim index 6faf5960e..5fcbb0974 100644 --- a/runtime/syntax/logtalk.vim +++ b/runtime/syntax/logtalk.vim @@ -2,7 +2,7 @@ " " Language: Logtalk " Maintainer: Paulo Moura <pmoura@logtalk.org> -" Last Change: February 24, 2006 +" Last Change: June 16, 2008 " Quit when a syntax file was already loaded: @@ -32,12 +32,15 @@ syn match logtalkOperator ":-" " Logtalk quoted atoms and strings syn region logtalkString start=+"+ skip=+\\"+ end=+"+ -syn region logtalkAtom start=+'+ skip=+\\'+ end=+'+ +syn region logtalkAtom start=+'+ skip=+\\'+ end=+'+ contains=logtalkEscapeSequence + +syn match logtalkEscapeSequence contained "\\\([\\abfnrtv\"\']\|\(x[a-fA-F0-9]\+\|[0-7]\+\)\\\)" " Logtalk message sending operators syn match logtalkOperator "::" +syn match logtalkOperator ":" syn match logtalkOperator "\^\^" @@ -48,7 +51,7 @@ syn region logtalkExtCall matchgroup=logtalkExtCallTag start="{" matchgroup=l " Logtalk opening entity directives -syn region logtalkOpenEntityDir matchgroup=logtalkOpenEntityDirTag start=":- object(" matchgroup=logtalkOpenEntityDirTag end=")\." contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkEntityRel +syn region logtalkOpenEntityDir matchgroup=logtalkOpenEntityDirTag start=":- object(" matchgroup=logtalkOpenEntityDirTag end=")\." contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkString,logtalkAtom,logtalkEntityRel syn region logtalkOpenEntityDir matchgroup=logtalkOpenEntityDirTag start=":- protocol(" matchgroup=logtalkOpenEntityDirTag end=")\." contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkEntityRel syn region logtalkOpenEntityDir matchgroup=logtalkOpenEntityDirTag start=":- category(" matchgroup=logtalkOpenEntityDirTag end=")\." contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkEntityRel @@ -62,17 +65,19 @@ syn match logtalkCloseEntityDir ":- end_category\." " Logtalk entity relations -syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="instantiates(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator contained -syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="specializes(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator contained -syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="extends(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator contained -syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="imports(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator contained -syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="implements(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator contained +syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="instantiates(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkString,logtalkAtom contained +syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="specializes(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkString,logtalkAtom contained +syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="extends(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkString,logtalkAtom contained +syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="imports(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkString,logtalkAtom contained +syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="implements(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkString,logtalkAtom contained +syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="complements(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkString,logtalkAtom contained " Logtalk directives syn region logtalkDir matchgroup=logtalkDirTag start=":- alias(" matchgroup=logtalkDirTag end=")\." contains=ALL -syn region logtalkDir matchgroup=logtalkDirTag start=":- encoding(" matchgroup=logtalkDirTag end=")\." contains=ALL +syn region logtalkDir matchgroup=logtalkDirTag start=":- calls(" matchgroup=logtalkDirTag end=")\." contains=ALL +syn region logtalkDir matchgroup=logtalkDirTag start=":- encoding(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- initialization(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- info(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- mode(" matchgroup=logtalkDirTag end=")\." contains=logtalkOperator, logtalkAtom @@ -83,17 +88,18 @@ syn region logtalkDir matchgroup=logtalkDirTag start=":- multifile(" matchgrou syn region logtalkDir matchgroup=logtalkDirTag start=":- public(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- protected(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- private(" matchgroup=logtalkDirTag end=")\." contains=ALL -syn region logtalkDir matchgroup=logtalkDirTag start=":- metapredicate(" matchgroup=logtalkDirTag end=")\." contains=ALL +syn region logtalkDir matchgroup=logtalkDirTag start=":- meta_predicate(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- op(" matchgroup=logtalkDirTag end=")\." contains=ALL -syn region logtalkDir matchgroup=logtalkDirTag start=":- calls(" matchgroup=logtalkDirTag end=")\." contains=ALL +syn region logtalkDir matchgroup=logtalkDirTag start=":- synchronized(" matchgroup=logtalkDirTag end=")\." contains=ALL +syn match logtalkDirTag ":- synchronized\." syn region logtalkDir matchgroup=logtalkDirTag start=":- uses(" matchgroup=logtalkDirTag end=")\." contains=ALL +syn match logtalkDirTag ":- threaded\." " Module directives syn region logtalkDir matchgroup=logtalkDirTag start=":- module(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- export(" matchgroup=logtalkDirTag end=")\." contains=ALL -syn region logtalkDir matchgroup=logtalkDirTag start=":- meta_predicate(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- use_module(" matchgroup=logtalkDirTag end=")\." contains=ALL @@ -103,19 +109,22 @@ syn match logtalkBuiltIn "\<\(abolish\|c\(reate\|urrent\)\)_\(object\|protocol\ syn match logtalkBuiltIn "\<\(object\|protocol\|category\)_property\ze(" -syn match logtalkBuiltIn "\<extends_\(object\|protocol\)\ze(" +syn match logtalkBuiltIn "\<complements_object\ze(" +syn match logtalkBuiltIn "\<extends_\(object\|protocol\|category\)\ze(" syn match logtalkBuiltIn "\<imp\(orts_category\|lements_protocol\)\ze(" -syn match logtalkBuiltIn "\<\(instantiates\|specializes\)_class\ze(" +syn match logtalkBuiltIn "\<\(instantiat\|specializ\)es_class\ze(" syn match logtalkBuiltIn "\<\(abolish\|define\)_events\ze(" syn match logtalkBuiltIn "\<current_event\ze(" -syn match logtalkBuiltIn "\<\(current\|set\)_logtalk_flag\ze(" +syn match logtalkBuiltIn "\<\(curren\|se\)t_logtalk_flag\ze(" syn match logtalkBuiltIn "\<logtalk_\(compile\|l\(ibrary_path\|oad\)\)\ze(" syn match logtalkBuiltIn "\<\(for\|retract\)all\ze(" +syn match logtalkBuiltIn "\<threaded\(_\(call\|once\|ignore\|exit\|peek\|wait\|notify\)\)\?\ze(" + " Logtalk built-in methods @@ -137,7 +146,7 @@ syn match logtalkBuiltInMethod "\<before\ze(" syn match logtalkBuiltInMethod "\<after\ze(" syn match logtalkBuiltInMethod "\<expand_term\ze(" -syn match logtalkBuiltInMethod "\<term_expansion\ze(" +syn match logtalkBuiltInMethod "\<\(goal\|term\)_expansion\ze(" syn match logtalkBuiltInMethod "\<phrase\ze(" @@ -212,7 +221,7 @@ syn match logtalkOperator ">=" " Stream selection and control -syn match logtalkKeyword "\<\(current\|set\)_\(in\|out\)put\ze(" +syn match logtalkKeyword "\<\(curren\|se\)t_\(in\|out\)put\ze(" syn match logtalkKeyword "\<open\ze(" syn match logtalkKeyword "\<close\ze(" syn match logtalkKeyword "\<flush_output\ze(" @@ -235,7 +244,7 @@ syn match logtalkKeyword "\<nl\>" syn match logtalkKeyword "\<read\(_term\)\?\ze(" syn match logtalkKeyword "\<write\(q\|_\(canonical\|term\)\)\?\ze(" syn match logtalkKeyword "\<\(current_\)\?op\ze(" -syn match logtalkKeyword "\<\(current\)\?char_conversion\ze(" +syn match logtalkKeyword "\<\(current_\)\?char_conversion\ze(" " Logic and control @@ -250,12 +259,12 @@ syn match logtalkKeyword "\<repeat\>" syn match logtalkKeyword "\<atom_\(length\|c\(hars\|o\(ncat\|des\)\)\)\ze(" syn match logtalkKeyword "\<sub_atom\ze(" syn match logtalkKeyword "\<char_code\ze(" -syn match logtalkKeyword "\<number_\(c\(hars\|odes\)\)\ze(" +syn match logtalkKeyword "\<number_c\(har\|ode\)s\ze(" " Implementation defined hooks functions -syn match logtalkKeyword "\<\(current\|set\)_prolog_flag\ze(" +syn match logtalkKeyword "\<\(curren\|se\)t_prolog_flag\ze(" syn match logtalkKeyword "\<halt\ze(" syn match logtalkKeyword "\<halt\>" @@ -302,13 +311,13 @@ syn match logtalkOperator "\\" syn match logtalkOperator "|" -" Logtalk numbers +" Logtalk numbers syn match logtalkNumber "\<\d\+\>" syn match logtalkNumber "\<\d\+\.\d\+\>" syn match logtalkNumber "\<\d\+[eE][-+]\=\d\+\>" syn match logtalkNumber "\<\d\+\.\d\+[eE][-+]\=\d\+\>" -syn match logtalkNumber "\<0'.\>" +syn match logtalkNumber "\<0'.\|0''\|0'\"\>" syn match logtalkNumber "\<0b[0-1]\+\>" syn match logtalkNumber "\<0o\o\+\>" syn match logtalkNumber "\<0x\x\+\>" @@ -346,7 +355,7 @@ if version >= 508 || !exists("did_logtalk_syn_inits") else command -nargs=+ HiLink hi def link <args> endif - + HiLink logtalkBlockComment Comment HiLink logtalkLineComment Comment @@ -365,6 +374,7 @@ if version >= 508 || !exists("did_logtalk_syn_inits") HiLink logtalkAtom String HiLink logtalkString String + HiLink logtalkEscapeSequence SpecialChar HiLink logtalkNumber Number @@ -386,7 +396,3 @@ endif let b:current_syntax = "logtalk" - -setlocal ts=4 -setlocal fdm=syntax -setlocal fdc=2 diff --git a/runtime/syntax/messages.vim b/runtime/syntax/messages.vim index 2dbaa5ac3..4648e94c1 100644 --- a/runtime/syntax/messages.vim +++ b/runtime/syntax/messages.vim @@ -1,7 +1,8 @@ " Vim syntax file " Language: /var/log/messages file " Maintainer: Yakov Lerner <iler.ml@gmail.com> -" Latest Revision: 2006-06-19 +" Latest Revision: 2008-06-29 +" Changes: 2008-06-29 support for RFC3339 tuimestamps James Vega if exists("b:current_syntax") finish @@ -10,7 +11,7 @@ endif let s:cpo_save = &cpo set cpo&vim -syn match messagesBegin display '^' nextgroup=messagesDate +syn match messagesBegin display '^' nextgroup=messagesDate,messagesDateRFC3339 syn match messagesDate contained display '\a\a\a [ 0-9]\d *' \ nextgroup=messagesHour @@ -18,6 +19,15 @@ syn match messagesDate contained display '\a\a\a [ 0-9]\d *' syn match messagesHour contained display '\d\d:\d\d:\d\d\s*' \ nextgroup=messagesHost +syn match messagesDateRFC3339 contained display '\d\{4}-\d\d-\d\d' + \ nextgroup=messagesRFC3339T + +syn match messagesRFC3339T contained display '\cT' + \ nextgroup=messagesHourRFC3339 + +syn match messagesHourRFC3339 contained display '\c\d\d:\d\d:\d\d\(\.\d\+\)\=\([+-]\d\d:\d\d\|Z\)' + \ nextgroup=messagesHost + syn match messagesHost contained display '\S*\s*' \ nextgroup=messagesLabel @@ -43,6 +53,9 @@ syn match messagesError contained '\c.*\<\(FATAL\|ERROR\|ERRORS\|FAILED\ hi def link messagesDate Constant hi def link messagesHour Type +hi def link messagesDateRFC3339 Constant +hi def link messagesHourRFC3339 Type +hi def link messagesRFC3339T Normal hi def link messagesHost Identifier hi def link messagesLabel Operator hi def link messagesPID Constant diff --git a/runtime/syntax/muttrc.vim b/runtime/syntax/muttrc.vim index 0b1d16164..068609c9a 100644 --- a/runtime/syntax/muttrc.vim +++ b/runtime/syntax/muttrc.vim @@ -2,9 +2,9 @@ " Language: Mutt setup files " Original: Preben 'Peppe' Guldberg <peppe-vim@wielders.org> " Maintainer: Kyle Wheeler <kyle-muttrc.vim@memoryhole.net> -" Last Change: 15 Aug 2007 +" Last Change: 12 Jun 2008 -" This file covers mutt version 1.5.16 (and most of CVS HEAD) +" This file covers mutt version 1.5.18 (and most of the mercurial tip) " Included are also a few features from 1.4.2.1 " For version 5.x: Clear all syntax items @@ -76,6 +76,7 @@ syn region muttrcKey contained start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=mut syn match muttrcKeyName contained "\<f\%(\d\|10\)\>" syn match muttrcKeyName contained "\\[trne]" syn match muttrcKeyName contained "\c<\%(BackSpace\|Delete\|Down\|End\|Enter\|Esc\|Home\|Insert\|Left\|PageDown\|PageUp\|Return\|Right\|Space\|Tab\|Up\)>" +syn match muttrcKeyName contained "<F[0-9]\+>" syn keyword muttrcVarBool contained allow_8bit allow_ansi arrow_cursor ascii_chars askbcc syn keyword muttrcVarBool contained askcc attach_split auto_tag autoedit beep beep_new @@ -217,6 +218,7 @@ syn match muttrcFormatErrors contained /%./ syn region muttrcIndexFormatStr contained keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcIndexFormatEscapes,muttrcIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes syn region muttrcIndexFormatStr contained keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcIndexFormatEscapes,muttrcIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes +syn region muttrcQueryFormatStr contained keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcQueryFormatEscapes,muttrcQueryFormatConditionals,muttrcFormatErrors syn region muttrcAliasFormatStr contained keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcAliasFormatEscapes,muttrcFormatErrors syn region muttrcAliasFormatStr contained keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcAliasFormatEscapes,muttrcFormatErrors syn region muttrcAttachFormatStr contained keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcAttachFormatEscapes,muttrcAttachFormatConditionals,muttrcFormatErrors @@ -243,6 +245,9 @@ syn match muttrcIndexFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\ syn match muttrcIndexFormatConditionals contained /%?[EFHlLMNOXyY]?/ nextgroup=muttrcFormatConditionals2 " The following info was pulled from alias_format_str in addrbook.c syn match muttrcAliasFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[afnrt%]/ +" The following info was pulled from query_format_str in query.c +syn match muttrcQueryFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[acent%]/ +syn match muttrcQueryFormatConditionals contained /%?[e]?/ nextgroup=muttrcFormatConditionals2 " The following info was pulled from mutt_attach_fmt in recvattach.c syn match muttrcAttachFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[CcDdefImMnQstTuX%]/ syn match muttrcAttachFormatEscapes contained /%[>|*]./ @@ -287,27 +292,29 @@ syn region muttrcTimeEscapes contained start=+%<+ end=+>+ contains=muttrcStrftim syn region muttrcPGPTimeEscapes contained start=+%\[+ end=+\]+ contains=muttrcStrftimeEscapes syn keyword muttrcVarStr contained attribution index_format message_format pager_format nextgroup=muttrcVarEqualsIdxFmt -syn match muttrcVarEqualsIdxFmt contained "=" nextgroup=muttrcIndexFormatStr +syn match muttrcVarEqualsIdxFmt contained " *= *" nextgroup=muttrcIndexFormatStr syn keyword muttrcVarStr contained alias_format nextgroup=muttrcVarEqualsAliasFmt -syn match muttrcVarEqualsAliasFmt contained "=" nextgroup=muttrcAliasFormatStr +syn match muttrcVarEqualsAliasFmt contained " *= *" nextgroup=muttrcAliasFormatStr syn keyword muttrcVarStr contained attach_format nextgroup=muttrcVarEqualsAttachFmt -syn match muttrcVarEqualsAttachFmt contained "=" nextgroup=muttrcAttachFormatStr +syn match muttrcVarEqualsAttachFmt contained " *= *" nextgroup=muttrcAttachFormatStr syn keyword muttrcVarStr contained compose_format nextgroup=muttrcVarEqualsComposeFmt -syn match muttrcVarEqualsComposeFmt contained "=" nextgroup=muttrcComposeFormatStr +syn match muttrcVarEqualsComposeFmt contained " *= *" nextgroup=muttrcComposeFormatStr syn keyword muttrcVarStr contained folder_format nextgroup=muttrcVarEqualsFolderFmt -syn match muttrcVarEqualsFolderFmt contained "=" nextgroup=muttrcFolderFormatStr +syn match muttrcVarEqualsFolderFmt contained " *= *" nextgroup=muttrcFolderFormatStr syn keyword muttrcVarStr contained mix_entry_format nextgroup=muttrcVarEqualsMixFmt -syn match muttrcVarEqualsMixFmt contained "=" nextgroup=muttrcMixFormatStr +syn match muttrcVarEqualsMixFmt contained " *= *" nextgroup=muttrcMixFormatStr syn keyword muttrcVarStr contained pgp_entry_format nextgroup=muttrcVarEqualsPGPFmt -syn match muttrcVarEqualsPGPFmt contained "=" nextgroup=muttrcPGPFormatStr +syn match muttrcVarEqualsPGPFmt contained " *= *" nextgroup=muttrcPGPFormatStr +syn keyword muttrcVarStr contained query_format nextgroup=muttrcVarEqualsQueryFmt +syn match muttrcVarEqualsQueryFmt contained " *= *" nextgroup=muttrcQueryFormatStr syn keyword muttrcVarStr contained pgp_decode_command pgp_verify_command pgp_decrypt_command pgp_clearsign_command pgp_sign_command pgp_encrypt_sign_command pgp_encrypt_only_command pgp_import_command pgp_export_command pgp_verify_key_command pgp_list_secring_command pgp_list_pubring_command nextgroup=muttrcVarEqualsPGPCmdFmt -syn match muttrcVarEqualsPGPCmdFmt contained "=" nextgroup=muttrcPGPCmdFormatStr +syn match muttrcVarEqualsPGPCmdFmt contained " *= *" nextgroup=muttrcPGPCmdFormatStr syn keyword muttrcVarStr contained status_format nextgroup=muttrcVarEqualsStatusFmt -syn match muttrcVarEqualsStatusFmt contained "=" nextgroup=muttrcStatusFormatStr +syn match muttrcVarEqualsStatusFmt contained " *= *" nextgroup=muttrcStatusFormatStr syn keyword muttrcVarStr contained pgp_getkeys_command nextgroup=muttrcVarEqualsPGPGetKeysFmt -syn match muttrcVarEqualsPGPGetKeysFmt contained "=" nextgroup=muttrcPGPGetKeysFormatStr +syn match muttrcVarEqualsPGPGetKeysFmt contained " *= *" nextgroup=muttrcPGPGetKeysFormatStr syn keyword muttrcVarStr contained smime_decrypt_command smime_verify_command smime_verify_opaque_command smime_sign_command smime_sign_opaque_command smime_encrypt_command smime_pk7out_command smime_get_cert_command smime_get_signer_cert_command smime_import_cert_command smime_get_cert_email_command nextgroup=muttrcVarEqualsSmimeFmt -syn match muttrcVarEqualsSmimeFmt contained "=" nextgroup=muttrcSmimeFormatStr +syn match muttrcVarEqualsSmimeFmt contained " *= *" nextgroup=muttrcSmimeFormatStr syn match muttrcVarStr contained 'my_[a-zA-Z0-9_]\+' syn keyword muttrcVarStr contained alias_file assumed_charset attach_charset attach_sep @@ -373,7 +380,7 @@ syn region muttrcAlternatesLine keepend start=+^\s*\%(un\)\?alternates\s+ skip=+ syn match muttrcVariable "\$[a-zA-Z_-]\+" syn match muttrcBadAction contained "[^<>]\+" contains=muttrcEmail -syn match muttrcFunction contained "\<\%(attach\|bounce\|copy\|delete\|display\|flag\|forward\|parent\|pipe\|postpone\|print\|recall\|resent\|save\|send\|tag\|undelete\)-message\>" +syn match muttrcFunction contained "\<\%(attach\|bounce\|copy\|delete\|display\|flag\|forward\|parent\|pipe\|postpone\|print\|recall\|resend\|save\|send\|tag\|undelete\)-message\>" syn match muttrcFunction contained "\<\%(delete\|next\|previous\|read\|tag\|undelete\)-thread\>" syn match muttrcFunction contained "\<\%(backward\|capitalize\|downcase\|forward\|kill\|upcase\)-word\>" syn match muttrcFunction contained "\<\%(delete\|filter\|first\|last\|next\|pipe\|previous\|print\|save\|select\|tag\|undelete\)-entry\>" @@ -389,7 +396,7 @@ syn match muttrcFunction contained "\<enter-\%(command\|mask\)\>" syn match muttrcFunction contained "\<half-\%(up\|down\)\>" syn match muttrcFunction contained "\<history-\%(up\|down\)\>" syn match muttrcFunction contained "\<kill-\%(eol\|eow\|line\)\>" -syn match muttrcFunction contained "\<next-\%(line\|new\|page\|subthread\|undeleted\|unread\)\>" +syn match muttrcFunction contained "\<next-\%(line\|new\|page\|subthread\|undeleted\|unread\|unread-mailbox\)\>" syn match muttrcFunction contained "\<previous-\%(line\|new\|page\|subthread\|undeleted\|unread\)\>" syn match muttrcFunction contained "\<search\%(-\%(next\|opposite\|reverse\|toggle\)\)\?\>" syn match muttrcFunction contained "\<show-\%(limit\|version\)\>" @@ -428,8 +435,8 @@ syn region muttrcMacroDescr contained keepend skipwhite start=+'+ms=e skip=+\\'+ syn region muttrcMacroDescr contained keepend skipwhite start=+"+ms=e skip=+\\"+ end=+"+me=s syn match muttrcMacroDescrNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroDescr,muttrcMacroDescrNL syn region muttrcMacroBody contained skipwhite start="\S" skip='\\ \|\\$' end=' \|$' contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcCommand,muttrcAction nextgroup=muttrcMacroDescr,muttrcMacroDescrNL -syn region muttrcMacroBody matchgroup=Type contained skipwhite start=+'+ms=e skip=+\\'+ end=+'+me=s contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcCommand,muttrcAction nextgroup=muttrcMacroDescr,muttrcMacroDescrNL -syn region muttrcMacroBody matchgroup=Type contained skipwhite start=+"+ms=e skip=+\\"+ end=+"+me=s contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcCommand,muttrcAction nextgroup=muttrcMacroDescr,muttrcMacroDescrNL +syn region muttrcMacroBody matchgroup=Type contained skipwhite start=+'+ms=e skip=+\\'\|\\$+ end=+'\|$+me=s contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcCommand,muttrcAction nextgroup=muttrcMacroDescr,muttrcMacroDescrNL +syn region muttrcMacroBody matchgroup=Type contained skipwhite start=+"+ms=e skip=+\\"\|\\$+ end=+"\|$+me=s contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcCommand,muttrcAction nextgroup=muttrcMacroDescr,muttrcMacroDescrNL syn match muttrcMacroBodyNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroBody,muttrcMacroBodyNL syn match muttrcMacroKey contained /\S\+/ skipwhite contains=muttrcKey nextgroup=muttrcMacroBody,muttrcMacroBodyNL syn match muttrcMacroKeyNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroKey,muttrcMacroKeyNL diff --git a/runtime/syntax/ruby.vim b/runtime/syntax/ruby.vim index f68d7f4da..a5a118e4d 100644 --- a/runtime/syntax/ruby.vim +++ b/runtime/syntax/ruby.vim @@ -19,6 +19,8 @@ if has("folding") && exists("ruby_fold") setlocal foldmethod=syntax endif +syn cluster rubyNotTop contains=@rubyExtendedStringSpecial,@rubyRegexpSpecial,@rubyDeclaration,rubyConditional,rubyTodo + if exists("ruby_space_errors") if !exists("ruby_no_trail_space_error") syn match rubySpaceError display excludenl "\s\+$" @@ -32,14 +34,14 @@ endif if exists("ruby_operators") syn match rubyOperator "\%([~!^&|*/%+-]\|\%(class\s*\)\@<!<<\|<=>\|<=\|\%(<\|\<class\s\+\u\w*\s*\)\@<!<[^<]\@=\|===\|==\|=\~\|>>\|>=\|=\@<!>\|\*\*\|\.\.\.\|\.\.\|::\)" syn match rubyPseudoOperator "\%(-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!=\)" - syn region rubyBracketOperator matchgroup=rubyOperator start="\%([_[:lower:]]\w*[?!=]\=\|[})]\)\@<=\[\s*" end="\s*]" contains=TOP + syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\w[?!]\=\|[]})]\)\@<=\[\s*" end="\s*]" contains=ALLBUT,@rubyNotTop endif " Expression Substitution and Backslash Notation -syn match rubyEscape "\\\\\|\\[abefnrstv]\|\\\o\{1,3}\|\\x\x\{1,2}" contained display -syn match rubyEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)" contained display +syn match rubyStringEscape "\\\\\|\\[abefnrstv]\|\\\o\{1,3}\|\\x\x\{1,2}" contained display +syn match rubyStringEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)" contained display -syn region rubyInterpolation matchgroup=rubyInterpolationDelimiter start="#{" end="}" contained contains=TOP +syn region rubyInterpolation matchgroup=rubyInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,@rubyNotTop syn match rubyInterpolation "#\%(\$\|@@\=\)\w\+" display contained contains=rubyInterpolationDelimiter,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable,rubyPredefinedVariable syn match rubyInterpolationDelimiter "#\ze\%(\$\|@@\=\)\w\+" display contained syn match rubyInterpolation "#\$\%(-\w\|\W\)" display contained contains=rubyInterpolationDelimiter,rubyPredefinedVariable,rubyInvalidVariable @@ -51,17 +53,32 @@ syn match rubyNoInterpolation "\\#\$\W" display contained syn match rubyDelimEscape "\\[(<{\[)>}\]]" transparent display contained contains=NONE -syn region rubyNestedParentheses start="(" end=")" skip="\\\\\|\\)" transparent contained contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape -syn region rubyNestedCurlyBraces start="{" end="}" skip="\\\\\|\\}" transparent contained contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimEscape -syn region rubyNestedAngleBrackets start="<" end=">" skip="\\\\\|\\>" transparent contained contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape -if exists("ruby_operators") - syn region rubyNestedSquareBrackets start="\[" end="\]" skip="\\\\\|\\\]" transparent contained contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape -else - syn region rubyNestedSquareBrackets start="\[" end="\]" skip="\\\\\|\\\]" transparent containedin=rubyArrayLiteral contained contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape -endif - -syn cluster rubyStringSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyEscape +syn region rubyNestedParentheses start="(" skip="\\\\\|\\)" matchgroup=rubyString end=")" transparent contained +syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" matchgroup=rubyString end="}" transparent contained +syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" matchgroup=rubyString end=">" transparent contained +syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" matchgroup=rubyString end="\]" transparent contained + +" These are mostly Oniguruma ready +syn region rubyRegexpComment matchgroup=rubyRegexpSpecial start="(?#" skip="\\)" end=")" contained +syn region rubyRegexpParens matchgroup=rubyRegexpSpecial start="(\(?:\|?<\=[=!]\|?>\|?<[a-z_]\w*>\|?[imx]*-[imx]*:\=\|\%(?#\)\@!\)" skip="\\)" end=")" contained transparent contains=@rubyRegexpSpecial +syn region rubyRegexpBrackets matchgroup=rubyRegexpCharClass start="\[\^\=" skip="\\\]" end="\]" contained transparent contains=rubyStringEscape,rubyRegexpEscape,rubyRegexpCharClass oneline +syn match rubyRegexpCharClass "\\[DdHhSsWw]" contained display +syn match rubyRegexpCharClass "\[:\^\=\%(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\):\]" contained +syn match rubyRegexpEscape "\\[].*?+^$|\\/(){}[]" contained display +syn match rubyRegexpQuantifier "[*?+][?+]\=" contained display +syn match rubyRegexpQuantifier "{\d\+\%(,\d*\)\=}?\=" contained display +syn match rubyRegexpAnchor "[$^]\|\\[ABbGZz]" contained display +syn match rubyRegexpDot "\." contained display +syn match rubyRegexpSpecial "|" contained display +syn match rubyRegexpSpecial "\\[1-9]\d\=\d\@!" contained display +syn match rubyRegexpSpecial "\\k<\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\=>" contained display +syn match rubyRegexpSpecial "\\k'\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\='" contained display +syn match rubyRegexpSpecial "\\g<\%([a-z_]\w*\|-\=\d\+\)>" contained display +syn match rubyRegexpSpecial "\\g'\%([a-z_]\w*\|-\=\d\+\)'" contained display + +syn cluster rubyStringSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape syn cluster rubyExtendedStringSpecial contains=@rubyStringSpecial,rubyNestedParentheses,rubyNestedCurlyBraces,rubyNestedAngleBrackets,rubyNestedSquareBrackets +syn cluster rubyRegexpSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment " Numbers and ASCII Codes syn match rubyASCIICode "\%(\w\|[]})\"'/]\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)" @@ -83,14 +100,14 @@ syn match rubyGlobalVariable "$\%(\h\w*\|-.\)" syn match rubySymbol "[]})\"':]\@<!:\%(\^\|\~\|<<\|<=>\|<=\|<\|===\|==\|=\~\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)" syn match rubySymbol "[]})\"':]\@<!:\$\%(-.\|[`~<=>_,;:!?/.'"@$*\&+0]\)" syn match rubySymbol "[]})\"':]\@<!:\%(\$\|@@\=\)\=\h\w*" -syn match rubySymbol "[]})\"':]\@<!:\h\w*[?!=]\=" +syn match rubySymbol "[]})\"':]\@<!:\h\w*\%([?!=]>\@!\)\=" syn region rubySymbol start="[]})\"':]\@<!:\"" end="\"" skip="\\\\\|\\\"" syn region rubySymbol start="[]})\"':]\@<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold syn match rubyBlockParameter "\h\w*" contained syn region rubyBlockParameterList start="\%(\%(\<do\>\|{\)\s*\)\@<=|" end="|" oneline display contains=rubyBlockParameter -syn match rubyInvalidVariable "$[^ A-Za-z-]" +syn match rubyInvalidVariable "$[^ A-Za-z_-]" syn match rubyPredefinedVariable #$[!$&"'*+,./0:;<=>?@\`~1-9]# syn match rubyPredefinedVariable "$_\>" display syn match rubyPredefinedVariable "$-[0FIKadilpvw]\>" display @@ -104,32 +121,32 @@ syn match rubyPredefinedConstant "\%(\%(\.\@<!\.\)\@<!\|::\)\_s*\zs\%(RUBY_VERSI "syn match rubyPredefinedConstant "\%(::\)\=\zs\%(NotImplementError\)\>" " Normal Regular Expression -syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,[>]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyStringSpecial fold -syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\<\%(split\|scan\|gsub\|sub\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyStringSpecial fold +syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,[>]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial keepend fold +syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=]\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold + +" Generalized Regular Expression +syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold +syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyRegexpSpecial fold +syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold +syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial fold +syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold " Normal String and Shell Command Output syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" fold syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold -" Generalized Regular Expression -syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold -syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimEscape fold -syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold -syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape fold -syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold - " Generalized Single Quoted String, Symbol and Array of Strings syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape syn region rubyString matchgroup=rubyStringDelimiter start="%[qw](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape -syn region rubySymbol start="%[s]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold -syn region rubySymbol start="%[s]{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape -syn region rubySymbol start="%[s]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape -syn region rubySymbol start="%[s]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape -syn region rubySymbol start="%[s](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape +syn region rubySymbol matchgroup=rubySymbolDelimiter start="%[s]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold +syn region rubySymbol matchgroup=rubySymbolDelimiter start="%[s]{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape +syn region rubySymbol matchgroup=rubySymbolDelimiter start="%[s]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape +syn region rubySymbol matchgroup=rubySymbolDelimiter start="%[s]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape +syn region rubySymbol matchgroup=rubySymbolDelimiter start="%[s](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape " Generalized Double Quoted String and Array of Strings and Shell Command Output " Note: %= is not matched here as the beginning of a double quoted string @@ -141,10 +158,10 @@ syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\[" e syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold " Here Document -syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs\%(\h\w*\)+ end=+$+ oneline contains=TOP -syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs"\%([^"]*\)"+ end=+$+ oneline contains=TOP -syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs'\%([^']*\)'+ end=+$+ oneline contains=TOP -syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs`\%([^`]*\)`+ end=+$+ oneline contains=TOP +syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs\%(\h\w*\)+ end=+$+ oneline contains=ALLBUT,@rubyNotTop +syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs"\%([^"]*\)"+ end=+$+ oneline contains=ALLBUT,@rubyNotTop +syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs'\%([^']*\)'+ end=+$+ oneline contains=ALLBUT,@rubyNotTop +syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs`\%([^`]*\)`+ end=+$+ oneline contains=ALLBUT,@rubyNotTop syn region rubyString start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<\z(\h\w*\)\ze+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend syn region rubyString start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<"\z([^"]*\)"\ze+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend @@ -163,43 +180,46 @@ end syn match rubyAliasDeclaration "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable nextgroup=rubyAliasDeclaration2 skipwhite syn match rubyAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable syn match rubyMethodDeclaration "[^[:space:];#(]\+" contained contains=rubyConstant,rubyBoolean,rubyPseudoVariable,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable -syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyConstant -syn match rubyModuleDeclaration "[^[:space:];#]\+" contained contains=rubyConstant +syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyConstant,rubyOperator +syn match rubyModuleDeclaration "[^[:space:];#<]\+" contained contains=rubyConstant,rubyOperator syn match rubyFunction "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:].:?!=]\@!" contained containedin=rubyMethodDeclaration syn match rubyFunction "\%(\s\|^\)\@<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2 syn match rubyFunction "\%([[:space:].]\|^\)\@<=\%(\[\]=\=\|\*\*\|[+-]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|==\|=\~\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration +syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration,rubyModuleDeclaration,rubyClassDeclaration,rubyFunction,rubyBlockParameter + " Expensive Mode - match 'end' with the appropriate opening keyword for syntax " based folding and special highlighting of module/class/method definitions if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive") syn match rubyDefine "\<alias\>" nextgroup=rubyAliasDeclaration skipwhite skipnl syn match rubyDefine "\<def\>" nextgroup=rubyMethodDeclaration skipwhite skipnl + syn match rubyDefine "\<undef\>" nextgroup=rubyFunction skipwhite skipnl syn match rubyClass "\<class\>" nextgroup=rubyClassDeclaration skipwhite skipnl syn match rubyModule "\<module\>" nextgroup=rubyModuleDeclaration skipwhite skipnl - syn region rubyBlock start="\<def\>" matchgroup=rubyDefine end="\%(\<def\_s\+\)\@<!\<end\>" contains=TOP fold - syn region rubyBlock start="\<class\>" matchgroup=rubyClass end="\<end\>" contains=TOP fold - syn region rubyBlock start="\<module\>" matchgroup=rubyModule end="\<end\>" contains=TOP fold + syn region rubyBlock start="\<def\>" matchgroup=rubyDefine end="\%(\<def\_s\+\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop fold + syn region rubyBlock start="\<class\>" matchgroup=rubyClass end="\<end\>" contains=ALLBUT,@rubyNotTop fold + syn region rubyBlock start="\<module\>" matchgroup=rubyModule end="\<end\>" contains=ALLBUT,@rubyNotTop fold " modifiers syn match rubyConditionalModifier "\<\%(if\|unless\)\>" display syn match rubyRepeatModifier "\<\%(while\|until\)\>" display - syn region rubyDoBlock matchgroup=rubyControl start="\<do\>" end="\<end\>" contains=TOP fold + syn region rubyDoBlock matchgroup=rubyControl start="\<do\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold " curly bracket block or hash literal - syn region rubyCurlyBlock start="{" end="}" contains=TOP fold - syn region rubyArrayLiteral matchgroup=rubyArrayDelimiter start="\%(\w\|[\]})]\)\@<!\[" end="]" contains=TOP fold + syn region rubyCurlyBlock start="{" end="}" contains=ALLBUT,@rubyNotTop fold + syn region rubyArrayLiteral matchgroup=rubyArrayDelimiter start="\%(\w\|[\]})]\)\@<!\[" end="]" contains=ALLBUT,@rubyNotTop fold " statements without 'do' - syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" end="\<end\>" contains=TOP fold - syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" end="\<end\>" contains=TOP fold - syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!?]\)\s*\)\@<=\%(if\|unless\)\>" end="\<end\>" contains=TOP fold + syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold + syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold + syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|unless\)\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold - syn keyword rubyConditional then else when contained containedin=rubyCaseExpression - syn keyword rubyConditional then else elsif contained containedin=rubyConditionalExpression + syn match rubyConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=rubyCaseExpression + syn match rubyConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=rubyConditionalExpression " statements with optional 'do' - syn region rubyOptionalDoLine matchgroup=rubyRepeat start="\<for\>" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyOptionalDo end="\%(\<do\>\)" end="\ze\%(;\|$\)" oneline contains=TOP - syn region rubyRepeatExpression start="\<for\>" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyRepeat end="\<end\>" contains=TOP nextgroup=rubyOptionalDoLine fold + syn region rubyOptionalDoLine matchgroup=rubyRepeat start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyOptionalDo end="\%(\<do\>\)" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@rubyNotTop + syn region rubyRepeatExpression start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyRepeat end="\<end\>" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine fold if !exists("ruby_minlines") let ruby_minlines = 50 @@ -207,31 +227,35 @@ if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive") exec "syn sync minlines=" . ruby_minlines else - syn match rubyControl "\<def\>" nextgroup=rubyMethodDeclaration skipwhite skipnl - syn match rubyControl "\<class\>" nextgroup=rubyClassDeclaration skipwhite skipnl - syn match rubyControl "\<module\>" nextgroup=rubyModuleDeclaration skipwhite skipnl - syn keyword rubyControl case begin do for if unless while until else elsif then when end - syn keyword rubyKeyword alias + syn match rubyControl "\<def\>[?!]\@!" nextgroup=rubyMethodDeclaration skipwhite skipnl + syn match rubyControl "\<class\>[?!]\@!" nextgroup=rubyClassDeclaration skipwhite skipnl + syn match rubyControl "\<module\>[?!]\@!" nextgroup=rubyModuleDeclaration skipwhite skipnl + syn match rubyControl "\<\%(case\|begin\|do\|for\|if\|unless\|while\|until\|else\|elsif\|then\|when\|end\)\>[?!]\@!" + syn match rubyKeyword "\<\%(alias\|undef\)\>[?!]\@!" endif " Keywords " Note: the following keywords have already been defined: " begin case class def do end for if module unless until while -syn keyword rubyControl and break ensure in next not or redo rescue retry return +syn match rubyControl "\<\%(and\|break\|ensure\|in\|next\|not\|or\|redo\|rescue\|retry\|return\)\>[?!]\@!" syn match rubyOperator "\<defined?" display -syn keyword rubyKeyword super undef yield -syn keyword rubyBoolean true false -syn keyword rubyPseudoVariable nil self __FILE__ __LINE__ -syn keyword rubyBeginEnd BEGIN END +syn match rubyKeyword "\<\%(super\|yield\)\>[?!]\@!" +syn match rubyBoolean "\<\%(true\|false\)\>[?!]\@!" +syn match rubyPseudoVariable "\<\%(nil\|self\|__FILE__\|__LINE__\)\>[?!]\@!" +syn match rubyBeginEnd "\<\%(BEGIN\|END\)\>[?!]\@!" " Special Methods if !exists("ruby_no_special_methods") - syn keyword rubyAccess public protected private - syn keyword rubyAttribute attr attr_accessor attr_reader attr_writer - syn match rubyControl "\<\%(exit!\|\%(abort\|at_exit\|exit\|fork\|loop\|trap\)\>\)" + syn keyword rubyAccess public protected private module_function + " attr is a common variable name + syn match rubyAttribute "\%(\%(^\|;\)\s*\)\@<=attr\>\(\s*[.=]\)\@!" + syn keyword rubyAttribute attr_accessor attr_reader attr_writer + syn match rubyControl "\<\%(exit!\|\%(abort\|at_exit\|exit\|fork\|loop\|trap\)\>[?!]\@!\)" syn keyword rubyEval eval class_eval instance_eval module_eval syn keyword rubyException raise fail catch throw - syn keyword rubyInclude autoload extend include load require + " false positive with 'include?' + syn match rubyInclude "\<include\>[?!]\@!" + syn keyword rubyInclude autoload extend load require syn keyword rubyKeyword callcc caller lambda proc endif @@ -252,6 +276,9 @@ syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(elsif\|end\|ensure\| syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(not\|or\|redo\|rescue\|retry\|return\|self\|super\|then\|true\)\>" transparent contains=NONE syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(undef\|unless\|until\|when\|while\|yield\|BEGIN\|END\|__FILE__\|__LINE__\)\>" transparent contains=NONE +syn match rubyKeywordAsMethod "\<\%(alias\|begin\|case\|class\|def\|do\|end\)[?!]" transparent contains=NONE +syn match rubyKeywordAsMethod "\<\%(if\|module\|undef\|unless\|until\|while\)[?!]" transparent contains=NONE + syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(abort\|at_exit\|attr\|attr_accessor\|attr_reader\)\>" transparent contains=NONE syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(attr_writer\|autoload\|callcc\|catch\|caller\)\>" transparent contains=NONE syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(eval\|class_eval\|instance_eval\|module_eval\|exit\)\>" transparent contains=NONE @@ -305,15 +332,24 @@ hi def link rubyComment Comment hi def link rubyData Comment hi def link rubyDataDirective Delimiter hi def link rubyDocumentation Comment -hi def link rubyEscape Special +hi def link rubyTodo Todo + +hi def link rubyStringEscape Special hi def link rubyInterpolationDelimiter Delimiter hi def link rubyNoInterpolation rubyString hi def link rubySharpBang PreProc hi def link rubyRegexpDelimiter rubyStringDelimiter +hi def link rubySymbolDelimiter rubyStringDelimiter hi def link rubyStringDelimiter Delimiter -hi def link rubyRegexp rubyString hi def link rubyString String -hi def link rubyTodo Todo +hi def link rubyRegexpEscape rubyRegexpSpecial +hi def link rubyRegexpQuantifier rubyRegexpSpecial +hi def link rubyRegexpAnchor rubyRegexpSpecial +hi def link rubyRegexpDot rubyRegexpCharClass +hi def link rubyRegexpCharClass rubyRegexpSpecial +hi def link rubyRegexpSpecial Special +hi def link rubyRegexpComment Comment +hi def link rubyRegexp rubyString hi def link rubyInvalidVariable Error hi def link rubyError Error @@ -321,4 +357,4 @@ hi def link rubySpaceError rubyError let b:current_syntax = "ruby" -" vim: nowrap sw=2 sts=2 ts=8 noet : +" vim: nowrap sw=2 sts=2 ts=8 noet: diff --git a/runtime/syntax/sass.vim b/runtime/syntax/sass.vim new file mode 100644 index 000000000..1a2e7a450 --- /dev/null +++ b/runtime/syntax/sass.vim @@ -0,0 +1,56 @@ +" Vim syntax file +" Language: Sass +" Maintainer: Tim Pope <vimNOSPAM@tpope.info> +" Filenames: *.sass + +if exists("b:current_syntax") + finish +endif + +runtime! syntax/css.vim + +syn case ignore + +syn cluster sassCssProperties contains=cssFontProp,cssFontDescriptorProp,cssColorProp,cssTextProp,cssBoxProp,cssGeneratedContentProp,cssPagingProp,cssUIProp,cssRenderProp,cssAuralProp,cssTableProp +syn cluster sassCssAttributes contains=css.*Attr,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp + +syn match sassProperty "^\s*\zs\s\%([[:alnum:]-]\+:\|:[[:alnum:]-]\+\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute +syn match sassCssAttribute ".*$" contained contains=@sassCssAttributes,sassConstant +syn match sassConstant "![[:alnum:]_-]\+" +syn match sassConstantAssignment "\%(![[:alnum:]_]\+\s*\)\@<==" nextgroup=sassCssAttribute skipwhite +syn match sassMixin "^=.*" +syn match sassMixing "^\s\+\zs+.*" + +syn match sassEscape "^\s*\zs\\" +syn match sassIdChar "#[[:alnum:]_-]\@=" nextgroup=sassId +syn match sassId "[[:alnum:]_-]\+" contained +syn match sassClassChar "\.[[:alnum:]_-]\@=" nextgroup=sassClass +syn match sassClass "[[:alnum:]_-]\+" contained +syn match sassAmpersand "&" + +" TODO: Attribute namespaces +" TODO: Arithmetic (including strings and concatenation) + +syn region sassInclude start="@import" end=";\|$" contains=cssComment,cssURL,cssUnicodeEscape,cssMediaType + +syn keyword sassTodo FIXME NOTE TODO OPTIMIZE XXX contained +syn region sassComment start="^\z(\s*\)//" end="^\%(\z1 \)\@!" contains=sassTodo +syn region sassCssComment start="^\z(\s*\)/\*" end="^\%(\z1 \)\@!" contains=sassTodo + +hi def link sassCssComment sassComment +hi def link sassComment Comment +hi def link sassConstant Identifier +hi def link sassMixing PreProc +hi def link sassMixin PreProc +hi def link sassTodo Todo +hi def link sassInclude Include +hi def link sassEscape Special +hi def link sassIdChar Special +hi def link sassClassChar Special +hi def link sassAmpersand Character +hi def link sassId Identifier +hi def link sassClass Type + +let b:current_syntax = "sass" + +" vim:set sw=2: diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index bddfe1c7e..cb92bbda8 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -2,22 +2,10 @@ " Language: shell (sh) Korn shell (ksh) bash (sh) " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz> " Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int> -" Last Change: Apr 24, 2008 -" Version: 90 +" Last Change: Jul 01, 2008 +" Version: 100 " URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax -" -" Using the following VIM variables: {{{1 -" g:is_bash if none of the previous three variables are -" defined, then if g:is_bash is set enhance with -" bash syntax highlighting -" g:is_kornshell if neither b:is_kornshell or b:is_bash is -" defined, then if g:is_kornshell is set -" enhance with kornshell/POSIX syntax highlighting -" g:is_posix this variable is the same as g:is_kornshell -" g:sh_fold_enabled if non-zero, syntax folding is enabled -" g:sh_minlines sets up syn sync minlines (dflt: 200) -" g:sh_maxlines sets up syn sync maxlines (dflt: 2x sh_minlines) -" +" For options and settings, please use: :help ft-sh-syntax " This file includes many ideas from Éric Brunet (eric.brunet@ens.fr) " For version 5.x: Clear all syntax items {{{1 @@ -54,6 +42,9 @@ if !exists("b:is_kornshell") && !exists("b:is_bash") endif endif +" adjust iskeyword for shell characters +"setlocal isk=@,48-57,_,192-255,#,.,/ + " set up default g:sh_fold_enabled {{{1 if !exists("g:sh_fold_enabled") let g:sh_fold_enabled= 0 @@ -61,6 +52,15 @@ elseif g:sh_fold_enabled != 0 && !has("folding") let g:sh_fold_enabled= 0 echomsg "Ignoring g:sh_fold_enabled=".g:sh_fold_enabled."; need to re-compile vim for +fold support" endif +if !exists("s:sh_fold_functions") + let s:sh_fold_functions = 1 +endif +if !exists("s:sh_fold_heredoc") + let s:sh_fold_heredoc = 2 +endif +if !exists("s:sh_fold_ifdofor") + let s:sh_fold_ifdofor = 4 +endif if g:sh_fold_enabled && &fdm == "manual" set fdm=syntax endif @@ -70,26 +70,33 @@ syn case match " Clusters: contains=@... clusters {{{1 "================================== -syn cluster shCaseEsacList contains=shCaseStart,shCase,shCaseBar,shCaseIn,shComment,shDeref,shDerefSimple,shCaseCommandSub,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote,shCtrlSeq +syn cluster shErrorList contains=shDoError,shIfError,shInError,shCaseError,shEsacError,shCurlyError,shParenError,shTestError +if exists("b:is_kornshell") + syn cluster ErrorList add=shDTestError +endif +syn cluster shArithParenList contains=shArithmetic,shDeref,shDerefSimple,shEscape,shNumber,shOperator,shPosnParm,shExSingleQuote,shSingleQuote,shDoubleQuote,shStatement,shVariable,shAlias,shTest,shCtrlSeq,shSpecial,shParen +syn cluster shArithList contains=@shArithParenList,shParenError +syn cluster shCaseEsacList contains=shCaseStart,shCase,shCaseBar,shCaseIn,shComment,shDeref,shDerefSimple,shCaseCommandSub,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote,shCtrlSeq,@shErrorList,shStringSpecial 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,shNumber,shOperator,shPosnParm,shExSingleQuote,shSingleQuote,shDoubleQuote,shStatement,shVariable,shSubSh,shAlias,shTest,shCtrlSeq +syn cluster shCommandSubList contains=shArithmetic,shDeref,shDerefSimple,shEscape,shNumber,shOperator,shPosnParm,shExSingleQuote,shSingleQuote,shDoubleQuote,shStatement,shVariable,shSubSh,shAlias,shTest,shCtrlSeq,shSpecial syn cluster shCurlyList contains=shNumber,shComma,shDeref,shDerefSimple,shDerefSpecial syn cluster shDblQuoteList contains=shCommandSub,shDeref,shDerefSimple,shPosnParm,shExSingleQuote,shCtrlSeq,shSpecial syn cluster shDerefList contains=shDeref,shDerefSimple,shDerefVar,shDerefSpecial,shDerefWordError,shDerefPPS syn cluster shDerefVarList contains=shDerefOp,shDerefVarArray,shDerefOpError -syn cluster shEchoList contains=shArithmetic,shCommandSub,shDeref,shDerefSimple,shExpr,shExSingleQuote,shSingleQuote,shDoubleQuote,shCtrlSeq +syn cluster shEchoList contains=shArithmetic,shCommandSub,shDeref,shDerefSimple,shExpr,shExSingleQuote,shSingleQuote,shDoubleQuote,shCtrlSeq,shEchoQuote syn cluster shExprList1 contains=shCharClass,shNumber,shOperator,shExSingleQuote,shSingleQuote,shDoubleQuote,shExpr,shDblBrace,shDeref,shDerefSimple,shCtrlSeq syn cluster shExprList2 contains=@shExprList1,@shCaseList,shTest -syn cluster shFunctionList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shOperator,shFunctionStart,shCtrlSeq +syn cluster shFunctionList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shOperator,shCtrlSeq if exists("b:is_kornshell") || exists("b:is_bash") + syn cluster shFunctionList add=shRepeat syn cluster shFunctionList add=shDblBrace,shDblParen endif syn cluster shHereBeginList contains=@shCommandSubList syn cluster shHereList contains=shBeginHere,shHerePayload syn cluster shHereListDQ contains=shBeginHere,@shDblQuoteList,shHerePayload -syn cluster shIdList contains=shCommandSub,shWrapLineOperator,shIdWhiteSpace,shDeref,shDerefSimple,shRedir,shExSingleQuote,shSingleQuote,shDoubleQuote,shExpr,shCtrlSeq -syn cluster shLoopList contains=@shCaseList,shTestOpr,shExpr,shDblBrace,shConditional,shCaseEsac,shTest +syn cluster shIdList contains=shCommandSub,shWrapLineOperator,shSetOption,shDeref,shDerefSimple,shRedir,shExSingleQuote,shSingleQuote,shDoubleQuote,shExpr,shCtrlSeq,shStringSpecial +syn cluster shLoopList contains=@shCaseList,shTestOpr,shExpr,shDblBrace,shConditional,shCaseEsac,shTest,@shErrorList,shSet syn cluster shSubShList contains=@shCaseList,shOperator syn cluster shTestList contains=shCharClass,shComment,shCommandSub,shDeref,shDerefSimple,shDoubleQuote,shExpr,shExpr,shNumber,shOperator,shExSingleQuote,shSingleQuote,shTestOpr,shTest,shCtrlSeq @@ -97,10 +104,11 @@ syn cluster shTestList contains=shCharClass,shComment,shCommandSub,shDeref,shDer " Echo: {{{1 " ==== " This one is needed INSIDE a CommandSub, so that `echo bla` be correct -syn region shEcho matchgroup=shStatement start="\<echo\>" skip="\\$" matchgroup=shOperator end="$" matchgroup=NONE end="[<>;&|()]"me=e-1 end="\d[<>]"me=e-2 end="#"me=e-1 contains=@shEchoList -syn region shEcho matchgroup=shStatement start="\<print\>" skip="\\$" matchgroup=shOperator end="$" matchgroup=NONE end="[<>;&|()]"me=e-1 end="\d[<>]"me=e-2 end="#"me=e-1 contains=@shEchoList +syn region shEcho matchgroup=shStatement start="\<echo\>" skip="\\$" matchgroup=shOperator end="$" matchgroup=NONE end="[<>;&|()]"me=e-1 end="\d[<>]"me=e-2 end="#"me=e-1 contains=@shEchoList skipwhite nextgroup=shQuickComment +syn region shEcho matchgroup=shStatement start="\<print\>" skip="\\$" matchgroup=shOperator end="$" matchgroup=NONE end="[<>;&|()]"me=e-1 end="\d[<>]"me=e-2 end="#"me=e-1 contains=@shEchoList skipwhite nextgroup=shQuickComment +syn match shEchoQuote contained '\%(\\\\\)*\\["`']' -" This must be after the strings, so that bla \" be correct +" This must be after the strings, so that ... \" will be correct syn region shEmbeddedEcho contained matchgroup=shStatement start="\<print\>" skip="\\$" matchgroup=shOperator end="$" matchgroup=NONE end="[<>;&|`)]"me=e-1 end="\d[<>]"me=e-2 end="#"me=e-1 contains=shNumber,shExSingleQuote,shSingleQuote,shDeref,shDerefSimple,shSpecialVar,shOperator,shDoubleQuote,shCharClass,shCtrlSeq " Alias: {{{1 @@ -125,10 +133,10 @@ if exists("b:is_kornshell") endif syn match shTestError "]" -" Options Interceptor: {{{1 +" Options: {{{1 " ==================== -syn match shOption "\s[\-+][a-zA-Z0-9]\+\>"ms=s+1 -syn match shOption "\s--[^ \t$`'"|]\+"ms=s+1 +syn match shOption "\s\zs[-+][a-zA-Z0-9]\+\>" +syn match shOption "\s\zs--[^ \t$`'"|]\+" " File Redirection Highlighted As Operators: {{{1 "=========================================== @@ -140,8 +148,8 @@ syn match shRedir "\d<<-\=" " Operators: {{{1 " ========== syn match shOperator "<<\|>>" contained -syn match shOperator "[!&;|]" -syn match shOperator "\[[[^:]\|\]]" +syn match shOperator "[!&;|]" contained +syn match shOperator "\[[[^:]\|\]]" contained syn match shOperator "!\==" skipwhite nextgroup=shPattern syn match shPattern "\<\S\+\())\)\@=" contained contains=shExSingleQuote,shSingleQuote,shDoubleQuote,shDeref @@ -172,33 +180,34 @@ syn match shCharClass contained "\[:\(backspace\|escape\|return\|xdigit\|alnum " Loops: do, if, while, until {{{1 " ====== -if g:sh_fold_enabled +if (g:sh_fold_enabled % (s:sh_fold_ifdofor * 2))/s:sh_fold_ifdofor syn region shDo fold transparent matchgroup=shConditional start="\<do\>" matchgroup=shConditional end="\<done\>" contains=@shLoopList - syn region shIf fold transparent matchgroup=shConditional start="\<if\>" matchgroup=shConditional end="\<;\_s*then\>" end="\<fi\>" contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey - syn region shFor fold matchgroup=shLoop start="\<for\>" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn + syn region shIf fold transparent matchgroup=shConditional start="\<if\_s" matchgroup=shConditional end="\<;\_s*then\>" end="\<fi\>" contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey + syn region shFor fold matchgroup=shLoop start="\<for\_s" end="\<in\_s" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn else syn region shDo transparent matchgroup=shConditional start="\<do\>" matchgroup=shConditional end="\<done\>" contains=@shLoopList - syn region shIf transparent matchgroup=shConditional start="\<if\>" matchgroup=shConditional end="\<;\_s*then\>" end="\<fi\>" contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey - syn region shFor matchgroup=shLoop start="\<for\>" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn + syn region shIf transparent matchgroup=shConditional start="\<if\_s" matchgroup=shConditional end="\<;\_s*then\>" end="\<fi\>" contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey + syn region shFor matchgroup=shLoop start="\<for\_s" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn endif if exists("b:is_kornshell") || exists("b:is_bash") - syn cluster shCaseList add=shRepeat - syn region shRepeat matchgroup=shLoop start="\<while\>" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen,shDblBrace - syn region shRepeat matchgroup=shLoop start="\<until\>" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen,shDblBrace - syn region shCaseEsac matchgroup=shConditional start="\<select\>" matchgroup=shConditional end="\<in\>" end="\<do\>" contains=@shLoopList + syn cluster shCaseList add=shRepeat + syn cluster shFunctionList add=shRepeat + syn region shRepeat matchgroup=shLoop start="\<while\_s" end="\<in\_s" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen,shDblBrace + syn region shRepeat matchgroup=shLoop start="\<until\_s" end="\<in\_s" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen,shDblBrace + syn region shCaseEsac matchgroup=shConditional start="\<select\s" matchgroup=shConditional end="\<in\>" end="\<do\>" contains=@shLoopList else - syn region shRepeat matchgroup=shLoop start="\<while\>" end="\<do\>"me=e-2 contains=@shLoopList - syn region shRepeat matchgroup=shLoop start="\<until\>" end="\<do\>"me=e-2 contains=@shLoopList + syn region shRepeat matchgroup=shLoop start="\<while\_s" end="\<do\>"me=e-2 contains=@shLoopList + syn region shRepeat matchgroup=shLoop start="\<until\_s" end="\<do\>"me=e-2 contains=@shLoopList endif syn region shCurlyIn contained matchgroup=Delimiter start="{" end="}" contains=@shCurlyList syn match shComma contained "," " Case: case...esac {{{1 " ==== -syn match shCaseBar contained skipwhite "[^|"`'()]\{-}|"hs=e nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote +syn match shCaseBar contained skipwhite "\(^\|[^\\]\)\(\\\\\)*\zs|" nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote syn match shCaseStart contained skipwhite skipnl "(" nextgroup=shCase,shCaseBar -syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="\([^#$()'" \t]\|\\.\)\{-})"ms=s,hs=e end=";;" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment -if g:sh_fold_enabled +syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="\%(\\.\|[^#$()'" \t]\)\{-}\zs)" end=";;" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment +if (g:sh_fold_enabled % (s:sh_fold_ifdofor * 2))/s:sh_fold_ifdofor syn region shCaseEsac fold matchgroup=shConditional start="\<case\>" end="\<esac\>" contains=@shCaseEsacList else syn region shCaseEsac matchgroup=shConditional start="\<case\>" end="\<esac\>" contains=@shCaseEsacList @@ -206,7 +215,6 @@ endif syn keyword shCaseIn contained skipwhite skipnl in nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote if exists("b:is_bash") syn region shCaseExSingleQuote matchgroup=shOperator start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial skipwhite skipnl nextgroup=shCaseBar contained - syn region shCaseExDoubleQuote matchgroup=shOperator start=+\$"+ skip=+\\\\\|\\.+ end=+"+ contains=shStringSpecial,shSpecial,shCommandSub,shDeref skipwhite skipnl nextgroup=shCaseBar contained else syn region shCaseExSingleQuote matchgroup=Error start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained endif @@ -218,6 +226,7 @@ syn region shCaseCommandSub start=+`+ skip=+\\\\\|\\.+ end=+`+ contains=@shCom "====== syn match shWrapLineOperator "\\$" syn region shCommandSub start="`" skip="\\\\\|\\." end="`" contains=@shCommandSubList +syn match shEscape contained '\\.' " $() and $(()): {{{1 " $(..) is not supported by sh (Bourne shell). However, apparently @@ -227,7 +236,7 @@ syn region shCommandSub start="`" skip="\\\\\|\\." end="`" contains=@shComman " an Error under /bin/sh. By consensus of vimdev'ers! if exists("b:is_kornshell") || exists("b:is_bash") syn region shCommandSub matchgroup=shCmdSubRegion start="\$(" skip='\\\\\|\\.' end=")" contains=@shCommandSubList - syn region shArithmetic matchgroup=shArithRegion start="\$((" skip='\\\\\|\\.' end="))" contains=@shCommandSubList + syn region shArithmetic matchgroup=shArithRegion start="\$((" skip='\\\\\|\\.' end="))" contains=@shArithList syn match shSkipInitWS contained "^\s\+" else syn region shCommandSub matchgroup=Error start="\$(" end=")" contains=@shCommandSubList @@ -261,7 +270,6 @@ if exists("b:is_bash") endif if exists("b:is_bash") syn region shExSingleQuote matchgroup=shOperator start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial - syn region shExDoubleQuote matchgroup=shOperator start=+\$"+ skip=+\\\\\|\\.+ end=+"+ contains=shStringSpecial,shSpecial,shCommandSub,shDeref else syn region shExSingleQuote matchGroup=Error start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial endif @@ -277,7 +285,8 @@ syn match shSpecial "^\%(\\\\\)*\\[\\"'`$()#]" syn cluster shCommentGroup contains=shTodo,@Spell syn keyword shTodo contained COMBAK FIXME TODO XXX syn match shComment "^\s*\zs#.*$" contains=@shCommentGroup -syn match shComment "#.*$" contains=@shCommentGroup +syn match shComment "\s\zs#.*$" contains=@shCommentGroup +syn match shQuickComment contained "#.*$" " Here Documents: {{{1 " ========================================= @@ -289,7 +298,7 @@ if version < 600 syn region shHereDoc matchgroup=shRedir start="<<\s*\**\.\**" matchgroup=shRedir end="^\.$" contains=@shDblQuoteList syn region shHereDoc matchgroup=shRedir start="<<-\s*\**\.\**" matchgroup=shRedir end="^\s*\.$" contains=@shDblQuoteList -elseif g:sh_fold_enabled +elseif (g:sh_fold_enabled % (s:sh_fold_heredoc * 2))/s:sh_fold_heredoc syn region shHereDoc matchgroup=shRedir fold start="<<\s*\z(\S*\)" matchgroup=shRedir end="^\z1\s*$" contains=@shDblQuoteList syn region shHereDoc matchgroup=shRedir fold start="<<\s*\"\z(\S*\)\"" matchgroup=shRedir end="^\z1\s*$" syn region shHereDoc matchgroup=shRedir fold start="<<\s*'\z(\S*\)'" matchgroup=shRedir end="^\z1\s*$" @@ -328,32 +337,40 @@ endif " Identifiers: {{{1 "============= -syn match shVariable "\<\([bwglsav]:\)\=[a-zA-Z0-9.!@_%+,]*\ze=" nextgroup=shSetIdentifier -syn match shIdWhiteSpace contained "\s" -syn match shSetIdentifier contained "=" nextgroup=shPattern,shDeref,shDerefSimple,shDoubleQuote,shSingleQuote,shExSingleQuote +syn match shSetOption "\s\zs[-+][a-zA-Z0-9]\+\>" contained +syn match shVariable "\<\([bwglsav]:\)\=[a-zA-Z0-9.!@_%+,]*\ze=" nextgroup=shSetIdentifier +syn match shSetIdentifier "=" contained nextgroup=shPattern,shDeref,shDerefSimple,shDoubleQuote,shSingleQuote,shExSingleQuote if exists("b:is_bash") - syn region shSetList matchgroup=shSet start="\<\(declare\|typeset\|local\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shOperator end="\ze[|);&]"me=e-1 matchgroup=NONE end="#\|="me=e-1 contains=@shIdList - syn region shSetList matchgroup=shSet start="\<set\>[^/]"me=e-1 end="$" end="\\ze[|)]" matchgroup=shOperator end="\ze[|);&]"me=e-1 matchgroup=NONE end="[#=]"me=e-1 contains=@shIdList - syn match shSet "\<\(declare\|typeset\|local\|export\|set\|unset\)\>" + syn region shSetList oneline matchgroup=shSet start="\<\(declare\|typeset\|local\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shOperator end="\ze[}|);&]" matchgroup=NONE end="\ze#\|=" contains=@shIdList + syn region shSetList oneline matchgroup=shSet start="\<set\>\ze[^/]" end="\ze[;|)]\|$" matchgroup=shOperator end="\ze[}|);&]" matchgroup=NONE end="\ze[#=]" contains=@shIdList elseif exists("b:is_kornshell") - syn region shSetList matchgroup=shSet start="\<\(typeset\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shOperator end="\ze[|);&]"me=e-1 matchgroup=NONE end="[#=]"me=e-1 contains=@shIdList - syn region shSetList matchgroup=shSet start="\<set\>\ze[^/]" end="$\|\ze[})]" matchgroup=shOperator end="\ze[|);&]"me=e-1 matchgroup=NONE end="[#=]"me=e-1 contains=@shIdList - syn match shSet "\<\(typeset\|set\|export\|unset\)\>" + syn region shSetList oneline matchgroup=shSet start="\<\(typeset\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shOperator end="\ze[}|);&]" matchgroup=NONE end="\ze[#=]" contains=@shIdList + syn region shSetList oneline matchgroup=shSet start="\<set\>\ze[^/]" end="$" matchgroup=shOperator end="\ze[}|);&]" matchgroup=NONE end="\ze[#=]" contains=@shIdList else - syn region shSetList matchgroup=shSet start="\<\(set\|export\|unset\)\>\ze[^/]" end="$\|\ze[|)]" matchgroup=shOperator end="\ze[|);&]" matchgroup=NONE end="[#=]"me=e-1 contains=@shIdList - syn match shStatement "\<\(set\|export\|unset\)\>" + syn region shSetList oneline matchgroup=shSet start="\<\(set\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shOperator end="\ze[}|);&]" matchgroup=NONE end="\ze[#=]" contains=@shIdList endif " Functions: {{{1 -syn keyword shFunctionKey function skipwhite skipnl nextgroup=shFunctionTwo -" COMBAK -- look at bash09. function foo() (line#35) is folding 38 lines. Not being terminated properly -"syn match shFunctionStart "{" contained -if g:sh_fold_enabled - syn region shFunctionOne transparent fold start="^\s*\h\w*\s*()\_s*\ze{" matchgroup=shFunctionStart end="}" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart - syn region shFunctionTwo transparent fold start="\h\w*\s*\%(()\)\=\_s*\ze{" matchgroup=shFunctionStart end="}" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart +if !exists("g:is_posix") + syn keyword shFunctionKey function skipwhite skipnl nextgroup=shFunctionTwo +endif + +if exists("b:is_bash") + if (g:sh_fold_enabled % (s:sh_fold_functions * 2))/s:sh_fold_functions + syn region shFunctionOne fold matchgroup=shFunction start="^\s*\h[-a-zA-Z_0-9]*\s*()\_s*{" end="}" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment + syn region shFunctionTwo fold matchgroup=shFunction start="\h[-a-zA-Z_0-9]*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment + else + syn region shFunctionOne matchgroup=shFunction start="^\s*\h[-a-zA-Z_0-9]*\s*()\_s*{" end="}" contains=@shFunctionList + syn region shFunctionTwo matchgroup=shFunction start="\h[-a-zA-Z_0-9]*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained + endif else - syn region shFunctionOne transparent start="^\s*\h\w*\s*()\_s*\ze{" matchgroup=shFunctionStart end="}" contains=@shFunctionList - syn region shFunctionTwo transparent start="\h\w*\s*\%(()\)\=\_s*\ze{" matchgroup=shFunctionStart end="}" contains=shFunctionKey,@shFunctionList contained + if (g:sh_fold_enabled % (s:sh_fold_functions * 2))/s:sh_fold_functions + syn region shFunctionOne fold matchgroup=shFunction start="^\s*\h\w*\s*()\_s*{" end="}" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment + syn region shFunctionTwo fold matchgroup=shFunction start="\h\w*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment + else + syn region shFunctionOne matchgroup=shFunction start="^\s*\h\w*\s*()\_s*{" end="}" contains=@shFunctionList + syn region shFunctionTwo matchgroup=shFunction start="\h\w*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained + endif endif " Parameter Dereferencing: {{{1 @@ -365,6 +382,7 @@ syn match shDerefSimple "\$[-#*@!?]" syn match shDerefSimple "\$\$" if exists("b:is_bash") || exists("b:is_kornshell") syn region shDeref matchgroup=PreProc start="\${##\=" end="}" contains=@shDerefList + syn region shDeref matchgroup=PreProc start="\${\$\$" end="}" contains=@shDerefList endif " bash: ${!prefix*} and ${#parameter}: {{{1 @@ -401,9 +419,9 @@ if exists("b:is_bash") || exists("b:is_kornshell") syn region shDerefPattern contained start="{" end="}" contains=shDeref,shDerefSimple,shDerefString,shCommandSub nextgroup=shDerefPattern syn match shDerefEscape contained '\%(\\\\\)*\\.' endif -syn region shDerefString contained matchgroup=shOperator start=+'+ end=+'+ contains=shStringSpecial -syn region shDerefString contained matchgroup=shOperator start=+"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial -syn match shDerefString contained "\\["']" +syn region shDerefString contained matchgroup=shOperator start=+\%(\\\)\@<!'+ end=+'+ contains=shStringSpecial +syn region shDerefString contained matchgroup=shOperator start=+\%(\\\)\@<!"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial +syn match shDerefString contained "\\["']" nextgroup=shDerefPattern if exists("b:is_bash") " bash : ${parameter:offset} @@ -418,6 +436,9 @@ if exists("b:is_bash") syn region shDerefPPSright contained start='.' end='\ze}' contains=@shCommandSubList endif +" Arithmetic Parenthesized Expressions: {{{1 +syn region shParen matchgroup=shArithRegion start='(\ze[^(]' end=')' contains=@shArithParenList + " Useful sh Keywords: {{{1 " =================== syn keyword shStatement break cd chdir continue eval exec exit kill newgrp pwd read readonly return shift test trap ulimit umask wait @@ -427,7 +448,12 @@ syn keyword shCondError elif else then " Useful ksh Keywords: {{{1 " ==================== if exists("b:is_kornshell") || exists("b:is_bash") - syn keyword shStatement autoload bg false fc fg functions getopts hash history integer jobs let nohup print printf r stop suspend time times true type unalias whence + syn keyword shStatement autoload bg false fc fg functions getopts hash history integer jobs let nohup print printf r stop suspend times true type unalias whence + if exists("g:is_posix") + syn keyword shStatement command + else + syn keyword shStatement time + endif " Useful bash Keywords: {{{1 " ===================== @@ -467,7 +493,6 @@ hi def link shCaseCommandSub shCommandSub hi def link shCaseDoubleQuote shDoubleQuote hi def link shCaseIn shConditional hi def link shCaseSingleQuote shSingleQuote -hi def link shCaseDoubleQuote shSingleQuote hi def link shCaseStart shConditional hi def link shCmdSubRegion shShellVariables hi def link shColon shStatement @@ -481,18 +506,22 @@ hi def link shDerefString shDoubleQuote hi def link shDerefVar shDeref hi def link shDoubleQuote shString hi def link shEcho shString +hi def link shEchoQuote shString hi def link shEmbeddedEcho shString +hi def link shEscape shCommandSub hi def link shExSingleQuote shSingleQuote -hi def link shExDoubleQuote shSingleQuote -hi def link shFunctionStart Delimiter +hi def link shFunction Function hi def link shHereDoc shString hi def link shHerePayload shHereDoc hi def link shLoop shStatement hi def link shOption shCommandSub hi def link shPattern shString +hi def link shParen shArithmetic hi def link shPosnParm shShellVariables +hi def link shQuickComment shComment hi def link shRange shOperator hi def link shRedir shOperator +hi def link shSetOption shOption hi def link shSingleQuote shString hi def link shSource shOperator hi def link shStringSpecial shSpecial diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index bbf31f7a7..c220f9de2 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -1,8 +1,8 @@ " Vim syntax file -" Language: Vim 7.1 script +" Language: Vim 7.2 script " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz> -" Last Change: Apr 08, 2008 -" Version: 7.1-77 +" Last Change: Jul 10, 2008 +" Version: 7.2-79+ " Automatically generated keyword lists: {{{1 " Quit when a syntax file was already loaded {{{2 @@ -25,12 +25,12 @@ syn match vimCommand contained "\<z[-+^.=]" " vimOptions are caught only when contained in a vimSet {{{2 syn keyword vimOption contained acd ambiwidth arabicshape autowriteall backupdir bdlay binary breakat bufhidden cdpath cin cinwords columns completeopt cpo cscopetagorder csverb deco dictionary directory ed encoding errorfile exrc fdls fencs fileformats fmr foldlevel foldtext fsync gfs gtl guioptions hf hk hlsearch imak ims indentexpr is isp keywordprg lazyredraw lispwords ls makeef maxmapdepth mfd mmd modified mousemodel msm numberwidth operatorfunc pastetoggle pexpr pmbfn printexpr pt readonly rightleft rtp sb scroll sect sessionoptions shellpipe shellxquote showbreak shq slm smd spc spf sr sta sts swapfile sxq tabpagemax tags tbis terse thesaurus titleold toolbariconsize tsr ttyfast tx ut verbosefile virtualedit wb wfw wildcharm winaltkeys winminwidth wmnu write -syn keyword vimOption contained ai ambw ari aw backupext beval biosk brk buflisted cedit cindent clipboard com confirm cpoptions cscopeverbose cuc def diff display edcompatible endofline errorformat fcl fdm fex filetype fo foldlevelstart formatexpr ft gfw gtt guipty hh hkmap ic imc imsearch indentkeys isf isprint km lbr list lsp makeprg maxmem mh mmp more mouses mzq nuw opfunc patchexpr pfn popt printfont pumheight remap rightleftcmd ru sbo scrollbind sections sft shellquote shiftround showcmd si sm sn spell spl srr stal su swapsync syn tabstop tagstack tbs textauto tildeop titlestring top ttimeout ttym uc vb vfile visualbell wc wh wildignore window winwidth wmw writeany -syn keyword vimOption contained akm anti arshape awa backupskip bex bioskey browsedir buftype cf cink cmdheight comments consk cpt cspc cul define diffexpr dy ef eol esckeys fcs fdn ff fillchars foldclose foldmarker formatlistpat gcr ghr guicursor guitablabel hi hkmapp icon imcmdline inc indk isfname joinspaces kmp lcs listchars lw mat maxmempattern mis mmt mouse mouseshape mzquantum odev osfiletype patchmode ph preserveindent printheader pvh report rl ruf sbr scrolljump secure sh shellredir shiftwidth showfulltag sidescroll smartcase so spellcapcheck splitbelow ss startofline sua swb synmaxcol tag tal tenc textmode timeout tl tpm ttimeoutlen ttymouse ul vbs vi vop wcm whichwrap wildmenu winfixheight wiv wop writebackup -syn keyword vimOption contained al antialias autochdir background balloondelay bexpr bk bs casemap cfu cinkeys cmdwinheight commentstring conskey cscopepathcomp csprg cursorcolumn delcombine diffopt ea efm ep et fdc fdo ffs fk foldcolumn foldmethod formatoptions gd go guifont guitabtooltip hid hkp iconstring imd include inex isi js kp linebreak lm lz matchpairs maxmemtot mkspellmem mod mousef mouset nf oft pa path pheader previewheight printmbcharset pvw restorescreen rlc ruler sc scrolloff sel shcf shellslash shm showmatch sidescrolloff smartindent softtabstop spellfile splitright ssl statusline suffixes swf syntax tagbsearch tb term textwidth timeoutlen tm tr ttm ttyscroll undolevels vdir viewdir wa wd wi wildmode winfixwidth wiw wrap writedelay -syn keyword vimOption contained aleph ar autoindent backspace ballooneval bg bkc bsdir cb ch cino cmp compatible copyindent cscopeprg csqf cursorline dex digraph ead ei equalalways eventignore fde fdt fileencoding fkmap foldenable foldminlines formatprg gdefault gp guifontset helpfile hidden hl ignorecase imdisable includeexpr inf isident key langmap lines lmap ma matchtime mco ml modeline mousefocus mousetime nrformats ofu para pdev pi previewwindow printmbfont qe revins ro rulerformat scb scrollopt selection shell shelltemp shortmess showmode siso smarttab sol spelllang spr ssop stl suffixesadd switchbuf ta taglength tbi termbidi tf title to ts tty ttytype updatecount ve viewoptions wak weirdinvert wig wildoptions winheight wm wrapmargin ws -syn keyword vimOption contained allowrevins arab autoread backup balloonexpr bh bl bsk ccv charconvert cinoptions cms complete cot cscopequickfix cst cwh dg dip eadirection ek equalprg ex fdi fen fileencodings flp foldexpr foldnestmax fp gfm grepformat guifontwide helpheight highlight hlg im imi incsearch infercase isk keymap langmenu linespace loadplugins macatsui maxcombine mef mls modelines mousehide mp nu omnifunc paragraphs penc pm printdevice printoptions quoteescape ri rs runtimepath scr scs selectmode shellcmdflag shelltype shortname showtabline sj smc sp spellsuggest sps st stmp sw sws tabline tagrelative tbidi termencoding tgst titlelen toolbar tsl ttybuiltin tw updatetime verbose viminfo warn wfh wildchar wim winminheight wmh wrapscan ww -syn keyword vimOption contained altkeymap arabic autowrite backupcopy bdir bin bomb bt cd ci cinw co completefunc cp cscopetag csto debug dict dir eb enc errorbells expandtab fdl fenc fileformat fml foldignore foldopen fs gfn grepprg guiheadroom helplang history hls imactivatekey iminsert inde insertmode iskeyword keymodel laststatus lisp lpl magic maxfuncdepth menuitems mm modifiable mousem mps number opendevice paste pex pmbcs printencoding prompt +syn keyword vimOption contained ai ambw ari aw backupext beval biosk brk buflisted cedit cindent clipboard com confirm cpoptions cscopeverbose cuc def diff display edcompatible endofline errorformat fcl fdm fex filetype fo foldlevelstart formatexpr ft gfw gtt guipty hh hkmap ic imc imsearch indentkeys isf isprint km lbr list lsp makeprg maxmem mh mmp more mouses mzq nuw opfunc patchexpr pfn popt printfont pumheight redrawtime rightleftcmd ru sbo scrollbind sections sft shellquote shiftround showcmd si sm sn spell spl srr stal su swapsync syn tabstop tagstack tbs textauto tildeop titlestring top ttimeout ttym uc vb vfile visualbell wc wh wildignore window winwidth wmw writeany +syn keyword vimOption contained akm anti arshape awa backupskip bex bioskey browsedir buftype cf cink cmdheight comments consk cpt cspc cul define diffexpr dy ef eol esckeys fcs fdn ff fillchars foldclose foldmarker formatlistpat gcr ghr guicursor guitablabel hi hkmapp icon imcmdline inc indk isfname joinspaces kmp lcs listchars lw mat maxmempattern mis mmt mouse mouseshape mzquantum odev osfiletype patchmode ph preserveindent printheader pvh remap rl ruf sbr scrolljump secure sh shellredir shiftwidth showfulltag sidescroll smartcase so spellcapcheck splitbelow ss startofline sua swb synmaxcol tag tal tenc textmode timeout tl tpm ttimeoutlen ttymouse ul vbs vi vop wcm whichwrap wildmenu winfixheight wiv wop writebackup +syn keyword vimOption contained al antialias autochdir background balloondelay bexpr bk bs casemap cfu cinkeys cmdwinheight commentstring conskey cscopepathcomp csprg cursorcolumn delcombine diffopt ea efm ep et fdc fdo ffs fk foldcolumn foldmethod formatoptions gd go guifont guitabtooltip hid hkp iconstring imd include inex isi js kp linebreak lm lz matchpairs maxmemtot mkspellmem mod mousef mouset nf oft pa path pheader previewheight printmbcharset pvw report rlc ruler sc scrolloff sel shcf shellslash shm showmatch sidescrolloff smartindent softtabstop spellfile splitright ssl statusline suffixes swf syntax tagbsearch tb term textwidth timeoutlen tm tr ttm ttyscroll undolevels vdir viewdir wa wd wi wildmode winfixwidth wiw wrap writedelay +syn keyword vimOption contained aleph ar autoindent backspace ballooneval bg bkc bsdir cb ch cino cmp compatible copyindent cscopeprg csqf cursorline dex digraph ead ei equalalways eventignore fde fdt fileencoding fkmap foldenable foldminlines formatprg gdefault gp guifontset helpfile hidden hl ignorecase imdisable includeexpr inf isident key langmap lines lmap ma matchtime mco ml modeline mousefocus mousetime nrformats ofu para pdev pi previewwindow printmbfont qe restorescreen ro rulerformat scb scrollopt selection shell shelltemp shortmess showmode siso smarttab sol spelllang spr ssop stl suffixesadd switchbuf ta taglength tbi termbidi tf title to ts tty ttytype updatecount ve viewoptions wak weirdinvert wig wildoptions winheight wm wrapmargin ws +syn keyword vimOption contained allowrevins arab autoread backup balloonexpr bh bl bsk ccv charconvert cinoptions cms complete cot cscopequickfix cst cwh dg dip eadirection ek equalprg ex fdi fen fileencodings flp foldexpr foldnestmax fp gfm grepformat guifontwide helpheight highlight hlg im imi incsearch infercase isk keymap langmenu linespace loadplugins macatsui maxcombine mef mls modelines mousehide mp nu omnifunc paragraphs penc pm printdevice printoptions quoteescape revins rs runtimepath scr scs selectmode shellcmdflag shelltype shortname showtabline sj smc sp spellsuggest sps st stmp sw sws tabline tagrelative tbidi termencoding tgst titlelen toolbar tsl ttybuiltin tw updatetime verbose viminfo warn wfh wildchar wim winminheight wmh wrapscan ww +syn keyword vimOption contained altkeymap arabic autowrite backupcopy bdir bin bomb bt cd ci cinw co completefunc cp cscopetag csto debug dict dir eb enc errorbells expandtab fdl fenc fileformat fml foldignore foldopen fs gfn grepprg guiheadroom helplang history hls imactivatekey iminsert inde insertmode iskeyword keymodel laststatus lisp lpl magic maxfuncdepth menuitems mm modifiable mousem mps number opendevice paste pex pmbcs printencoding prompt rdt ri " vimOptions: These are the turn-off setting variants {{{2 syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoread noaw noballooneval nobinary nobk nobuflisted nocin noconfirm nocopyindent nocscopeverbose nocuc nocursorline nodg nodisable noeb noedcompatible noendofline noequalalways noesckeys noex noexrc nofk nofoldenable nogdefault nohid nohk nohkmapp nohls noic noignorecase noimc noimd noinf noinsertmode nojoinspaces nolazyredraw nolinebreak nolist nolpl noma nomagic noml nomodeline nomodified nomousef nomousehide nonumber noopendevice nopi nopreviewwindow nopvw noremap norevins norightleft norl noro noru nosb noscb noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx novisualbell nowarn noweirdinvert nowfw nowinfixheight nowiv nowrap nowrite nowritebackup @@ -70,9 +70,9 @@ syn match vimHLGroup contained "Conceal" syn case match " Function Names {{{2 -syn keyword vimFuncName contained add argidx browsedir bufloaded bufwinnr call cindent complete confirm cscope_connection delete diff_hlID eval exists expr8 feedkeys filewritable finddir fnamemodify foldclosedend foldtext foreground garbagecollect getbufline getchar getcmdline getcmdtype getfontname getfsize getftype getloclist getpos getreg gettabwinvar getwinposy glob has haslocaldir histadd histget hlexists hostname indent input inputlist inputsave insert islocked join len libcallnr line2byte localtime maparg match matcharg matchend matchstr min mode nr2char prevnonblank pumvisible readfile reltimestr remote_foreground remote_read remove repeat reverse searchdecl searchpairpos server2client setbufvar setline setmatches setqflist settabwinvar shellescape sort spellbadword split strftime string strpart strtrans substitute synIDattr system tabpagenr tagfiles tempname toupper type virtcol winbufnr winheight winnr winrestview winwidth -syn keyword vimFuncName contained append argv bufexists bufname byte2line changenr clearmatches complete_add copy cursor did_filetype empty eventhandler expand extend filereadable filter findfile foldclosed foldlevel foldtextresult function get getbufvar getcharmod getcmdpos getcwd getfperm getftime getline getmatches getqflist getregtype getwinposx getwinvar globpath has_key hasmapto histdel histnr hlID iconv index inputdialog inputrestore inputsecret isdirectory items keys libcall line lispindent map mapcheck matchadd matchdelete matchlist max mkdir nextnonblank pathshorten printf range reltime remote_expr remote_peek remote_send rename resolve search searchpair searchpos serverlist setcmdpos setloclist setpos setreg setwinvar simplify soundfold spellsuggest str2nr stridx strlen strridx submatch synID synIDtrans tabpagebuflist tabpagewinnr taglist tolower tr values visualmode wincol winline winrestcmd winsaveview writefile -syn keyword vimFuncName contained argc browse buflisted bufnr byteidx char2nr col complete_check count deepcopy diff_filler escape executable +syn keyword vimFuncName contained abs argc atan bufexists bufname byte2line ceil cindent complete confirm count deepcopy diff_filler escape executable expr8 filereadable finddir floor foldclosed foldtext function getbufline getcharmod getcmdtype getfperm getftype getmatches getqflist gettabwinvar getwinposy glob has haslocaldir histadd histget hlexists hostname indent input inputlist inputsave insert islocked join len libcallnr line2byte localtime map mapcheck matchadd matchdelete matchlist max mkdir nextnonblank pathshorten prevnonblank pumvisible readfile reltimestr remote_foreground remote_read remove repeat reverse search searchpair searchpos serverlist setcmdpos setloclist setpos setreg setwinvar simplify sort spellbadword split str2float strftime string strpart strtrans substitute synIDattr synstack tabpagebuflist tabpagewinnr taglist tolower tr type virtcol winbufnr winheight winnr winrestview winwidth +syn keyword vimFuncName contained add argidx browse buflisted bufnr byteidx changenr clearmatches complete_add copy cscope_connection delete diff_hlID eval exists extend filewritable findfile fnameescape foldclosedend foldtextresult garbagecollect getbufvar getcmdline getcwd getfsize getline getpid getreg getwinposx getwinvar globpath has_key hasmapto histdel histnr hlID iconv index inputdialog inputrestore inputsecret isdirectory items keys libcall line lispindent log10 maparg match matcharg matchend matchstr min mode nr2char pow printf range reltime remote_expr remote_peek remote_send rename resolve round searchdecl searchpairpos server2client setbufvar setline setmatches setqflist settabwinvar shellescape sin soundfold spellsuggest sqrt str2nr stridx strlen strridx submatch synID synIDtrans system tabpagenr tagfiles tempname toupper trunc values visualmode wincol winline winrestcmd winsaveview writefile +syn keyword vimFuncName contained append argv browsedir bufloaded bufwinnr call char2nr col complete_check cos cursor did_filetype empty eventhandler expand feedkeys filter float2nr fnamemodify foldlevel foreground get getchar getcmdpos getfontname getftime getloclist getpos getregtype "--- syntax above generated by mkvimvim --- " Special Vim Highlighting (not automatic) {{{1 @@ -157,7 +157,7 @@ syn cluster vimFuncBodyList contains=vimAddress,vimAutoCmd,vimCmplxRepeat,vimCom if !exists("g:vimsyn_noerror") syn match vimFunctionError "\<fu\%[nction]!\=\s\+\zs\U\i\{-}\ze\s*(" contains=vimFuncKey,vimFuncBlank nextgroup=vimFuncBody endif -syn match vimFunction "\<fu\%[nction]!\=\s\+\(\(<[sS][iI][dD]>\|[Ss]:\|\u\|\i\+#\)\i*\|g:\(\I\i*\.\)\+\I\i*\)\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody +syn match vimFunction "\<fu\%[nction]!\=\s\+\(\(<[sS][iI][dD]>\|[Ss]:\|\u\|\i\+#\)\i*\|\(g:\)\=\(\I\i*\.\)\+\I\i*\)\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'f' syn region vimFuncBody contained fold start="\ze(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\)" contains=@vimFuncBodyList else @@ -547,6 +547,9 @@ if (g:vimsyn_embed =~ 'p' && has("perl")) && filereadable(expand("<sfile>:p:h"). syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPerlScript syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*$+ end=+\.$+ contains=@vimPerlScript endif +else + syn region vimEmbedError start=+pe\%[rl]\s*<<\s*\z(.*\)$+ end=+^\z1$+ + syn region vimEmbedError start=+pe\%[rl]\s*<<\s*$+ end=+\.$+ endif " [-- ruby --] {{{3 @@ -556,9 +559,12 @@ if (g:vimsyn_embed =~ 'r' && has("ruby")) && filereadable(expand("<sfile>:p:h"). if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'r' syn region vimRubyRegion fold matchgroup=vimScriptDelim start=+rub[y]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimRubyScript else - syn region vimRubyRegion fold matchgroup=vimScriptDelim start=+rub[y]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimRubyScript + syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub[y]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimRubyScript endif syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub[y]\s*<<\s*$+ end=+\.$+ contains=@vimRubyScript +else + syn region vimEmbedError start=+rub[y]\s*<<\s*\z(.*\)$+ end=+^\z1$+ + syn region vimEmbedError start=+rub[y]\s*<<\s*$+ end=+\.$+ endif " [-- python --] {{{3 @@ -572,6 +578,9 @@ if (g:vimsyn_embed =~ 'P' && has("python")) && filereadable(expand("<sfile>:p:h" syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPythonScript syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon]\s*<<\s*$+ end=+\.$+ contains=@vimPythonScript endif +else + syn region vimEmbedError start=+py\%[thon]\s*<<\s*\z(.*\)$+ end=+^\z1$+ + syn region vimEmbedError start=+py\%[thon]\s*<<\s*$+ end=+\.$+ endif " [-- tcl --] {{{3 @@ -593,6 +602,9 @@ if trytcl syn region vimTclRegion matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*$+ end=+\.$+ contains=@vimTclScript endif endif +else + syn region vimEmbedError start=+tc[l]\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ + syn region vimEmbedError start=+tc[l]\=\s*<<\s*$+ end=+\.$+ endif unlet trytcl @@ -602,13 +614,16 @@ if (g:vimsyn_embed =~ 'm' && has("mzscheme")) && filereadable(expand("<sfile>:p: let iskKeep= &isk syn include @vimMzSchemeScript <sfile>:p:h/scheme.vim let &isk= iskKeep - if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 't' + if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'm' syn region vimMzSchemeRegion fold matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimMzSchemeScript syn region vimMzSchemeRegion fold matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*$+ end=+\.$+ contains=@vimMzSchemeScript else syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimMzSchemeScript syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*$+ end=+\.$+ contains=@vimMzSchemeScript endif +else + syn region vimEmbedError start=+mz\%[scheme]\s*<<\s*\z(.*\)$+ end=+^\z1$+ + syn region vimEmbedError start=+mz\%[scheme]\s*<<\s*$+ end=+\.$+ endif " Synchronize (speed) {{{2 @@ -635,6 +650,7 @@ if !exists("g:vimsyn_noerror") hi def link vimBehaveError vimError hi def link vimCollClassErr vimError hi def link vimErrSetting vimError + hi def link vimEmbedError vimError hi def link vimFTError vimError hi def link vimFunctionError vimError hi def link vimFunc vimError diff --git a/runtime/tutor/tutor.pl b/runtime/tutor/tutor.pl index 7f39f3894..4ae5355e9 100644 --- a/runtime/tutor/tutor.pl +++ b/runtime/tutor/tutor.pl @@ -142,12 +142,12 @@ UWAGA: Ucz się przez ćwiczenie, nie wkuwanie. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.6.: EDYCJA PLIKU - ** Użyj :wq aby zapisać plik i wyj¶ć. ** !! UWAGA: zanim wykonasz jakiekolwiek polecenia przeczyaj cał± lekcję !! 1. Zakończ tutorial tak jak w lekcji 1.2.: :q! + Lub je¶li masz dostęp do innego terminala zrób kolejne kroki tam. 2. W powłoce wydaj polecenie: vim tutor<ENTER> "vim" jest poleceniem uruchamiaj±cym edytor Vim. 'tutor' to nazwa pliku @@ -157,11 +157,11 @@ UWAGA: Ucz się przez ćwiczenie, nie wkuwanie. 4. Zapisz plik ze zmianami i opu¶ć Vima: :wq<ENTER> - 5. Uruchom ponownie vimtutor i przejdĽ do podsumowania lekcji. + 5. Je¶li zakończyłe¶ vimtutor w kroku 1. uruchom go ponownie i przejdĽ + do podsumowania poniżej. 6. Po przeczytaniu wszystkich kroków i ich zrozumieniu: wykonaj je. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 1. PODSUMOWANIE diff --git a/runtime/tutor/tutor.pl.cp1250 b/runtime/tutor/tutor.pl.cp1250 index 2c62b75d1..98971d014 100644 --- a/runtime/tutor/tutor.pl.cp1250 +++ b/runtime/tutor/tutor.pl.cp1250 @@ -142,12 +142,12 @@ UWAGA: Ucz się przez ćwiczenie, nie wkuwanie. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.6.: EDYCJA PLIKU - ** Użyj :wq aby zapisać plik i wyjść. ** !! UWAGA: zanim wykonasz jakiekolwiek polecenia przeczyaj całą lekcję !! 1. Zakończ tutorial tak jak w lekcji 1.2.: :q! + Lub jeśli masz dostęp do innego terminala zrób kolejne kroki tam. 2. W powłoce wydaj polecenie: vim tutor<ENTER> "vim" jest poleceniem uruchamiającym edytor Vim. 'tutor' to nazwa pliku @@ -157,11 +157,11 @@ UWAGA: Ucz się przez ćwiczenie, nie wkuwanie. 4. Zapisz plik ze zmianami i opuść Vima: :wq<ENTER> - 5. Uruchom ponownie vimtutor i przejdź do podsumowania lekcji. + 5. Jeśli zakończyłeś vimtutor w kroku 1. uruchom go ponownie i przejdź + do podsumowania poniżej. 6. Po przeczytaniu wszystkich kroków i ich zrozumieniu: wykonaj je. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 1. PODSUMOWANIE diff --git a/runtime/tutor/tutor.pl.utf-8 b/runtime/tutor/tutor.pl.utf-8 index 4590c4551..88f95d126 100644 --- a/runtime/tutor/tutor.pl.utf-8 +++ b/runtime/tutor/tutor.pl.utf-8 @@ -142,12 +142,12 @@ UWAGA: Ucz siÄ™ przez ćwiczenie, nie wkuwanie. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.6.: EDYCJA PLIKU - ** UĹĽyj :wq aby zapisać plik i wyjść. ** !! UWAGA: zanim wykonasz jakiekolwiek polecenia przeczyaj caĹ‚Ä… lekcjÄ™ !! 1. ZakoĹ„cz tutorial tak jak w lekcji 1.2.: :q! + Lub jeĹ›li masz dostÄ™p do innego terminala zrĂłb kolejne kroki tam. 2. W powĹ‚oce wydaj polecenie: vim tutor<ENTER> "vim" jest poleceniem uruchamiajÄ…cym edytor Vim. 'tutor' to nazwa pliku @@ -157,11 +157,11 @@ UWAGA: Ucz siÄ™ przez ćwiczenie, nie wkuwanie. 4. Zapisz plik ze zmianami i opuść Vima: :wq<ENTER> - 5. Uruchom ponownie vimtutor i przejdĹş do podsumowania lekcji. + 5. JeĹ›li zakoĹ„czyĹ‚eĹ› vimtutor w kroku 1. uruchom go ponownie i przejdĹş + do podsumowania poniĹĽej. 6. Po przeczytaniu wszystkich krokĂłw i ich zrozumieniu: wykonaj je. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 1. PODSUMOWANIE diff --git a/runtime/vimrc_example.vim b/runtime/vimrc_example.vim index a2a891c16..2c0de3d8a 100644 --- a/runtime/vimrc_example.vim +++ b/runtime/vimrc_example.vim @@ -1,7 +1,7 @@ " An example for a vimrc file. " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last change: 2008 Jun 16 +" Last change: 2008 Jul 02 " " To use it, copy it to " for Unix and OS/2: ~/.vimrc @@ -42,7 +42,9 @@ map Q gq inoremap <C-U> <C-G>u<C-U> " In many terminal emulators the mouse works just fine, thus enable it. -set mouse=a +if has('mouse') + set mouse=a +endif " Switch syntax highlighting on, when the terminal has colors " Also switch on highlighting the last used search pattern. |