diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-11-23 21:25:05 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-11-23 21:25:05 +0000 |
commit | a5792f58905da28f0ab37e1c4c3cfd8171b2e602 (patch) | |
tree | 258ddcfde89bbf98b90d42dd6c297e1b22a20d09 /runtime | |
parent | af289d333a2985051948a53d510fa345df1ddeb3 (diff) |
updated for version 7.0158v7.0158
Diffstat (limited to 'runtime')
64 files changed, 4407 insertions, 1676 deletions
diff --git a/runtime/autoload/htmlcomplete.vim b/runtime/autoload/htmlcomplete.vim index a773ff2049..bd138e6bb8 100644 --- a/runtime/autoload/htmlcomplete.vim +++ b/runtime/autoload/htmlcomplete.vim @@ -1,7 +1,7 @@ " Vim completion script " Language: XHTML 1.0 Strict " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) -" Last Change: 2005 Oct 12 +" Last Change: 2005 Now 20 function! htmlcomplete#CompleteTags(findstart, base) if a:findstart @@ -52,10 +52,13 @@ function! htmlcomplete#CompleteTags(findstart, base) if exists("b:entitiescompl") unlet! b:entitiescompl - " Very, very long line - let values = ["AElig", "Aacute", "Acirc", "Agrave", "Alpha", "Aring", "Atilde", "Auml", "Beta", "Ccedil", "Chi", "Dagger", "Delta", "ETH", "Eacute", "Ecirc", "Egrave", "Epsilon", "Eta", "Euml", "Gamma", "Iacute", "Icirc", "Igrave", "Iota", "Iuml", "Kappa", "Lambda", "Mu", "Ntilde", "Nu", "OElig", "Oacute", "Ocirc", "Ograve", "Omega", "Omicron", "Oslash", "Otilde", "Ouml", "Phi", "Pi", "Prime", "Psi", "Rho", "Scaron", "Sigma", "THORN", "TITY", "Tau", "Theta", "Uacute", "Ucirc", "Ugrave", "Upsilon", "Uuml", "Xi", "Yacute", "Yuml", "Zeta", "amp", "aacute", "acirc", "acute", "aelig", "agrave", "alefsym", "alpha", "and", "ang", "apos", "aring", "asymp", "atilde", "auml", "bdquo", "beta", "brvbar", "bull", "cap", "ccedil", "cedil", "cent", "chi", "circ", "clubs", "copy", "cong", "crarr", "cup", "curren", "dArr", "dagger", "darr", "deg", "delta", "diams", "divide", "eacute", "ecirc", "egrave", "empty", "ensp", "emsp", "epsilon", "equiv", "eta", "eth", "euro", "euml", "exist", "fnof", "forall", "frac12", "frac14", "frac34", "frasl", "gt", "gamma", "ge", "hArr", "harr", "hearts", "hellip", "iacute", "icirc", "iexcl", "igrave", "image", "infin", "int", "iota", "iquest", "isin", "iuml", "kappa", "lt", "laquo", "lArr", "lambda", "lang", "larr", "lceil", "ldquo", "le", "lfloor", "lowast", "loz", "lrm", "lsaquo", "lsquo", "macr", "mdash", "micro", "middot", "minus", "mu", "nbsp", "nabla", "ndash", "ne", "ni", "not", "notin", "nsub", "ntilde", "nu", "oacute", "ocirc", "oelig", "ograve", "oline", "omega", "omicron", "oplus", "or", "ordf", "ordm", "oslash", "otilde", "otimes", "ouml", "para", "part", "permil", "perp", "phi", "pi", "piv", "plusmn", "pound", "prime", "prod", "prop", "psi", "quot", "rArr", "raquo", "radic", "rang", "rarr", "rceil", "rdquo", "real", "reg", "rfloor", "rho", "rlm", "rsaquo", "rsquo", "sbquo", "scaron", "sdot", "sect", "shy", "sigma", "sigmaf", "sim", "spades", "sub", "sube", "sum", "sup", "sup1", "sup2", "sup3", "supe", "szlig", "tau", "there4", "theta", "thetasym", "thinsp", "thorn", "tilde", "times", "trade", "uArr", "uacute", "uarr", "ucirc", "ugrave", "uml", "upsih", "upsilon", "uuml", "weierp", "xi", "yacute", "yen", "yuml", "zeta", "zwj", "zwnj"] + if !exists("g:xmldata_xhtml10s") + runtime! autoload/xml/xhtml10s.vim + endif + + let entities = g:xmldata_xhtml10s['vimxmlentities'] - for m in values + for m in entities if m =~ '^'.a:base call add(res, m.';') endif @@ -114,6 +117,7 @@ function! htmlcomplete#CompleteTags(findstart, base) let head = getline(search('<head\>'), search('<\/head>')) let headjoined = join(copy(head), ' ') if headjoined =~ '<style' + " Remove possibly confusing CSS operators let stylehead = substitute(headjoined, '+>\*[,', ' ', 'g') if search_for == 'class' let styleheadlines = split(stylehead) @@ -447,68 +451,18 @@ function! htmlcomplete#CompleteTags(findstart, base) " Close tag let b:unaryTagsStack = "base meta link hr br param img area input col" if context =~ '^\/' - let opentag = htmlcomplete#GetLastOpenTag("b:unaryTagsStack") + let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack") return [opentag.">"] endif " Deal with tag completion. - let opentag = htmlcomplete#GetLastOpenTag("b:unaryTagsStack") - " Clusters - let special = "br span bdo map object img" - let phrase = "em strong dfn code q samp kbd var cite abbr acronym sub sup" - let inlineforms = "input select textarea label button" - let miscinline = "ins del script" - let inline = "a ".special." ".phrase." ".inlineforms." tt i b big small" - let misc = "noscript ".miscinline - let block = "p h1 h2 h3 h4 h5 h6 div ul ol dl pre hr blockquote address fieldset table" - - if opentag == 'a' - let tags = split("tt i b big small ".special." ".phrase." ".inlineforms." ".miscinline) - elseif opentag =~ '^\(abbr\|acronym\|address\|b\|p\|h\d\|dt\|span\|bdo\|em\|strong\|dfn\|code\|samp\|kbd\|var\|cite\|q\|sub\|sup\|tt\|i\|big\|small\|label\|caption\)$' - let tags = split(inline." ".miscinline) - elseif opentag == 'pre' - let tags = split("a tt i b big small br span bdo map ".phrase." ".miscinline." ".inlineforms) - elseif opentag == 'html' - let tags = ["head", "body"] - elseif opentag == 'legend' - let tags = split(inline." ".miscinline) - elseif opentag == 'head' - let tags = ["title", "base", "scipt", "style", "meta", "link", "object"] - elseif opentag =~ '^\(noscript\|body\|blockquote\)$' - let tags = split("form ".block." ".misc) - elseif opentag =~ '^\(ul\|ol\)$' - let tags = ["li"] - elseif opentag == 'dl' - let tags = ["dt", "dd"] - elseif opentag =~ '^\(ins\|del\|th\|td\|dd\|div\|li\)$' - let tags = split("form ".block." ".inline." ".misc) - elseif opentag == 'object' - let tags = split("param form ".block." ".inline." ".misc) - elseif opentag == 'fieldset' - let tags = split("legend form ".block." ".inline." ".misc) - elseif opentag == 'map' - let tags = split("area form ".block." ".misc) - elseif opentag == 'form' - let tags = split(block." ".misc) - elseif opentag == 'select' - let tags = ["optgroup", "option"] - elseif opentag == 'optgroup' - let tags = ["option"] - elseif opentag == 'colgroup' - let tags = ["col"] - elseif opentag == '^\(textarea\|option\|script\|style\|title\)$' - let tags = ['empty'] - elseif opentag == 'button' - let tags = ["p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "ul", "ol", "dl", "table"] - elseif opentag =~ '^\(thead\|tfoot\|tbody\)$' - let tags = ["tr"] - elseif opentag == 'tr' - let tags = ["th", "td"] - elseif opentag == 'table' - let tags = ["caption", "col", "colgroup", "thead", "tfoot", "tbody", "tr"] - else - return [] + let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack") + + if !exists("g:xmldata_xhtml10s") + runtime! autoload/xml/xhtml10s.vim endif + let tags = g:xmldata_xhtml10s[opentag][0] + for m in tags if m =~ '^'.context call add(res, m) @@ -521,133 +475,3 @@ function! htmlcomplete#CompleteTags(findstart, base) endif endfunction - -" MM: This is greatly reduced closetag.vim used with kind permission of Steven -" Mueller -" Changes: strip all comments; delete error messages -" Author: Steven Mueller <diffusor@ugcs.caltech.edu> -" Last Modified: Tue May 24 13:29:48 PDT 2005 -" Version: 0.9.1 - -function! htmlcomplete#GetLastOpenTag(unaryTagsStack) - let linenum=line('.') - let lineend=col('.') - 1 " start: cursor position - let first=1 " flag for first line searched - let b:TagStack='' " main stack of tags - let startInComment=s:InComment() - - let tagpat='</\=\(\k\|[-:]\)\+\|/>' - while (linenum>0) - let line=getline(linenum) - if first - let line=strpart(line,0,lineend) - else - let lineend=strlen(line) - endif - let b:lineTagStack='' - let mpos=0 - let b:TagCol=0 - while (mpos > -1) - let mpos=matchend(line,tagpat) - if mpos > -1 - let b:TagCol=b:TagCol+mpos - let tag=matchstr(line,tagpat) - - if exists('b:closetag_disable_synID') || startInComment==s:InCommentAt(linenum, b:TagCol) - let b:TagLine=linenum - call s:Push(matchstr(tag,'[^<>]\+'),'b:lineTagStack') - endif - let lineend=lineend-mpos - let line=strpart(line,mpos,lineend) - endif - endwhile - while (!s:EmptystackP('b:lineTagStack')) - let tag=s:Pop('b:lineTagStack') - if match(tag, '^/') == 0 "found end tag - call s:Push(tag,'b:TagStack') - elseif s:EmptystackP('b:TagStack') && !s:Instack(tag, a:unaryTagsStack) "found unclosed tag - return tag - else - let endtag=s:Peekstack('b:TagStack') - if endtag == '/'.tag || endtag == '/' - call s:Pop('b:TagStack') "found a open/close tag pair - elseif !s:Instack(tag, a:unaryTagsStack) "we have a mismatch error - return '' - endif - endif - endwhile - let linenum=linenum-1 | let first=0 - endwhile -return '' -endfunction - -function! s:InComment() - return synIDattr(synID(line('.'), col('.'), 0), 'name') =~ 'Comment' -endfunction - -function! s:InCommentAt(line, col) - return synIDattr(synID(a:line, a:col, 0), 'name') =~ 'Comment' -endfunction - -function! s:SetKeywords() - let g:IsKeywordBak=&iskeyword - let &iskeyword='33-255' -endfunction - -function! s:RestoreKeywords() - let &iskeyword=g:IsKeywordBak -endfunction - -function! s:Push(el, sname) - if !s:EmptystackP(a:sname) - exe 'let '.a:sname."=a:el.' '.".a:sname - else - exe 'let '.a:sname.'=a:el' - endif -endfunction - -function! s:EmptystackP(sname) - exe 'let stack='.a:sname - if match(stack,'^ *$') == 0 - return 1 - else - return 0 - endif -endfunction - -function! s:Instack(el, sname) - exe 'let stack='.a:sname - call s:SetKeywords() - let m=match(stack, '\<'.a:el.'\>') - call s:RestoreKeywords() - if m < 0 - return 0 - else - return 1 - endif -endfunction - -function! s:Peekstack(sname) - call s:SetKeywords() - exe 'let stack='.a:sname - let top=matchstr(stack, '\<.\{-1,}\>') - call s:RestoreKeywords() - return top -endfunction - -function! s:Pop(sname) - if s:EmptystackP(a:sname) - return '' - endif - exe 'let stack='.a:sname - call s:SetKeywords() - let loc=matchend(stack,'\<.\{-1,}\>') - exe 'let '.a:sname.'=strpart(stack, loc+1, strlen(stack))' - let top=strpart(stack, match(stack, '\<'), loc) - call s:RestoreKeywords() - return top -endfunction - -function! s:Clearstack(sname) - exe 'let '.a:sname."=''" -endfunction diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index d989dc00f2..5a06bb0a27 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -1,96 +1,36 @@ " netrw.vim: Handles file transfer and remote directory listing across a network " AUTOLOAD PORTION -" Date: Oct 12, 2005 -" Version: 73 +" Last Change: Aug 31, 2005 " 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 " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright " notice is copied with it. Like anything else that's free, -" netrw.vim, netrwPlugin.vim, and netrwSettings.vim are provided -" *as is* and comes with no warranty of any kind, either -" expressed or implied. By using this plugin, you agree that -" in no event will the copyright holder be liable for any damages -" resulting from the use of this software. +" netrw.vim is provided *as is* and comes with no warranty +" of any kind, either expressed or implied. By using this +" plugin, you agree that in no event will the copyright +" holder be liable for any damages resulting from the use " of this software. " " But be doers of the Word, and not only hearers, deluding your own selves {{{1 " (James 1:22 RSV) " =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - -" Exception for &cp: {{{1 -if &cp || exists("g:loaded_netrw") - finish -endif -let g:loaded_netrw = "v73" +let s:keepcpo= &cpo +set cpo&vim +" call Decho("doing autoload/netrw.vim") 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 s:keepcpo = &cpo -set cpo&vim -" call Decho("doing autoload/netrw.vim") - -" --------------------------------------------------------------------- -" Default values for netrw's global protocol variables {{{1 -if !exists("g:netrw_dav_cmd") - let g:netrw_dav_cmd = "cadaver" -endif -if !exists("g:netrw_fetch_cmd") - if executable("fetch") - let g:netrw_fetch_cmd = "fetch -o" - else - let g:netrw_fetch_cmd = "" - endif -endif -if !exists("g:netrw_ftp_cmd") - let g:netrw_ftp_cmd = "ftp" -endif -if !exists("g:netrw_http_cmd") - if executable("wget") - let g:netrw_http_cmd = "wget -q -O" - elseif executable("fetch") - let g:netrw_http_cmd = "fetch -o" - else - let g:netrw_http_cmd = "" - endif -endif -if !exists("g:netrw_rcp_cmd") - let g:netrw_rcp_cmd = "rcp" -endif -if !exists("g:netrw_rsync_cmd") - let g:netrw_rsync_cmd = "rsync" -endif -if !exists("g:netrw_scp_cmd") - let g:netrw_scp_cmd = "scp -q" -endif -if !exists("g:netrw_sftp_cmd") - let g:netrw_sftp_cmd = "sftp" -endif -if !exists("g:netrw_ssh_cmd") - let g:netrw_ssh_cmd= "ssh" -endif - -if has("win32") || has("win95") || has("win64") || has("win16") - \ && exists("g:netrw_use_nt_rcp") - \ && g:netrw_use_nt_rcp - \ && executable( $SystemRoot .'/system32/rcp.exe') - let s:netrw_has_nt_rcp = 1 - let s:netrw_rcpmode = '-b' - else - let s:netrw_has_nt_rcp = 0 - let s:netrw_rcpmode = '' -endif " --------------------------------------------------------------------- -" Default values for netrw's global variables {{{1 -" Default values - a-c ---------- {{{2 -if !exists("g:netrw_alto") - let g:netrw_alto= 0 +" Default values for global netrw variables {{{1 +if !exists("g:netrw_ftpmode") + let g:netrw_ftpmode= "binary" endif -if !exists("g:netrw_altv") - let g:netrw_altv= 0 +if !exists("g:netrw_win95ftp") + let g:netrw_win95ftp= 1 endif if !exists("g:netrw_cygwin") if has("win32") || has("win95") || has("win64") || has("win16") @@ -103,15 +43,14 @@ if !exists("g:netrw_cygwin") let g:netrw_cygwin= 0 endif endif -" Default values - d-f ---------- {{{2 -if !exists("g:NETRW_DIRHIST_CNT") - let g:NETRW_DIRHIST_CNT= 0 -endif -if !exists("g:netrw_dirhistmax") - let g:netrw_dirhistmax= 10 -endif -if !exists("g:netrw_ftp_browse_reject") - let g:netrw_ftp_browse_reject='^total\s\+\d\+$\|^Trying\s\+\d\+.*$\|^KERBEROS_V\d rejected\|^Security extensions not\|No such file\|: connect to address [0-9a-fA-F:]*: No route to host$' +if !exists("g:netrw_list_cmd") + if executable("ssh") + " provide a default listing command + let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa" + else +" call Decho("ssh is not executable, can't do remote directory exploring with ssh") + let g:netrw_list_cmd= "" + endif endif if !exists("g:netrw_ftp_list_cmd") if has("unix") || exists("g:netrw_cygwin") @@ -120,96 +59,75 @@ if !exists("g:netrw_ftp_list_cmd") let g:netrw_ftp_list_cmd= "dir" endif endif -if !exists("g:netrw_ftpmode") - let g:netrw_ftpmode= "binary" -endif -" Default values - h-lh ---------- {{{2 -if !exists("g:netrw_hide") - let g:netrw_hide= 1 -endif -if !exists("g:netrw_keepdir") - let g:netrw_keepdir= 1 -endif -if !exists("g:netrw_list_cmd") - if executable(g:netrw_ssh_cmd) - " provide a default listing command - let g:netrw_list_cmd= g:netrw_ssh_cmd." HOSTNAME ls -FLa" - else -" call Decho(g:netrw_ssh_cmd." is not executable, can't do remote directory exploring) - let g:netrw_list_cmd= "" - endif -endif -if !exists("g:netrw_list_hide") - let g:netrw_list_hide= "" -endif -" Default values - lh-lz ---------- {{{2 -if !exists("g:netrw_local_mkdir") - let g:netrw_local_mkdir= "mkdir" -endif -if !exists("g:netrw_local_rmdir") - let g:netrw_local_rmdir= "rmdir" -endif -if !exists("g:netrw_longlist") - let g:netrw_longlist= 0 -endif -if g:netrw_longlist < 0 || g:netrw_longlist > 2 - " sanity check - let g:netrw_longlist= 0 -endif -if g:netrw_longlist == 1 - let g:netrw_list_cmd= g:netrw_list_cmd." -l" -endif -" Default values - m-r ---------- {{{2 -if !exists("g:netrw_maxfilenamelen") - let g:netrw_maxfilenamelen= 32 -endif -if !exists("g:netrw_mkdir_cmd") - let g:netrw_mkdir_cmd= g:netrw_ssh_cmd." HOSTNAME mkdir" -endif -if !exists("g:netrw_rename_cmd") - let g:netrw_rename_cmd= g:netrw_ssh_cmd." HOSTNAME mv" -endif if !exists("g:netrw_rm_cmd") - let g:netrw_rm_cmd = g:netrw_ssh_cmd." HOSTNAME rm" + let g:netrw_rm_cmd = "ssh HOSTNAME rm" +endif +if !exists("g:netrw_rmf_cmd") + let g:netrw_rmf_cmd = "ssh HOSTNAME rm -f" endif if !exists("g:netrw_rmdir_cmd") - let g:netrw_rmdir_cmd = g:netrw_ssh_cmd." HOSTNAME rmdir" + let g:netrw_rmdir_cmd = "ssh HOSTNAME rmdir" endif -if !exists("g:netrw_rmf_cmd") - let g:netrw_rmf_cmd = g:netrw_ssh_cmd." HOSTNAME rm -f" +if !exists("g:netrw_rename_cmd") + let g:netrw_rename_cmd= "ssh HOSTNAME mv" endif -" Default values - s ---------- {{{2 if exists("g:netrw_silent") && g:netrw_silent != 0 let g:netrw_silentxfer= "silent " else let g:netrw_silentxfer= "" endif +if !exists("g:netrw_winsize") + let g:netrw_winsize= "" +endif +if !exists("g:netrw_list_hide") + let g:netrw_list_hide= "" +endif if !exists("g:netrw_sort_by") " alternatives: date size let g:netrw_sort_by= "name" endif +if !exists("g:netrw_sort_sequence") + let g:netrw_sort_sequence= '[\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$' +endif if !exists("g:netrw_sort_direction") " alternative: reverse (z y x ...) let g:netrw_sort_direction= "normal" endif -if !exists("g:netrw_sort_sequence") - let g:netrw_sort_sequence= '[\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$' +if !exists("g:netrw_longlist") + let g:netrw_longlist= 0 endif -if !exists("g:netrw_ssh_browse_reject") - let g:netrw_ssh_browse_reject='^total\s\+\d\+$' +if g:netrw_longlist == 0 || g:netrw_longlist == 2 + let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa" +else + let g:netrw_longlist= 1 + let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa -l" +endif +if !exists("g:netrw_list_cmd") endif -" Default values - t-w ---------- {{{2 if !exists("g:netrw_timefmt") let g:netrw_timefmt= "%c" endif -if !exists("g:netrw_win95ftp") - let g:netrw_win95ftp= 1 +if !exists("g:netrw_local_rmdir") + let g:netrw_local_rmdir= "rmdir" endif -if !exists("g:netrw_winsize") - let g:netrw_winsize= "" +if !exists("g:netrw_local_mkdir") + let g:netrw_local_mkdir= "mkdir" +endif +if !exists("g:netrw_mkdir_cmd") + let g:netrw_mkdir_cmd= "ssh HOSTNAME mkdir" +endif +if !exists("g:netrw_hide") + let g:netrw_hide= 1 +endif +if !exists("g:netrw_ftp_browse_reject") + let g:netrw_ftp_browse_reject='^total\s\+\d\+$\|^Trying\s\+\d\+.*$\|^KERBEROS_V\d rejected\|^Security extensions not\|No such file\|: connect to address [0-9a-fA-F:]*: No route to host$' +endif +if !exists("g:netrw_ssh_browse_reject") + let g:netrw_ssh_browse_reject='^total\s\+\d\+$' +endif +if !exists("g:netrw_keepdir") + let g:netrw_keepdir= 1 endif -" --------------------------------------------------------------------- -" Default values for netrw's script variables: {{{1 if !exists("s:netrw_cd_escape") if has("win32") || has("win95") || has("win64") || has("win16") let s:netrw_cd_escape="#% " @@ -224,12 +142,75 @@ if !exists("s:netrw_glob_escape") let s:netrw_glob_escape= '[]*?`{~$' endif endif +if !exists("g:netrw_alto") + let g:netrw_alto= 0 +endif +if !exists("g:netrw_altv") + let g:netrw_altv= 0 +endif +if !exists("g:netrw_maxfilenamelen") + let g:netrw_maxfilenamelen= 32 +endif +if !exists("g:netrw_dirhistmax") + let g:netrw_dirhistmax= 10 +endif +if !exists("g:NETRW_DIRHIST_CNT") + let g:NETRW_DIRHIST_CNT= 0 +endif " BufEnter event ignored by decho when following variable is true " Has a side effect that doau BufReadPost doesn't work, so " files read by network transfer aren't appropriately highlighted. "let g:decho_bufenter = 1 "Decho +" ----------------------------------- |