diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-09-13 21:20:47 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-09-13 21:20:47 +0000 |
commit | f75a963eea9a893bb60c0b8eb425b2161de4919f (patch) | |
tree | 60f6d73ec091dc053cdaf4a0c0dc2f5465ef3359 /runtime | |
parent | 5e0d6678adf1dfff841acdd7f7424d565e63fbcc (diff) | |
download | vim-f75a963eea9a893bb60c0b8eb425b2161de4919f.zip |
updated for version 7.0146
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/autoload/ccomplete.vim | 134 | ||||
-rw-r--r-- | runtime/autoload/htmlcomplete.vim | 243 | ||||
-rw-r--r-- | runtime/autoload/netrw.vim | 114 | ||||
-rw-r--r-- | runtime/doc/digraph.txt | 5 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 20 | ||||
-rw-r--r-- | runtime/doc/insert.txt | 28 | ||||
-rw-r--r-- | runtime/doc/options.txt | 8 | ||||
-rw-r--r-- | runtime/doc/pattern.txt | 10 | ||||
-rw-r--r-- | runtime/doc/pi_netrw.txt | 47 | ||||
-rw-r--r-- | runtime/doc/quickref.txt | 4 | ||||
-rw-r--r-- | runtime/doc/spell.txt | 4 | ||||
-rw-r--r-- | runtime/doc/syntax.txt | 4 | ||||
-rw-r--r-- | runtime/doc/tags | 14 | ||||
-rw-r--r-- | runtime/doc/todo.txt | 30 | ||||
-rw-r--r-- | runtime/doc/version7.txt | 24 | ||||
-rw-r--r-- | runtime/ftplugin/html.vim | 2 | ||||
-rw-r--r-- | runtime/optwin.vim | 4 | ||||
-rw-r--r-- | runtime/spell/ru/ru_RU.diff | 6 | ||||
-rw-r--r-- | runtime/spell/ru/ru_YO.diff | 6 | ||||
-rw-r--r-- | runtime/syntax/vim.vim | 2 |
20 files changed, 570 insertions, 139 deletions
diff --git a/runtime/autoload/ccomplete.vim b/runtime/autoload/ccomplete.vim index c8e258d05..c71852530 100644 --- a/runtime/autoload/ccomplete.vim +++ b/runtime/autoload/ccomplete.vim @@ -1,10 +1,10 @@ " Vim completion script " Language: C " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2005 Sep 10 +" Last Change: 2005 Sep 13 -" This function is used for the 'occultfunc' option. +" This function is used for the 'omnifunc' option. function! ccomplete#Complete(findstart, base) if a:findstart " Locate the start of the item, including "." and "->". @@ -38,12 +38,12 @@ function! ccomplete#Complete(findstart, base) " 2. in tags file(s) (like with ":tag") " 3. in current file (like with "gD") let res = [] - if searchdecl(items[0]) == 0 + if searchdecl(items[0], 0, 1) == 0 " Found, now figure out the type. " TODO: join previous line if it makes sense let line = getline('.') let col = col('.') - let res = ccomplete#Nextitem(strpart(line, 0, col), items[1:]) + let res = s:Nextitem(strpart(line, 0, col), items[1:]) endif if len(res) == 0 @@ -54,7 +54,7 @@ function! ccomplete#Complete(findstart, base) for i in range(len(diclist)) " New ctags has the "typename" field. if has_key(diclist[i], 'typename') - call extend(res, ccomplete#StructMembers(diclist[i]['typename'], items[1:])) + call extend(res, s:StructMembers(diclist[i]['typename'], items[1:])) endif " For a variable use the command, which must be a search pattern that @@ -63,7 +63,7 @@ function! ccomplete#Complete(findstart, base) let line = diclist[i]['cmd'] if line[0] == '/' && line[1] == '^' let col = match(line, items[0]) - call extend(res, ccomplete#Nextitem(strpart(line, 2, col - 2), items[1:]) + call extend(res, s:Nextitem(strpart(line, 2, col - 2), items[1:])) endif endif endfor @@ -74,19 +74,30 @@ function! ccomplete#Complete(findstart, base) " TODO: join previous line if it makes sense let line = getline('.') let col = col('.') - let res = ccomplete#Nextitem(strpart(line, 0, col), items[1:]) + let res = s:Nextitem(strpart(line, 0, col), items[1:]) + endif + + " If the one and only match was what's already there and it is a composite + " type, add a "." or "->". + if len(res) == 1 && res[0]['match'] == items[-1] && len(s:SearchMembers(res, [''])) > 0 + " If there is a '*' before the name use "->". + if match(res[0]['tagline'], '\*\s*' . res[0]['match']) > 0 + let res[0]['match'] .= '->' + else + let res[0]['match'] .= '.' + endif endif " The basetext is up to the last "." or "->" and won't be changed. The " matching members are concatenated to this. let basetext = matchstr(a:base, '.*\(\.\|->\)') - return map(res, 'basetext . v:val') + return map(res, 'basetext . v:val["match"]') endfunc " Find composing type in "lead" and match items[0] with it. " Repeat this recursively for items[1], if it's there. " Return the list of matches. -function! ccomplete#Nextitem(lead, items) +function! s:Nextitem(lead, items) " Use the text up to the variable name and split it in tokens. let tokens = split(a:lead, '\s\+\|\<') @@ -97,7 +108,7 @@ function! ccomplete#Nextitem(lead, items) " Recognize "struct foobar" and "union foobar". if (tokens[tidx] == 'struct' || tokens[tidx] == 'union') && tidx + 1 < len(tokens) - let res = ccomplete#StructMembers(tokens[tidx] . ':' . tokens[tidx + 1], a:items) + let res = s:StructMembers(tokens[tidx] . ':' . tokens[tidx + 1], a:items) break endif @@ -108,20 +119,42 @@ function! ccomplete#Nextitem(lead, items) " Use the tags file to find out if this is a typedef. let diclist = taglist('^' . tokens[tidx] . '$') - for i in range(len(diclist)) + for tagidx in range(len(diclist)) " New ctags has the "typename" field. - if has_key(diclist[i], 'typename') - call extend(res, ccomplete#StructMembers(diclist[i]['typename'], a:items)) + if has_key(diclist[tagidx], 'typename') + call extend(res, s:StructMembers(diclist[tagidx]['typename'], a:items)) + continue + endif + + " Only handle typedefs here. + if diclist[tagidx]['kind'] != 't' continue endif - " For old ctags we only recognize "typedef struct foobar" in the tags - " file command. - let cmd = diclist[i]['cmd'] - let ci = matchend(cmd, 'typedef\s\+struct\s\+') - if ci > 1 - let name = matchstr(cmd, '\w*', ci) - call extend(res, ccomplete#StructMembers('struct:' . name, a:items)) + " For old ctags we recognize "typedef struct aaa" and + " "typedef union bbb" in the tags file command. + let cmd = diclist[tagidx]['cmd'] + let ei = matchend(cmd, 'typedef\s\+') + if ei > 1 + let cmdtokens = split(strpart(cmd, ei), '\s\+\|\<') + if len(cmdtokens) > 1 + if cmdtokens[0] == 'struct' || cmdtokens[0] == 'union' + let name = '' + " Use the first identifier after the "struct" or "union" + for ti in range(len(cmdtokens) - 1) + if cmdtokens[ti] =~ '^\w' + let name = cmdtokens[ti] + break + endif + endfor + if name != '' + call extend(res, s:StructMembers(cmdtokens[0] . ':' . name, a:items)) + endif + else + " Could be "typedef other_T some_T". + call extend(res, s:Nextitem(cmdtokens[0], a:items)) + endif + endif endif endfor if len(res) > 0 @@ -133,12 +166,13 @@ function! ccomplete#Nextitem(lead, items) endfunction -" Return a list with resulting matches -function! ccomplete#StructMembers(typename, items) +" Return a list with resulting matches. +" Each match is a dictionary with "match" and "tagline" entries. +function! s:StructMembers(typename, items) " Todo: What about local structures? let fnames = join(map(tagfiles(), 'escape(v:val, " \\")')) if fnames == '' - return [[], []] + return [] endif let typename = a:typename @@ -153,45 +187,49 @@ function! ccomplete#StructMembers(typename, items) let typename = substitute(typename, ':[^:]*::', ':', '') endwhile - let members = [] - let taglines = [] + let matches = [] for l in qflist let memb = matchstr(l['text'], '[^\t]*') if memb =~ '^' . a:items[0] - call add(members, memb) - call add(taglines, l['text']) + call add(matches, {'match': memb, 'tagline': l['text']}) endif endfor - if len(members) > 0 + if len(matches) > 0 " No further items, return the result. if len(a:items) == 1 - return members + return matches endif " More items following. For each of the possible members find the " matching following members. - let res = [] - for i in range(len(members)) - let line = taglines[i] - let e = matchend(line, '\ttypename:') - if e > 0 - " Use typename field - let name = matchstr(line, '[^\t]*', e) - call extend(res, ccomplete#StructMembers(name, a:items[1:])) - else - let s = match(line, '\t\zs/^') - if s > 0 - let e = match(line, members[i], s) - if e > 0 - call extend(res, ccomplete#Nextitem(strpart(line, s, e - s), a:items[1:])) - endif - endif - endif - endfor - return res + return s:SearchMembers(matches, a:items[1:]) endif " Failed to find anything. return [] endfunction + +" For matching members, find matches for following items. +function! s:SearchMembers(matches, items) + let res = [] + for i in range(len(a:matches)) + let line = a:matches[i]['tagline'] + let e = matchend(line, '\ttypename:') + if e > 0 + " Use typename field + let name = matchstr(line, '[^\t]*', e) + call extend(res, s:StructMembers(name, a:items)) + else + " Use the search command (the declaration itself). + let s = match(line, '\t\zs/^') + if s > 0 + let e = match(line, a:matches[i]['match'], s) + if e > 0 + call extend(res, s:Nextitem(strpart(line, s, e - s), a:items)) + endif + endif + endif + endfor + return res +endfunc diff --git a/runtime/autoload/htmlcomplete.vim b/runtime/autoload/htmlcomplete.vim new file mode 100644 index 000000000..d80e1ebb9 --- /dev/null +++ b/runtime/autoload/htmlcomplete.vim @@ -0,0 +1,243 @@ +" Vim completion script +" Language: XHTML 1.0 Strict +" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) +" Last Change: 2005 Sep 13 + +function! htmlcomplete#CompleteTags(findstart, base) + if a:findstart + " locate the start of the word + let line = getline('.') + let start = col('.') - 1 + while start >= 0 && line[start - 1] !~ '<' + let start -= 1 + endwhile + let g:st = start + return start + else + " Set attribute groups + let g:coreattrs = ["id", "class", "style", "title"] + let g:i18n = ["lang", "xml:lang", "dir"] + let g:events = ["onclick", "ondblclick", "onmousedown", "onmouseup", "onmousemove", + \ "onmouseout", "onkeypress", "onkeydown", "onkeyup"] + let g:focus = ["accesskey", "tabindex", "onfocus", "onblur"] + let g:coregroup = g:coreattrs + let g:coregroup = extend(g:coregroup, g:i18n) + let g:coregroup = extend(g:coregroup, g:events) + " find tags matching with "a:base" + let res = [] + " If a:base contains > it means we are already outside of tag and we + " should abandon action + if a:base =~ '>' + return [] + endif + " If a:base contains white space it is attribute. + " It could be also value of attribute... + " Possible situations where any prediction would be difficult: + " 1. Events attributes + if a:base =~ '\s' + " Sort out style, class, and on* cases + " Perfect solution for style would be switching for CSS completion. Is + " it possible? + " Also retrieving class names from current file and linked + " stylesheets. + if a:base =~ "\\(on[a-z]*\\|style\\|class\\)\\s*=\\s*[\"']" + let stripbase = matchstr(a:base, ".*\\(on[a-z]*\\|style\\|class\\)\\s*=\\s*[\"']\\zs.*") + " Now we have a:base stripped from all chars up to style/class. + " It may fail with some strange style value combinations. + if stripbase !~ "[\"']" + return [] + endif + endif + " We have to get first word to offer + " proper attributes. + let tag = split(a:base)[0] + " Get last word, it should be attr name + let attr = matchstr(a:base, '.*\s\zs.*') + " If attr contains =\s*[\"'] we catched value of attribute + if attr =~ "=\s*[\"']" + " Let do attribute specific completion + 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' + if a:base =~ '^a\>' + let values = ["rect"] + else + let values = ["rect", "circle", "poly", "default"] + endif + elseif attrname == 'valuetype' + let values = ["data", "ref", "object"] + elseif attrname == 'method' + let values = ["get", "post"] + 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' + " Now we are looking for local anchors defined by name or id + if entered_value =~ '^#' + let file = join(getline(1, line('$')), ' ') + " Split it be sure there will be one id/name element in + " item, it will be also first word [a-zA-Z0-9_-] in element + let oneelement = split(file, "\\(meta \\)\\@<!\\(name\\|id\\)\\s*=\\s*[\"']") + for i in oneelement + let values += ['#'.matchstr(i, "^[a-zA-Z][a-zA-Z0-9%_-]*")] + endfor + endif + elseif attrname == 'type' + if a:base =~ '^input' + let values = ["input-text", "password", "checkbox", "radio", "submit", "reset", "input-file", "hidden", "input-image", "input-button"] + elseif a:base =~ '^button' + let values = ["button", "submit", "reset"] + endif + else + return [] + endif + + if len(values) == 0 + return [] + endif + + " We need special version of sbase + let attrbase = matchstr(a:base, ".*[\"']") + + for m in values + if m =~ '^' . entered_value + call add(res, attrbase . m . '" ') + endif + endfor + endif + " Shorten a:base to not include last word + let sbase = matchstr(a:base, '.*\ze\s.*') + if tag =~ '^\(abbr\|acronym\|b\|bdo\|big\|caption\|cite\|code\|dd\|dfn\|div\|dl\|dt\|em\|fieldset\|h\d\|kbd\|li\|noscript\|ol\|p\|samp\|small\|span\|strong\|sub\|sup\|tt\|ul\|var\)$' + let attrs = g:coregroup + elseif tag == 'a' + let tagspec = ["charset", "type", "name", "href", "hreflang", "rel", "rev", "shape", "coords"] + let attrs = extend(tagspec, g:coregroup) + let attrs = extend(attrs, g:focus) + elseif tag == 'area' + let attrs = g:coregroup + elseif tag == 'base' + let attrs = ["href", "id"] + elseif tag == 'blockquote' + let attrs = g:coregroup + let attrs = extend(attrs, ["cite"]) + elseif tag == 'body' + let attrs = g:coregroup + let attrs = extend(attrs, ["onload", "onunload"]) + elseif tag == 'br' + let attrs = g:coreattrs + elseif tag == 'button' + let attrs = g:coreattrs + let attrs = extend(attrs, g:focus) + let attrs = extend(attrs, ["name", "value", "type"]) + elseif tag == '^\(col\|colgroup\)$' + let attrs = g:coreattrs + let attrs = extend(attrs, ["span", "width", "align", "char", "charoff", "valign"]) + elseif tag =~ '^\(del\|ins\)$' + let attrs = g:coreattrs + let attrs = extend(attrs, ["cite", "datetime"]) + elseif tag == 'form' + let attrs = g:coreattrs + let attrs = extend(attrs, ["action", "method", "enctype", "onsubmit", "onreset", "accept", "accept-charset"]) + elseif tag == 'head' + let attrs = g:i18n + let attrs = extend(attrs, ["id", "profile"]) + elseif tag == 'html' + let attrs = g:i18n + let attrs = extend(attrs, ["id", "xmlns"]) + elseif tag == 'img' + let attrs = g:coreattrs + let attrs = extend(attrs, ["src", "alt", "longdesc", "height", "width", "usemap", "ismap"]) + elseif tag == 'input' + let attrs = g:coreattrs + let attrs = extend(attrs, g:focus) + let attrs = extend(attrs, ["type", "name", "value", "checked", "disabled", "readonly", "size", "maxlength", "src", "alt", "usemap", "onselect", "onchange", "accept"]) + elseif tag == 'label' + let attrs = g:coreattrs + let attrs = extend(attrs, ["for", "accesskey", "onfocus", "onblur"]) + elseif tag == 'legend' + let attrs = g:coreattrs + let attrs = extend(attrs, ["accesskey"]) + elseif tag == 'link' + let attrs = g:coreattrs + let attrs = extend(attrs, ["charset", "href", "hreflang", "type", "rel", "rev", "media"]) + elseif tag == 'map' + let attrs = g:i18n + let attrs = extend(attrs, g:events) + let attrs = extend(attrs, ["id", "class", "style", "title", "name"]) + elseif tag == 'meta' + let attrs = g:i18n + let attrs = extend(attrs, ["id", "http-equiv", "content", "scheme", "name"]) + elseif tag == 'title' + let attrs = g:i18n + let attrs = extend(attrs, ["id"]) + elseif tag == 'object' + let attrs = g:coreattrs + let attrs = extend(attrs, ["declare", "classid", "codebase", "data", "type", "codetype", "archive", "standby", "height", "width", "usemap", "name", "tabindex"]) + elseif tag == 'optgroup' + let attrs = g:coreattrs + let attrs = extend(attrs, ["disbled", "label"]) + elseif tag == 'option' + let attrs = g:coreattrs + let attrs = extend(attrs, ["disbled", "selected", "value", "label"]) + elseif tag == 'param' + let attrs = ["id", "name", "value", "valuetype", "type"] + elseif tag == 'pre' + let attrs = g:coreattrs + let attrs = extend(attrs, ["xml:space"]) + elseif tag == 'q' + let attrs = g:coreattrs + let attrs = extend(attrs, ["cite"]) + elseif tag == 'script' + let attrs = ["id", "charset", "type", "src", "defer", "xml:space"] + elseif tag == 'select' + let attrs = g:coreattrs + let attrs = extend(attrs, ["name", "size", "multiple", "disabled", "tabindex", "onfocus", "onblur", "onchange"]) + elseif tag == 'style' + let attrs = g:coreattrs + let attrs = extend(attrs, ["id", "type", "media", "title", "xml:space"]) + elseif tag == 'table' + let attrs = g:coreattrs + let attrs = extend(attrs, ["summary", "width", "border", "frame", "rules" "cellspacing", "cellpadding"]) + elseif tag =~ '^\(thead\|tfoot\|tbody\|tr\)$' + let attrs = g:coreattrs + let attrs = extend(attrs, ["align", "char", "charoff", "valign"]) + elseif tag == 'textarea' + let attrs = g:coreattrs + let attrs = extend(attrs, g:focus) + let attrs = extend(attrs, ["name", "rows", "cols", "disabled", "readonly", "onselect", "onchange"]) + elseif tag =~ '^\(th\|td\)$' + let attrs = g:coreattrs + let attrs = extend(attrs, ["abbr", "headers", "scope", "rowspan", "colspan", "align", "char", "charoff", "valign"]) + endif + + for m in sort(attrs) + if m =~ '^' . attr + if m =~ '^\(ismap\|defer\|declare\|nohref\|checked\|disabled\|selected\|readonly\)$' + call add(res, sbase.' '.m) + else + call add(res, sbase.' '.m.'="') + endif + endif + endfor + return res + endif + for m in split("a abbr acronym address area b base bdo big blockquote body br button caption cite code col colgroup dd del dfn div dl dt em fieldset form head h1 h2 h3 h4 h5 h6 hr html i img input ins kbd label legend li link map meta noscript object ol optgroup option p param pre q samp script select small span strong style sub sup table tbody td textarea tfoot th thead title tr tt ul var") + if m =~ '^' . a:base + call add(res, m) + endif + endfor + return res + endif +endfunction diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index 37dd13dfa..c7434af9b 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -1,7 +1,7 @@ " netrw.vim: Handles file transfer and remote directory listing across a network " AUTOLOAD PORTION -" Date: Sep 09, 2005 -" Version: 69 +" Date: Sep 12, 2005 +" Version: 70 " Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz> " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1 @@ -26,7 +26,7 @@ if v:version < 700 echohl WarningMsg | echo "***netrw*** you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw" | echohl None finish endif -let g:loaded_netrw = "v69" +let g:loaded_netrw = "v70" let s:keepcpo = &cpo set cpo&vim " call Decho("doing autoload/netrw.vim") @@ -1143,7 +1143,7 @@ fun! s:NetBrowse(dirname) keepjumps 1d " save certain window-oriented variables into buffer-oriented variables - call s:BufWinVars() + call s:SetBufWinVars() call s:NetOptionRestore() setlocal nomod @@ -2237,12 +2237,10 @@ endfun " --------------------------------------------------------------------- " NetObtain: obtain file under cursor (for remote browsing support) {{{2 fun! s:NetObtain() - if !exists("s:netrw_users_stl") - let s:netrw_users_stl= &stl - endif let fname= expand("<cWORD>") - exe 'set stl=%f\ %h%m%r%=Obtaining\ '.escape(fname,' ') - redraw! + + " NetrwStatusLine support - for obtaining support + call s:SetupNetrwStatusLine('%f %h%m%r%=%9*Obtaining '.fname) " call Dfunc("NetObtain() method=".w:netrw_method) if exists("w:netrw_method") && w:netrw_method =~ '[235]' @@ -2320,6 +2318,8 @@ fun! s:NetObtain() echohl Error | echo "***netrw*** this system doesn't support ftp" | echohl None call inputsave()|call input("Press <cr> to continue")|call inputrestore() endif + let &stl = s:netrw_users_stl + let &laststatus = s:netrw_users_ls " call Dret("NetObtain") return endif @@ -2343,7 +2343,8 @@ fun! s:NetObtain() endif " restore status line - let &stl= s:netrw_users_stl + let &stl = s:netrw_users_stl + let &laststatus = s:netrw_users_ls redraw! " call Dret("NetObtain") @@ -2611,7 +2612,7 @@ fun! netrw#DirBrowse(dirname) let w:netrw_prvdir= b:netrw_curdir " save certain window-oriented variables into buffer-oriented variables - call s:BufWinVars() + call s:SetBufWinVars() call s:NetOptionRestore() setlocal noma nomod nonu bh=hide nobl @@ -3042,12 +3043,8 @@ fun! netrw#Explore(indx,dosplit,style,...) endif endif - " NetrwStatusLine support + " NetrwStatusLine support - for exploring support let w:netrw_explore_indx= indx - if !exists("s:netrw_users_stl") - let s:netrw_users_stl= &stl - endif - set stl=%f\ %h%m%r%=%{NetrwStatusLine()} " call Decho("explorelist<".join(w:netrw_explore_list,',')."> len=".w:netrw_explore_listlen) " sanity check @@ -3060,15 +3057,21 @@ fun! netrw#Explore(indx,dosplit,style,...) endif exe "let dirfile= w:netrw_explore_list[".indx."]" -" call Decho("dirfile<".dirfile."> indx=".indx) +" call Decho("dirfile=w:netrw_explore_list[indx=".indx."]= <".dirfile.">") let newdir= substitute(dirfile,'/[^/]*$','','e') " call Decho("newdir<".newdir.">") + " call Decho("calling LocalBrowse(newdir<".newdir.">)") call s:LocalBrowse(newdir) - call search(substitute(dirfile,"^.*/","",""),"W") + if w:netrw_longlist == 0 || w:netrw_longlist == 1 + call search('^'.substitute(dirfile,"^.*/","","").'\>',"W") + else + call search('\<'.substitute(dirfile,"^.*/","","").'\>',"w") + endif let w:netrw_explore_mtchcnt = indx + 1 let w:netrw_explore_bufnr = bufnr(".") let w:netrw_explore_line = line(".") + call s:SetupNetrwStatusLine('%f %h%m%r%=%9*%{NetrwStatusLine()}') " call Decho("explore: mtchcnt=".w:netrw_explore_mtchcnt." bufnr=".w:netrw_explore_bufnr." line#".w:netrw_explore_line) else @@ -3088,12 +3091,73 @@ fun! netrw#Explore(indx,dosplit,style,...) endfun " --------------------------------------------------------------------- +" SetupNetrwStatusLine: {{{2 +fun! s:SetupNetrwStatusLine(statline) +" call Dfunc("SetupNetrwStatusLine(statline<".a:statline.">)") + + if !exists("s:netrw_setup_statline") + let s:netrw_setup_statline= 1 +" call Decho("do first-time status line setup") + + if !exists("s:netrw_users_stl") + let s:netrw_users_stl= &stl + endif + if !exists("s:netrw_users_ls") + let s:netrw_users_ls= &laststatus + endif + + " set up User9 highlighting as needed + let keepa= @a + redir @a + try + hi User9 + catch /^Vim\%((\a\+)\)\=:E411/ + if &bg == "dark" + hi User9 ctermfg=yellow ctermbg=blue guifg=yellow guibg=blue + else + hi User9 ctermbg=yellow ctermfg=blue guibg=yellow guifg=blue + endif + endtry + redir END + let @a= keepa + endif + + " set up status line (may use User9 highlighting) + " insure that windows have a statusline + " make sure statusline is displayed + let &stl=a:statline + set laststatus=2 +" call Decho("stl=".&stl) + redraw! + +" call Dret("SetupNetrwStatusLine : stl=".&stl) +endfun + +" --------------------------------------------------------------------- " NetrwStatusLine: {{{2 fun! NetrwStatusLine() -" let g:stlmsg= "Xbufnr=".w:netrw_explore_bufnr." bufnr=".bufnr(".")." Xline#".w:netrw_explore_line." line#".line(".") + + " vvv NetrwStatusLine() debugging vvv +" let g:stlmsg="" +" if !exists("w:netrw_explore_bufnr") +" let g:stlmsg="!X<explore_bufnr>" +" elseif w:netrw_explore_bufnr != bufnr(".") +" let g:stlmsg="explore_bufnr!=".bufnr(".") +" endif +" if !exists("w:netrw_explore_line") +" let g:stlmsg=" !X<explore_line>" +" elseif w:netrw_explore_line != line(".") +" let g:stlmsg=" explore_line!={line(.)<".line(".").">" +" endif +" if !exists("w:netrw_explore_list") +" let g:stlmsg=" !X<explore_list>" +" endif + " ^^^ NetrwStatusLine() debugging ^^^ + if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr(".") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list") " restore user's status line - let &stl= s:netrw_users_stl + let &stl = s:netrw_users_stl + let &laststatus = s:netrw_users_ls if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif if exists("w:netrw_explore_line")|unlet w:netrw_explore_line|endif return "" @@ -3591,14 +3655,14 @@ fun! s:CopyWinVars() endfun " --------------------------------------------------------------------- -" BufWinVars: (used by NetBrowse() and LocalBrowse()) {{{1 +" SetBufWinVars: (used by NetBrowse() and LocalBrowse()) {{{1 " To allow separate windows to have their own activities, such as " Explore **/pattern, several variables have been made window-oriented. " However, when the user splits a browser window (ex: ctrl-w s), these -" variables are not inherited by the new window. BufWinVars() and +" variables are not inherited by the new window. SetBufWinVars() and " UseBufWinVars() get around that. -fun! s:BufWinVars() -" call Dfunc("BufWinVars()") +fun! s:SetBufWinVars() +" call Dfunc("SetBufWinVars()") if exists("w:netrw_longlist") |let b:netrw_longlist = w:netrw_longlist |endif if exists("w:netrw_bannercnt") |let b:netrw_bannercnt = w:netrw_bannercnt |endif if exists("w:netrw_method") |let b:netrw_method = w:netrw_method |endif @@ -3609,7 +3673,7 @@ fun! s:BufWinVars() if exists("w:netrw_explore_bufnr") |let b:netrw_explore_bufnr = w:netrw_explore_bufnr |endif if exists("w:netrw_explore_line") |let b:netrw_explore_line = w:netrw_explore_line |endif if exists("w:netrw_explore_list") |let b:netrw_explore_list = w:netrw_explore_list |endif -" call Dret("BufWinVars") +" call Dret("SetBufWinVars") endfun " --------------------------------------------------------------------- diff --git a/runtime/doc/digraph.txt b/runtime/doc/digraph.txt index 201d6a0e5..c75708ebc 100644 --- a/runtime/doc/digraph.txt +++ b/runtime/doc/digraph.txt @@ -1,4 +1,4 @@ -*digraph.txt* For Vim version 7.0aa. Last change: 2005 Mar 06 +*digraph.txt* For Vim version 7.0aa. Last change: 2005 Sep 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -166,7 +166,8 @@ EURO Exception: RFC1345 doesn't specify the euro sign. In Vim the digraph =e was added for this. Note the difference between latin1, where the digraph Cu is used for the currency sign, and latin9 (iso-8859-15), where the digraph =e is -used for the euro sign, while both of them are the character 164, 0xa4. +used for the euro sign, while both of them are the character 164, 0xa4. For +compatibility with zsh Eu can also be used for the euro sign. *digraph-table* char digraph hex dec official name ~ diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index c7fee8347..6e3d26cf5 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.0aa. Last change: 2005 Sep 10 +*eval.txt* For Vim version 7.0aa. Last change: 2005 Sep 12 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1607,7 +1607,8 @@ repeat( {expr}, {count}) String repeat {expr} {count} times resolve( {filename}) String get filename a shortcut points to reverse( {list}) List reverse {list} in-place search( {pattern} [, {flags}]) Number search for {pattern} -searchdecl({name} [, {global}]) Number search for variable declaration +searchdecl({name} [, {global} [, {thisblock}]]) + Number search for variable declaration searchpair( {start}, {middle}, {end} [, {flags} [, {skip}]]) Number search for other end of start/end pair server2client( {clientid}, {string}) @@ -3730,10 +3731,17 @@ search({pattern} [, {flags}]) *search()* :endwhile < -searchdecl({name} [, {global}]) *searchdecl()* - Search for the declaration of {name}. Without {global} or - with a zero {global} argument this works like |gd|. With a - non-zero {global} argument it works like |gD|. +searchdecl({name} [, {global} [, {thisblock}]]) *searchdecl()* + Search for the declaration of {name}. + + With a non-zero {global} argument it works like |gD|, find + first match in the file. Otherwise it works like |gd|, find + first match in the function. + + With a non-zero {thisblock} argument matches in a {} block + that ends before the cursor position are ignored. Avoids + finding variable declarations only valid in another scope. + Moves the cursor to the found match. Returns zero for success, non-zero for failure. Example: > diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index 324730556..97641079a 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1,4 +1,4 @@ -*insert.txt* For Vim version 7.0aa. Last change: 2005 Sep 10 +*insert.txt* For Vim version 7.0aa. Last change: 2005 Sep 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -569,7 +569,7 @@ Completion can be done for: 8. definitions or macros |i_CTRL-X_CTRL-D| 9. Vim command-line |i_CTRL-X_CTRL-V| 10. User defined completion |i_CTRL-X_CTRL-U| -11. Occult completion |i_CTRL-X_CTRL-O| +11. omni completion |i_CTRL-X_CTRL-O| 12. Spelling suggestions |i_CTRL-X_s| 13. keywords in 'complete' |i_CTRL-N| @@ -674,6 +674,9 @@ at least two characters is matched. just type: printf("(%g, %g, %g)", vector[0], ^P[1], ^P[2]); +The search wraps around the end of the file, the value of 'wrapscan' is not +used here. + Multiple repeats of the same completion are skipped; thus a different match will be inserted at each CTRL-N and CTRL-P (unless there is only one matching keyword). @@ -882,13 +885,13 @@ CTRL-X CTRL-U Guess what kind of item is in front of the cursor and previous one. -Occult completion *compl-occult* +Omni completion *compl-omni* Completion is done by a function that can be defined by the user with the -'occultfunc' option. This is to be used for filetype-specific completion. +'omnifunc' option. This is to be used for filetype-specific completion. See the 'completefunc' help for how the function is called and an example. -For remarks about specific filetypes see |compl-occult-filetypes|. +For remarks about specific filetypes see |compl-omni-filetypes|. *i_CTRL-X_CTRL-O* CTRL-X CTRL-O Guess what kind of item is in front of the cursor and @@ -949,14 +952,14 @@ CTRL-P Find previous match for words that start with the other contexts unless a double CTRL-X is used. -Filetype-specific remarks for occult completion *compl-occult-filetypes* +Filetype-specific remarks for omni completion *compl-omni-filetypes* -C *ft-c-occult* +C *ft-c-omni* -Completion requires a tags file. You should use Exuberant ctags, because it -adds extra information that is needed for completion. You can find it here: -http://ctags.sourceforge.net/ -For version 5.5.4 you need to add a patch that adds the "typename:" field: +Completion of C code requires a tags file. You should use Exuberant ctags, +because it adds extra information that is needed for completion. You can find +it here: http://ctags.sourceforge.net/ +For version 5.5.4 you should add a patch that adds the "typename:" field: ftp://ftp.vim.org/pub/vim/unstable/patches/ctags-5.5.4.patch If you want to complete system functions you can do something like this. Use @@ -974,6 +977,9 @@ When using CTRL-X CTRL-O after something that has "." or "->" Vim will attempt to recognize the type of the variable and figure out what members it has. This means only members valid for the variable will be listed. +When a member name already was complete, CTRL-X CTRL-O will add a "." or +"->" for composite types. + Vim doesn't include a C compiler, only the most obviously formatted declarations are recognized. Preprocessor stuff may cause confusion. When the same structure name appears in multiple places all possible members diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 91076157f..7cc817043 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.0aa. Last change: 2005 Sep 10 +*options.txt* For Vim version 7.0aa. Last change: 2005 Sep 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -19,7 +19,7 @@ achieve special effects. These options come in three forms: string has a string value ============================================================================== -1. Setting options *set-option* +1. Setting options *set-option* *E764* *:se* *:set* :se[t] Show all options that differ from their default value. @@ -4602,8 +4602,8 @@ A jump table for the options with a short description can be found at |Q_op|. The minimum value is 1, the maximum value is 10. NOTE: 'numberwidth' is reset to 8 when 'compatible' is set. - *'occultfunc'* *'ofu'* -'occultfunc' 'ofu' string (default: empty) + *'omnifunc'* *'ofu'* +'omnifunc' 'ofu' string (default: empty) local to buffer {not in Vi} {not available when compiled without the +eval diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index 84e9bf517..2cc592189 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -1,4 +1,4 @@ -*pattern.txt* For Vim version 7.0aa. Last change: 2005 Aug 18 +*pattern.txt* For Vim version 7.0aa. Last change: 2005 Sep 12 VIM REFERENCE MANUAL by Bram Moolenaar @@ -117,6 +117,14 @@ gD Goto global Declaration. When the cursor is on a like "gd", except that the search for the keyword always starts in line 1. {not in Vi} + *1gd* +1gd Like "gd", but ignore matches inside a {} block that + ends before the cursor position. {not in Vi} + + *1gD* +1gD Like "gD", but ignore matches inside a {} block that + ends before the cursor position. {not in Vi} + *CTRL-C* CTRL-C Interrupt current (search) command. Use CTRL-Break on MS-DOS |dos-CTRL-Break|. diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index e5696e75f..4d446f692 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -1,4 +1,4 @@ -*pi_netrw.txt* For Vim version 7.0. Last change: Sep 07, 2005 +*pi_netrw.txt* For Vim version 7.0. Last change: Sep 12, 2005 VIM REFERENCE MANUAL by Charles E. Campbell, Jr. @@ -333,6 +333,7 @@ after one has set it. Unfortunately there doesn't appear to be a way for netrw to feed a password to scp. Thus every transfer via scp will require re-entry of the password. +However, |netrw-listhack| can help with this problem. ============================================================================== @@ -341,20 +342,27 @@ scp. Thus every transfer via scp will require re-entry of the password. Network-oriented file transfers are available by default whenever |'nocompatible'| mode is enabled. The <netrw.vim> file resides in your system's vim-plugin directory and is sourced automatically whenever you bring -up vim. - +up vim. I suggest that, at a minimum, you have at least the following in your +<.vimrc> customization file: > + set nocp + if version >= 600 + filetype plugin indent on + endif +< ============================================================================== 4. Transparent File Transfer *netrw-transparent* Transparent file transfers occur whenever a regular file read or write (invoked via an |:autocmd| for |BufReadCmd| or |BufWriteCmd| events) is made. -Thus one may use files across networks as if they were local. > +Thus one may use files across networks just as simply as if they were local. > vim ftp://[user@]machine/path ... :wq +See |netrw-activate| for more on how to encourage your vim to use plugins +such as netrw. ============================================================================== 5. Ex Commands *netrw-ex* @@ -368,8 +376,7 @@ additional commands available. :[range]Nw {netfile} [{netfile}]... Write the specified lines to the {netfile}. -:Nread - Read the specified lines into the current +:Nread Read the specified lines into the current buffer from the file specified in b:netrw_lastfile. @@ -400,10 +407,11 @@ additional commands available. The script <netrw.vim> uses several variables which can affect <netrw.vim>'s behavior. These variables typically may be set in the user's <.vimrc> file: -> - ------------- - Netrw Options - ------------- +(also see |netrw-settings|) > + + ------------- + Netrw Options + ------------- Option Meaning -------------- ----------------------------------------------- < @@ -859,7 +867,21 @@ OBTAINING A FILE *netrw-O* When browsing a remote directory, one may obtain a file under the cursor (ie. get a copy on your local machine, but not edit it) by pressing the O key. Only ftp and scp are supported for this operation (but since these two are -available for browsing, that shouldn't be a problem). +available for browsing, that shouldn't be a problem). The status bar +will then show, on its right hand side, a message like "Obtaining filename". +The statusline will be restored after the transfer is complete. + +Netrw can also "obtain" a file using the local browser. Netrw's display +of a directory is not necessarily the same as Vim's "current directory", +unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select +a file using the local browser (by putting the cursor on it) and pressing +"O" will then "obtain" the file; ie. copy it to Vim's current directory. + +Related topics: + * To see what the current directory is, use |:pwd| + * To make the currently browsed directory the current directory, see |netrw-c| + * To automatically make the currently browsed directory the current + directory, see |g:netrw_keepdir|. THIN, LONG, AND WIDE LISTINGS *netrw-i* @@ -1257,6 +1279,9 @@ which is loaded automatically at startup (assuming :set nocp). ============================================================================== 10. History *netrw-history* + v70: * when using |netrw-O|, the "Obtaining filename" message is now + shown using |hl-User9|. If User9 has not been defined, netrw + will define it. v69: * Bugfix: win95/98 machines were experiencing a "E121: Undefined variable: g:netrw_win95ftp" message v68: * double-click-leftmouse selects word under mouse diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index c8597a6d5..f4610ae8b 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -1,4 +1,4 @@ -*quickref.txt* For Vim version 7.0aa. Last change: 2005 Sep 01 +*quickref.txt* For Vim version 7.0aa. Last change: 2005 Sep 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -772,7 +772,7 @@ Short explanation of each option: *option-list* |'nrformats'| |'nf'| number formats recognized for CTRL-A command |'number'| |'nu'| print the line number in front of each line |'numberwidth'| |'nuw'| number of columns used for the line number -|'occultfunc'| |'ofu'| function for filetype-specific completion +|'omnifunc'| |'ofu'| function for filetype-specific completion |'osfiletype'| |'oft'| operating system-specific filetype information |'paragraphs'| |'para'| nroff macros that separate paragraphs |'paste'| allow pasting text diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt index 49f727dfd..d2fa97629 100644 --- a/runtime/doc/spell.txt +++ b/runtime/doc/spell.txt @@ -1,4 +1,4 @@ -*spell.txt* For Vim version 7.0aa. Last change: 2005 Aug 30 +*spell.txt* For Vim version 7.0aa. Last change: 2005 Sep 12 VIM REFERENCE MANUAL by Bram Moolenaar @@ -60,7 +60,7 @@ To search for the next misspelled word: [S Like "]S" but search backwards. -To add words to your own word list: *E764* +To add words to your own word list: *zg* zg Add word under the cursor as a good word to the first diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index f3210ea7d..2a12894f8 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 7.0aa. Last change: 2005 Aug 30 +*syntax.txt* For Vim version 7.0aa. Last change: 2005 Sep 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -3969,7 +3969,7 @@ WarningMsg warning messages *hl-WildMenu* WildMenu current match in 'wildmenu' completion - *hl-User1* *hl-User1..9* + *hl-User1* *hl-User1..9* *hl-User9* The 'statusline' syntax allows the use of 9 different highlights in the statusline and ruler (via 'rulerformat'). The names are User1 to User9. diff --git a/runtime/doc/tags b/runtime/doc/tags index 3c95458a3..4dc041485 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -607,9 +607,9 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* 'number' options.txt /*'number'* 'numberwidth' options.txt /*'numberwidth'* 'nuw' options.txt /*'nuw'* -'occultfunc' options.txt /*'occultfunc'* 'oft' options.txt /*'oft'* 'ofu' options.txt /*'ofu'* +'omnifunc' options.txt /*'omnifunc'* 'op' vi_diff.txt /*'op'* 'open' vi_diff.txt /*'open'* 'optimize' vi_diff.txt /*'optimize'* @@ -1484,6 +1484,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* 12.6 usr_12.txt /*12.6* 12.7 usr_12.txt /*12.7* 12.8 usr_12.txt /*12.8* +1gD pattern.txt /*1gD* +1gd pattern.txt /*1gd* 20.1 usr_20.txt /*20.1* 20.2 usr_20.txt /*20.2* 20.3 usr_20.txt /*20.3* @@ -3752,7 +3754,7 @@ E760 spell.txt /*E760* E761 spell.txt /*E761* E762 spell.txt /*E762* E763 spell.txt /*E763* -E764 spell.txt /*E764* +E764 options.txt /*E764* E765 options.txt /*E765* E766 eval.txt /*E766* E767 eval.txt /*E767* @@ -4460,8 +4462,8 @@ compl-filename insert.txt /*compl-filename* compl-function insert.txt /*compl-function* compl-generic insert.txt /*compl-generic* compl-keyword insert.txt /*compl-keyword* -compl-occult insert.txt /*compl-occult* -compl-occult-filetypes insert.txt /*compl-occult-filetypes* +compl-omni insert.txt /*compl-omni* +compl-omni-filetypes insert.txt /*compl-omni-filetypes* compl-spelling insert.txt /*compl-spelling* compl-tag insert.txt /*compl-tag* compl-vim insert.txt /*compl-vim* @@ -4962,7 +4964,7 @@ ft-aspperl-syntax syntax.txt /*ft-aspperl-syntax* ft-aspvbs-syntax syntax.txt /*ft-aspvbs-syntax* ft-bash-syntax syntax.txt /*ft-bash-syntax* ft-basic-syntax syntax.txt /*ft-basic-syntax* -ft-c-occult insert.txt /*ft-c-occult* +ft-c-omni insert.txt /*ft-c-omni* ft-c-syntax syntax.txt /*ft-c-syntax* ft-ch-syntax syntax.txt /*ft-ch-syntax* ft-changelog-plugin filetype.txt /*ft-changelog-plugin* @@ -5363,6 +5365,7 @@ hl-Title syntax.txt /*hl-Title* hl-Tooltip syntax.txt /*hl-Tooltip* hl-User1 syntax.txt /*hl-User1* hl-User1..9 syntax.txt /*hl-User1..9* +hl-User9 syntax.txt /*hl-User9* hl-VertSplit syntax.txt /*hl-VertSplit* hl-Visual syntax.txt /*hl-Visual* hl-VisualNOS syntax.txt /*hl-VisualNOS* @@ -5977,6 +5980,7 @@ new-multi-byte version5.txt /*new-multi-byte* new-multi-lang version6.txt /*new-multi-lang* new-netrw-explore version7.txt /*new-netrw-explore* new-network-files version6.txt /*new-network-files* +new-omni-completion version7.txt /*new-omni-completion* new-operator-mod version6.txt /*new-operator-mod* new-options-5.2 version5.txt /*new-options-5.2* new-options-5.4 version5.txt /*new-options-5.4* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 5feaf699d..ab14fb86d 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.0aa. Last change: 2005 Sep 10 +*todo.txt* For Vim version 7.0aa. Last change: 2005 Sep 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -31,10 +31,12 @@ be worked on, but only if you sponsor Vim development. See |sponsor|. -------------------- Known bugs and current work ----------------------- ccomplete: -- When a typedef or struct is local to a file only use it in that file? - How to use a popup menu? -- when a struct reference is already complete and CTRL-X CTRL-O is used, add a - "." or "->"? +- When a typedef or struct is local to a file only use it in that file? + +When 'foldcolumn' is 1 show more + to be able to open all folds? (Donohue) + +After vi" another i" should include the quotes. Mac unicode patch (Da Woon Jung): - selecting proportional font breaks display @@ -63,21 +65,27 @@ Awaiting response: PLANNED FOR VERSION 7.0: -- Occult completion: Understands the programming language and finds matches +- Omni completion: Understands the programming language and finds matches that make sense. Esp. members of classes/structs. It's not much different from other Insert-mode completion, use the same - mechanism. Use CTRL-X CTRL-O and 'occultfunc'. Set 'occultfunc' in the + mechanism. Use CTRL-X CTRL-O and 'omnifunc'. Set 'omnifunc' in the filetype plugin, define the function in the autoload directory. Separately develop the completion logic and the UI. When adding UI stuff make it work for all completion methods. UI: - - At first: use 'wildmenu' kind of thing. - - Nicer: Display the list of choices right under the place where they + - Display the list of choices right under the place where they would be inserted in a kind of meny (use scrollbar when there are many alternatives). + At first in a terminal, then add GUI implementations. + - When using tags, show match in preview window (function prototype, + struct member, etc.). + Or use one window for matches, another for context/info (Doug Kearns, + 2005 Sep 13) + - Ideas on: http://www.wholetomato.com/ + Completion logic: Use runtime/autoload/{filetype}complete.vim files. @@ -92,6 +100,12 @@ PLANNED FOR VERSION 7.0: complist[0]['helpfunc'] = function that shows help text etc. + Can CTRL-] (jump to tag) include the "." and "->" to restrict the + number of possible matches? (Flemming Madsen) + + In general: Besides completion, figure out the type of a variable + and use it for information. + Ideas from others: http://www.vim.org/scripts/script.php?script_id=747 http://sourceforge.net/projects/insenvim diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt index 0a6923348..ce0b32b4b 100644 --- a/runtime/doc/version7.txt +++ b/runtime/doc/version7.txt @@ -1,4 +1,4 @@ -*version7.txt* For Vim version 7.0aa. Last change: 2005 Sep 10 +*version7.txt* For Vim version 7.0aa. Last change: 2005 Sep 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -20,6 +20,7 @@ NEW FEATURES |new-7| Vim script enhancements |new-vim-script| Spell checking |new-spell| +Omni completion |new-omni-completion| KDE support |new-KDE| MzScheme interface |new-MzScheme| Printing multi-byte text |new-print-multi-byte| @@ -180,6 +181,22 @@ highlighting. Much more info here: |spell|. +Omni completion *new-omni-completion* +----------------- + +This could also be called "intellisense", but that is a trademark. It is a +smart kind of completion. The text in front of the cursor is inspected to +figure out what could be following. This considers struct and class members, +unions, etc. + +Use CTRL-X CTRL-O in Insert mode to start the completion. |i_CTRL-X_CTRL-O| + +The 'omnifunc' option is set by filetype plugins to define the function that +figures out the completion. + +Currently only C is supported. |ft-c-omni| + + KDE support *new-KDE* ----------- @@ -349,6 +366,7 @@ Options: ~ 'completefunc' The name of a function used for user-specified Insert mode completion. CTRL-X CTRL-U can be used in Insert mode to do any kind of completion. (Taro Muraoka) +'omnifunc' The name of a function used for omni completion. 'quoteescape' Characters used to escape quotes inside a string. Used for the a", a' and a` text objects. |a'| 'numberwidth' Minimal width of the space used for the 'number' @@ -450,6 +468,7 @@ New functions: ~ |remove()| remove one or more items from a List or Dictionary |repeat()| repeat "expr" "count" times (Christophe Poucet) |reverse()| reverse the order of a List +|searchdecl()| search for declaration of variable |setqflist()| create a quickfix list (Yegappan Lakshmanan) |sort()| sort a List |soundfold()| get the sound-a-like equivalent of a word @@ -576,6 +595,9 @@ When 'verbose' is set the output of the ":map", ":abbreviate", ":command", ":function /pattern" lists functions matching the pattern. +"1gd" can be used like "gd" but ignores matches in a {} block that ends before +the cursor position. Likewise for "1gD" and "gD". + ============================================================================== IMPROVEMENTS *improvements-7* diff --git a/runtime/ftplugin/html.vim b/runtime/ftplugin/html.vim index 80b04cdc3..4f7e97daf 100644 --- a/runtime/ftplugin/html.vim +++ b/runtime/ftplugin/html.vim @@ -14,6 +14,8 @@ set cpo-=C setlocal commentstring=<!--%s--> +setlocal omnifunc=htmlcomplete#CompleteTags + " HTML: thanks to Johannes Zellner and Benji Fisher. if exists("loaded_matchit") let b:match_ignorecase = 1 diff --git a/runtime/optwin.vim b/runtime/optwin.vim index 7aa1e0ff6..06d297627 100644 --- a/runtime/optwin.vim +++ b/runtime/optwin.vim @@ -1,7 +1,7 @@ " These commands create the option window. " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2005 Sep 01 +" Last Change: 2005 Sep 13 " If there already is an option window, jump to that one. if bufwinnr("option-window") > 0 @@ -704,7 +704,7 @@ if has("insert_expand") call append("$", "completefunc\tuser defined function for Insert mode completion") call append("$", "\t(local to buffer)") call <SID>OptionL("cfu") - call append("$", "occultfunc\tfunction for filetype-specific Insert mode completion") + call append("$", "omnifunc\tfunction for filetype-specific Insert mode completion") call append("$", "\t(local to buffer)") call <SID>OptionL("ofu") call append("$", "dictionary\tlist of dictionary files for keyword completion") diff --git a/runtime/spell/ru/ru_RU.diff b/runtime/spell/ru/ru_RU.diff index c79fb0c6b..465da3e57 100644 --- a/runtime/spell/ru/ru_RU.diff +++ b/runtime/spell/ru/ru_RU.diff @@ -1,8 +1,8 @@ *** ru_RU.orig.aff Sun Aug 28 21:12:27 2005 ---- ru_RU.aff Sun Sep 4 17:21:40 2005 +--- ru_RU.aff Mon Sep 12 22:10:22 2005 *************** *** 3,4 **** ---- 3,13 ---- +--- 3,11 ---- + FOL ÁÂ×ÇÄÅ£ÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝØÙßÜÀÑ + LOW ÁÂ×ÇÄÅ£ÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝØÙßÜÀÑ @@ -11,8 +11,6 @@ + SOFOFROM ÁÂ×ÇÄÅ£ÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝØÙßÜÀÑáâ÷çäå³öúéêëìíîïðòóôõæèãþûýøùÿüàñ + SOFOTO ÅÂ×ÇÄÅÅÖÚÅÊËÌÎÎÅÐÒÓÔÅÆÈÃÞÛÛØÅ'ÅÅÅåâ÷çäååöúåêëìîîåðòóôåæèãþûûøå'ååå + -+ MIDWORD '- -+ SFX L Y 52 *** ru_RU.orig.dic Sun Aug 28 21:12:27 2005 --- ru_RU.dic Sun Sep 4 17:23:27 2005 diff --git a/runtime/spell/ru/ru_YO.diff b/runtime/spell/ru/ru_YO.diff index cd2eb5abb..741372de7 100644 --- a/runtime/spell/ru/ru_YO.diff +++ b/runtime/spell/ru/ru_YO.diff @@ -1,8 +1,8 @@ *** ru_YO.orig.aff Sun Aug 28 21:12:35 2005 ---- ru_YO.aff Sun Sep 4 17:23:51 2005 +--- ru_YO.aff Mon Sep 12 22:10:32 2005 *************** *** 3,4 **** ---- 3,13 ---- +--- 3,11 ---- + FOL ÁÂ×ÇÄÅ£ÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝØÙßÜÀÑ + LOW ÁÂ×ÇÄÅ£ÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝØÙßÜÀÑ @@ -11,8 +11,6 @@ + SOFOFROM ÁÂ×ÇÄÅ£ÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝØÙßÜÀÑáâ÷çäå³öúéêëìíîïðòóôõæèãþûýøùÿüàñ + SOFOTO ÅÂ×ÇÄÅÅÖÚÅÊËÌÎÎÅÐÒÓÔÅÆÈÃÞÛÛØÅ'ÅÅÅåâ÷çäååöúåêëìîîåðòóôåæèãþûûøå'ååå + -+ MIDWORD '- -+ SFX L Y 56 *** ru_YO.orig.dic Sun Aug 28 21:12:35 2005 --- ru_YO.dic Sun Sep 4 17:24:26 2005 diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index c2712ba4f..46f42e9aa 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -20,7 +20,7 @@ syn keyword vimCommand contained ab[breviate] abc[lear] abo[veleft] al[l] arga[d syn match vimCommand contained "\<z[-+^.=]" " vimOptions are caught only when contained in a vimSet {{{2 -syn keyword vimOption contained : acd ai akm al aleph allowrevins altkeymap ambiwidth ambw anti antialias ar arab arabic arabicshape ari arshape autochdir autoindent autoread autowrite autowriteall aw awa background backspace backup backupcopy backupdir backupext backupskip balloondelay ballooneval balloonexpr bdir bdlay beval bex bexpr bg bh bin binary biosk bioskey bk bkc bl bomb breakat brk browsedir bs bsdir bsk bt bufhidden buflisted buftype casemap cb ccv cd cdpath cedit cf cfu ch charconvert ci cin cindent cink cinkeys cino cinoptions cinw cinwords clipboard cmdheight cmdwinheight cmp cms co columns com comments commentstring compatible complete completefunc confirm consk conskey copyindent cp cpo cpoptions cpt cscopepathcomp cscopeprg cscopequickfix cscopetag cscopetagorder cscopeverbose cspc csprg csqf cst csto csverb cwh debug deco def define delcombine dex dg dict dictionary diff diffexpr diffopt digraph dip dir directory display dy ea ead eadirection eb ed edcompatible ef efm ei ek enc encoding endofline eol ep equalalways equalprg errorbells errorfile errorformat esckeys et eventignore ex expandtab exrc fcl fcs fdc fde fdi fdl fdls fdm fdn fdo fdt fen fenc fencs ff ffs fileencoding fileencodings fileformat fileformats filetype fillchars fk fkmap flp fml fmr fo foldclose foldcolumn foldenable foldexpr foldignore foldlevel foldlevelstart foldmarker foldmethod foldminlines foldnestmax foldopen foldtext formatlistpat formatoptions formatprg fp fs fsync ft gcr gd gdefault gfm gfn gfs gfw ghr go gp grepformat grepprg guicursor guifont guifontset guifontwide guiheadroom guioptions guipty helpfile helpheight helplang hf hh hi hid hidden highlight history hk hkmap hkmapp hkp hl hlg hls hlsearch ic icon iconstring ignorecase im imactivatekey imak imc imcmdline imd imdisable imi iminsert ims imsearch inc include includeexpr incsearch inde indentexpr indentkeys indk inex inf infercase insertmode is isf isfname isi isident isk iskeyword isp isprint joinspaces js key keymap keymodel keywordprg km kmp kp langmap langmenu laststatus lazyredraw lbr lcs linebreak lines linespace lisp lispwords list listchars lm lmap loadplugins lpl ls lsp lw lz ma magic makeef makeprg mat matchpairs matchtime maxfuncdepth maxmapdepth maxmem maxmempattern maxmemtot mef menuitems mfd mh mis mkspellmem ml mls mm mmd mmp mmt mod modeline modelines modifiable modified more mouse mousef mousefocus mousehide mousem mousemodel mouses mouseshape mouset mousetime mp mps msm mzq mzquantum nf nrformats nu number numberwidth nuw occultfunc oft ofu osfiletype pa para paragraphs paste pastetoggle patchexpr patchmode path pdev penc pex pexpr pfn pheader pi pm pmbcs pmbfn popt preserveindent previewheight previewwindow printdevice printencoding printexpr printfont printheader printmbcharset printmbfont printoptions prompt pt pvh pvw qe quoteescape readonly remap report restorescreen revins ri rightleft rightleftcmd rl rlc ro rs rtp ru ruf ruler rulerformat runtimepath sb sbo sbr sc scb scr scroll scrollbind scrolljump scrolloff scrollopt scs sect sections secure sel selection selectmode sessionoptions sft sh shcf shell shellcmdflag shellpipe shellquote shellredir shellslash shelltemp shelltype shellxquote shiftround shiftwidth shm shortmess shortname showbreak showcmd showfulltag showmatch showmode shq si sidescroll sidescrolloff siso sj slm sm smartcase smartindent smarttab smc smd sn so softtabstop sol sp spc spell spellcapcheck spellfile spelllang spellsuggest spf spl splitbelow splitright spr sps sr srr ss ssl ssop st sta startofline statusline stl stmp sts su sua suffixes suffixesadd sw swapfile swapsync swb swf switchbuf sws sxq syn synmaxcol syntax ta tabstop tag tagbsearch taglength tagrelative tags tagstack tb tbi tbidi tbis tbs tenc term termbidi termencoding terse textauto textmode textwidth tf tgst thesaurus tildeop timeout timeoutlen title titlelen titleold titlestring tl tm to toolbar toolbariconsize top tr ts tsl tsr ttimeout ttimeoutlen ttm tty ttybuiltin ttyfast ttym ttymouse ttyscroll ttytype tw tx uc ul undolevels updatecount updatetime ut vb vbs vdir ve verbose verbosefile vfile vi viewdir viewoptions viminfo virtualedit visualbell vop wa wak warn wb wc wcm wd weirdinvert wfh wh whichwrap wi wig wildchar wildcharm wildignore wildmenu wildmode wildoptions wim winaltkeys window winfixheight winheight winminheight winminwidth winwidth wiv wiw wm wmh wmnu wmw wop wrap wrapmargin wrapscan write writeany writebackup writedelay ws ww +syn keyword vimOption contained : acd ai akm al aleph allowrevins altkeymap ambiwidth ambw anti antialias ar arab arabic arabicshape ari arshape autochdir autoindent autoread autowrite autowriteall aw awa background backspace backup backupcopy backupdir backupext backupskip balloondelay ballooneval balloonexpr bdir bdlay beval bex bexpr bg bh bin binary biosk bioskey bk bkc bl bomb breakat brk browsedir bs bsdir bsk bt bufhidden buflisted buftype casemap cb ccv cd cdpath cedit cf cfu ch charconvert ci cin cindent cink cinkeys cino cinoptions cinw cinwords clipboard cmdheight cmdwinheight cmp cms co columns com comments commentstring compatible complete completefunc confirm consk conskey copyindent cp cpo cpoptions cpt cscopepathcomp cscopeprg cscopequickfix cscopetag cscopetagorder cscopeverbose cspc csprg csqf cst csto csverb cwh debug deco def define delcombine dex dg dict dictionary diff diffexpr diffopt digraph dip dir directory display dy ea ead eadirection eb ed edcompatible ef efm ei ek enc encoding endofline eol ep equalalways equalprg errorbells errorfile errorformat esckeys et eventignore ex expandtab exrc fcl fcs fdc fde fdi fdl fdls fdm fdn fdo fdt fen fenc fencs ff ffs fileencoding fileencodings fileformat fileformats filetype fillchars fk fkmap flp fml fmr fo foldclose foldcolumn foldenable foldexpr foldignore foldlevel foldlevelstart foldmarker foldmethod foldminlines foldnestmax foldopen foldtext formatlistpat formatoptions formatprg fp fs fsync ft gcr gd gdefault gfm gfn gfs gfw ghr go gp grepformat grepprg guicursor guifont guifontset guifontwide guiheadroom guioptions guipty helpfile helpheight helplang hf hh hi hid hidden highlight history hk hkmap hkmapp hkp hl hlg hls hlsearch ic icon iconstring ignorecase im imactivatekey imak imc imcmdline imd imdisable imi iminsert ims imsearch inc include includeexpr incsearch inde indentexpr indentkeys indk inex inf infercase insertmode is isf isfname isi isident isk iskeyword isp isprint joinspaces js key keymap keymodel keywordprg km kmp kp langmap langmenu laststatus lazyredraw lbr lcs linebreak lines linespace lisp lispwords list listchars lm lmap loadplugins lpl ls lsp lw lz ma magic makeef makeprg mat matchpairs matchtime maxfuncdepth maxmapdepth maxmem maxmempattern maxmemtot mef menuitems mfd mh mis mkspellmem ml mls mm mmd mmp mmt mod modeline modelines modifiable modified more mouse mousef mousefocus mousehide mousem mousemodel mouses mouseshape mouset mousetime mp mps msm mzq mzquantum nf nrformats nu number numberwidth nuw omnifunc oft ofu osfiletype pa para paragraphs paste pastetoggle patchexpr patchmode path pdev penc pex pexpr pfn pheader pi pm pmbcs pmbfn popt preserveindent previewheight previewwindow printdevice printencoding printexpr printfont printheader printmbcharset printmbfont printoptions prompt pt pvh pvw qe quoteescape readonly remap report restorescreen revins ri rightleft rightleftcmd rl rlc ro rs rtp ru ruf ruler rulerformat runtimepath sb sbo sbr sc scb scr scroll scrollbind scrolljump scrolloff scrollopt scs sect sections secure sel selection selectmode sessionoptions sft sh shcf shell shellcmdflag shellpipe shellquote shellredir shellslash shelltemp shelltype shellxquote shiftround shiftwidth shm shortmess shortname showbreak showcmd showfulltag showmatch showmode shq si sidescroll sidescrolloff siso sj slm sm smartcase smartindent smarttab smc smd sn so softtabstop sol sp spc spell spellcapcheck spellfile spelllang spellsuggest spf spl splitbelow splitright spr sps sr srr ss ssl ssop st sta startofline statusline stl stmp sts su sua suffixes suffixesadd sw swapfile swapsync swb swf switchbuf sws sxq syn synmaxcol syntax ta tabstop tag tagbsearch taglength tagrelative tags tagstack tb tbi tbidi tbis tbs tenc term termbidi termencoding terse textauto textmode textwidth tf tgst thesaurus tildeop timeout timeoutlen title titlelen titleold titlestring tl tm to toolbar toolbariconsize top tr ts tsl tsr ttimeout ttimeoutlen ttm tty ttybuiltin ttyfast ttym ttymouse ttyscroll ttytype tw tx uc ul undolevels updatecount updatetime ut vb vbs vdir ve verbose verbosefile vfile vi viewdir viewoptions viminfo virtualedit visualbell vop wa wak warn wb wc wcm wd weirdinvert wfh wh whichwrap wi wig wildchar wildcharm wildignore wildmenu wildmode wildoptions wim winaltkeys window winfixheight winheight winminheight winminwidth winwidth wiv wiw wm wmh wmnu wmw wop wrap wrapmargin wrapscan write writeany writebackup writedelay ws ww " vimOptions: These are the turn-off setting variants {{{2 syn keyword vimOption contained noacd noai noakm noallowrevins noaltkeymap noanti noantialias noar noarab noarabic noarabicshape noari noarshape noautochdir noautoindent noautoread noautowrite noautowriteall noaw noawa nobackup noballooneval nobeval nobin nobinary nobiosk nobioskey nobk nobl nobomb nobuflisted nocf noci nocin nocindent nocompatible noconfirm noconsk noconskey nocopyindent nocp nocscopetag nocscopeverbose nocst nocsverb nodeco nodelcombine nodg nodiff nodigraph nodisable noea noeb noed noedcompatible noek noendofline noeol noequalalways noerrorbells noesckeys noet noex noexpandtab noexrc nofen nofk nofkmap nofoldenable nogd nogdefault noguipty nohid nohidden nohk nohkmap nohkmapp nohkp nohls nohlsearch noic noicon noignorecase noim noimc noimcmdline noimd noincsearch noinf noinfercase noinsertmode nois nojoinspaces nojs nolazyredraw nolbr nolinebreak nolisp nolist noloadplugins nolpl nolz noma nomagic nomh noml nomod nomodeline nomodifiable nomodified nomore nomousef nomousefocus nomousehide nonu nonumber nopaste nopi nopreserveindent nopreviewwindow noprompt nopvw noreadonly noremap norestorescreen norevins nori norightleft norightleftcmd norl norlc noro nors noru noruler nosb nosc noscb noscrollbind noscs nosecure nosft noshellslash noshelltemp noshiftround noshortname noshowcmd noshowfulltag noshowmatch noshowmode nosi nosm nosmartcase nosmartindent nosmarttab nosmd nosn nosol nospell nosplitbelow nosplitright nospr nosr nossl nosta nostartofline nostmp noswapfile noswf nota notagbsearch notagrelative notagstack notbi notbidi notbs notermbidi noterse notextauto notextmode notf notgst notildeop notimeout notitle noto notop notr nottimeout nottybuiltin nottyfast notx novb novisualbell nowa nowarn nowb noweirdinvert nowfh nowildmenu nowinfixheight nowiv nowmnu nowrap nowrapscan nowrite nowriteany nowritebackup nows |