# HG changeset patch # User vimboss # Date 1215970909 0 # Node ID 0b796e045c429253e9ce8825ad05aad2474553bd # Parent 131dbd3d2a4bba5d1514c2842952ca7b77b6902e updated for version 7.2b-000 diff --git a/Contents b/Contents --- a/Contents +++ b/Contents @@ -9,10 +9,10 @@ Vim Vi IMproved. A clone of the UNIX t messages, shows current file name in window title, on-line help, rectangular cut/paste, etc., etc., etc... - Version 7.2a. Also runs under UNIX, MSDOS and other systems. - vim72art.tgz contains the documentation and syntax files. - vim72abin.tgz contains the binaries. - vim72asrc.tgz contains the sources. + Version 7.2b. Also runs under UNIX, MSDOS and other systems. + vim72brt.tgz contains the documentation and syntax files. + vim72bbin.tgz contains the binaries. + vim72bsrc.tgz contains the sources. Author: Bram Moolenaar et al. diff --git a/Filelist b/Filelist --- a/Filelist +++ b/Filelist @@ -516,6 +516,7 @@ RT_SCRIPTS = \ runtime/indent/*.vim \ runtime/indent/README.txt \ runtime/ftplugin/*.vim \ + runtime/ftplugin/logtalk.dict \ runtime/ftplugin/README.txt \ runtime/plugin/*.vim \ runtime/plugin/README.txt \ diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ all install uninstall tools config confi # Before creating an archive first delete all backup files, *.orig, etc. MAJOR = 7 -MINOR = 2a +MINOR = 2b # Uncomment this line if the Win32s version is to be included. DOSBIN_S = dosbin_s @@ -133,7 +133,7 @@ DOSBIN_S = dosbin_s # Win32 console version: # - Set environment for Visual C++ 2008 Express Edition: "msvc2008.bat". Or, # when using the Visual C++ Toolkit 2003: "msvcsetup.bat" (adjust the paths -# when necessary). +# when necessary). For Windows 98 the 2003 version is required. # - "nmake -f Make_mvc.mak" # - "rm testdir/*.out", "nmake -f Make_mvc.mak test" and check the output. # - Rename the executables to "vimw32.exe", "xxdw32.exe". diff --git a/README.txt b/README.txt --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -README.txt for version 7.2a of Vim: Vi IMproved. +README.txt for version 7.2b of Vim: Vi IMproved. WHAT IS VIM diff --git a/README_ami.txt b/README_ami.txt --- a/README_ami.txt +++ b/README_ami.txt @@ -1,4 +1,4 @@ -README_ami.txt for version 7.2a of Vim: Vi IMproved. +README_ami.txt for version 7.2b of Vim: Vi IMproved. This file explains the installation of Vim on Amiga systems. See README.txt for general information about Vim. diff --git a/README_amibin.txt b/README_amibin.txt --- a/README_amibin.txt +++ b/README_amibin.txt @@ -1,4 +1,4 @@ -README_amibin.txt for version 7.2a of Vim: Vi IMproved. +README_amibin.txt for version 7.2b of Vim: Vi IMproved. See "README.txt" for general information about Vim. See "README_ami.txt" for installation instructions for the Amiga. diff --git a/README_amisrc.txt b/README_amisrc.txt --- a/README_amisrc.txt +++ b/README_amisrc.txt @@ -1,4 +1,4 @@ -README_amisrc.txt for version 7.2a of Vim: Vi IMproved. +README_amisrc.txt for version 7.2b of Vim: Vi IMproved. See "README.txt" for general information about Vim. See "README_ami.txt" for installation instructions for the Amiga. diff --git a/README_bindos.txt b/README_bindos.txt --- a/README_bindos.txt +++ b/README_bindos.txt @@ -1,4 +1,4 @@ -README_bindos.txt for version 7.2a of Vim: Vi IMproved. +README_bindos.txt for version 7.2b of Vim: Vi IMproved. See "README.txt" for general information about Vim. See "README_dos.txt" for installation instructions for MS-DOS and MS-Windows. diff --git a/README_dos.txt b/README_dos.txt --- a/README_dos.txt +++ b/README_dos.txt @@ -1,4 +1,4 @@ -README_dos.txt for version 7.2a of Vim: Vi IMproved. +README_dos.txt for version 7.2b of Vim: Vi IMproved. This file explains the installation of Vim on MS-DOS and MS-Windows systems. See "README.txt" for general information about Vim. diff --git a/README_extra.txt b/README_extra.txt --- a/README_extra.txt +++ b/README_extra.txt @@ -1,4 +1,4 @@ -README_extra.txt for version 7.2a of Vim: Vi IMproved. +README_extra.txt for version 7.2b of Vim: Vi IMproved. The extra archive of Vim is to be used in combination with the source archive (vim-7.0-src.tar.gz). The extra archive is useless without it. diff --git a/README_lang.txt b/README_lang.txt --- a/README_lang.txt +++ b/README_lang.txt @@ -1,4 +1,4 @@ -README_lang.txt for version 7.2a of Vim: Vi IMproved. +README_lang.txt for version 7.2b of Vim: Vi IMproved. This file contains files for non-English languages: - Translated messages. diff --git a/README_mac.txt b/README_mac.txt --- a/README_mac.txt +++ b/README_mac.txt @@ -1,4 +1,4 @@ -README_mac.txt for version 7.2a of Vim: Vi IMproved. +README_mac.txt for version 7.2b of Vim: Vi IMproved. This file explains the installation of Vim on Macintosh systems. See "README.txt" for general information about Vim. diff --git a/README_ole.txt b/README_ole.txt --- a/README_ole.txt +++ b/README_ole.txt @@ -1,4 +1,4 @@ -README_ole.txt for version 7.2a of Vim: Vi IMproved. +README_ole.txt for version 7.2b of Vim: Vi IMproved. This archive contains gvim.exe with OLE interface and VisVim. This version of gvim.exe can also load a number of interface dynamically (you diff --git a/README_os2.txt b/README_os2.txt --- a/README_os2.txt +++ b/README_os2.txt @@ -1,4 +1,4 @@ -README_os2.txt for version 7.2a of Vim: Vi IMproved. +README_os2.txt for version 7.2b of Vim: Vi IMproved. This file explains the installation of Vim on OS/2 systems. See "README.txt" for general information about Vim. diff --git a/README_os390.txt b/README_os390.txt --- a/README_os390.txt +++ b/README_os390.txt @@ -1,4 +1,4 @@ -README_os_390.txt for version 7.2a of Vim: Vi IMproved. +README_os_390.txt for version 7.2b of Vim: Vi IMproved. Welcome to the OS/390 Unix port of VIM. diff --git a/README_src.txt b/README_src.txt --- a/README_src.txt +++ b/README_src.txt @@ -1,4 +1,4 @@ -README_src.txt for version 7.2a of Vim: Vi IMproved. +README_src.txt for version 7.2b of Vim: Vi IMproved. The source archive contains the files needed to compile Vim on Unix systems. It is packed for Unix systems (NL line separator). It is also used for other diff --git a/README_srcdos.txt b/README_srcdos.txt --- a/README_srcdos.txt +++ b/README_srcdos.txt @@ -1,4 +1,4 @@ -README_srcdos.txt for version 7.2a of Vim: Vi IMproved. +README_srcdos.txt for version 7.2b of Vim: Vi IMproved. See "README.txt" for general information about Vim. See "README_dos.txt" for installation instructions for MS-DOS and MS-Windows. diff --git a/README_unix.txt b/README_unix.txt --- a/README_unix.txt +++ b/README_unix.txt @@ -1,4 +1,4 @@ -README_unix.txt for version 7.2a of Vim: Vi IMproved. +README_unix.txt for version 7.2b of Vim: Vi IMproved. This file explains the installation of Vim on Unix systems. See "README.txt" for general information about Vim. diff --git a/README_vms.txt b/README_vms.txt --- a/README_vms.txt +++ b/README_vms.txt @@ -1,4 +1,4 @@ -README_vms.txt for version 7.2a of Vim: Vi IMproved. +README_vms.txt for version 7.2b of Vim: Vi IMproved. This file explains the installation of Vim on VMS systems. See "README.txt" in the runtime archive for information about Vim. diff --git a/README_w32s.txt b/README_w32s.txt --- a/README_w32s.txt +++ b/README_w32s.txt @@ -1,4 +1,4 @@ -README_w32s.txt for version 7.2a of Vim: Vi IMproved. +README_w32s.txt for version 7.2b of Vim: Vi IMproved. This archive contains the gvim.exe that was specifically compiled for use in the Win32s subsystem in MS-Windows 3.1 and 3.11. diff --git a/nsis/gvim.nsi b/nsis/gvim.nsi --- a/nsis/gvim.nsi +++ b/nsis/gvim.nsi @@ -22,7 +22,7 @@ !define HAVE_NLS !define VER_MAJOR 7 -!define VER_MINOR 2a +!define VER_MINOR 2b # ----------- No configurable settings below this line ----------- diff --git a/runtime/autoload/ada.vim b/runtime/autoload/ada.vim --- 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 +" Taylor Venable " Neil Bird +" Ned Okie " $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 + + try + set sessionoptions=buffers,curdir,folds,globals,resize,slash,tabpages,tabpages,unix,winpos,winsize - let v:this_session = a:New_Session + 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 - if filereadable (v:this_session) - execute 'source ' . v:this_session - endif + let v:this_session = a:New_Session - augroup ada_session - autocmd! - autocmd VimLeavePre * execute 'mksession! ' . v:this_session - augroup END - endif + "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, Comma \ a:Keys . \" :" . a:Command . "" else + if exists("g:mapleader") + let l:leader = g:mapleader + else + let l:leader = '\' + endif execute \ "50amenu " . \ "Ada." . escape(a:Text, ' ') . - \ "" . escape(g:mapleader . "a" . a:Keys , '\') . + \ "" . escape(l:leader . "a" . a:Keys , '\') . \ " :" . a:Command . "" execute \ "nnoremap " . - \ escape(g:mapleader . "a" . a:Keys , '\') . + \ escape(l:leader . "a" . a:Keys , '\') . \" :" . a:Command execute \ "inoremap " . - \ escape(g:mapleader . "a" . a:Keys , '\') . + \ escape(l:leader . "a" . a:Keys , '\') . \" :" . 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, ' ') . - \ "" . escape(g:mapleader . "a" . a:Keys , '\') . + \ "" . escape(l:leader . "a" . a:Keys , '\') . \ " :" . a:Command . "" call ada#Map_Menu (a:Text, a:Keys, a:Command) diff --git a/runtime/autoload/adacomplete.vim b/runtime/autoload/adacomplete.vim --- 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 --- 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 " $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 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 --- 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 --- 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 k +" Ned Okie " $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 (...) dic 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 --- a/runtime/autoload/gzip.vim +++ b/runtime/autoload/gzip.vim @@ -1,6 +1,6 @@ " Vim autoload file for editing compressed files. " Maintainer: Bram Moolenaar -" 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(":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 --- 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 " 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.'"/'."\" @@ -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, meth " 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, meth 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, meth 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, meth " 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, meth " 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 U :call NetrwBookmarkDir(5,expand("%")) nnoremap v :call NetrwSplit(5) nnoremap x :call netrw#NetrwBrowseX(NetrwBrowseChgDir(1,NetrwGetWord(),0),0)" + nnoremap % :call NetrwOpenFile(1) if !hasmapto('NetrwHideEdit') nmap NetrwHideEdit endif @@ -1775,6 +1766,7 @@ fun! s:BrowserMaps(islocal) nnoremap U :call NetrwBookmarkDir(5,b:netrw_curdir) nnoremap v :call NetrwSplit(2) nnoremap x :call netrw#NetrwBrowseX(NetrwBrowseChgDir(0,NetrwGetWord()),1) + nnoremap % :call NetrwOpenFile(0) if !hasmapto('NetrwHideEdit') nmap NetrwHideEdit endif @@ -1797,7 +1789,7 @@ fun! s:BrowserMaps(islocal) exe 'vnoremap D :call NetrwRemoteRm("'.s:user.s:machine.'","'.s:path.'")' exe 'nnoremap R :call NetrwRemoteRename("'.s:user.s:machine.'","'.s:path.'")' exe 'vnoremap R :call NetrwRemoteRename("'.s:user.s:machine.'","'.s:path.'")' - nnoremap :he netrw-browse-cmds + nnoremap :he netrw-quickhelp 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 call TreeListMove('[') nnoremap ] :silent call TreeListMove(']') nnoremap [[ :silent call TreeListMove('[') @@ -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("%") +" call Decho("setlocal bt=nofile nobl ma nonu nowrap noro") setlocal bt=nofile nobl ma nonu nowrap noro -" call Decho("setlocal bt=nofile nobl ma nonu nowrap noro") - exe "keepalt file ".escape(fname,' ') +" 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."\" 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 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) r 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) r 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 =~ "\\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\" + 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."\" + 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,'\',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) +" 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 =~ "\\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 +" call Decho("exe let result= ".a:cmd."('".path."')") + let result= delete(path) + endif 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 +" call Decho("let result= delete(".path.")") + let result= delete(path) + endif + 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 call TreeListMove('[') nno ] :silent call TreeListMove(']') 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\" - 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."\" - 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 --- 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 -" 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 --- 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 --- 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 " 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 --- 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 " 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:ve 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 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 --- 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 " $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', + \'', + \'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 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', - \'', - \'call decada.Make ()') - finish " 1}}} "------------------------------------------------------------------------------ diff --git a/runtime/compiler/eruby.vim b/runtime/compiler/eruby.vim --- 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 --- 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 k +" Ned Okie " $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 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 --- /dev/null +++ b/runtime/compiler/rspec.vim @@ -0,0 +1,41 @@ +" Vim compiler file +" Language: RSpec +" Maintainer: Tim Pope +" Info: $Id$ +" URL: http://vim-ruby.rubyforge.org +" Anon CVS: See above site +" Release Coordinator: Doug Kearns + +if exists("current_compiler") + finish +endif +let current_compiler = "rspec" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +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 --- 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 --- 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 displaye 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 --- 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 recursiv the expression cannot use "\=" for the substitute string. The special meaning for characters as mentioned at |sub-replace-special| does -not apply except "", "\" and "\\". Thus in the result of the -expression you need to use two backslashes get one, put a backslash before a - you want to insert and use a without a backslash where you want to +not apply except for "", "\" and "\\". Thus in the result of the +expression you need to use two backslashes to get one, put a backslash before a + you want to insert, and use a without a backslash where you want to break the line. For convenience a 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/\="\"/g -This replaces 'E' characters with an euro sign. Read more in ||. +This replaces each 'E' character with a euro sign. Read more in ||. 4.3 Search and replace *search-replace* diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt --- 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 availab - 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 (equiva 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 *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 @@ 11. File Searching *file-searching* {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 @@ 1) Downward search: *starstar* '**' 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 @@ 1) Downward search: *starstar* .... < 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 --- 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, w |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}) *getbufv 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}]) *histde 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 ite :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 @@ 7. Commands *expression-commands* < 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 --- 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 --- 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 ap 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 pa 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 u 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 ex 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 a 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: +> + +(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 --- 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 --- 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 --- 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 n 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 --- 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 other arguments. *:map-local* *:map-* *E224* *E225* -If the first argument to one of these commands is "" it will apply to -mappings locally to the current buffer only. Example: > +If the first argument to one of these commands is "" the mapping will +be effective in the current buffer only. Example: > :map ,w /[.,;] Then you can map ",w" to something else in another buffer: > :map ,w /[#&!] diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt --- 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 --- 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 --- 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 --- 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 --- 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 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 --- 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 shor |+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 shor 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 shor - 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 (se 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 `.*'. +User choices are read from "Choices:*" and are saved to ".*". 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 *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 fo 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), li > :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 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 (i.e. insid 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 and type `*vi -r'. +To see a list of swap files, press 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 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. 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 @@ 10. The shell - 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 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/[^ \t]*// < vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/os_unix.txt b/runtime/doc/os_unix.txt --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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- 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-m 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-%| + (gvim only) selects word under mouse as if a had been pressed (ie. edit file, change directory) (gvim only) same as P selecting word under mouse; @@ -1362,8 +1358,8 @@ will end up. One may change the sorting 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* {{ (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 use 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: | 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: | *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 ============================================================================== 12. History *netrw-history* {{{1 + v126: Jun 30, 2008 * after having gone to a remote directory, + 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 @@ 12. History *netrw-history* {{{1 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 --- 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 --- 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 --- 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 --- 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 @@ 4. Vimball History *vimball-history* 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 --- 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 @@ 3. Additional Extensions *zip-extens au BufReadCmd *.jar,*.xpi call zip#Browse(expand("")) < - 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -5460,6 +5460,7 @@ ft-papp-syntax syntax.txt /*ft-papp-synt 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 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 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 --- 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 --- 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 --- 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 --- 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 Vi *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 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 cur (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 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 Kan ":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 onl 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 n 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 bac VERASE key is Delete. Set VERASE to Backspace? (patch by Stephane Chazelas, 2007 Oct 16) +When entering a C /* comment, after typing 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 Mak 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 @@ 8 Add functions: 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 @@ 8 Handling of non-fixed width fonts is 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 @@ 9 When using ":e ++enc=foo file" and t '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 @@ 8 In the fileformat dialog, "Cancel" i 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 @@ 7 Add local directory for 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 @@ 8 Handle postponed prefix with COMPOUN WFP_COMPPERMIT and WFP_COMPFORBID 8 implement use of 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 @@ 6 Add file locking. Lock a file when 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 @@ 9 With ":set tags=./tags,../tags" and 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 @@ 8 When editing "tt.gz", which is in DO 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 @@ 8 When using CTRL-G CTRL-O do like CTR same change, so that "." repeats the whole insert. 7 Use CTRL-G 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 @@ 8 Add CTRL-W T: go to the top window i 7 Use CTRL-W , like alt-tab, to switch between buffers. Repeat to select another buffer (only loaded ones?), to go back, to select buffer, 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 ma "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 --- 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 --- 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 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 a 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 --- 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 --- 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. (Ma 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 rem 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 Lubin 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 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 se 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 sh 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 e 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 getp 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 wor '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 --- 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. |'cin 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 --- 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 --- 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 --- 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 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar -" 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(":r")) au BufNewFile,BufRead *~ \ let s:name = expand("") | @@ -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 gr 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 chask " 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. " 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 set 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 sa " 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:F let s:ft_rules_udev_rules_pattern = '^\s*\cudev_rules\s*=\s*"\([^"]\{-1,}\)/*".*' func! s:FTRules() - if expand(':p') =~ '^/etc/udev/rules\.d/.*\.rules$' + if expand(':p') =~ '^/etc/udev/\%(rules\.d/\)\=.*\.rules$' setf udevrules return endif @@ -2257,6 +2267,9 @@ au StdinReadPost * if !did_filetype() | " 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 --- 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 +" Taylor Venable " Neil Bird " $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 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 . '\:\\s\+\' 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 --- 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 + + " 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 " 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 - let colidx = -1 + 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 - return colidx - 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('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 --- 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 --- a/runtime/ftplugin/git.vim +++ b/runtime/ftplugin/git.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: generic git output " Maintainer: Tim Pope -" 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 --- /dev/null +++ b/runtime/ftplugin/haml.vim @@ -0,0 +1,66 @@ +" Vim filetype plugin +" Language: Haml +" Maintainer: Tim Pope + +" 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 --- /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 --- /dev/null +++ b/runtime/ftplugin/logtalk.vim @@ -0,0 +1,18 @@ +" Logtalk filetype plugin file +" Language: Logtalk +" Maintainer: Paulo Moura +" 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 --- /dev/null +++ b/runtime/ftplugin/sass.vim @@ -0,0 +1,18 @@ +" Vim filetype plugin +" Language: Sass +" Maintainer: Tim Pope + +" 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 --- 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 " Neil Bird +" Ned Okie " $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 < 7 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, 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, " 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_inde 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 --- 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 =~# '\' + if line =~# '\%({\|\' 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 --- /dev/null +++ b/runtime/indent/haml.vim @@ -0,0 +1,73 @@ +" Vim indent file +" Language: HAML +" Maintainer: Tim Pope +" 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,*,},],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\)\>\%(.*\\)\@!\|.*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 --- /dev/null +++ b/runtime/indent/logtalk.vim @@ -0,0 +1,61 @@ +" Maintainer: Paulo Moura +" 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 --- a/runtime/indent/php.vim +++ b/runtime/indent/php.vim @@ -2,11 +2,14 @@ " Language: PHP " Author: John Wellesz " 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.'.*)\|\%(//.*\)\@\)'.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 + 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 --- 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 = '\' +let s:syng_strcom = '\' " Regex of syntax group names that are strings. let s:syng_string = - \ '\' + \ '\' " Regex of syntax group names that are strings or documentation. let s:syng_stringdoc = - \'\' + \'\' " 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\)\>' . \ '\|\' @@ -78,15 +78,15 @@ let s:end_end_regex = '\%(^\|[^.:@$]\)\@ " Expression used for searchpair() call for finding match for 'end' keyword. let s:end_skip_expr = s:skip_expr . \ ' || (expand("") == "do"' . - \ ' && getline(".") =~ "^\\s*\\")' + \ ' && getline(".") =~ "^\\s*\\<\\(while\\|until\\|for\\)\\>")' " Regex that defines continuation lines, not including (, {, or [. -let s:continuation_regex = '\%([\\*+/.,=:-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$' +let s:continuation_regex = '\%([\\*+/.,:]\|\%(<%\)\@ +" 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,*,<:>,!^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 --- 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 -" 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, БДС). +" +" 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. +" +" 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. " -" 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. +" 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 €. " -" 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. +" 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 --- 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 -" 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 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 € +" 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. +" +" 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 +-- – 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 +'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 --- 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 -" 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 --- 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 --- a/runtime/makemenu.vim +++ b/runtime/makemenu.vim @@ -1,6 +1,6 @@ " Script to define the syntax menu in synmenu.vim " Maintainer: Bram Moolenaar -" Last Change: 2008 Jun 24 +" Last Change: 2008 Jul 13 " This is used by "make menu" in the src directory. edit :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 --- a/runtime/plugin/getscriptPlugin.vim +++ b/runtime/plugin/getscriptPlugin.vim @@ -19,7 +19,7 @@ if &cp || exists("g:loaded_getscriptPlug 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 --- 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 --- 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 --- 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 --- a/runtime/scripts.vim +++ b/runtime/scripts.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types in scripts " " Maintainer: Bram Moolenaar -" 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 --- a/runtime/synmenu.vim +++ b/runtime/synmenu.vim @@ -208,50 +208,52 @@ an 50.40.400 &Syntax.FG.Gretl :cal SetSy an 50.40.410 &Syntax.FG.Groff :cal SetSyn("groff") an 50.40.420 &Syntax.FG.Groovy :cal SetSyn("groovy") an 50.40.430 &Syntax.FG.GTKrc :cal SetSyn("gtkrc") -an 50.50.100 &Syntax.HIJK.Hamster :cal SetSyn("hamster") -an 50.50.110 &Syntax.HIJK.Haskell.Haskell :cal SetSyn("haskell") -an 50.50.120 &Syntax.HIJK.Haskell.Haskell-c2hs :cal SetSyn("chaskell") -an 50.50.130 &Syntax.HIJK.Haskell.Haskell-literate :cal SetSyn("lhaskell") -an 50.50.140 &Syntax.HIJK.HASTE :cal SetSyn("haste") -an 50.50.150 &Syntax.HIJK.Hercules :cal SetSyn("hercules") -an 50.50.160 &Syntax.HIJK.Hex\ dump.XXD :cal SetSyn("xxd") -an 50.50.170 &Syntax.HIJK.Hex\ dump.Intel\ MCS51 :cal SetSyn("hex") -an 50.50.180 &Syntax.HIJK.HTML.HTML :cal SetSyn("html") -an 50.50.190 &Syntax.HIJK.HTML.HTML\ with\ M4 :cal SetSyn("htmlm4") -an 50.50.200 &Syntax.HIJK.HTML.HTML\ with\ Ruby\ (eRuby) :cal SetSyn("eruby") -an 50.50.210 &Syntax.HIJK.HTML.Cheetah\ HTML\ template :cal SetSyn("htmlcheetah") -an 50.50.220 &Syntax.HIJK.HTML.Django\ HTML\ template :cal SetSyn("htmldjango") -an 50.50.230 &Syntax.HIJK.HTML.HTML/OS :cal SetSyn("htmlos") -an 50.50.240 &Syntax.HIJK.HTML.XHTML :cal SetSyn("xhtml") -an 50.50.250 &Syntax.HIJK.Host\.conf :cal SetSyn("hostconf") -an 50.50.260 &Syntax.HIJK.Hyper\ Builder :cal SetSyn("hb") -an 50.50.280 &Syntax.HIJK.Icewm\ menu :cal SetSyn("icemenu") -an 50.50.290 &Syntax.HIJK.Icon :cal SetSyn("icon") -an 50.50.300 &Syntax.HIJK.IDL\Generic\ IDL :cal SetSyn("idl") -an 50.50.310 &Syntax.HIJK.IDL\Microsoft\ IDL :cal SetSyn("msidl") -an 50.50.320 &Syntax.HIJK.Indent\ profile :cal SetSyn("indent") -an 50.50.330 &Syntax.HIJK.Inform :cal SetSyn("inform") -an 50.50.340 &Syntax.HIJK.Informix\ 4GL :cal SetSyn("fgl") -an 50.50.350 &Syntax.HIJK.Initng :cal SetSyn("initng") -an 50.50.360 &Syntax.HIJK.Inittab :cal SetSyn("inittab") -an 50.50.370 &Syntax.HIJK.Inno\ setup :cal SetSyn("iss") -an 50.50.380 &Syntax.HIJK.InstallShield\ script :cal SetSyn("ishd") -an 50.50.390 &Syntax.HIJK.Interactive\ Data\ Lang :cal SetSyn("idlang") -an 50.50.400 &Syntax.HIJK.IPfilter :cal SetSyn("ipfilter") -an 50.50.420 &Syntax.HIJK.JAL :cal SetSyn("jal") -an 50.50.430 &Syntax.HIJK.JAM :cal SetSyn("jam") -an 50.50.440 &Syntax.HIJK.Jargon :cal SetSyn("jargon") -an 50.50.450 &Syntax.HIJK.Java.Java :cal SetSyn("java") -an 50.50.460 &Syntax.HIJK.Java.JavaCC :cal SetSyn("javacc") -an 50.50.470 &Syntax.HIJK.Java.Java\ Server\ Pages :cal SetSyn("jsp") -an 50.50.480 &Syntax.HIJK.Java.Java\ Properties :cal SetSyn("jproperties") -an 50.50.490 &Syntax.HIJK.JavaScript :cal SetSyn("javascript") -an 50.50.500 &Syntax.HIJK.Jess :cal SetSyn("jess") -an 50.50.510 &Syntax.HIJK.Jgraph :cal SetSyn("jgraph") -an 50.50.530 &Syntax.HIJK.Kconfig :cal SetSyn("kconfig") -an 50.50.540 &Syntax.HIJK.KDE\ script :cal SetSyn("kscript") -an 50.50.550 &Syntax.HIJK.Kimwitu++ :cal SetSyn("kwt") -an 50.50.560 &Syntax.HIJK.KixTart :cal SetSyn("kix") +an 50.50.100 &Syntax.HIJK.Haml :cal SetSyn("haml") +an 50.50.110 &Syntax.HIJK.Hamster :cal SetSyn("hamster") +an 50.50.120 &Syntax.HIJK.Haskell.Haskell :cal SetSyn("haskell") +an 50.50.130 &Syntax.HIJK.Haskell.Haskell-c2hs :cal SetSyn("chaskell") +an 50.50.140 &Syntax.HIJK.Haskell.Haskell-literate :cal SetSyn("lhaskell") +an 50.50.150 &Syntax.HIJK.HASTE :cal SetSyn("haste") +an 50.50.160 &Syntax.HIJK.HASTE\ preproc :cal SetSyn("hastepreproc") +an 50.50.170 &Syntax.HIJK.Hercules :cal SetSyn("hercules") +an 50.50.180 &Syntax.HIJK.Hex\ dump.XXD :cal SetSyn("xxd") +an 50.50.190 &Syntax.HIJK.Hex\ dump.Intel\ MCS51 :cal SetSyn("hex") +an 50.50.200 &Syntax.HIJK.HTML.HTML :cal SetSyn("html") +an 50.50.210 &Syntax.HIJK.HTML.HTML\ with\ M4 :cal SetSyn("htmlm4") +an 50.50.220 &Syntax.HIJK.HTML.HTML\ with\ Ruby\ (eRuby) :cal SetSyn("eruby") +an 50.50.230 &Syntax.HIJK.HTML.Cheetah\ HTML\ template :cal SetSyn("htmlcheetah") +an 50.50.240 &Syntax.HIJK.HTML.Django\ HTML\ template :cal SetSyn("htmldjango") +an 50.50.250 &Syntax.HIJK.HTML.HTML/OS :cal SetSyn("htmlos") +an 50.50.260 &Syntax.HIJK.HTML.XHTML :cal SetSyn("xhtml") +an 50.50.270 &Syntax.HIJK.Host\.conf :cal SetSyn("hostconf") +an 50.50.280 &Syntax.HIJK.Hyper\ Builder :cal SetSyn("hb") +an 50.50.300 &Syntax.HIJK.Icewm\ menu :cal SetSyn("icemenu") +an 50.50.310 &Syntax.HIJK.Icon :cal SetSyn("icon") +an 50.50.320 &Syntax.HIJK.IDL\Generic\ IDL :cal SetSyn("idl") +an 50.50.330 &Syntax.HIJK.IDL\Microsoft\ IDL :cal SetSyn("msidl") +an 50.50.340 &Syntax.HIJK.Indent\ profile :cal SetSyn("indent") +an 50.50.350 &Syntax.HIJK.Inform :cal SetSyn("inform") +an 50.50.360 &Syntax.HIJK.Informix\ 4GL :cal SetSyn("fgl") +an 50.50.370 &Syntax.HIJK.Initng :cal SetSyn("initng") +an 50.50.380 &Syntax.HIJK.Inittab :cal SetSyn("inittab") +an 50.50.390 &Syntax.HIJK.Inno\ setup :cal SetSyn("iss") +an 50.50.400 &Syntax.HIJK.InstallShield\ script :cal SetSyn("ishd") +an 50.50.410 &Syntax.HIJK.Interactive\ Data\ Lang :cal SetSyn("idlang") +an 50.50.420 &Syntax.HIJK.IPfilter :cal SetSyn("ipfilter") +an 50.50.440 &Syntax.HIJK.JAL :cal SetSyn("jal") +an 50.50.450 &Syntax.HIJK.JAM :cal SetSyn("jam") +an 50.50.460 &Syntax.HIJK.Jargon :cal SetSyn("jargon") +an 50.50.470 &Syntax.HIJK.Java.Java :cal SetSyn("java") +an 50.50.480 &Syntax.HIJK.Java.JavaCC :cal SetSyn("javacc") +an 50.50.490 &Syntax.HIJK.Java.Java\ Server\ Pages :cal SetSyn("jsp") +an 50.50.500 &Syntax.HIJK.Java.Java\ Properties :cal SetSyn("jproperties") +an 50.50.510 &Syntax.HIJK.JavaScript :cal SetSyn("javascript") +an 50.50.520 &Syntax.HIJK.Jess :cal SetSyn("jess") +an 50.50.530 &Syntax.HIJK.Jgraph :cal SetSyn("jgraph") +an 50.50.550 &Syntax.HIJK.Kconfig :cal SetSyn("kconfig") +an 50.50.560 &Syntax.HIJK.KDE\ script :cal SetSyn("kscript") +an 50.50.570 &Syntax.HIJK.Kimwitu++ :cal SetSyn("kwt") +an 50.50.580 &Syntax.HIJK.KixTart :cal SetSyn("kix") an 50.60.100 &Syntax.L-Ma.Lace :cal SetSyn("lace") an 50.60.110 &Syntax.L-Ma.LamdaProlog :cal SetSyn("lprolog") an 50.60.120 &Syntax.L-Ma.Latte :cal SetSyn("latte") @@ -402,24 +404,25 @@ an 50.90.330 &Syntax.R-Sg.Ruby :cal SetS an 50.90.350 &Syntax.R-Sg.S-Lang :cal SetSyn("slang") an 50.90.360 &Syntax.R-Sg.Samba\ config :cal SetSyn("samba") an 50.90.370 &Syntax.R-Sg.SAS :cal SetSyn("sas") -an 50.90.380 &Syntax.R-Sg.Sather :cal SetSyn("sather") -an 50.90.390 &Syntax.R-Sg.Scheme :cal SetSyn("scheme") -an 50.90.400 &Syntax.R-Sg.Scilab :cal SetSyn("scilab") -an 50.90.410 &Syntax.R-Sg.Screen\ RC :cal SetSyn("screen") -an 50.90.420 &Syntax.R-Sg.SDL :cal SetSyn("sdl") -an 50.90.430 &Syntax.R-Sg.Sed :cal SetSyn("sed") -an 50.90.440 &Syntax.R-Sg.Sendmail\.cf :cal SetSyn("sm") -an 50.90.450 &Syntax.R-Sg.Send-pr :cal SetSyn("sendpr") -an 50.90.460 &Syntax.R-Sg.Sensors\.conf :cal SetSyn("sensors") -an 50.90.470 &Syntax.R-Sg.Service\ Location\ config :cal SetSyn("slpconf") -an 50.90.480 &Syntax.R-Sg.Service\ Location\ registration :cal SetSyn("slpreg") -an 50.90.490 &Syntax.R-Sg.Service\ Location\ SPI :cal SetSyn("slpspi") -an 50.90.500 &Syntax.R-Sg.Services :cal SetSyn("services") -an 50.90.510 &Syntax.R-Sg.Setserial\ config :cal SetSyn("setserial") -an 50.90.520 &Syntax.R-Sg.SGML.SGML\ catalog :cal SetSyn("catalog") -an 50.90.530 &Syntax.R-Sg.SGML.SGML\ DTD :cal SetSyn("sgml") -an 50.90.540 &Syntax.R-Sg.SGML.SGML\ Declaration :cal SetSyn("sgmldecl") -an 50.90.550 &Syntax.R-Sg.SGML.SGML-linuxdoc :cal SetSyn("sgmllnx") +an 50.90.380 &Syntax.R-Sg.Sass :cal SetSyn("sass") +an 50.90.390 &Syntax.R-Sg.Sather :cal SetSyn("sather") +an 50.90.400 &Syntax.R-Sg.Scheme :cal SetSyn("scheme") +an 50.90.410 &Syntax.R-Sg.Scilab :cal SetSyn("scilab") +an 50.90.420 &Syntax.R-Sg.Screen\ RC :cal SetSyn("screen") +an 50.90.430 &Syntax.R-Sg.SDL :cal SetSyn("sdl") +an 50.90.440 &Syntax.R-Sg.Sed :cal SetSyn("sed") +an 50.90.450 &Syntax.R-Sg.Sendmail\.cf :cal SetSyn("sm") +an 50.90.460 &Syntax.R-Sg.Send-pr :cal SetSyn("sendpr") +an 50.90.470 &Syntax.R-Sg.Sensors\.conf :cal SetSyn("sensors") +an 50.90.480 &Syntax.R-Sg.Service\ Location\ config :cal SetSyn("slpconf") +an 50.90.490 &Syntax.R-Sg.Service\ Location\ registration :cal SetSyn("slpreg") +an 50.90.500 &Syntax.R-Sg.Service\ Location\ SPI :cal SetSyn("slpspi") +an 50.90.510 &Syntax.R-Sg.Services :cal SetSyn("services") +an 50.90.520 &Syntax.R-Sg.Setserial\ config :cal SetSyn("setserial") +an 50.90.530 &Syntax.R-Sg.SGML.SGML\ catalog :cal SetSyn("catalog") +an 50.90.540 &Syntax.R-Sg.SGML.SGML\ DTD :cal SetSyn("sgml") +an 50.90.550 &Syntax.R-Sg.SGML.SGML\ Declaration :cal SetSyn("sgmldecl") +an 50.90.560 &Syntax.R-Sg.SGML.SGML-linuxdoc :cal SetSyn("sgmllnx") an 50.100.100 &Syntax.Sh-S.Shell\ script.sh\ and\ ksh :cal SetSyn("sh") an 50.100.110 &Syntax.Sh-S.Shell\ script.csh :cal SetSyn("csh") an 50.100.120 &Syntax.Sh-S.Shell\ script.tcsh :cal SetSyn("tcsh") diff --git a/runtime/syntax/ada.vim b/runtime/syntax/ada.vim --- 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 "\" +syntax match adaEnd /\/ 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 --- 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 --- a/runtime/syntax/debcontrol.vim +++ b/runtime/syntax/debcontrol.vim @@ -34,6 +34,7 @@ syn match debcontrolPriority contained " 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=" 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_debcon 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 --- a/runtime/syntax/debsources.vim +++ b/runtime/syntax/debsources.vim @@ -1,12 +1,9 @@ " Vim syntax file -" Language: Debian sources.list -" Maintainer: Matthijs Mohlmann -" 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 +" Former Maintainer: Matthijs Mohlmann +" 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 --- a/runtime/syntax/eruby.vim +++ b/runtime/syntax/eruby.vim @@ -22,7 +22,7 @@ if !exists("b:eruby_subtype") && main_sy 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="-\=%\@" contains=@rubyTop containedin=ALLBUT,@erubyRegions keepend' +exe 'syn region erubyExpression matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}=" end="-\=%\@" contains=@rubyTop containedin=ALLBUT,@erubyRegions keepend' +exe 'syn region erubyComment matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}#" end="-\=%\@" 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 - else - command -nargs=+ HiLink hi def link - 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 --- /dev/null +++ b/runtime/syntax/haml.vim @@ -0,0 +1,85 @@ +" Vim syntax file +" Language: Haml +" Maintainer: Tim Pope +" 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 "\[^]]*]" 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 --- 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\ 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 --- /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 :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 --- a/runtime/syntax/lhaskell.vim +++ b/runtime/syntax/lhaskell.vim @@ -4,8 +4,8 @@ " \begin{code} \end{code} blocks " Maintainer: Haskell Cafe mailinglist " Original Author: Arthur van Leeuwen -" 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 :p:h/tex.vim diff --git a/runtime/syntax/logtalk.vim b/runtime/syntax/logtalk.vim --- a/runtime/syntax/logtalk.vim +++ b/runtime/syntax/logtalk.vim @@ -2,7 +2,7 @@ " " Language: Logtalk " Maintainer: Paulo Moura -" 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=lo " 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_ " 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=logtal 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\| syn match logtalkBuiltIn "\<\(object\|protocol\|category\)_property\ze(" -syn match logtalkBuiltIn "\=" " 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 "\" syn match logtalkKeyword "\" syn match logtalkKeyword "\" @@ -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_logtal else command -nargs=+ HiLink hi def link endif - + HiLink logtalkBlockComment Comment HiLink logtalkLineComment Comment @@ -365,6 +374,7 @@ if version >= 508 || !exists("did_logtal 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 --- 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 -" 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 containe 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 containe 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 --- a/runtime/syntax/muttrc.vim +++ b/runtime/syntax/muttrc.vim @@ -2,9 +2,9 @@ " Language: Mutt setup files " Original: Preben 'Peppe' Guldberg " Maintainer: Kyle Wheeler -" 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=+ syn match muttrcKeyName contained "\" 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 "" 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 conta 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 s 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 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 "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" -syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" @@ -428,8 +435,8 @@ syn region muttrcMacroDescr contained ke 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 --- 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*\)\@\|<=\|\%(<\|\>\|>=\|=\@\|\*\*\|\.\.\.\|\.\.\|::\)" 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 "\\ 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 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 -syn cluster rubyStringSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyEscape +" 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\|[]})\"'/]\)\@\|<=\|<\|===\|==\|=\~\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)" syn match rubySymbol "[]})\"':]\@_,;:!?/.'"@$*\&+0]\)" syn match rubySymbol "[]})\"':]\@\@!\)\=" syn region rubySymbol start="[]})\"':]\@\|{\)\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 "\%(\%( "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=rubyStr 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\)\@>\|[<>]=\=\|<=>\|===\|==\|=\~\|`\)\%([[: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 "\" nextgroup=rubyAliasDeclaration skipwhite skipnl syn match rubyDefine "\" nextgroup=rubyMethodDeclaration skipwhite skipnl + syn match rubyDefine "\" nextgroup=rubyFunction skipwhite skipnl syn match rubyClass "\" nextgroup=rubyClassDeclaration skipwhite skipnl syn match rubyModule "\" nextgroup=rubyModuleDeclaration skipwhite skipnl - syn region rubyBlock start="\" matchgroup=rubyDefine end="\%(\" contains=TOP fold - syn region rubyBlock start="\" matchgroup=rubyClass end="\" contains=TOP fold - syn region rubyBlock start="\" matchgroup=rubyModule end="\" contains=TOP fold + syn region rubyBlock start="\" matchgroup=rubyDefine end="\%(\" contains=ALLBUT,@rubyNotTop fold + syn region rubyBlock start="\" matchgroup=rubyClass end="\" contains=ALLBUT,@rubyNotTop fold + syn region rubyBlock start="\" matchgroup=rubyModule end="\" contains=ALLBUT,@rubyNotTop fold " modifiers syn match rubyConditionalModifier "\<\%(if\|unless\)\>" display syn match rubyRepeatModifier "\<\%(while\|until\)\>" display - syn region rubyDoBlock matchgroup=rubyControl start="\" end="\" contains=TOP fold + syn region rubyDoBlock matchgroup=rubyControl start="\" 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 rubyCaseExpression matchgroup=rubyConditional start="\" end="\" contains=TOP fold - syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@" end="\" contains=TOP fold + syn region rubyBlockExpression matchgroup=rubyControl start="\" end="\" contains=ALLBUT,@rubyNotTop fold + syn region rubyCaseExpression matchgroup=rubyConditional start="\" end="\" contains=ALLBUT,@rubyNotTop fold + syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@" 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="\" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@" matchgroup=rubyOptionalDo end="\%(\\)" end="\ze\%(;\|$\)" oneline contains=TOP - syn region rubyRepeatExpression start="\" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@" matchgroup=rubyRepeat end="\" contains=TOP nextgroup=rubyOptionalDoLine fold + syn region rubyOptionalDoLine matchgroup=rubyRepeat start="\[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@" matchgroup=rubyOptionalDo end="\%(\\)" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@rubyNotTop + syn region rubyRepeatExpression start="\[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@" matchgroup=rubyRepeat 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") && !ex exec "syn sync minlines=" . ruby_minlines else - syn match rubyControl "\" nextgroup=rubyMethodDeclaration skipwhite skipnl - syn match rubyControl "\" nextgroup=rubyClassDeclaration skipwhite skipnl - syn match rubyControl "\" 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 "\[?!]\@!" nextgroup=rubyMethodDeclaration skipwhite skipnl + syn match rubyControl "\[?!]\@!" nextgroup=rubyClassDeclaration skipwhite skipnl + syn match rubyControl "\[?!]\@!" 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 "\[?!]\@!" +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 "\[?!]\@!" + syn keyword rubyInclude autoload extend load require syn keyword rubyKeyword callcc caller lambda proc endif @@ -252,6 +276,9 @@ syn match rubyKeywordAsMethod "\%(\%(\.\ syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE syn match rubyKeywordAsMethod "\%(\%(\.\@" 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 "\%(\%(\.\@" transparent contains=NONE syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE syn match rubyKeywordAsMethod "\%(\%(\.\@" 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 rubyString String +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 rubyString String -hi def link rubyTodo Todo 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 --- /dev/null +++ b/runtime/syntax/sass.vim @@ -0,0 +1,56 @@ +" Vim syntax file +" Language: Sass +" Maintainer: Tim Pope +" 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 --- 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. " Previous Maintainer: Lennart Schultz -" 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( 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("f 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=shCharCl " Echo: {{{1 " ==== " This one is needed INSIDE a CommandSub, so that `echo bla` be correct -syn region shEcho matchgroup=shStatement start="\" skip="\\$" matchgroup=shOperator end="$" matchgroup=NONE end="[<>;&|()]"me=e-1 end="\d[<>]"me=e-2 end="#"me=e-1 contains=@shEchoList -syn region shEcho matchgroup=shStatement start="\" 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="\" 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="\" 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="\" 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 "\[:\( " 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="\" matchgroup=shConditional end="\" contains=@shLoopList - syn region shIf fold transparent matchgroup=shConditional start="\" matchgroup=shConditional end="\<;\_s*then\>" end="\" contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey - syn region shFor fold matchgroup=shLoop start="\" end="\" end="\"me=e-2 contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn + syn region shIf fold transparent matchgroup=shConditional start="\" 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="\[^/]"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="\\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="\\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="\\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_k 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=+\%(\\\)\@ -" 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 "\