# HG changeset patch # User vimboss # Date 1126646447 0 # Node ID a7ae7e043e438c590fdd82d32cf8146be4635fef # Parent 530b30703db64fd465feb4bd5971023ba79b2a04 updated for version 7.0146 diff --git a/runtime/autoload/ccomplete.vim b/runtime/autoload/ccomplete.vim --- a/runtime/autoload/ccomplete.vim +++ b/runtime/autoload/ccomplete.vim @@ -1,10 +1,10 @@ " Vim completion script " Language: C " Maintainer: Bram Moolenaar -" 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, " 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, 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, 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, " 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(typena 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 --- /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 \\)\\@ " 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("") - 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 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" +" elseif w:netrw_explore_bufnr != bufnr(".") +" let g:stlmsg="explore_bufnr!=".bufnr(".") +" endif +" if !exists("w:netrw_explore_line") +" let g:stlmsg=" !X" +" elseif w:netrw_explore_line != line(".") +" let g:stlmsg=" explore_line!={line(.)<".line(".").">" +" endif +" if !exists("w:netrw_explore_list") +" let g:stlmsg=" !X" +" 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 --- 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 --- 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 { 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 --- 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 @@ 7. file names |i_CTRL-X_CTRL-F| 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 i 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 t 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 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 --- 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 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 shor 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 --- 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 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 --- 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 @@ 3. Activation *netrw-activate* Network-oriented file transfers are available by default whenever |'nocompatible'| mode is enabled. The 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 @@ 6. Variables and Options *netrw The script uses several variables which can affect '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 ============================================================================== 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 --- 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: *opti |'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 --- 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 --- 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 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -607,9 +607,9 @@ '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 @@ 12.5 usr_12.txt /*12.5* 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-filena 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-aspper 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- 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 --- 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 Vi -------------------- Known bugs and current work ----------------------- ccomplete: +- How to use a popup menu? - 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 '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 --- 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 ":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 --- a/runtime/ftplugin/html.vim +++ b/runtime/ftplugin/html.vim @@ -14,6 +14,8 @@ set cpo-=C setlocal commentstring= +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 --- a/runtime/optwin.vim +++ b/runtime/optwin.vim @@ -1,7 +1,7 @@ " These commands create the option window. " " Maintainer: Bram Moolenaar -" 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 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 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 --- 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 --- 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 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -20,7 +20,7 @@ syn keyword vimCommand contained ab[brev syn match vimCommand contained "\