summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-02-14 22:29:30 +0000
committerBram Moolenaar <Bram@vim.org>2006-02-14 22:29:30 +0000
commit1d2ba7fa851f988ea9eab47b7662be243f85ddfa (patch)
tree5882ec62c5c5c6047021a94e74e4797139944a95
parentf52c725c4739f2d3368029d67218d6cae0d87995 (diff)
updated for version 7.0197v7.0197
-rw-r--r--runtime/autoload/htmlcomplete.vim146
-rw-r--r--runtime/autoload/javascriptcomplete.vim55
-rw-r--r--runtime/autoload/xmlcomplete.vim82
-rw-r--r--runtime/doc/autocmd.txt3
-rw-r--r--runtime/doc/change.txt27
-rw-r--r--runtime/doc/eval.txt55
-rw-r--r--runtime/doc/gui.txt5
-rw-r--r--runtime/doc/insert.txt109
-rw-r--r--runtime/doc/options.txt48
-rw-r--r--runtime/doc/os_dos.txt6
-rw-r--r--runtime/doc/pattern.txt4
-rw-r--r--runtime/doc/quickref.txt3
-rw-r--r--runtime/doc/starting.txt5
-rw-r--r--runtime/doc/tags7
-rw-r--r--runtime/doc/term.txt4
-rw-r--r--runtime/doc/tips.txt57
-rw-r--r--runtime/doc/todo.txt151
-rw-r--r--runtime/doc/usr_41.txt2
-rw-r--r--runtime/doc/version7.txt12
-rw-r--r--runtime/indent/vhdl.vim36
-rw-r--r--src/buffer.c10
-rw-r--r--src/edit.c679
-rw-r--r--src/eval.c164
-rw-r--r--src/ex_cmds.h10
-rw-r--r--src/ex_docmd.c247
-rw-r--r--src/globals.h10
-rw-r--r--src/gui.h2
-rw-r--r--src/gui_beval.c5
-rw-r--r--src/if_mzsch.c2
-rw-r--r--src/main.c13
-rw-r--r--src/netbeans.c2
-rw-r--r--src/normal.c13
-rw-r--r--src/ops.c43
-rw-r--r--src/option.c26
-rw-r--r--src/proto/eval.pro2
-rw-r--r--src/proto/ex_docmd.pro2
-rw-r--r--src/proto/ops.pro2
-rw-r--r--src/proto/window.pro7
-rw-r--r--src/screen.c87
-rw-r--r--src/search.c4
-rw-r--r--src/structs.h30
-rw-r--r--src/syntax.c3
-rw-r--r--src/term.c4
-rw-r--r--src/ui.c1
-rw-r--r--src/version.h4
-rw-r--r--src/vim.h5
-rw-r--r--src/window.c322
47 files changed, 1779 insertions, 737 deletions
diff --git a/runtime/autoload/htmlcomplete.vim b/runtime/autoload/htmlcomplete.vim
index a6295373ed..0b4bc5fd88 100644
--- a/runtime/autoload/htmlcomplete.vim
+++ b/runtime/autoload/htmlcomplete.vim
@@ -41,7 +41,7 @@ function! htmlcomplete#CompleteTags(findstart, base)
let start = col('.') - 1
let b:jscompl = 1
let b:jsrange = [scriptstart, scriptend]
- while start >= 0 && line[start - 1] =~ '\w'
+ while start >= 0 && line[start - 1] =~ '\k'
let start -= 1
endwhile
" We are inside of <script> tag. But we should also get contents
@@ -102,7 +102,7 @@ function! htmlcomplete#CompleteTags(findstart, base)
" completion will be badly reported
if b:compl_context =~? 'on[a-z]*\s*=\s*\(''[^'']*\|"[^"]*\)$'
let start = col('.') - 1
- while start >= 0 && line[start - 1] =~ '\w'
+ while start >= 0 && line[start - 1] =~ '\k'
let start -= 1
endwhile
endif
@@ -178,13 +178,6 @@ function! htmlcomplete#CompleteTags(findstart, base)
endif
endif
- " Set attribute groups
- let coreattrs = ["id", "class", "style", "title"]
- let i18n = ["lang", "xml:lang", "dir=\"ltr\" ", "dir=\"rtl\" "]
- let events = ["onclick", "ondblclick", "onmousedown", "onmouseup", "onmousemove",
- \ "onmouseover", "onmouseout", "onkeypress", "onkeydown", "onkeyup"]
- let focus = ["accesskey", "tabindex", "onfocus", "onblur"]
- let coregroup = coreattrs + i18n + events
" If context contains > it means we are already outside of tag and we
" should abandon action
" If context contains white space it is attribute.
@@ -403,12 +396,11 @@ function! htmlcomplete#CompleteTags(findstart, base)
" 3. Proper call for javascriptcomplete#CompleteJS
call cursor(l,c)
- let js_context = matchstr(a:base, '\w\+$')
+ let js_context = matchstr(a:base, '\k\+$')
let js_shortcontext = substitute(a:base, js_context.'$', '', '')
let b:compl_context = context
let b:jsrange = [l, l]
unlet! l c
- "return map(javascriptcomplete#CompleteJS(0, js_context), 'js_shortcontext.v:val')
return javascriptcomplete#CompleteJS(0, js_context)
endif
@@ -501,95 +493,44 @@ function! htmlcomplete#CompleteTags(findstart, base)
" Attribute completion {{{
" Shorten context to not include last word
let sbase = matchstr(context, '.*\ze\s.*')
- if tag =~ '^\(abbr\|acronym\|address\|b\|bdo\|big\|caption\|cite\|code\|dd\|dfn\|div\|dl\|dt\|em\|fieldset\|h\d\|hr\|i\|kbd\|li\|noscript\|ol\|p\|samp\|small\|span\|strong\|sub\|sup\|tt\|ul\|var\)$'
- let attrs = coregroup
- elseif tag == 'a'
- let attrs = coregroup + focus + ["charset", "type", "name", "href", "hreflang", "rel", "rev", "shape", "coords"]
- elseif tag == 'area'
- let attrs = coregroup + focus + ["shape", "coords", "href", "nohref", "alt"]
- elseif tag == 'base'
- let attrs = ["href", "id"]
- elseif tag == 'blockquote'
- let attrs = coregroup + ["cite"]
- elseif tag == 'body'
- let attrs = coregroup + ["onload", "onunload"]
- elseif tag == 'br'
- let attrs = coreattrs
- elseif tag == 'button'
- let attrs = coregroup + focus + ["name", "value", "type"]
- elseif tag == '^\(col\|colgroup\)$'
- let attrs = coregroup + ["span", "width", "align", "char", "charoff", "valign"]
- elseif tag =~ '^\(del\|ins\)$'
- let attrs = coregroup + ["cite", "datetime"]
- elseif tag == 'form'
- let attrs = coregroup + ["action", "method=\"get\" ", "method=\"post\" ", "enctype", "onsubmit", "onreset", "accept", "accept-charset"]
- elseif tag == 'head'
- let attrs = i18n + ["id", "profile"]
- elseif tag == 'html'
- let attrs = i18n + ["id", "xmlns"]
- elseif tag == 'img'
- let attrs = coregroup + ["src", "alt", "longdesc", "height", "width", "usemap", "ismap"]
- elseif tag == 'input'
- let attrs = coregroup + ["type", "name", "value", "checked", "disabled", "readonly", "size", "maxlength", "src", "alt", "usemap", "onselect", "onchange", "accept"]
- elseif tag == 'label'
- let attrs = coregroup + ["for", "accesskey", "onfocus", "onblur"]
- elseif tag == 'legend'
- let attrs = coregroup + ["accesskey"]
- elseif tag == 'link'
- let attrs = coregroup + ["charset", "href", "hreflang", "type", "rel", "rev", "media"]
- elseif tag == 'map'
- let attrs = i18n + events + ["id", "class", "style", "title", "name"]
- elseif tag == 'meta'
- let attrs = i18n + ["id", "http-equiv", "content", "scheme", "name"]
- elseif tag == 'title'
- let attrs = i18n + ["id"]
- elseif tag == 'object'
- let attrs = coregroup + ["declare", "classid", "codebase", "data", "type", "codetype", "archive", "standby", "height", "width", "usemap", "name", "tabindex"]
- elseif tag == 'optgroup'
- let attrs = coregroup + ["disbled", "label"]
- elseif tag == 'option'
- let attrs = coregroup + ["disbled", "selected", "value", "label"]
- elseif tag == 'param'
- let attrs = ["id", "name", "value", "valuetype", "type"]
- elseif tag == 'pre'
- let attrs = coregroup + ["xml:space"]
- elseif tag == 'q'
- let attrs = coregroup + ["cite"]
- elseif tag == 'script'
- let attrs = ["id", "charset", "type=\"text/javascript\"", "type", "src", "defer", "xml:space"]
- elseif tag == 'select'
- let attrs = coregroup + ["name", "size", "multiple", "disabled", "tabindex", "onfocus", "onblur", "onchange"]
- elseif tag == 'style'
- let attrs = coreattrs + ["id", "type=\"text/css\"", "type", "media", "title", "xml:space"]
- elseif tag == 'table'
- let attrs = coregroup + ["summary", "width", "border", "frame", "rules", "cellspacing", "cellpadding"]
- elseif tag =~ '^\(thead\|tfoot\|tbody\|tr\)$'
- let attrs = coregroup + ["align", "char", "charoff", "valign"]
- elseif tag == 'textarea'
- let attrs = coregroup + ["name", "rows", "cols", "disabled", "readonly", "onselect", "onchange"]
- elseif tag =~ '^\(th\|td\)$'
- let attrs = coregroup + ["abbr", "headers", "scope", "rowspan", "colspan", "align", "char", "charoff", "valign"]
- else
- return []
+
+ " Load data {{{
+ if !exists("g:xmldata_xhtml10s")
+ runtime! autoload/xml/xhtml10s.vim
endif
+ " }}}
+ "
+ let attrs = keys(g:xmldata_xhtml10s[tag][1])
for m in sort(attrs)
if m =~ '^'.attr
- if m =~ '^\(ismap\|defer\|declare\|nohref\|checked\|disabled\|selected\|readonly\)$' || m =~ '='
- call add(res, m)
- else
- call add(res, m.'="')
- endif
+ call add(res, m)
elseif m =~ attr
- if m =~ '^\(ismap\|defer\|declare\|nohref\|checked\|disabled\|selected\|readonly\)$' || m =~ '='
- call add(res2, m)
- else
- call add(res2, m.'="')
- endif
+ call add(res2, m)
endif
endfor
-
- return res + res2
+ let menu = res + res2
+ if has_key(g:xmldata_xhtml10s, '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 m_menu !~ 'Bool'
+ let item .= '="'
+ endif
+ else
+ let m_menu = ''
+ let m_info = ''
+ let item .= '="'
+ endif
+ let final_menu += [{'word':item, 'menu':m_menu, 'info':m_info}]
+ endfor
+ else
+ let final_menu = map(menu, 'v:val."=\""')
+ endif
+ return final_menu
endif
" }}}
@@ -625,8 +566,25 @@ function! htmlcomplete#CompleteTags(findstart, base)
call add(res2, m)
endif
endfor
+ let menu = res + res2
+ if has_key(g:xmldata_xhtml10s, '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]
+ else
+ let m_menu = ''
+ let m_info = ''
+ endif
+ let final_menu += [{'word':item, 'menu':m_menu, 'info':m_info}]
+ endfor
+ else
+ let final_menu = menu
+ endif
+ return final_menu
- return res + res2
" }}}
endif
diff --git a/runtime/autoload/javascriptcomplete.vim b/runtime/autoload/javascriptcomplete.vim
index 0163fd9b7e..87e40f36d3 100644
--- a/runtime/autoload/javascriptcomplete.vim
+++ b/runtime/autoload/javascriptcomplete.vim
@@ -12,7 +12,7 @@ function! javascriptcomplete#CompleteJS(findstart, base)
let compl_begin = col('.') - 2
" Bit risky but JS is rather limited language and local chars shouldn't
" fint way into names
- while start >= 0 && line[start - 1] =~ '\w'
+ while start >= 0 && line[start - 1] =~ '\k'
let start -= 1
endwhile
let b:compl_context = getline('.')[0:compl_begin]
@@ -120,17 +120,17 @@ function! javascriptcomplete#CompleteJS(findstart, base)
let stris = striprop + strimeth
" User created properties
- let user_props1 = filter(copy(file), 'v:val =~ "this\\.\\w"')
+ let user_props1 = filter(copy(file), 'v:val =~ "this\\.\\k"')
let juser_props1 = join(user_props1, ' ')
let user_props1 = split(juser_props1, '\zethis\.')
unlet! juser_props1
- call map(user_props1, 'matchstr(v:val, "this\\.\\zs\\w\\+\\ze")')
+ call map(user_props1, 'matchstr(v:val, "this\\.\\zs\\k\\+\\ze")')
- let user_props2 = filter(copy(file), 'v:val =~ "\\.prototype\\.\\w"')
+ let user_props2 = filter(copy(file), 'v:val =~ "\\.prototype\\.\\k"')
let juser_props2 = join(user_props2, ' ')
let user_props2 = split(juser_props2, '\zeprototype\.')
unlet! juser_props2
- call map(user_props2, 'matchstr(v:val, "prototype\\.\\zs\\w\\+\\ze")')
+ call map(user_props2, 'matchstr(v:val, "prototype\\.\\zs\\k\\+\\ze")')
let user_props = user_props1 + user_props2
" HTML DOM properties
@@ -394,11 +394,11 @@ function! javascriptcomplete#CompleteJS(findstart, base)
" for regexp "= /re/"
" 4. Make correction for Microsoft.XMLHTTP ActiveXObject
" 5. Repeat for external files
- let object = matchstr(shortcontext, '\zs\w\+\ze\(\[.\{-}\]\)\?\.$')
+ let object = matchstr(shortcontext, '\zs\k\+\ze\(\[.\{-}\]\)\?\.$')
if len(object) > 0
let decl_line = search(object.'.\{-}=\s*new\s*', 'bn')
if decl_line > 0
- let object_type = matchstr(getline(decl_line), object.'.\{-}=\s*new\s*\zs\w\+\ze')
+ let object_type = matchstr(getline(decl_line), object.'.\{-}=\s*new\s*\zs\k\+\ze')
if object_type == 'ActiveXObject' && matchstr(getline(decl_line), object.'.\{-}=\s*new\s*ActiveXObject\s*(.Microsoft\.XMLHTTP.)') != ''
let object_type = 'XMLHttpRequest'
endif
@@ -413,7 +413,7 @@ function! javascriptcomplete#CompleteJS(findstart, base)
if decl_line == 0 && exists("b:js_extfiles")
let dext_line = filter(copy(b:js_extfiles), 'v:val =~ "'.object.'.\\{-}=\\s*new\\s*"')
if len(dext_line) > 0
- let object_type = matchstr(dext_line[-1], object.'.\{-}=\s*new\s*\zs\w\+\ze')
+ let object_type = matchstr(dext_line[-1], object.'.\{-}=\s*new\s*\zs\k\+\ze')
if object_type == 'ActiveXObject' && matchstr(dext_line[-1], object.'.\{-}=\s*new\s*ActiveXObject\s*(.Microsoft\.XMLHTTP.)') != ''
let object_type = 'XMLHttpRequest'
endif
@@ -532,7 +532,7 @@ function! javascriptcomplete#CompleteJS(findstart, base)
" constructs like: var var1, var2, var3 = "something";
for i in range(len(variables))
let comma_separated = split(variables[i], ',\s*')
- call map(comma_separated, 'matchstr(v:val, "\\w\\+")')
+ call map(comma_separated, 'matchstr(v:val, "\\k\\+")')
let vars += comma_separated
endfor
@@ -540,11 +540,11 @@ function! javascriptcomplete#CompleteJS(findstart, base)
unlet! vars
" Add "no var" variables.
- let undeclared_variables = filter(copy(file), 'v:val =~ "^\\s*\\w\\+\\s*="')
+ let undeclared_variables = filter(copy(file), 'v:val =~ "^\\s*\\k\\+\\s*="')
let u_vars = []
for i in range(len(undeclared_variables))
let split_equal = split(undeclared_variables[i], '\s*=')
- call map(split_equal, 'matchstr(v:val, "\\w\\+$")')
+ call map(split_equal, 'matchstr(v:val, "\\k\\+$")')
let u_vars += split_equal
endfor
@@ -554,10 +554,20 @@ function! javascriptcomplete#CompleteJS(findstart, base)
" Get functions
let functions = filter(copy(file), 'v:val =~ "^\\s*function\\s"')
let arguments = copy(functions)
- call map(functions, 'matchstr(v:val, "^\\s*function\\s\\+\\zs\\w\\+")')
+ call map(functions, 'matchstr(v:val, "^\\s*function\\s\\+\\zs\\k\\+")')
call map(functions, 'v:val."("')
let functions = sort(functions)
+ " Create table to keep arguments for additional 'menu' info
+ let b:js_menuinfo = {}
+ for i in arguments
+ let g:ia = i
+ let f_elements = matchlist(i, 'function\s\+\(\k\+\)\s*(\(.\{-}\))')
+ if len(f_elements) == 3
+ let b:js_menuinfo[f_elements[1].'('] = f_elements[2]
+ endif
+ endfor
+
" Get functions arguments
call map(arguments, 'matchstr(v:val, "function.\\{-}(\\zs.\\{-}\\ze)")')
let jargs = join(arguments, ',')
@@ -590,7 +600,26 @@ function! javascriptcomplete#CompleteJS(findstart, base)
endif
endfor
- return res + res2
+ let menu = res + res2
+ let final_menu = []
+ for i in range(len(menu))
+ let item = menu[i]
+ if item =~ '($'
+ let kind = 'f'
+ if has_key(b:js_menuinfo, item)
+ let m_info = b:js_menuinfo[item]
+ else
+ let m_info = ''
+ endif
+ else
+ let kind = 'v'
+ let m_info = ''
+ endif
+ let final_menu += [{'word':item, 'menu':m_info, 'kind':kind}]
+ endfor
+ let g:fm = final_menu
+ return final_menu
+
endfunction
" vim:set foldmethod=marker:
diff --git a/runtime/autoload/xmlcomplete.vim b/runtime/autoload/xmlcomplete.vim
index 0d104a0e9a..22e81a4d93 100644
--- a/runtime/autoload/xmlcomplete.vim
+++ b/runtime/autoload/xmlcomplete.vim
@@ -230,25 +230,42 @@ function! xmlcomplete#CompleteTags(findstart, base)
for m in sort(attrs)
if m =~ '^'.attr
- if tag !~ '^[?!]' && len(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][m]) > 0 && g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][m][0] =~ '^BOOL$'
- call add(res, m)
- elseif m =~ '='
- call add(res, m)
+ call add(res, m)
+ elseif m =~ attr
+ call add(res2, m)
+ endif
+ endfor
+ let menu = res + res2
+ let final_menu = []
+ if has_key(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}, 'vimxmlattrinfo')
+ for i in range(len(menu))
+ let item = menu[i]
+ if has_key(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}['vimxmlattrinfo'], item)
+ let m_menu = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}['vimxmlattrinfo'][item][0]
+ let m_info = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}['vimxmlattrinfo'][item][1]
else
- call add(res, m.'="')
+ let m_menu = ''
+ let m_info = ''
endif
- elseif m =~ attr
- if tag !~ '^[?!]' && len(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][m]) > 0 && g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][m][0] =~ '^BOOL$'
- call add(res, m)
- elseif m =~ '='
- call add(res, m)
+ if tag !~ '^[?!]' && len(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][item]) > 0 && g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][item][0] =~ '^\(BOOL\|'.item.'\)$'
+ let item = item
else
- call add(res2, m.'="')
+ let item .= '="'
endif
- endif
- endfor
-
- return res + res2
+ let final_menu += [{'word':item, 'menu':m_menu, 'info':m_info}]
+ endfor
+ else
+ for i in range(len(menu))
+ let item = menu[i]
+ if tag !~ '^[?!]' && len(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][item]) > 0 && g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][item][0] =~ '^\(BOOL\|'.item.'\)$'
+ let item = item
+ else
+ let item .= '="'
+ endif
+ let final_menu += [item]
+ endfor
+ endif
+ return final_menu
endif
" Close tag
@@ -308,21 +325,36 @@ function! xmlcomplete#CompleteTags(findstart, base)
let tags = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[opentag][0]
let context = substitute(context, '^\k*:', '', '')
- if b:xml_namespace == 'DEFAULT'
- let b:xml_namespace = ''
- else
- let b:xml_namespace .= ':'
- endif
-
for m in tags
if m =~ '^'.context
- call add(res, b:xml_namespace.m)
+ call add(res, m)
elseif m =~ context
- call add(res2, b:xml_namespace.m)
+ call add(res2, m)
endif
endfor
-
- return res + res2
+ let menu = res + res2
+ if has_key(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}, 'vimxmltaginfo')
+ let final_menu = []
+ for i in range(len(menu))
+ let item = menu[i]
+ if has_key(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}['vimxmltaginfo'], item)
+ let m_menu = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}['vimxmltaginfo'][item][0]
+ let m_info = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}['vimxmltaginfo'][item][1]
+ else
+ let m_menu = ''
+ let m_info = ''
+ endif
+ if b:xml_namespace == 'DEFAULT'
+ let xml_namespace = ''
+ else
+ let xml_namespace = b:xml_namespace.':'
+ endif
+ let final_menu += [{'word':xml_namespace.item, 'menu':m_menu, 'info':m_info}]
+ endfor
+ else
+ let final_menu = menu
+ endif
+ return final_menu
endif
endfunction
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index f545fafdce..3688cdae37 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -1,4 +1,4 @@
-*autocmd.txt* For Vim version 7.0aa. Last change: 2006 Feb 09
+*autocmd.txt* For Vim version 7.0aa. Last change: 2006 Feb 13
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -471,6 +471,7 @@ CursorHoldI Just like CursorHold, but in Insert mode.
CursorMoved After the cursor was moved in Normal mode.
Not triggered when there is typeahead or when
an operator is pending.
+ For an example see |match-parens|.
Careful: Don't do anything that the user does
not expect or that is slow.
*CursorMovedI*
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index 676da4bf19..b5283bc1af 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -1,4 +1,4 @@
-*change.txt* For Vim version 7.0aa. Last change: 2005 Dec 16
+*change.txt* For Vim version 7.0aa. Last change: 2006 Feb 13
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1168,12 +1168,18 @@ The next three commands always work on whole lines.
*gq*
gq{motion} Format the lines that {motion} moves over.
- If 'formatprg' is empty formatting is done internally
- and the 'textwidth' option controls the length of each
- formatted line (see below).
+ Formatting is done with one of three methods:
+ 1. If 'formatexpr' is not empty the expression is
+ evaluated. This can differ for each buffer.
+ 2. If 'formatprg' is not mepty an external program
+ is used.
+ 3. Otherise formatting is done internally.
+
+ In the third case the 'textwidth' option controls the
+ length of each formatted line (see below).
If the 'textwidth' option is 0, the formatted line
length is the screen width (with a maximum width of
- 79). {not in Vi}
+ 79).
The 'formatoptions' option controls the type of
formatting |fo-table|.
The cursor is left on the first non-blank of the last
@@ -1193,8 +1199,8 @@ gqq Format the current line. {not in Vi}
*gw*
gw{motion} Format the lines that {motion} moves over. Similar to
|gq| but puts the cursor back at the same position in
- the text. However, 'formatprg' is not used.
- {not in Vi}
+ the text. However, 'formatprg' and 'formatexpr' are
+ not used. {not in Vi}
gwgw *gwgw* *gww*
gww Format the current line as with "gw". {not in Vi}
@@ -1225,9 +1231,10 @@ white space!).
The 'joinspaces' option is used when lines are joined together.
-You can set the 'formatprg' option to the name of an external program for Vim
-to use for text formatting. The 'textwidth' and other options have no effect
-on formatting by an external program.
+You can set the 'formatexpr' option to an expression or the 'formatprg' option
+to the name of an external program for Vim to use for text formatting. The
+'textwidth' and other options have no effect on formatting by an external
+program.
*right-justify*
There is no command in Vim to right justify text. You can do it with
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 5364f60b1a..0f339e1119 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 Feb 10
+*eval.txt* For Vim version 7.0aa. Last change: 2006 Feb 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1203,6 +1203,7 @@ v:count The count given for the last Normal mode command. Can be used
:map _x :<C-U>echo "the count is " . v:count<CR>
< Note: The <C-U> is required to remove the line range that you
get when typing ':' after a count.
+ Also used for evaluating the 'formatexpr' option.
"count" also works, for backwards compatibility.
*v:count1* *count1-variable*
@@ -1624,6 +1625,7 @@ nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum}
nr2char( {expr}) String single char with ASCII value {expr}
prevnonblank( {lnum}) Number line nr of non-blank line <= {lnum}
printf( {fmt}, {expr1}...) String format text
+pumvisible() Number whether popup menu is visible
range( {expr} [, {max} [, {stride}]])
List items from {expr} to {max}
readfile({fname} [, {binary} [, {max}]])
@@ -1647,6 +1649,10 @@ searchdecl({name} [, {global} [, {thisblock}]])
Number search for variable declaration
searchpair( {start}, {middle}, {end} [, {flags} [, {skip}]])
Number search for other end of start/end pair
+searchpairpos( {start}, {middle}, {end} [, {flags} [, {skip}]])
+ List search for other end of start/end pair
+searchpos( {pattern} [, {flags}])
+ List search for {pattern}
server2client( {clientid}, {string})
Number send reply string
serverlist() String get a list of available servers
@@ -3471,6 +3477,15 @@ nr2char({expr}) *nr2char()*
characters. nr2char(0) is a real NUL and terminates the
string, thus results in an empty string.
+prevnonblank({lnum}) *prevnonblank()*
+ Return the line number of the first line at or above {lnum}
+ that is not blank. Example: >
+ let ind = indent(prevnonblank(v:lnum - 1))
+< When {lnum} is invalid or there is no non-blank line at or
+ above it, zero is returned.
+ Also see |nextnonblank()|.
+
+
printf({fmt}, {expr1} ...) *printf()*
Return a String with {fmt}, where "%" items are replaced by
the formatted form of their respective arguments. Example: >
@@ -3598,13 +3613,10 @@ printf({fmt}, {expr1} ...) *printf()*
arguments an error is given. Up to 18 arguments can be used.
-prevnonblank({lnum}) *prevnonblank()*
- Return the line number of the first line at or above {lnum}
- that is not blank. Example: >
- let ind = indent(prevnonblank(v:lnum - 1))
-< When {lnum} is invalid or there is no non-blank line at or
- above it, zero is returned.
- Also see |nextnonblank()|.
+pumvisible() *pumvisible()*
+ Returns non-zero when the popup menu is visible, zero
+ otherwise. See |ins-completion-menu|.
+
*E726* *E727*
range({expr} [, {max} [, {stride}]]) *range()*
@@ -3714,9 +3726,9 @@ remote_send({server}, {string} [, {idvar}])
Send the {string} to {server}. The string is sent as input
keys and the function returns immediately. At the Vim server
the keys are not mapped |:map|.
- If {idvar} is present, it is taken as the name of a
- variable and a {serverid} for later use with
- remote_read() is stored there.
+ If {idvar} is present, it is taken as the name of a variable
+ and a {serverid} for later use with remote_read() is stored
+ there.
See also |clientserver| |RemoteReply|.
This function is not available in the |sandbox|.
{only available when compiled with the |+clientserver| feature}
@@ -3920,6 +3932,27 @@ searchpair({start}, {middle}, {end} [, {flags} [, {skip}]])
:echo searchpair('{', '', '}', 'bW',
\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"')
<
+ *searchpairpos()*
+searchpairpos({start}, {middle}, {end} [, {flags} [, {skip}]])
+ Same as searchpair(), but returns a List with the line and
+ column position of the match. The first element of the List is
+ the line number and the second element is the byte index of
+ the column position of the match. If no match is found,
+ returns [0, 0].
+>
+ :let [lnum,col] = searchpairpos('{', '', '}', 'n')
+<
+ See |match-parens| for a bigger and more useful example.
+
+searchpos({pattern} [, {flags}]) *searchpos()*
+ Same as search(), but returns a List with the line and column
+ position of the match. The first element of the List is the
+ line number and the second element is the byte index of the
+ column position of the match. If no match is found, returns
+ [0, 0].
+>
+ :let [lnum,col] = searchpos('mypattern', 'n')
+<
server2client( {clientid}, {string}) *server2client()*
Send a reply string to {clientid}. The most recent {clientid}
that sent a string can be retrieved with expand("<client>").
diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt
index ea87249a1e..066cfd496c 100644
--- a/runtime/doc/gui.txt
+++ b/runtime/doc/gui.txt
@@ -1,4