diff options
-rw-r--r-- | runtime/autoload/netrwFileHandlers.vim | 6 | ||||
-rw-r--r-- | runtime/autoload/netrwSettings.vim | 16 | ||||
-rw-r--r-- | runtime/autoload/zip.vim | 25 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 9 | ||||
-rw-r--r-- | runtime/doc/filetype.txt | 15 | ||||
-rw-r--r-- | runtime/doc/quickfix.txt | 19 | ||||
-rw-r--r-- | runtime/doc/tags | 9 | ||||
-rw-r--r-- | runtime/doc/todo.txt | 17 | ||||
-rw-r--r-- | runtime/doc/various.txt | 7 | ||||
-rw-r--r-- | runtime/doc/version7.txt | 19 | ||||
-rw-r--r-- | runtime/filetype.vim | 8 | ||||
-rw-r--r-- | runtime/keymap/greek_cp737.vim | 104 | ||||
-rw-r--r-- | runtime/plugin/vimball.vim | 256 | ||||
-rw-r--r-- | runtime/syntax/django.vim | 72 | ||||
-rw-r--r-- | runtime/syntax/htmldjango.vim | 30 | ||||
-rw-r--r-- | src/Makefile | 9 | ||||
-rw-r--r-- | src/config.mk.in | 2 | ||||
-rw-r--r-- | src/configure.in | 4 | ||||
-rw-r--r-- | src/eval.c | 16 | ||||
-rw-r--r-- | src/ex_cmds.h | 8 | ||||
-rw-r--r-- | src/ex_getln.c | 2 | ||||
-rw-r--r-- | src/gui_gtk_x11.c | 15 | ||||
-rw-r--r-- | src/option.c | 2 | ||||
-rw-r--r-- | src/quickfix.c | 31 | ||||
-rw-r--r-- | src/regexp.c | 22 | ||||
-rw-r--r-- | src/screen.c | 2 | ||||
-rw-r--r-- | src/undo.c | 29 | ||||
-rw-r--r-- | src/version.h | 4 |
28 files changed, 413 insertions, 345 deletions
diff --git a/runtime/autoload/netrwFileHandlers.vim b/runtime/autoload/netrwFileHandlers.vim index bad6d81c65..cd6de66c58 100644 --- a/runtime/autoload/netrwFileHandlers.vim +++ b/runtime/autoload/netrwFileHandlers.vim @@ -1,8 +1,8 @@ " netrwFileHandlers: contains various extension-based file handlers for " netrw's browsers' x command ("eXecute launcher") " Author: Charles E. Campbell, Jr. -" Date: Feb 15, 2006 -" Version: 8a ASTRO-ONLY +" Date: Mar 22, 2006 +" Version: 8 " Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1 " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright @@ -22,7 +22,7 @@ if exists("g:loaded_netrwFileHandlers") || &cp endif let s:keepcpo= &cpo set cpo&vim -let g:loaded_netrwFileHandlers= "v8a" +let g:loaded_netrwFileHandlers= "v8" " --------------------------------------------------------------------- " netrwFileHandlers#Invoke: {{{2 diff --git a/runtime/autoload/netrwSettings.vim b/runtime/autoload/netrwSettings.vim index e8d6bd28b9..f51a328200 100644 --- a/runtime/autoload/netrwSettings.vim +++ b/runtime/autoload/netrwSettings.vim @@ -1,7 +1,7 @@ " netrwSettings.vim: makes netrw settings simpler -" Date: Jan 26, 2006 +" Date: Mar 22, 2006 " Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz> -" Version: 6a ASTRO-ONLY +" Version: 6 " Copyright: Copyright (C) 1999-2005 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 = "v6a" +let g:loaded_netrwSettings = "v6" " --------------------------------------------------------------------- " NetrwSettings: {{{1 @@ -56,10 +56,10 @@ fun! netrwSettings#NetrwSettings() let g:netrw_ignorenetrc= 0 endif - put ='+ --------------------------------------------' - put ='+ NetrwSettings: by Charles E. Campbell, Jr.' - put ='+ Press ? with cursor atop any line for help ' - put ='+ --------------------------------------------' + put ='+ ---------------------------------------------' + put ='+ NetrwSettings: by Charles E. Campbell, Jr.' + put ='+ Press <F1> with cursor atop any line for help' + put ='+ ---------------------------------------------' let s:netrw_settings_stop= line(".") put ='' @@ -132,7 +132,7 @@ fun! netrwSettings#NetrwSettings() set nomod - map <buffer> <silent> ? :call NetrwSettingHelp()<cr> + map <buffer> <silent> <F1> :call NetrwSettingHelp()<cr> let tmpfile= tempname() exe 'au BufWriteCmd Netrw\ Settings silent w! '.tmpfile.'|so '.tmpfile.'|call delete("'.tmpfile.'")|set nomod' endfun diff --git a/runtime/autoload/zip.vim b/runtime/autoload/zip.vim index be39740112..2243ea8a38 100644 --- a/runtime/autoload/zip.vim +++ b/runtime/autoload/zip.vim @@ -1,7 +1,7 @@ " zip.vim: Handles browsing zipfiles " AUTOLOAD PORTION -" Date: Dec 21, 2005 -" Version: 6 +" Date: Mar 22, 2006 +" Version: 7 " Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz> " License: Vim License (see vim's :help license) " Copyright: Copyright (C) 2005 Charles E. Campbell, Jr. {{{1 @@ -22,7 +22,8 @@ if exists("g:loaded_zip") finish endif -let g:loaded_zip= "v6" +let g:loaded_zip = "v7" +let s:zipfile_escape = ' ?&;\' " ---------------- " Functions: {{{1 @@ -53,6 +54,7 @@ fun! zip#Browse(zipfile) " call Dret("zip#Browse : file<".a:zipfile."> not readable") return endif +" call Decho("passed sanity checks") if &ma != 1 set ma endif @@ -73,7 +75,8 @@ fun! zip#Browse(zipfile) 0d $ - exe "silent r! unzip -l ".a:zipfile + call Decho("exe silent r! unzip -l '".escape(a:zipfile,s:zipfile_escape)."'") + exe "silent r! unzip -l '".escape(a:zipfile,s:zipfile_escape)."'" $d silent 4,$v/^\s\+\d\+\s\{0,5}\d/d silent 4,$s/^\%(.*\)\s\+\(\S\)/\1/ @@ -111,12 +114,15 @@ fun! s:ZipBrowseSelect() " get zipfile to the new-window let zipfile= substitute(w:zipfile,'.zip$','','e') - let curfile= expand("%") + let curfile= escape(expand("%"),s:zipfile_escape) +" call Decho("zipfile<".zipfile.">") +" call Decho("curfile<".curfile.">") new wincmd _ let s:zipfile_{winnr()}= curfile - exe "e zipfile:".zipfile.':'.fname +" call Decho("exe e zipfile:".escape(zipfile,s:zipfile_escape).':'.fname) + exe "e zipfile:".escape(zipfile,s:zipfile_escape).':'.fname filetype detect let &report= repkeep @@ -130,11 +136,12 @@ fun! zip#Read(fname,mode) let repkeep= &report set report=10 - let zipfile = substitute(a:fname,'zipfile:\(.\{-}\):.*$','\1','') - let fname = substitute(a:fname,'zipfile:.\{-}:\(.*\)$','\1','') + let zipfile = substitute(a:fname,'zipfile:\(.\{-}\):[^\\].*$','\1','') + let fname = substitute(a:fname,'zipfile:.\{-}:\([^\\].*\)$','\1','') " call Decho("zipfile<".zipfile."> fname<".fname.">") - exe "r! unzip -p ".zipfile." ".fname +" call Decho("exe r! unzip -p '".escape(zipfile,s:zipfile_escape)."' ".fname) + exe "r! unzip -p '".escape(zipfile,s:zipfile_escape)."' ".fname " cleanup 0d diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 18342b89ca..b25a88e3af 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.0aa. Last change: 2006 Mar 21 +*eval.txt* For Vim version 7.0aa. Last change: 2006 Mar 22 VIM REFERENCE MANUAL by Bram Moolenaar @@ -3591,7 +3591,7 @@ getpos({expr}) Get the position for {expr}. For possible values of {expr} This can be used to save and restore the cursor position: > let save_cursor = getpos(".") MoveTheCursorAround - call setpos(save_cursor) + call setpos('.', save_cursor) < Also see |setpos()|. prevnonblank({lnum}) *prevnonblank()* @@ -4225,6 +4225,7 @@ setpos({expr}, {list}) the current buffer. To set a mark in another buffer you can use the |bufnr()| function to turn a file name into a buffer number. + Does not change the jumplist. "lnum" and "col" are the position in the buffer. The first column is 1. Use a zero "lnum" to delete a mark. @@ -4918,8 +4919,8 @@ winsaveview() Returns a |Dictionary| that contains information to restore This is useful if you have a mapping that jumps around in the buffer and you want to go back to the original view. This does not save fold information. Use the 'foldenable' - option to temporarily switch of folding, so that folds are not - opened when moving around. + option to temporarily switch off folding, so that folds are + not opened when moving around. The return value includes: lnum cursor line number col cursor column diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index 3a8b164796..778b639b03 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -1,4 +1,4 @@ -*filetype.txt* For Vim version 7.0aa. Last change: 2006 Mar 09 +*filetype.txt* For Vim version 7.0aa. Last change: 2006 Mar 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -148,6 +148,7 @@ can be used to overrule the filetype used for certain extensions: *.i g:filetype_i |ft-progress-syntax| *.p g:filetype_p |ft-pascal-syntax| *.sh g:bash_is_sh |ft-sh-syntax| + *.tex g:tex_flavor |ft-tex-plugin| *filetype-ignore* To avoid that certain files are being inspected, the g:ft_ignore_pat variable @@ -542,4 +543,16 @@ Since the text for this plugin is rather long it has been put in a separate file: |sql.txt|. +TEX *ft-tex-plugin* + +If the first line of a *.tex file has the form > + %&<format> +then this determined the file type: plaintex (for plain TeX), context (for +ConTeXt), or tex (for LaTeX). Otherwise, the file is searched for keywords to +choose context or tex. If no keywords are found, it defaults to tex. You can +change the default by defining the variable g:tex_flavor to the format (not +the file type) you use most: plain or context or latex. (Currently no other +formats are recognized.) + + vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index 4814a09d6c..81a3822679 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1,4 +1,4 @@ -*quickfix.txt* For Vim version 7.0aa. Last change: 2006 Mar 20 +*quickfix.txt* For Vim version 7.0aa. Last change: 2006 Mar 23 VIM REFERENCE MANUAL by Bram Moolenaar @@ -189,6 +189,15 @@ command with 'l'. :lb[uffer] [bufnr] Same as ":cbuffer", except the location list for the current window is used instead of the quickfix list. + *:cgetb* *:cgetbuffer* +:cgetb[uffer] [bufnr] Read the error list from the current buffer. Just + like ":cbuffer" but don't jump to the first error. + + *:lgetb* *:lgetbuffer* +:lgetb[uffer] [bufnr] Same as ":cgetbuffer", except the location list for + the current window is used instead of the quickfix + list. + *:caddb* *:caddbuffer* :caddb[uffer] [bufnr] Read the error list from the current buffer and add the errors to the current quickfix list. If a @@ -231,6 +240,14 @@ command with 'l'. :lad[dexpr][!] {expr} Same as ":caddexpr", except the location list for the current window is used instead of the quickfix list. + *:cgete* *:cgetexpr* +:cgete[xpr][!] {expr} Create a quickfix list using the result of {expr}. + Just like ":cexpr", but don't jump to the first error. + + *:lgete* *:lgetexpr* +:lgete[xpr][!] {expr} Same as ":cgetexpr", except the location list for the + current window is used instead of the quickfix list. + *:cl* *:clist* :cl[ist] [from] [, [to]] List all errors that are valid |quickfix-valid|. diff --git a/runtime/doc/tags b/runtime/doc/tags index 4d6cc6380d..5a8086f0ce 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -1849,6 +1849,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* :cfir quickfix.txt /*:cfir* :cfirst quickfix.txt /*:cfirst* :cg quickfix.txt /*:cg* +:cgetb quickfix.txt /*:cgetb* +:cgetbuffer quickfix.txt /*:cgetbuffer* +:cgete quickfix.txt /*:cgete* +:cgetexpr quickfix.txt /*:cgetexpr* :cgetfile quickfix.txt /*:cgetfile* :ch change.txt /*:ch* :change change.txt /*:change* @@ -2188,6 +2192,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* :lfir quickfix.txt /*:lfir* :lfirst quickfix.txt /*:lfirst* :lg quickfix.txt /*:lg* +:lgetb quickfix.txt /*:lgetb* +:lgetbuffer quickfix.txt /*:lgetbuffer* +:lgete quickfix.txt /*:lgete* +:lgetexpr quickfix.txt /*:lgetexpr* :lgetfile quickfix.txt /*:lgetfile* :lgr quickfix.txt /*:lgr* :lgrep quickfix.txt /*:lgrep* @@ -5299,6 +5307,7 @@ ft-sqlinformix-syntax syntax.txt /*ft-sqlinformix-syntax* ft-syntax-omni insert.txt /*ft-syntax-omni* ft-tcsh-syntax syntax.txt /*ft-tcsh-syntax* ft-termcap-syntax syntax.txt /*ft-termcap-syntax* +ft-tex-plugin filetype.txt /*ft-tex-plugin* ft-tex-syntax syntax.txt /*ft-tex-syntax* ft-tf-syntax syntax.txt /*ft-tf-syntax* ft-vb-syntax syntax.txt /*ft-vb-syntax* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index faaf2b2dfd..22d0608637 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.0aa. Last change: 2006 Mar 21 +*todo.txt* For Vim version 7.0aa. Last change: 2006 Mar 23 VIM REFERENCE MANUAL by Bram Moolenaar @@ -30,11 +30,8 @@ be worked on, but only if you sponsor Vim development. See |sponsor|. *known-bugs* -------------------- Known bugs and current work ----------------------- -HTML indenting can be slow, find out why. - -Adjust src/main.aap for installing manpages like in Makefile. - And for generating Vim.app for the Mac. - Install spell files with src/main.aap. +Include patch for recognizing TeX flavor. (Benji Fisher) +And new tex.vim and plaintex.vim. Win32: Describe how to do debugging. (George Reilly) @@ -50,6 +47,12 @@ Mac unicode patch (Da Woon Jung, Eckehard Berns): Darren is including the patch in ctags. Test it when it's ready. Change "typename" to "typeref" in C complete code. +HTML indenting can be slow. Caused by using searchpair(). Can search() be +used instead? + +ccomplete: use "signature:" field from tags file when it's present. +Or list all the fields? (Martin Stubenschrott) + Add more tests for all new functionality in Vim 7. Especially new functions. Add text in user manual for using the undo tree. Example with finding the @@ -1129,7 +1132,7 @@ Spell checking: means the compound flags of the word are not used. Instead of "SFX a 0 add/FLAGS ." we could use "SFX a 0 add . /FLAGS" (or support both). -- Support breakpoint character · 0xb7 and ignore it? Makes it possible to +- Support breakpoint character ? 0xb7 and ignore it? Makes it possible to use same wordlist for hyphenation. - Compound word is accepted if nr of words is <= COMPOUNDMAX OR nr of syllables <= COMPOUNDSYLMAX. Specify using AND in the affix file? diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index 393054105c..e3e8655ed0 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -756,6 +756,13 @@ It is possible to add translated help files, next to the original English help files. Vim will search for all help in "doc" directories in 'runtimepath'. This is only available when compiled with the |+multi_lang| feature. +At this moment translations are available for: + Chinese - multiple authors + French - translated by David Blanchet + Italian - translated by Antonio Colombo + Russian - translated by Vassily Ragosin +See the Vim website to find them: http://www.vim.org/translations.php + A set of translated help files consists of these files: help.abx diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt index 05ed7d2a52..777dff0b59 100644 --- a/runtime/doc/version7.txt +++ b/runtime/doc/version7.txt @@ -1,4 +1,4 @@ -*version7.txt* For Vim version 7.0aa. Last change: 2006 Mar 21 +*version7.txt* For Vim version 7.0aa. Last change: 2006 Mar 23 VIM REFERENCE MANUAL by Bram Moolenaar @@ -609,24 +609,27 @@ Win32: The ":winpos" command now also works in the console. (Vipin Aravind) |:viusage| Help for Vi commands (Nvi command). -|:cbuffer| Read error lines from a buffer. (partly by Yegappan - Lakshmanan) - |:sort| Sort lines in the buffer without depending on an external command. |:caddfile| Add error messages to an existing quickfix list (Yegappan Lakshmanan). - +|:cbuffer| Read error lines from a buffer. (partly by Yegappan + Lakshmanan) +|:cgetbuffer| Create a quickfix list from a buffer but don't jump to + the first error. +|:caddbuffer| Add errors from the current buffer to the quickfix + list. |:cexpr| Read error messages from a Vim expression (Yegappan Lakshmanan). - |:caddexpr| Add error messages from a Vim expression to an existing quickfix list. (Yegappan Lakshmanan). -|:caddbuffer| Add errors from the current buffer to the quickfix - list. +|:cgetexpr| Create a quickfix list from a Vim expression, but + don't jump to the first error. (Yegappan Lakshmanan). |:lfile| Like |:cfile| but use the location list. +|:lgetbuffer| Like |:cgetbuffer| but use the location list. +|:lgetexpr| Like |:cgetexpr| but use the location list. |:lgetfile| Like |:cgetfile| but use the location list. |:laddfile| Like |:caddfile| but use the location list. |:lbuffer| Like |:cbuffer| but use the location list. diff --git a/runtime/filetype.vim b/runtime/filetype.vim index f245eec3f5..2ab0987050 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2006 Mar 21 +" Last Change: 2006 Mar 23 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -638,7 +638,7 @@ au BufNewFile,BufRead *.t.html setf tilde " HTML (.shtml and .stm for server side) au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm call s:FThtml() -" Distinguish between HTML and XHTML +" Distinguish between HTML, XHTML and Django fun! s:FThtml() let n = 1 while n < 10 && n < line("$") @@ -646,6 +646,10 @@ fun! s:FThtml() setf xhtml return endif + if getline(n) =~ '{%\s*\(extends\|block\)\>' + setf htmldjango + return + endif let n = n + 1 endwhile setf html diff --git a/runtime/keymap/greek_cp737.vim b/runtime/keymap/greek_cp737.vim new file mode 100644 index 0000000000..e41114eb32 --- /dev/null +++ b/runtime/keymap/greek_cp737.vim @@ -0,0 +1,104 @@ +" Vim Keymap file for greek DOS cp737 +" Maintainer: Panagiotis Louridas <louridas@acm.org> +" Last Updated: Thu Mar 23 14:05:45 EET 2006 + +" This keyboard layout allows all Greek symbols to be typed, +" including accented capitals and diaeresis. It does not +" include diaeresis and accent on the same vowel, nor +" the greek quotes, as these were not included in the codepage. +" It includes the Greek semicolon sign. + +" +" accent ";" + letter +" diaeresis ":" + letter +" diaeresis + accent ";" + ":" (or ":" + ";") + letter +" semicolon "q" +" colon "Q" +" greek semicolon "W" +" sigma at end of word "w" + +" Use this short name in the status line. +let b:keymap_name = "greek" + +loadkeymap +" capital +A <char-128> " € +B <char-129> " +G <char-130> " ‚ +D <char-131> " ƒ +E <char-132> " „ +Z <char-133> " … +H <char-134> " † +U <char-135> " ‡ +I <char-136> " ˆ +K <char-137> " ‰ +L <char-138> " Š +M <char-139> " ‹ +N <char-140> " Œ +J <char-141> " +O <char-142> " Ž +P <char-143> " +R <char-144> " +S <char-145> " ‘ +T <char-146> " ’ +Y <char-147> " “ +F <char-148> " ” +X <char-149> " • +C <char-150> " – +V <char-151> " — + +" small +a <char-152> " ˜ +b <char-153> " ™ +g <char-154> " š +d <char-155> " › +e <char-156> " œ +z <char-157> " +h <char-158> " ž +u <char-159> " Ÿ +i <char-160> " +k <char-161> " ¡ +l <char-162> " ¢ +m <char-163> " £ +n <char-164> " ¤ +j <char-165> " ¥ +o <char-166> " ¦ +p <char-167> " § +r <char-168> " ¨ +s <char-169> " © +w <char-170> " ª +t <char-171> " « +y <char-172> " ¬ +f <char-173> " +x <char-174> " ® +c <char-175> " ¯ +v <char-224> " à + +" accented capital +;A <char-234> " ê +;E <char-235> " ë +;H <char-236> " ì +;I <char-237> " í +;O <char-238> " î +;Y <char-239> " ï +;V <char-240> " ð +" +:I <char-244> " ô +:Y <char-245> " õ + +" accented small +;a <char-225> " á +;e <char-226> " â +;h <char-227> " ã +;i <char-229> " å +;o <char-230> " æ +;y <char-231> " ç +;v <char-233> " é +" +:i <char-228> " ä +:y <char-232> " è +" +" symbols +q ; " ; +Q : " : +W <char-250> " ú diff --git a/runtime/plugin/vimball.vim b/runtime/plugin/vimball.vim deleted file mode 100644 index 89d2ee182c..0000000000 --- a/runtime/plugin/vimball.vim +++ /dev/null @@ -1,256 +0,0 @@ -" vimball : construct a file containing both paths and files -" Author: Charles E. Campbell, Jr. -" Date: Mar 20, 2006 -" Version: 3 -" GetLatestVimScripts: 1502 1 :AutoInstall: vimball.vim -" Copyright: (c) 2004-2006 by Charles E. Campbell, Jr. -" The VIM LICENSE applies to Vimball.vim, and Vimball.txt -" (see |copyright|) except use "Vimball" instead of "Vim". -" No warranty, express or implied. -" *** *** Use At-Your-Own-Risk! *** *** - -" --------------------------------------------------------------------- -" Load Once: {{{1 -if &cp || exists("g:loaded_vimball") - finish -endif - -let s:keepcpo = &cpo -let g:loaded_vimball = "v3" -set cpo&vim - -" ------------------------------------------------------------------------------ -" Public Interface: {{{1 -com! -ra -na=+ -bang MkVimball call s:MkVimball(<line1>,<line2>,<bang>0,<f-args>) -com! -na=0 UseVimball call s:Vimball(1) -com! -na=0 VimballList call s:Vimball(0) -au BufReadPost *.vba echohl WarningMsg | echo "Source this file to extract it! (:so %)" | echohl None - -" ===================================================================== -" Functions: {{{1 - -" --------------------------------------------------------------------- -" MkVimball: creates a vimball given a list of paths to files {{{2 -" Vimball Format: -" path -" filesize -" [file] -" path -" filesize -" [file] -fun! s:MkVimball(line1,line2,writelevel,vimballname) range -" call Dfunc("MkVimball(line1=".a:line1." line2=".a:line2." writelevel=".a:writelevel." vimballname<".a:vimballname.">") - let vbname= substitute(a:vimballname,'\.[^.]*$','','e').'.vba' - if !a:writelevel && filereadable(vbname) - echohl Error | echoerr "(MkVimball) file<".vbname."> exists; use ! to insist" | echohl None -" call Dret("MkVimball : file<".vbname."> already exists; use ! to insist") - return - endif - - " user option bypass - let eikeep= &ei - set ei=all - - let home = substitute(&rtp,',.*$','','') - let curdir = getcwd() - exe "cd ".home - - " record current tab, initialize while loop index - let curtabnr = tabpagenr() - let linenr = a:line1 -" call Decho("curtabnr=".curtabnr) - - while linenr <= a:line2 - let svfile = getline(linenr) -" call Decho("svfile<".svfile.">") - - if !filereadable(svfile) - echohl Error | echo "unable to read file<".svfile.">" | echohl None - let &ei= eikeep - exe "cd ".curdir -" call Dret("MkVimball") - return - endif - - " create/switch to mkvimball tab - if !exists("vbtabnr") - tabnew - silent! file Vimball - let vbtabnr= tabpagenr() - else - exe "tabn ".vbtabnr - endif - - let lastline= line("$") + 1 - if lastline == 2 && getline("$") == "" - call setline(1,'" Vimball Archiver by Charles E. Campbell, Jr., Ph.D.') - call setline(2,'UseVimball') - call setline(3,'finish') - let lastline= 4 - endif - call setline(lastline ,svfile) - call setline(lastline+1,0) - exe "$r ".svfile - call setline(lastline+1,line("$") - lastline - 1) -" call Decho("lastline=".lastline." line$=".line("$")) - - " restore to normal tab - exe "tabn ".curtabnr - let linenr= linenr + 1 - endwhile - - " write the vimball - exe "tabn ".vbtabnr - exe "cd ".curdir - if a:really - if a:writelevel - exe "w! ".vbname - else - exe "w ".vbname - endif - endif -" call Decho("Vimball<".vbname."> created") - echo "Vimball<".vbname."> created" - - " remove the evidence - setlocal nomod bh=wipe - exe "tabn ".curtabnr - exe "tabc ".vbtabnr - - " restore options - let &ei= eikeep - -" call Dret("MkVimball") -endfun - -" --------------------------------------------------------------------- -" Vimball: {{{2 -fun! s:Vimball(really) -" call Dfunc("Vimball(really=".a:really.")") - - if getline(1) !~ '^" Vimball Archiver by Charles E. Campbell, Jr., Ph.D.$' - echoerr "(Vimball) The current file does not appear to be a Vimball!" -" call Dret("Vimball") - return - endif - - " initialize - let regakeep = @a - let eikeep = &ei - let vekeep = &ve - let makeep = getpos("'a") - let curtabnr = tabpagenr() - set ei=all ve=all - - " set up vimball tab - tabnew - silent! file Vimball - let vbtabnr= tabpagenr() - let didhelp= "" - - " go to vim plugin home - let home = substitute(&rtp,',.*$','','') - let curdir = getcwd() -" call Decho("exe cd ".home) - exe "cd ".home - let linenr = 4 - let filecnt = 0 - - " give title to listing of (extracted) files from Vimball Archive - if a:really - echohl Title | echomsg "Vimball Archive" | echohl None - else - echohl Title | echomsg "Vimball Archive Listing" | echohl None - endif - - " apportion vimball contents to various files -" call Decho("exe tabn ".curtabnr) - exe "tabn ".curtabnr -" call Decho("linenr=".linenr." line$=".line("$")) - while 1 < linenr && linenr < line("$") - let fname = getline(linenr) - let fsize = getline(linenr+1) - let filecnt = filecnt + 1 - if a:really - echomsg "extracted <".fname.">: ".fsize." lines" - else - echomsg "would extract <".fname.">: ".fsize." lines" - endif -" call Decho(linenr.": will extract file<".fname.">") -" call Decho((linenr+1).": fsize=".fsize) - - " make directories if they don't exist yet - let fnamebuf= fname - while fnamebuf =~ '/' - let dirname = substitute(fnamebuf,'/.*$','','e') - let fnamebuf = substitute(fnamebuf,'^.\{-}/\(.*\)$','\1','e') - if !isdirectory(dirname) -" call Decho("making <".dirname.">") - call mkdir(dirname) - endif - exe "cd ".dirname - endwhile - exe "cd ".home - - " grab specified qty of lines and place into "a" buffer - exe linenr - norm! jjma - exe (linenr + fsize + 1) - silent norm! "ay'a -" call Decho("yanked ".fsize." lines into register-a") - -" call Decho("didhelp<".didhelp."> fname<".fname.">") - if didhelp == "" && fname =~ 'doc/[^/]\+\.txt$' - let didhelp= substitute(fname,'^\(.*\<doc\)[/\\][^.]*\.txt$','\1','e') -" call Decho("didhelp<".didhelp.">") - endif - - " copy "a" buffer into tab -" call Decho('copy "a buffer into tab#'.vbtabnr) - exe "tabn ".vbtabnr - silent! %d - silent norm! "aPGdd1G -" call Decho("rega<".@a.">") - - " write tab to file -" call Decho("exe w! ".fname) - exe "silent w! ".fname - -" call Decho("exe tabn ".curtabnr) - exe "tabn ".curtabnr -" let oldlinenr = linenr " Decho - let linenr = linenr + fsize + 2 -" call Decho("update linenr= [linenr=".oldlinenr."] + [fsize=".fsize."] + 2 = ".linenr) - endwhile - - " set up help -" call Decho("about to set up help: didhelp<".didhelp.">") - if didhelp != "" -" call Decho("exe helptags ".home."/".didhelp) - exe "helptags ".home."/".didhelp - echomsg "did helptags" - endif - - " make sure a "Press ENTER..." prompt appears to keep the messages showing! - while filecnt < &ch - echomsg " " - let filecnt= filecnt + 1 - endwhile - - " restore events, delete tab and buffer - exe "tabn ".vbtabnr - setlocal nomod bh=wipe - exe "tabn ".curtabnr - exe "tabc ".vbtabnr - let &ei= eikeep - let @a = regakeep - if makeep[0] != 0 - " restore mark a -" call Decho("restore mark-a: makeep=".string(makeep)) - call setpos("'a",makeep) - ka - endif - exe "cd ".curdir - -" call Dret("Vimball") -endfun diff --git a/runtime/syntax/django.vim b/runtime/syntax/django.vim new file mode 100644 index 0000000000..fc48d2608c --- /dev/null +++ b/runtime/syntax/django.vim @@ -0,0 +1,72 @@ +" Vim syntax file +" Language: Django template +" Maintainer: Dave Hodder <dmh@dmh.org.uk> +" Last Change: 2006 Mar 23 + +" 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 + +syntax case match + +" Django template built-in tags and parameters +" 'comment' doesn't appear here because it gets special treatment +syn keyword djangoStatement contained as block endblock by cycle debug else +syn keyword djangoStatement contained extends filter endfilter firstof for +syn keyword djangoStatement contained endfor if endif ifchanged endifchanged +syn keyword djangoStatement contained ifequal endifequal ifnotequal +syn keyword djangoStatement contained endifnotequal in include load not now or +syn keyword djangoStatement contained parsed regroup reversed spaceless +syn keyword djangoStatement contained endspaceless ssi templatetag openblock +syn keyword djangoStatement contained closeblock openvariable closevariable +syn keyword djangoStatement contained widthratio with + +" Django templete built-in filters +syn keyword djangoFilter contained add addslashes capfirst center cut date +syn keyword djangoFilter contained default default_if_none dictsort +syn keyword djangoFilter contained dictsortreversed divisibleby escape +syn keyword djangoFilter contained filesizeformat first fix_ampersands +syn keyword djangoFilter contained floatformat get_digit join length length_is +syn keyword djangoFilter contained linebreaks linebreaksbr linenumbers ljust |