diff --git a/runtime/autoload/htmlcomplete.vim b/runtime/autoload/htmlcomplete.vim
index 61d2a09d9b..c663e3c6b0 100644
--- a/runtime/autoload/htmlcomplete.vim
+++ b/runtime/autoload/htmlcomplete.vim
@@ -1,7 +1,7 @@
" Vim completion script
-" Language: XHTML 1.0 Strict
+" Language: HTML (XHTML 1.0 Strict by default)
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
-" Last Change: 2006 Mar 25
+" Last Change: 2006 Apr 17
function! htmlcomplete#CompleteTags(findstart, base)
if a:findstart
@@ -159,12 +159,12 @@ function! htmlcomplete#CompleteTags(findstart, base)
if exists("b:entitiescompl")
unlet! b:entitiescompl
- if !exists("g:xmldata_xhtml10s")
- runtime! autoload/xml/xhtml10s.vim
- "call htmlcomplete#LoadData()
+ if !exists("g:html_omni")
+ "runtime! autoload/xml/xhtml10s.vim
+ call htmlcomplete#LoadData()
endif
- let entities = g:xmldata_xhtml10s['vimxmlentities']
+ let entities = g:html_omni['vimxmlentities']
if len(a:base) == 1
for m in entities
@@ -443,29 +443,7 @@ function! htmlcomplete#CompleteTags(findstart, base)
let attrname = matchstr(attr, '.*\ze\s*=')
let entered_value = matchstr(attr, ".*=\\s*[\"']\\zs.*")
let values = []
- if attrname == 'media'
- let values = ["screen", "tty", "tv", "projection", "handheld", "print", "braille", "aural", "all"]
- elseif attrname == 'xml:space'
- let values = ["preserve"]
- elseif attrname == 'shape'
- let values = ["rect", "circle", "poly", "default"]
- elseif attrname == 'valuetype'
- let values = ["data", "ref", "object"]
- elseif attrname == 'method'
- let values = ["get", "post"]
- elseif attrname == 'dir'
- let values = ["ltr", "rtl"]
- elseif attrname == 'frame'
- let values = ["void", "above", "below", "hsides", "lhs", "rhs", "vsides", "box", "border"]
- elseif attrname == 'rules'
- let values = ["none", "groups", "rows", "all"]
- elseif attrname == 'align'
- let values = ["left", "center", "right", "justify", "char"]
- elseif attrname == 'valign'
- let values = ["top", "middle", "bottom", "baseline"]
- elseif attrname == 'scope'
- let values = ["row", "col", "rowgroup", "colgroup"]
- elseif attrname == 'href'
+ if attrname == 'href'
" Now we are looking for local anchors defined by name or id
if entered_value =~ '^#'
let file = join(getline(1, line('$')), ' ')
@@ -476,18 +454,12 @@ function! htmlcomplete#CompleteTags(findstart, base)
let values += ['#'.matchstr(i, "^[a-zA-Z][a-zA-Z0-9%_-]*")]
endfor
endif
- elseif attrname == 'type'
- if context =~ '^input'
- let values = ["text", "password", "checkbox", "radio", "submit", "reset", "file", "hidden", "image", "button"]
- elseif context =~ '^button'
- let values = ["button", "submit", "reset"]
- elseif context =~ '^style'
- let values = ["text/css"]
- elseif context =~ '^script'
- let values = ["text/javascript"]
- endif
else
- return []
+ if has_key(g:html_omni, tag) && has_key(g:html_omni[tag][1], attrname)
+ let values = g:html_omni[tag][1][attrname]
+ else
+ return []
+ endif
endif
if len(values) == 0
@@ -518,13 +490,12 @@ function! htmlcomplete#CompleteTags(findstart, base)
let sbase = matchstr(context, '.*\ze\s.*')
" Load data {{{
- if !exists("g:xmldata_xhtml10s")
- runtime! autoload/xml/xhtml10s.vim
- "call htmlcomplete#LoadData()
+ if !exists("g:html_omni_gen")
+ call htmlcomplete#LoadData()
endif
" }}}
"
- let attrs = keys(g:xmldata_xhtml10s[tag][1])
+ let attrs = keys(g:html_omni[tag][1])
for m in sort(attrs)
if m =~ '^'.attr
@@ -534,13 +505,13 @@ function! htmlcomplete#CompleteTags(findstart, base)
endif
endfor
let menu = res + res2
- if has_key(g:xmldata_xhtml10s, 'vimxmlattrinfo')
+ if has_key(g:html_omni, 'vimxmlattrinfo')
let final_menu = []
for i in range(len(menu))
let item = menu[i]
- if has_key(g:xmldata_xhtml10s['vimxmlattrinfo'], item)
- let m_menu = g:xmldata_xhtml10s['vimxmlattrinfo'][item][0]
- let m_info = g:xmldata_xhtml10s['vimxmlattrinfo'][item][1]
+ if has_key(g:html_omni['vimxmlattrinfo'], item)
+ let m_menu = g:html_omni['vimxmlattrinfo'][item][0]
+ let m_info = g:html_omni['vimxmlattrinfo'][item][1]
if m_menu !~ 'Bool'
let item .= '="'
endif
@@ -569,9 +540,9 @@ function! htmlcomplete#CompleteTags(findstart, base)
endif
endif
" Load data {{{
- if !exists("g:xmldata_xhtml10s")
- runtime! autoload/xml/xhtml10s.vim
- "call htmlcomplete#LoadData()
+ if !exists("g:html_omni")
+ "runtime! autoload/xml/xhtml10s.vim
+ call htmlcomplete#LoadData()
endif
" }}}
" Tag completion {{{
@@ -580,15 +551,15 @@ function! htmlcomplete#CompleteTags(findstart, base)
" MM: TODO: GLOT works always the same but with some weird situation it
" behaves as intended in HTML but screws in PHP
let g:ot = opentag
- if opentag == '' || &ft == 'php' && !has_key(g:xmldata_xhtml10s, opentag)
+ if opentag == '' || &ft == 'php' && !has_key(g:html_omni, opentag)
" Hack for sometimes failing GetLastOpenTag.
" As far as I tested fail isn't GLOT fault but problem
" of invalid document - not properly closed tags and other mish-mash.
" Also when document is empty. Return list of *all* tags.
- let tags = keys(g:xmldata_xhtml10s)
+ let tags = keys(g:html_omni)
call filter(tags, 'v:val !~ "^vimxml"')
else
- let tags = g:xmldata_xhtml10s[opentag][0]
+ let tags = g:html_omni[opentag][0]
endif
" }}}
@@ -600,13 +571,13 @@ function! htmlcomplete#CompleteTags(findstart, base)
endif
endfor
let menu = res + res2
- if has_key(g:xmldata_xhtml10s, 'vimxmltaginfo')
+ if has_key(g:html_omni, 'vimxmltaginfo')
let final_menu = []
for i in range(len(menu))
let item = menu[i]
- if has_key(g:xmldata_xhtml10s['vimxmltaginfo'], item)
- let m_menu = g:xmldata_xhtml10s['vimxmltaginfo'][item][0]
- let m_info = g:xmldata_xhtml10s['vimxmltaginfo'][item][1]
+ if has_key(g:html_omni['vimxmltaginfo'], item)
+ let m_menu = g:html_omni['vimxmltaginfo'][item][0]
+ let m_info = g:html_omni['vimxmltaginfo'][item][1]
else
let m_menu = ''
let m_info = ''
@@ -621,4 +592,27 @@ function! htmlcomplete#CompleteTags(findstart, base)
" }}}
endif
endfunction
+
+function! htmlcomplete#LoadData() " {{{
+ if !exists("g:html_omni_flavor")
+ let g:html_omni_flavor = 'xhtml10s'
+ endif
+ exe 'runtime! autoload/xml/'.g:html_omni_flavor.'.vim'
+ " This one is necessary because we don't know if
+ " g:html_omni_flavor file exists and was sourced
+ " Proper checking for files would require iterating through 'rtp'
+ " and could introduce OS dependent mess.
+ if !exists("g:xmldata_".g:html_omni_flavor)
+ let g:html_omni_flavor = 'xhtml10s'
+ runtime! autoload/xml/xhtml10s.vim
+ endif
+
+ exe 'let g:html_omni = g:xmldata_'.g:html_omni_flavor
+
+ " Free some memory
+ exe 'unlet! g:xmldata_'.g:html_omni_flavor
+
+ "call htmlcomplete#LoadData()
+endfunction
+" }}}
" vim:set foldmethod=marker:
diff --git a/runtime/autoload/xml/xhtml10s.vim b/runtime/autoload/xml/xhtml10s.vim
index 1d15cef153..2fe68cdd23 100644
--- a/runtime/autoload/xml/xhtml10s.vim
+++ b/runtime/autoload/xml/xhtml10s.vim
@@ -1460,9 +1460,21 @@ let g:xmldata_xhtml10s = {
\ 'style' : [[],
\ {
\ 'lang' : [],
-\ 'media' : [],
+\ 'media' : [
+\ 'screen',
+\ 'tty',
+\ 'tv',
+\ 'projection',
+\ 'handheld',
+\ 'print',
+\ 'braille',
+\ 'aural',
+\ 'all'
+\ ],
\ 'title' : [],
-\ 'type' : [],
+\ 'type' : [
+\ 'text/css'
+\ ],
\ 'xml:space' : [
\ 'preserve'
\ ],
@@ -3342,7 +3354,17 @@ let g:xmldata_xhtml10s = {
\ ],
\ 'onkeydown' : [],
\ 'onkeyup' : [],
-\ 'media' : [],
+\ 'media' : [
+\ 'screen',
+\ 'tty',
+\ 'tv',
+\ 'projection',
+\ 'handheld',
+\ 'print',
+\ 'braille',
+\ 'aural',
+\ 'all'
+\ ],
\ 'href' : [],
\ 'onmouseup' : [],
\ 'id' : [],
@@ -3369,7 +3391,9 @@ let g:xmldata_xhtml10s = {
\ 'BOOL'
\ ],
\ 'src' : [],
-\ 'type' : [],
+\ 'type' : [
+\ 'text/javascript'
+\ ],
\ 'charset' : [],
\ 'xml:space' : [
\ 'preserve'
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index 550bb3007d..1b6d59771b 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -1,4 +1,4 @@
-*insert.txt* For Vim version 7.0e. Last change: 2006 Apr 14
+*insert.txt* For Vim version 7.0e. Last change: 2006 Apr 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1103,7 +1103,7 @@ Vim can display the matches in a simplistic popup menu.
The menu is used when:
- The 'completeopt' option contains "menu" or "menuone".
- The terminal supports at least 8 colors.
-- There are at least two matches.
+- There are at least two matches. One of "menuone" is used.
The 'pumheight' option can be used to set a maximum height. The default is to
use all space available.
@@ -1264,6 +1264,26 @@ Note: Completion may fail in badly formatted documents. In such case try to
run |:make| command to detect formatting problems.
+HTML flavor *html-flavor*
+
+By default HTML completion provides completion for XHTML 1.0 Strict. This is
+not the only HTML version. To use another data file and still have benefits of
+custom completion for class, style, etc. attributes set g:html_omni_flavor
+variable. Example (in .vimrc or filetype plugin file): >
+
+ let g:html_omni_flavor = 'xhtml10t'
+
+Data for HTML completion will be read from 'autoload/xml/xhtml10t.vim' file
+located somewhere in 'runtimepath' (not in default distribution).
+
+More about format of data file in |xml-omni-datafile|. Some of data files may
+in future be found on vim-online site (|www|).
+
+Note that g:html_omni_flavor may point to file with any XML data. This makes
+possible to mix PHP (|ft-php-omni|) completion with whatever XML dialect
+(assuming you have data file for it).
+
+
JAVASCRIPT *ft-javascript-omni*
Completion of most elements of JavaScript language and DOM elements.
@@ -1479,10 +1499,23 @@ In example are visible four special elements:
names, as value two element List for additional menu info and long
description.
-Note: Tag names in data file MUST not contain namespace description. Check
+Note: Tag names in data file MUST not contain namespace description. Check
xsl.vim for example.
+DTD -> Vim *dtd2vim*
+
+On |www| is script |dtd2vim| which parses DTD and creates XML data file
+for Vim XML omni completion.
+
+ dtd2vim: http://www.vim.org/scripts/script.php?script_id=1462
+
+Check there and beginning of file for details of usage.
+Script requires perl and:
+
+ perlSGML: http://savannah.nongnu.org/projects/perlsgml
+
+
Commands
:XMLns {name} [{namespace}] *:XMLns*
diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt
index af12147ba4..8555788520 100644
--- a/runtime/doc/motion.txt
+++ b/runtime/doc/motion.txt
@@ -1,4 +1,4 @@
-*motion.txt* For Vim version 7.0e. Last change: 2006 Jan 02
+*motion.txt* For Vim version 7.0e. Last change: 2006 Apr 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1059,7 +1059,8 @@ The result is that when repeating CTRL-O you will get back to old positions
only once.
When the |:keepjumps| command modifier is used, jumps are not stored in the
-jumplist.
+jumplist. Jumps are also not stored in other cases, e.g., in a |:global|
+command. You can explicitly add a jump by setting the ' mark.
After the CTRL-O command that got you into line 1154 you could give another
jump command (e.g., "G"). The jump list would then become:
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 2cfd730124..1b18f804c9 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 7.0e. Last change: 2006 Apr 12
+*options.txt* For Vim version 7.0e. Last change: 2006 Apr 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1651,10 +1651,11 @@ A jump table for the options with a short description can be found at |Q_op|.
Useful when there is additional information about the
match, e.g., what file it comes from.
- longest Only insert the longest common text of the matches. Use
- CTRL-L to add more characters. Whether case is ignored
- depends on the kind of completion. For buffer text the
- 'ignorecase' option is used.
+ longest Only insert the longest common text of the matches. If
+ the menu is displayed you can use CTRL-L to add more
+ characters. Whether case is ignored depends on the kind
+ of completion. For buffer text the 'ignorecase' option is
+ used.
preview Show extra information about the currently selected
completion in the preview window.
diff --git a/runtime/doc/tags b/runtime/doc/tags
index a327261d90..e8d6853fea 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -4984,6 +4984,7 @@ drag-n-drop gui.txt /*drag-n-drop*
drag-n-drop-win32 gui_w32.txt /*drag-n-drop-win32*
drag-status-line term.txt /*drag-status-line*
dtd.vim syntax.txt /*dtd.vim*
+dtd2vim insert.txt /*dtd2vim*
dying-variable eval.txt /*dying-variable*
e motion.txt /*e*
easy starting.txt /*easy*
@@ -5716,6 +5717,7 @@ howto howto.txt /*howto*
howto.txt howto.txt /*howto.txt*
hpterm term.txt /*hpterm*
hpterm-color syntax.txt /*hpterm-color*
+html-flavor insert.txt /*html-flavor*
html.vim syntax.txt /*html.vim*
htmlos.vim syntax.txt /*htmlos.vim*
http pi_netrw.txt /*http*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 599e3702b9..4f98431a25 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 7.0e. Last change: 2006 Apr 17
+*todo.txt* For Vim version 7.0e. Last change: 2006 Apr 18
VIM REFERENCE MANUAL by Bram Moolenaar
diff --git a/runtime/doc/usr_44.txt b/runtime/doc/usr_44.txt
index 308337a0a2..4c148c4243 100644
--- a/runtime/doc/usr_44.txt
+++ b/runtime/doc/usr_44.txt
@@ -1,4 +1,4 @@
-*usr_44.txt* For Vim version 7.0e. Last change: 2006 Mar 27
+*usr_44.txt* For Vim version 7.0e. Last change: 2006 Apr 18
VIM USER MANUAL - by Bram Moolenaar
@@ -667,8 +667,13 @@ the syntax file "name.vim", 'filetype', b:current_syntax the start of each
syntax group (nameType, nameStatement, nameString, etc).
Start with a check for "b:current_syntax". If it is defined, some other
-syntax file, earlier in 'runtimepath' was already loaded. To be compatible
-with Vim 5.8 use: >
+syntax file, earlier in 'runtimepath' was already loaded: >
+
+ if exists("b:current_syntax")
+ finish
+ endif
+
+To be compatible with Vim 5.8 use: >
if version < 600
syntax clear
diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt
index 6d0183d51b..4bafdbed59 100644
--- a/runtime/doc/version7.txt
+++ b/runtime/doc/version7.txt
@@ -1,4 +1,4 @@
-*version7.txt* For Vim version 7.0e. Last change: 2006 Apr 17
+*version7.txt* For Vim version 7.0e. Last change: 2006 Apr 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -350,6 +350,10 @@ When moving the cursor through the text and it is on a paren, then the
matching paren can be highlighted. This uses the new |CursorMoved|
autocommand event.
+This means some commands are executed every time you move the cursor. If this
+slows you down too much switch it off with: >
+ :NoMatchParen
+
See |matchparen| for more information.
The plugin uses the |:match| command. It now supports three match patterns.
@@ -890,6 +894,7 @@ BibTeX indent file. (Dorai Sitaram)
BTM ftplugin file. (Bram Moolenaar)
calendar ftplugin file. (Nikolai Weibull)
Changelog indent file. (Nikolai Weibull)
+Cmake indent and syntax file. (Andy Cedilnik)
conf ftplugin file. (Nikolai Weibull)
context syntax and ftplugin file. (Nikolai Weibull)
CRM114 ftplugin file. (Nikolai Weibull)
@@ -949,6 +954,7 @@ racc syntax and ftplugin file. (Nikolai Weibull)
rd syntax file. (Johannes Ranke)
readline ftplugin file. (Nikolai Weibull)
rhelp syntax file. (Johannes Ranke)
+rnoweb syntax file. (Johannes Ranke)
Relax NG compact ftplugin file. (Nikolai Weibull)
Scheme indent file. (Sergey Khorev)
screen ftplugin file. (Nikolai Weibull)
@@ -970,6 +976,7 @@ sudoers ftplugin file. (Nikolai Weibull)
sysctl syntax and ftplugin file. (Nikolai Weibull)
terminfo ftplugin file. (Nikolai Weibull)
trustees syntax file. (Nima Talebi)
+Vera syntax file. (David Eggum)
udev config, permissions and rules syntax and ftplugin files. (Nikolai Weibull)
updatedb syntax and ftplugin file. (Nikolai Weibull)
VHDL indent file (Gerald Lai)
@@ -2520,4 +2527,33 @@ if 'encoding' is a multi-byte encoding.
Spell checking: spellbadword() didn't see a missing capital in the first word
of a line. Popup menu now only suggest the capitalized word when appropriate.
+When using whole line completion CTRL-L moves throught the matches but it
+didn't work when at the original text.
+
+When completion finds the longest match, don't go to the first match but stick
+at the original text, so that CTRL-N selects the first one.
+
+Recognize "zsh-beta" like "zsh" for setting the 'shellpipe' default. (James
+Vega)
+
+When using ":map " and the expression results in something with a
+special byte (NUL or CSI) then it didn't work properly. Now escape special
+bytes.
+
+The default Visual highlighting for a color xterm with 8 colors was a magenta
+background, which made magenta text disappear. Now use reverse in this
+specific situation.
+
+After completing the longest match "." didn't insert the same text. Repeating
+also didn't work correctly for multi-byte text.
+
+When using Insert mode completion and BS the whole word that was completed
+would result in all possible matches. Now stop completion. Also fixes that
+for spell completion the previous word was deleted.
+
+GTK: When 'encoding' is "latin1" and using non-ASCII characters in a file name
+the tab page label was wrong and an error message would be given.
+
+The taglist() function could hang on a tags line with a non-ASCII character.
+
vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 26463a8be3..2e14397c9b 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar
-" Last Change: 2006 Apr 15
+" Last Change: 2006 Apr 18
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -427,6 +427,9 @@ au BufNewFile,BufRead *.prg
\ setf clipper |
\ endif
+" Cmake
+au BufNewFile,BufRead CMakeLists.txt,*.cmake,*.cmake.in setf cmake
+
" Cobol
au BufNewFile,BufRead *.cbl,*.cob,*.lib setf cobol
" cobol or zope form controller python script? (heuristic)
@@ -1332,10 +1335,25 @@ au BufNewFile,BufRead *.rib setf rib
au BufNewFile,BufRead *.rexx,*.rex setf rexx
" R (Splus)
-au BufNewFile,BufRead *.s,*.S setf r
+if has("fname_case")
+ au BufNewFile,BufRead *.s,*.S setf r
+else
+ au BufNewFile,BufRead *.s setf r
+endif
" R Help file
-au BufNewFile,BufRead *.rd,*.Rd setf rhelp
+if has("fname_case")
+ au BufNewFile,BufRead *.rd,*.Rd setf rhelp
+else
+ au BufNewFile,BufRead *.rd setf rhelp
+endif
+
+" R noweb file
+if has("fname_case")
+ au BufNewFile,BufRead *.Rnw,*.rnw,*.Snw,*.snw setf rnoweb
+else
+ au BufNewFile,BufRead *.rnw,*.snw setf rnoweb
+endif
" Rexx, Rebol or R
au BufNewFile,BufRead *.r,*.R call s:FTr()
@@ -1822,6 +1840,9 @@ au BufNewFile,BufRead *.uc setf uc
" Updatedb
au BufNewFile,BufRead /etc/updatedb.conf setf updatedb
+" Vera
+au BufNewFile,BufRead *.vr,*.vri,*.vrh setf vera
+
" Verilog HDL
au BufNewFile,BufRead *.v setf verilog
diff --git a/runtime/indent/cmake.vim b/runtime/indent/cmake.vim
new file mode 100644
index 0000000000..e36937df5b
--- /dev/null
+++ b/runtime/indent/cmake.vim
@@ -0,0 +1,92 @@
+" =============================================================================
+"
+" Program: CMake - Cross-Platform Makefile Generator
+" Module: $RCSfile$
+" Language: VIM
+" Date: $Date$
+" Version: $Revision$
+"
+" =============================================================================
+
+" Vim indent file
+" Language: CMake (ft=cmake)
+" Author: Andy Cedilnik
+" Maintainer: Andy Cedilnik
+" Last Change: $Date$
+" Version: $Revision$
+"
+" Licence: The CMake license applies to this file. See
+" http://www.cmake.org/HTML/Copyright.html
+" This implies that distribution with Vim is allowed
+
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal indentexpr=CMakeGetIndent(v:lnum)
+
+" Only define the function once.
+if exists("*CMakeGetIndent")
+ finish
+endif
+
+fun! CMakeGetIndent(lnum)
+ let this_line = getline(a:lnum)
+
+ " Find a non-blank line above the current line.
+ let lnum = a:lnum
+ let lnum = prevnonblank(lnum - 1)
+ let previous_line = getline(lnum)
+
+ " Hit the start of the file, use zero indent.
+ if lnum == 0
+ return 0
+ endif
+
+ let ind = indent(lnum)
+
+ let or = '\|'
+ " Regular expressions used by line indentation function.
+ let cmake_regex_comment = '#.*'
+ let cmake_regex_identifier = '[A-Za-z][A-Za-z0-9_]*'
+ let cmake_regex_quoted = '"\([^"\\]\|\\.\)*"'
+ let cmake_regex_arguments = '\(' . cmake_regex_quoted .
+ \ or . '\$(' . cmake_regex_identifier . ')' .
+ \ or . '[^()\\#"]' . or . '\\.' . '\)*'
+
+ let cmake_indent_comment_line = '^\s*' . cmake_regex_comment
+ let cmake_indent_blank_regex = '^\s*$')
+ let cmake_indent_open_regex = '^\s*' . cmake_regex_identifier .
+ \ '\s*(' . cmake_regex_arguments .
+ \ '\(' . cmake_regex_comment . '\)\?$'
+
+ let cmake_indent_close_regex = '^' . cmake_regex_arguments .
+ \ ')\s*' .
+ \ '\(' . cmake_regex_comment . '\)\?$'
+
+ let cmake_indent_begin_regex = '^\s*\(IF\|MACRO\|FOREACH\|ELSE\)\s*('
+ let cmake_indent_end_regex = '^\s*\(ENDIF\|ENDFOREACH\|ENDMACRO\|ELSE\)\s*('
+
+ " Add
+ if previous_line =~? cmake_indent_comment_line " Handle comments
+ let ind = ind
+ else
+ if previous_line =~? cmake_indent_begin_regex
+ let ind = ind + &sw
+ endif
+ if previous_line =~? cmake_indent_open_regex
+ let ind = ind + &sw
+ endif
+ endif
+
+ " Subtract
+ if this_line =~? cmake_indent_end_regex
+ let ind = ind - &sw
+ endif
+ if previous_line =~? cmake_indent_close_regex
+ let ind = ind - &sw
+ endif
+
+ return ind
+endfun
diff --git a/runtime/lang/menu_chinese_gb.936.vim b/runtime/lang/menu_chinese_gb.936.vim
index 9c3bf6dcd9..55a24422d3 100644
--- a/runtime/lang/menu_chinese_gb.936.vim
+++ b/runtime/lang/menu_chinese_gb.936.vim
@@ -1,6 +1,8 @@
-" Menu Translations: Simplified Chinese (Windows)
-" Translated By: Wang Jun
-" Last Change: Tue Sep 4 11:26:52 CST 2001
+" Menu Translations: Simplified Chinese
+" Translated By: Yuheng Xie
+" Last Change: Tue Apr 18 22:00:00 2006
+
+" vim: ts=8 sw=8 noet
" Quit when menu translations have already been done.
if exists("did_menu_trans")
@@ -14,62 +16,68 @@ scriptencoding cp936
menutrans &Help 帮助(&H)
menutrans &Overview 预览(&O)
menutrans &User\ Manual 用户手册(&U)
-menutrans &GUI 图形界面(&G)
-menutrans &How-to\ links HOWTO文档\.\.\.(&H)
+menutrans &How-to\ links How-to\ 连接(&H)
+menutrans &Find\.\.\. 查找(&F)\.\.\.
menutrans &Credits 作者(&C)
menutrans Co&pying 版权(&P)
menutrans &Version 版本(&V)
-menutrans &About 关于\ Vim(&A)
+menutrans &Sponsor/Register 赞助/注册(&S)
+menutrans O&rphans 孤儿(&R)
+menutrans &Version 版本(&V)
+menutrans &About 关于(&A)
" File menu
menutrans &File 文件(&F)
menutrans &Open\.\.\.:e 打开(&O)\.\.\.:e
-menutrans Sp&lit-Open\.\.\.:sp 分割窗口并打开(&L):sp
+menutrans Sp&lit-Open\.\.\.:sp 分割并打开(&L)\.\.\.:sp
+menutrans Open\ Tab\.\.\.:tabnew 打开标签\.\.\.:tabnew
menutrans &New:enew 新建(&N):enew
menutrans &Close:close 关闭(&C):close
menutrans &Save:w 保存(&S):w
menutrans Save\ &As\.\.\.:sav 另存为(&A)\.\.\.:sav
-menutrans Split\ &Diff\ with\.\.\. 分割比较(&Diff)\.\.\.
-menutrans Split\ Patched\ &By\.\.\. 分割打补丁(&Patch)\.\.\.
+menutrans Split\ &Diff\ with\.\.\. 分割比较(Diff)(&D)\.\.\.
+menutrans Split\ Patched\ &By\.\.\. 分割打补丁(Patch)(&B)\.\.\.
menutrans &Print 打印(&P)
menutrans Sa&ve-Exit:wqa 保存并退出(&V):wqa
menutrans E&xit:qa 退出(&X):qa
" Edit menu
menutrans &Edit 编辑(&E)
-menutrans &Undou 恢复(&U)u
+menutrans &Undou 撤销(&U)u
menutrans &Redo^R 重做(&R)^R
-menutrans Rep&eat\. 重复上次动作(&E)\.
+menutrans Rep&eat\. 重复上次操作(&E)\.
menutrans Cu&t"+x 剪切(&T)"+x
menutrans &Copy"+y 复制(&C)"+y
-menutrans &Paste"+gP 粘帖(&P)"+gP
-menutrans Put\ &Before[p 贴到光标前(&B)[p
-menutrans Put\ &After]p 贴到光标后(&A)]p
+menutrans &Paste"+gP 粘贴(&P)"+gP
+menutrans Put\ &Before[p 粘贴到光标前(&B)[p
+menutrans Put\ &After]p 粘贴到光标后(&A)]p
menutrans &Deletex 删除(&D)x
-menutrans &Select\ allggVG 全选(&S)ggvG
+menutrans &Select\ allggVG 全选(&S)ggVG
menutrans &Find\.\.\. 查找(&F)\.\.\.
-menutrans Find\ and\ Rep&lace\.\.\. 查找替换(&L)\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. 查找和替换(&L)\.\.\.
+menutrans &Find/ 查找(&F)/
+menutrans Find\ and\ Rep&lace:%s 查找和替换(&L):%s
menutrans Settings\ &Window 设定窗口(&W)
+menutrans Startup\ &Settings 启动设定(&S)
menutrans &Global\ Settings 全局设定(&G)
-" Build boolean options
-menutrans Toggle\ Pattern\ &Highlight:set\ hls! 开/关增量查找模式:set\ hls!
-menutrans Toggle\ &Ignore-case:set\ ic! 开/关忽略大小写模式:set\ ic!
-menutrans Toggle\ &Showmatch:set\ sm! 开/关匹配显示:set sm!
+" Edit/Global Settings
+menutrans Toggle\ Pattern\ &Highlight:set\ hls! 开/关模式高亮(&H):set\ hls!
+menutrans Toggle\ &Ignore-case:set\ ic! 开/关忽略大小写(&I):set\ ic!
+menutrans Toggle\ &Showmatch:set\ sm! 开/关显示配对(&S):set\ sm!
menutrans &Context\ lines 上下文行数(&C)
-menutrans &Virtual\ Edit 可视化编辑模式(&V)
+menutrans &Virtual\ Edit 虚拟编辑(&V)
menutrans Never 从不
menutrans Block\ Selection 块选择
menutrans Insert\ mode 插入模式
-menutrans Block\ and\ Insert 块选择与插入模式
-menutrans Always 所有模式
+menutrans Block\ and\ Insert 块选择和插入模式
+menutrans Always 总是
-menutrans Toggle\ Insert\ &Mode:set\ im! 开/关插入模式:set\ im!
-
-menutrans Search\ &Path\.\.\. 查找路径\.\.\.(&P)
-
-menutrans Ta&g\ Files\.\.\. 标签文件\.\.\.(&g)
+menutrans Toggle\ Insert\ &Mode:set\ im! 开/关插入模式(&M):set\ im!
+menutrans Toggle\ Vi\ C&ompatible:set\ cp! 开/关\ Vi\ 兼容:set\ cp!
+menutrans Search\ &Path\.\.\. 查找路径(&P)\.\.\.
+menutrans Ta&g\ Files\.\.\. Tag\ 文件(&T)\.\.\.
" GUI options
menutrans Toggle\ &Toolbar 开/关工具条(&T)
@@ -77,87 +85,111 @@ menutrans Toggle\ &Bottom\ Scrollbar
menutrans Toggle\ &Left\ Scrollbar 开/关左端滚动条(&L)
menutrans Toggle\ &Right\ Scrollbar 开/关右端滚动条(&R)
-
" Edit/File Settings
-menutrans F&ile\ Settings 文件设定(&i)
+menutrans F&ile\ Settings 文件设定(&I)
" Boolean options
-menutrans Toggle\ Line\ &Numbering:set\ nu! 开/关显示行号:set\ nu!
-menutrans Toggle\ &List\ Mode:set\ list! 开/关显示Tab:set\ list!
-menutrans Toggle\ Line\ &Wrap:set\ wrap! 开/关自动折行:set\ wrap!
-menutrans Toggle\ W&rap\ at\ word:set\ lbr! 开/关词尾折行:set\ lbr!
-menutrans Toggle\ &expand-tab:set\ et! 开/关expand-tab:set\ et!
-menutrans Toggle\ &auto-indent:set\ ai! 开/关auto-indent:set\ ai!
-menutrans Toggle\ &C-indenting:set\ cin! 开/关C-indent:set\ cin!
-
+menutrans Toggle\ Line\ &Numbering:set\ nu! 开/关显示行号(&N):set\ nu!
+menutrans Toggle\ &List\ Mode:set\ list! 开/关\ list\ 模式(&L):set\ list!
+menutrans Toggle\ Line\ &Wrap:set\ wrap! 开/关折行(&W):set\ wrap!
+menutrans Toggle\ W&rap\ at\ word:set\ lbr! 开/关整词折行(&R):set\ lbr!
+menutrans Toggle\ &expand-tab:set\ et! 开/关扩展\ tab(&E):set\ et!
+menutrans Toggle\ &auto-indent:set\ ai! 开/关自动缩进(&A):set\ ai!
+menutrans Toggle\ &C-indenting:set\ cin! 开/关\ C\ 缩进(&C):set\ cin!
" other options
-menutrans &Shiftwidth 缩排宽度(&S)
-menutrans Soft\ &Tabstop 伪Tab宽度(&T)
-menutrans Te&xt\ Width\.\.\. 页面宽度(&x)\.\.\.
+menutrans &Shiftwidth 缩进宽度(&S)
+menutrans Soft\ &Tabstop Soft\ Tab\ 宽度(&T)
+menutrans Te&xt\ Width\.\.\. 文本宽度(&X)\.\.\.
menutrans &File\ Format\.\.\. 文件格式(&F)\.\.\.
-
-menutrans C&olor\ Scheme 调色板(&o)
-menutrans Select\ Fo&nt\.\.\. 选择字体(&n)\.\.\.
-
+menutrans C&olor\ Scheme 配色方案(&O)
+menutrans Select\ Fo&nt\.\.\. 选择字体(&N)\.\.\.
+menutrans &Keymap Keymap(&K)
" Programming menu
menutrans &Tools 工具(&T)
-menutrans &Jump\ to\ this\ tagg^] 检索光标处的标签关键字(tag)(&J)g^]
-menutrans Jump\ &back^T 跳回检索前的位置(&B)^T
-menutrans Build\ &Tags\ File 建立标签索引文件\ Tags(&T)
-menutrans &Folding Folding设定(&F)
-menutrans &Diff 比较(&D)
-menutrans &Make:make 执行\ Make(&M):make
-menutrans &List\ Errors:cl 列出编译错误(&E):cl
-menutrans L&ist\ Messages:cl! 列出所有信息(&I):cl!
-menutrans &Next\ Error:cn 下一个编译错误处(&N):cn
-menutrans &Previous\ Error:cp 上一个编译错误处(&P):cp
-menutrans &Older\ List:cold 旧错误列表(&O):cold
-menutrans N&ewer\ List:cnew 新错误列表(&E):cnew
-menutrans Error\ &Window 错误信息窗口(&W)
-menutrans &Set\ Compiler 设置编译器(&S)
-menutrans &Convert\ to\ HEX:%!xxd 转换成16进制:%!xxd
-menutrans Conve&rt\ back:%!xxd\ -r 从16进制转换回文字:%!xxd\ -r
+menutrans &Jump\ to\ this\ tagg^] 跳转到这个\ tag(&J)g^]
+menutrans Jump\ &back^T 跳转返回(&B)^T
+menutrans Build\ &Tags\ File 建立 Tags 文件(&T)
+
+" Tools.Spelling Menu
+menutrans &Spelling 拼写检查(&S)
+menutrans &Spell\ Check\ On 打开拼写检查(&S)
+menutrans Spell\ Check\ &Off 关闭拼写检查(&O)
+menutrans To\ &Next\ error]s 上一个错误(&N)]s
+menutrans To\ &Previous\ error[s 下一个错误(&P)[s
+menutrans Suggest\ &Correctionsz= 修正建议(&C)z=
+menutrans &Repeat\ correction:spellrepall 重复修正(&R):spellrepall
+menutrans Set\ language\ to\ "en" 设定语言为\ "en"
+menutrans Set\ language\ to\ "en_au" 设定语言为\ "en_au"
+menutrans Set\ language\ to\ "en_ca" 设定语言为\ "en_ca"
+menutrans Set\ language\ to\ "en_gb" 设定语言为\ "en_gb"
+menutrans Set\ language\ to\ "en_nz" 设定语言为\ "en_nz"
+menutrans Set\ language\ to\ "en_us" 设定语言为\ "en_us"
+menutrans &Find\ More\ Languages 查找更多语言(&F)
" Tools.Fold Menu
-menutrans &Enable/Disable\ foldszi 使用/不使用Folding(&E)zi
+" open close folds
+menutrans &Folding 折叠(&F)
+menutrans &Enable/Disable\ foldszi 启用/禁用折叠(&E)zi
menutrans &View\ Cursor\ Linezv 查看此行(&V)zv
-menutrans Vie&w\ Cursor\ Line\ onlyzMzx 只查看此行(&W)zMzx
-menutrans C&lose\ more\ foldszm 关闭Folds(&L)zm
-menutrans &Close\ all\ foldszM 关闭所有Folds(&C)zM
-menutrans O&pen\ more\ foldszr 展开Folds(&P)zr
-menutrans &Open\ all\ foldszR 展开所有Folds(&O)zR
+menutrans Vie&w\ Cursor\ Line\ onlyzMzx 仅查看此行(&W)zMzx
+menutrans C&lose\ more\ foldszm 关闭更多折叠(&L)zm
+menutrans &Close\ all\ foldszM 关闭所有折叠(&C)zM
+menutrans O&pen\ more\ foldszr 打开更多折叠(&P)zr
+menutrans &Open\ all\ foldszR 打开所有折叠(&O)zR
" fold method
-menutrans Fold\ Met&hod Fold方式(&H)
-menutrans Create\ &Foldzf 建立Fold(&F)zf
-menutrans &Delete\ Foldzd 删除Fold(&D)zd
-menutrans Delete\ &All\ FoldszD 删除所有Fold(&A)zD
+menutrans Fold\ Met&hod 折叠方法(&H)
+menutrans M&anual 手工(&A)
+menutrans I&ndent 缩进(&N)
+menutrans E&xpression 表达式(&X)
+menutrans S&yntax 语法(&Y)
+menutrans &Diff 比较(Diff)(&D)
+menutrans Ma&rker 标记(&R)
+" create and delete folds
+menutrans Create\ &Foldzf 创建折叠(&F)zf
+menutrans &Delete\ Foldzd 删除折叠(&D)zd
+menutrans Delete\ &All\ FoldszD 删除所有折叠(&A)zD
" moving around in folds
-menutrans Fold\ column\ &width 设定Fold栏宽(&W)
+menutrans Fold\ column\ &width 折叠栏宽度(&W)
" Tools.Diff Menu
-menutrans &Update 更新(&U)
-menutrans &Get\ Block 取得不同部分(&G)
-menutrans &Put\ Block 将不同部分应用到对方(&P)
+menutrans &Diff 比较(Diff)(&D)
+menutrans &Update 更新(&U)
+menutrans &Get\ Block 得到块(&G)
+menutrans &Put\ Block 放置块(&P)
+menutrans &Make:make Make(&M):make
+menutrans &List\ Errors:cl 列出错误(&L):cl
+menutrans L&ist\ Messages:cl! 列出消息(&I):cl!
+menutrans &Next\ Error:cn 下一个错误(&N):cn
+menutrans &Previous\ Error:cp 上一个错误(&P):cp
+menutrans &Older\ List:cold 更旧的错误列表(&O):cold
+menutrans N&ewer\ List:cnew 更新的错误列表(&E):cnew
+menutrans Error\ &Window 错误窗口(&W)
+menutrans &Update:cwin 更新(&U):cwin
+menutrans &Open:copen 打开(&O):copen
+menutrans &Close:cclose 关闭(&C):cclose
+menutrans &Convert\ to\ HEX:%!xxd 转换成十六进制:%!xxd
+menutrans Conve&rt\ back:%!xxd\ -r 转换返回:%!xxd\ -r
+menutrans Se&T\ Compiler 设定编译器(&T)
" Names for buffer menu.
menutrans &Buffers 缓冲区(&B)
-menutrans &Refresh\ menu 更新(&R)
+menutrans &Refresh\ menu 更新菜单(&R)
menutrans &Delete 删除(&D)
-menutrans &Alternate 修改(&L)
+menutrans &Alternate 交替(&A)
menutrans &Next 下一个(&N)
-menutrans &Previous 前一个(&P)
+menutrans &Previous 上一个(&P)
" Window menu
menutrans &Window 窗口(&W)
-menutrans &New^Wn 新建窗口(&N)^Wn
-menutrans S&plit^Ws 分割窗口(&P)^Ws
-menutrans Sp&lit\ To\ #^W^^ 分割到#(&L)^W^^
+menutrans &New^Wn 新建(&N)^Wn
+menutrans S&plit^Ws 分割(&P)^Ws
+menutrans Sp&lit\ To\ #^W^^ 分割到\ #(&L)^W^^
menutrans Split\ &Vertically^Wv 垂直分割(&V)^Wv
-menutrans Split\ File\ E&xplorer 文件浏览器式分割(&X)
-menutrans &Close^Wc 关闭窗口(&C)^Wc
+menutrans Split\ File\ E&xplorer 分割文件浏览器(&X)
+menutrans &Close^Wc 关闭(&C)^Wc
menutrans Close\ &Other(s)^Wo 关闭其它窗口(&O)^Wo
menutrans Move\ &To 移动到(&T)
menutrans &Top^WK 顶端(&T)^WK
@@ -166,13 +198,13 @@ menutrans &Left\ side^WH
menutrans &Right\ side^WL 右边(&R)^WL
" menutrans Ne&xt^Ww 下一个(&X)^Ww
" menutrans P&revious^WW 上一个(&R)^WW
-menutrans Rotate\ &Up^WR 上移窗口(&U)^WR
-menutrans Rotate\ &Down^Wr 下移窗口(&D)^Wr
-menutrans &Equal\ Size^W= 所有窗口等高(&E)^W=
+menutrans Rotate\ &Up^WR 向上轮换(&U)^WR
+menutrans Rotate\ &Down^Wr 向下轮换(&D)^Wr
+menutrans &Equal\ Size^W= 等大(&E)^W=
menutrans &Max\ Height^W_ 最大高度(&M)^W
-menutrans M&in\ Height^W1_ 最小高度(&i)^W1_
+menutrans M&in\ Height