diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/autoload/htmlcomplete.vim | 28 | ||||
-rw-r--r-- | runtime/doc/index.txt | 22 | ||||
-rw-r--r-- | runtime/spell/cleanadd.vim | 22 |
3 files changed, 68 insertions, 4 deletions
diff --git a/runtime/autoload/htmlcomplete.vim b/runtime/autoload/htmlcomplete.vim index 768afd572..c7a43c304 100644 --- a/runtime/autoload/htmlcomplete.vim +++ b/runtime/autoload/htmlcomplete.vim @@ -1,13 +1,14 @@ " Vim completion script " Language: XHTML 1.0 Strict " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) -" Last Change: 2006 Jan 22 +" Last Change: 2006 Jan 24 function! htmlcomplete#CompleteTags(findstart, base) if a:findstart " locate the start of the word let line = getline('.') let start = col('.') - 1 + let curline = line('.') let compl_begin = col('.') - 2 while start >= 0 && line[start - 1] =~ '\(\k\|[:.-]\)' let start -= 1 @@ -20,8 +21,7 @@ function! htmlcomplete#CompleteTags(findstart, base) let stylestart = searchpair('<style\>', '', '<\/style\>', "bnW") let styleend = searchpair('<style\>', '', '<\/style\>', "nW") if stylestart != 0 && styleend != 0 - let curpos = line('.') - if stylestart <= curpos && styleend >= curpos + if stylestart <= curline && styleend >= curline let start = col('.') - 1 let b:csscompl = 1 while start >= 0 && line[start - 1] =~ '\(\k\|-\)' @@ -31,6 +31,27 @@ function! htmlcomplete#CompleteTags(findstart, base) endif if !exists("b:csscompl") let b:compl_context = getline('.')[0:(compl_begin)] + if b:compl_context !~ '<[^>]*$' + " Look like we may have broken tag. Check previous lines. Up to + " 10? + let i = 1 + while 1 + let context_line = getline(curline-i) + if context_line =~ '<[^>]*$' + " Yep, this is this line + let context_lines = getline(curline-i, curline) + let b:compl_context = join(context_lines, ' ') + break + elseif context_line =~ '>[^<]*$' + " Normal tag line, no need for completion at all + let b:compl_context = '' + break + endif + let i += 1 + endwhile + " Make sure we don't have counter + unlet! i + endif let b:compl_context = matchstr(b:compl_context, '.*\zs<.*') else let b:compl_context = getline('.')[0:compl_begin] @@ -94,7 +115,6 @@ function! htmlcomplete#CompleteTags(findstart, base) return [] endif endif - "if context !~ '<$' " Set attribute groups let coreattrs = ["id", "class", "style", "title"] diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index 96a6c612d..bf2fb15d0 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1213,23 +1213,45 @@ The commands are sorted on the non-optional part of their name. |:keepalt| :keepa[lt] following command keeps the alternate file |:keepmarks| :kee[pmarks] following command keeps marks where they are |:keepjumps| :keepj[jumps] following command keeps jumplist and marks +|:lNext| :lN[ext] go to previous entry in location list +|:lNfile| :lNf[ile] go to last entry in previous file |:list| :l[ist] print lines +|:laddexpr| :lad[dexpr] add locations from expr +|:laddfile| :laddf[ile] add locations to current location list |:last| :la[st] go to the last file in the argument list |:language| :lan[guage] set the language (locale) +|:lbuffer| :lb[uffer] parse locations and jump to first location |:lcd| :lc[d] change directory locally |:lchdir| :lch[dir] change directory locally +|:lclose| :lcl[ose] close location window |:left| :le[ft] left align lines |:leftabove| :lefta[bove] make split window appear left or above |:let| :let assign a value to a variable or option +|:lexpr| :lex[pr] read locations from expr and jump to first +|:lfile| :lf[ile] read file with locations and jump to first +|:lfirst| :lfir[st] go to the specified location, default first one +|:lgetfile| :lg[etfile] read file with locations +|:ll| :ll go to specific location +|:llast| :lla[st] go to the specified location, default last one +|:llist| :lli[st] list all locations |:lmap| :lm[ap] like ":map!" but includes Lang-Arg mode |:lmapclear| :lmapc[lear] like ":mapclear!" but includes Lang-Arg mode +|:lnext| :ln[ext] go to next location +|:lnewer| :lnew[er] go to newer location list +|:lnfile| :lnf[ile] go to first location in next file |:lnoremap| :ln[oremap] like ":noremap!" but includes Lang-Arg mode |:loadkeymap| :loadk[eymap] load the following keymaps until EOF |:loadview| :lo[adview] load view for current window from a file |:lockmarks| :loc[kmarks] following command keeps marks where they are |:lockvar| :lockv[ar] lock variables +|:lolder| :lol[der] go to older location list +|:lopen| :lope[n] open location window +|:lprevious| :lp[revious] go to previous location +|:lpfile| :lpf[ile] go to last location in previous file +|:lrewind| :lr[ewind] go to the specified location, default first one |:ls| :ls list all buffers |:lunmap| :lu[nmap] like ":unmap!" but includes Lang-Arg mode +|:lwindow| :lw[indow] open or close location window |:move| :m[ove] move lines |:mark| :ma[rk] set a mark |:make| :mak[e] execute external command 'makeprg' and parse diff --git a/runtime/spell/cleanadd.vim b/runtime/spell/cleanadd.vim new file mode 100644 index 000000000..14eb83a11 --- /dev/null +++ b/runtime/spell/cleanadd.vim @@ -0,0 +1,22 @@ +" Vim script to clean the ll.xxxxx.add files of commented out entries +" Author: Antonio Colombo, Bram Moolenaar +" Last Update: 2006 Jan 19 + +" Time in seconds after last time an ll.xxxxx.add file was updated +" Default is one hour. +if !exists("g:spell_clean_limit") + let g:spell_clean_limit = 60 * 60 +endif + +" Loop over all the runtime/spell/*.add files. +for s:fname in split(globpath(&rtp, "spell/*.add"), "\n") + if filewritable(s:fname) && localtime() - getftime(s:fname) > g:spell_clean_limit + silent exe "split " . escape(s:fname, ' \') + echo "Processing" s:fname + silent! g/^#/d + silent update + close + endif +endfor + +echo "Done" |