mirror of
https://github.com/zoriya/vim.git
synced 2026-01-02 20:38:14 +00:00
Compare commits
47 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a3f7eeebf | ||
|
|
df1bdc92c2 | ||
|
|
80a94a582c | ||
|
|
d1f56e68f1 | ||
|
|
238a564935 | ||
|
|
8f7fd65b24 | ||
|
|
030f0dfad5 | ||
|
|
faa959a870 | ||
|
|
70836c8ba8 | ||
|
|
2a0449d129 | ||
|
|
7e8fd63682 | ||
|
|
997fb4ba69 | ||
|
|
49d7bf13e0 | ||
|
|
f740b29ae2 | ||
|
|
4c7ed462cb | ||
|
|
e45828b593 | ||
|
|
98ea5defcf | ||
|
|
1d2ba7fa85 | ||
|
|
f52c725c47 | ||
|
|
c7453f52d4 | ||
|
|
110bc6bc91 | ||
|
|
06b5db9397 | ||
|
|
3d0a603fa9 | ||
|
|
754b56089f | ||
|
|
cf0c554e3f | ||
|
|
8b6144bdfe | ||
|
|
9f2c6e1deb | ||
|
|
a65576059f | ||
|
|
41cabdadc2 | ||
|
|
a37420f46f | ||
|
|
0e5bd96f84 | ||
|
|
986920760e | ||
|
|
49315f65c9 | ||
|
|
1ef15e30a0 | ||
|
|
afeb4fa8a7 | ||
|
|
b8a7b560b1 | ||
|
|
280f126ef0 | ||
|
|
17c7c01170 | ||
|
|
51156d5a87 | ||
|
|
6ab5b84db4 | ||
|
|
d12f5c17be | ||
|
|
28c258fd24 | ||
|
|
7df351eb8a | ||
|
|
09df3127f4 | ||
|
|
33aec765bd | ||
|
|
71fe80dddd | ||
|
|
66fa271a25 |
@@ -1,13 +1,13 @@
|
||||
" Vim completion script
|
||||
" Language: C
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2005 Dec 18
|
||||
" Last Change: 2006 Feb 10
|
||||
|
||||
|
||||
" This function is used for the 'omnifunc' option.
|
||||
function! ccomplete#Complete(findstart, base)
|
||||
if a:findstart
|
||||
" Locate the start of the item, including "." and "->".
|
||||
" Locate the start of the item, including ".", "->" and "[...]".
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
let lastword = -1
|
||||
@@ -24,6 +24,21 @@ function! ccomplete#Complete(findstart, base)
|
||||
let lastword = start
|
||||
endif
|
||||
let start -= 2
|
||||
elseif line[start - 1] == ']'
|
||||
" Skip over [...].
|
||||
let n = 0
|
||||
let start -= 1
|
||||
while start > 0
|
||||
let start -= 1
|
||||
if line[start] == '['
|
||||
if n == 0
|
||||
break
|
||||
endif
|
||||
let n -= 1
|
||||
elseif line[start] == ']' " nested []
|
||||
let n += 1
|
||||
endif
|
||||
endwhile
|
||||
else
|
||||
break
|
||||
endif
|
||||
@@ -43,20 +58,53 @@ function! ccomplete#Complete(findstart, base)
|
||||
|
||||
let base = s:prepended . a:base
|
||||
|
||||
" Don't do anything for an empty base, would result in all the tags in the
|
||||
" tags file.
|
||||
if base == ''
|
||||
return []
|
||||
endif
|
||||
|
||||
" Split item in words, keep empty word after "." or "->".
|
||||
" "aa" -> ['aa'], "aa." -> ['aa', ''], "aa.bb" -> ['aa', 'bb'], etc.
|
||||
let items = split(base, '\.\|->', 1)
|
||||
if len(items) <= 1
|
||||
" Don't do anything for an empty base, would result in all the tags in the
|
||||
" tags file.
|
||||
if base == ''
|
||||
return []
|
||||
" We can't use split, because we need to skip nested [...].
|
||||
let items = []
|
||||
let s = 0
|
||||
while 1
|
||||
let e = match(base, '\.\|->\|\[', s)
|
||||
if e < 0
|
||||
if s == 0 || base[s - 1] != ']'
|
||||
call add(items, strpart(base, s))
|
||||
endif
|
||||
break
|
||||
endif
|
||||
|
||||
" Only one part, no "." or "->": complete from tags file.
|
||||
" When local completion is wanted CTRL-N would have been used.
|
||||
return map(taglist('^' . base), 'v:val["name"]')
|
||||
endif
|
||||
if s == 0 || base[s - 1] != ']'
|
||||
call add(items, strpart(base, s, e - s))
|
||||
endif
|
||||
if base[e] == '.'
|
||||
let s = e + 1 " skip over '.'
|
||||
elseif base[e] == '-'
|
||||
let s = e + 2 " skip over '->'
|
||||
else
|
||||
" Skip over [...].
|
||||
let n = 0
|
||||
let s = e
|
||||
let e += 1
|
||||
while e < len(base)
|
||||
if base[e] == ']'
|
||||
if n == 0
|
||||
break
|
||||
endif
|
||||
let n -= 1
|
||||
elseif base[e] == '[' " nested [...]
|
||||
let n += 1
|
||||
endif
|
||||
let e += 1
|
||||
endwhile
|
||||
let e += 1
|
||||
call add(items, strpart(base, s, e - s))
|
||||
let s = e
|
||||
endif
|
||||
endwhile
|
||||
|
||||
" Find the variable items[0].
|
||||
" 1. in current function (like with "gd")
|
||||
@@ -68,7 +116,33 @@ function! ccomplete#Complete(findstart, base)
|
||||
" TODO: join previous line if it makes sense
|
||||
let line = getline('.')
|
||||
let col = col('.')
|
||||
let res = s:Nextitem(strpart(line, 0, col), items[1:])
|
||||
if len(items) == 1
|
||||
" Completing one word and it's a local variable: May add '[', '.' or
|
||||
" '->'.
|
||||
let match = items[0]
|
||||
if match(line, match . '\s*\[') > 0
|
||||
let match .= '['
|
||||
else
|
||||
let res = s:Nextitem(strpart(line, 0, col), [''], 0)
|
||||
if len(res) > 0
|
||||
" There are members, thus add "." or "->".
|
||||
if match(line, '\*[ \t(]*' . match . '\>') > 0
|
||||
let match .= '->'
|
||||
else
|
||||
let match .= '.'
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
let res = [{'match': match, 'tagline' : ''}]
|
||||
else
|
||||
" Completing "var.", "var.something", etc.
|
||||
let res = s:Nextitem(strpart(line, 0, col), items[1:], 0)
|
||||
endif
|
||||
endif
|
||||
|
||||
if len(items) == 1
|
||||
" Only one part, no "." or "->": complete from tags file.
|
||||
call extend(res, map(taglist('^' . base), 's:Tag2item(v:val)'))
|
||||
endif
|
||||
|
||||
if len(res) == 0
|
||||
@@ -88,7 +162,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, s:Nextitem(strpart(line, 2, col - 2), items[1:]))
|
||||
call extend(res, s:Nextitem(strpart(line, 2, col - 2), items[1:], 0))
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
@@ -99,27 +173,100 @@ function! ccomplete#Complete(findstart, base)
|
||||
" TODO: join previous line if it makes sense
|
||||
let line = getline('.')
|
||||
let col = col('.')
|
||||
let res = s:Nextitem(strpart(line, 0, col), items[1:])
|
||||
let res = s:Nextitem(strpart(line, 0, col), items[1:], 0)
|
||||
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 the last item(s) are [...] they need to be added to the matches.
|
||||
let last = len(items) - 1
|
||||
let brackets = ''
|
||||
while last >= 0
|
||||
if items[last][0] != '['
|
||||
break
|
||||
endif
|
||||
let brackets = items[last] . brackets
|
||||
let last -= 1
|
||||
endwhile
|
||||
|
||||
return map(res, 's:Tagline2item(v:val, brackets)')
|
||||
endfunc
|
||||
|
||||
function! s:GetAddition(line, match, memarg, bracket)
|
||||
" Guess if the item is an array.
|
||||
if a:bracket && match(a:line, a:match . '\s*\[') > 0
|
||||
return '['
|
||||
endif
|
||||
|
||||
" Check if the item has members.
|
||||
if len(s:SearchMembers(a:memarg, [''])) > 0
|
||||
" If there is a '*' before the name use "->".
|
||||
if match(res[0]['tagline'], '\*\s*' . res[0]['match']) > 0
|
||||
let res[0]['match'] .= '->'
|
||||
if match(a:line, '\*[ \t(]*' . a:match . '\>') > 0
|
||||
return '->'
|
||||
else
|
||||
let res[0]['match'] .= '.'
|
||||
return '.'
|
||||
endif
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
return map(res, 'v:val["match"]')
|
||||
endfunc
|
||||
" Turn the tag info "val" into an item for completion.
|
||||
" "val" is is an item in the list returned by taglist().
|
||||
" If it is a variable we may add "." or "->". Don't do it for other types,
|
||||
" such as a typedef, by not including the info that s:GetAddition() uses.
|
||||
function! s:Tag2item(val)
|
||||
let x = s:Tagcmd2extra(a:val['cmd'], a:val['name'], a:val['filename'])
|
||||
|
||||
if has_key(a:val, "kind")
|
||||
if a:val["kind"] == 'v'
|
||||
return {'match': a:val['name'], 'tagline': "\t" . a:val['cmd'], 'dict': a:val, 'extra': x}
|
||||
endif
|
||||
if a:val["kind"] == 'f'
|
||||
return {'match': a:val['name'] . '(', 'tagline': "", 'extra': x}
|
||||
endif
|
||||
endif
|
||||
return {'match': a:val['name'], 'tagline': '', 'extra': x}
|
||||
endfunction
|
||||
|
||||
" Turn a match item "val" into an item for completion.
|
||||
" "val['match']" is the matching item.
|
||||
" "val['tagline']" is the tagline in which the last part was found.
|
||||
function! s:Tagline2item(val, brackets)
|
||||
let line = a:val['tagline']
|
||||
let word = a:val['match'] . a:brackets . s:GetAddition(line, a:val['match'], [a:val], a:brackets == '')
|
||||
if has_key(a:val, 'extra')
|
||||
return {'word': word, 'menu': a:val['extra']}
|
||||
endif
|
||||
|
||||
" Isolate the command after the tag and filename.
|
||||
let s = matchstr(line, '[^\t]*\t[^\t]*\t\zs\(/^.*$/\|[^\t]*\)\ze\(;"\t\|\t\|$\)')
|
||||
if s != ''
|
||||
return {'word': word, 'menu': s:Tagcmd2extra(s, a:val['match'], matchstr(line, '[^\t]*\t\zs[^\t]*\ze\t'))}
|
||||
endif
|
||||
return {'word': word}
|
||||
endfunction
|
||||
|
||||
" Turn a command from a tag line to something that is useful in the menu
|
||||
function! s:Tagcmd2extra(cmd, name, fname)
|
||||
if a:cmd =~ '^/^'
|
||||
" The command is a search command, useful to see what it is.
|
||||
let x = matchstr(a:cmd, '^/^\zs.*\ze$/')
|
||||
let x = substitute(x, a:name, '@@', '')
|
||||
let x = substitute(x, '\\\(.\)', '\1', 'g')
|
||||
let x = x . ' - ' . a:fname
|
||||
elseif a:cmd =~ '^\d*$'
|
||||
" The command is a line number, the file name is more useful.
|
||||
let x = a:fname . ' - ' . a:cmd
|
||||
else
|
||||
" Not recognized, use command and file name.
|
||||
let x = a:cmd . ' - ' . a:fname
|
||||
endif
|
||||
return x
|
||||
endfunction
|
||||
|
||||
" Find composing type in "lead" and match items[0] with it.
|
||||
" Repeat this recursively for items[1], if it's there.
|
||||
" When resolving typedefs "depth" is used to avoid infinite recursion.
|
||||
" Return the list of matches.
|
||||
function! s:Nextitem(lead, items)
|
||||
function! s:Nextitem(lead, items, depth)
|
||||
|
||||
" Use the text up to the variable name and split it in tokens.
|
||||
let tokens = split(a:lead, '\s\+\|\<')
|
||||
@@ -135,7 +282,7 @@ function! s:Nextitem(lead, items)
|
||||
endif
|
||||
|
||||
" TODO: add more reserved words
|
||||
if index(['int', 'float', 'static', 'unsigned', 'extern'], tokens[tidx]) >= 0
|
||||
if index(['int', 'short', 'char', 'float', 'double', 'static', 'unsigned', 'extern'], tokens[tidx]) >= 0
|
||||
continue
|
||||
endif
|
||||
|
||||
@@ -172,9 +319,9 @@ function! s:Nextitem(lead, items)
|
||||
if name != ''
|
||||
call extend(res, s:StructMembers(cmdtokens[0] . ':' . name, a:items))
|
||||
endif
|
||||
else
|
||||
elseif a:depth < 10
|
||||
" Could be "typedef other_T some_T".
|
||||
call extend(res, s:Nextitem(cmdtokens[0], a:items))
|
||||
call extend(res, s:Nextitem(cmdtokens[0], a:items, a:depth + 1))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@@ -188,6 +335,7 @@ function! s:Nextitem(lead, items)
|
||||
endfunction
|
||||
|
||||
|
||||
" Search for members of structure "typename" in tags files.
|
||||
" Return a list with resulting matches.
|
||||
" Each match is a dictionary with "match" and "tagline" entries.
|
||||
function! s:StructMembers(typename, items)
|
||||
@@ -218,14 +366,21 @@ function! s:StructMembers(typename, items)
|
||||
endfor
|
||||
|
||||
if len(matches) > 0
|
||||
" No further items, return the result.
|
||||
if len(a:items) == 1
|
||||
return matches
|
||||
endif
|
||||
" Skip over [...] items
|
||||
let idx = 1
|
||||
while 1
|
||||
if idx >= len(a:items)
|
||||
return matches " No further items, return the result.
|
||||
endif
|
||||
if a:items[idx][0] != '['
|
||||
break
|
||||
endif
|
||||
let idx += 1
|
||||
endwhile
|
||||
|
||||
" More items following. For each of the possible members find the
|
||||
" matching following members.
|
||||
return s:SearchMembers(matches, a:items[1:])
|
||||
return s:SearchMembers(matches, a:items[idx :])
|
||||
endif
|
||||
|
||||
" Failed to find anything.
|
||||
@@ -236,19 +391,29 @@ endfunction
|
||||
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))
|
||||
let typename = ''
|
||||
if has_key(a:matches[i], 'dict')
|
||||
if has_key(a:matches[i].dict, 'typename')
|
||||
let typename = a:matches[i].dict['typename']
|
||||
endif
|
||||
let line = "\t" . a:matches[i].dict['cmd']
|
||||
else
|
||||
let line = a:matches[i]['tagline']
|
||||
let e = matchend(line, '\ttypename:')
|
||||
if e > 0
|
||||
" Use typename field
|
||||
let typename = matchstr(line, '[^\t]*', e)
|
||||
endif
|
||||
endif
|
||||
if typename != ''
|
||||
call extend(res, s:StructMembers(typename, 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)
|
||||
let e = match(line, '\<' . a:matches[i]['match'] . '\>', s)
|
||||
if e > 0
|
||||
call extend(res, s:Nextitem(strpart(line, s, e - s), a:items))
|
||||
call extend(res, s:Nextitem(strpart(line, s, e - s), a:items, 0))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -1,27 +1,30 @@
|
||||
" Vim completion script
|
||||
" Language: XHTML 1.0 Strict
|
||||
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" Last Change: 2005 Now 20
|
||||
" Last Change: 2006 Feb 18
|
||||
|
||||
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
|
||||
endwhile
|
||||
" Handling of entities {{{
|
||||
if start >= 0 && line[start - 1] =~ '&'
|
||||
let b:entitiescompl = 1
|
||||
let b:compl_context = ''
|
||||
return start
|
||||
endif
|
||||
" }}}
|
||||
" Handling of <style> tag {{{
|
||||
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\|-\)'
|
||||
@@ -29,9 +32,80 @@ function! htmlcomplete#CompleteTags(findstart, base)
|
||||
endwhile
|
||||
endif
|
||||
endif
|
||||
if !exists("b:csscompl")
|
||||
" }}}
|
||||
" Handling of <script> tag {{{
|
||||
let scriptstart = searchpair('<script\>', '', '<\/script\>', "bnW")
|
||||
let scriptend = searchpair('<script\>', '', '<\/script\>', "nW")
|
||||
if scriptstart != 0 && scriptend != 0
|
||||
if scriptstart <= curline && scriptend >= curline
|
||||
let start = col('.') - 1
|
||||
let b:jscompl = 1
|
||||
let b:jsrange = [scriptstart, scriptend]
|
||||
while start >= 0 && line[start - 1] =~ '\k'
|
||||
let start -= 1
|
||||
endwhile
|
||||
" We are inside of <script> tag. But we should also get contents
|
||||
" of all linked external files and (secondary, less probably) other <script> tags
|
||||
" This logic could possible be done in separate function - may be
|
||||
" reused in events scripting (also with option could be reused for
|
||||
" CSS
|
||||
let b:js_extfiles = []
|
||||
let l = line('.')
|
||||
let c = col('.')
|
||||
call cursor(1,1)
|
||||
while search('<\@<=script\>', 'W') && line('.') <= l
|
||||
if synIDattr(synID(line('.'),col('.')-1,0),"name") !~? 'comment'
|
||||
let sname = matchstr(getline('.'), '<script[^>]*src\s*=\s*\([''"]\)\zs.\{-}\ze\1')
|
||||
if filereadable(sname)
|
||||
let b:js_extfiles += readfile(sname)
|
||||
endif
|
||||
endif
|
||||
endwhile
|
||||
call cursor(1,1)
|
||||
let js_scripttags = []
|
||||
while search('<script\>', 'W') && line('.') < l
|
||||
if matchstr(getline('.'), '<script[^>]*src') == ''
|
||||
let js_scripttag = getline(line('.'), search('</script>', 'W'))
|
||||
let js_scripttags += js_scripttag
|
||||
endif
|
||||
endwhile
|
||||
let b:js_extfiles += js_scripttags
|
||||
call cursor(l,c)
|
||||
unlet! l c
|
||||
endif
|
||||
endif
|
||||
" }}}
|
||||
if !exists("b:csscompl") && !exists("b:jscompl")
|
||||
let b:compl_context = getline('.')[0:(compl_begin)]
|
||||
let b:compl_context = matchstr(b:compl_context, '.*<\zs.*')
|
||||
if b:compl_context !~ '<[^>]*$'
|
||||
" Look like we may have broken tag. Check previous lines.
|
||||
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<.*')
|
||||
" Return proper start for on-events. Without that beginning of
|
||||
" completion will be badly reported
|
||||
if b:compl_context =~? 'on[a-z]*\s*=\s*\(''[^'']*\|"[^"]*\)$'
|
||||
let start = col('.') - 1
|
||||
while start >= 0 && line[start - 1] =~ '\k'
|
||||
let start -= 1
|
||||
endwhile
|
||||
endif
|
||||
else
|
||||
let b:compl_context = getline('.')[0:compl_begin]
|
||||
endif
|
||||
@@ -42,13 +116,24 @@ function! htmlcomplete#CompleteTags(findstart, base)
|
||||
let res2 = []
|
||||
" a:base is very short - we need context
|
||||
let context = b:compl_context
|
||||
unlet! b:compl_context
|
||||
" Check if we should do CSS completion inside of <style> tag
|
||||
" or JS completion inside of <script> tag
|
||||
if exists("b:csscompl")
|
||||
unlet! b:csscompl
|
||||
let context = b:compl_context
|
||||
unlet! b:compl_context
|
||||
return csscomplete#CompleteCSS(0, context)
|
||||
elseif exists("b:jscompl")
|
||||
unlet! b:jscompl
|
||||
return javascriptcomplete#CompleteJS(0, a:base)
|
||||
else
|
||||
if len(b:compl_context) == 0 && !exists("b:entitiescompl")
|
||||
return []
|
||||
endif
|
||||
let context = matchstr(b:compl_context, '.\zs.*')
|
||||
endif
|
||||
" Make entities completion
|
||||
unlet! b:compl_context
|
||||
" Entities completion {{{
|
||||
if exists("b:entitiescompl")
|
||||
unlet! b:entitiescompl
|
||||
|
||||
@@ -58,39 +143,46 @@ function! htmlcomplete#CompleteTags(findstart, base)
|
||||
|
||||
let entities = g:xmldata_xhtml10s['vimxmlentities']
|
||||
|
||||
for m in entities
|
||||
if m =~ '^'.a:base
|
||||
call add(res, m.';')
|
||||
endif
|
||||
endfor
|
||||
if len(a:base) == 1
|
||||
for m in entities
|
||||
if m =~ '^'.a:base
|
||||
call add(res, m.';')
|
||||
endif
|
||||
endfor
|
||||
return res
|
||||
else
|
||||
for m in entities
|
||||
if m =~? '^'.a:base
|
||||
call add(res, m.';')
|
||||
elseif m =~? a:base
|
||||
call add(res2, m.';')
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
endif
|
||||
|
||||
return res
|
||||
|
||||
endif
|
||||
" }}}
|
||||
if context =~ '>'
|
||||
" Generally if context contains > it means we are outside of tag and
|
||||
" should abandon action - with one exception: <style> span { bo
|
||||
if context =~ 'style[^>]\{-}>[^<]\{-}$'
|
||||
return csscomplete#CompleteCSS(0, context)
|
||||
elseif context =~ 'script[^>]\{-}>[^<]\{-}$'
|
||||
let b:jsrange = [line('.'), search('<\/script\>', 'nW')]
|
||||
return javascriptcomplete#CompleteJS(0, context)
|
||||
else
|
||||
return []
|
||||
endif
|
||||
endif
|
||||
|
||||
" Set attribute groups
|
||||
let coreattrs = ["id", "class", "style", "title"]
|
||||
let i18n = ["lang", "xml:lang", "dir=\"ltr\" ", "dir=\"rtl\" "]
|
||||
let events = ["onclick", "ondblclick", "onmousedown", "onmouseup", "onmousemove",
|
||||
\ "onmouseover", "onmouseout", "onkeypress", "onkeydown", "onkeyup"]
|
||||
let focus = ["accesskey", "tabindex", "onfocus", "onblur"]
|
||||
let coregroup = coreattrs + i18n + events
|
||||
" find tags matching with "context"
|
||||
" If context contains > it means we are already outside of tag and we
|
||||
" should abandon action
|
||||
" If context contains white space it is attribute.
|
||||
" It could be also value of attribute...
|
||||
" We have to get first word to offer
|
||||
" proper completions
|
||||
" It can be also value of attribute.
|
||||
" We have to get first word to offer proper completions
|
||||
if context == ''
|
||||
let tag = ''
|
||||
else
|
||||
@@ -102,11 +194,12 @@ function! htmlcomplete#CompleteTags(findstart, base)
|
||||
" 1. Events attributes
|
||||
if context =~ '\s'
|
||||
" Sort out style, class, and on* cases
|
||||
if context =~ "\\(on[a-z]*\\|id\\|style\\|class\\)\\s*=\\s*[\"']"
|
||||
if context =~ "\\(id\\|class\\)\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
|
||||
if context =~ "class\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
|
||||
if context =~? "\\(on[a-z]*\\|id\\|style\\|class\\)\\s*=\\s*[\"']"
|
||||
" Id, class completion {{{
|
||||
if context =~? "\\(id\\|class\\)\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
|
||||
if context =~? "class\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
|
||||
let search_for = "class"
|
||||
elseif context =~ "id\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
|
||||
elseif context =~? "id\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
|
||||
let search_for = "id"
|
||||
endif
|
||||
" Handle class name completion
|
||||
@@ -269,17 +362,58 @@ function! htmlcomplete#CompleteTags(findstart, base)
|
||||
|
||||
return res + res2
|
||||
|
||||
elseif context =~ "style\\s*=\\s*[\"'][^\"']*$"
|
||||
elseif context =~? "style\\s*=\\s*[\"'][^\"']*$"
|
||||
return csscomplete#CompleteCSS(0, context)
|
||||
|
||||
endif
|
||||
let stripbase = matchstr(context, ".*\\(on[a-z]*\\|style\\|class\\)\\s*=\\s*[\"']\\zs.*")
|
||||
" }}}
|
||||
" Complete on-events {{{
|
||||
if context =~? 'on[a-z]*\s*=\s*\(''[^'']*\|"[^"]*\)$'
|
||||
" We have to:
|
||||
" 1. Find external files
|
||||
let b:js_extfiles = []
|
||||
let l = line('.')
|
||||
let c = col('.')
|
||||
call cursor(1,1)
|
||||
while search('<\@<=script\>', 'W') && line('.') <= l
|
||||
if synIDattr(synID(line('.'),col('.')-1,0),"name") !~? 'comment'
|
||||
let sname = matchstr(getline('.'), '<script[^>]*src\s*=\s*\([''"]\)\zs.\{-}\ze\1')
|
||||
if filereadable(sname)
|
||||
let b:js_extfiles += readfile(sname)
|
||||
endif
|
||||
endif
|
||||
endwhile
|
||||
" 2. Find at least one <script> tag
|
||||
call cursor(1,1)
|
||||
let js_scripttags = []
|
||||
while search('<script\>', 'W') && line('.') < l
|
||||
if matchstr(getline('.'), '<script[^>]*src') == ''
|
||||
let js_scripttag = getline(line('.'), search('</script>', 'W'))
|
||||
let js_scripttags += js_scripttag
|
||||
endif
|
||||
endwhile
|
||||
let b:js_extfiles += js_scripttags
|
||||
|
||||
" 3. Proper call for javascriptcomplete#CompleteJS
|
||||
call cursor(l,c)
|
||||
let js_context = matchstr(a:base, '\k\+$')
|
||||
let js_shortcontext = substitute(a:base, js_context.'$', '', '')
|
||||
let b:compl_context = context
|
||||
let b:jsrange = [l, l]
|
||||
unlet! l c
|
||||
return javascriptcomplete#CompleteJS(0, js_context)
|
||||
|
||||
endif
|
||||
|
||||
" }}}
|
||||
let stripbase = matchstr(context, ".*\\(on[a-zA-Z]*\\|style\\|class\\)\\s*=\\s*[\"']\\zs.*")
|
||||
" Now we have context stripped from all chars up to style/class.
|
||||
" It may fail with some strange style value combinations.
|
||||
if stripbase !~ "[\"']"
|
||||
return []
|
||||
endif
|
||||
endif
|
||||
" Value of attribute completion {{{
|
||||
" If attr contains =\s*[\"'] we catched value of attribute
|
||||
if attr =~ "=\s*[\"']"
|
||||
" Let do attribute specific completion
|
||||
@@ -355,113 +489,77 @@ function! htmlcomplete#CompleteTags(findstart, base)
|
||||
return res + res2
|
||||
|
||||
endif
|
||||
" }}}
|
||||
" Attribute completion {{{
|
||||
" Shorten context to not include last word
|
||||
let sbase = matchstr(context, '.*\ze\s.*')
|
||||
if tag =~ '^\(abbr\|acronym\|address\|b\|bdo\|big\|caption\|cite\|code\|dd\|dfn\|div\|dl\|dt\|em\|fieldset\|h\d\|hr\|i\|kbd\|li\|noscript\|ol\|p\|samp\|small\|span\|strong\|sub\|sup\|tt\|ul\|var\)$'
|
||||
let attrs = coregroup
|
||||
elseif tag == 'a'
|
||||
let attrs = coregroup + focus + ["charset", "type", "name", "href", "hreflang", "rel", "rev", "shape", "coords"]
|
||||
elseif tag == 'area'
|
||||
let attrs = coregroup + focus + ["shape", "coords", "href", "nohref", "alt"]
|
||||
elseif tag == 'base'
|
||||
let attrs = ["href", "id"]
|
||||
elseif tag == 'blockquote'
|
||||
let attrs = coregroup + ["cite"]
|
||||
elseif tag == 'body'
|
||||
let attrs = coregroup + ["onload", "onunload"]
|
||||
elseif tag == 'br'
|
||||
let attrs = coreattrs
|
||||
elseif tag == 'button'
|
||||
let attrs = coregroup + focus + ["name", "value", "type"]
|
||||
elseif tag == '^\(col\|colgroup\)$'
|
||||
let attrs = coregroup + ["span", "width", "align", "char", "charoff", "valign"]
|
||||
elseif tag =~ '^\(del\|ins\)$'
|
||||
let attrs = coregroup + ["cite", "datetime"]
|
||||
elseif tag == 'form'
|
||||
let attrs = coregroup + ["action", "method=\"get\" ", "method=\"post\" ", "enctype", "onsubmit", "onreset", "accept", "accept-charset"]
|
||||
elseif tag == 'head'
|
||||
let attrs = i18n + ["id", "profile"]
|
||||
elseif tag == 'html'
|
||||
let attrs = i18n + ["id", "xmlns"]
|
||||
elseif tag == 'img'
|
||||
let attrs = coregroup + ["src", "alt", "longdesc", "height", "width", "usemap", "ismap"]
|
||||
elseif tag == 'input'
|
||||
let attrs = coregroup + ["type", "name", "value", "checked", "disabled", "readonly", "size", "maxlength", "src", "alt", "usemap", "onselect", "onchange", "accept"]
|
||||
elseif tag == 'label'
|
||||
let attrs = coregroup + ["for", "accesskey", "onfocus", "onblur"]
|
||||
elseif tag == 'legend'
|
||||
let attrs = coregroup + ["accesskey"]
|
||||
elseif tag == 'link'
|
||||
let attrs = coregroup + ["charset", "href", "hreflang", "type", "rel", "rev", "media"]
|
||||
elseif tag == 'map'
|
||||
let attrs = i18n + events + ["id", "class", "style", "title", "name"]
|
||||
elseif tag == 'meta'
|
||||
let attrs = i18n + ["id", "http-equiv", "content", "scheme", "name"]
|
||||
elseif tag == 'title'
|
||||
let attrs = i18n + ["id"]
|
||||
elseif tag == 'object'
|
||||
let attrs = coregroup + ["declare", "classid", "codebase", "data", "type", "codetype", "archive", "standby", "height", "width", "usemap", "name", "tabindex"]
|
||||
elseif tag == 'optgroup'
|
||||
let attrs = coregroup + ["disbled", "label"]
|
||||
elseif tag == 'option'
|
||||
let attrs = coregroup + ["disbled", "selected", "value", "label"]
|
||||
elseif tag == 'param'
|
||||
let attrs = ["id", "name", "value", "valuetype", "type"]
|
||||
elseif tag == 'pre'
|
||||
let attrs = coregroup + ["xml:space"]
|
||||
elseif tag == 'q'
|
||||
let attrs = coregroup + ["cite"]
|
||||
elseif tag == 'script'
|
||||
let attrs = ["id", "charset", "type=\"text/javascript\"", "type", "src", "defer", "xml:space"]
|
||||
elseif tag == 'select'
|
||||
let attrs = coregroup + ["name", "size", "multiple", "disabled", "tabindex", "onfocus", "onblur", "onchange"]
|
||||
elseif tag == 'style'
|
||||
let attrs = coreattrs + ["id", "type=\"text/css\"", "type", "media", "title", "xml:space"]
|
||||
elseif tag == 'table'
|
||||
let attrs = coregroup + ["summary", "width", "border", "frame", "rules", "cellspacing", "cellpadding"]
|
||||
elseif tag =~ '^\(thead\|tfoot\|tbody\|tr\)$'
|
||||
let attrs = coregroup + ["align", "char", "charoff", "valign"]
|
||||
elseif tag == 'textarea'
|
||||
let attrs = coregroup + ["name", "rows", "cols", "disabled", "readonly", "onselect", "onchange"]
|
||||
elseif tag =~ '^\(th\|td\)$'
|
||||
let attrs = coregroup + ["abbr", "headers", "scope", "rowspan", "colspan", "align", "char", "charoff", "valign"]
|
||||
else
|
||||
return []
|
||||
|
||||
" Load data {{{
|
||||
if !exists("g:xmldata_xhtml10s")
|
||||
runtime! autoload/xml/xhtml10s.vim
|
||||
endif
|
||||
" }}}
|
||||
"
|
||||
let attrs = keys(g:xmldata_xhtml10s[tag][1])
|
||||
|
||||
for m in sort(attrs)
|
||||
if m =~ '^'.attr
|
||||
if m =~ '^\(ismap\|defer\|declare\|nohref\|checked\|disabled\|selected\|readonly\)$' || m =~ '='
|
||||
call add(res, m)
|
||||
else
|
||||
call add(res, m.'="')
|
||||
endif
|
||||
call add(res, m)
|
||||
elseif m =~ attr
|
||||
if m =~ '^\(ismap\|defer\|declare\|nohref\|checked\|disabled\|selected\|readonly\)$' || m =~ '='
|
||||
call add(res2, m)
|
||||
else
|
||||
call add(res2, m.'="')
|
||||
endif
|
||||
call add(res2, m)
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
let menu = res + res2
|
||||
if has_key(g:xmldata_xhtml10s, 'vimxmlattrinfo')
|
||||
let final_menu = []
|
||||
for i in range(len(menu))
|
||||
let item = menu[i]
|
||||
if has_key(g:xmldata_xhtml10s['vimxmlattrinfo'], item)
|
||||
let m_menu = g:xmldata_xhtml10s['vimxmlattrinfo'][item][0]
|
||||
let m_info = g:xmldata_xhtml10s['vimxmlattrinfo'][item][1]
|
||||
if m_menu !~ 'Bool'
|
||||
let item .= '="'
|
||||
endif
|
||||
else
|
||||
let m_menu = ''
|
||||
let m_info = ''
|
||||
let item .= '="'
|
||||
endif
|
||||
let final_menu += [{'word':item, 'menu':m_menu, 'info':m_info}]
|
||||
endfor
|
||||
else
|
||||
let final_menu = map(menu, 'v:val."=\""')
|
||||
endif
|
||||
return final_menu
|
||||
|
||||
endif
|
||||
" Close tag
|
||||
" }}}
|
||||
" Close tag {{{
|
||||
let b:unaryTagsStack = "base meta link hr br param img area input col"
|
||||
if context =~ '^\/'
|
||||
let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
|
||||
return [opentag.">"]
|
||||
endif
|
||||
" Deal with tag completion.
|
||||
let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
|
||||
|
||||
" Load data {{{
|
||||
if !exists("g:xmldata_xhtml10s")
|
||||
runtime! autoload/xml/xhtml10s.vim
|
||||
endif
|
||||
" }}}
|
||||
" Tag completion {{{
|
||||
" Deal with tag completion.
|
||||
let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
|
||||
if opentag == ''
|
||||
" Hack for sometimes failing GetLastOpenTag.
|
||||
" As far as I tested fail isn't GLOT fault but problem
|
||||
" of invalid document - not properly closed tags and other mish-mash.
|
||||
" Also when document is empty. Return list of *all* tags.
|
||||
let tags = keys(g:xmldata_xhtml10s)
|
||||
call filter(tags, 'v:val !~ "^vimxml"')
|
||||
else
|
||||
let tags = g:xmldata_xhtml10s[opentag][0]
|
||||
endif
|
||||
" }}}
|
||||
|
||||
let tags = g:xmldata_xhtml10s[opentag][0]
|
||||
|
||||
for m in sort(tags)
|
||||
if m =~ '^'.context
|
||||
@@ -470,8 +568,27 @@ function! htmlcomplete#CompleteTags(findstart, base)
|
||||
call add(res2, m)
|
||||
endif
|
||||
endfor
|
||||
let menu = res + res2
|
||||
if has_key(g:xmldata_xhtml10s, 'vimxmltaginfo')
|
||||
let final_menu = []
|
||||
for i in range(len(menu))
|
||||
let item = menu[i]
|
||||
if has_key(g:xmldata_xhtml10s['vimxmltaginfo'], item)
|
||||
let m_menu = g:xmldata_xhtml10s['vimxmltaginfo'][item][0]
|
||||
let m_info = g:xmldata_xhtml10s['vimxmltaginfo'][item][1]
|
||||
else
|
||||
let m_menu = ''
|
||||
let m_info = ''
|
||||
endif
|
||||
let final_menu += [{'word':item, 'menu':m_menu, 'info':m_info}]
|
||||
endfor
|
||||
else
|
||||
let final_menu = menu
|
||||
endif
|
||||
return final_menu
|
||||
|
||||
return res + res2
|
||||
|
||||
" }}}
|
||||
endif
|
||||
endfunction
|
||||
" vim:set foldmethod=marker:
|
||||
|
||||
625
runtime/autoload/javascriptcomplete.vim
Normal file
625
runtime/autoload/javascriptcomplete.vim
Normal file
@@ -0,0 +1,625 @@
|
||||
" Vim completion script
|
||||
" Language: Java Script
|
||||
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" Last Change: 2006 Feb 6
|
||||
|
||||
function! javascriptcomplete#CompleteJS(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
|
||||
" Bit risky but JS is rather limited language and local chars shouldn't
|
||||
" fint way into names
|
||||
while start >= 0 && line[start - 1] =~ '\k'
|
||||
let start -= 1
|
||||
endwhile
|
||||
let b:compl_context = getline('.')[0:compl_begin]
|
||||
return start
|
||||
else
|
||||
" Initialize base return lists
|
||||
let res = []
|
||||
let res2 = []
|
||||
" a:base is very short - we need context
|
||||
" Shortcontext is context without a:base, useful for checking if we are
|
||||
" looking for objects and for what objects we are looking for
|
||||
let context = b:compl_context
|
||||
let shortcontext = substitute(context, a:base.'$', '', '')
|
||||
unlet! b:compl_context
|
||||
|
||||
if exists("b:jsrange")
|
||||
let file = getline(b:jsrange[0],b:jsrange[1])
|
||||
unlet! b:jsrange
|
||||
|
||||
if len(b:js_extfiles) > 0
|
||||
let file = b:js_extfiles + file
|
||||
endif
|
||||
|
||||
else
|
||||
let file = getline(1, '$')
|
||||
endif
|
||||
|
||||
|
||||
" Completion of properties, methods, etc. {{{
|
||||
if shortcontext =~ '\.$'
|
||||
" Complete methods and properties for objects
|
||||
" DOM separate
|
||||
let doms = ['style.']
|
||||
" Arrays
|
||||
let arrayprop = ['constructor', 'index', 'input', 'length', 'prototype']
|
||||
let arraymeth = ['concat', 'join', 'pop', 'push', 'reverse', 'shift',
|
||||
\ 'splice', 'sort', 'toSource', 'toString', 'unshift', 'valueOf',
|
||||
\ 'watch', 'unwatch']
|
||||
call map(arraymeth, 'v:val."("')
|
||||
let arrays = arrayprop + arraymeth
|
||||
|
||||
" Boolean - complete subset of array values
|
||||
" properties - constructor, prototype
|
||||
" methods - toSource, toString, valueOf
|
||||
|
||||
" Date
|
||||
" properties - constructor, prototype
|
||||
let datemeth = ['getDate', 'getDay', 'getFullYear', 'getHours', 'getMilliseconds',
|
||||
\ 'getMinutes', 'getMonth', 'getSeconds', 'getTime', 'getTimezoneOffset',
|
||||
\ 'getUTCDate', 'getUTCDay', 'getUTCFullYear', 'getUTCHours', 'getUTCMilliseconds',
|
||||
\ 'getUTCMinutes', 'getUTCMonth', 'getUTCSeconds',
|
||||
\ 'getYear', 'parse', 'parse',
|
||||
\ 'setDate', 'setDay', 'setFullYear', 'setHours', 'setMilliseconds',
|
||||
\ 'setMinutes', 'setMonth', 'setSeconds',
|
||||
\ 'setUTCDate', 'setUTCDay', 'setUTCFullYear', 'setUTCHours', 'setUTCMilliseconds',
|
||||
\ 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds', 'setYear', 'setTime',
|
||||
\ 'toGMTString', 'toLocaleString', 'toLocaleDateString', 'toLocaleTimeString',
|
||||
\ 'toSource', 'toString', 'toUTCString', 'UTC', 'valueOf', 'watch', 'unwatch']
|
||||
call map(datemeth, 'v:val."("')
|
||||
let dates = datemeth
|
||||
|
||||
" Function
|
||||
let funcprop = ['arguments', 'arguments.callee', 'arguments.caller', 'arguments.length',
|
||||
\ 'arity', 'constructor', 'length', 'prototype']
|
||||
let funcmeth = ['apply', 'call', 'toSource', 'toString', 'valueOf']
|
||||
call map(funcmeth, 'v:val."("')
|
||||
let funcs = funcprop + funcmeth
|
||||
|
||||
" Math
|
||||
let mathprop = ['E', 'LN2', 'LN10', 'LOG2E', 'LOG10E', 'PI', 'SQRT1_2', 'SQRT']
|
||||
let mathmeth = ['abs', 'acos', 'asin', 'atan', 'atan2', 'ceil', 'cos', 'exp', 'floor',
|
||||
\ 'log', 'max', 'min', 'pow', 'random', 'round', 'sin', 'sqrt', 'tan',
|
||||
\ 'watch', 'unwatch']
|
||||
call map(mathmeth, 'v:val."("')
|
||||
let maths = mathprop + mathmeth
|
||||
|
||||
" Number
|
||||
let numbprop = ['MAX_VALUE', 'MIN_VALUE', 'NaN', 'NEGATIVE_INFINITY', 'POSITIVE_INFINITY',
|
||||
\ 'constructor', 'prototype']
|
||||
let numbmeth = ['toExponential', 'toFixed', 'toPrecision', 'toSource', 'toString', 'valueOf',
|
||||
\ 'watch', 'unwatch']
|
||||
call map(numbmeth, 'v:val."("')
|
||||
let numbs = numbprop + numbmeth
|
||||
|
||||
" Object
|
||||
let objeprop = ['constructor', 'prototype']
|
||||
let objemeth = ['eval', 'toSource', 'toString', 'unwatch', 'watch', 'valueOf']
|
||||
call map(objemeth, 'v:val."("')
|
||||
let objes = objeprop + objemeth
|
||||
|
||||
" RegExp
|
||||
let regeprop = ['constructor', 'global', 'ignoreCase', 'lastIndex', 'multiline', 'source', 'prototype']
|
||||
let regemeth = ['exec', 'test', 'toSource', 'toString', 'watch', 'unwatch']
|
||||
call map(regemeth, 'v:val."("')
|
||||
let reges = regeprop + regemeth
|
||||
|
||||
" String
|
||||
let striprop = ['constructor', 'length', 'prototype']
|
||||
let strimeth = ['anchor', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'concat',
|
||||
\ 'fixed', 'fontcolor', 'fontsize', 'fromCharCode', 'indexOf', 'italics',
|
||||
\ 'lastIndexOf', 'link', 'match', 'replace', 'search', 'slice', 'small',
|
||||
\ 'split', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLowerCase',
|
||||
\ 'toSource', 'toString', 'toUpperCase', 'watch', 'unwatch']
|
||||
call map(strimeth, 'v:val."("')
|
||||
let stris = striprop + strimeth
|
||||
|
||||
" User created properties
|
||||
let user_props1 = filter(copy(file), 'v:val =~ "this\\.\\k"')
|
||||
let juser_props1 = join(user_props1, ' ')
|
||||
let user_props1 = split(juser_props1, '\zethis\.')
|
||||
unlet! juser_props1
|
||||
call map(user_props1, 'matchstr(v:val, "this\\.\\zs\\k\\+\\ze")')
|
||||
|
||||
let user_props2 = filter(copy(file), 'v:val =~ "\\.prototype\\.\\k"')
|
||||
let juser_props2 = join(user_props2, ' ')
|
||||
let user_props2 = split(juser_props2, '\zeprototype\.')
|
||||
unlet! juser_props2
|
||||
call map(user_props2, 'matchstr(v:val, "prototype\\.\\zs\\k\\+\\ze")')
|
||||
let user_props = user_props1 + user_props2
|
||||
|
||||
" HTML DOM properties
|
||||
" Anchors - anchor.
|
||||
let anchprop = ['accessKey', 'charset', 'coords', 'href', 'hreflang', 'id', 'innerHTML',
|
||||
\ 'name', 'rel', 'rev', 'shape', 'tabIndex', 'target', 'type', 'onBlur', 'onFocus']
|
||||
let anchmeth = ['blur', 'focus']
|
||||
call map(anchmeth, 'v:val."("')
|
||||
let anths = anchprop + anchmeth
|
||||
" Area - area.
|
||||
let areaprop = ['accessKey', 'alt', 'coords', 'hash', 'host', 'hostname', 'href', 'id',
|
||||
\ 'noHref', 'pathname', 'port', 'protocol', 'search', 'shape', 'tabIndex', 'target']
|
||||
let areameth = ['onClick', 'onDblClick', 'onMouseOut', 'onMouseOver']
|
||||
call map(areameth, 'v:val."("')
|
||||
let areas = areaprop + areameth
|
||||
" Base - base.
|
||||
let baseprop = ['href', 'id', 'target']
|
||||
let bases = baseprop
|
||||
" Body - body.
|
||||
let bodyprop = ['aLink', 'background', 'gbColor', 'id', 'link', 'scrollLeft', 'scrollTop',
|
||||
\ 'text', 'vLink']
|
||||
let bodys = bodyprop
|
||||
" Document - document.
|
||||
let docuprop = ['anchors', 'applets', 'childNodes', 'embeds', 'forms', 'images', 'links', 'stylesheets',
|
||||
\ 'body', 'cookie', 'documentElement', 'domain', 'lastModified', 'referrer', 'title', 'URL']
|
||||
let documeth = ['close', 'createAttribute', 'createElement', 'createTextNode', 'focus', 'getElementById',
|
||||
\ 'getElementsByName', 'getElementsByTagName', 'open', 'write', 'writeln',
|
||||
\ 'onClick', 'onDblClick', 'onFocus', 'onKeyDown', 'onKeyPress', 'onKeyUp',
|
||||
\ 'onMouseDown', 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp', 'onResize']
|
||||
call map(documeth, 'v:val."("')
|
||||
let docuxprop = ['attributes', 'childNodes', 'doctype', 'documentElement', 'firstChild',
|
||||
\ 'implementation', 'namespaceURI', 'nextSibling', 'nodeName', 'nodeType',
|
||||
\ 'nodeValue', 'ownerDocument', 'parentNode', 'previousSibling']
|
||||
let docuxmeth = ['createAttribute', 'createCDATASection',
|
||||
\ 'createComment', 'createDocument', 'createDocumentFragment',
|
||||
\ 'createElement', 'createEntityReference', 'createProcessingInstruction',
|
||||
\ 'createTextNode']
|
||||
call map(docuxmeth, 'v:val."("')
|
||||
let docus = docuprop + docuxprop + documeth + docuxmeth
|
||||
" Form - form.
|
||||
let formprop = ['elements', 'acceptCharset', 'action', 'encoding', 'enctype', 'id', 'length',
|
||||
\ 'method', 'name', 'tabIndex', 'target']
|
||||
let formmeth = ['reset', 'submit', 'onReset', 'onSubmit']
|
||||
call map(formmeth, 'v:val."("')
|
||||
let forms = formprop + formmeth
|
||||
" Frame - frame.
|
||||
let framprop = ['contentDocument', 'frameBorder', 'id', 'longDesc', 'marginHeight', 'marginWidth',
|
||||
\ 'name', 'noResize', 'scrolling', 'src']
|
||||
let frammeth = ['blur', 'focus']
|
||||
call map(frammeth, 'v:val."("')
|
||||
let frams = framprop + frammeth
|
||||
" Frameset - frameset.
|
||||
let fsetprop = ['cols', 'id', 'rows']
|
||||
let fsetmeth = ['blur', 'focus']
|
||||
call map(fsetmeth, 'v:val."("')
|
||||
let fsets = fsetprop + fsetmeth
|
||||
" History - history.
|
||||
let histprop = ['length']
|
||||
let histmeth = ['back', 'forward', 'go']
|
||||
call map(histmeth, 'v:val."("')
|
||||
let hists = histprop + histmeth
|
||||
" Iframe - iframe.
|
||||
let ifraprop = ['align', 'frameBorder', 'height', 'id', 'longDesc', 'marginHeight', 'marginWidth',
|
||||
\ 'name', 'scrolling', 'src', 'width']
|
||||
let ifras = ifraprop
|
||||
" Image - image.
|
||||
let imagprop = ['align', 'alt', 'border', 'complete', 'height', 'hspace', 'id', 'isMap', 'longDesc',
|
||||
\ 'lowSrc', 'name', 'src', 'useMap', 'vspace', 'width']
|
||||
let imagmeth = ['onAbort', 'onError', 'onLoad']
|
||||
call map(imagmeth, 'v:val."("')
|
||||
let imags = histprop + imagmeth
|
||||
" Button - accessible only by other properties
|
||||
let buttprop = ['accessKey', 'disabled', 'form', 'id', 'name', 'tabIndex', 'type', 'value']
|
||||
let buttmeth = ['blur', 'click', 'focus', 'onBlur', 'onClick', 'onFocus', 'onMouseDown', 'onMouseUp']
|
||||
call map(buttmeth, 'v:val."("')
|
||||
let butts = buttprop + buttmeth
|
||||
" Checkbox - accessible only by other properties
|
||||
let checprop = ['accept', 'accessKey', 'align', 'alt', 'checked', 'defaultChecked',
|
||||
\ 'disabled', 'form', 'id', 'name', 'tabIndex', 'type', 'value']
|
||||
let checmeth = ['blur', 'click', 'focus', 'onBlur', 'onClick', 'onFocus', 'onMouseDown', 'onMouseUp']
|
||||
call map(checmeth, 'v:val."("')
|
||||
let checs = checprop + checmeth
|
||||
" File upload - accessible only by other properties
|
||||
let fileprop = ['accept', 'accessKey', 'align', 'alt', 'defaultValue',
|
||||
\ 'disabled', 'form', 'id', 'name', 'tabIndex', 'type', 'value']
|
||||
let filemeth = ['blur', 'focus', 'onBlur', 'onClick', 'onFocus', 'onMouseDown', 'onMouseUp']
|
||||
call map(filemeth, 'v:val."("')
|
||||
let files = fileprop + filemeth
|
||||
" Hidden - accessible only by other properties
|
||||
let hiddprop = ['defaultValue', 'form', 'id', 'name', 'type', 'value']
|
||||
let hidds = hiddprop
|
||||
" Password - accessible only by other properties
|
||||
let passprop = ['accept', 'accessKey', 'defaultValue',
|
||||
\ 'disabled', 'form', 'id', 'maxLength', 'name', 'readOnly', 'size', 'tabIndex',
|
||||
\ 'type', 'value']
|
||||
let passmeth = ['blur', 'click', 'focus', 'select', 'onBlur', 'onFocus', 'onKeyDown',
|
||||
\ 'onKeyPress', 'onKeyUp']
|
||||
call map(passmeth, 'v:val."("')
|
||||
let passs = passprop + passmeth
|
||||
" Radio - accessible only by other properties
|
||||
let radiprop = ['accept', 'accessKey', 'align', 'alt', 'checked', 'defaultChecked',
|
||||
\ 'disabled', 'form', 'id', 'name', 'tabIndex', 'type', 'value']
|
||||
let radimeth = ['blur', 'click', 'focus', 'select', 'onBlur', 'onFocus']
|
||||
call map(radimeth, 'v:val."("')
|
||||
let radis = radiprop + radimeth
|
||||
" Reset - accessible only by other properties
|
||||
let reseprop = ['accept', 'accessKey', 'align', 'alt', 'defaultValue',
|
||||
\ 'disabled', 'form', 'id', 'name', 'size', 'tabIndex', 'type', 'value']
|
||||
let resemeth = ['blur', 'click', 'focus', 'select', 'onBlur', 'onFocus']
|
||||
call map(resemeth, 'v:val."("')
|
||||
let reses = reseprop + resemeth
|
||||
" Submit - accessible only by other properties
|
||||
let submprop = ['accept', 'accessKey', 'align', 'alt', 'defaultValue',
|
||||
\ 'disabled', 'form', 'id', 'name', 'size', 'tabIndex', 'type', 'value']
|
||||
let submmeth = ['blur', 'click', 'focus', 'select', 'onClick', 'onSelectStart']
|
||||
call map(submmeth, 'v:val."("')
|
||||
let subms = submprop + submmeth
|
||||
" Text - accessible only by other properties
|
||||
let textprop = ['accept', 'accessKey', 'align', 'alt', 'defaultValue',
|
||||
\ 'disabled', 'form', 'id', 'maxLength', 'name', 'readOnly',
|
||||
\ 'size', 'tabIndex', 'type', 'value']
|
||||
let textmeth = ['blur', 'focus', 'select', 'onBlur', 'onChange', 'onFocus', 'onKeyDown',
|
||||
\ 'onKeyPress', 'onKeyUp', 'onSelect']
|
||||
call map(textmeth, 'v:val."("')
|
||||
let texts = textprop + textmeth
|
||||
" Link - link.
|
||||
let linkprop = ['charset', 'disabled', 'href', 'hreflang', 'id', 'media',
|
||||
\ 'rel', 'rev', 'target', 'type']
|
||||
let linkmeth = ['onLoad']
|
||||
call map(linkmeth, 'v:val."("')
|
||||
let links = linkprop + linkmeth
|
||||
" Location - location.
|
||||
let locaprop = ['href', 'hash', 'host', 'hostname', 'pathname', 'port', 'protocol',
|
||||
\ 'search']
|
||||
let locameth = ['assign', 'reload', 'replace']
|
||||
call map(locameth, 'v:val."("')
|
||||
let locas = locaprop + locameth
|
||||
" Meta - meta.
|
||||
let metaprop = ['charset', 'content', 'disabled', 'httpEquiv', 'name', 'scheme']
|
||||
let metas = metaprop
|
||||
" Navigator - navigator.
|
||||
let naviprop = ['plugins', 'appCodeName', 'appName', 'appVersion', 'cookieEnabled',
|
||||
\ 'platform', 'userAgent']
|
||||
let navimeth = ['javaEnabled', 'taintEnabled']
|
||||
call map(navimeth, 'v:val."("')
|
||||
let navis = naviprop + navimeth
|
||||
" Object - object.
|
||||
let objeprop = ['align', 'archive', 'border', 'code', 'codeBase', 'codeType', 'data',
|
||||
\ 'declare', 'form', 'height', 'hspace', 'id', 'name', 'standby', 'tabIndex',
|
||||
\ 'type', 'useMap', 'vspace', 'width']
|
||||
let objes = objeprop
|
||||
" Option - accessible only by other properties
|
||||
let optiprop = ['defaultSelected',
|
||||
\ 'disabled', 'form', 'id', 'index', 'label', 'selected', 'text', 'value']
|
||||
let optis = optiprop
|
||||
" Screen - screen.
|
||||
let screprop = ['availHeight', 'availWidth', 'colorDepth', 'height', 'width']
|
||||
let scres = screprop
|
||||
" Select - accessible only by other properties
|
||||
let seleprop = ['options', 'disabled', 'form', 'id', 'length', 'multiple', 'name',
|
||||
\ 'selectedIndex', 'size', 'tabIndex', 'type', 'value']
|
||||
let selemeth = ['blur', 'focus', 'remove', 'onBlur', 'onChange', 'onFocus']
|
||||
call map(selemeth, 'v:val."("')
|
||||
let seles = seleprop + selemeth
|
||||
" Style - style.
|
||||
let stylprop = ['background', 'backgroundAttachment', 'backgroundColor', 'backgroundImage',
|
||||
\ 'backgroundPosition', 'backgroundRepeat',
|
||||
\ 'border', 'borderBottom', 'borderLeft', 'borderRight', 'borderTop',
|
||||
\ 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor',
|
||||
\ 'borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle',
|
||||
\ 'borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth',
|
||||
\ 'borderColor', 'borderStyle', 'borderWidth', 'margin', 'marginBottom',
|
||||
\ 'marginLeft', 'marginRight', 'marginTop', 'outline', 'outlineStyle', 'outlineWidth',
|
||||
\ 'outlineColor', 'outlineStyle', 'outlineWidth', 'padding', 'paddingBottom',
|
||||
\ 'paddingLeft', 'paddingRight', 'paddingTop',
|
||||
\ 'clear', 'clip', 'clipBottom', 'clipLeft', 'clipRight', 'clipTop', 'content',
|
||||
\ 'counterIncrement', 'counterReset', 'cssFloat', 'cursor', 'direction',
|
||||
\ 'display', 'markerOffset', 'marks', 'maxHeight', 'maxWidth', 'minHeight',
|
||||
\ 'minWidth', 'overflow', 'overflowX', 'overflowY', 'verticalAlign', 'visibility',
|
||||
\ 'width',
|
||||
\ 'listStyle', 'listStyleImage', 'listStylePosition', 'listStyleType',
|
||||
\ 'cssText', 'bottom', 'height', 'left', 'position', 'right', 'top', 'width', 'zindex',
|
||||
\ 'orphans', 'widows', 'page', 'pageBreakAfter', 'pageBreakBefore', 'pageBreakInside',
|
||||
\ 'borderCollapse', 'borderSpacing', 'captionSide', 'emptyCells', 'tableLayout',
|
||||
\ 'color', 'font', 'fontFamily', 'fontSize', 'fontSizeAdjust', 'fontStretch',
|
||||
\ 'fontStyle', 'fontVariant', 'fontWeight', 'letterSpacing', 'lineHeight', 'quotes',
|
||||
\ 'textAlign', 'textIndent', 'textShadow', 'textTransform', 'textUnderlinePosition',
|
||||
\ 'unicodeBidi', 'whiteSpace', 'wordSpacing']
|
||||
let styls = stylprop
|
||||
" Table - table.
|
||||
let tablprop = ['rows', 'tBodies', 'align', 'bgColor', 'border', 'caption', 'cellPadding',
|
||||
\ 'cellSpacing', 'frame', 'height', 'rules', 'summary', 'tFoot', 'tHead', 'width']
|
||||
let tablmeth = ['createCaption', 'createTFoot', 'createTHead', 'deleteCaption', 'deleteRow',
|
||||
\ 'deleteTFoot', 'deleteTHead', 'insertRow']
|
||||
call map(tablmeth, 'v:val."("')
|
||||
let tabls = tablprop + tablmeth
|
||||
" Table data - TableData.
|
||||
let tdatprop = ['abbr', 'align', 'axis', 'bgColor', 'cellIndex', 'ch', 'chOff',
|
||||
\ 'colSpan', 'headers', 'noWrap', 'rowSpan', 'scope', 'vAlign', 'width']
|
||||
let tdats = tdatprop
|
||||
" Table row - TableRow.
|
||||
let trowprop = ['cells', 'align', 'bgColor', 'ch', 'chOff', 'rowIndex', 'sectionRowIndex',
|
||||
\ 'vAlign']
|
||||
let trowmeth = ['deleteCell', 'insertCell']
|
||||
call map(trowmeth, 'v:val."("')
|
||||
let trows = trowprop + trowmeth
|
||||
" Textarea - accessible only by other properties
|
||||
let tareprop = ['accessKey', 'cols', 'defaultValue',
|
||||
\ 'disabled', 'form', 'id', 'name', 'readOnly', 'rows',
|
||||
\ 'tabIndex', 'type', 'value', 'selectionStart', 'selectionEnd']
|
||||
let taremeth = ['blur', 'focus', 'select', 'onBlur', 'onChange', 'onFocus']
|
||||
call map(taremeth, 'v:val."("')
|
||||
let tares = tareprop + taremeth
|
||||
" Window - window.
|
||||
let windprop = ['frames', 'closed', 'defaultStatus', 'encodeURI', 'event', 'history',
|
||||
\ 'length', 'location', 'name', 'onload', 'opener', 'parent', 'screen', 'self',
|
||||
\ 'status', 'top', 'XMLHttpRequest', 'ActiveXObject']
|
||||
let windmeth = ['alert', 'blur', 'clearInterval', 'clearTimeout', 'close', 'confirm', 'focus',
|
||||
\ 'moveBy', 'moveTo', 'open', 'print', 'prompt', 'scrollBy', 'scrollTo', 'setInterval',
|
||||
\ 'setTimeout']
|
||||
call map(windmeth, 'v:val."("')
|
||||
let winds = windprop + windmeth
|
||||
" XMLHttpRequest - access by new xxx()
|
||||
let xmlhprop = ['onreadystatechange', 'readyState', 'responseText', 'responseXML',
|
||||
\ 'status', 'statusText', 'parseError']
|
||||
let xmlhmeth = ['abort', 'getAllResponseHeaders', 'getResponseHeaders', 'open',
|
||||
\ 'send', 'setRequestHeader']
|
||||
call map(xmlhmeth, 'v:val."("')
|
||||
let xmlhs = xmlhprop + xmlhmeth
|
||||
|
||||
" XML DOM
|
||||
" Attributes - element.attributes[x].
|
||||
let xdomattrprop = ['name', 'specified', 'value']
|
||||
" Element - anyelement.
|
||||
let xdomelemprop = ['attributes', 'childNodes', 'firstChild', 'lastChild',
|
||||
\ 'namespaceURI', 'nextSibling', 'nodeName', 'nodeType', 'nodeValue',
|
||||
\ 'ownerDocument', 'parentNode', 'prefix', 'previousSibling', 'tagName']
|
||||
let xdomelemmeth = ['appendChild', 'cloneNode', 'getAttribute', 'getAttributeNode',
|
||||
\ 'getElementsByTagName', 'hasChildNodes', 'insertBefore', 'normalize',
|
||||
\ 'removeAttribute', 'removeAttributeNode', 'removeChild', 'replaceChild',
|
||||
\ 'setAttribute', 'setAttributeNode']
|
||||
call map(xdomelemmeth, 'v:val."("')
|
||||
let xdomelems = xdomelemprop + xdomelemmeth
|
||||
" Node - anynode.
|
||||
let xdomnodeprop = ['attributes', 'childNodes', 'firstChild', 'lastChild',
|
||||
\ 'namespaceURI', 'nextSibling', 'nodeName', 'nodeType', 'nodeValue',
|
||||
\ 'ownerDocument', 'parentNode', 'prefix', 'previousSibling']
|
||||
let xdomnodemeth = ['appendChild', 'cloneNode',
|
||||
\ 'hasChildNodes', 'insertBefore', 'removeChild', 'replaceChild']
|
||||
call map(xdomnodemeth, 'v:val."("')
|
||||
let xdomnodes = xdomnodeprop + xdomnodemeth
|
||||
" NodeList
|
||||
let xdomnliss = ['length', 'item(']
|
||||
" Error - parseError.
|
||||
let xdomerror = ['errorCode', 'reason', 'line', 'linepos', 'srcText', 'url', 'filepos']
|
||||
|
||||
" Find object type declaration to reduce number of suggestions. {{{
|
||||
" 1. Get object name
|
||||
" 2. Find object declaration line
|
||||
" 3. General declaration follows "= new Type" syntax, additional else
|
||||
" for regexp "= /re/"
|
||||
" 4. Make correction for Microsoft.XMLHTTP ActiveXObject
|
||||
" 5. Repeat for external files
|
||||
let object = matchstr(shortcontext, '\zs\k\+\ze\(\[.\{-}\]\)\?\.$')
|
||||
if len(object) > 0
|
||||
let decl_line = search(object.'.\{-}=\s*new\s*', 'bn')
|
||||
if decl_line > 0
|
||||
let object_type = matchstr(getline(decl_line), object.'.\{-}=\s*new\s*\zs\k\+\ze')
|
||||
if object_type == 'ActiveXObject' && matchstr(getline(decl_line), object.'.\{-}=\s*new\s*ActiveXObject\s*(.Microsoft\.XMLHTTP.)') != ''
|
||||
let object_type = 'XMLHttpRequest'
|
||||
endif
|
||||
else
|
||||
let decl_line = search('var\s*'.object.'\s*=\s*\/', 'bn')
|
||||
if decl_line > 0
|
||||
let object_type = 'RegExp'
|
||||
endif
|
||||
endif
|
||||
" We didn't find var declaration in current file but we may have
|
||||
" something in external files.
|
||||
if decl_line == 0 && exists("b:js_extfiles")
|
||||
let dext_line = filter(copy(b:js_extfiles), 'v:val =~ "'.object.'.\\{-}=\\s*new\\s*"')
|
||||
if len(dext_line) > 0
|
||||
let object_type = matchstr(dext_line[-1], object.'.\{-}=\s*new\s*\zs\k\+\ze')
|
||||
if object_type == 'ActiveXObject' && matchstr(dext_line[-1], object.'.\{-}=\s*new\s*ActiveXObject\s*(.Microsoft\.XMLHTTP.)') != ''
|
||||
let object_type = 'XMLHttpRequest'
|
||||
endif
|
||||
else
|
||||
let dext_line = filter(copy(b:js_extfiles), 'v:val =~ "var\s*'.object.'\\s*=\\s*\\/"')
|
||||
if len(dext_line) > 0
|
||||
let object_type = 'RegExp'
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
" }}}
|
||||
|
||||
if !exists('object_type')
|
||||
let object_type = ''
|
||||
endif
|
||||
|
||||
if object_type == 'Date'
|
||||
let values = dates
|
||||
elseif object_type == 'Image'
|
||||
let values = imags
|
||||
elseif object_type == 'Array'
|
||||
let values = arrays
|
||||
elseif object_type == 'Boolean'
|
||||
" TODO: a bit more than real boolean
|
||||
let values = arrays
|
||||
elseif object_type == 'XMLHttpRequest'
|
||||
let values = xmlhs
|
||||
elseif object_type == 'String'
|
||||
let values = stris
|
||||
elseif object_type == 'RegExp'
|
||||
let values = reges
|
||||
elseif object_type == 'Math'
|
||||
let values = maths
|
||||
endif
|
||||
|
||||
if !exists('values')
|
||||
" List of properties
|
||||
if shortcontext =~ 'Math\.$'
|
||||
let values = maths
|
||||
elseif shortcontext =~ 'anchors\(\[.\{-}\]\)\?\.$'
|
||||
let values = anths
|
||||
elseif shortcontext =~ 'area\.$'
|
||||
let values = areas
|
||||
elseif shortcontext =~ 'base\.$'
|
||||
let values = bases
|
||||
elseif shortcontext =~ 'body\.$'
|
||||
let values = bodys
|
||||
elseif shortcontext =~ 'document\.$'
|
||||
let values = docus
|
||||
elseif shortcontext =~ 'forms\(\[.\{-}\]\)\?\.$'
|
||||
let values = forms
|
||||
elseif shortcontext =~ 'frameset\.$'
|
||||
let values = fsets
|
||||
elseif shortcontext =~ 'history\.$'
|
||||
let values = hists
|
||||
elseif shortcontext =~ 'iframe\.$'
|
||||
let values = ifras
|
||||
elseif shortcontext =~ 'images\(\[.\{-}\]\)\?\.$'
|
||||
let values = imags
|
||||
elseif shortcontext =~ 'links\(\[.\{-}\]\)\?\.$'
|
||||
let values = links
|
||||
elseif shortcontext =~ 'location\.$'
|
||||
let values = locas
|
||||
elseif shortcontext =~ 'meta\.$'
|
||||
let values = metas
|
||||
elseif shortcontext =~ 'navigator\.$'
|
||||
let values = navis
|
||||
elseif shortcontext =~ 'object\.$'
|
||||
let values = objes
|
||||
elseif shortcontext =~ 'screen\.$'
|
||||
let values = scres
|
||||
elseif shortcontext =~ 'style\.$'
|
||||
let values = styls
|
||||
elseif shortcontext =~ 'table\.$'
|
||||
let values = tabls
|
||||
elseif shortcontext =~ 'TableData\.$'
|
||||
let values = tdats
|
||||
elseif shortcontext =~ 'TableRow\.$'
|
||||
let values = trows
|
||||
elseif shortcontext =~ 'window\.$'
|
||||
let values = winds
|
||||
elseif shortcontext =~ 'parseError\.$'
|
||||
let values = xdomerror
|
||||
elseif shortcontext =~ 'attributes\[\d\+\]\.$'
|
||||
let values = xdomattrprop
|
||||
else
|
||||
let values = user_props + arrays + dates + funcs + maths + numbs + objes + reges + stris
|
||||
let values += doms + anths + areas + bases + bodys + docus + forms + frams + fsets + hists
|
||||
let values += ifras + imags + links + locas + metas + navis + objes + scres
|
||||
let values += tabls + trows + tares + winds
|
||||
let values += xdomnodes + xdomnliss + xdomelems
|
||||
endif
|
||||
endif
|
||||
|
||||
for m in values
|
||||
if m =~? '^'.a:base
|
||||
call add(res, m)
|
||||
elseif m =~? a:base
|
||||
call add(res2, m)
|
||||
endif
|
||||
endfor
|
||||
|
||||
unlet! values
|
||||
return res + res2
|
||||
|
||||
endif
|
||||
" }}}
|
||||
|
||||
" Get variables data.
|
||||
let variables = filter(copy(file), 'v:val =~ "var\\s"')
|
||||
call map(variables, 'matchstr(v:val, ".\\{-}var\\s\\+\\zs.*\\ze")')
|
||||
call map(variables, 'substitute(v:val, ";\\|$", ",", "g")')
|
||||
let vars = []
|
||||
" This loop (and next one) is necessary to get variable names from
|
||||
" constructs like: var var1, var2, var3 = "something";
|
||||
for i in range(len(variables))
|
||||
let comma_separated = split(variables[i], ',\s*')
|
||||
call map(comma_separated, 'matchstr(v:val, "\\k\\+")')
|
||||
let vars += comma_separated
|
||||
endfor
|
||||
|
||||
let variables = sort(vars)
|
||||
unlet! vars
|
||||
|
||||
" Add "no var" variables.
|
||||
let undeclared_variables = filter(copy(file), 'v:val =~ "^\\s*\\k\\+\\s*="')
|
||||
let u_vars = []
|
||||
for i in range(len(undeclared_variables))
|
||||
let split_equal = split(undeclared_variables[i], '\s*=')
|
||||
call map(split_equal, 'matchstr(v:val, "\\k\\+$")')
|
||||
let u_vars += split_equal
|
||||
endfor
|
||||
|
||||
let variables += sort(u_vars)
|
||||
unlet! u_vars
|
||||
|
||||
" Get functions
|
||||
let functions = filter(copy(file), 'v:val =~ "^\\s*function\\s"')
|
||||
let arguments = copy(functions)
|
||||
call map(functions, 'matchstr(v:val, "^\\s*function\\s\\+\\zs\\k\\+")')
|
||||
call map(functions, 'v:val."("')
|
||||
let functions = sort(functions)
|
||||
|
||||
" Create table to keep arguments for additional 'menu' info
|
||||
let b:js_menuinfo = {}
|
||||
for i in arguments
|
||||
let g:ia = i
|
||||
let f_elements = matchlist(i, 'function\s\+\(\k\+\)\s*(\(.\{-}\))')
|
||||
if len(f_elements) == 3
|
||||
let b:js_menuinfo[f_elements[1].'('] = f_elements[2]
|
||||
endif
|
||||
endfor
|
||||
|
||||
" Get functions arguments
|
||||
call map(arguments, 'matchstr(v:val, "function.\\{-}(\\zs.\\{-}\\ze)")')
|
||||
let jargs = join(arguments, ',')
|
||||
let jargs = substitute(jargs, '\s', '', 'g')
|
||||
let arguments = split(jargs, ',')
|
||||
let arguments = sort(arguments)
|
||||
|
||||
" Built-in functions
|
||||
let builtin = ['alert(', 'confirm(']
|
||||
|
||||
" Top-level HTML DOM objects
|
||||
let htmldom = ['document', 'anchor', 'area', 'base', 'body', 'document', 'event', 'form', 'frame', 'frameset', 'history', 'iframe', 'image', 'input', 'link', 'location', 'meta', 'navigator', 'object', 'option', 'screen', 'select', 'table', 'tableData', 'tableHeader', 'tableRow', 'textarea', 'window']
|
||||
call map(htmldom, 'v:val."."')
|
||||
|
||||
" Top-level properties
|
||||
let properties = ['decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent',
|
||||
\ 'eval', 'Infinity', 'isFinite', 'isNaN', 'NaN', 'Number', 'parseFloat',
|
||||
\ 'parseInt', 'String', 'undefined', 'escape', 'unescape']
|
||||
|
||||
" Keywords
|
||||
let keywords = ["Array", "Boolean", "Date", "Function", "Math", "Number", "Object", "RegExp", "String", "XMLHttpRequest", "ActiveXObject", "abstract", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "debugger", "default", "delete", "do", "double ", "else", "enum", "export", "extends", "false", "final", "finally", "float", "for", "function", "goto", "if", "implements", "import", "in ", "instanceof", "int", "interface", "long", "native", "new", "null", "package", "private", "protected", "public", "return", "short", "static", "super ", "switch", "synchronized", "this", "throw", "throws", "transient", "true", "try", "typeof", "var", "void", "volatile", "while", "with"]
|
||||
|
||||
let values = variables + functions + htmldom + arguments + builtin + properties + keywords
|
||||
|
||||
for m in values
|
||||
if m =~? '^'.a:base
|
||||
call add(res, m)
|
||||
elseif m =~? a:base
|
||||
call add(res2, m)
|
||||
endif
|
||||
endfor
|
||||
|
||||
let menu = res + res2
|
||||
let final_menu = []
|
||||
for i in range(len(menu))
|
||||
let item = menu[i]
|
||||
if item =~ '($'
|
||||
let kind = 'f'
|
||||
if has_key(b:js_menuinfo, item)
|
||||
let m_info = b:js_menuinfo[item]
|
||||
else
|
||||
let m_info = ''
|
||||
endif
|
||||
else
|
||||
let kind = 'v'
|
||||
let m_info = ''
|
||||
endif
|
||||
let final_menu += [{'word':item, 'menu':m_info, 'kind':kind}]
|
||||
endfor
|
||||
let g:fm = final_menu
|
||||
return final_menu
|
||||
|
||||
endfunction
|
||||
|
||||
" vim:set foldmethod=marker:
|
||||
@@ -1,7 +1,7 @@
|
||||
" netrw.vim: Handles file transfer and remote directory listing across a network
|
||||
" AUTOLOAD PORTION
|
||||
" Date: Nov 28, 2005
|
||||
" Version: 76
|
||||
" Date: Jan 30, 2006
|
||||
" Version: 78
|
||||
" 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
|
||||
@@ -23,7 +23,7 @@
|
||||
if &cp || exists("g:loaded_netrw")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_netrw = "v76"
|
||||
let g:loaded_netrw = "v78"
|
||||
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
|
||||
@@ -32,8 +32,12 @@ let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
" call Decho("doing autoload/netrw.vim")
|
||||
|
||||
" ======================
|
||||
" Netrw Variables: {{{1
|
||||
" ======================
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Default values for netrw's global protocol variables {{{1
|
||||
" Default values for netrw's global protocol variables {{{2
|
||||
if !exists("g:netrw_dav_cmd")
|
||||
let g:netrw_dav_cmd = "cadaver"
|
||||
endif
|
||||
@@ -84,14 +88,17 @@ if has("win32") || has("win95") || has("win64") || has("win16")
|
||||
endif
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Default values for netrw's global variables {{{1
|
||||
" Default values - a-c ---------- {{{2
|
||||
" Default values for netrw's global variables {{{2
|
||||
" Default values - a-c ---------- {{{3
|
||||
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_browse_split")
|
||||
let g:netrw_browse_split= 0
|
||||
endif
|
||||
if !exists("g:netrw_cygwin")
|
||||
if has("win32") || has("win95") || has("win64") || has("win16")
|
||||
if &shell == "bash"
|
||||
@@ -103,7 +110,7 @@ if !exists("g:netrw_cygwin")
|
||||
let g:netrw_cygwin= 0
|
||||
endif
|
||||
endif
|
||||
" Default values - d-f ---------- {{{2
|
||||
" Default values - d-f ---------- {{{3
|
||||
if !exists("g:NETRW_DIRHIST_CNT")
|
||||
let g:NETRW_DIRHIST_CNT= 0
|
||||
endif
|
||||
@@ -123,7 +130,7 @@ endif
|
||||
if !exists("g:netrw_ftpmode")
|
||||
let g:netrw_ftpmode= "binary"
|
||||
endif
|
||||
" Default values - h-lh ---------- {{{2
|
||||
" Default values - h-lh ---------- {{{3
|
||||
if !exists("g:netrw_hide")
|
||||
let g:netrw_hide= 1
|
||||
endif
|
||||
@@ -142,7 +149,7 @@ endif
|
||||
if !exists("g:netrw_list_hide")
|
||||
let g:netrw_list_hide= ""
|
||||
endif
|
||||
" Default values - lh-lz ---------- {{{2
|
||||
" Default values - lh-lz ---------- {{{3
|
||||
if !exists("g:netrw_local_mkdir")
|
||||
let g:netrw_local_mkdir= "mkdir"
|
||||
endif
|
||||
@@ -159,7 +166,7 @@ endif
|
||||
if g:netrw_longlist == 1
|
||||
let g:netrw_list_cmd= g:netrw_list_cmd." -l"
|
||||
endif
|
||||
" Default values - m-r ---------- {{{2
|
||||
" Default values - m-r ---------- {{{3
|
||||
if !exists("g:netrw_maxfilenamelen")
|
||||
let g:netrw_maxfilenamelen= 32
|
||||
endif
|
||||
@@ -178,7 +185,7 @@ endif
|
||||
if !exists("g:netrw_rmf_cmd")
|
||||
let g:netrw_rmf_cmd = g:netrw_ssh_cmd." HOSTNAME rm -f"
|
||||
endif
|
||||
" Default values - s ---------- {{{2
|
||||
" Default values - s ---------- {{{3
|
||||
if exists("g:netrw_silent") && g:netrw_silent != 0
|
||||
let g:netrw_silentxfer= "silent "
|
||||
else
|
||||
@@ -198,7 +205,7 @@ endif
|
||||
if !exists("g:netrw_ssh_browse_reject")
|
||||
let g:netrw_ssh_browse_reject='^total\s\+\d\+$'
|
||||
endif
|
||||
" Default values - t-w ---------- {{{2
|
||||
" Default values - t-w ---------- {{{3
|
||||
if !exists("g:netrw_timefmt")
|
||||
let g:netrw_timefmt= "%c"
|
||||
endif
|
||||
@@ -209,7 +216,7 @@ if !exists("g:netrw_winsize")
|
||||
let g:netrw_winsize= ""
|
||||
endif
|
||||
" ---------------------------------------------------------------------
|
||||
" Default values for netrw's script variables: {{{1
|
||||
" Default values for netrw's script variables: {{{2
|
||||
if !exists("s:netrw_cd_escape")
|
||||
if has("win32") || has("win95") || has("win64") || has("win16")
|
||||
let s:netrw_cd_escape="#% "
|
||||
@@ -230,8 +237,12 @@ endif
|
||||
" files read by network transfer aren't appropriately highlighted.
|
||||
"let g:decho_bufenter = 1 "Decho
|
||||
|
||||
" ==============================
|
||||
" Netrw Utility Functions: {{{1
|
||||
" ==============================
|
||||
|
||||
" ------------------------------------------------------------------------
|
||||
" NetSavePosn: saves position of cursor on screen {{{1
|
||||
" NetSavePosn: saves position of cursor on screen {{{2
|
||||
fun! netrw#NetSavePosn()
|
||||
" call Dfunc("NetSavePosn()")
|
||||
" Save current line and column
|
||||
@@ -248,7 +259,7 @@ fun! netrw#NetSavePosn()
|
||||
endfun
|
||||
|
||||
" ------------------------------------------------------------------------
|
||||
" NetRestorePosn: restores the cursor and file position as saved by NetSavePosn() {{{1
|
||||
" NetRestorePosn: restores the cursor and file position as saved by NetSavePosn() {{{2
|
||||
fun! netrw#NetRestorePosn()
|
||||
" call Dfunc("NetRestorePosn() winnr=".w:netrw_winnr." line=".w:netrw_line." col=".w:netrw_col." hline=".w:netrw_hline)
|
||||
let eikeep= &ei
|
||||
@@ -275,15 +286,19 @@ fun! netrw#NetRestorePosn()
|
||||
" call Dret("NetRestorePosn")
|
||||
endfun
|
||||
|
||||
" ===============================
|
||||
" Netrw Transfer Functions: {{{1
|
||||
" ===============================
|
||||
|
||||
" ------------------------------------------------------------------------
|
||||
" NetRead: responsible for reading a file over the net {{{1
|
||||
" NetRead: responsible for reading a file over the net {{{2
|
||||
fun! netrw#NetRead(...)
|
||||
" call Dfunc("NetRead(a:1<".a:1.">)")
|
||||
|
||||
" save options
|
||||
call s:NetOptionSave()
|
||||
|
||||
" Special Exception: if a file is named "0r", then
|
||||
" Special Exception: if a file is named "0r", then {{{3
|
||||
" "0r" will be used to read the
|
||||
" following files instead of "r"
|
||||
if a:0 == 0
|
||||
@@ -297,7 +312,7 @@ fun! netrw#NetRead(...)
|
||||
let ichoice = 1
|
||||
endif
|
||||
|
||||
" get name of a temporary file and set up shell-quoting character
|
||||
" get name of a temporary file and set up shell-quoting character {{{3
|
||||
let tmpfile= tempname()
|
||||
let tmpfile= substitute(tmpfile,'\','/','ge')
|
||||
if !isdirectory(substitute(tmpfile,'[^/]\+$','','e'))
|
||||
@@ -377,7 +392,7 @@ fun! netrw#NetRead(...)
|
||||
let tmpfile = fnamemodify(tmpfile,':t')
|
||||
endif
|
||||
|
||||
" Determine method of read (ftp, rcp, etc)
|
||||
" Determine method of read (ftp, rcp, etc) {{{3
|
||||
call s:NetMethod(choice)
|
||||
|
||||
" Check if NetBrowse() should be handling this request
|
||||
@@ -389,21 +404,21 @@ fun! netrw#NetRead(...)
|
||||
endif
|
||||
|
||||
" use filename's suffix for the temporary file
|
||||
if b:netrw_fname =~ '\.[^./]\+'
|
||||
let suffix = substitute(b:netrw_fname,'^.*\(\.[^./]\+\)','\1','e')
|
||||
if b:netrw_fname =~ '\.[^./]\+$'
|
||||
let suffix = substitute(b:netrw_fname,'^.*\(\.[^./]\+\)$','\1','e')
|
||||
let tmpfile= substitute(tmpfile,"$",suffix,'e')
|
||||
" call Decho("chgd tmpfile<".tmpfile."> (added ".suffix." suffix)")
|
||||
" call Decho("chgd tmpfile<".tmpfile."> (added ".suffix." suffix) netrw_fname<".b:netrw_fname.">")
|
||||
endif
|
||||
|
||||
" ============
|
||||
" Perform Read
|
||||
" ============
|
||||
" Perform Protocol-Based Read {{{3
|
||||
" ===========================
|
||||
if exists("g:netrw_silent") && g:netrw_silent == 0 && &ch >= 1
|
||||
echo "(netrw) Processing your read request..."
|
||||
endif
|
||||
|
||||
".........................................
|
||||
" rcp: NetRead Method #1
|
||||
" rcp: NetRead Method #1 {{{3
|
||||
if b:netrw_method == 1 " read with rcp
|
||||
" call Decho("read via rcp (method #1)")
|
||||
" ER: noting done with g:netrw_uid yet?
|
||||
@@ -430,7 +445,7 @@ fun! netrw#NetRead(...)
|
||||
let b:netrw_lastfile = choice
|
||||
|
||||
".........................................
|
||||
" ftp + <.netrc>: NetRead Method #2
|
||||
" ftp + <.netrc>: NetRead Method #2 {{{3
|
||||
elseif b:netrw_method == 2 " read with ftp + <.netrc>
|
||||
" call Decho("read via ftp+.netrc (method #2)")
|
||||
let netrw_fname= b:netrw_fname
|
||||
@@ -460,7 +475,7 @@ fun! netrw#NetRead(...)
|
||||
let b:netrw_lastfile = choice
|
||||
|
||||
".........................................
|
||||
" ftp + machine,id,passwd,filename: NetRead Method #3
|
||||
" ftp + machine,id,passwd,filename: NetRead Method #3 {{{3
|
||||
elseif b:netrw_method == 3 " read with ftp + machine, id, passwd, and fname
|
||||
" Construct execution string (four lines) which will be passed through filter
|
||||
" call Decho("read via ftp+mipf (method #3)")
|
||||
@@ -512,7 +527,7 @@ fun! netrw#NetRead(...)
|
||||
let b:netrw_lastfile = choice
|
||||
|
||||
".........................................
|
||||
" scp: NetRead Method #4
|
||||
" scp: NetRead Method #4 {{{3
|
||||
elseif b:netrw_method == 4 " read with scp
|
||||
" call Decho("read via scp (method #4)")
|
||||
if exists("g:netrw_port") && g:netrw_port != ""
|
||||
@@ -522,17 +537,18 @@ fun! netrw#NetRead(...)
|
||||
endif
|
||||
if g:netrw_cygwin == 1
|
||||
let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
|
||||
" call Decho("executing: !".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile)
|
||||
exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile
|
||||
" call Decho("executing: !".g:netrw_scp_cmd.useport." '".g:netrw_machine.":".escape(b:netrw_fname,' ?&')."' ".cygtmpfile)
|
||||
exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." '".g:netrw_machine.":".escape(b:netrw_fname,' ?&')."' ".cygtmpfile
|
||||
else
|
||||
" call Decho("executing: !".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile)
|
||||
exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile
|
||||
" call Decho("executing: !".g:netrw_scp_cmd.useport." '".g:netrw_machine.":".escape(b:netrw_fname,' ?&')."' ".tmpfile)
|
||||
exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." '".g:netrw_machine.":".escape(b:netrw_fname,' ?&')."' ".tmpfile
|
||||
endif
|
||||
let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
|
||||
let b:netrw_lastfile = choice
|
||||
|
||||
".........................................
|
||||
elseif b:netrw_method == 5 " read with http (wget)
|
||||
" http: NetRead Method #5 (wget) {{{3
|
||||
elseif b:netrw_method == 5
|
||||
" call Decho("read via http (method #5)")
|
||||
if g:netrw_http_cmd == ""
|
||||
if !exists("g:netrw_quiet")
|
||||
@@ -564,8 +580,8 @@ fun! netrw#NetRead(...)
|
||||
let b:netrw_lastfile = choice
|
||||
|
||||
".........................................
|
||||
" cadaver: NetRead Method #6
|
||||
elseif b:netrw_method == 6 " read with cadaver
|
||||
" cadaver: NetRead Method #6 {{{3
|
||||
elseif b:netrw_method == 6
|
||||
" call Decho("read via cadaver (method #6)")
|
||||
|
||||
" Construct execution string (four lines) which will be passed through filter
|
||||
@@ -596,8 +612,8 @@ fun! netrw#NetRead(...)
|
||||
let b:netrw_lastfile = choice
|
||||
|
||||
".........................................
|
||||
" rsync: NetRead Method #7
|
||||
elseif b:netrw_method == 7 " read with rsync
|
||||
" rsync: NetRead Method #7 {{{3
|
||||
elseif b:netrw_method == 7
|
||||
" call Decho("read via rsync (method #7)")
|
||||
if g:netrw_cygwin == 1
|
||||
let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
|
||||
@@ -611,9 +627,9 @@ fun! netrw#NetRead(...)
|
||||
let b:netrw_lastfile = choice
|
||||
|
||||
".........................................
|
||||
" fetch: NetRead Method #8
|
||||
" fetch: NetRead Method #8 {{{3
|
||||
" fetch://[user@]host[:http]/path
|
||||
elseif b:netrw_method == 8 " read with fetch
|
||||
elseif b:netrw_method == 8
|
||||
if g:netrw_fetch_cmd == ""
|
||||
if !exists("g:netrw_quiet")
|
||||
echohl Error | echo "***netrw*** fetch command not available" | echohl None
|
||||
@@ -640,8 +656,8 @@ fun! netrw#NetRead(...)
|
||||
let b:netrw_lastfile = choice
|
||||
|
||||
".........................................
|
||||
" sftp: NetRead Method #9
|
||||
elseif b:netrw_method == 9 " read with sftp
|
||||
" sftp: NetRead Method #9 {{{3
|
||||
elseif b:netrw_method == 9
|
||||
" call Decho("read via sftp (method #4)")
|
||||
if g:netrw_cygwin == 1
|
||||
let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
|
||||
@@ -656,12 +672,13 @@ fun! netrw#NetRead(...)
|
||||
let b:netrw_lastfile = choice
|
||||
|
||||
".........................................
|
||||
else " Complain
|
||||
" Complain {{{3
|
||||
else
|
||||
echo "***warning*** unable to comply with your request<" . choice . ">"
|
||||
endif
|
||||
endwhile
|
||||
|
||||
" cleanup
|
||||
" cleanup {{{3
|
||||
" call Decho("cleanup")
|
||||
if exists("b:netrw_method")
|
||||
unlet b:netrw_method
|
||||
@@ -673,7 +690,7 @@ fun! netrw#NetRead(...)
|
||||
endfun
|
||||
|
||||
" ------------------------------------------------------------------------
|
||||
" NetGetFile: Function to read temporary file "tfile" with command "readcmd". {{{1
|
||||
" NetGetFile: Function to read temporary file "tfile" with command "readcmd". {{{2
|
||||
fun! s:NetGetFile(readcmd, tfile, method)
|
||||
" call Dfunc("NetGetFile(readcmd<".a:readcmd.">,tfile<".a:tfile."> method<".a:method.">)")
|
||||
|
||||
@@ -715,13 +732,14 @@ fun! s:NetGetFile(readcmd, tfile, method)
|
||||
elseif rfile =~ '\.tar$'
|
||||
call tar#Browse(tfile)
|
||||
else
|
||||
" call Decho("edit temporary file")
|
||||
e
|
||||
endif
|
||||
|
||||
" rename buffer back to remote filename
|
||||
keepalt exe "file ".rfile
|
||||
keepalt exe "file ".escape(rfile,' ')
|
||||
filetype detect
|
||||
" call Dredir("ls!","renamed buffer back to remote filename<".rfile.">")
|
||||
" call Dredir("ls!","renamed buffer back to remote filename<".rfile."> : expand(%)<".expand("%").">")
|
||||
let line1 = 1
|
||||
let line2 = line("$")
|
||||
|
||||
@@ -764,7 +782,7 @@ fun! s:NetGetFile(readcmd, tfile, method)
|
||||
endfun
|
||||
|
||||
" ------------------------------------------------------------------------
|
||||
" NetWrite: responsible for writing a file over the net {{{1
|
||||
" NetWrite: responsible for writing a file over the net {{{2
|
||||
fun! netrw#NetWrite(...) range
|
||||
" call Dfunc("NetWrite(a:0=".a:0.")")
|
||||
|
||||
@@ -772,7 +790,7 @@ fun! netrw#NetWrite(...) range
|
||||
let mod= 0
|
||||
call s:NetOptionSave()
|
||||
|
||||
" Get Temporary Filename
|
||||
" Get Temporary Filename {{{3
|
||||
let tmpfile= tempname()
|
||||
if !isdirectory(substitute(tmpfile,'[^/]\+$','','e'))
|
||||
echohl Error | echo "***netrw*** your ".substitute(tmpfile,'[^/]\+$','','e')." directory is missing!"
|
||||
@@ -800,6 +818,7 @@ fun! netrw#NetWrite(...) range
|
||||
|
||||
while ichoice <= a:0
|
||||
|
||||
" Process arguments: {{{3
|
||||
" attempt to repeat with previous host-file-etc
|
||||
if exists("b:netrw_lastfile") && a:0 == 0
|
||||
" call Decho("using b:netrw_lastfile<" . b:netrw_lastfile . ">")
|
||||
@@ -860,19 +879,19 @@ fun! netrw#NetWrite(...) range
|
||||
let tmpfile = fnamemodify(tmpfile,':t')
|
||||
endif
|
||||
|
||||
" Determine method of read (ftp, rcp, etc)
|
||||
" Determine method of read (ftp, rcp, etc) {{{3
|
||||
call s:NetMethod(choice)
|
||||
|
||||
" =============
|
||||
" Perform Write
|
||||
" =============
|
||||
" Perform Protocol-Based Write {{{3
|
||||
" ============================
|
||||
if exists("g:netrw_silent") && g:netrw_silent == 0 && &ch >= 1
|
||||
echo "(netrw) Processing your write request..."
|
||||
endif
|
||||
|
||||
".........................................
|
||||
" rcp: NetWrite Method #1
|
||||
if b:netrw_method == 1 " write with rcp
|
||||
" rcp: NetWrite Method #1 {{{3
|
||||
if b:netrw_method == 1
|
||||
" call Decho("write via rcp (method #1)")
|
||||
if s:netrw_has_nt_rcp == 1
|
||||
if exists("g:netrw_uid") && ( g:netrw_uid != "" )
|
||||
@@ -892,8 +911,8 @@ fun! netrw#NetWrite(...) range
|
||||
let b:netrw_lastfile = choice
|
||||
|
||||
".........................................
|
||||
" ftp + <.netrc>: NetWrite Method #2
|
||||
elseif b:netrw_method == 2 " write with ftp + <.netrc>
|
||||
" ftp + <.netrc>: NetWrite Method #2 {{{3
|
||||
elseif b:netrw_method == 2
|
||||
let netrw_fname = b:netrw_fname
|
||||
new
|
||||
setlocal ff=unix
|
||||
@@ -920,8 +939,8 @@ fun! netrw#NetWrite(...) range
|
||||
let b:netrw_lastfile = choice
|
||||
|
||||
".........................................
|
||||
" ftp + machine, id, passwd, filename: NetWrite Method #3
|
||||
elseif b:netrw_method == 3 " write with ftp + machine, id, passwd, and fname
|
||||
" ftp + machine, id, passwd, filename: NetWrite Method #3 {{{3
|
||||
elseif b:netrw_method == 3
|
||||
let netrw_fname= b:netrw_fname
|
||||
new
|
||||
setlocal ff=unix
|
||||
@@ -964,8 +983,8 @@ fun! netrw#NetWrite(...) range
|
||||
bd!
|
||||
|
||||
".........................................
|
||||
" scp: NetWrite Method #4
|
||||
elseif b:netrw_method == 4 " write with scp
|
||||
" scp: NetWrite Method #4 {{{3
|
||||
elseif b:netrw_method == 4
|
||||
if exists("g:netrw_port") && g:netrw_port != ""
|
||||
let useport= " -P ".g:netrw_port
|
||||
else
|
||||
@@ -973,16 +992,16 @@ fun! netrw#NetWrite(...) range
|
||||
endif
|
||||
if g:netrw_cygwin == 1
|
||||
let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
|
||||
" call Decho("executing: !".g:netrw_scp_cmd.useport." ".cygtmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&'))
|
||||
exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".cygtmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')
|
||||
" call Decho("executing: !".g:netrw_scp_cmd.useport." ".cygtmpfile." '".g:netrw_machine.":".escape(b:netrw_fname,' ?&')."'")
|
||||
exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".cygtmpfile." '".g:netrw_machine.":".escape(b:netrw_fname,' ?&')."'"
|
||||
else
|
||||
" call Decho("executing: !".g:netrw_scp_cmd.useport." ".tmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&'))
|
||||
exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".tmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')
|
||||
" call Decho("executing: !".g:netrw_scp_cmd.useport." ".tmpfile." '".g:netrw_machine.":".escape(b:netrw_fname,' ?&')."'")
|
||||
exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".tmpfile." '".g:netrw_machine.":".escape(b:netrw_fname,' ?&')."'"
|
||||
endif
|
||||
let b:netrw_lastfile = choice
|
||||
|
||||
".........................................
|
||||
" http: NetWrite Method #5
|
||||
" http: NetWrite Method #5 {{{3
|
||||
elseif b:netrw_method == 5
|
||||
if !exists("g:netrw_quiet")
|
||||
echohl Error | echo "***netrw*** currently <netrw.vim> does not support writing using http:" | echohl None
|
||||
@@ -990,8 +1009,8 @@ fun! netrw#NetWrite(...) range
|
||||
endif
|
||||
|
||||
".........................................
|
||||
" dav: NetWrite Method #6
|
||||
elseif b:netrw_method == 6 " write with cadaver
|
||||
" dav: NetWrite Method #6 (cadaver) {{{3
|
||||
elseif b:netrw_method == 6
|
||||
" call Decho("write via cadaver (method #6)")
|
||||
|
||||
" Construct execution string (four lines) which will be passed through filter
|
||||
@@ -1020,8 +1039,8 @@ fun! netrw#NetWrite(...) range
|
||||
let b:netrw_lastfile = choice
|
||||
|
||||
".........................................
|
||||
" rsync: NetWrite Method #7
|
||||
elseif b:netrw_method == 7 " write with rsync
|
||||
" rsync: NetWrite Method #7 {{{3
|
||||
elseif b:netrw_method == 7
|
||||
if g:netrw_cygwin == 1
|
||||
let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
|
||||
" call Decho("executing: !".g:netrw_rsync_cmd." ".cygtmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&'))
|
||||
@@ -1033,8 +1052,8 @@ fun! netrw#NetWrite(...) range
|
||||
let b:netrw_lastfile = choice
|
||||
|
||||
".........................................
|
||||
" scp: NetWrite Method #9
|
||||
elseif b:netrw_method == 9 " write with sftp
|
||||
" sftp: NetWrite Method #9 {{{3
|
||||
elseif b:netrw_method == 9
|
||||
let netrw_fname= b:netrw_fname
|
||||
if exists("g:netrw_uid") && ( g:netrw_uid != "" )
|
||||
let uid_machine = g:netrw_uid .'@'. g:netrw_machine
|
||||
@@ -1051,12 +1070,13 @@ fun! netrw#NetWrite(...) range
|
||||
let b:netrw_lastfile= choice
|
||||
|
||||
".........................................
|
||||
else " Complain
|
||||
" Complain {{{3
|
||||
else
|
||||
echo "***warning*** unable to comply with your request<" . choice . ">"
|
||||
endif
|
||||
endwhile
|
||||
|
||||
" cleanup
|
||||
" cleanup {{{3
|
||||
" call Decho("cleanup")
|
||||
let result=delete(tmpfile)
|
||||
call s:NetOptionRestore()
|
||||
@@ -1072,6 +1092,7 @@ endfun
|
||||
" Remote Directory Browsing Support: {{{1
|
||||
" ===========================================
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetBrowse: This function uses the command in g:netrw_list_cmd to get a list {{{2
|
||||
" of the contents of a remote directory. It is assumed that the
|
||||
" g:netrw_list_cmd has a string, HOSTNAME, that needs to be substituted
|
||||
@@ -1235,10 +1256,10 @@ fun! s:NetBrowse(dirname)
|
||||
" call Decho("exe file ".escape(bufname,s:netrw_cd_escape))
|
||||
exe 'file '.escape(bufname,s:netrw_cd_escape)
|
||||
" call Decho("renaming file to bufname<".bufname.">")
|
||||
setlocal bh=hide bt=nofile nobl nonu
|
||||
setlocal bh=hide bt=nofile nobl nonu noswf
|
||||
|
||||
" save current directory on directory history list
|
||||
call <SID>NetBookmarkDir(3,expand("%"))
|
||||
call s:NetBookmarkDir(3,expand("%"))
|
||||
|
||||
" set up buffer-local mappings
|
||||
" call Decho("set up buffer-local mappings")
|
||||
@@ -1256,6 +1277,7 @@ fun! s:NetBrowse(dirname)
|
||||
nnoremap <buffer> <silent> i :call <SID>NetLongList(0)<cr>
|
||||
nnoremap <buffer> <silent> o :call <SID>NetSplit(0)<cr>
|
||||
nnoremap <buffer> <silent> O :call <SID>NetObtain()<cr>
|
||||
nnoremap <buffer> <silent> P :call <SID>NetPrevWinOpen(0)<cr>
|
||||
nnoremap <buffer> <silent> q :<c-u>call <SID>NetBookmarkDir(2,expand("%"))<cr>
|
||||
nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<cr>
|
||||
nnoremap <buffer> <silent> s :call <SID>NetSaveWordPosn()<bar>let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<bar>call <SID>NetRestoreWordPosn()<cr>
|
||||
@@ -1263,7 +1285,7 @@ fun! s:NetBrowse(dirname)
|
||||
nnoremap <buffer> <silent> u :<c-u>call <SID>NetBookmarkDir(4,expand("%"))<cr>
|
||||
nnoremap <buffer> <silent> U :<c-u>call <SID>NetBookmarkDir(5,expand("%"))<cr>
|
||||
nnoremap <buffer> <silent> v :call <SID>NetSplit(1)<cr>
|
||||
nnoremap <buffer> <silent> x :call <SID>NetBrowseX(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()),1)<cr>
|
||||
nnoremap <buffer> <silent> x :call netrw#NetBrowseX(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()),1)<cr>
|
||||
nnoremap <buffer> <silent> <2-leftmouse> :call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()))<cr>
|
||||
exe 'nnoremap <buffer> <silent> <del> :call <SID>NetBrowseRm("'.user.machine.'","'.path.'")<cr>'
|
||||
exe 'vnoremap <buffer> <silent> <del> :call <SID>NetBrowseRm("'.user.machine.'","'.path.'")<cr>'
|
||||
@@ -1446,6 +1468,13 @@ fun! s:NetBrowseChgDir(dirname,newdir)
|
||||
if newdir !~ '[\/]$'
|
||||
" handling a file
|
||||
let dirname= dirname.newdir
|
||||
if g:netrw_browse_split == 1
|
||||
new
|
||||
wincmd _
|
||||
elseif g:netrw_browse_split == 2
|
||||
rightb vert new
|
||||
wincmd |
|
||||
endif
|
||||
" call Decho("handling a file: dirname<".dirname.">")
|
||||
|
||||
elseif newdir == './'
|
||||
@@ -1479,7 +1508,7 @@ fun! s:NetBrowseChgDir(dirname,newdir)
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetGetWord: it gets the directory named under the cursor
|
||||
" NetGetWord: it gets the directory named under the cursor {{{2
|
||||
fun! s:NetGetWord()
|
||||
" call Dfunc("NetGetWord() line#".line("."))
|
||||
call s:UseBufWinVars()
|
||||
@@ -1651,7 +1680,7 @@ fun! s:NetBrowseRm(usrhost,path) range
|
||||
" refresh the directory
|
||||
let curline= line(".")-1
|
||||
" call Decho("refresh the directory")
|
||||
call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))
|
||||
call s:NetBrowse(s:NetBrowseChgDir(expand("%"),'./'))
|
||||
exe curline
|
||||
|
||||
" call Dret("NetBrowseRm")
|
||||
@@ -1692,7 +1721,7 @@ fun! s:NetBrowseRename(usrhost,path) range
|
||||
|
||||
" refresh the directory
|
||||
let curline= line(".")
|
||||
call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))
|
||||
call s:NetBrowse(s:NetBrowseChgDir(expand("%"),'./'))
|
||||
exe "keepjumps ".curline
|
||||
" call Dret("NetBrowseRename")
|
||||
endfun
|
||||
@@ -1721,29 +1750,29 @@ endfun
|
||||
" =2 : local and o
|
||||
" =3 : local and v
|
||||
fun! s:NetSplit(mode)
|
||||
" call Dfunc("NetSplit(mode=".a:mode.")")
|
||||
" call Dfunc("NetSplit(mode=".a:mode.") alto=".g:netrw_alto." altv=".g:netrw_altv)
|
||||
|
||||
call s:SaveWinVars()
|
||||
if a:mode == 0
|
||||
exe (g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s"
|
||||
call s:CopyWinVars()
|
||||
exe "norm! 0"
|
||||
call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()))
|
||||
call s:NetBrowse(s:NetBrowseChgDir(expand("%"),s:NetGetWord()))
|
||||
elseif a:mode ==1
|
||||
exe (g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v"
|
||||
call s:CopyWinVars()
|
||||
exe "norm! 0"
|
||||
call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()))
|
||||
call s:NetBrowse(s:NetBrowseChgDir(expand("%"),s:NetGetWord()))
|
||||
elseif a:mode ==2
|
||||
exe (g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s"
|
||||
call s:CopyWinVars()
|
||||
exe "norm! 0"
|
||||
call s:LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))
|
||||
call s:LocalBrowse(s:LocalBrowseChgDir(b:netrw_curdir,s:NetGetWord()))
|
||||
else
|
||||
exe (g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v"
|
||||
call s:CopyWinVars()
|
||||
exe "norm! 0"
|
||||
call s:LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))
|
||||
call s:LocalBrowse(s:LocalBrowseChgDir(b:netrw_curdir,s:NetGetWord()))
|
||||
endif
|
||||
|
||||
" call Dret("NetSplit")
|
||||
@@ -1752,8 +1781,8 @@ endfun
|
||||
" ---------------------------------------------------------------------
|
||||
" NetBrowseX: allows users to write custom functions to operate on {{{2
|
||||
" files given their extension. Passes 0=local, 1=remote
|
||||
fun! s:NetBrowseX(fname,remote)
|
||||
" call Dfunc("NetBrowseX(".a:fname." remote=".a:remote.")")
|
||||
fun! netrw#NetBrowseX(fname,remote)
|
||||
" call Dfunc("NetBrowseX(fname<".a:fname."> remote=".a:remote.")")
|
||||
|
||||
" set up the filename
|
||||
" (lower case the extension, make a local copy of a remote file)
|
||||
@@ -1764,6 +1793,23 @@ fun! s:NetBrowseX(fname,remote)
|
||||
let fname= escape(a:fname,"%#")
|
||||
" call Decho("fname<".fname."> after escape()")
|
||||
|
||||
" seems kde systems often have gnome-open due to dependencies, even though
|
||||
" gnome-open's subsidiary display tools are largely absent. Kde systems
|
||||
" usually have "kicker" running, though... (tnx Mikolaj Machowski)
|
||||
if !exists("s:haskicker")
|
||||
if has("unix")
|
||||
let v:shell_error=0
|
||||
silent! let s:haskicker= system('ps -e') =~ 'kicker'
|
||||
if v:shell_error
|
||||
let s:haskicker = 0
|
||||
let v:shell_error = 0
|
||||
endif
|
||||
else
|
||||
let s:haskicker= 0
|
||||
endif
|
||||
" call Decho("setting s:haskicker=".s:haskicker)
|
||||
endif
|
||||
|
||||
if a:remote == 1
|
||||
" create a local copy
|
||||
let fname= tempname().".".exten
|
||||
@@ -1783,18 +1829,31 @@ fun! s:NetBrowseX(fname,remote)
|
||||
endif
|
||||
" call Decho("redir:".redir.":")
|
||||
|
||||
if exists("g:netrw_browsex_viewer") && executable(g:netrw_browsex_viewer)
|
||||
if g:netrw_browsex_viewer == '-'
|
||||
call netrwFileHandlers#Init()
|
||||
if exten != "" && exists("*netrwFileHandlers#NFH_".exten)
|
||||
" call Decho("let ret= netrwFileHandlers#NFH_".exten.'("'.fname.'")')
|
||||
exe "let ret= netrwFileHandlers#NFH_".exten.'("'.fname.'")'
|
||||
endif
|
||||
else
|
||||
" call Decho("exe silent !".g:netrw_browsex_viewer." '".escape(fname,'%#')."' ".redir)
|
||||
exe "silent !".g:netrw_browsex_viewer." '".escape(fname,'%#')."'".redir
|
||||
let ret= v:shell_error
|
||||
endif
|
||||
|
||||
" execute the file handler
|
||||
if has("win32") || has("win64")
|
||||
elseif has("win32") || has("win64")
|
||||
" call Decho('exe silent !start rundll32 url.dll,FileProtocolHandler "'.escape(fname, '%#').'"')
|
||||
exe 'silent !start rundll32 url.dll,FileProtocolHandler "'.escape(fname, '%#').'"'
|
||||
let ret= v:shell_error
|
||||
|
||||
elseif has("unix") && executable("gnome-open")
|
||||
elseif has("unix") && executable("gnome-open") && !s:haskicker
|
||||
" call Decho("exe silent !gnome-open '".escape(fname,'%#')."' ".redir)
|
||||
exe "silent !gnome-open '".escape(fname,'%#')."'".redir
|
||||
let ret= v:shell_error
|
||||
|
||||
elseif has("unix") && executable("kfmclient")
|
||||
elseif has("unix") && executable("kfmclient") && s:haskicker
|
||||
" call Decho("exe silent !kfmclient exec '".escape(fname,'%#')."' ".redir)
|
||||
exe "silent !kfmclient exec '".escape(fname,'%#')."' ".redir
|
||||
let ret= v:shell_error
|
||||
@@ -1969,7 +2028,7 @@ fun! s:NetHideEdit(islocal)
|
||||
if a:islocal == 0
|
||||
silent call s:NetBrowse(s:NetBrowseChgDir(expand("%"),'./'))
|
||||
else
|
||||
silent call s:NetRefresh(<SID>LocalBrowseChgDir(b:netrw_curdir,"./"),a:islocal)
|
||||
silent call s:NetRefresh(s:LocalBrowseChgDir(b:netrw_curdir,"./"),a:islocal)
|
||||
endif
|
||||
|
||||
" call Dret("NetHideEdit")
|
||||
@@ -1989,7 +2048,7 @@ fun! s:NetSortSequence(mode)
|
||||
if a:mode == 0
|
||||
silent call s:NetBrowse(s:NetBrowseChgDir(expand("%"),'./'))
|
||||
else
|
||||
silent call s:LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,"./"))
|
||||
silent call s:LocalBrowse(s:LocalBrowseChgDir(b:netrw_curdir,"./"))
|
||||
endif
|
||||
|
||||
" call Dret("NetSortSequence")
|
||||
@@ -2025,9 +2084,9 @@ fun! s:NetLongList(mode)
|
||||
|
||||
" refresh the listing
|
||||
if a:mode == 0
|
||||
silent call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),"./"))
|
||||
silent call s:NetBrowse(s:NetBrowseChgDir(expand("%"),"./"))
|
||||
else
|
||||
silent call s:LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,"./"))
|
||||
silent call s:LocalBrowse(s:LocalBrowseChgDir(b:netrw_curdir,"./"))
|
||||
endif
|
||||
|
||||
" keep cursor on the filename
|
||||
@@ -2434,6 +2493,82 @@ fun! s:NetObtain()
|
||||
" call Dret("NetObtain")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetPrevWinOpen: opoen file/directory in previous window. {{{2
|
||||
" If there's only one window, then the window will first be split.
|
||||
fun! s:NetPrevWinOpen(islocal)
|
||||
" call Dfunc("NetPrevWinOpen(islocal=".a:islocal.")")
|
||||
|
||||
" get last window number and the word currently under the cursor
|
||||
let lastwinnr = winnr("$")
|
||||
let curword = s:NetGetWord()
|
||||
let curdir = b:netrw_curdir
|
||||
" call Decho("lastwinnr=".lastwinnr." curword<".curword.">")
|
||||
|
||||
let didsplit = 0
|
||||
if lastwinnr == 1
|
||||
" if only one window, open a new one first
|
||||
" call Decho("only one window, so open a new one (g:netrw_alto=".g:netrw_alto.")")
|
||||
exe (g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s"
|
||||
let didsplit = 1
|
||||
|
||||
else
|
||||
wincmd p
|
||||
" if the previous window's buffer has been changed (is modified),
|
||||
" and it doesn't appear in any other extant window, then ask the
|
||||
" user if s/he wants to abandon modifications therein.
|
||||
let bnr = winbufnr(0)
|
||||
let bnrcnt = 0
|
||||
if &mod
|
||||
windo if winbufnr(0) == bnr | let bnrcnt=bnrcnt+1 | endif
|
||||
" call Decho("bnr=".bnr." bnrcnt=".bnrcnt)
|
||||
if bnrcnt == 1
|
||||
let bufname= bufname(winbufnr(winnr()))
|
||||
let choice= confirm("Save modified file<".bufname.">?","&Yes\n&No\n&Cancel")
|
||||
|
||||
if choice == 1
|
||||
" Yes -- write file & then browse
|
||||
let v:errmsg= ""
|
||||
silent w
|
||||
if v:errmsg != ""
|
||||
echohl Error | echo "***netrw*** "unable to write <".bufname.">!" | echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
if didsplit
|
||||
q
|
||||
else
|
||||
wincmd p
|
||||
endif
|
||||
" call Dret("NetPrevWinOpen : unable to write <".bufname.">")
|
||||
return
|
||||
endif
|
||||
|
||||
elseif choice == 2
|
||||
" No -- don't worry about changed file, just browse anyway
|
||||
set nomod
|
||||
echohl WarningMsg | echo "***netrw*** ".bufname." changes abandoned" | echohl None
|
||||
|
||||
else
|
||||
" Cancel -- don't do this
|
||||
if didsplit
|
||||
q
|
||||
else
|
||||
wincmd p
|
||||
endif
|
||||
" call Dret("NetPrevWinOpen : cancelled")
|
||||
return
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if a:islocal
|
||||
call s:LocalBrowse(s:LocalBrowseChgDir(curdir,curword))
|
||||
else
|
||||
call s:NetBrowse(s:NetBrowseChgDir(expand("%"),curword))
|
||||
endif
|
||||
" call Dret("NetPrevWinOpen")
|
||||
endfun
|
||||
|
||||
" ==========================================
|
||||
" Local Directory Browsing Support: {{{1
|
||||
" ==========================================
|
||||
@@ -2445,7 +2580,7 @@ fun! s:LocalBrowse(dirname)
|
||||
" the BufEnter event causes triggering when attempts to write to
|
||||
" the DBG buffer are made.
|
||||
if isdirectory(a:dirname)
|
||||
call netrw#DirBrowse(a:dirname)
|
||||
silent! call netrw#DirBrowse(a:dirname)
|
||||
endif
|
||||
" not a directory, ignore it
|
||||
endfun
|
||||
@@ -2462,6 +2597,7 @@ fun! netrw#DirBrowse(dirname)
|
||||
" call Dret("DirBrowse")
|
||||
return
|
||||
endif
|
||||
|
||||
call s:NetOptionSave()
|
||||
|
||||
if v:version < 603
|
||||
@@ -2550,10 +2686,13 @@ fun! netrw#DirBrowse(dirname)
|
||||
endif
|
||||
|
||||
" change the name of the buffer to reflect the b:netrw_curdir
|
||||
" Hmm. When another vim is open to the same directory, I get
|
||||
" a "Press ENTER" ... ok, setting "noswf" avoids it.
|
||||
" call Decho('exe silent! file '.escape(b:netrw_curdir,s:netrw_cd_escape))
|
||||
exe 'silent! file '.escape(b:netrw_curdir,s:netrw_cd_escape)
|
||||
|
||||
" make this buffer not-a-file, modifiable, not line-numbered, etc
|
||||
setlocal bh=hide bt=nofile nobl ma nonu
|
||||
setlocal bh=hide bt=nofile nobl ma nonu noswf
|
||||
keepalt silent! %d
|
||||
|
||||
" ---------------------------
|
||||
@@ -2563,7 +2702,7 @@ fun! netrw#DirBrowse(dirname)
|
||||
endif
|
||||
|
||||
" save current directory on directory history list
|
||||
call <SID>NetBookmarkDir(3,b:netrw_curdir)
|
||||
call s:NetBookmarkDir(3,b:netrw_curdir)
|
||||
|
||||
" set up all the maps
|
||||
" call Decho("Setting up local browser maps")
|
||||
@@ -2584,6 +2723,7 @@ fun! netrw#DirBrowse(dirname)
|
||||
nnoremap <buffer> <silent> o :call <SID>NetSplit(2)<cr>
|
||||
nnoremap <buffer> <silent> O :call <SID>LocalObtain()<cr>
|
||||
nnoremap <buffer> <silent> p :call <SID>LocalPreview(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord(),1))<cr>
|
||||
nnoremap <buffer> <silent> P :call <SID>NetPrevWinOpen(1)<cr>
|
||||
nnoremap <buffer> <silent> q :<c-u>call <SID>NetBookmarkDir(2,b:netrw_curdir)<cr>
|
||||
nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetRefresh(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'),1)<cr>
|
||||
nnoremap <buffer> <silent> s :call <SID>NetSaveWordPosn()<bar>let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'<bar>exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<bar>call <SID>NetRestoreWordPosn()<cr>
|
||||
@@ -2591,7 +2731,7 @@ fun! netrw#DirBrowse(dirname)
|
||||
nnoremap <buffer> <silent> u :<c-u>call <SID>NetBookmarkDir(4,expand("%"))<cr>
|
||||
nnoremap <buffer> <silent> U :<c-u>call <SID>NetBookmarkDir(5,expand("%"))<cr>
|
||||
nnoremap <buffer> <silent> v :call <SID>NetSplit(3)<cr>
|
||||
nnoremap <buffer> <silent> x :call <SID>NetBrowseX(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord(),0),0)"<cr>
|
||||
nnoremap <buffer> <silent> x :call netrw#NetBrowseX(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord(),0),0)"<cr>
|
||||
nnoremap <buffer> <silent> <2-leftmouse> :call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))<cr>
|
||||
nnoremap <buffer> <silent> <s-up> :Pexplore<cr>
|
||||
nnoremap <buffer> <silent> <s-down> :Nexplore<cr>
|
||||
@@ -2784,7 +2924,7 @@ fun! s:LocalBrowseList()
|
||||
let ft = strpart("000000000000000000",1,18-strlen(t)).t
|
||||
" call Decho("exe keepjumps put ='".ft.'/'.filename."'")
|
||||
let ftpfile= ft.'/'.pfile
|
||||
keepjumps put=ftpfile
|
||||
keepjumps silent! put=ftpfile
|
||||
|
||||
elseif g:netrw_sort_by =~ "^s"
|
||||
" sort by size (handles file sizes up to 1 quintillion bytes, US)
|
||||
@@ -2793,12 +2933,12 @@ fun! s:LocalBrowseList()
|
||||
let fsz = strpart("000000000000000000",1,18-strlen(sz)).sz
|
||||
" call Decho("exe keepjumps put ='".fsz.'/'.filename."'")
|
||||
let fszpfile= fsz.'/'.pfile
|
||||
keepjumps put =fszpfile
|
||||
keepjumps silent! put =fszpfile
|
||||
|
||||
else
|
||||
" sort by name
|
||||
" call Decho("exe keepjumps put ='".pfile."'")
|
||||
keepjumps put=pfile
|
||||
keepjumps silent! put=pfile
|
||||
endif
|
||||
endwhile
|
||||
|
||||
@@ -2833,6 +2973,13 @@ fun! s:LocalBrowseChgDir(dirname,newdir,...)
|
||||
if a:0 < 1
|
||||
" call Decho("dirname<".dirname."> netrw_cd_escape<".s:netrw_cd_escape.">")
|
||||
" call Decho("about to edit<".escape(dirname,s:netrw_cd_escape).">")
|
||||
if g:netrw_browse_split == 1
|
||||
new
|
||||
wincmd _
|
||||
elseif g:netrw_browse_split == 2
|
||||
rightb vert new
|
||||
wincmd |
|
||||
endif
|
||||
exe "e! ".escape(dirname,s:netrw_cd_escape)
|
||||
set ma nomod
|
||||
endif
|
||||
@@ -3063,7 +3210,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
|
||||
|
||||
" if dosplit or file has been modified
|
||||
if a:dosplit || &modified
|
||||
call <SID>SaveWinVars()
|
||||
call s:SaveWinVars()
|
||||
|
||||
if a:style == 0 " Explore, Sexplore
|
||||
exe g:netrw_winsize."wincmd s"
|
||||
@@ -3275,7 +3422,7 @@ fun! s:NetGetcwd(doesc)
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetMethod: determine method of transfer {{{1
|
||||
" NetMethod: determine method of transfer {{{2
|
||||
" method == 1: rcp
|
||||
" 2: ftp + <.netrc>
|
||||
" 3: ftp + machine, id, password, and [path]filename
|
||||
@@ -3475,7 +3622,7 @@ fun! s:NetMethod(choice) " globals: method machine id passwd fname
|
||||
endfun
|
||||
|
||||
" ------------------------------------------------------------------------
|
||||
" NetUserPass: set username and password for subsequent ftp transfer {{{1
|
||||
" NetUserPass: set username and password for subsequent ftp transfer {{{2
|
||||
" Usage: :call NetUserPass() -- will prompt for userid and password
|
||||
" :call NetUserPass("uid") -- will prompt for password
|
||||
" :call NetUserPass("uid","password") -- sets global userid and password
|
||||
@@ -3506,7 +3653,7 @@ fun! NetUserPass(...)
|
||||
endfun
|
||||
|
||||
" ------------------------------------------------------------------------
|
||||
" NetOptionSave: save options and set to "standard" form {{{1
|
||||
" NetOptionSave: save options and set to "standard" form {{{2
|
||||
fun! s:NetOptionSave()
|
||||
" call Dfunc("NetOptionSave()")
|
||||
if !exists("w:netoptionsave")
|
||||
@@ -3550,7 +3697,7 @@ fun! s:NetOptionSave()
|
||||
endfun
|
||||
|
||||
" ------------------------------------------------------------------------
|
||||
" NetOptionRestore: restore options {{{1
|
||||
" NetOptionRestore: restore options {{{2
|
||||
fun! s:NetOptionRestore()
|
||||
" call Dfunc("NetOptionRestore()")
|
||||
if !exists("w:netoptionsave")
|
||||
@@ -3591,7 +3738,7 @@ fun! s:NetOptionRestore()
|
||||
endfun
|
||||
|
||||
" ------------------------------------------------------------------------
|
||||
" NetReadFixup: this sort of function is typically written by the user {{{1
|
||||
" NetReadFixup: this sort of function is typically written by the user {{{2
|
||||
" to handle extra junk that their system's ftp dumps
|
||||
" into the transfer. This function is provided as an
|
||||
" example and as a fix for a Windows 95 problem: in my
|
||||
@@ -3609,7 +3756,7 @@ if has("win95") && exists("g:netrw_win95ftp") && g:netrw_win95ftp
|
||||
endif
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetSort: Piet Delport's BISort2() function, modified to take a range {{{1
|
||||
" NetSort: Piet Delport's BISort2() function, modified to take a range {{{2
|
||||
if v:version < 700
|
||||
fun! s:NetSort() range
|
||||
" " call Dfunc("NetSort()")
|
||||
@@ -3654,7 +3801,7 @@ if v:version < 700
|
||||
endif
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" SetSort: sets up the sort based on the g:netrw_sort_sequence {{{1
|
||||
" SetSort: sets up the sort based on the g:netrw_sort_sequence {{{2
|
||||
" What this function does is to compute a priority for the patterns
|
||||
" in the g:netrw_sort_sequence. It applies a substitute to any
|
||||
" "files" that satisfy each pattern, putting the priority / in
|
||||
@@ -3711,7 +3858,7 @@ fun! s:SetSort()
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" SaveWinVars: (used by Explore()) {{{1
|
||||
" SaveWinVars: (used by Explore()) {{{2
|
||||
fun! s:SaveWinVars()
|
||||
" call Dfunc("SaveWinVars()")
|
||||
if exists("w:netrw_bannercnt") |let s:bannercnt = w:netrw_bannercnt |endif
|
||||
@@ -3727,7 +3874,7 @@ fun! s:SaveWinVars()
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" CopyWinVars: (used by Explore()) {{{1
|
||||
" CopyWinVars: (used by Explore()) {{{2
|
||||
fun! s:CopyWinVars()
|
||||
" call Dfunc("CopyWinVars()")
|
||||
if exists("s:bannercnt") |let w:netrw_bannercnt = s:bannercnt |unlet s:bannercnt |endif
|
||||
@@ -3743,7 +3890,7 @@ fun! s:CopyWinVars()
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" SetBufWinVars: (used by NetBrowse() and LocalBrowse()) {{{1
|
||||
" SetBufWinVars: (used by NetBrowse() and LocalBrowse()) {{{2
|
||||
" 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
|
||||
@@ -3765,7 +3912,7 @@ fun! s:SetBufWinVars()
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" UseBufWinVars: (used by NetBrowse() and LocalBrowse() {{{1
|
||||
" UseBufWinVars: (used by NetBrowse() and LocalBrowse() {{{2
|
||||
" Matching function to BufferWinVars()
|
||||
fun! s:UseBufWinVars()
|
||||
" call Dfunc("UseBufWinVars()")
|
||||
@@ -3783,7 +3930,7 @@ fun! s:UseBufWinVars()
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" RFC2396: converts %xx into characters
|
||||
" RFC2396: converts %xx into characters {{{2
|
||||
fun! netrw#RFC2396(fname)
|
||||
" call Dfunc("RFC2396(fname<".a:fname.">)")
|
||||
let fname = escape(substitute(a:fname,'%\(\x\x\)','\=nr2char("0x".submatch(1))','ge')," \t")
|
||||
@@ -3792,7 +3939,7 @@ fun! netrw#RFC2396(fname)
|
||||
endfun
|
||||
|
||||
" ------------------------------------------------------------------------
|
||||
" Settings Restoration: {{{1
|
||||
" Settings Restoration: {{{2
|
||||
let &cpo= s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" netrwSettings.vim: makes netrw settings simpler
|
||||
" Date: Oct 12, 2005
|
||||
" Date: Jan 26, 2006
|
||||
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
|
||||
" Version: 4
|
||||
" Version: 6a ASTRO-ONLY
|
||||
" 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
|
||||
@@ -19,7 +19,7 @@
|
||||
if exists("g:loaded_netrwSettings") || &cp
|
||||
finish
|
||||
endif
|
||||
let g:loaded_netrwSettings = "v4"
|
||||
let g:loaded_netrwSettings = "v6a"
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwSettings: {{{1
|
||||
@@ -56,10 +56,10 @@ fun! netrwSettings#NetrwSettings()
|
||||
let g:netrw_ignorenetrc= 0
|
||||
endif
|
||||
|
||||
put ='+ ---------------------------------------------'
|
||||
put ='+ NetrwSettings: (by Charles E. Campbell, Jr.)'
|
||||
put ='+ --------------------------------------------'
|
||||
put ='+ NetrwSettings: by Charles E. Campbell, Jr.'
|
||||
put ='+ Press ? with cursor atop any line for help '
|
||||
put ='+ ---------------------------------------------'
|
||||
put ='+ --------------------------------------------'
|
||||
let s:netrw_settings_stop= line(".")
|
||||
|
||||
put =''
|
||||
@@ -89,6 +89,12 @@ fun! netrwSettings#NetrwSettings()
|
||||
put ='+ Netrw Browser Control'
|
||||
put = 'let g:netrw_alto = '.g:netrw_alto
|
||||
put = 'let g:netrw_altv = '.g:netrw_altv
|
||||
put = 'let g:netrw_browse_split = '.g:netrw_browse_split
|
||||
if exists("g:netrw_browsex_viewer")
|
||||
put = 'let g:netrw_browsex_viewer = '.g:netrw_browsex_viewer
|
||||
else
|
||||
put = 'let g:netrw_browsex_viewer = (not defined)'
|
||||
endif
|
||||
put = 'let g:netrw_dirhistmax = '.g:netrw_dirhistmax
|
||||
put = 'let g:netrw_ftp_browse_reject = '.g:netrw_ftp_browse_reject
|
||||
put = 'let g:netrw_ftp_list_cmd = '.g:netrw_ftp_list_cmd
|
||||
|
||||
@@ -1,10 +1,20 @@
|
||||
"pycomplete.vim - Omni Completion for python
|
||||
" Maintainer: Aaron Griffin
|
||||
" Version: 0.2
|
||||
" Last Updated: 5 January 2006
|
||||
" Version: 0.3
|
||||
" Last Updated: 23 January 2006
|
||||
"
|
||||
" v0.3 Changes:
|
||||
" added top level def parsing
|
||||
" for safety, call returns are not evaluated
|
||||
" handful of parsing changes
|
||||
" trailing ( and . characters
|
||||
" argument completion on open parens
|
||||
" stop parsing at current line - ++performance, local var resolution
|
||||
"
|
||||
" TODO
|
||||
" * local variables *inside* class members
|
||||
" RExec subclass
|
||||
" Code cleanup + make class
|
||||
" use internal dict, not globals()
|
||||
|
||||
if !has('python')
|
||||
echo "Error: Required vim compiled with +python"
|
||||
@@ -20,10 +30,10 @@ function! pycomplete#Complete(findstart, base)
|
||||
let idx -= 1
|
||||
let c = line[idx-1]
|
||||
if c =~ '\w'
|
||||
continue
|
||||
elseif ! c =~ '\.'
|
||||
continue
|
||||
elseif ! c =~ '\.'
|
||||
idx = -1
|
||||
break
|
||||
break
|
||||
else
|
||||
break
|
||||
endif
|
||||
@@ -39,79 +49,222 @@ endfunction
|
||||
|
||||
function! s:DefPython()
|
||||
python << PYTHONEOF
|
||||
import vim
|
||||
import sys
|
||||
import vim, sys, types
|
||||
import __builtin__
|
||||
import tokenize, keyword, cStringIO
|
||||
|
||||
LOCALDEFS = \
|
||||
['LOCALDEFS', 'clean_up','eval_source_code', \
|
||||
'get_completions', '__builtin__', '__builtins__', \
|
||||
'dbg', '__name__', 'vim', 'sys']
|
||||
#comment/uncomment one line at a time to enable/disable debugging
|
||||
def dbg(msg):
|
||||
pass
|
||||
# print(msg)
|
||||
'dbg', '__name__', 'vim', 'sys', 'parse_to_end', \
|
||||
'parse_statement', 'tokenize', 'keyword', 'cStringIO', \
|
||||
'debug_level', 'safe_eval', '_ctor', 'get_arguments', \
|
||||
'strip_calls', 'types', 'parse_block']
|
||||
|
||||
#it seems that by this point, vim has already stripped the base
|
||||
# matched in the findstart=1 section, so we will create the
|
||||
# statement from scratch
|
||||
def get_completions(base):
|
||||
stmt = vim.eval('expand("<cWORD>")')+base
|
||||
dbg("parsed statement => %s" % stmt)
|
||||
eval_source_code()
|
||||
def dbg(level,msg):
|
||||
debug_level = 1
|
||||
try:
|
||||
dbg("eval: %s" % stmt)
|
||||
if len(stmt.split('.')) == 1:
|
||||
all = globals().keys() + dir(__builtin__)
|
||||
match = stmt
|
||||
else:
|
||||
rindex= stmt.rfind('.')
|
||||
all = dir(eval(stmt[:rindex]))
|
||||
match = stmt[rindex+1:]
|
||||
debug_level = vim.eval("g:pycomplete_debug_level")
|
||||
except:
|
||||
pass
|
||||
if level <= debug_level: print(msg)
|
||||
|
||||
def strip_calls(stmt):
|
||||
parsed=''
|
||||
level = 0
|
||||
for c in stmt:
|
||||
if c in ['[','(']:
|
||||
level += 1
|
||||
elif c in [')',']']:
|
||||
level -= 1
|
||||
elif level == 0:
|
||||
parsed += c
|
||||
##dbg(10,"stripped: %s" % parsed)
|
||||
return parsed
|
||||
|
||||
def get_completions(base):
|
||||
stmt = vim.eval('expand("<cWORD>")')
|
||||
#dbg(1,"statement: %s - %s" % (stmt, base))
|
||||
stmt = stmt+base
|
||||
eval_source_code()
|
||||
|
||||
try:
|
||||
ridx = stmt.rfind('.')
|
||||
if stmt[-1] == '(':
|
||||
match = ""
|
||||
stmt = strip_calls(stmt[:len(stmt)-1])
|
||||
all = get_arguments(eval(stmt))
|
||||
elif ridx == -1:
|
||||
match = stmt
|
||||
all = globals() + __builtin__.__dict__
|
||||
else:
|
||||
match = stmt[ridx+1:]
|
||||
stmt = strip_calls(stmt[:ridx])
|
||||
all = eval(stmt).__dict__
|
||||
|
||||
#dbg(15,"completions for: %s, match=%s" % (stmt,match))
|
||||
completions = []
|
||||
dbg("match == %s" % match)
|
||||
for m in all:
|
||||
#TODO: remove private (_foo) functions?
|
||||
if m.find('__') != 0 and \
|
||||
m.find(match) == 0 and \
|
||||
m not in LOCALDEFS:
|
||||
dbg("matched... %s, %s" % (m, m.find(match)))
|
||||
completions.append(m)
|
||||
dbg("all completions: %s" % completions)
|
||||
if type(all) == types.DictType:
|
||||
for m in all:
|
||||
if m.find('_') != 0 and m.find(match) == 0 and \
|
||||
m not in LOCALDEFS:
|
||||
#dbg(25,"matched... %s, %s" % (m, m.find(match)))
|
||||
typestr = str(all[m])
|
||||
if "function" in typestr: m += '('
|
||||
elif "method" in typestr: m += '('
|
||||
elif "module" in typestr: m += '.'
|
||||
elif "class" in typestr: m += '('
|
||||
completions.append(m)
|
||||
completions.sort()
|
||||
else:
|
||||
completions.append(all)
|
||||
#dbg(10,"all completions: %s" % completions)
|
||||
vim.command("let g:pycomplete_completions = %s" % completions)
|
||||
except:
|
||||
dbg("exception: %s" % sys.exc_info()[1])
|
||||
vim.command("let g:pycomplete_completions = []")
|
||||
#dbg(1,"exception: %s" % sys.exc_info()[1])
|
||||
clean_up()
|
||||
|
||||
#yes, this is a quasi-functional python lexer
|
||||
def get_arguments(func_obj):
|
||||
def _ctor(obj):
|
||||
try:
|
||||
return class_ob.__init__.im_func
|
||||
except AttributeError:
|
||||
for base in class_ob.__bases__:
|
||||
rc = _find_constructor(base)
|
||||
if rc is not None: return rc
|
||||
return None
|
||||
|
||||
arg_offset = 1
|
||||
if type(func_obj) == types.ClassType: func_obj = _ctor(func_obj)
|
||||
elif type(func_obj) == types.MethodType: func_obj = func_obj.im_func
|
||||
else: arg_offset = 0
|
||||
|
||||
#dbg(20,"%s, offset=%s" % (str(func_obj), arg_offset))
|
||||
|
||||
arg_text = ''
|
||||
if type(func_obj) in [types.FunctionType, types.LambdaType]:
|
||||
try:
|
||||
cd = func_obj.func_code
|
||||
real_args = cd.co_varnames[arg_offset:cd.co_argcount]
|
||||
defaults = func_obj.func_defaults or []
|
||||
defaults = list(map(lambda name: "=%s" % name, defaults))
|
||||
defaults = [""] * (len(real_args)-len(defaults)) + defaults
|
||||
items = map(lambda a,d: a+d, real_args, defaults)
|
||||
if func_obj.func_code.co_flags & 0x4:
|
||||
items.append("...")
|
||||
if func_obj.func_code.co_flags & 0x8:
|
||||
items.append("***")
|
||||
arg_text = ", ".join(items) + ')'
|
||||
|
||||
except:
|
||||
#dbg(1,"exception: %s" % sys.exc_info()[1])
|
||||
pass
|
||||
if len(arg_text) == 0:
|
||||
# The doc string sometimes contains the function signature
|
||||
# this works for alot of C modules that are part of the
|
||||
# standard library
|
||||
doc = getattr(func_obj, '__doc__', '')
|
||||
if doc:
|
||||
doc = doc.lstrip()
|
||||
pos = doc.find('\n')
|
||||
if pos > 0:
|
||||
sigline = doc[:pos]
|
||||
lidx = sigline.find('(')
|
||||
ridx = sigline.find(')')
|
||||
retidx = sigline.find('->')
|
||||
ret = sigline[retidx+2:].strip()
|
||||
if lidx > 0 and ridx > 0:
|
||||
arg_text = sigline[lidx+1:ridx] + ')'
|
||||
if len(ret) > 0: arg_text += ' #returns %s' % ret
|
||||
#dbg(15,"argument completion: %s" % arg_text)
|
||||
return arg_text
|
||||
|
||||
def parse_to_end(gen):
|
||||
stmt=''
|
||||
level = 0
|
||||
for type, str, begin, end, line in gen:
|
||||
if line == vim.eval('getline(\'.\')'): break
|
||||
elif str == '\\': continue
|
||||
elif str == ';':
|
||||
break
|
||||
elif type == tokenize.NEWLINE and level == 0:
|
||||
break
|
||||
elif str in ['[','(']:
|
||||
level += 1
|
||||
elif str in [')',']']:
|
||||
level -= 1
|
||||
elif level == 0:
|
||||
stmt += str
|
||||
#dbg(10,"current statement: %s" % stmt)
|
||||
return stmt
|
||||
|
||||
def parse_block(gen):
|
||||
lines = []
|
||||
level = 0
|
||||
for type, str, begin, end, line in gen:
|
||||
if line.replace('\n','') == vim.eval('getline(\'.\')'): break
|
||||
elif type == tokenize.INDENT:
|
||||
level += 1
|
||||
elif type == tokenize.DEDENT:
|
||||
level -= 1
|
||||
if level == 0: break;
|
||||
else:
|
||||
stmt = parse_statement(gen,str)
|
||||
if len(stmt) > 0: lines.append(stmt)
|
||||
return lines
|
||||
|
||||
def parse_statement(gen,curstr=''):
|
||||
var = curstr
|
||||
type, str, begin, end, line = gen.next()
|
||||
if str == '=':
|
||||
type, str, begin, end, line = gen.next()
|
||||
if type == tokenize.NEWLINE:
|
||||
return ''
|
||||
elif type == tokenize.STRING or str == 'str':
|
||||
return '%s = str' % var
|
||||
elif str == '[' or str == 'list':
|
||||
return '%s= list' % var
|
||||
elif str == '{' or str == 'dict':
|
||||
return '%s = dict' % var
|
||||
elif type == tokenize.NUMBER:
|
||||
return '%s = 0' % var
|
||||
elif str == 'Set':
|
||||
return '%s = Set' % var
|
||||
elif str == 'open' or str == 'file':
|
||||
return '%s = file' % var
|
||||
else:
|
||||
inst = str + parse_to_end(gen)
|
||||
if len(inst) > 0:
|
||||
#dbg(5,"found [%s = %s]" % (var, inst))
|
||||
return '%s = %s' % (var, inst)
|
||||
return ''
|
||||
|
||||
def eval_source_code():
|
||||
import tokenize
|
||||
import keyword
|
||||
import StringIO
|
||||
s = StringIO.StringIO('\n'.join(vim.current.buffer[:]) + '\n')
|
||||
LINE=vim.eval('getline(\'.\')')
|
||||
s = cStringIO.StringIO('\n'.join(vim.current.buffer[:]) + '\n')
|
||||
g = tokenize.generate_tokens(s.readline)
|
||||
|
||||
stmts = []
|
||||
lineNo = 0
|
||||
try:
|
||||
for type, str, begin, end, line in g:
|
||||
if begin[0] == lineNo:
|
||||
continue
|
||||
if line.replace('\n','') == vim.eval('getline(\'.\')'): break
|
||||
elif begin[0] == lineNo: continue
|
||||
#junk
|
||||
elif type == tokenize.INDENT or \
|
||||
type == tokenize.DEDENT or \
|
||||
type == tokenize.ERRORTOKEN or \
|
||||
type == tokenize.ENDMARKER or \
|
||||
type == tokenize.NEWLINE:
|
||||
type == tokenize.NEWLINE or \
|
||||
type == tokenize.COMMENT:
|
||||
continue
|
||||
#import statement
|
||||
elif str == 'import':
|
||||
for type, str, begin, end, line in g:
|
||||
if str == ';' or type == tokenize.NEWLINE: break
|
||||
dbg("found [import %s]" % str)
|
||||
stmts.append("import %s" % str)
|
||||
import_stmt=parse_to_end(g)
|
||||
if len(import_stmt) > 0:
|
||||
#dbg(5,"found [import %s]" % import_stmt)
|
||||
stmts.append("import %s" % import_stmt)
|
||||
#import from statement
|
||||
elif str == 'from':
|
||||
type, str, begin, end, line = g.next()
|
||||
@@ -119,87 +272,68 @@ def eval_source_code():
|
||||
|
||||
type, str, begin, end, line = g.next()
|
||||
if str != "import": break
|
||||
mem = ''
|
||||
from_stmt=parse_to_end(g)
|
||||
if len(from_stmt) > 0:
|
||||
#dbg(5,"found [from %s import %s]" % (mod, from_stmt))
|
||||
stmts.append("from %s import %s" % (mod, from_stmt))
|
||||
#def statement
|
||||
elif str == 'def':
|
||||
funcstr = ''
|
||||
for type, str, begin, end, line in g:
|
||||
if str == ';' or type == tokenize.NEWLINE: break
|
||||
mem += (str + ',')
|
||||
if len(mem) > 0:
|
||||
dbg("found [from %s import %s]" % (mod, mem[:-1]))
|
||||
stmts.append("from %s import %s" % (mod, mem[:-1]))
|
||||
if line.replace('\n','') == vim.eval('getline(\'.\')'): break
|
||||
elif str == ':':
|
||||
stmts += parse_block(g)
|
||||
break
|
||||
funcstr += str
|
||||
if len(funcstr) > 0:
|
||||
#dbg(5,"found [def %s]" % funcstr)
|
||||
stmts.append("def %s:\n pass" % funcstr)
|
||||
#class declaration
|
||||
elif str == 'class':
|
||||
type, str, begin, end, line = g.next()
|
||||
classname = str
|
||||
dbg("found [class %s]" % classname)
|
||||
#dbg(5,"found [class %s]" % classname)
|
||||
|
||||
level = 0
|
||||
members = []
|
||||
#we don't care about the meat of the members,
|
||||
# only the signatures, so we'll replace the bodies
|
||||
# with 'pass' for evaluation
|
||||
for type, str, begin, end, line in g:
|
||||
if type == tokenize.INDENT:
|
||||
if line.replace('\n','') == vim.eval('getline(\'.\')'): break
|
||||
elif type == tokenize.INDENT:
|
||||
level += 1
|
||||
elif type == tokenize.DEDENT:
|
||||
level -= 1
|
||||
if level == 0: break;
|
||||
elif str == 'def':
|
||||
#TODO: if name begins with '_', keep private
|
||||
memberstr = ''
|
||||
for type, str, begin, end, line in g:
|
||||
if str == ':': break
|
||||
if line.replace('\n','') == vim.eval('getline(\'.\')'): break
|
||||
elif str == ':':
|
||||
stmts += parse_block(g)
|
||||
break
|
||||
memberstr += str
|
||||
dbg(" member [%s]" % memberstr)
|
||||
#dbg(5," member [%s]" % memberstr)
|
||||
members.append(memberstr)
|
||||
#TODO parse self.blah = something lines
|
||||
#elif str == "self" && next && str == "." ...blah...
|
||||
classstr = 'class %s:' % classname
|
||||
for m in members:
|
||||
classstr += ("\n def %s:\n pass" % m)
|
||||
stmts.append("%s\n" % classstr)
|
||||
elif keyword.iskeyword(str) or str in globals():
|
||||
dbg("keyword = %s" % str)
|
||||
#dbg(5,"keyword = %s" % str)
|
||||
lineNo = begin[0]
|
||||
else:
|
||||
if line.find("=") == -1: continue
|
||||
var = str
|
||||
type, str, begin, end, line = g.next()
|
||||
dbg('next = %s' % str)
|
||||
if str != '=': continue
|
||||
|
||||
type, str, begin, end, line = g.next()
|
||||
if type == tokenize.NEWLINE:
|
||||
continue
|
||||
elif type == tokenize.STRING or str == 'str':
|
||||
stmts.append('%s = str' % var)
|
||||
elif str == '[' or str == 'list':
|
||||
stmts.append('%s= list' % var)
|
||||
elif str == '{' or str == 'dict':
|
||||
stmts.append('%s = dict' % var)
|
||||
elif type == tokenize.NUMBER:
|
||||
continue
|
||||
elif str == 'Set':
|
||||
stmts.append('%s = Set' % var)
|
||||
elif str == 'open' or str == 'file':
|
||||
stmts.append('%s = file' % var)
|
||||
else:
|
||||
inst = str
|
||||
for type, str, begin, end, line in g:
|
||||
if type == tokenize.NEWLINE:
|
||||
break
|
||||
inst += str
|
||||
if len(inst) > 0:
|
||||
dbg("found [%s = %s]" % (var, inst))
|
||||
stmts.append('%s = %s' % (var, inst))
|
||||
lineNo = begin[0]
|
||||
assign = parse_statement(g,str)
|
||||
if len(assign) > 0: stmts.append(assign)
|
||||
|
||||
for s in stmts:
|
||||
try:
|
||||
dbg("evaluating: %s\n" % s)
|
||||
#dbg(15,"evaluating: %s\n" % s)
|
||||
exec(s) in globals()
|
||||
except:
|
||||
#dbg(1,"exception: %s" % sys.exc_info()[1])
|
||||
pass
|
||||
except:
|
||||
dbg("exception: %s" % sys.exc_info()[1])
|
||||
#dbg(1,"exception: %s" % sys.exc_info()[1])
|
||||
pass
|
||||
|
||||
def clean_up():
|
||||
for o in globals().keys():
|
||||
@@ -212,5 +346,6 @@ sys.path.extend(['.','..'])
|
||||
PYTHONEOF
|
||||
endfunction
|
||||
|
||||
let g:pycomplete_debug_level = 0
|
||||
call s:DefPython()
|
||||
" vim: set et ts=4:
|
||||
|
||||
111
runtime/autoload/spellfile.vim
Normal file
111
runtime/autoload/spellfile.vim
Normal file
@@ -0,0 +1,111 @@
|
||||
" Vim script to download a missing spell file
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2006 Feb 01
|
||||
|
||||
if !exists('g:spellfile_URL')
|
||||
let g:spellfile_URL = 'ftp://ftp.vim.org/pub/vim/unstable/runtime/spell'
|
||||
endif
|
||||
let s:spellfile_URL = '' " Start with nothing so that s:donedict is reset.
|
||||
|
||||
" This function is used for the spellfile plugin.
|
||||
function! spellfile#LoadFile(lang)
|
||||
" If the netrw plugin isn't loaded we silently skip everything.
|
||||
if !exists(":Nread")
|
||||
if &verbose
|
||||
echomsg 'spellfile#LoadFile(): Nread command is not available.'
|
||||
endif
|
||||
return
|
||||
endif
|
||||
|
||||
" If the URL changes we try all files again.
|
||||
if s:spellfile_URL != g:spellfile_URL
|
||||
let s:donedict = {}
|
||||
let s:spellfile_URL = g:spellfile_URL
|
||||
endif
|
||||
|
||||
" I will say this only once!
|
||||
if has_key(s:donedict, a:lang . &enc)
|
||||
if &verbose
|
||||
echomsg 'spellfile#LoadFile(): Tried this language/encoding before.'
|
||||
endif
|
||||
return
|
||||
endif
|
||||
let s:donedict[a:lang . &enc] = 1
|
||||
|
||||
" Find spell directories we can write in.
|
||||
let dirlist = []
|
||||
let dirchoices = '&Cancel'
|
||||
for dir in split(globpath(&rtp, 'spell'), "\n")
|
||||
if filewritable(dir) == 2
|
||||
call add(dirlist, dir)
|
||||
let dirchoices .= "\n&" . len(dirlist)
|
||||
endif
|
||||
endfor
|
||||
if len(dirlist) == 0
|
||||
if &verbose
|
||||
echomsg 'spellfile#LoadFile(): There is no writable spell directory.'
|
||||
endif
|
||||
return
|
||||
endif
|
||||
|
||||
let msg = 'Cannot find spell file for "' . a:lang . '" in ' . &enc
|
||||
let msg .= "\nDo you want me to try downloading it?"
|
||||
if confirm(msg, "&Yes\n&No", 2) == 1
|
||||
let enc = &encoding
|
||||
if enc == 'iso-8859-15'
|
||||
let enc = 'latin1'
|
||||
endif
|
||||
let fname = a:lang . '.' . enc . '.spl'
|
||||
|
||||
" Split the window, read the file into a new buffer.
|
||||
new
|
||||
setlocal bin
|
||||
echo 'Downloading ' . fname . '...'
|
||||
exe 'Nread ' g:spellfile_URL . '/' . fname
|
||||
if getline(2) !~ 'VIMspell'
|
||||
" Didn't work, perhaps there is an ASCII one.
|
||||
g/^/d
|
||||
let fname = a:lang . '.ascii.spl'
|
||||
echo 'Could not find it, trying ' . fname . '...'
|
||||
exe 'Nread ' g:spellfile_URL . '/' . fname
|
||||
if getline(2) !~ 'VIMspell'
|
||||
echo 'Sorry, downloading failed'
|
||||
bwipe!
|
||||
return
|
||||
endif
|
||||
endif
|
||||
|
||||
" Delete the empty first line and mark the file unmodified.
|
||||
1d
|
||||
set nomod
|
||||
|
||||
let msg = "In which directory do you want to write the file:"
|
||||
for i in range(len(dirlist))
|
||||
let msg .= "\n" . (i + 1) . '. ' . dirlist[i]
|
||||
endfor
|
||||
let dirchoice = confirm(msg, dirchoices) - 2
|
||||
if dirchoice >= 0
|
||||
exe "write " . escape(dirlist[dirchoice], ' ') . '/' . fname
|
||||
|
||||
" Also download the .sug file, if the user wants to.
|
||||
let msg = "Do you want me to try getting the .sug file?\n"
|
||||
let msg .= "This will improve making suggestions for spelling mistakes,\n"
|
||||
let msg .= "but it uses quite a bit of memory."
|
||||
if confirm(msg, "&No\n&Yes") == 2
|
||||
g/^/d
|
||||
let fname = substitute(fname, '\.spl$', '.sug', '')
|
||||
echo 'Downloading ' . fname . '...'
|
||||
exe 'Nread ' g:spellfile_URL . '/' . fname
|
||||
if getline(2) !~ 'VIMsug'
|
||||
echo 'Sorry, downloading failed'
|
||||
else
|
||||
1d
|
||||
exe "write " . escape(dirlist[dirchoice], ' ') . '/' . fname
|
||||
endif
|
||||
set nomod
|
||||
endif
|
||||
endif
|
||||
|
||||
bwipe
|
||||
endif
|
||||
endfunc
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim completion script
|
||||
" Language: XHTML 1.0 Strict
|
||||
" Language: XML
|
||||
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" Last Change: 2005 Nov 22
|
||||
" Last Change: 2006 Feb 18
|
||||
|
||||
" This function will create Dictionary with users namespace strings and values
|
||||
" canonical (system) names of data files. Names should be lowercase,
|
||||
@@ -54,6 +54,7 @@ endfunction
|
||||
function! xmlcomplete#CompleteTags(findstart, base)
|
||||
if a:findstart
|
||||
" locate the start of the word
|
||||
let curline = line('.')
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
let compl_begin = col('.') - 2
|
||||
@@ -69,11 +70,32 @@ function! xmlcomplete#CompleteTags(findstart, base)
|
||||
endif
|
||||
|
||||
let b:compl_context = getline('.')[0:(compl_begin)]
|
||||
let b:compl_context = matchstr(b:compl_context, '.*<\zs.*')
|
||||
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<.*')
|
||||
|
||||
" Make sure we will have only current namespace
|
||||
unlet! b:xml_namespace
|
||||
let b:xml_namespace = matchstr(b:compl_context, '^\k*\ze:')
|
||||
let b:xml_namespace = matchstr(b:compl_context, '^<\zs\k*\ze:')
|
||||
if b:xml_namespace == ''
|
||||
let b:xml_namespace = 'DEFAULT'
|
||||
endif
|
||||
@@ -89,7 +111,10 @@ function! xmlcomplete#CompleteTags(findstart, base)
|
||||
let res = []
|
||||
let res2 = []
|
||||
" a:base is very short - we need context
|
||||
let context = b:compl_context
|
||||
if len(b:compl_context) == 0 && !exists("b:entitiescompl")
|
||||
return []
|
||||
endif
|
||||
let context = matchstr(b:compl_context, '^<\zs.*')
|
||||
unlet! b:compl_context
|
||||
|
||||
" Make entities completion
|
||||
@@ -111,13 +136,24 @@ function! xmlcomplete#CompleteTags(findstart, base)
|
||||
let values = intent + values
|
||||
endif
|
||||
|
||||
for m in values
|
||||
if m =~ '^'.a:base
|
||||
call add(res, m.';')
|
||||
endif
|
||||
endfor
|
||||
if len(a:base) == 1
|
||||
for m in values
|
||||
if m =~ '^'.a:base
|
||||
call add(res, m.';')
|
||||
endif
|
||||
endfor
|
||||
return res
|
||||
else
|
||||
for m in values
|
||||
if m =~? '^'.a:base
|
||||
call add(res, m.';')
|
||||
elseif m =~? a:base
|
||||
call add(res2, m.';')
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res
|
||||
return res + res2
|
||||
endif
|
||||
|
||||
endif
|
||||
if context =~ '>'
|
||||
@@ -194,25 +230,42 @@ function! xmlcomplete#CompleteTags(findstart, base)
|
||||
|
||||
for m in sort(attrs)
|
||||
if m =~ '^'.attr
|
||||
if tag !~ '^[?!]' && len(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][m]) > 0 && g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][m][0] =~ '^BOOL$'
|
||||
call add(res, m)
|
||||
elseif m =~ '='
|
||||
call add(res, m)
|
||||
else
|
||||
call add(res, m.'="')
|
||||
endif
|
||||
call add(res, m)
|
||||
elseif m =~ attr
|
||||
if tag !~ '^[?!]' && len(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][m]) > 0 && g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][m][0] =~ '^BOOL$'
|
||||
call add(res, m)
|
||||
elseif m =~ '='
|
||||
call add(res, m)
|
||||
else
|
||||
call add(res2, m.'="')
|
||||
endif
|
||||
call add(res2, m)
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
let menu = res + res2
|
||||
let final_menu = []
|
||||
if has_key(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}, 'vimxmlattrinfo')
|
||||
for i in range(len(menu))
|
||||
let item = menu[i]
|
||||
if has_key(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}['vimxmlattrinfo'], item)
|
||||
let m_menu = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}['vimxmlattrinfo'][item][0]
|
||||
let m_info = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}['vimxmlattrinfo'][item][1]
|
||||
else
|
||||
let m_menu = ''
|
||||
let m_info = ''
|
||||
endif
|
||||
if tag !~ '^[?!]' && len(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][item]) > 0 && g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][item][0] =~ '^\(BOOL\|'.item.'\)$'
|
||||
let item = item
|
||||
else
|
||||
let item .= '="'
|
||||
endif
|
||||
let final_menu += [{'word':item, 'menu':m_menu, 'info':m_info}]
|
||||
endfor
|
||||
else
|
||||
for i in range(len(menu))
|
||||
let item = menu[i]
|
||||
if tag !~ '^[?!]' && len(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][item]) > 0 && g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][item][0] =~ '^\(BOOL\|'.item.'\)$'
|
||||
let item = item
|
||||
else
|
||||
let item .= '="'
|
||||
endif
|
||||
let final_menu += [item]
|
||||
endfor
|
||||
endif
|
||||
return final_menu
|
||||
|
||||
endif
|
||||
" Close tag
|
||||
@@ -265,25 +318,46 @@ function! xmlcomplete#CompleteTags(findstart, base)
|
||||
" Deal with tag completion.
|
||||
let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
|
||||
let opentag = substitute(opentag, '^\k*:', '', '')
|
||||
|
||||
let tags = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[opentag][0]
|
||||
let context = substitute(context, '^\k*:', '', '')
|
||||
|
||||
if b:xml_namespace == 'DEFAULT'
|
||||
let b:xml_namespace = ''
|
||||
if opentag == ''
|
||||
"return []
|
||||
let tags = keys(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]})
|
||||
call filter(tags, 'v:val !~ "^vimxml"')
|
||||
else
|
||||
let b:xml_namespace .= ':'
|
||||
let tags = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[opentag][0]
|
||||
endif
|
||||
|
||||
let context = substitute(context, '^\k*:', '', '')
|
||||
|
||||
for m in tags
|
||||
if m =~ '^'.context
|
||||
call add(res, b:xml_namespace.m)
|
||||
call add(res, m)
|
||||
elseif m =~ context
|
||||
call add(res2, b:xml_namespace.m)
|
||||
call add(res2, m)
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
let menu = res + res2
|
||||
if has_key(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}, 'vimxmltaginfo')
|
||||
let final_menu = []
|
||||
for i in range(len(menu))
|
||||
let item = menu[i]
|
||||
if has_key(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}['vimxmltaginfo'], item)
|
||||
let m_menu = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}['vimxmltaginfo'][item][0]
|
||||
let m_info = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}['vimxmltaginfo'][item][1]
|
||||
else
|
||||
let m_menu = ''
|
||||
let m_info = ''
|
||||
endif
|
||||
if b:xml_namespace == 'DEFAULT'
|
||||
let xml_namespace = ''
|
||||
else
|
||||
let xml_namespace = b:xml_namespace.':'
|
||||
endif
|
||||
let final_menu += [{'word':xml_namespace.item, 'menu':m_menu, 'info':m_info}]
|
||||
endfor
|
||||
else
|
||||
let final_menu = menu
|
||||
endif
|
||||
return final_menu
|
||||
|
||||
endif
|
||||
endfunction
|
||||
@@ -357,11 +431,11 @@ return ''
|
||||
endfunction
|
||||
|
||||
function! s:InComment()
|
||||
return synIDattr(synID(line('.'), col('.'), 0), 'name') =~ 'Comment'
|
||||
return synIDattr(synID(line('.'), col('.'), 0), 'name') =~ 'Comment\|String'
|
||||
endfunction
|
||||
|
||||
function! s:InCommentAt(line, col)
|
||||
return synIDattr(synID(a:line, a:col, 0), 'name') =~ 'Comment'
|
||||
return synIDattr(synID(a:line, a:col, 0), 'name') =~ 'Comment\|String'
|
||||
endfunction
|
||||
|
||||
function! s:SetKeywords()
|
||||
|
||||
@@ -89,6 +89,7 @@ DOCS = \
|
||||
starting.txt \
|
||||
spell.txt \
|
||||
syntax.txt \
|
||||
tabpage.txt \
|
||||
tagsrch.txt \
|
||||
term.txt \
|
||||
tips.txt \
|
||||
@@ -211,6 +212,7 @@ HTMLS = \
|
||||
starting.html \
|
||||
spell.html \
|
||||
syntax.html \
|
||||
tabpage.html \
|
||||
tagsrch.html \
|
||||
tags.html \
|
||||
term.html \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 7.0aa. Last change: 2006 Jan 08
|
||||
*autocmd.txt* For Vim version 7.0aa. Last change: 2006 Feb 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -273,13 +273,19 @@ Name triggered by ~
|
||||
|FileChangedRO| before making the first change to a read-only file
|
||||
|
||||
|FuncUndefined| a user function is used but it isn't defined
|
||||
|SpellFileMissing| a spell file is used but it can't be found
|
||||
|
||||
|FocusGained| Vim got input focus
|
||||
|FocusLost| Vim lost input focus
|
||||
|CursorHold| the user doesn't press a key for a while
|
||||
|CursorHoldI| the user doesn't press a key for a while in Insert mode
|
||||
|CursorMoved| the cursor was moved in Normal mode
|
||||
|CursorMovedI| the cursor was moved in Insert mode
|
||||
|
||||
|WinEnter| after entering another window
|
||||
|WinLeave| before leaving a window
|
||||
|TabEnter| after entering another tab page
|
||||
|TabLeave| before leaving a tab page
|
||||
|CmdwinEnter| after entering the command-line window
|
||||
|CmdwinLeave| before leaving the command-line window
|
||||
|
||||
@@ -439,6 +445,7 @@ CmdwinLeave Before leaving the command-line window.
|
||||
|cmdwin-char|
|
||||
*ColorScheme*
|
||||
ColorScheme After loading a color scheme. |:colorscheme|
|
||||
|
||||
*CursorHold*
|
||||
CursorHold When the user doesn't press a key for the time
|
||||
specified with 'updatetime'. Not re-triggered
|
||||
@@ -459,6 +466,19 @@ CursorHold When the user doesn't press a key for the time
|
||||
:let &ro = &ro
|
||||
< {only on Amiga, Unix, Win32, MSDOS and all GUI
|
||||
versions}
|
||||
*CursorHoldI*
|
||||
CursorHoldI Just like CursorHold, but in Insert mode.
|
||||
|
||||
*CursorMoved*
|
||||
CursorMoved After the cursor was moved in Normal mode.
|
||||
Not triggered when there is typeahead or when
|
||||
an operator is pending.
|
||||
For an example see |match-parens|.
|
||||
Careful: Don't do anything that the user does
|
||||
not expect or that is slow.
|
||||
*CursorMovedI*
|
||||
CursorMovedI After the cursor was moved in Insert mode.
|
||||
Otherwise the same as CursorMoved.
|
||||
*EncodingChanged*
|
||||
EncodingChanged Fires off after the 'encoding' option has been
|
||||
changed. Useful to set up fonts, for example.
|
||||
@@ -619,11 +639,12 @@ MenuPopup Just before showing the popup menu (under the
|
||||
c Commmand line
|
||||
*QuickFixCmdPre*
|
||||
QuickFixCmdPre Before a quickfix command is run (|:make|,
|
||||
|:grep|, |:grepadd|, |:vimgrep|,
|
||||
|:vimgrepadd|). The pattern is matched against
|
||||
the command being run. When |:grep| is used
|
||||
but 'grepprg' is set to "internal" it still
|
||||
matches "grep".
|
||||
|:lmake|, |:grep|, |:lgrep|, |:grepadd|,
|
||||
|:lgrepadd|, |:vimgrep|, |:lvimgrep|,
|
||||
|:vimgrepadd|, |:vimgrepadd|). The pattern is
|
||||
matched against the command being run. When
|
||||
|:grep| is used but 'grepprg' is set to
|
||||
"internal" it still matches "grep".
|
||||
This command cannot be used to set the
|
||||
'makeprg' and 'grepprg' variables.
|
||||
If this command causes an error, the quickfix
|
||||
@@ -643,6 +664,11 @@ RemoteReply When a reply from a Vim that functions as
|
||||
*SessionLoadPost*
|
||||
SessionLoadPost After loading the session file created using
|
||||
the |:mksession| command.
|
||||
*SpellFileMissing*
|
||||
SpellFileMissing When trying to load a spell checking file and
|
||||
it can't be found. <amatch> is the language,
|
||||
'encoding' also matters. See
|
||||
|spell-SpellFileMissing|.
|
||||
*StdinReadPost*
|
||||
StdinReadPost After reading from the stdin into the buffer,
|
||||
before executing the modelines. Only used
|
||||
@@ -680,6 +706,14 @@ Syntax When the 'syntax' option has been set.
|
||||
where this option was set, and <amatch> for
|
||||
the new value of 'syntax'.
|
||||
See |:syn-on|.
|
||||
*TabEnter*
|
||||
TabEnter Just after entering a tab page. |tab-page|
|
||||
Before triggering the WinEnter and BufEnter
|
||||
events.
|
||||
*TabLeave*
|
||||
TabLeave Just before leaving a tab page. |tab-page|
|
||||
A WinLeave event will have been triggered
|
||||
first.
|
||||
*TermChanged*
|
||||
TermChanged After the value of 'term' has changed. Useful
|
||||
for re-loading the syntax file to update the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*change.txt* For Vim version 7.0aa. Last change: 2005 Dec 16
|
||||
*change.txt* For Vim version 7.0aa. Last change: 2006 Feb 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1168,12 +1168,18 @@ The next three commands always work on whole lines.
|
||||
|
||||
*gq*
|
||||
gq{motion} Format the lines that {motion} moves over.
|
||||
If 'formatprg' is empty formatting is done internally
|
||||
and the 'textwidth' option controls the length of each
|
||||
formatted line (see below).
|
||||
Formatting is done with one of three methods:
|
||||
1. If 'formatexpr' is not empty the expression is
|
||||
evaluated. This can differ for each buffer.
|
||||
2. If 'formatprg' is not empty an external program
|
||||
is used.
|
||||
3. Otherise formatting is done internally.
|
||||
|
||||
In the third case the 'textwidth' option controls the
|
||||
length of each formatted line (see below).
|
||||
If the 'textwidth' option is 0, the formatted line
|
||||
length is the screen width (with a maximum width of
|
||||
79). {not in Vi}
|
||||
79).
|
||||
The 'formatoptions' option controls the type of
|
||||
formatting |fo-table|.
|
||||
The cursor is left on the first non-blank of the last
|
||||
@@ -1193,8 +1199,8 @@ gqq Format the current line. {not in Vi}
|
||||
*gw*
|
||||
gw{motion} Format the lines that {motion} moves over. Similar to
|
||||
|gq| but puts the cursor back at the same position in
|
||||
the text. However, 'formatprg' is not used.
|
||||
{not in Vi}
|
||||
the text. However, 'formatprg' and 'formatexpr' are
|
||||
not used. {not in Vi}
|
||||
|
||||
gwgw *gwgw* *gww*
|
||||
gww Format the current line as with "gw". {not in Vi}
|
||||
@@ -1225,9 +1231,10 @@ white space!).
|
||||
|
||||
The 'joinspaces' option is used when lines are joined together.
|
||||
|
||||
You can set the 'formatprg' option to the name of an external program for Vim
|
||||
to use for text formatting. The 'textwidth' and other options have no effect
|
||||
on formatting by an external program.
|
||||
You can set the 'formatexpr' option to an expression or the 'formatprg' option
|
||||
to the name of an external program for Vim to use for text formatting. The
|
||||
'textwidth' and other options have no effect on formatting by an external
|
||||
program.
|
||||
|
||||
*right-justify*
|
||||
There is no command in Vim to right justify text. You can do it with
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*cmdline.txt* For Vim version 7.0aa. Last change: 2006 Jan 19
|
||||
*cmdline.txt* For Vim version 7.0aa. Last change: 2006 Feb 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -479,6 +479,7 @@ followed by another command:
|
||||
:global
|
||||
:help
|
||||
:helpfind
|
||||
:lcscope
|
||||
:make
|
||||
:normal
|
||||
:perl
|
||||
@@ -746,7 +747,7 @@ Note: these are typed literally, they are not special keys!
|
||||
<amatch> when executing autocommands, is replaced with the match for
|
||||
which this autocommand was executed. It differs from
|
||||
<afile> only when the file name isn't used to match with
|
||||
(for FileType and Syntax events).
|
||||
(for FileType, Syntax and SpellFileMissing events).
|
||||
<sfile> when executing a ":source" command, is replaced with the
|
||||
file name of the sourced file;
|
||||
when executing a function, is replaced with
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*diff.txt* For Vim version 7.0aa. Last change: 2005 Sep 21
|
||||
*diff.txt* For Vim version 7.0aa. Last change: 2006 Feb 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -41,6 +41,10 @@ the file.
|
||||
|
||||
This only works when a standard "diff" command is available. See 'diffexpr'.
|
||||
|
||||
Diffs are local to the current tab page |tab-page|. You can't see diffs with
|
||||
a window in another tab page. This does make it possible to have several
|
||||
diffs at the same time, each in their own tab page.
|
||||
|
||||
What happens is that Vim opens a window for each of the files. This is like
|
||||
using the |-O| argument. This uses vertical splits. If you prefer horizontal
|
||||
splits add the |-o| argument: >
|
||||
@@ -113,7 +117,7 @@ file for a moment and come back to the same file and be in diff mode again.
|
||||
*:diffo* *:diffoff*
|
||||
:diffoff Switch off diff mode for the current window.
|
||||
|
||||
:diffoff! Switch off diff mode for all windows.
|
||||
:diffoff! Switch off diff mode for all windows in the current tab page.
|
||||
|
||||
The ":diffoff" command resets the relevant options to their default value.
|
||||
This may be different from what the values were before diff mode was started,
|
||||
@@ -345,8 +349,8 @@ get an error message. Possible causes:
|
||||
- The 'shell' and associated options are not set correctly. Try if filtering
|
||||
works with a command like ":!sort".
|
||||
- You are using 'diffexpr' and it doesn't work.
|
||||
If it's not clear what the problem is set the 'verbose' option to see more
|
||||
messages.
|
||||
If it's not clear what the problem is set the 'verbose' option to one or more
|
||||
to see more messages.
|
||||
|
||||
The self-installing Vim includes a diff program. If you don't have it you
|
||||
might want to download a diff.exe. For example from
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 7.0aa. Last change: 2006 Jan 20
|
||||
*editing.txt* For Vim version 7.0aa. Last change: 2006 Feb 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -334,6 +334,22 @@ CTRL-^ Edit the alternate file (equivalent to ":e #").
|
||||
(For {Visual} see |Visual-mode|.)
|
||||
{not in VI}
|
||||
|
||||
*gF*
|
||||
[count]gF Same as "gf", except if a number follows the file
|
||||
name, then the cursor is positioned on that line in
|
||||
the file. The file name and the number must be
|
||||
separated by a non-filename (see 'isfname') and
|
||||
non-numeric character. White space between the
|
||||
filename, the separator and the number are ignored.
|
||||
Examples: >
|
||||
eval.c:10
|
||||
eval.c @ 20
|
||||
eval.c (30)
|
||||
eval.c 40
|
||||
<
|
||||
*v_gF*
|
||||
{Visual}[count]gF Same as "v_gf".
|
||||
|
||||
These commands are used to start editing a single file. This means that the
|
||||
file is read into the buffer and the current file name is set. The file that
|
||||
is opened depends on the current directory, see |:cd|.
|
||||
@@ -1014,6 +1030,9 @@ The names can be in upper- or lowercase.
|
||||
Vim refuses to |abandon| the current buffer, and when
|
||||
the last file in the argument list has not been
|
||||
edited.
|
||||
If there are other tab pages and quitting the last
|
||||
window in the current tab page the current tab page is
|
||||
closed |tab-page|.
|
||||
|
||||
:conf[irm] q[uit] Quit, but give prompt when changes have been made, or
|
||||
the last file in the argument list has not been
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 7.0aa. Last change: 2006 Jan 20
|
||||
*eval.txt* For Vim version 7.0aa. Last change: 2006 Feb 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1203,6 +1203,7 @@ v:count The count given for the last Normal mode command. Can be used
|
||||
:map _x :<C-U>echo "the count is " . v:count<CR>
|
||||
< Note: The <C-U> is required to remove the line range that you
|
||||
get when typing ':' after a count.
|
||||
Also used for evaluating the 'formatexpr' option.
|
||||
"count" also works, for backwards compatibility.
|
||||
|
||||
*v:count1* *count1-variable*
|
||||
@@ -1562,6 +1563,7 @@ getftime( {fname}) Number last modification time of file
|
||||
getftype( {fname}) String description of type of file {fname}
|
||||
getline( {lnum}) String line {lnum} of current buffer
|
||||
getline( {lnum}, {end}) List lines {lnum} to {end} of current buffer
|
||||
getloclist({nr}) List list of location list items
|
||||
getqflist() List list of quickfix items
|
||||
getreg( [{regname} [, 1]]) String contents of register
|
||||
getregtype( [{regname}]) String type of register
|
||||
@@ -1623,6 +1625,7 @@ nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum}
|
||||
nr2char( {expr}) String single char with ASCII value {expr}
|
||||
prevnonblank( {lnum}) Number line nr of non-blank line <= {lnum}
|
||||
printf( {fmt}, {expr1}...) String format text
|
||||
pumvisible() Number whether popup menu is visible
|
||||
range( {expr} [, {max} [, {stride}]])
|
||||
List items from {expr} to {max}
|
||||
readfile({fname} [, {binary} [, {max}]])
|
||||
@@ -1646,13 +1649,19 @@ searchdecl({name} [, {global} [, {thisblock}]])
|
||||
Number search for variable declaration
|
||||
searchpair( {start}, {middle}, {end} [, {flags} [, {skip}]])
|
||||
Number search for other end of start/end pair
|
||||
searchpairpos( {start}, {middle}, {end} [, {flags} [, {skip}]])
|
||||
List search for other end of start/end pair
|
||||
searchpos( {pattern} [, {flags}])
|
||||
List search for {pattern}
|
||||
server2client( {clientid}, {string})
|
||||
Number send reply string
|
||||
serverlist() String get a list of available servers
|
||||
setbufvar( {expr}, {varname}, {val}) set {varname} in buffer {expr} to {val}
|
||||
setcmdpos( {pos}) Number set cursor position in command-line
|
||||
setline( {lnum}, {line}) Number set line {lnum} to {line}
|
||||
setqflist( {list}[, {action}]) Number set list of quickfix items using {list}
|
||||
setloclist( {nr}, {list}[, {action}])
|
||||
Number modify location list using {list}
|
||||
setqflist( {list}[, {action}]) Number modify quickfix list using {list}
|
||||
setreg( {n}, {v}[, {opt}]) Number set register to value and type
|
||||
setwinvar( {nr}, {varname}, {val}) set {varname} in window {nr} to {val}
|
||||
simplify( {filename}) String simplify filename as much as possible
|
||||
@@ -1681,7 +1690,11 @@ synIDattr( {synID}, {what} [, {mode}])
|
||||
String attribute {what} of syntax ID {synID}
|
||||
synIDtrans( {synID}) Number translated syntax ID of {synID}
|
||||
system( {expr} [, {input}]) String output of shell command/filter {expr}
|
||||
taglist( {expr}) List list of tags matching {expr}
|
||||
tabpagebuflist( [{arg}]) List list of buffer numbers in tab page
|
||||
tabpagenr( [{arg}]) Number number of current or last tab page
|
||||
tabpagewinnr( {tabarg}[, {arg}])
|
||||
Number number of current window in tab page
|
||||
taglist( {expr}) List list of tags matching {expr}
|
||||
tagfiles() List tags files used
|
||||
tempname() String name for a temporary file
|
||||
tolower( {expr}) String the String {expr} switched to lowercase
|
||||
@@ -1696,7 +1709,7 @@ winbufnr( {nr}) Number buffer number of window {nr}
|
||||
wincol() Number window column of the cursor
|
||||
winheight( {nr}) Number height of window {nr}
|
||||
winline() Number window line of the cursor
|
||||
winnr() Number number of current window
|
||||
winnr( [{expr}]) Number number of current window
|
||||
winrestcmd() String returns command to restore window sizes
|
||||
winwidth( {nr}) Number width of window {nr}
|
||||
writefile({list}, {fname} [, {binary}])
|
||||
@@ -1891,8 +1904,8 @@ char2nr({expr}) *char2nr()*
|
||||
char2nr(" ") returns 32
|
||||
char2nr("ABC") returns 65
|
||||
< The current 'encoding' is used. Example for "utf-8": >
|
||||
char2nr("<EFBFBD>") returns 225
|
||||
char2nr("<EFBFBD>"[0]) returns 195
|
||||
char2nr("?") returns 225
|
||||
char2nr("?"[0]) returns 195
|
||||
< nr2char() does the opposite.
|
||||
|
||||
cindent({lnum}) *cindent()*
|
||||
@@ -2368,9 +2381,11 @@ filter({expr}, {string}) *filter()*
|
||||
|
||||
The operation is done in-place. If you want a List or
|
||||
Dictionary to remain unmodified make a copy first: >
|
||||
:let l = filter(copy(mylist), '& =~ "KEEP"')
|
||||
:let l = filter(copy(mylist), 'v:val =~ "KEEP"')
|
||||
|
||||
< Returns {expr}, the List or Dictionary that was filtered.
|
||||
When an error is encountered while evaluating {string} no
|
||||
further items in {expr} are processed.
|
||||
|
||||
|
||||
finddir({name}[, {path}[, {count}]]) *finddir()*
|
||||
@@ -2693,6 +2708,12 @@ getline({lnum} [, {end}])
|
||||
:let end = search("^$") - 1
|
||||
:let lines = getline(start, end)
|
||||
|
||||
getloclist({nr}) *getloclist()*
|
||||
Returns a list with all the entries in the location list for
|
||||
window {nr}. When {nr} is zero the current window is used.
|
||||
For a location list window, the displayed location list is
|
||||
returned. For an invalid window number {nr}, an empty list is
|
||||
returned. Otherwise, same as getqflist().
|
||||
|
||||
getqflist() *getqflist()*
|
||||
Returns a list with all the current quickfix errors. Each
|
||||
@@ -3199,6 +3220,8 @@ line({expr}) The result is a Number, which is the line number of the file
|
||||
$ the last line in the current buffer
|
||||
'x position of mark x (if the mark is not set, 0 is
|
||||
returned)
|
||||
w0 first line visible in current window
|
||||
w$ last line visible in current window
|
||||
Note that only marks in the current file can be used.
|
||||
Examples: >
|
||||
line(".") line number of the cursor
|
||||
@@ -3255,12 +3278,14 @@ map({expr}, {string}) *map()*
|
||||
:let tlist = map(copy(mylist), ' & . "\t"')
|
||||
|
||||
< Returns {expr}, the List or Dictionary that was filtered.
|
||||
When an error is encountered while evaluating {string} no
|
||||
further items in {expr} are processed.
|
||||
|
||||
|
||||
maparg({name}[, {mode}]) *maparg()*
|
||||
Return the rhs of mapping {name} in mode {mode}. When there
|
||||
is no mapping for {name}, an empty String is returned.
|
||||
These characters can be used for {mode}:
|
||||
{mode} can be one of these strings:
|
||||
"n" Normal
|
||||
"v" Visual
|
||||
"o" Operator-pending
|
||||
@@ -3268,7 +3293,7 @@ maparg({name}[, {mode}]) *maparg()*
|
||||
"c" Cmd-line
|
||||
"l" langmap |language-mapping|
|
||||
"" Normal, Visual and Operator-pending
|
||||
When {mode} is omitted, the modes from "" are used.
|
||||
When {mode} is omitted, the modes for "" are used.
|
||||
The {name} can have special key names, like in the ":map"
|
||||
command. The returned String has special characters
|
||||
translated like in the output of the ":map" command listing.
|
||||
@@ -3456,6 +3481,15 @@ nr2char({expr}) *nr2char()*
|
||||
characters. nr2char(0) is a real NUL and terminates the
|
||||
string, thus results in an empty string.
|
||||
|
||||
prevnonblank({lnum}) *prevnonblank()*
|
||||
Return the line number of the first line at or above {lnum}
|
||||
that is not blank. Example: >
|
||||
let ind = indent(prevnonblank(v:lnum - 1))
|
||||
< When {lnum} is invalid or there is no non-blank line at or
|
||||
above it, zero is returned.
|
||||
Also see |nextnonblank()|.
|
||||
|
||||
|
||||
printf({fmt}, {expr1} ...) *printf()*
|
||||
Return a String with {fmt}, where "%" items are replaced by
|
||||
the formatted form of their respective arguments. Example: >
|
||||
@@ -3465,7 +3499,8 @@ printf({fmt}, {expr1} ...) *printf()*
|
||||
|
||||
Often used items are:
|
||||
%s string
|
||||
%6s string right-aligned in 6 characters
|
||||
%6s string right-aligned in 6 bytes
|
||||
%.9s string truncated to 9 bytes
|
||||
%c single byte
|
||||
%d decimal number
|
||||
%5d decimal number padded with spaces to 5 characters
|
||||
@@ -3473,7 +3508,7 @@ printf({fmt}, {expr1} ...) *printf()*
|
||||
%04x hex number padded with zeros to at least 4 characters
|
||||
%X hex number using upper case letters
|
||||
%o octal number
|
||||
%% the % character
|
||||
%% the % character itself
|
||||
|
||||
Conversion specifications start with '%' and end with the
|
||||
conversion type. All other characters are copied unchanged to
|
||||
@@ -3519,11 +3554,10 @@ printf({fmt}, {expr1} ...) *printf()*
|
||||
|
||||
field-width
|
||||
An optional decimal digit string specifying a minimum
|
||||
field width. If the converted value has fewer
|
||||
characters than the field width, it will be padded
|
||||
with spaces on the left (or right, if the
|
||||
left-adjustment flag has been given) to fill out the
|
||||
field width.
|
||||
field width. If the converted value has fewer bytes
|
||||
than the field width, it will be padded with spaces on
|
||||
the left (or right, if the left-adjustment flag has
|
||||
been given) to fill out the field width.
|
||||
|
||||
.precision
|
||||
An optional precision, in the form of a period '.'
|
||||
@@ -3531,8 +3565,7 @@ printf({fmt}, {expr1} ...) *printf()*
|
||||
string is omitted, the precision is taken as zero.
|
||||
This gives the minimum number of digits to appear for
|
||||
d, o, x, and X conversions, or the maximum number of
|
||||
characters to be printed from a string for s
|
||||
conversions.
|
||||
bytes to be printed from a string for s conversions.
|
||||
|
||||
type
|
||||
A character that specifies the type of conversion to
|
||||
@@ -3584,13 +3617,10 @@ printf({fmt}, {expr1} ...) *printf()*
|
||||
arguments an error is given. Up to 18 arguments can be used.
|
||||
|
||||
|
||||
prevnonblank({lnum}) *prevnonblank()*
|
||||
Return the line number of the first line at or above {lnum}
|
||||
that is not blank. Example: >
|
||||
let ind = indent(prevnonblank(v:lnum - 1))
|
||||
< When {lnum} is invalid or there is no non-blank line at or
|
||||
above it, zero is returned.
|
||||
Also see |nextnonblank()|.
|
||||
pumvisible() *pumvisible()*
|
||||
Returns non-zero when the popup menu is visible, zero
|
||||
otherwise. See |ins-completion-menu|.
|
||||
|
||||
|
||||
*E726* *E727*
|
||||
range({expr} [, {max} [, {stride}]]) *range()*
|
||||
@@ -3700,9 +3730,9 @@ remote_send({server}, {string} [, {idvar}])
|
||||
Send the {string} to {server}. The string is sent as input
|
||||
keys and the function returns immediately. At the Vim server
|
||||
the keys are not mapped |:map|.
|
||||
If {idvar} is present, it is taken as the name of a
|
||||
variable and a {serverid} for later use with
|
||||
remote_read() is stored there.
|
||||
If {idvar} is present, it is taken as the name of a variable
|
||||
and a {serverid} for later use with remote_read() is stored
|
||||
there.
|
||||
See also |clientserver| |RemoteReply|.
|
||||
This function is not available in the |sandbox|.
|
||||
{only available when compiled with the |+clientserver| feature}
|
||||
@@ -3834,10 +3864,12 @@ searchpair({start}, {middle}, {end} [, {flags} [, {skip}]])
|
||||
Search for the match of a nested start-end pair. This can be
|
||||
used to find the "endif" that matches an "if", while other
|
||||
if/endif pairs in between are ignored.
|
||||
The search starts at the cursor. If a match is found, the
|
||||
cursor is positioned at it and the line number is returned.
|
||||
If no match is found 0 or -1 is returned and the cursor
|
||||
doesn't move. No error message is given.
|
||||
The search starts at the cursor. The default is to search
|
||||
forward, include 'b' in {flags} to search backward.
|
||||
If a match is found, the cursor is positioned at it and the
|
||||
line number is returned. If no match is found 0 or -1 is
|
||||
returned and the cursor doesn't move. No error message is
|
||||
given.
|
||||
|
||||
{start}, {middle} and {end} are patterns, see |pattern|. They
|
||||
must not contain \( \) pairs. Use of \%( \) is allowed. When
|
||||
@@ -3905,6 +3937,27 @@ searchpair({start}, {middle}, {end} [, {flags} [, {skip}]])
|
||||
|
||||
:echo searchpair('{', '', '}', 'bW',
|
||||
\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"')
|
||||
<
|
||||
*searchpairpos()*
|
||||
searchpairpos({start}, {middle}, {end} [, {flags} [, {skip}]])
|
||||
Same as searchpair(), but returns a List with the line and
|
||||
column position of the match. The first element of the List is
|
||||
the line number and the second element is the byte index of
|
||||
the column position of the match. If no match is found,
|
||||
returns [0, 0].
|
||||
>
|
||||
:let [lnum,col] = searchpairpos('{', '', '}', 'n')
|
||||
<
|
||||
See |match-parens| for a bigger and more useful example.
|
||||
|
||||
searchpos({pattern} [, {flags}]) *searchpos()*
|
||||
Same as search(), but returns a List with the line and column
|
||||
position of the match. The first element of the List is the
|
||||
line number and the second element is the byte index of the
|
||||
column position of the match. If no match is found, returns
|
||||
[0, 0].
|
||||
>
|
||||
:let [lnum,col] = searchpos('mypattern', 'n')
|
||||
<
|
||||
server2client( {clientid}, {string}) *server2client()*
|
||||
Send a reply string to {clientid}. The most recent {clientid}
|
||||
@@ -3971,12 +4024,18 @@ setline({lnum}, {line}) *setline()*
|
||||
:endfor
|
||||
< Note: The '[ and '] marks are not set.
|
||||
|
||||
setloclist({nr}, {list} [, {action}]) *setloclist()*
|
||||
Create or replace or add to the location list for window {nr}.
|
||||
When {nr} is zero the current window is used. For a location
|
||||
list window, the displayed location list is modified. For an
|
||||
invalid window number {nr}, -1 is returned.
|
||||
Otherwise, same as setqflist().
|
||||
|
||||
setqflist({list} [, {action}]) *setqflist()*
|
||||
Creates a quickfix list using the items in {list}. Each item
|
||||
in {list} is a dictionary. Non-dictionary items in {list} are
|
||||
ignored. Each dictionary item can contain the following
|
||||
entries:
|
||||
Create or replace or add to the quickfix list using the items
|
||||
in {list}. Each item in {list} is a dictionary.
|
||||
Non-dictionary items in {list} are ignored. Each dictionary
|
||||
item can contain the following entries:
|
||||
|
||||
filename name of a file
|
||||
lnum line number in the file
|
||||
@@ -4394,20 +4453,55 @@ system({expr} [, {input}]) *system()* *E677*
|
||||
Use |:checktime| to force a check.
|
||||
|
||||
|
||||
tabpagebuflist([{arg}]) *tabpagebuflist()*
|
||||
The result is a List, where each item is the number of the
|
||||
buffer associated with each window in the current tab page.
|
||||
{arg} specifies the number of tab page to be used. When
|
||||
omitted the current tab page is used.
|
||||
When {arg} is invalid the number zero is returned.
|
||||
To get a list of all buffers in all tabs use this: >
|
||||
tablist = []
|
||||
for i in range(tabpagenr('$'))
|
||||
call extend(tablist, tabpagebuflist(i + 1))
|
||||
endfor
|
||||
< Note that a buffer may appear in more than one window.
|
||||
|
||||
|
||||
tabpagenr([{arg}]) *tabpagenr()*
|
||||
The result is a Number, which is the number of the current
|
||||
tab page. The first tab page has number 1.
|
||||
When the optional argument is "$", the number of the last tab
|
||||
page is returned (the tab page count).
|
||||
The number can be used with the |:tab| command.
|
||||
|
||||
|
||||
tabpagewinnr({tabarg}, [{arg}]) *tabpagewinnr()*
|
||||
Like |winnr()| but for tab page {arg}.
|
||||
{tabarg} specifies the number of tab page to be used.
|
||||
{arg} is used like with |winnr()|:
|
||||
- When omitted the current window number is returned. This is
|
||||
the window which will be used when going to this tab page.
|
||||
- When "$" the number of windows is returned.
|
||||
- When "#" the previous window nr is returned.
|
||||
Useful examples: >
|
||||
tabpagewinnr(1) " current window of tab page 1
|
||||
tabpagewinnr(4, '$') " number of windows in tab page 4
|
||||
< When {tabarg} is invalid zero is returned.
|
||||
|
||||
taglist({expr}) *taglist()*
|
||||
Returns a list of tags matching the regular expression {expr}.
|
||||
Each list item is a dictionary with at least the following
|
||||
entries:
|
||||
name name of the tag.
|
||||
filename name of the file where the tag is
|
||||
name Name of the tag.
|
||||
filename Name of the file where the tag is
|
||||
defined.
|
||||
cmd Ex command used to locate the tag in
|
||||
the file.
|
||||
kind type of the tag. The value for this
|
||||
kind Type of the tag. The value for this
|
||||
entry depends on the language specific
|
||||
kind values generated by the ctags
|
||||
tool.
|
||||
static a file specific tag. Refer to
|
||||
static A file specific tag. Refer to
|
||||
|static-tag| for more information.
|
||||
The "kind" entry is only available when using Exuberant ctags
|
||||
generated tags file. More entries may be present, depending
|
||||
@@ -4565,7 +4659,7 @@ winline() The result is a Number, which is the screen line of the cursor
|
||||
winnr([{arg}]) The result is a Number, which is the number of the current
|
||||
window. The top window has number 1.
|
||||
When the optional argument is "$", the number of the
|
||||
last window is returnd (the window count).
|
||||
last window is returned (the window count).
|
||||
When the optional argument is "#", the number of the last
|
||||
accessed window is returned (where |CTRL-W_p| goes to).
|
||||
If there is no previous window 0 is returned.
|
||||
@@ -4887,14 +4981,15 @@ See |:verbose-cmd| for more information.
|
||||
|
||||
When the [abort] argument is added, the function will
|
||||
abort as soon as an error is detected.
|
||||
The last used search pattern and the redo command "."
|
||||
will not be changed by the function.
|
||||
|
||||
When the [dict] argument is added, the function must
|
||||
be invoked through an entry in a Dictionary. The
|
||||
local variable "self" will then be set to the
|
||||
dictionary. See |Dictionary-function|.
|
||||
|
||||
The last used search pattern and the redo command "."
|
||||
will not be changed by the function.
|
||||
|
||||
*:endf* *:endfunction* *E126* *E193*
|
||||
:endf[unction] The end of a function definition. Must be on a line
|
||||
by its own, without other commands.
|
||||
@@ -6833,7 +6928,7 @@ This is not guaranteed 100% secure, but it should block most attacks.
|
||||
|
||||
*sandbox-option*
|
||||
A few options contain an expression. When this expression is evaluated it may
|
||||
have to be done in the sandbox to avoid trouble. But the sandbox is
|
||||
have to be done in the sandbox to avoid a security risc. But the sandbox is
|
||||
restrictive, thus this only happens when the option was set from an insecure
|
||||
location. Insecure in this context are:
|
||||
- sourcing a .vimrc or .exrc in the current directlry
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*gui.txt* For Vim version 7.0aa. Last change: 2005 Aug 07
|
||||
*gui.txt* For Vim version 7.0aa. Last change: 2006 Feb 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -37,7 +37,8 @@ The X11 version of Vim can run both in GUI and in non-GUI mode. See
|
||||
|
||||
*gui-init* *gvimrc* *.gvimrc* *_gvimrc*
|
||||
When the GUI starts up initializations are carried out, in this order:
|
||||
- The termcap options are reset to their default value for the GUI.
|
||||
- The 'term' option is set to "builgin_gui" and terminal options are reset to
|
||||
their default value for the GUI |terminal-options|.
|
||||
- If the system menu file exists, it is sourced. The name of this file is
|
||||
normally "$VIMRUNTIME/menu.vim". You can check this with ":version". Also
|
||||
see |$VIMRUNTIME|. To skip loading the system menu include 'M' in
|
||||
@@ -954,6 +955,9 @@ This section describes other features which are related to the GUI.
|
||||
endif
|
||||
endif
|
||||
|
||||
A recommended Japanese font is MS Mincho. You can find info here:
|
||||
http://www.lexikan.com/mincho.htm
|
||||
|
||||
==============================================================================
|
||||
7. Shell Commands *gui-shell*
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*help.txt* For Vim version 7.0aa. Last change: 2005 Nov 30
|
||||
*help.txt* For Vim version 7.0aa. Last change: 2006 Feb 18
|
||||
|
||||
VIM - main help file
|
||||
k
|
||||
@@ -122,6 +122,7 @@ Advanced editing ~
|
||||
|tagsrch.txt| tags and special searches
|
||||
|quickfix.txt| commands for a quick edit-compile-fix cycle
|
||||
|windows.txt| commands for using multiple windows and buffers
|
||||
|tabpage.txt| commands for using multiple tab pages
|
||||
|syntax.txt| syntax highlighting
|
||||
|spell.txt| spell checking
|
||||
|diff.txt| working with two or three versions of the same file
|
||||
@@ -191,13 +192,6 @@ Standard plugins ~
|
||||
|pi_expl.txt| File explorer
|
||||
|
||||
LOCAL ADDITIONS: *local-additions*
|
||||
|cecutil.txt| DrChip's Utilities Jun 11, 2004
|
||||
|engspchk.txt| English Spelling Checker (v61) Mar 14, 2005
|
||||
|example.txt| Example for a locally added help file
|
||||
|matchit.txt| Extended "%" matching
|
||||
|test.txt| Testing the h<>lp c<>mm<6D>nd n<>w
|
||||
|typecorr.txt| Plugin for correcting typing mistakes
|
||||
|helpp.txt| Dummy line to avoid an error message
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*bars* Bars example
|
||||
|
||||
@@ -208,6 +208,11 @@ The available subcommands are:
|
||||
|
||||
USAGE :cs show
|
||||
|
||||
*:lcscope* *:lcs*
|
||||
This command is same as the ":cscope" command, except when the
|
||||
'cscopequickfix' option is set, the location list for the current window is
|
||||
used instead of the quickfix list to show the cscope results.
|
||||
|
||||
*:cstag* *E257* *E562*
|
||||
If you use cscope as well as ctags, |:cstag| allows you to search one or
|
||||
the other before making a jump. For example, you can choose to first
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 7.0aa. Last change: 2006 Jan 11
|
||||
*index.txt* For Vim version 7.0aa. Last change: 2006 Feb 23
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -541,6 +541,9 @@ tag command action in Normal mode ~
|
||||
the cursor
|
||||
|CTRL-W_f| CTRL-W f split window and edit file name under the
|
||||
cursor
|
||||
|CTRL-W_F| CTRL-W F split window and edit file name under the
|
||||
cursor and jump to the line number
|
||||
following the file name.
|
||||
|CTRL-W_g_CTRL-]| CTRL-W g CTRL-] split window and do |:tjump| to tag under
|
||||
cursor
|
||||
|CTRL-W_g]| CTRL-W g ] split window and do |:tselect| for tag
|
||||
@@ -719,6 +722,9 @@ tag char note action in Normal mode ~
|
||||
word
|
||||
|gf| gf start editing the file whose name is under
|
||||
the cursor
|
||||
|gF| gF start editing the file whose name is under
|
||||
the cursor and jump to the line number
|
||||
following the filename.
|
||||
|gg| gg 1 cursor to line N, default first line
|
||||
|gh| gh start Select mode
|
||||
|gi| gi 2 like "i", but first move to the |'^| mark
|
||||
@@ -1069,6 +1075,7 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:cNfile| :cNf[ile] go to last error in previous file
|
||||
|:cabbrev| :ca[bbrev] like ":abbreviate" but for Command-line mode
|
||||
|:cabclear| :cabc[lear] clear all abbreviations for Command-line mode
|
||||
|:caddbuffer| :caddb[uffer] add errors from buffer
|
||||
|:caddexpr| :cad[dexpr] add errors from expr
|
||||
|:caddfile| :caddf[ile] add error message to current quickfix list
|
||||
|:call| :cal[l] call a function
|
||||
@@ -1213,23 +1220,56 @@ 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
|
||||
|:laddbuffer| :laddb[uffer] add locations from buffer
|
||||
|: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
|
||||
|:lcscope| :lcs[cope] like ":cscope" but uses location list
|
||||
|: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
|
||||
|:lgrep| :lgr[ep] run 'grepprg' and jump to first match
|
||||
|:lgrepadd| :lgrepa[dd] like :grep, but append to current list
|
||||
|:lhelpgrep| :lh[elpgrep] like ":helpgrep" but uses location list
|
||||
|:ll| :ll go to specific location
|
||||
|:llast| :lla[st] go to the specified location, default last one
|
||||
|:llist| :lli[st] list all locations
|
||||
|:lmake| :lmak[e] execute external command 'makeprg' and parse
|
||||
error messages
|
||||
|:lmap| :lm[ap] like ":map!" but includes Lang-Arg mode
|
||||
|:lmapclear| :lmapc[lear] like ":mapclear!" but includes Lang-Arg mode
|
||||
|:lnext| :lne[xt] 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
|
||||
|:ltag| :lt[ag] jump to tag and add matching tags to the
|
||||
location list
|
||||
|:lunmap| :lu[nmap] like ":unmap!" but includes Lang-Arg mode
|
||||
|:lvimgrep| :lv[imgrep] search for pattern in files
|
||||
|:lvimgrepadd| :lvimgrepa[dd] like :vimgrep, but append to current list
|
||||
|: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
|
||||
@@ -1271,7 +1311,7 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:omap| :om[ap] like ":map" but for Operator-pending mode
|
||||
|:omapclear| :omapc[lear] remove all mappings for Operator-pending mode
|
||||
|:omenu| :ome[nu] add menu for Operator-pending mode
|
||||
|:only| :on[ly] close all windows except current one
|
||||
|:only| :on[ly] close all windows except the current one
|
||||
|:onoremap| :ono[remap] like ":noremap" but for Operator-pending mode
|
||||
|:onoremenu| :onoreme[nu] like ":noremenu" but for Operator-pending mode
|
||||
|:options| :opt[ions] open the options-window
|
||||
@@ -1402,6 +1442,17 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:syncbind| :sync[bind] sync scroll binding
|
||||
|:t| :t same as ":copy"
|
||||
|:tNext| :tN[ext] jump to previous matching tag
|
||||
|:tabNext| :tabN[ext] go to previous tab page
|
||||
|:tabclose| :tabc[lose] close current tab page
|
||||
|:tabedit| :tabe[dit] edit a file in a new tab page
|
||||
|:tabfind| :tabf[ind] find file in 'path', edit it in a new tab page
|
||||
|:tabmove| :tabm[ove] move tab page to other position
|
||||
|:tabnew| :tabnew edit a file in a new tab page
|
||||
|:tabnext| :tabn[ext] go to next tab page
|
||||
|:tabonly| :tabo[nly] close all tab pages except the current one
|
||||
|:tabprevious| :tabp[revious] go to previous tab page
|
||||
|:tabs| :tabs list the tab pages and what they contain
|
||||
|:tab| :tab create new tab when opening new window
|
||||
|:tag| :ta[g] jump to tag
|
||||
|:tags| :tags show the contents of the tag stack
|
||||
|:tcl| :tc[l] execute Tcl command
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*insert.txt* For Vim version 7.0aa. Last change: 2006 Jan 08
|
||||
*insert.txt* For Vim version 7.0aa. Last change: 2006 Feb 23
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -126,8 +126,10 @@ CTRL-R {0-9a-z"%#*+:.-=} *i_CTRL-R*
|
||||
'=' the expression register: you are prompted to
|
||||
enter an expression (see |expression|)
|
||||
Note that 0x80 (128 decimal) is used for
|
||||
special keys, use CTRL-R CTRL-R to insert it
|
||||
literally.
|
||||
special keys. E.g., you can use this to move
|
||||
the cursor up:
|
||||
CTRL-R ="\<Up>"
|
||||
Use CTRL-R CTRL-R to insert text literally.
|
||||
See |registers| about registers. {not in Vi}
|
||||
|
||||
CTRL-R CTRL-R {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-R*
|
||||
@@ -422,7 +424,7 @@ When 'textwidth' and 'wrapmargin' are both set, 'textwidth' is used.
|
||||
If you don't really want to break the line, but view the line wrapped at a
|
||||
convenient place, see the 'linebreak' option.
|
||||
|
||||
The line is only broken automatically when using insert mode, or when
|
||||
The line is only broken automatically when using Insert mode, or when
|
||||
appending to a line. When in replace mode and the line length is not
|
||||
changed, the line will not be broken.
|
||||
|
||||
@@ -438,6 +440,10 @@ characters to the 'formatoptions' option:
|
||||
current insert command. Only differs from "l" when entering non-white
|
||||
characters while crossing the 'textwidth' boundary.
|
||||
|
||||
Normally an internal function will be used to decide where to break the line.
|
||||
If you want to do it in a different way set the 'formatexpr' option to an
|
||||
expression that will take care of the line break.
|
||||
|
||||
If you want to format a block of text, you can use the "gq" operator. Type
|
||||
"gq" and a movement command to move the cursor to the end of the block. In
|
||||
many cases, the command "gq}" will do what you want (format until the end of
|
||||
@@ -622,8 +628,8 @@ CTRL-X CTRL-L Search backwards for a line that starts with the
|
||||
the cursor. Indent is ignored. The matching line is
|
||||
inserted in front of the cursor.
|
||||
The 'complete' option is used to decide which buffers
|
||||
are searched for a match. Only loaded buffers are
|
||||
used.
|
||||
are searched for a match. Both loaded and unloaded
|
||||
buffers are used.
|
||||
CTRL-L or
|
||||
CTRL-P Search backwards for next matching line. This line
|
||||
replaces the previous matching line.
|
||||
@@ -871,8 +877,8 @@ CTRL-X CTRL-V Guess what kind of item is in front of the cursor and
|
||||
User defined completion *compl-function*
|
||||
|
||||
Completion is done by a function that can be defined by the user with the
|
||||
'completefunc' option. See the 'completefunc' help for how the function
|
||||
is called and an example.
|
||||
'completefunc' option. See below for how the function is called and an
|
||||
example |complete-functions|.
|
||||
|
||||
*i_CTRL-X_CTRL-U*
|
||||
CTRL-X CTRL-U Guess what kind of item is in front of the cursor and
|
||||
@@ -890,7 +896,7 @@ Omni completion *compl-omni*
|
||||
Completion is done by a function that can be defined by the user with the
|
||||
'omnifunc' option. This is to be used for filetype-specific completion.
|
||||
|
||||
See the 'completefunc' help for how the function is called and an example.
|
||||
See below for how the function is called and an example |complete-functions|.
|
||||
For remarks about specific filetypes see |compl-omni-filetypes|.
|
||||
|
||||
*i_CTRL-X_CTRL-O*
|
||||
@@ -952,6 +958,118 @@ CTRL-P Find previous match for words that start with the
|
||||
other contexts unless a double CTRL-X is used.
|
||||
|
||||
|
||||
FUNCTIONS FOR FINDING COMPLETIONS *complete-functions*
|
||||
|
||||
This applies to 'completefunc' and 'omnifunc'.
|
||||
|
||||
The function is called in two different ways:
|
||||
- First the function is called to find the start of the text to be completed.
|
||||
- Later the function is called to actually find the matches.
|
||||
|
||||
On the first invocation the arguments are:
|
||||
a:findstart 1
|
||||
a:base empty
|
||||
|
||||
The function must return the column where the completion starts. It must be a
|
||||
number between zero and the cursor column "col('.')". This involves looking
|
||||
at the characters just before the cursor and including those characters that
|
||||
could be part of the completed item. The text between this column and the
|
||||
cursor column will be replaced with the matches. Return -1 if no completion
|
||||
can be done.
|
||||
|
||||
On the second invocation the arguments are:
|
||||
a:findstart 0
|
||||
a:base the text with which matches should match; the text that was
|
||||
located in the first call (can be empty)
|
||||
|
||||
The function must return a List with the matching words. These matches
|
||||
usually include the "a:base" text. When there are no matches return an empty
|
||||
List.
|
||||
|
||||
Each list item can either be a string or a Dictionary. When it is a string it
|
||||
is used as the completion. When it is a Dictionary it can contain these
|
||||
items:
|
||||
word the completion, mandatory
|
||||
menu extra text for the popup menu
|
||||
info more information about the item
|
||||
kind single letter indicating the type of completion
|
||||
icase when not zero case is to be ignored; when omitted
|
||||
the 'ignorecase' option is used
|
||||
|
||||
All of these except 'icase' must be a string. If an item does not meet these
|
||||
requirements then an error message is given and further items in the list are
|
||||
not used. You can mix string and Dictionary items in the returned list.
|
||||
|
||||
The "menu" item is used in the popup menu and may be truncated, thus it should
|
||||
be relatively short. The "info" item can be longer, it may be displayed in a
|
||||
balloon.
|
||||
|
||||
The "kind" item uses a single letter to indicate the kind of completion. This
|
||||
may be used to show the completion differently (different color or icon).
|
||||
Currently these types can be used:
|
||||
v variable
|
||||
f function or method
|
||||
c composite (struct, object)
|
||||
|
||||
When searching for matches takes some time call |complete_add()| to add each
|
||||
match to the total list. These matches should then not appear in the returned
|
||||
list! Call |complete_check()| now and then to allow the user to press a key
|
||||
while still searching for matches. Stop searching when it returns non-zero.
|
||||
|
||||
The function is allowed to move the cursor, it is restored afterwards. This
|
||||
option cannot be set from a |modeline| or in the |sandbox|, for security
|
||||
reasons.
|
||||
|
||||
An example that completes the names of the months: >
|
||||
fun! CompleteMonths(findstart, base)
|
||||
if a:findstart
|
||||
" locate the start of the word
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
while start > 0 && line[start - 1] =~ '\a'
|
||||
let start -= 1
|
||||
endwhile
|
||||
return start
|
||||
else
|
||||
" find months matching with "a:base"
|
||||
let res = []
|
||||
for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")
|
||||
if m =~ '^' . a:base
|
||||
call add(res, m)
|
||||
endif
|
||||
endfor
|
||||
return res
|
||||
endif
|
||||
endfun
|
||||
set completefunc=CompleteMonths
|
||||
<
|
||||
The same, but now pretending searching for matches is slow: >
|
||||
fun! CompleteMonths(findstart, base)
|
||||
if a:findstart
|
||||
" locate the start of the word
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
while start > 0 && line[start - 1] =~ '\a'
|
||||
let start -= 1
|
||||
endwhile
|
||||
return start
|
||||
else
|
||||
" find months matching with "a:base"
|
||||
for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")
|
||||
if m =~ '^' . a:base
|
||||
call complete_add(m)
|
||||
endif
|
||||
sleep 300m " simulate searching for next match
|
||||
if complete_check()
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
return []
|
||||
endif
|
||||
endfun
|
||||
set completefunc=CompleteMonths
|
||||
<
|
||||
|
||||
INSERT COMPLETION POPUP MENU *ins-completion-menu*
|
||||
*popupmenu-completion*
|
||||
Vim can display the matches in a simplistic popup menu.
|
||||
@@ -961,12 +1079,44 @@ The menu is used when:
|
||||
- The terminal supports at least 8 colors.
|
||||
- There are at least two matches.
|
||||
|
||||
While the menu is displayed these keys have a special meaning:
|
||||
<CR> and <Enter>: Accept the currently selected match
|
||||
<Up>: Select the previous match, as if CTRL-P was used
|
||||
<Down>: Select the next match, as if CTRL-N was used
|
||||
<PageUp>: Select a match several entries back
|
||||
<PageDown>: Select a match several entries further
|
||||
There are two states:
|
||||
1. A complete match has been inserted.
|
||||
2. Only part of a match has been inserted.
|
||||
|
||||
You normally start in the first state, with the first match being inserted.
|
||||
When "longest" is in 'completeopt' and there is more than one match you start
|
||||
in the second state.
|
||||
|
||||
If you select another match, e.g., with CTRL-N or CTRL-P, you go from the
|
||||
second to the first state. This doesn't change the list of matches.
|
||||
|
||||
|
||||
In the first state these keys have a special meaning:
|
||||
<BS> and CTRL-H Delete one character, find the matches for the word before
|
||||
the cursor. This reduces the list of matches, often to one
|
||||
entry, and switches to the second state.
|
||||
|
||||
In the second state these keys have a special meaning:
|
||||
<BS> and CTRL-H Delete one character, find the matches for the shorter word
|
||||
before the cursor. This may find more matches.
|
||||
CTRL-L Add one character from the current match, may reduce the
|
||||
number of matches.
|
||||
any printable, non-white character:
|
||||
Add this character and reduce the number of matches.
|
||||
|
||||
In both states these can be used:
|
||||
<CR> and <Enter> Accept the currently selected match and stop completion.
|
||||
<PageUp> Select a match several entries back, but don't insert it.
|
||||
<PageDown> Select a match several entries further, but don't insert it.
|
||||
<Up> Select the previous match, as if CTRL-P was used, but don't
|
||||
insert it.
|
||||
<Down> Select the next match, as if CTRL-N was used, but don't
|
||||
insert it.
|
||||
Any other character:
|
||||
Stop completion without changing the match and insert the
|
||||
typed character. Note that typing a space or <Tab> will
|
||||
work in both states.
|
||||
|
||||
|
||||
The colors of the menu can be changed with these highlight groups:
|
||||
Pmenu normal item |hl-Pmenu|
|
||||
@@ -974,8 +1124,16 @@ PmenuSel selected item |hl-PmenuSel|
|
||||
PmenuSbar scrollbar |hl-PmenuSbar|
|
||||
PmenuThumb thumb of the scrollbar |hl-PmenuThumb|
|
||||
|
||||
There are no special mappings for when the popup menu is visible. However,
|
||||
you can use an Insert mode mapping that checks the |pumvisible()| function to
|
||||
do something different. Example: >
|
||||
:inoremap <Down> <C-R>=pumvisible() ? "\<lt>C-N>" : "\<lt>Down>"<CR>
|
||||
|
||||
Filetype-specific remarks for omni completion *compl-omni-filetypes*
|
||||
|
||||
FILETYPE-SPECIFIC REMARKS FOR OMNI COMPLETION *compl-omni-filetypes*
|
||||
|
||||
The file used for {filetype} should be autoload/{filetype}complete.vim
|
||||
in 'runtimepath'. Thus for "java" it is autoload/javacomplete.vim.
|
||||
|
||||
|
||||
C *ft-c-omni*
|
||||
@@ -985,6 +1143,8 @@ 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
|
||||
A compiled .exe for MS-Windows can be found at:
|
||||
http://georgevreilly.com/vim/ctags.html
|
||||
|
||||
If you want to complete system functions you can do something like this. Use
|
||||
ctags to generate a tags file for all the system header files: >
|
||||
@@ -1016,28 +1176,67 @@ Complete properties and their appropriate values according to CSS 2.1
|
||||
specification.
|
||||
|
||||
|
||||
(X)HTML *ft-html-omni*
|
||||
HTML and XHTML *ft-html-omni*
|
||||
*ft-xhtml-omni*
|
||||
|
||||
CTRL-X CTRL-O provides completion of various elements of (X)HTML files.
|
||||
It is designed to support writing of XHTML 1.0 Strict files but will
|
||||
also works for other versions of HTML. Features:
|
||||
CTRL-X CTRL-O provides completion of various elements of (X)HTML files. It is
|
||||
designed to support writing of XHTML 1.0 Strict files but will also works for
|
||||
other versions of HTML. Features:
|
||||
|
||||
- after "<" complete tag name depending on context (no div suggest
|
||||
inside of an a tag)
|
||||
- inside of tag complete proper attributes (no width attribute for an
|
||||
a tag)
|
||||
- when attribute has limited number of possible values help to complete
|
||||
them
|
||||
- after "<" complete tag name depending on context (no div suggestion inside
|
||||
of an a tag); '/>' indicates empty tags
|
||||
- inside of tag complete proper attributes (no width attribute for an a tag);
|
||||
show also type of attribute; '*' indicates required attributes
|
||||
- when attribute has limited number of possible values help to complete them
|
||||
- complete names of entities
|
||||
- complete values of "class" and "id" attributes with data obtained from
|
||||
style tag and included CSS files
|
||||
- when completing "style" attribute or working inside of "style" tag
|
||||
<style> tag and included CSS files
|
||||
- when completing value of "style" attribute or working inside of "style" tag
|
||||
switch to |ft-css-omni| completion
|
||||
- when completing values of events attributes or working inside of "script"
|
||||
tag switch to |ft-javascript-omni| completion
|
||||
- when used after "</" CTRL-X CTRL-O will close the last opened tag
|
||||
|
||||
Note: When used first time completion menu will be shown with little delay
|
||||
- this is time needed for loading of data file.
|
||||
- this is time needed for loading of data file.
|
||||
Note: Completion may fail in badly formatted documents. In such case try to
|
||||
run |:make| command to detect formatting problems.
|
||||
|
||||
|
||||
JAVASCRIPT *ft-javascript-omni*
|
||||
|
||||
Completion of most elements of JavaScript language and DOM elements.
|
||||
|
||||
Complete:
|
||||
|
||||
- variables
|
||||
- function name; show function arguments
|
||||
- function arguments
|
||||
- properties of variables trying to detect type of variable
|
||||
- complete DOM objects and properties depending on context
|
||||
- keywords of language
|
||||
|
||||
Completion works in separate JavaScript files (&ft==javascript), inside of
|
||||
<script> tag of (X)HTML and in values of event attributes (including scanning
|
||||
of external files.
|
||||
|
||||
DOM compatibility
|
||||
|
||||
At the moment (beginning of 2006) there are two main browsers - MS Internet
|
||||
Explorer and Mozilla Firefox. These two applications are covering over 90% of
|
||||
market. Theoretically standards are created by W3C organisation
|
||||
(http://www.w3c.org) but they are not always followed/implemented.
|
||||
|
||||
IE FF W3C Omni completion ~
|
||||
+/- +/- + + ~
|
||||
+ + - + ~
|
||||
+ - - - ~
|
||||
- + - - ~
|
||||
|
||||
Regardless from state of implementation in browsers but if element is defined
|
||||
in standards, completion plugin will place element in suggestion list. When
|
||||
both major engines implemented element, even if this is not in standards it
|
||||
will be suggested. All other elements are not placed in suggestion list.
|
||||
|
||||
|
||||
SYNTAX *ft-syntax-omni*
|
||||
@@ -1079,7 +1278,7 @@ Format of XML data file *xml-omni-datafile*
|
||||
|
||||
Vim distribution provides two data files as examples (xhtml10s.vim, xsl.vim)
|
||||
|
||||
XML data files are stored in "autoload/xml" directory in 'runtimepath'. They
|
||||
XML data files are stored in "autoload/xml" directory in 'runtimepath'. They
|
||||
have meaningful name which will be used in commands. It should be unique name
|
||||
which will not create conflicts in future. For example name xhtml10s.vim means
|
||||
it is data file for XHTML 1.0 Strict.
|
||||
@@ -1093,9 +1292,9 @@ compound from two parts:
|
||||
Part two must be exactly the same as name of file.
|
||||
|
||||
Variable is data structure in form of |Dictionary|. Keys are tag names and
|
||||
values are two element |List|. First element of List is also List with
|
||||
names of possible children, second element is |Dictionary| with names of
|
||||
attributes as keys and possible values of attributes as values. Example: >
|
||||
values are two element |List|. First element of List is also List with names
|
||||
of possible children, second element is |Dictionary| with names of attributes
|
||||
as keys and possible values of attributes as values. Example: >
|
||||
|
||||
let g:xmldata_crippledhtml = {
|
||||
\ "html":
|
||||
@@ -1107,21 +1306,31 @@ attributes as keys and possible values of attributes as values. Example: >
|
||||
\ "meta":
|
||||
\ [ [], {"id": [], "http-equiv": [], "name": [], "content": [], "scheme":
|
||||
\ [], "lang": [], "xml:lang": [], "dir": ["ltr", "rtl"]}]
|
||||
\ "vimxmlentities": ["amp", "lt", "gt", "apos", "quot"]}
|
||||
\ "vimxmlentities": ["amp", "lt", "gt", "apos", "quot"]},
|
||||
\ "vimxmltaginfo": {
|
||||
\ 'meta': ['/>', '']},
|
||||
\ "vimxmlattrinfo": {
|
||||
\ 'http-equiv': ['ContentType', '']}
|
||||
|
||||
This example should be put in "autoload/xml/crippledhtml.vim" file.
|
||||
|
||||
In example are visible two special elements:
|
||||
In example are visible four special elements:
|
||||
|
||||
1. "vimxmlentities" - special key with List containing entities of this XML
|
||||
dialect.
|
||||
2. "BOOL" - value of attribute key showing if attribute should be inserted
|
||||
bare ("defer" vs. 'defer="'). It can be the only element of List of
|
||||
attribute values.
|
||||
3. "vimxmltaginfo" - special key with dictionary containing as key tag names,
|
||||
as value two element List for additional menu info and long description.
|
||||
4. "vimxmlattrinfo" - special key with dictionary containing as key attribute
|
||||
names, as value two element List for additional menu info and long
|
||||
description.
|
||||
|
||||
Note: Tag names in data file MUST not contain namespace description. Check
|
||||
xsl.vim for example.
|
||||
|
||||
|
||||
Commands
|
||||
|
||||
:XMLns {name} [{namespace}] *:XMLns*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 7.0aa. Last change: 2006 Jan 13
|
||||
*map.txt* For Vim version 7.0aa. Last change: 2006 Feb 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -45,42 +45,42 @@ modes.
|
||||
{lhs} means left-hand-side *{lhs}*
|
||||
{rhs} means right-hand-side *{rhs}*
|
||||
|
||||
:map {lhs} {rhs} *:map*
|
||||
:nm[ap] {lhs} {rhs} *:nm* *:nmap*
|
||||
:vm[ap] {lhs} {rhs} *:vm* *:vmap*
|
||||
:om[ap] {lhs} {rhs} *:om* *:omap*
|
||||
:map! {lhs} {rhs} *:map!*
|
||||
:im[ap] {lhs} {rhs} *:im* *:imap*
|
||||
:lm[ap] {lhs} {rhs} *:lm* *:lmap*
|
||||
:cm[ap] {lhs} {rhs} *:cm* *:cmap*
|
||||
:map {lhs} {rhs} |mapmode-nvo| *:map*
|
||||
:nm[ap] {lhs} {rhs} |mapmode-n| *:nm* *:nmap*
|
||||
:vm[ap] {lhs} {rhs} |mapmode-v| *:vm* *:vmap*
|
||||
:om[ap] {lhs} {rhs} |mapmode-o| *:om* *:omap*
|
||||
:map! {lhs} {rhs} |mapmode-ic| *:map!*
|
||||
:im[ap] {lhs} {rhs} |mapmode-i| *:im* *:imap*
|
||||
:lm[ap] {lhs} {rhs} |mapmode-l| *:lm* *:lmap*
|
||||
:cm[ap] {lhs} {rhs} |mapmode-c| *:cm* *:cmap*
|
||||
Map the key sequence {lhs} to {rhs} for the modes
|
||||
where the map command applies. The result, including
|
||||
{rhs}, is then further scanned for mappings. This
|
||||
allows for nested and recursive use of mappings.
|
||||
|
||||
|
||||
:no[remap] {lhs} {rhs} *:no* *:noremap*
|
||||
:nn[oremap] {lhs} {rhs} *:nn* *:nnoremap*
|
||||
:vn[oremap] {lhs} {rhs} *:vn* *:vnoremap*
|
||||
:ono[remap] {lhs} {rhs} *:ono* *:onoremap*
|
||||
:no[remap]! {lhs} {rhs} *:no!* *:noremap!*
|
||||
:ino[remap] {lhs} {rhs} *:ino* *:inoremap*
|
||||
:ln[oremap] {lhs} {rhs} *:ln* *:lnoremap*
|
||||
:cno[remap] {lhs} {rhs} *:cno* *:cnoremap*
|
||||
:no[remap] {lhs} {rhs} |mapmode-nvo| *:no* *:noremap*
|
||||
:nn[oremap] {lhs} {rhs} |mapmode-n| *:nn* *:nnoremap*
|
||||
:vn[oremap] {lhs} {rhs} |mapmode-v| *:vn* *:vnoremap*
|
||||
:ono[remap] {lhs} {rhs} |mapmode-o| *:ono* *:onoremap*
|
||||
:no[remap]! {lhs} {rhs} |mapmode-ic| *:no!* *:noremap!*
|
||||
:ino[remap] {lhs} {rhs} |mapmode-i| *:ino* *:inoremap*
|
||||
:ln[oremap] {lhs} {rhs} |mapmode-l| *:ln* *:lnoremap*
|
||||
:cno[remap] {lhs} {rhs} |mapmode-c| *:cno* *:cnoremap*
|
||||
Map the key sequence {lhs} to {rhs} for the modes
|
||||
where the map command applies. Disallow mapping of
|
||||
{rhs}, to avoid nested and recursive mappings. Often
|
||||
used to redefine a command. {not in Vi}
|
||||
|
||||
|
||||
:unm[ap] {lhs} *:unm* *:unmap*
|
||||
:nun[map] {lhs} *:nun* *:nunmap*
|
||||
:vu[nmap] {lhs} *:vu* *:vunmap*
|
||||
:ou[nmap] {lhs} *:ou* *:ounmap*
|
||||
:unm[ap]! {lhs} *:unm!* *:unmap!*
|
||||
:iu[nmap] {lhs} *:iu* *:iunmap*
|
||||
:lu[nmap] {lhs} *:lu* *:lunmap*
|
||||
:cu[nmap] {lhs} *:cu* *:cunmap*
|
||||
:unm[ap] {lhs} |mapmode-nvo| *:unm* *:unmap*
|
||||
:nun[map] {lhs} |mapmode-n| *:nun* *:nunmap*
|
||||
:vu[nmap] {lhs} |mapmode-v| *:vu* *:vunmap*
|
||||
:ou[nmap] {lhs} |mapmode-o| *:ou* *:ounmap*
|
||||
:unm[ap]! {lhs} |mapmode-ic| *:unm!* *:unmap!*
|
||||
:iu[nmap] {lhs} |mapmode-i| *:iu* *:iunmap*
|
||||
:lu[nmap] {lhs} |mapmode-l| *:lu* *:lunmap*
|
||||
:cu[nmap] {lhs} |mapmode-c| *:cu* *:cunmap*
|
||||
Remove the mapping of {lhs} for the modes where the
|
||||
map command applies. The mapping may remain defined
|
||||
for other modes where it applies.
|
||||
@@ -89,38 +89,38 @@ modes.
|
||||
:map @@ foo
|
||||
:unmap @@ | print
|
||||
|
||||
:mapc[lear] *:mapc* *:mapclear*
|
||||
:nmapc[lear] *:nmapc* *:nmapclear*
|
||||
:vmapc[lear] *:vmapc* *:vmapclear*
|
||||
:omapc[lear] *:omapc* *:omapclear*
|
||||
:mapc[lear]! *:mapc!* *:mapclear!*
|
||||
:imapc[lear] *:imapc* *:imapclear*
|
||||
:lmapc[lear] *:lmapc* *:lmapclear*
|
||||
:cmapc[lear] *:cmapc* *:cmapclear*
|
||||
:mapc[lear] |mapmode-nvo| *:mapc* *:mapclear*
|
||||
:nmapc[lear] |mapmode-n| *:nmapc* *:nmapclear*
|
||||
:vmapc[lear] |mapmode-v| *:vmapc* *:vmapclear*
|
||||
:omapc[lear] |mapmode-o| *:omapc* *:omapclear*
|
||||
:mapc[lear]! |mapmode-ic| *:mapc!* *:mapclear!*
|
||||
:imapc[lear] |mapmode-i| *:imapc* *:imapclear*
|
||||
:lmapc[lear] |mapmode-l| *:lmapc* *:lmapclear*
|
||||
:cmapc[lear] |mapmode-c| *:cmapc* *:cmapclear*
|
||||
Remove ALL mappings for the modes where the map
|
||||
command applies. {not in Vi}
|
||||
Warning: This also removes the default mappings.
|
||||
|
||||
:map
|
||||
:nm[ap]
|
||||
:vm[ap]
|
||||
:om[ap]
|
||||
:map!
|
||||
:im[ap]
|
||||
:lm[ap]
|
||||
:cm[ap]
|
||||
:map |mapmode-nvo|
|
||||
:nm[ap] |mapmode-n|
|
||||
:vm[ap] |mapmode-v|
|
||||
:om[ap] |mapmode-o|
|
||||
:map! |mapmode-ic|
|
||||
:im[ap] |mapmode-i|
|
||||
:lm[ap] |mapmode-l|
|
||||
:cm[ap] |mapmode-c|
|
||||
List all key mappings for the modes where the map
|
||||
command applies. Note that ":map" and ":map!" are
|
||||
used most often, because they include the other modes.
|
||||
|
||||
:map {lhs} *:map_l*
|
||||
:nm[ap] {lhs} *:nmap_l*
|
||||
:vm[ap] {lhs} *:vmap_l*
|
||||
:om[ap] {lhs} *:omap_l*
|
||||
:map! {lhs} *:map_l!*
|
||||
:im[ap] {lhs} *:imap_l*
|
||||
:lm[ap] {lhs} *:lmap_l*
|
||||
:cm[ap] {lhs} *:cmap_l*
|
||||
:map {lhs} |mapmode-nvo| *:map_l*
|
||||
:nm[ap] {lhs} |mapmode-n| *:nmap_l*
|
||||
:vm[ap] {lhs} |mapmode-v| *:vmap_l*
|
||||
:om[ap] {lhs} |mapmode-o| *:omap_l*
|
||||
:map! {lhs} |mapmode-ic| *:map_l!*
|
||||
:im[ap] {lhs} |mapmode-i| *:imap_l*
|
||||
:lm[ap] {lhs} |mapmode-l| *:lmap_l*
|
||||
:cm[ap] {lhs} |mapmode-c| *:cmap_l*
|
||||
List the key mappings for the key sequences starting
|
||||
with {lhs} in the modes where the map command applies.
|
||||
{not in Vi}
|
||||
@@ -218,6 +218,7 @@ to type a count with a zero.
|
||||
*map-overview* *map-modes*
|
||||
Overview of which map command works in which mode:
|
||||
|
||||
*mapmode-nvo* *mapmode-n* *mapmode-v* *mapmode-o*
|
||||
commands: modes: ~
|
||||
Normal Visual Operator-pending ~
|
||||
:map :noremap :unmap :mapclear yes yes yes
|
||||
@@ -225,6 +226,7 @@ Overview of which map command works in which mode:
|
||||
:vmap :vnoremap :vunmap :vmapclear - yes -
|
||||
:omap :onoremap :ounmap :omapclear - - yes
|
||||
|
||||
*mapmode-ic* *mapmode-i* *mapmode-c* *mapmode-l*
|
||||
Insert Command-line Lang-Arg ~
|
||||
:map! :noremap! :unmap! :mapclear! yes yes -
|
||||
:imap :inoremap :iunmap :imapclear yes - -
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*netbeans.txt* For Vim version 7.0aa. Last change: 2005 Apr 04
|
||||
*netbeans.txt* For Vim version 7.0aa. Last change: 2006 Feb 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Gordon Prieur
|
||||
@@ -179,6 +179,7 @@ These messages are specific for NetBeans:
|
||||
Region is guarded, cannot modify
|
||||
NetBeans defines guarded areas in the text, which you cannot
|
||||
change.
|
||||
Also sets the current buffer, if necessary.
|
||||
|
||||
*E656*
|
||||
NetBeans disallows writes of unmodified buffers
|
||||
@@ -485,8 +486,10 @@ setContentType
|
||||
Not implemented.
|
||||
|
||||
setDot off Make the buffer the current buffer and set the cursor at the
|
||||
specified position. If there are folds they are opened to
|
||||
make the cursor line visible.
|
||||
specified position. If the buffer is open in another window
|
||||
than make that window the current window.
|
||||
If there are folds they are opened to make the cursor line
|
||||
visible.
|
||||
In version 2.1 "lnum/col" can be used instead of "off".
|
||||
|
||||
setExitDelay seconds
|
||||
@@ -566,6 +569,7 @@ stopDocumentListen
|
||||
|
||||
unguard off len
|
||||
Opposite of "guard", remove guarding for a text area.
|
||||
Also sets the current buffer, if necessary.
|
||||
|
||||
version Not implemented.
|
||||
|
||||
@@ -612,6 +616,7 @@ insert off text
|
||||
123 no problem
|
||||
123 !message failed
|
||||
Note that the message in the reply is not quoted.
|
||||
Also sets the current buffer, if necessary.
|
||||
|
||||
remove off length
|
||||
Delete "length" bytes of text at position "off". Both
|
||||
@@ -620,6 +625,7 @@ remove off length
|
||||
123 no problem
|
||||
123 !message failed
|
||||
Note that the message in the reply is not quoted.
|
||||
Also sets the current buffer, if necessary.
|
||||
|
||||
saveAndExit Perform the equivalent of closing Vim: ":confirm qall".
|
||||
If there are no changed files or the user does not cancel the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 7.0aa. Last change: 2006 Jan 20
|
||||
*options.txt* For Vim version 7.0aa. Last change: 2006 Feb 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -127,7 +127,7 @@ Note that an option may also have been set as a side effect of setting
|
||||
{not available when compiled without the +eval feature}
|
||||
|
||||
*:set-termcap* *E522*
|
||||
For {option} the form "t_xx" may be used to set a termcap option. This will
|
||||
For {option} the form "t_xx" may be used to set a terminal option. This will
|
||||
override the value from the termcap. You can then use it in a mapping. If
|
||||
the "xx" part contains special characters, use the <t_xx> form: >
|
||||
:set <t_#4>=^[Ot
|
||||
@@ -162,6 +162,11 @@ include the "|" in the option value, use "\|" instead. This example sets the
|
||||
This sets the 'titlestring' option to "hi" and 'iconstring' to "there": >
|
||||
:set titlestring=hi|set iconstring=there
|
||||
|
||||
Similarly, the double quote character starts a comment. To include the '"' in
|
||||
the option value, use '\"' instead. This example sets the 'titlestring'
|
||||
option to 'hi "there"': >
|
||||
:set titlestring=hi\ \"there\"
|
||||
|
||||
For MS-DOS and WIN32 backslashes in file names are mostly not removed. More
|
||||
precise: For options that expect a file name (those where environment
|
||||
variables are expanded) a backslash before a normal file name character is not
|
||||
@@ -1178,6 +1183,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
autocommands. {not available when compiled without the
|
||||
|+autocmd| feature}
|
||||
quickfix quickfix buffer, contains list of errors |:cwindow|
|
||||
or list of locations |:lwindow|
|
||||
help help buffer (you are not supposed to set this
|
||||
manually)
|
||||
|
||||
@@ -1186,8 +1192,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
Be careful with changing this option, it can have many side effects!
|
||||
|
||||
A "quickfix" buffer is only used for the error list. This value is
|
||||
set by the |:cwindow| command and you are not supposed to change it.
|
||||
A "quickfix" buffer is only used for the error list and the location
|
||||
list. This value is set by the |:cwindow| and |:lwindow| commands and
|
||||
you are not supposed to change it.
|
||||
|
||||
"nofile" and "nowrite" buffers are similar:
|
||||
both: The buffer is not to be written to disk, ":w" doesn't
|
||||
@@ -1606,102 +1613,26 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
or +insert_expand feature}
|
||||
This option specifies a function to be used for Insert mode completion
|
||||
with CTRL-X CTRL-U. |i_CTRL-X_CTRL-U|
|
||||
See |complete-functions| for an explanation of how the function is
|
||||
invoked and what it should return.
|
||||
|
||||
The function will be invoked with two arguments. First the function
|
||||
is called to find the start of the text to be completed. Secondly the
|
||||
function is called to actually find the matches.
|
||||
|
||||
On the first invocation the arguments are:
|
||||
a:findstart 1
|
||||
a:base empty
|
||||
|
||||
The function must return the column of where the completion starts.
|
||||
It must be a number between zero and the cursor column "col('.')".
|
||||
This involves looking at the characters just before the cursor and
|
||||
including those characters that could be part of the completed item.
|
||||
The text between this column and the cursor column will be replaced
|
||||
with the matches. Return -1 if no completion can be done.
|
||||
|
||||
On the second invocation the arguments are:
|
||||
a:findstart 0
|
||||
a:base the text with which matches should match, what was
|
||||
located in the first call (can be empty)
|
||||
|
||||
The function must return a List with the matching words. These
|
||||
matches usually include the "a:base" text. When there are no matches
|
||||
return an empty List.
|
||||
|
||||
When searching for matches takes some time call |complete_add()| to
|
||||
add each match to the total list. These matches should then not
|
||||
appear in the returned list! Call |complete_check()| now and then to
|
||||
allow the user to press a key while still searching for matches. Stop
|
||||
searching when it returns non-zero.
|
||||
|
||||
The function may move the cursor, it is restored afterwards.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
An example that completes the names of the months: >
|
||||
fun! CompleteMonths(findstart, base)
|
||||
if a:findstart
|
||||
" locate the start of the word
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
while start > 0 && line[start - 1] =~ '\a'
|
||||
let start -= 1
|
||||
endwhile
|
||||
return start
|
||||
else
|
||||
" find months matching with "a:base"
|
||||
let res = []
|
||||
for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")
|
||||
if m =~ '^' . a:base
|
||||
call add(res, m)
|
||||
endif
|
||||
endfor
|
||||
return res
|
||||
endif
|
||||
endfun
|
||||
set completefunc=CompleteMonths
|
||||
<
|
||||
The same, but now pretending searching for matches is slow: >
|
||||
fun! CompleteMonths(findstart, base)
|
||||
if a:findstart
|
||||
" locate the start of the word
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
while start > 0 && line[start - 1] =~ '\a'
|
||||
let start -= 1
|
||||
endwhile
|
||||
return start
|
||||
else
|
||||
" find months matching with "a:base"
|
||||
for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")
|
||||
if m =~ '^' . a:base
|
||||
call complete_add(m)
|
||||
endif
|
||||
sleep 300m " simulate searching for next match
|
||||
if complete_check()
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
return []
|
||||
endif
|
||||
endfun
|
||||
set completefunc=CompleteMonths
|
||||
<
|
||||
|
||||
*'completeopt'* *'cot'*
|
||||
'completeopt' 'cot' string (default: "menu")
|
||||
global
|
||||
{not in Vi}
|
||||
Options for Insert mode completion |ins-completion|.
|
||||
Currently the only supported value is:
|
||||
A comma separated list of options for Insert mode completion
|
||||
|ins-completion|. The supported values are:
|
||||
|
||||
menu Use a popup menu to show the possible completions. The
|
||||
menu is only shown when there is more than one match and
|
||||
sufficient colors are available. |ins-completion-menu|
|
||||
|
||||
longest Only insert the longest common text of the matches. Use
|
||||
CTRL-L to add more characters. Whether case is ignored
|
||||
depends on the kind of completion. For buffer text the
|
||||
'ignorecase' option is used.
|
||||
|
||||
|
||||
*'confirm'* *'cf'* *'noconfirm'* *'nocf'*
|
||||
'confirm' 'cf' boolean (default off)
|
||||
@@ -2107,8 +2038,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
global
|
||||
{not in Vi}
|
||||
When set to "msg", error messages that would otherwise be omitted will
|
||||
be given anyway. This is useful when debugging 'foldexpr' or
|
||||
'indentexpr'.
|
||||
be given anyway. This is useful when debugging 'foldexpr',
|
||||
'formatexpr' or 'indentexpr'.
|
||||
When set to "beep", a message will be given when otherwise only a beep
|
||||
would be produced.
|
||||
The values can be combined, separated by a comma.
|
||||
@@ -2953,17 +2884,43 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
global
|
||||
{not in Vi}
|
||||
The name of an external program that will be used to format the lines
|
||||
selected with the "gq" command. The program must take the input on
|
||||
selected with the |gq| operator. The program must take the input on
|
||||
stdin and produce the output on stdout. The Unix program "fmt" is
|
||||
such a program.
|
||||
If this option is an empty string, the internal format function will
|
||||
be used |C-indenting|.
|
||||
If the 'formatexpr' option is not empty it will be used instead.
|
||||
Otherwise, if 'formatprg' option is an empty string, the internal
|
||||
format function will be used |C-indenting|.
|
||||
Environment variables are expanded |:set_env|. See |option-backslash|
|
||||
about including spaces and backslashes.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
The expression may be evaluated in the |sandbox|, see
|
||||
|sandbox-option|.
|
||||
|
||||
*'fsync'* *'fs'*
|
||||
*'formatexpr'* *'fex'*
|
||||
'formatexpr' 'fex' string (default "")
|
||||
local to buffer
|
||||
{not in Vi}
|
||||
{not available when compiled without the |+eval|
|
||||
feature}
|
||||
Expression which is evaluated to format a range of lines for the |gq|
|
||||
operator. The |v:lnum| variable holds the first line to be formatted,
|
||||
|v:count| the number of lines to be formatted.
|
||||
When this option is empty 'formatprg' is used.
|
||||
Example: >
|
||||
:set formatexpr=mylang#Format()
|
||||
< This will invoke the mylang#Format() function in the
|
||||
autoload/mylang.vim file in 'runtimepath'. |autoload|
|
||||
|
||||
The expression is also evaluated when 'textwidth' is set and adding
|
||||
text beyond that limit. This happens under the same conditions as
|
||||
when internal formatting is used. Make sure the cursor is kept in the
|
||||
same spot relative to the text then! The |mode()| function will
|
||||
return "i" or "R" in this situation. When the function returns
|
||||
non-zero Vim will fall back to using the internal format mechanism.
|
||||
|
||||
The expression may be evaluated in the |sandbox|, see
|
||||
|sandbox-option|.
|
||||
|
||||
*'fsync'* *'fs'*
|
||||
'fsync' 'fs' boolean (default on)
|
||||
global
|
||||
{not in Vi}
|
||||
@@ -3017,7 +2974,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
also work well with a single file: >
|
||||
:set grepprg=grep\ -nH
|
||||
< Special value: When 'grepprg' is set to "internal" the |:grep| command
|
||||
works like |:vimgrep| and |:grepadd| like |:vimgrepadd|.
|
||||
works like |:vimgrep|, |:lgrep| like |:lvimgrep|, |:grepadd| like
|
||||
|:vimgrepadd| and |:lgrepadd| like |:lvimgrepadd|.
|
||||
See also the section |:make_makeprg|, since most of the comments there
|
||||
apply equally to 'grepprg'.
|
||||
For Win32, the default is "findstr /n" if "findstr.exe" can be found,
|
||||
@@ -4658,7 +4616,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
{only available when compiled with the |+linebreak|
|
||||
feature}
|
||||
Minimal number of columns to use for the line number. Only relevant
|
||||
when the 'number' option is set.
|
||||
when the 'number' option is set or printint lines with a line number.
|
||||
Since one space is always between the number and the text, there is
|
||||
one less character for the number itself.
|
||||
The value is the minimum width. A bigger width is used when needed to
|
||||
@@ -4676,7 +4634,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
or +insert_expand feature}
|
||||
This option specifies a function to be used for Insert mode omni
|
||||
completion with CTRL-X CTRL-O. |i_CTRL-X_CTRL-O|
|
||||
For the use of the function see 'completefunc'.
|
||||
See |complete-functions| for an explanation of how the function is
|
||||
invoked and what it should return.
|
||||
|
||||
|
||||
*'operatorfunc'* *'opfunc'*
|
||||
@@ -5165,6 +5124,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
menu.vim GUI menus |menu.vim|
|
||||
plugin/ plugin scripts |write-plugin|
|
||||
print/ files for printing |postscript-print-encoding|
|
||||
spell/ spell checking files |spell|
|
||||
syntax/ syntax files |mysyntaxfile|
|
||||
tutor/ files for vimtutor |tutor|
|
||||
|
||||
@@ -5378,6 +5338,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
winsize window sizes
|
||||
|
||||
Don't include both "curdir" and "sesdir".
|
||||
There is no option to include tab pages yet, only the current tab page
|
||||
is stored in the session. |tab-page|
|
||||
When "curdir" nor "sesdir" is included, file names are stored with
|
||||
absolute paths.
|
||||
"slash" and "unix" are useful on Windows when sharing session files
|
||||
@@ -5720,6 +5682,21 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
NOTE: This option is set to the Vi default value when 'compatible' is
|
||||
set and to the Vim default value when 'compatible' is reset.
|
||||
|
||||
*'showtabline'* *'stal'*
|
||||
'showtabline' 'stal' number (default 1)
|
||||
global
|
||||
{not in Vi}
|
||||
{not available when compiled without the +windows
|
||||
feature}
|
||||
The value of this option specifies when the line with tab page labels
|
||||
will be displayed:
|
||||
0: never
|
||||
1: only if there are at least two tab pages
|
||||
2: always
|
||||
This is both for the GUI and non-GUI implementation of the tab pages
|
||||
line.
|
||||
See |tab-page| for more information about tab pages.
|
||||
|
||||
*'sidescroll'* *'ss'*
|
||||
'sidescroll' 'ss' number (default 0)
|
||||
global
|
||||
@@ -5797,11 +5774,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
global
|
||||
{not in Vi}
|
||||
When on, a <Tab> in front of a line inserts blanks according to
|
||||
'shiftwidth'. 'tabstop' is used in other places. A <BS> will delete
|
||||
a 'shiftwidth' worth of space at the start of the line.
|
||||
When off a <Tab> always inserts blanks according to 'tabstop'.
|
||||
'shiftwidth' is only used for shifting text left or right
|
||||
|shift-left-right|.
|
||||
'shiftwidth'. 'tabstop' or 'softtabstop' is used in other places. A
|
||||
<BS> will delete a 'shiftwidth' worth of space at the start of the
|
||||
line.
|
||||
When off, a <Tab> always inserts blanks according to 'tabstop' or
|
||||
'softtabstop'. 'shiftwidth' is only used for shifting text left or
|
||||
right |shift-left-right|.
|
||||
What gets inserted (a Tab or spaces) depends on the 'expandtab'
|
||||
option. Also see |ins-expandtab|. When 'expandtab' is not set, the
|
||||
number of spaces is minimized by using <Tab>s.
|
||||
@@ -5906,9 +5884,14 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
files twice.
|
||||
How the related spell files are found is explained here: |spell-load|.
|
||||
|
||||
If the |spellfile.vim| plugin is active and you use a language name
|
||||
for which Vim cannot find the .spl file in 'runtimepath' the plugin
|
||||
will ask you if you want to download the file.
|
||||
|
||||
After this option has been set successfully, Vim will source the files
|
||||
"spell/LANG.vim" in 'runtimepath'. "LANG" is the value of 'spelllang'
|
||||
up to the first comma, dot or underscore. See |set-spc-auto|.
|
||||
up to the first comma, dot or underscore.
|
||||
Also see |set-spc-auto|.
|
||||
|
||||
|
||||
*'spellsuggest'* *'sps'*
|
||||
@@ -6021,6 +6004,14 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
All fields except the {item} is optional. A single percent sign can
|
||||
be given as "%%". Up to 80 items can be specified.
|
||||
|
||||
When the option starts with "%!" then it is used as an expression,
|
||||
evaluated and the result is used as the option value. Example: >
|
||||
:set statusline=%!MyStatusLine()
|
||||
< The result can contain %{} items that will be evaluated too.
|
||||
|
||||
When there is error while evaluating the option then it will be made
|
||||
empty to avoid further errors. Otherwise screen updating would loop.
|
||||
|
||||
Note that the only effect of 'ruler' when this option is set (and
|
||||
'laststatus' is 2) is controlling the output of |CTRL-G|.
|
||||
|
||||
@@ -6079,15 +6070,24 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
percentage described for 'ruler'. Always 3 in length.
|
||||
a S Argument list status as in default title. ({current} of {max})
|
||||
Empty if the argument file count is zero or one.
|
||||
{ NF Evaluate expression between '{' and '}' and substitute result.
|
||||
{ NF Evaluate expression between '%{' and '}' and substitute result.
|
||||
Note that there is no '%' before the closing '}'.
|
||||
( - Start of item group. Can be used for setting the width and
|
||||
alignment of a section. Must be followed by %) somewhere.
|
||||
) - End of item group. No width fields allowed.
|
||||
T N For 'tabline': start of tab page N label. Use %T after the last
|
||||
label. This information is used for mouse clicks.
|
||||
X N For 'tabline': start of close tab N label. Use %X after the
|
||||
label, e.g.: %3Xclose%X. Use %999X for a "close current tab"
|
||||
mark. This information is used for mouse clicks.
|
||||
< - Where to truncate line if too long. Default is at the start.
|
||||
No width fields allowed.
|
||||
= - Separation point between left and right aligned items.
|
||||
No width fields allowed.
|
||||
# - Set highlight group. The name must follow and then a # again.
|
||||
Thus use %#HLname# for highlight group HLname. The same
|
||||
highlighting is used, also for the statusline of non-current
|
||||
windows.
|
||||
* - Set highlight group to User{N}, where {N} is taken from the
|
||||
minwid field, e.g. %1*. Restore normal highlight with %* or %0*.
|
||||
The difference between User{N} and StatusLine will be applied
|
||||
@@ -6268,6 +6268,28 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'S' flag in 'cpoptions'.
|
||||
Only normal file name characters can be used, "/\*?[|<>" are illegal.
|
||||
|
||||
*'tabline'* *'tal'*
|
||||
'tabline' 'tal' string (default empty)
|
||||
global
|
||||
{not in Vi}
|
||||
{not available when compiled without the +windows
|
||||
feature}
|
||||
When nonempty, this option determines the content of the tab pages
|
||||
line at the top of the Vim window. When empty Vim will use a default
|
||||
tab pages line. See |setting-tabline| for more info.
|
||||
|
||||
The tab pages line only appears as specified with the 'showtabline'
|
||||
option and only when there is no GUI implementation for tabs.
|
||||
|
||||
The value is evaluated like with 'statusline'. You can use
|
||||
|tabpagenr()|, |tabpagewinnr()| and |tabpagebuflist()| to figure out
|
||||
the text to be displayed. Use "%1T" for the first label, "%2T" for
|
||||
the second one, etc. Use "%X" items for closing labels.
|
||||
|
||||
Keep in mind that only one of the tab pages is the current one, others
|
||||
are invisible and you can't jump to their windows.
|
||||
|
||||
|
||||
*'tabstop'* *'ts'*
|
||||
'tabstop' 'ts' number (default 8)
|
||||
local to buffer
|
||||
@@ -7078,7 +7100,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'weirdinvert' 'wiv' boolean (default off)
|
||||
global
|
||||
{not in Vi}
|
||||
This option has the same effect as the 't_xs' termcap option.
|
||||
This option has the same effect as the 't_xs' terminal option.
|
||||
It is provided for backwards compatibility with version 4.x.
|
||||
Setting 'weirdinvert' has the effect of making 't_xs' non-empty, and
|
||||
vice versa. Has no effect when the GUI is running.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*os_dos.txt* For Vim version 7.0aa. Last change: 2003 Dec 20
|
||||
*os_dos.txt* For Vim version 7.0aa. Last change: 2006 Feb 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -126,8 +126,8 @@ text. For example, to get grey text on a blue background: >
|
||||
See |highlight-groups| for other groups that are available.
|
||||
|
||||
A DOS console does not support attributes like bold and underlining. You can
|
||||
set the color used in five modes with nine termcap options. Note that this is
|
||||
not necessary since you can set the color directly with the ":highlight"
|
||||
set the color used in five modes with nine terminal options. Note that this
|
||||
is not necessary since you can set the color directly with the ":highlight"
|
||||
command; these options are for backward compatibility with older Vim versions.
|
||||
The |'highlight'| option specifies which of the five modes is used for which
|
||||
action. >
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*pattern.txt* For Vim version 7.0aa. Last change: 2006 Jan 05
|
||||
*pattern.txt* For Vim version 7.0aa. Last change: 2006 Feb 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -161,7 +161,7 @@ The offset gives the cursor position relative to the found match:
|
||||
s[-num] [num] characters to the left of the start of the match
|
||||
b[+num] [num] identical to s[+num] above (mnemonic: begin)
|
||||
b[-num] [num] identical to s[-num] above (mnemonic: begin)
|
||||
;{pattern} perform another searcn, see |//;|
|
||||
;{pattern} perform another search, see |//;|
|
||||
|
||||
If a '-' or '+' is given but [num] is omitted, a count of one will be used.
|
||||
When including an offset with 'e', the search becomes inclusive (the
|
||||
@@ -394,7 +394,9 @@ More explanation and examples below, follow the links.
|
||||
|/\ze| \ze \ze anything, sets end of match
|
||||
|/\%^| \%^ \%^ beginning of file |/zero-width| *E71*
|
||||
|/\%$| \%$ \%$ end of file |/zero-width|
|
||||
|/\%V| \%V \%V inside Visual area |/zero-width|
|
||||
|/\%#| \%# \%# cursor position |/zero-width|
|
||||
|/\%'m| \%'m \%'m mark m position |/zero-width|
|
||||
|/\%l| \%23l \%23l in line 23 |/zero-width|
|
||||
|/\%c| \%23c \%23c in column 23 |/zero-width|
|
||||
|/\%v| \%23v \%23v in virtual column 23 |/zero-width|
|
||||
@@ -788,6 +790,11 @@ $ At end of pattern or in front of "\|" or "\)" ("|" or ")" after "\v"):
|
||||
position after the first "VIM".
|
||||
Searching from the end of the file backwards is easier!
|
||||
|
||||
*/\%V*
|
||||
\%V Match inside the Visual area. When Visual mode has already been
|
||||
stopped match in the area that |gv| would reselect.
|
||||
Only works for the current buffer.
|
||||
|
||||
*/\%#* *cursor-position*
|
||||
\%# Matches with the cursor position. Only works when matching in a
|
||||
buffer displayed in a window. {not in Vi}
|
||||
@@ -802,6 +809,20 @@ $ At end of pattern or in front of "\|" or "\)" ("|" or ")" after "\v"):
|
||||
< When 'hlsearch' is set and you move the cursor around and make changes
|
||||
this will clearly show when the match is updated or not.
|
||||
|
||||
*/\%'m* */\%<'m* */\%>'m*
|
||||
\%'m Matches with the position of mark m.
|
||||
\%<'m Matches before the position of mark m.
|
||||
\%>'m Matches after the position of mark m.
|
||||
Example, to highlight the text from mark 's to 'e: >
|
||||
/.\%>'s.*\%<'e..
|
||||
< Note that two dots are required to include mark 'e in the match. That
|
||||
is because "\%<'e" matches at the character before the 'e mark, and
|
||||
since it's a |/zero-width| match it doesn't include that character.
|
||||
{not in Vi}
|
||||
WARNING: When the mark is moved after the pattern was used, the result
|
||||
becomes invalid. Vim doesn't automatically update the matches.
|
||||
Similar to moving the cursor for "\%#" |/\%#|.
|
||||
|
||||
*/\%l* */\%>l* */\%<l*
|
||||
\%23l Matches in a specific line.
|
||||
\%<23l Matches above a specific line (lower line number).
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*pi_netrw.txt* For Vim version 7.0. Last change: Nov 28, 2005
|
||||
*pi_netrw.txt* For Vim version 7.0. Last change: Jan 27, 2006
|
||||
|
||||
VIM REFERENCE MANUAL by Charles E. Campbell, Jr.
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
==============================================================================
|
||||
0. Contents *netrw-contents*
|
||||
|
||||
1. Netrw Reference......................................|netrw-ref|
|
||||
1. Starting With Netrw.................................|netrw-start|
|
||||
2. Netrw Reference......................................|netrw-ref|
|
||||
CONTROLLING EXTERNAL APPLICTIONS...................|netrw-externapp|
|
||||
READING............................................|netrw-read|
|
||||
WRITING............................................|netrw-write|
|
||||
@@ -18,14 +19,14 @@
|
||||
CHANGING THE USERID AND PASSWORD...................|netrw-chgup|
|
||||
VARIABLES..........................................|netrw-variables|
|
||||
PATHS..............................................|netrw-path|
|
||||
2. Network-Oriented File Transfer.......................|netrw-xfer|
|
||||
3. Network-Oriented File Transfer.......................|netrw-xfer|
|
||||
NETRC..............................................|netrw-netrc|
|
||||
PASSWORD...........................................|netrw-passwd|
|
||||
3. Activation...........................................|netrw-activate|
|
||||
4. Transparent File Transfer............................|netrw-transparent|
|
||||
5. Ex Commands..........................................|netrw-ex|
|
||||
6. Variables and Options................................|netrw-var|
|
||||
7. Directory Browsing...................................|netrw-browse| {{{1
|
||||
4. Activation...........................................|netrw-activate|
|
||||
5. Transparent File Transfer............................|netrw-transparent|
|
||||
6. Ex Commands..........................................|netrw-ex|
|
||||
7. Variables and Options................................|netrw-var|
|
||||
8. Directory Browsing...................................|netrw-browse| {{{1
|
||||
Maps...............................................|netrw-maps|
|
||||
Exploring..........................................|netrw-explore-cmds|
|
||||
Quick Reference Commands Table.....................|netrw-browse-cmds|
|
||||
@@ -41,7 +42,7 @@
|
||||
Deleting Files Or Directories......................|netrw-delete|
|
||||
Renaming Files Or Directories......................|netrw-move|
|
||||
Hiding Files Or Directories........................|netrw-a|
|
||||
Edit File Or Directory Hiding List.................|netrw-h|
|
||||
Edit File Or Directory Hiding List.................|netrw-ctrl-h|
|
||||
Browsing With A Horizontally Split Window..........|netrw-o|
|
||||
Preview Window.....................................|netrw-p|
|
||||
Selecting Sorting Style............................|netrw-s|
|
||||
@@ -56,19 +57,19 @@
|
||||
Changing To A Bookmarked Directory.................|netrw-B| |netrw-NB|
|
||||
Listing Bookmarks And History......................|netrw-q|
|
||||
Improving Directory Browsing.......................|netrw-listhack| }}}1
|
||||
8. Problems and Fixes...................................|netrw-problems|
|
||||
9. Debugging............................................|netrw-debug|
|
||||
10. History..............................................|netrw-history|
|
||||
11. Credits..............................................|netrw-credits|
|
||||
9. Problems and Fixes...................................|netrw-problems|
|
||||
10. Debugging............................................|netrw-debug|
|
||||
11. History..............................................|netrw-history|
|
||||
12. Credits..............................................|netrw-credits|
|
||||
|
||||
The Netrw plugin is generally sourced automatically as it is a
|
||||
|standard-plugin|. That said, to make use of netrw, one must
|
||||
have plugins available which can be done with the following
|
||||
two lines in your <.vimrc>:
|
||||
two lines in your <.vimrc>: >
|
||||
|
||||
set nocp " 'compatible' is not set
|
||||
filetype plugin on " plugins are enabled
|
||||
|
||||
<
|
||||
You can avoid loading this plugin by setting the "loaded_netrw" variable
|
||||
in your <.vimrc> file: >
|
||||
|
||||
@@ -77,14 +78,66 @@ in your <.vimrc> file: >
|
||||
{Vi does not have any of this}
|
||||
|
||||
==============================================================================
|
||||
1. Netrw Reference *netrw-ref*
|
||||
1. Starting With Netrw *netrw-start*
|
||||
|
||||
Netrw makes reading, writing, and browsing over a network connection easy!
|
||||
First, make sure that you have plugins enabled, so you'll need to have at
|
||||
least the following in your <.vimrc>: (or see |netrw-activate|) >
|
||||
|
||||
set nocp " 'compatible' is not set
|
||||
filetype plugin on " plugins are enabled
|
||||
<
|
||||
(see |'cp'| and |:filetype-plugin-on|)
|
||||
|
||||
Netrw supports "transparent" editing of files on other machines using urls
|
||||
(see |netrw-transparent|). As an example of this, let's assume you have an
|
||||
account on some other machine; try >
|
||||
|
||||
vim scp://hostname/path/to/file
|
||||
<
|
||||
if you have an ssh connection. Want to make ssh/scp easier to use? Check
|
||||
out |netrw-listhack|!
|
||||
|
||||
What if you have ftp, not ssh/scp? That's easy, too; try >
|
||||
|
||||
vim ftp://hostname/path/to/file
|
||||
<
|
||||
Want to make ftp simpler to use? See if your ftp supports a file called
|
||||
<.netrc> -- typically it goes in your home directory, has read/write
|
||||
permissions for only the user to read (ie. not group, world, other, etc),
|
||||
and has lines resembling >
|
||||
|
||||
machine HOSTNAME login USERID password "PASSWORD"
|
||||
machine HOSTNAME login USERID password "PASSWORD"
|
||||
...
|
||||
default login USERID password "PASSWORD"
|
||||
<
|
||||
How about browsing -- ie. you just want to look around before editing a
|
||||
file. For browsing on your current host, just "edit" a directory: >
|
||||
|
||||
vim .
|
||||
vim /home/userid/path
|
||||
<
|
||||
For browsing on a remote host, "edit" a directory (but make sure that
|
||||
the directory name is followed by a "/"): >
|
||||
|
||||
vim scp://hostname/
|
||||
vim ftp://hostname/path/to/dir/
|
||||
<
|
||||
See |netrw-browse| for more!
|
||||
|
||||
There's more protocols supported than scp and ftp, too: see the next
|
||||
section, |netrw-externapp|.
|
||||
|
||||
==============================================================================
|
||||
2. Netrw Reference *netrw-ref*
|
||||
|
||||
CONTROLLING EXTERNAL APPLICTIONS *netrw-externapp*
|
||||
|
||||
Protocol Variable Default Value
|
||||
-------- ---------------- -------------
|
||||
dav: *g:netrw_dav_cmd* = "cadaver"
|
||||
fetch: *g:netrw_fetch_cmd* = "fetch -o"
|
||||
fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available
|
||||
ftp: *g:netrw_ftp_cmd* = "ftp"
|
||||
http: *g:netrw_http_cmd* = "fetch -o" if fetch is available
|
||||
http: g:netrw_http_cmd = "wget -q -O" If wget is available
|
||||
@@ -191,7 +244,7 @@ file using root-relative paths, use the full path:
|
||||
<
|
||||
|
||||
==============================================================================
|
||||
2. Network-Oriented File Transfer *netrw-xfer*
|
||||
3. Network-Oriented File Transfer *netrw-xfer*
|
||||
|
||||
Network-oriented file transfer under Vim is implemented by a VimL-based script
|
||||
(<netrw.vim>) using plugin techniques. It currently supports both reading and
|
||||
@@ -337,7 +390,7 @@ However, |netrw-listhack| can help with this problem.
|
||||
|
||||
|
||||
==============================================================================
|
||||
3. Activation *netrw-activate*
|
||||
4. Activation *netrw-activate*
|
||||
|
||||
Network-oriented file transfers are available by default whenever
|
||||
|'nocompatible'| mode is enabled. The <netrw.vim> file resides in your
|
||||
@@ -351,7 +404,7 @@ up vim. I suggest that, at a minimum, you have at least the following in your
|
||||
<
|
||||
|
||||
==============================================================================
|
||||
4. Transparent File Transfer *netrw-transparent*
|
||||
5. 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.
|
||||
@@ -365,7 +418,7 @@ See |netrw-activate| for more on how to encourage your vim to use plugins
|
||||
such as netrw.
|
||||
|
||||
==============================================================================
|
||||
5. Ex Commands *netrw-ex*
|
||||
6. Ex Commands *netrw-ex*
|
||||
|
||||
The usual read/write commands are supported. There are also a couple of
|
||||
additional commands available.
|
||||
@@ -403,7 +456,7 @@ additional commands available.
|
||||
|
||||
|
||||
==============================================================================
|
||||
6. Variables and Options *netrw-options* *netrw-var*
|
||||
7. Variables and Options *netrw-options* *netrw-var*
|
||||
|
||||
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:
|
||||
@@ -476,10 +529,10 @@ variables listed below, and may be modified by the user.
|
||||
transformed however they wish
|
||||
by NetReadFixup()
|
||||
g:netrw_dav_cmd variable ="cadaver"
|
||||
g:netrw_fetch_cmd variable ="fetch -o"
|
||||
g:netrw_fetch_cmd variable ="fetch -o" if fetch is available
|
||||
g:netrw_ftp_cmd variable ="ftp"
|
||||
g:netrw_http_cmd variable ="fetch -o" else if fetch is executable
|
||||
g:netrw_http_cmd variable ="wget -O" if wget is executable
|
||||
g:netrw_http_cmd variable ="fetch -o" if fetch is available
|
||||
g:netrw_http_cmd variable ="wget -O" else if wget is available
|
||||
g:netrw_list_cmd variable ="ssh HOSTNAME ls -Fa"
|
||||
g:netrw_rcp_cmd variable ="rcp"
|
||||
g:netrw_rsync_cmd variable ="rsync -a"
|
||||
@@ -488,9 +541,10 @@ variables listed below, and may be modified by the user.
|
||||
-------------------------------------------------------------------------
|
||||
<
|
||||
*netrw-ftp*
|
||||
The first two options both help with certain ftp's that give trouble
|
||||
otherwise. In order to best understand how to use these options if ftp is
|
||||
giving you troubles, a bit of discussion follows on how netrw does ftp reads.
|
||||
The first two options (netrw_ftp and NetReadFixup) both help with certain
|
||||
ftp's that give trouble otherwise. In order to best understand how to use
|
||||
these options if ftp is giving you troubles, a bit of discussion follows on
|
||||
how netrw does ftp reads.
|
||||
|
||||
The g:netrw_..._cmd variables specify the external program to use handle the
|
||||
associated protocol (rcp, ftp, etc), plus any options.
|
||||
@@ -572,7 +626,7 @@ itself:
|
||||
>
|
||||
|
||||
==============================================================================
|
||||
7. Directory Browsing *netrw-browse* *netrw-dir* *netrw-list* *netrw-help*
|
||||
8. Directory Browsing *netrw-browse* *netrw-dir* *netrw-list* *netrw-help*
|
||||
|
||||
MAPS *netrw-maps*
|
||||
?................Help.......................................|netrw-help|
|
||||
@@ -585,7 +639,7 @@ MAPS *netrw-maps*
|
||||
c................Make Browsing Directory The Current Dir....|netrw-c|
|
||||
d................Make A New Directory.......................|netrw-d|
|
||||
D................Deleting Files or Directories..............|netrw-D|
|
||||
<c-h>............Edit File/Directory Hiding List............|netrw-h|
|
||||
<c-h>............Edit File/Directory Hiding List............|netrw-ctrl-h|
|
||||
i................Long Listing...............................|netrw-i|
|
||||
<c-l>............Refreshing the Listing.....................|netrw-ctrl-l|
|
||||
o................Browsing with a Horizontal Split...........|netrw-o|
|
||||
@@ -615,27 +669,38 @@ QUICK REFERENCE COMMANDS TABLE *netrw-browse-cmds*
|
||||
Command Explanation
|
||||
------- -----------
|
||||
< ? Causes Netrw to issue help
|
||||
<cr> Netrw will enter the directory or read the file
|
||||
<del> Netrw will attempt to remove the file/directory
|
||||
d Make a directory
|
||||
D Netrw will attempt to remove the file(s)/directory(ies)
|
||||
R Netrw will attempt to rename the file(s)/directory(ies)
|
||||
- Makes Netrw go up one directory
|
||||
a Toggles between normal display,
|
||||
hiding (suppress display of files matching g:netrw_list_hide)
|
||||
showing (display only files which match g:netrw_list_hide)
|
||||
c Make current browsing directory the current directory
|
||||
<c-h> Edit file hiding list
|
||||
i Toggles between long and short listing
|
||||
<c-l> Causes Netrw to refresh the directory listing
|
||||
<cr> Netrw will enter the directory or read the file |netrw-cr|
|
||||
<del> Netrw will attempt to remove the file/directory |netrw-del|
|
||||
- Makes Netrw go up one directory |netrw--|
|
||||
a Toggles between normal display, |netrw-a|
|
||||
hiding (suppress display of files matching g:netrw_list_hide)
|
||||
showing (display only files which match g:netrw_list_hide)
|
||||
b bookmark current directory; use Nb if compact listing
|
||||
in use |netrw-b|
|
||||
B go to previous bookmarked directory; use Nb if compact
|
||||
listing is in use |netrw-B|
|
||||
c Make current browsing directory the current directory |netrw-c|
|
||||
d Make a directory |netrw-d|
|
||||
D Netrw will attempt to remove the file(s)/directory(ies) |netrw-D|
|
||||
<c-h> Edit file hiding list |netrw-ctrl-h|
|
||||
i Toggles between long and short listing |netrw-i|
|
||||
<c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
|
||||
Nb Same as b, but always available |netrw-Nb|
|
||||
NB Same as B, but always available |netrw-NB|
|
||||
o Enter the file/directory under the cursor in a new browser
|
||||
window. A horizontal split is used.
|
||||
p Preview the file
|
||||
r Reverse sorting order
|
||||
s Select sorting style: by name, time, or file size
|
||||
window. A horizontal split is used. |netrw-o|
|
||||
O Obtain a file specified by cursor |netrw-O|
|
||||
p Preview the file |netrw-p|
|
||||
P Browse in the previously used window |netrw-P|
|
||||
r Reverse sorting order |netrw-r|
|
||||
R Rename the designed file(s)/directory(ies) |netrw-R|
|
||||
s Select sorting style: by name, time, or file size |netrw-s|
|
||||
S Specify suffix priority for name-sorting |netrw-S|
|
||||
u Change to recently-visited directory |netrw-u|
|
||||
U Change to subsequently-visited directory |netrw-U|
|
||||
v Enter the file/directory under the cursor in a new browser
|
||||
window. A vertical split is used.
|
||||
x Apply a function to a file.
|
||||
window. A vertical split is used. |netrw-v|
|
||||
x Apply a function to a file. (special browsers) |netrw-x|
|
||||
|
||||
NETRW BROWSER VARIABLES *netrw-browse-var*
|
||||
>
|
||||
@@ -650,6 +715,19 @@ NETRW BROWSER VARIABLES *netrw-browse-var*
|
||||
by setting this variable (see |netrw-v|)
|
||||
default: =0
|
||||
|
||||
*g:netrw_browse_split* when browsing, <cr> will open the file by:
|
||||
=0: re-using the same window
|
||||
=1: horizontally splitting the window first
|
||||
=2: vertically splitting the window first
|
||||
*g:netrw_browsex_viewer* specify user's preference for a viewer: >
|
||||
"kfmclient exec"
|
||||
"gnome-open"
|
||||
< If >
|
||||
"-"
|
||||
< is used, then netrwFileHandler() will look for
|
||||
a script/function to handle the given
|
||||
extension. (see |netrw_filehandler|).
|
||||
<
|
||||
*g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings
|
||||
that can show up as "directories" and "files"
|
||||
in the listing. This pattern is used to
|
||||
@@ -866,6 +944,11 @@ protocol given in the original read request.
|
||||
or more spaces embedded in it, or any trailing spaces, then you'll need to
|
||||
use the "thin" format to select it.
|
||||
|
||||
The |g:netrw_browse_split| option, which is zero by default, may be used to
|
||||
cause the opening of files to be done in a new window. The splitting will
|
||||
be done horizontally if the option is one and vertically if the option is
|
||||
two.
|
||||
|
||||
|
||||
OBTAINING A FILE *netrw-O*
|
||||
|
||||
@@ -921,7 +1004,7 @@ directory. Attempts to make a local directory that already exists (as either
|
||||
a file or a directory) will be detected, reported on, and ignored.
|
||||
|
||||
|
||||
DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D*
|
||||
DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del*
|
||||
|
||||
Deleting/removing files and directories involves moving the cursor to the
|
||||
file/directory to be deleted and pressing "D". Directories must be empty
|
||||
@@ -971,7 +1054,7 @@ ways: ignore it, hide files which match, and show only those files which
|
||||
match. The "a" map allows the user to cycle about these three ways.
|
||||
|
||||
The g:netrw_list_hide variable holds a comma delimited list of patterns (ex.
|
||||
\.obj) which specify the hiding list. (also see |netrw-h|) To set the hiding
|
||||
\.obj) which specify the hiding list. (also see |netrw-ctrl-h|) To set the hiding
|
||||
list, use the <c-h> map. As an example, to hide files which begin with a ".",
|
||||
one may use the <c-h> map to set the hiding list to '^\..*' (or one may put
|
||||
let g:netrw_list_hide= '^\..*' in one's <.vimrc>). One may then use the "a"
|
||||
@@ -979,7 +1062,7 @@ key to show all files, hide matching files, or to show only the matching
|
||||
files.
|
||||
|
||||
|
||||
EDIT FILE OR DIRECTORY HIDING LIST *netrw-h* *netrw-edithide*
|
||||
EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide*
|
||||
|
||||
The "<ctrl-h>" map brings up a requestor allowing the user to change the
|
||||
file/directory hiding list. The hiding list consists of one or more patterns
|
||||
@@ -1009,6 +1092,20 @@ One may use a preview window (currently only for local browsing) by using the
|
||||
"p" key when the cursor is atop the desired filename to be previewed.
|
||||
|
||||
|
||||
PREVIOUS WINDOW *netrw-P* *netrw-prvwin*
|
||||
|
||||
To edit a file or directory in the previously used window (see :he |CTRL-W_P|),
|
||||
press a "P". If there's only one window, then the one window will be
|
||||
horizontally split (above/below splitting is controlled by |g:netrw_alto|,
|
||||
and its initial size is controlled by |g:netrw_winsize|).
|
||||
|
||||
If there's more than one window, the previous window will be re-used on
|
||||
the selected file/directory. If the previous window's associated buffer
|
||||
has been modified, and there's only one window with that buffer, then
|
||||
the user will be asked if s/he wishes to save the buffer first (yes,
|
||||
no, or cancel).
|
||||
|
||||
|
||||
SELECTING SORTING STYLE *netrw-s* *netrw-sort*
|
||||
|
||||
One may select the sorting style by name, time, or (file) size. The "s" map
|
||||
@@ -1068,15 +1165,30 @@ window and cursor at the right, have
|
||||
in your <.vimrc>.
|
||||
|
||||
|
||||
CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler*
|
||||
CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler* *gx*
|
||||
|
||||
One may "enter" a file with a special handler, thereby firing up a browser or
|
||||
other application, for example, on a file by hitting the "x" key. The special
|
||||
handler varies:
|
||||
Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
|
||||
best seen with a special handler (ie. a tool provided with your computer).
|
||||
Netrw allows one to invoke such special handlers by: >
|
||||
|
||||
* when Exploring, hit the "x" key
|
||||
* when editing, hit gx with the cursor atop the special filename
|
||||
<
|
||||
Netrw determines which special handler by the following method:
|
||||
|
||||
* if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
|
||||
view files. Examples of useful settings (place into your <.vimrc>): >
|
||||
|
||||
:let g:netrw_browsex_viewer= "kfmclient exec"
|
||||
< or >
|
||||
:let g:netrw_browsex_viewer= "gnome-open"
|
||||
<
|
||||
If g:netrw_browsex_viewer == '-', then netrwFileHandler() will be
|
||||
invoked first (see |netrw_filehandler|).
|
||||
|
||||
* for Windows 32 or 64, the url and FileProtocolHandler dlls are used.
|
||||
* for KDE (with kfmclient): kfmclient is used.
|
||||
* for Gnome (with gnome-open): gnome-open is used.
|
||||
* for KDE (with kfmclient): kfmclient is used.
|
||||
* otherwise the netrwFileHandler plugin is used.
|
||||
|
||||
The file's suffix is used by these various approaches to determine an
|
||||
@@ -1084,6 +1196,7 @@ appropriate application to use to "handle" these files. Such things as
|
||||
OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps,
|
||||
*.eps) can be handled.
|
||||
|
||||
*netrw_filehandler*
|
||||
The netrwFileHandler applies a user-defined function to a file, based on its
|
||||
extension. Of course, the handler function must exist for it to be called!
|
||||
>
|
||||
@@ -1093,10 +1206,12 @@ extension. Of course, the handler function must exist for it to be called!
|
||||
See the <plugin/netrwFileHandlers.vim> for an example of how to handle an html
|
||||
file with mozilla.
|
||||
|
||||
One may write custom netrwFileHandlers; please look at the
|
||||
plugin/netrwFileHandlers.vim script for examples. If its likely to be
|
||||
generally useful, please feel free to forward a copy to me for future
|
||||
inclusion in the distribution.
|
||||
One may write custom netrwFileHandlers; please look at the >
|
||||
|
||||
plugin/netrwFileHandlers.vim
|
||||
|
||||
script for examples. If its likely to be generally useful, please feel free
|
||||
to forward a copy to me for future inclusion in the distribution.
|
||||
|
||||
|
||||
MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-c* *netrw-curdir*
|
||||
@@ -1168,7 +1283,7 @@ help on what each of the variables do.
|
||||
|
||||
|
||||
==============================================================================
|
||||
8. Problems and Fixes *netrw-problems*
|
||||
9. Problems and Fixes *netrw-problems*
|
||||
|
||||
(This section is likely to grow as I get feedback)
|
||||
(also see |netrw-debug|)
|
||||
@@ -1233,7 +1348,7 @@ help on what each of the variables do.
|
||||
|
||||
|
||||
==============================================================================
|
||||
9. Debugging *netrw-debug*
|
||||
10. Debugging *netrw-debug*
|
||||
|
||||
The <netrw.vim> script is typically available as:
|
||||
>
|
||||
@@ -1282,8 +1397,23 @@ which is loaded automatically at startup (assuming :set nocp).
|
||||
NdrOchip at ScampbellPfamily.AbizM - NOSPAM
|
||||
|
||||
==============================================================================
|
||||
10. History *netrw-history*
|
||||
11. History *netrw-history* {{{1
|
||||
|
||||
v78: * progress has been made on allowing spaces inside directory
|
||||
names for remote work (reading, writing, browsing). (scp)
|
||||
v77: * Mikolaj Machowski fixed a bug in a substitute command
|
||||
* g:netrw_browsex_viewer implemented
|
||||
* Mikolaj Machowski pointed out that gnome-open is often
|
||||
executable under KDE systems, although it is effectively
|
||||
not functional. NetBrowseX now looks for "kicker" as
|
||||
a running process to determine if KDE is actually the
|
||||
really running.
|
||||
* Explorer's O functionality was inadvertently left out.
|
||||
Netrw now does the same thing, but with the "P" key.
|
||||
* added g:netrw_browse_split option
|
||||
* fixed a bug where the directory contained a "." but
|
||||
the file didn't (was treating the dirname from "."
|
||||
onwards as a suffix)
|
||||
v76: * "directory is missing" error message now restores echo
|
||||
highlighting
|
||||
v75: * file://... now conforms to RFC2396 (thanks to S. Zacchiroli)
|
||||
@@ -1475,7 +1605,7 @@ which is loaded automatically at startup (assuming :set nocp).
|
||||
|
||||
|
||||
==============================================================================
|
||||
11. Credits *netrw-credits*
|
||||
11. Credits *netrw-credits* {{{1
|
||||
|
||||
Vim editor by Bram Moolenaar (Thanks, Bram!)
|
||||
dav support by C Campbell
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickfix.txt* For Vim version 7.0aa. Last change: 2006 Jan 13
|
||||
*quickfix.txt* For Vim version 7.0aa. Last change: 2006 Feb 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -42,7 +42,19 @@ easy way to do this is with the |:make| command (see below). The
|
||||
'errorformat' option should be set to match the error messages from your
|
||||
compiler (see |errorformat| below).
|
||||
|
||||
The following quickfix commands can be used:
|
||||
*location-list* *E776*
|
||||
A location list is similar to a quickfix list and contains a list of positions
|
||||
in files. A location list is associated with a window and each window can
|
||||
have a separate location list. A location list can be associated with only
|
||||
one window. The location list is independent of the quickfix list.
|
||||
|
||||
When a window with a location list is split, the new window gets a copy of the
|
||||
location list. When there are no references to a location list, the location
|
||||
list is destroyed.
|
||||
|
||||
The following quickfix commands can be used. The location list commands are
|
||||
similar to the quickfix commands, replacing the 'c' prefix in the quickfix
|
||||
command with 'l'.
|
||||
|
||||
*:cc*
|
||||
:cc[!] [nr] Display error [nr]. If [nr] is omitted, the same
|
||||
@@ -56,18 +68,32 @@ The following quickfix commands can be used:
|
||||
The 'switchbuf' settings are respected when jumping
|
||||
to a buffer.
|
||||
|
||||
*:ll*
|
||||
:ll[!] [nr] Same as ":cc", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
*:cn* *:cnext* *E553*
|
||||
:[count]cn[ext][!] Display the [count] next error in the list that
|
||||
includes a file name. If there are no file names at
|
||||
all, go to the [count] next error. See |:cc| for
|
||||
[!] and 'switchbuf'.
|
||||
|
||||
*:lne* *:lnext*
|
||||
:[count]lne[xt][!] Same as ":cnext", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
:[count]cN[ext][!] *:cp* *:cprevious* *:cN* *:cNext*
|
||||
:[count]cp[revious][!] Display the [count] previous error in the list that
|
||||
includes a file name. If there are no file names at
|
||||
all, go to the [count] previous error. See |:cc| for
|
||||
[!] and 'switchbuf'.
|
||||
|
||||
|
||||
:[count]lN[ext][!] *:lp* *:lprevious* *:lN* *:lNext*
|
||||
:[count]lp[revious][!] Same as ":cNext" and ":cprevious", except the location
|
||||
list for the current window is used instead of the
|
||||
quickfix list.
|
||||
|
||||
*:cnf* *:cnfile*
|
||||
:[count]cnf[ile][!] Display the first error in the [count] next file in
|
||||
the list that includes a file name. If there are no
|
||||
@@ -75,6 +101,10 @@ The following quickfix commands can be used:
|
||||
the [count] next error. See |:cc| for [!] and
|
||||
'switchbuf'.
|
||||
|
||||
*:lnf* *:lnfile*
|
||||
:[count]lnf[ile][!] Same as ":cnfile", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
:[count]cNf[ile][!] *:cpf* *:cpfile* *:cNf* *:cNfile*
|
||||
:[count]cpf[ile][!] Display the last error in the [count] previous file in
|
||||
the list that includes a file name. If there are no
|
||||
@@ -82,17 +112,34 @@ The following quickfix commands can be used:
|
||||
the [count] previous error. See |:cc| for [!] and
|
||||
'switchbuf'.
|
||||
|
||||
|
||||
:[count]lNf[ile][!] *:lpf* *:lpfile* *:lNf* *:lNfile*
|
||||
:[count]lpf[ile][!] Same as ":cNfile" and ":cpfile", except the location
|
||||
list for the current window is used instead of the
|
||||
quickfix list.
|
||||
|
||||
*:crewind* *:cr*
|
||||
:cr[ewind][!] [nr] Display error [nr]. If [nr] is omitted, the FIRST
|
||||
error is displayed. See |:cc|.
|
||||
|
||||
*:lrewind* *:lr*
|
||||
:lr[ewind][!] [nr] Same as ":crewind", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
*:cfirst* *:cfir*
|
||||
:cfir[st][!] [nr] Same as ":crewind".
|
||||
|
||||
*:lfirst* *:lfir*
|
||||
:lfir[st][!] [nr] Same as ":lrewind".
|
||||
|
||||
*:clast* *:cla*
|
||||
:cla[st][!] [nr] Display error [nr]. If [nr] is omitted, the LAST
|
||||
error is displayed. See |:cc|.
|
||||
|
||||
*:llast* *:lla*
|
||||
:lla[st][!] [nr] Same as ":clast", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
*:cq* *:cquit*
|
||||
:cq[uit] Quit Vim with an error code, so that the compiler
|
||||
will not compile the same file again.
|
||||
@@ -105,16 +152,31 @@ The following quickfix commands can be used:
|
||||
name of the errorfile, the 'errorfile' option will
|
||||
be set to [errorfile]. See |:cc| for [!].
|
||||
|
||||
*:cg* *:cgetfile*
|
||||
:cg[etfile][!] [errorfile]
|
||||
*:lf* *:lfile*
|
||||
:lf[ile][!] [errorfile] Same as ":cfile", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
You can not use the -q command-line option to set
|
||||
the location list.
|
||||
|
||||
|
||||
:cg[etfile][!] [errorfile] *:cg* *:cgetfile*
|
||||
Read the error file. Just like ":cfile" but don't
|
||||
jump to the first error.
|
||||
|
||||
|
||||
:lg[etfile][!] [errorfile] *:lg* *:lgetfile*
|
||||
Same as ":cgetfile", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
*:caddf* *:caddfile*
|
||||
:caddf[ile] [errorfile] Read the error file and add the errors from the
|
||||
errorfile to the current quickfix list. If a quickfix
|
||||
list is not present, then a new list is created.
|
||||
|
||||
*:laddf* *:laddfile*
|
||||
:laddf[ile] [errorfile] Same as ":caddfile", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
*:cb* *:cbuffer* *E681*
|
||||
:cb[uffer] [bufnr] Read the error list from the current buffer.
|
||||
When [bufnr] is given it must be the number of a
|
||||
@@ -123,6 +185,21 @@ The following quickfix commands can be used:
|
||||
A range can be specified for the lines to be used.
|
||||
Otherwise all lines in the buffer are used.
|
||||
|
||||
*:lb* *:lbuffer*
|
||||
:lb[uffer] [bufnr] Same as ":cbuffer", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
*:caddb* *:caddbuffer*
|
||||
:caddb[uffer] [bufnr] Read the error list from the current buffer and add
|
||||
the errors to the current quickfix list. If a
|
||||
quickfix list is not present, then a new list is
|
||||
created. Otherwise, same as ":cbuffer".
|
||||
|
||||
*:laddb* *:laddbuffer*
|
||||
:laddb[uffer] [bufnr] Same as ":caddbuffer", except the location list for
|
||||
the current window is used instead of the quickfix
|
||||
list.
|
||||
|
||||
*:cex* *:cexpr* *E777*
|
||||
:cex[pr][!] {expr} Create a quickfix list using the result of {expr} and
|
||||
jump to the first error. If {expr} is a String, then
|
||||
@@ -137,6 +214,10 @@ The following quickfix commands can be used:
|
||||
:cexpr system('grep -n xyz *')
|
||||
:cexpr getline(1, '$')
|
||||
<
|
||||
*:lex* *:lexpr*
|
||||
:lex[pr][!] {expr} Same as ":cexpr", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
*:cad* *:caddexpr*
|
||||
:cad[dexpr][!] {expr} Evaluate {expr} and add the resulting lines to the
|
||||
current quickfix list. If a quickfix list is not
|
||||
@@ -146,6 +227,10 @@ The following quickfix commands can be used:
|
||||
Example: >
|
||||
:g/mypattern/caddexpr expand("%") . ":" . line(".") . ":" . getline(".")
|
||||
<
|
||||
*:lad* *:laddexpr*
|
||||
:lad[dexpr][!] {expr} Same as ":caddexpr", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
*:cl* *:clist*
|
||||
:cl[ist] [from] [, [to]]
|
||||
List all errors that are valid |quickfix-valid|.
|
||||
@@ -158,6 +243,15 @@ The following quickfix commands can be used:
|
||||
:cl[ist]! [from] [, [to]]
|
||||
List all errors.
|
||||
|
||||
*:lli* *:llist*
|
||||
:lli[st] [from] [, [to]]
|
||||
Same as ":clist", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
:lli[st]! [from] [, [to]]
|
||||
List all the entries in the location list for the
|
||||
current window.
|
||||
|
||||
If you insert or delete lines, mostly the correct error location is still
|
||||
found because hidden marks are used. Sometimes, when the mark has been
|
||||
deleted for some reason, the message "line changed" is shown to warn you that
|
||||
@@ -182,14 +276,28 @@ on) is executed. See |QuickFixCmdPre| and |QuickFixCmdPost| for details.
|
||||
the current window. It is not possible to open a
|
||||
second quickfix window.
|
||||
|
||||
*:lop* *:lopen*
|
||||
:lop[en] [height] Open a window to show the location list for the
|
||||
current window. Works only when the location list for
|
||||
the current window is present. You can have more than
|
||||
one location window opened at a time. Otherwise, it
|
||||
acts the same as ":copen".
|
||||
|
||||
*:ccl* *:cclose*
|
||||
:ccl[ose] Close the quickfix window.
|
||||
|
||||
*:lcl* *:lclose*
|
||||
:lcl[ose] Close the window showing the location list for the
|
||||
current window.
|
||||
|
||||
*:cw* *:cwindow*
|
||||
:cw[indow] [height] Open the quickfix window when there are recognized
|
||||
errors. If the window is already open and there are
|
||||
no recognized errors, close the window.
|
||||
|
||||
*:lw* *:lwindow*
|
||||
:lw[indow] [height] Same as ":cwindow", except use the window showing the
|
||||
location list for the current window.
|
||||
|
||||
Normally the quickfix window is at the bottom of the screen. If there are
|
||||
vertical splits, it's at the bottom of the rightmost column of windows. To
|
||||
@@ -214,14 +322,17 @@ You can use CTRL-W <Enter> to open a new window and jump to the error there.
|
||||
|
||||
When the quickfix window has been filled, two autocommand events are
|
||||
triggered. First the 'filetype' option is set to "qf", which triggers the
|
||||
FileType event. Then the BufReadPost event is triggered. This can be used to
|
||||
perform some action on the listed errors. Example: >
|
||||
au BufReadPost quickfix setlocal nomodifiable
|
||||
\ | silent g/^/s//\=line(".")." "/
|
||||
\ | setlocal modifiable
|
||||
FileType event. Then the BufReadPost event is triggered, using "quickfix" for
|
||||
the buffer name. This can be used to perform some action on the listed
|
||||
errors. Example: >
|
||||
au BufReadPost quickfix setlocal modifiable
|
||||
\ | silent exe 'g/^/s//\=line(".")." "/'
|
||||
\ | setlocal nomodifiable
|
||||
This prepends the line number to each line. Note the use of "\=" in the
|
||||
substitute string of the ":s" command, which is used to evaluate an
|
||||
expression.
|
||||
The BufWinEnter event is also triggered, again using "quickfix" for the buffer
|
||||
name.
|
||||
|
||||
Note: Making changes in the quickfix window has no effect on the list of
|
||||
errors. 'modifiable' is off to avoid making changes. If you delete or insert
|
||||
@@ -230,6 +341,29 @@ If you really want to do this, you could write the contents of the quickfix
|
||||
window to a file and use ":cfile" to have it parsed and used as the new error
|
||||
list.
|
||||
|
||||
*location-list-window*
|
||||
The location list window displays the entries in a location list. When you
|
||||
open a location list window, it is created below the current window and
|
||||
displays the location list for the current window. The location list window
|
||||
is similar to the quickfix window, except that you can have more than one
|
||||
location list window open at a time. When you use a location list command in
|
||||
this window, the displayed location list is used.
|
||||
|
||||
When you select a file from the location list window, the following steps are
|
||||
used to find a window to edit the file:
|
||||
|
||||
1. If a window with the location list displayed in the location list window is
|
||||
present, then the file is opened in that window.
|
||||
2. If the above step fails and if the file is already opened in another
|
||||
window, then that window is used.
|
||||
3. If the above step fails then an existing window showing a buffer with
|
||||
'buftype' not set is used.
|
||||
4. If the above step fails, then the file is edited in a new window.
|
||||
|
||||
In all of the above cases, if the location list for the selected window is not
|
||||
yet set, then it is set to the location list displayed in the location list
|
||||
window.
|
||||
|
||||
=============================================================================
|
||||
3. Using more than one list of errors *quickfix-error-lists*
|
||||
|
||||
@@ -243,11 +377,19 @@ lists. They set one of the existing error lists as the current one.
|
||||
this [count] times. When already at the oldest error
|
||||
list, an error message is given.
|
||||
|
||||
*:lolder* *:lol*
|
||||
:lol[der] [count] Same as ":colder", except use the location list for
|
||||
the current window instead of the quickfix list.
|
||||
|
||||
*:cnewer* *:cnew* *E381*
|
||||
:cnew[er] [count] Go to newer error list. When [count] is given, do
|
||||
this [count] times. When already at the newest error
|
||||
list, an error message is given.
|
||||
|
||||
*:lnewer* *:lnew*
|
||||
:lnew[er] [count] Same as ":cnewer", except use the location list for
|
||||
the current window instead of the quickfix list.
|
||||
|
||||
When adding a new error list, it becomes the current list.
|
||||
|
||||
When ":colder" has been used and ":make" or ":grep" is used to add a new error
|
||||
@@ -281,6 +423,11 @@ lists, use ":cnewer 99" first.
|
||||
This command does not accept a comment, any "
|
||||
characters are considered part of the arguments.
|
||||
|
||||
*:lmak* *:lmake*
|
||||
:lmak[e][!] [arguments]
|
||||
Same as ":make", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
The ":make" command executes the command given with the 'makeprg' option.
|
||||
This is done by passing the command to the shell given with the 'shell'
|
||||
option. This works almost like typing
|
||||
@@ -372,6 +519,12 @@ advantages are:
|
||||
Example: >
|
||||
:vimgrep Error *.c
|
||||
<
|
||||
*:lv* *:lvimgrep*
|
||||
:lv[imgrep][!] /{pattern}/[g][j] {file} ...
|
||||
:lv[imgrep][!] {pattern} {file} ...
|
||||
Same as ":vimgrep", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
*:vimgrepa* *:vimgrepadd*
|
||||
:vimgrepa[dd][!] /{pattern}/[g][j] {file} ...
|
||||
:vimgrepa[dd][!] {pattern} {file} ...
|
||||
@@ -379,6 +532,12 @@ advantages are:
|
||||
of errors the matches are appended to the current
|
||||
list.
|
||||
|
||||
*:lvimgrepa* *:lvimgrepadd*
|
||||
:lvimgrepa[dd][!] /{pattern}/[g][j] {file} ...
|
||||
:lvimgrepa[dd][!] {pattern} {file} ...
|
||||
Same as ":vimgrepadd", except the location list for
|
||||
the current window is used instead of the quickfix
|
||||
list.
|
||||
|
||||
5.2 External grep
|
||||
|
||||
@@ -394,6 +553,11 @@ id-utils) in a similar way to its compiler integration (see |:make| above).
|
||||
When 'grepprg' is "internal" this works like
|
||||
|:vimgrep|. Note that the pattern needs to be
|
||||
enclosed in separator characters then.
|
||||
|
||||
*:lgr* *:lgrep*
|
||||
:lgr[ep][!] [arguments] Same as ":grep", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
*:grepa* *:grepadd*
|
||||
:grepa[dd][!] [arguments]
|
||||
Just like ":grep", but instead of making a new list of
|
||||
@@ -407,6 +571,11 @@ id-utils) in a similar way to its compiler integration (see |:make| above).
|
||||
":grepadd" jumps to the first error, which is not
|
||||
allowed with |:bufdo|.
|
||||
|
||||
*:lgrepa* *:lgrepadd*
|
||||
:lgrepa[dd][!] [arguments]
|
||||
Same as ":grepadd", except the location list for the
|
||||
current window is used instead of the quickfix list.
|
||||
|
||||
5.3 Setting up external grep
|
||||
|
||||
If you have a standard "grep" program installed, the :grep command may work
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickref.txt* For Vim version 7.0aa. Last change: 2006 Jan 11
|
||||
*quickref.txt* For Vim version 7.0aa. Last change: 2006 Feb 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -211,6 +211,8 @@ N is used to indicate an optional count that can be given before the command.
|
||||
|:ts| :ts[elect][!] [tag] List matching tags and select one to jump to
|
||||
|:tjump| :tj[ump][!] [tag] Jump to tag [tag] or select from list when
|
||||
there are multiple matches
|
||||
|:ltag| :lt[ag][!] [tag] Jump to tag [tag] and add matching tags to the
|
||||
location list.
|
||||
|
||||
|:tags| :tags Print tag list
|
||||
|CTRL-T| N CTRL-T Jump back from Nth older tag in tag list
|
||||
@@ -690,6 +692,7 @@ Short explanation of each option: *option-list*
|
||||
|'formatlistpat'| |'flp'| pattern used to recognize a list header
|
||||
|'formatoptions'| |'fo'| how automatic formatting is to be done
|
||||
|'formatprg'| |'fp'| name of external program used with "gq" command
|
||||
|'formatexpr'| |'fex'| expression used with "gq" command
|
||||
|'fsync'| |'fs'| whether to invoke fsync() after file write
|
||||
|'gdefault'| |'gd'| the ":substitute" flag 'g' is default on
|
||||
|'grepformat'| |'gfm'| format of 'grepprg' output
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*spell.txt* For Vim version 7.0aa. Last change: 2006 Jan 13
|
||||
*spell.txt* For Vim version 7.0aa. Last change: 2006 Feb 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -129,8 +129,10 @@ z= For the word under/after the cursor suggest correctly
|
||||
spelled words. This also works to find alternatives
|
||||
for a word that is not highlighted as a bad word,
|
||||
e.g., when the word after it is bad.
|
||||
The results are sorted on similarity to the word
|
||||
under/after the cursor.
|
||||
In Visual mode the highlighted text is taken as the
|
||||
word to be replaced.
|
||||
The results are sorted on similarity to the word being
|
||||
replaced.
|
||||
This may take a long time. Hit CTRL-C when you get
|
||||
bored.
|
||||
|
||||
@@ -259,6 +261,10 @@ Only the first file is loaded, the one that is first in 'runtimepath'. If
|
||||
this succeeds then additionally files with the name LL.EEE.add.spl are loaded.
|
||||
All the ones that are found are used.
|
||||
|
||||
If no spell file is found the |SpellFileMissing| autocommand event is
|
||||
triggered. This may trigger the |spellfile.vim| plugin to offer you
|
||||
downloading the spell file.
|
||||
|
||||
Additionally, the files related to the names in 'spellfile' are loaded. These
|
||||
are the files that |zg| and |zw| add good and wrong words to.
|
||||
|
||||
@@ -558,6 +564,48 @@ for the current region are included and no "/regions" line is generated.
|
||||
Comment lines with the name of the .spl file are used as a header above the
|
||||
words that were generated from that .spl file.
|
||||
|
||||
|
||||
SPELL FILE MISSING *spell-SpellFileMissing* *spellfile.vim*
|
||||
|
||||
If the spell file for the language you are using is not available, you will
|
||||
get an error message. But if the "spellfile.vim" plugin is active it will
|
||||
offer you to download the spell file. Just follow the instructions, it will
|
||||
ask you where to write the file.
|
||||
|
||||
The plugin has a default place where to look for spell files, on the Vim ftp
|
||||
server. If you want to use another location or another protocol, set the
|
||||
g:spellfile_URL variable to the directory that holds the spell files. The
|
||||
|netrw| plugin is used for getting the file, look there for the speficic
|
||||
syntax of the URL. Example: >
|
||||
let g:spellfile_URL = 'http://ftp.vim.org/vim/runtime/spell'
|
||||
You may need to escape special characters.
|
||||
|
||||
The plugin will only ask about downloading a language once. If you want to
|
||||
try again anyway restart Vim, or set g:spellfile_URL to another value (e.g.,
|
||||
prepend a space).
|
||||
|
||||
To avoid using the "spellfile.vim" plugin do this in your vimrc file: >
|
||||
|
||||
let loaded_spellfile_plugin = 1
|
||||
|
||||
Instead of using the plugin you can define a |SpellFileMissing| autocommand to
|
||||
handle the missing file yourself. You can use it like this: >
|
||||
|
||||
:au SpellFileMissing * call Download_spell_file(expand('<amatch>'))
|
||||
|
||||
Thus the <amatch> item contains the name of the language. Another important
|
||||
value is 'encoding', since every encoding has its own spell file. With two
|
||||
exceptions:
|
||||
- For ISO-8859-15 (latin9) the name "latin1" is used (the encodings only
|
||||
differ in characters not used in dictionary words).
|
||||
- The name "ascii" may also be used for some languages where the words use
|
||||
only ASCII letters for most of the words.
|
||||
|
||||
The default "spellfile.vim" plugin uses this autocommand, if you define your
|
||||
autocommand afterwars you may want to use ":au! SpellFileMissing" to overrule
|
||||
it. If you define your autocommand before the plugin is loaded it will notice
|
||||
this and not do anything.
|
||||
|
||||
==============================================================================
|
||||
4. Spell file format *spell-file-format*
|
||||
|
||||
@@ -995,16 +1043,11 @@ word to start with an upper case letter.
|
||||
WORDS WITH A SLASH *spell-SLASH*
|
||||
|
||||
The slash is used in the .dic file to separate the basic word from the affix
|
||||
letters that can be used. Unfortunately, this means you cannot use a slash in
|
||||
a word. Thus "TCP/IP" cannot be a word. To work around that you can define a
|
||||
replacement character for the slash. Example:
|
||||
|
||||
SLASH , ~
|
||||
|
||||
Now you can use "TCP,IP" to add the word "TCP/IP".
|
||||
|
||||
Of course, the letter used should itself not appear in any word! The letter
|
||||
must be ASCII, thus a single byte.
|
||||
letters and other flags. Unfortunately, this means you cannot use a slash in
|
||||
a word. Thus "TCP/IP" is not a word but "TCP with the flags "IP". To include
|
||||
a slash in the word put a backslash before it: "TCP\/IP". In the rare case
|
||||
you want to use a backslash inside a word you need to use two backslashes.
|
||||
Any other use of the backslash is reserved for future expansion.
|
||||
|
||||
|
||||
KEEP-CASE WORDS *spell-KEEPCASE*
|
||||
@@ -1319,13 +1362,17 @@ efficient if the first letter is ASCII or at least one without accents.
|
||||
.SUG FILE *spell-NOSUGFILE*
|
||||
|
||||
When soundfolding is specified in the affix file then ":mkspell" will normally
|
||||
p ~ ~roduce a .sug file next to the .spl file. This used to find suggestions by
|
||||
their sound-a-like form quickly. At the cost of a lot of memory.
|
||||
produce a .sug file next to the .spl file. This file is used to find
|
||||
suggestions by their sound-a-like form quickly. At the cost of a lot of
|
||||
memory (the amount depends on the number of words, |:mkspell| will display an
|
||||
estimate when it's done).
|
||||
|
||||
To avoid producing a .sug file use this item in the affix file:
|
||||
|
||||
NOSUGFILE ~
|
||||
|
||||
Users can simply omit the .sug file if they don't want to use it.
|
||||
|
||||
|
||||
SOUND-A-LIKE *spell-SAL*
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*starting.txt* For Vim version 7.0aa. Last change: 2006 Jan 19
|
||||
*starting.txt* For Vim version 7.0aa. Last change: 2006 Feb 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -372,6 +372,13 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
|
||||
-O[N] Open N windows, split vertically. Otherwise it's like -o.
|
||||
If both the -o and the -O option are given, the last one on
|
||||
the command line determines how the windows will be split.
|
||||
{not in Vi}
|
||||
|
||||
*-p*
|
||||
-p[N] Open N tab pages. If [N] is not given, one tab page is opened
|
||||
for every file given as argument. The maximum is 10 tab
|
||||
pages. If there are more tab pages than arguments, the last
|
||||
few tab pages will be editing an empty file.
|
||||
{not in Vi}
|
||||
|
||||
*-T*
|
||||
@@ -706,7 +713,8 @@ accordingly. Vim proceeds in this order:
|
||||
'shell' option. On MS-DOS and Win32, the COMSPEC variable is used
|
||||
if SHELL is not set.
|
||||
The environment variable TERM, if it exists, is used to set the 'term'
|
||||
option.
|
||||
option. However, 'term' will change later when starting the GUI (step
|
||||
8 below).
|
||||
|
||||
2. Process the arguments
|
||||
The options and file names from the command that start Vim are
|
||||
@@ -830,6 +838,8 @@ accordingly. Vim proceeds in this order:
|
||||
11. Open all windows
|
||||
When the |-o| flag was given, windows will be opened (but not
|
||||
displayed yet).
|
||||
When the |-p| flag was given, tab pages will be created (but not
|
||||
displayed yet).
|
||||
When switching screens, it happens now. Redrawing starts.
|
||||
If the "-q" flag was given to Vim, the first error is jumped to.
|
||||
Buffers for all windows will be loaded.
|
||||
@@ -1202,6 +1212,9 @@ An example mapping: >
|
||||
:nmap <F2> :wa<Bar>exe "mksession! " . v:this_session<CR>:so ~/sessions/
|
||||
This saves the current Session, and starts off the command to load another.
|
||||
|
||||
A session only includes the current tab page. There currently is no option to
|
||||
store all tab pages. |tab-page|
|
||||
|
||||
The |SessionLoadPost| autocmd event is triggered after a session file is
|
||||
loaded/sourced.
|
||||
*SessionLoad-variable*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 7.0aa. Last change: 2006 Jan 17
|
||||
*syntax.txt* For Vim version 7.0aa. Last change: 2006 Feb 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -3900,8 +3900,8 @@ guifg={color-name} *highlight-guifg*
|
||||
guibg={color-name} *highlight-guibg*
|
||||
guisp={color-name} *highlight-guisp*
|
||||
These give the foreground (guifg), background (guibg) and special
|
||||
(guisp) color to use in the GUI. "guisp" is used for underline and
|
||||
undercurl. There are a few special names:
|
||||
(guisp) color to use in the GUI. "guisp" is used for undercurl.
|
||||
There are a few special names:
|
||||
NONE no color (transparent)
|
||||
bg use normal background color
|
||||
background use normal background color
|
||||
@@ -4020,6 +4020,12 @@ StatusLine status line of current window
|
||||
StatusLineNC status lines of not-current windows
|
||||
Note: if this is equal to "StatusLine" Vim will use "^^^" in
|
||||
the status line of the current window.
|
||||
*hl-TabLine*
|
||||
TabLine tab pages line, not active tab page label
|
||||
*hl-TabLineFill*
|
||||
TabLineFill tab pages line, where there are no labels
|
||||
*hl-TabLineSel*
|
||||
TabLineSel tab pages line, active tab page label
|
||||
*hl-Title*
|
||||
Title titles for output from ":set all", ":autocmd" etc.
|
||||
*hl-Visual*
|
||||
@@ -4257,9 +4263,8 @@ But for using 16 colors in an rxvt these should work with terminfo: >
|
||||
<
|
||||
*colortest.vim*
|
||||
To test your color setup, a file has been included in the Vim distribution.
|
||||
To use it, execute these commands: >
|
||||
:e $VIMRUNTIME/syntax/colortest.vim
|
||||
:so %
|
||||
To use it, execute this command: >
|
||||
:runtime syntax/colortest.vim
|
||||
|
||||
Some versions of xterm (and other terminals, like the Linux console) can
|
||||
output lighter foreground colors, even though the number of colors is defined
|
||||
|
||||
244
runtime/doc/tabpage.txt
Normal file
244
runtime/doc/tabpage.txt
Normal file
@@ -0,0 +1,244 @@
|
||||
*tabpage.txt* For Vim version 7.0aa. Last change: 2006 Feb 23
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
Editing with windows in multiple tab pages. *tab-page* *tabpage*
|
||||
|
||||
The commands which have been added to use multiple tab pages are explained
|
||||
here. Additionally, there are explanations for commands that work differently
|
||||
when used in combination with more than one tab page.
|
||||
|
||||
1. Introduction |tab-page-intro|
|
||||
2. Commands |tab-page-commands|
|
||||
3. Other items |tab-page-other|
|
||||
4. Setting 'tabline' |setting-tabline|
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
{not able to use multiple tab pages when the |+windows| feature was disabled
|
||||
at compile time}
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *tab-page-intro*
|
||||
|
||||
A tab page holds one or more windows. You can easily switch between tab
|
||||
pages, so that you have several collections of windows to work on different
|
||||
things.
|
||||
|
||||
Usually you will see a list of labels at the top of the Vim window, one for
|
||||
each tab page. With the mouse you can click on the label to jump to that tab
|
||||
page. There are other ways to move between tab pages, see below.
|
||||
|
||||
Most commands work only in the current tab page. That includes the |CTRL-W|
|
||||
commands, |:windo|, |:all| and |:ball|. The commands that are aware of
|
||||
other tab pages than the current one are mentioned below.
|
||||
|
||||
Tabs are also a nice way to edit a buffer temporarily without changing the
|
||||
current window layout. Open a new tab page, do whatever you want to do and
|
||||
close the tab page.
|
||||
|
||||
==============================================================================
|
||||
2. Commands *tab-page-commands*
|
||||
|
||||
OPENING A NEW TAB PAGE:
|
||||
|
||||
When starting Vim "vim -p filename ..." opens each file argument in a separate
|
||||
tab page (up to 10). |-p|
|
||||
|
||||
A double click with the mouse in the tab pages line opens a new, empty tab
|
||||
page. It is placed left of the position of the click. The first click may
|
||||
select another tab page first, causing an extra screen update.
|
||||
|
||||
:tabe[dit] *:tabe* *:tabedit* *:tabnew*
|
||||
:tabnew Open a new tab page with an empty window, after the current
|
||||
tab page.
|
||||
|
||||
:tabe[dit] [++opt] [+cmd] {file}
|
||||
:tabnew [++opt] [+cmd] {file}
|
||||
Open a new tab page and edit {file}, like with |:edit|.
|
||||
|
||||
:tabf[ind] [++opt] [+cmd] {file} *:tabf* *:tabfind*
|
||||
Open a new tab page and edit {file} in 'path', like with
|
||||
|:find|.
|
||||
{not available when the |+file_in_path| feature was disabled
|
||||
at compile time}
|
||||
|
||||
:[count]tab {cmd} *:tab*
|
||||
Execute {cmd} and when it opens a new window open a new tab
|
||||
page instead. Doesn't work for |:diffsplit| or |:diffpatch|.
|
||||
When [count] is omitted the tab page appears after the current
|
||||
one. When [count] is specified the new tab page comes after
|
||||
tab page [count]. Use ":0tab cmd" to get the new tab page as
|
||||
the first one. Examples: >
|
||||
:tab split " opens current buffer in new tab page
|
||||
:tab help gt " opens tab page with help for "gt"
|
||||
|
||||
|
||||
CLOSING A TAB PAGE:
|
||||
|
||||
Closing the last window of a tab page closes the tab page too, unless there is
|
||||
only one tab page.
|
||||
|
||||
Using the mouse: If the tab page line is displayed you can click in the "X" at
|
||||
the top right to close the current tab page. A custom |'tabline'| may show
|
||||
something else.
|
||||
|
||||
*:tabc* *:tabclose*
|
||||
:tabc[lose][!] Close current tab page.
|
||||
This command fails when:
|
||||
- There is only one tab page on the screen. *E784*
|
||||
- When 'hidden' is not set, [!] is not used, a buffer has
|
||||
changes, and there is no other window on this buffer.
|
||||
Changes to the buffer are not written and won't get lost, so
|
||||
this is a "safe" command.
|
||||
|
||||
:tabc[lose][!] {count}
|
||||
Close tab page {count}. Fails in the same way as ':tabclose"
|
||||
above.
|
||||
|
||||
*:tabo* *:tabonly*
|
||||
:tabo[nly][!] Close all other tab pages.
|
||||
When the 'hidden' option is set, all buffers in closed windows
|
||||
become hidden.
|
||||
When 'hidden' is not set, and the 'autowrite' option is set,
|
||||
modified buffers are written. Otherwise, windows that have
|
||||
buffers that are modified are not removed, unless the [!] is
|
||||
given, then they become hidden. But modified buffers are
|
||||
never abandoned, so changes cannot get lost.
|
||||
|
||||
|
||||
SWITCHING TO ANOTHER TAB PAGE:
|
||||
|
||||
Using the mouse: If the tab page line is displayed you can click in a tab page
|
||||
label to switch to that tab page. Click where there is no label to go to the
|
||||
next tab page. |'tabline'|
|
||||
|
||||
:tabn[ext] *:tabn* *:tabnext* *gt*
|
||||
gt Go to the next tab page. Wraps around from the last to the
|
||||
first one.
|
||||
|
||||
:tabn[ext] {count}
|
||||
{count}gt Go to tab page {count}. The first tab page has number one.
|
||||
|
||||
|
||||
:tabp[revious] *:tabp* *:tabprevious* *gT*
|
||||
:tabN[ext] *:tabN* *:tabNext*
|
||||
gT Go to the previous tab page. Wraps around from the first one
|
||||
to the last one.
|
||||
|
||||
:tabp[revious] {count}
|
||||
:tabN[ext] {count}
|
||||
{count}gT Go {count} tab pages back. Wraps around from the first one
|
||||
to the last one.
|
||||
|
||||
|
||||
Other commands:
|
||||
*:tabs*
|
||||
:tabs List the tab pages and the windows they contain.
|
||||
Shows a ">" for the current window.
|
||||
Shows a "+" for modified buffers.
|
||||
|
||||
|
||||
REORDERING TAB PAGES:
|
||||
|
||||
*:tabm* *:tabmove*
|
||||
:tabmove N Move the current tab page to after tab page N. Use zero to
|
||||
make the current tab page the first one. Without N the tab
|
||||
page is made the last one.
|
||||
|
||||
==============================================================================
|
||||
3. Other items *tab-page-other*
|
||||
|
||||
Diff mode works per tab page. You can see the diffs between several files
|
||||
within one tab page. Other tab pages can show differences between other
|
||||
files.
|
||||
|
||||
The TabLeave and TabEnter autocommand events can be used to do something when
|
||||
switching from one tab page to another. The exact order depends on what you
|
||||
are doing. When creating a new tab page this works as if you create a new
|
||||
window on the same buffer and then edit another buffer. Thus ":tabnew"
|
||||
triggers:
|
||||
WinLeave leave current window
|
||||
TabLeave leave current tab page
|
||||
TabEnter enter new tab page
|
||||
WinEnter enter window in new tab page
|
||||
BufLeave leave current buffer
|
||||
BufEnter enter new empty buffer
|
||||
|
||||
When switching to another tab page the order is:
|
||||
BufLeave
|
||||
WinLeave
|
||||
TabLeave
|
||||
TabEnter
|
||||
WinEnter
|
||||
BufEnter
|
||||
|
||||
==============================================================================
|
||||
4. Setting 'tabline' *setting-tabline*
|
||||
|
||||
You can use the 'showtabline' option to specify when you want the line with
|
||||
tab page labels to appear: never, when there is more than one tab page or
|
||||
always.
|
||||
|
||||
The highlighting of the tab pages line is set with the groups TabLine
|
||||
TabLineSel and TabLineFill. |hl-TabLine| |hl-TabLineSel| |hl-TabLineFill|
|
||||
|
||||
The 'tabline' option allows you to define your preferred way to tab pages
|
||||
labels. This isn't easy, thus an example will be given here.
|
||||
|
||||
For basics see the 'statusline' option. The same items can be used in the
|
||||
'tabline' option. Additionally, the |tabpagebuflist()|, |tabpagenr()| and
|
||||
|tabpagewinnr()| functions are useful.
|
||||
|
||||
Since the number of tab labels will vary, you need to use an expresion for the
|
||||
whole option. Something like: >
|
||||
:set tabline=%!MyTabLine()
|
||||
|
||||
Then define the MyTabLine() function to list all the tab pages labels. A
|
||||
convenient method is to split it in two parts: First go over all the tab
|
||||
pages and define labels for them. Then get the label for each tab page. >
|
||||
|
||||
function MyTabLine()
|
||||
let s = ''
|
||||
for i in range(tabpagenr('$'))
|
||||
" select the highlighting
|
||||
if i + 1 == tabpagenr()
|
||||
let s .= '%#TabLineSel#'
|
||||
else
|
||||
let s .= '%#TabLine#'
|
||||
endif
|
||||
|
||||
" set the tab page number (for mouse clicks)
|
||||
let s .= '%' . (i + 1) . 'T'
|
||||
|
||||
" the label is made by MyTabLabel()
|
||||
let s .= ' %{MyTabLabel(' . (i + 1) . ')} '
|
||||
endfor
|
||||
|
||||
" after the last tab fill with TabLineFill and reset tab page nr
|
||||
let s .= '%#TabLineFill#%T'
|
||||
|
||||
" right-align the label to close the current tab page
|
||||
if tabpagenr('$') > 1
|
||||
let s .= '%=%#TabLine#%999Xclose'
|
||||
endif
|
||||
|
||||
return s
|
||||
endfunction
|
||||
|
||||
Now the MyTabLabel() function is called for each tab page to get its label. >
|
||||
|
||||
function MyTabLabel(n)
|
||||
let buflist = tabpagebuflist(a:n)
|
||||
let winnr = tabpagewinnr(a:n)
|
||||
return bufname(buflist[winnr - 1])
|
||||
endfunction
|
||||
|
||||
This is just a simplistic example that results in a tab pages line that
|
||||
resembles the default, but without adding a + for a modified buffer or
|
||||
trunctating the names. You will want to reduce the width of labels in a
|
||||
clever way when there is not enough room. Check the 'columns' option for the
|
||||
space available.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
152
runtime/doc/tags
152
runtime/doc/tags
@@ -202,6 +202,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
'fen' options.txt /*'fen'*
|
||||
'fenc' options.txt /*'fenc'*
|
||||
'fencs' options.txt /*'fencs'*
|
||||
'fex' options.txt /*'fex'*
|
||||
'ff' options.txt /*'ff'*
|
||||
'ffs' options.txt /*'ffs'*
|
||||
'fileencoding' options.txt /*'fileencoding'*
|
||||
@@ -231,6 +232,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
'foldnestmax' options.txt /*'foldnestmax'*
|
||||
'foldopen' options.txt /*'foldopen'*
|
||||
'foldtext' options.txt /*'foldtext'*
|
||||
'formatexpr' options.txt /*'formatexpr'*
|
||||
'formatlistpat' options.txt /*'formatlistpat'*
|
||||
'formatoptions' options.txt /*'formatoptions'*
|
||||
'formatprg' options.txt /*'formatprg'*
|
||||
@@ -716,6 +718,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
'showfulltag' options.txt /*'showfulltag'*
|
||||
'showmatch' options.txt /*'showmatch'*
|
||||
'showmode' options.txt /*'showmode'*
|
||||
'showtabline' options.txt /*'showtabline'*
|
||||
'shq' options.txt /*'shq'*
|
||||
'si' options.txt /*'si'*
|
||||
'sidescroll' options.txt /*'sidescroll'*
|
||||
@@ -756,6 +759,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
'ssop' options.txt /*'ssop'*
|
||||
'st' options.txt /*'st'*
|
||||
'sta' options.txt /*'sta'*
|
||||
'stal' options.txt /*'stal'*
|
||||
'startofline' options.txt /*'startofline'*
|
||||
'statusline' options.txt /*'statusline'*
|
||||
'stl' options.txt /*'stl'*
|
||||
@@ -890,6 +894,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
't_vs' term.txt /*'t_vs'*
|
||||
't_xs' term.txt /*'t_xs'*
|
||||
'ta' options.txt /*'ta'*
|
||||
'tabline' options.txt /*'tabline'*
|
||||
'tabstop' options.txt /*'tabstop'*
|
||||
'tag' options.txt /*'tag'*
|
||||
'tagbsearch' options.txt /*'tagbsearch'*
|
||||
@@ -897,6 +902,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
'tagrelative' options.txt /*'tagrelative'*
|
||||
'tags' options.txt /*'tags'*
|
||||
'tagstack' options.txt /*'tagstack'*
|
||||
'tal' options.txt /*'tal'*
|
||||
'tb' options.txt /*'tb'*
|
||||
'tbi' options.txt /*'tbi'*
|
||||
'tbidi' options.txt /*'tbidi'*
|
||||
@@ -1222,6 +1228,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
-n starting.txt /*-n*
|
||||
-nb starting.txt /*-nb*
|
||||
-o starting.txt /*-o*
|
||||
-p starting.txt /*-p*
|
||||
-q starting.txt /*-q*
|
||||
-qf starting.txt /*-qf*
|
||||
-r starting.txt /*-r*
|
||||
@@ -1264,15 +1271,19 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
/\$ pattern.txt /*\/\\$*
|
||||
/\%# pattern.txt /*\/\\%#*
|
||||
/\%$ pattern.txt /*\/\\%$*
|
||||
/\%'m pattern.txt /*\/\\%'m*
|
||||
/\%( pattern.txt /*\/\\%(*
|
||||
/\%(\) pattern.txt /*\/\\%(\\)*
|
||||
/\%<'m pattern.txt /*\/\\%<'m*
|
||||
/\%<c pattern.txt /*\/\\%<c*
|
||||
/\%<l pattern.txt /*\/\\%<l*
|
||||
/\%<v pattern.txt /*\/\\%<v*
|
||||
/\%>'m pattern.txt /*\/\\%>'m*
|
||||
/\%>c pattern.txt /*\/\\%>c*
|
||||
/\%>l pattern.txt /*\/\\%>l*
|
||||
/\%>v pattern.txt /*\/\\%>v*
|
||||
/\%U pattern.txt /*\/\\%U*
|
||||
/\%V pattern.txt /*\/\\%V*
|
||||
/\%[] pattern.txt /*\/\\%[]*
|
||||
/\%^ pattern.txt /*\/\\%^*
|
||||
/\%c pattern.txt /*\/\\%c*
|
||||
@@ -1784,6 +1795,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
:cabc map.txt /*:cabc*
|
||||
:cabclear map.txt /*:cabclear*
|
||||
:cad quickfix.txt /*:cad*
|
||||
:caddb quickfix.txt /*:caddb*
|
||||
:caddbuffer quickfix.txt /*:caddbuffer*
|
||||
:caddexpr quickfix.txt /*:caddexpr*
|
||||
:caddf quickfix.txt /*:caddf*
|
||||
:caddfile quickfix.txt /*:caddfile*
|
||||
@@ -2095,15 +2108,31 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
:keepjumps motion.txt /*:keepjumps*
|
||||
:keepmarks motion.txt /*:keepmarks*
|
||||
:l various.txt /*:l*
|
||||
:lN quickfix.txt /*:lN*
|
||||
:lNext quickfix.txt /*:lNext*
|
||||
:lNf quickfix.txt /*:lNf*
|
||||
:lNfile quickfix.txt /*:lNfile*
|
||||
:la editing.txt /*:la*
|
||||
:lad quickfix.txt /*:lad*
|
||||
:laddb quickfix.txt /*:laddb*
|
||||
:laddbuffer quickfix.txt /*:laddbuffer*
|
||||
:laddexpr quickfix.txt /*:laddexpr*
|
||||
:laddf quickfix.txt /*:laddf*
|
||||
:laddfile quickfix.txt /*:laddfile*
|
||||
:lan mlang.txt /*:lan*
|
||||
:lang mlang.txt /*:lang*
|
||||
:language mlang.txt /*:language*
|
||||
:last editing.txt /*:last*
|
||||
:lb quickfix.txt /*:lb*
|
||||
:lbuffer quickfix.txt /*:lbuffer*
|
||||
:lc editing.txt /*:lc*
|
||||
:lcd editing.txt /*:lcd*
|
||||
:lch editing.txt /*:lch*
|
||||
:lchdir editing.txt /*:lchdir*
|
||||
:lcl quickfix.txt /*:lcl*
|
||||
:lclose quickfix.txt /*:lclose*
|
||||
:lcs if_cscop.txt /*:lcs*
|
||||
:lcscope if_cscop.txt /*:lcscope*
|
||||
:le change.txt /*:le*
|
||||
:left change.txt /*:left*
|
||||
:lefta windows.txt /*:lefta*
|
||||
@@ -2119,13 +2148,40 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
:let-star eval.txt /*:let-star*
|
||||
:let-unpack eval.txt /*:let-unpack*
|
||||
:let.= eval.txt /*:let.=*
|
||||
:lex quickfix.txt /*:lex*
|
||||
:lexpr quickfix.txt /*:lexpr*
|
||||
:lf quickfix.txt /*:lf*
|
||||
:lfile quickfix.txt /*:lfile*
|
||||
:lfir quickfix.txt /*:lfir*
|
||||
:lfirst quickfix.txt /*:lfirst*
|
||||
:lg quickfix.txt /*:lg*
|
||||
:lgetfile quickfix.txt /*:lgetfile*
|
||||
:lgr quickfix.txt /*:lgr*
|
||||
:lgrep quickfix.txt /*:lgrep*
|
||||
:lgrepa quickfix.txt /*:lgrepa*
|
||||
:lgrepadd quickfix.txt /*:lgrepadd*
|
||||
:lh various.txt /*:lh*
|
||||
:lhelpgrep various.txt /*:lhelpgrep*
|
||||
:list various.txt /*:list*
|
||||
:ll quickfix.txt /*:ll*
|
||||
:lla quickfix.txt /*:lla*
|
||||
:llast quickfix.txt /*:llast*
|
||||
:lli quickfix.txt /*:lli*
|
||||
:llist quickfix.txt /*:llist*
|
||||
:lm map.txt /*:lm*
|
||||
:lmak quickfix.txt /*:lmak*
|
||||
:lmake quickfix.txt /*:lmake*
|
||||
:lmap map.txt /*:lmap*
|
||||
:lmap_l map.txt /*:lmap_l*
|
||||
:lmapc map.txt /*:lmapc*
|
||||
:lmapclear map.txt /*:lmapclear*
|
||||
:ln map.txt /*:ln*
|
||||
:lne quickfix.txt /*:lne*
|
||||
:lnew quickfix.txt /*:lnew*
|
||||
:lnewer quickfix.txt /*:lnewer*
|
||||
:lnext quickfix.txt /*:lnext*
|
||||
:lnf quickfix.txt /*:lnf*
|
||||
:lnfile quickfix.txt /*:lnfile*
|
||||
:lnoremap map.txt /*:lnoremap*
|
||||
:lo starting.txt /*:lo*
|
||||
:loadk mbyte.txt /*:loadk*
|
||||
@@ -2135,9 +2191,27 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
:lockmarks motion.txt /*:lockmarks*
|
||||
:lockv eval.txt /*:lockv*
|
||||
:lockvar eval.txt /*:lockvar*
|
||||
:lol quickfix.txt /*:lol*
|
||||
:lolder quickfix.txt /*:lolder*
|
||||
:lop quickfix.txt /*:lop*
|
||||
:lopen quickfix.txt /*:lopen*
|
||||
:lp quickfix.txt /*:lp*
|
||||
:lpf quickfix.txt /*:lpf*
|
||||
:lpfile quickfix.txt /*:lpfile*
|
||||
:lprevious quickfix.txt /*:lprevious*
|
||||
:lr quickfix.txt /*:lr*
|
||||
:lrewind quickfix.txt /*:lrewind*
|
||||
:ls windows.txt /*:ls*
|
||||
:lt tagsrch.txt /*:lt*
|
||||
:ltag tagsrch.txt /*:ltag*
|
||||
:lu map.txt /*:lu*
|
||||
:lunmap map.txt /*:lunmap*
|
||||
:lv quickfix.txt /*:lv*
|
||||
:lvimgrep quickfix.txt /*:lvimgrep*
|
||||
:lvimgrepa quickfix.txt /*:lvimgrepa*
|
||||
:lvimgrepadd quickfix.txt /*:lvimgrepadd*
|
||||
:lw quickfix.txt /*:lw*
|
||||
:lwindow quickfix.txt /*:lwindow*
|
||||
:m change.txt /*:m*
|
||||
:ma motion.txt /*:ma*
|
||||
:mak quickfix.txt /*:mak*
|
||||
@@ -2569,6 +2643,25 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
:tN tagsrch.txt /*:tN*
|
||||
:tNext tagsrch.txt /*:tNext*
|
||||
:ta tagsrch.txt /*:ta*
|
||||
:tab tabpage.txt /*:tab*
|
||||
:tabN tabpage.txt /*:tabN*
|
||||
:tabNext tabpage.txt /*:tabNext*
|
||||
:tabc tabpage.txt /*:tabc*
|
||||
:tabclose tabpage.txt /*:tabclose*
|
||||
:tabe tabpage.txt /*:tabe*
|
||||
:tabedit tabpage.txt /*:tabedit*
|
||||
:tabf tabpage.txt /*:tabf*
|
||||
:tabfind tabpage.txt /*:tabfind*
|
||||
:tabm tabpage.txt /*:tabm*
|
||||
:tabmove tabpage.txt /*:tabmove*
|
||||
:tabn tabpage.txt /*:tabn*
|
||||
:tabnew tabpage.txt /*:tabnew*
|
||||
:tabnext tabpage.txt /*:tabnext*
|
||||
:tabo tabpage.txt /*:tabo*
|
||||
:tabonly tabpage.txt /*:tabonly*
|
||||
:tabp tabpage.txt /*:tabp*
|
||||
:tabprevious tabpage.txt /*:tabprevious*
|
||||
:tabs tabpage.txt /*:tabs*
|
||||
:tag tagsrch.txt /*:tag*
|
||||
:tags tagsrch.txt /*:tags*
|
||||
:tc if_tcl.txt /*:tc*
|
||||
@@ -2992,6 +3085,7 @@ CTRL-W_CTRL-Z windows.txt /*CTRL-W_CTRL-Z*
|
||||
CTRL-W_CTRL-] windows.txt /*CTRL-W_CTRL-]*
|
||||
CTRL-W_CTRL-^ windows.txt /*CTRL-W_CTRL-^*
|
||||
CTRL-W_CTRL-_ windows.txt /*CTRL-W_CTRL-_*
|
||||
CTRL-W_F windows.txt /*CTRL-W_F*
|
||||
CTRL-W_H windows.txt /*CTRL-W_H*
|
||||
CTRL-W_J windows.txt /*CTRL-W_J*
|
||||
CTRL-W_K windows.txt /*CTRL-W_K*
|
||||
@@ -3049,7 +3143,10 @@ Contents quickref.txt /*Contents*
|
||||
Cscope if_cscop.txt /*Cscope*
|
||||
CursorHold autocmd.txt /*CursorHold*
|
||||
CursorHold-example windows.txt /*CursorHold-example*
|
||||
CursorHoldI autocmd.txt /*CursorHoldI*
|
||||
CursorIM mbyte.txt /*CursorIM*
|
||||
CursorMoved autocmd.txt /*CursorMoved*
|
||||
CursorMovedI autocmd.txt /*CursorMovedI*
|
||||
D change.txt /*D*
|
||||
DOS os_dos.txt /*DOS*
|
||||
DOS-format editing.txt /*DOS-format*
|
||||
@@ -3794,6 +3891,7 @@ E772 spell.txt /*E772*
|
||||
E773 recover.txt /*E773*
|
||||
E774 map.txt /*E774*
|
||||
E775 map.txt /*E775*
|
||||
E776 quickfix.txt /*E776*
|
||||
E777 quickfix.txt /*E777*
|
||||
E778 spell.txt /*E778*
|
||||
E779 spell.txt /*E779*
|
||||
@@ -3802,6 +3900,7 @@ E780 spell.txt /*E780*
|
||||
E781 spell.txt /*E781*
|
||||
E782 spell.txt /*E782*
|
||||
E783 spell.txt /*E783*
|
||||
E784 tabpage.txt /*E784*
|
||||
E79 message.txt /*E79*
|
||||
E80 message.txt /*E80*
|
||||
E800 arabic.txt /*E800*
|
||||
@@ -4003,6 +4102,7 @@ Select-mode-mapping visual.txt /*Select-mode-mapping*
|
||||
Session starting.txt /*Session*
|
||||
SessionLoad-variable starting.txt /*SessionLoad-variable*
|
||||
SessionLoadPost autocmd.txt /*SessionLoadPost*
|
||||
SpellFileMissing autocmd.txt /*SpellFileMissing*
|
||||
StdinReadPost autocmd.txt /*StdinReadPost*
|
||||
StdinReadPre autocmd.txt /*StdinReadPre*
|
||||
SwapExists autocmd.txt /*SwapExists*
|
||||
@@ -4012,6 +4112,8 @@ TCL if_tcl.txt /*TCL*
|
||||
TERM starting.txt /*TERM*
|
||||
TTpro-telnet syntax.txt /*TTpro-telnet*
|
||||
Tab intro.txt /*Tab*
|
||||
TabEnter autocmd.txt /*TabEnter*
|
||||
TabLeave autocmd.txt /*TabLeave*
|
||||
Tcl if_tcl.txt /*Tcl*
|
||||
TermChanged autocmd.txt /*TermChanged*
|
||||
TermResponse autocmd.txt /*TermResponse*
|
||||
@@ -4511,6 +4613,7 @@ compl-spelling insert.txt /*compl-spelling*
|
||||
compl-tag insert.txt /*compl-tag*
|
||||
compl-vim insert.txt /*compl-vim*
|
||||
compl-whole-line insert.txt /*compl-whole-line*
|
||||
complete-functions insert.txt /*complete-functions*
|
||||
complete_add() eval.txt /*complete_add()*
|
||||
complete_check() eval.txt /*complete_check()*
|
||||
complex-change change.txt /*complex-change*
|
||||
@@ -5045,6 +5148,7 @@ ft-htmlos-syntax syntax.txt /*ft-htmlos-syntax*
|
||||
ft-ia64-syntax syntax.txt /*ft-ia64-syntax*
|
||||
ft-inform-syntax syntax.txt /*ft-inform-syntax*
|
||||
ft-java-syntax syntax.txt /*ft-java-syntax*
|
||||
ft-javascript-omni insert.txt /*ft-javascript-omni*
|
||||
ft-ksh-syntax syntax.txt /*ft-ksh-syntax*
|
||||
ft-lace-syntax syntax.txt /*ft-lace-syntax*
|
||||
ft-lex-syntax syntax.txt /*ft-lex-syntax*
|
||||
@@ -5135,6 +5239,8 @@ g0 motion.txt /*g0*
|
||||
g8 various.txt /*g8*
|
||||
g:netrw_alto pi_netrw.txt /*g:netrw_alto*
|
||||
g:netrw_altv pi_netrw.txt /*g:netrw_altv*
|
||||
g:netrw_browse_split pi_netrw.txt /*g:netrw_browse_split*
|
||||
g:netrw_browsex_viewer pi_netrw.txt /*g:netrw_browsex_viewer*
|
||||
g:netrw_cygwin pi_netrw.txt /*g:netrw_cygwin*
|
||||
g:netrw_dav_cmd pi_netrw.txt /*g:netrw_dav_cmd*
|
||||
g:netrw_fetch_cmd pi_netrw.txt /*g:netrw_fetch_cmd*
|
||||
@@ -5187,12 +5293,14 @@ g?g? change.txt /*g?g?*
|
||||
g@ map.txt /*g@*
|
||||
gD pattern.txt /*gD*
|
||||
gE motion.txt /*gE*
|
||||
gF editing.txt /*gF*
|
||||
gH visual.txt /*gH*
|
||||
gI insert.txt /*gI*
|
||||
gJ change.txt /*gJ*
|
||||
gP change.txt /*gP*
|
||||
gQ intro.txt /*gQ*
|
||||
gR change.txt /*gR*
|
||||
gT tabpage.txt /*gT*
|
||||
gU change.txt /*gU*
|
||||
gUU change.txt /*gUU*
|
||||
gUgU change.txt /*gUgU*
|
||||
@@ -5225,6 +5333,7 @@ getfsize() eval.txt /*getfsize()*
|
||||
getftime() eval.txt /*getftime()*
|
||||
getftype() eval.txt /*getftype()*
|
||||
getline() eval.txt /*getline()*
|
||||
getloclist() eval.txt /*getloclist()*
|
||||
getqflist() eval.txt /*getqflist()*
|
||||
getreg() eval.txt /*getreg()*
|
||||
getregtype() eval.txt /*getregtype()*
|
||||
@@ -5261,6 +5370,7 @@ group-name syntax.txt /*group-name*
|
||||
gs various.txt /*gs*
|
||||
gsp.vim syntax.txt /*gsp.vim*
|
||||
gstar pattern.txt /*gstar*
|
||||
gt tabpage.txt /*gt*
|
||||
gtk-tooltip-colors gui_x11.txt /*gtk-tooltip-colors*
|
||||
gu change.txt /*gu*
|
||||
gugu change.txt /*gugu*
|
||||
@@ -5330,6 +5440,7 @@ gvimrc gui.txt /*gvimrc*
|
||||
gw change.txt /*gw*
|
||||
gwgw change.txt /*gwgw*
|
||||
gww change.txt /*gww*
|
||||
gx pi_netrw.txt /*gx*
|
||||
gzip pi_gzip.txt /*gzip*
|
||||
gzip-autocmd pi_gzip.txt /*gzip-autocmd*
|
||||
gzip-example autocmd.txt /*gzip-example*
|
||||
@@ -5420,6 +5531,9 @@ hl-SpellLocal syntax.txt /*hl-SpellLocal*
|
||||
hl-SpellRare syntax.txt /*hl-SpellRare*
|
||||
hl-StatusLine syntax.txt /*hl-StatusLine*
|
||||
hl-StatusLineNC syntax.txt /*hl-StatusLineNC*
|
||||
hl-TabLine syntax.txt /*hl-TabLine*
|
||||
hl-TabLineFill syntax.txt /*hl-TabLineFill*
|
||||
hl-TabLineSel syntax.txt /*hl-TabLineSel*
|
||||
hl-Title syntax.txt /*hl-Title*
|
||||
hl-Tooltip syntax.txt /*hl-Tooltip*
|
||||
hl-User1 syntax.txt /*hl-User1*
|
||||
@@ -5725,6 +5839,8 @@ local-variables eval.txt /*local-variables*
|
||||
locale mbyte.txt /*locale*
|
||||
locale-name mbyte.txt /*locale-name*
|
||||
localtime() eval.txt /*localtime()*
|
||||
location-list quickfix.txt /*location-list*
|
||||
location-list-window quickfix.txt /*location-list-window*
|
||||
long-lines version5.txt /*long-lines*
|
||||
lowercase change.txt /*lowercase*
|
||||
lpc.vim syntax.txt /*lpc.vim*
|
||||
@@ -5776,12 +5892,21 @@ mapcheck() eval.txt /*mapcheck()*
|
||||
maple.vim syntax.txt /*maple.vim*
|
||||
mapleader map.txt /*mapleader*
|
||||
maplocalleader map.txt /*maplocalleader*
|
||||
mapmode-c map.txt /*mapmode-c*
|
||||
mapmode-i map.txt /*mapmode-i*
|
||||
mapmode-ic map.txt /*mapmode-ic*
|
||||
mapmode-l map.txt /*mapmode-l*
|
||||
mapmode-n map.txt /*mapmode-n*
|
||||
mapmode-nvo map.txt /*mapmode-nvo*
|
||||
mapmode-o map.txt /*mapmode-o*
|
||||
mapmode-v map.txt /*mapmode-v*
|
||||
mapping map.txt /*mapping*
|
||||
mark motion.txt /*mark*
|
||||
mark-motions motion.txt /*mark-motions*
|
||||
masm.vim syntax.txt /*masm.vim*
|
||||
match() eval.txt /*match()*
|
||||
match-highlight pattern.txt /*match-highlight*
|
||||
match-parens tips.txt /*match-parens*
|
||||
matchend() eval.txt /*matchend()*
|
||||
matchit-install usr_05.txt /*matchit-install*
|
||||
matchlist() eval.txt /*matchlist()*
|
||||
@@ -5911,6 +6036,7 @@ netrw-D pi_netrw.txt /*netrw-D*
|
||||
netrw-NB pi_netrw.txt /*netrw-NB*
|
||||
netrw-Nb pi_netrw.txt /*netrw-Nb*
|
||||
netrw-O pi_netrw.txt /*netrw-O*
|
||||
netrw-P pi_netrw.txt /*netrw-P*
|
||||
netrw-R pi_netrw.txt /*netrw-R*
|
||||
netrw-S pi_netrw.txt /*netrw-S*
|
||||
netrw-U pi_netrw.txt /*netrw-U*
|
||||
@@ -5929,10 +6055,12 @@ netrw-chgup pi_netrw.txt /*netrw-chgup*
|
||||
netrw-contents pi_netrw.txt /*netrw-contents*
|
||||
netrw-cr pi_netrw.txt /*netrw-cr*
|
||||
netrw-credits pi_netrw.txt /*netrw-credits*
|
||||
netrw-ctrl-h pi_netrw.txt /*netrw-ctrl-h*
|
||||
netrw-ctrl-l pi_netrw.txt /*netrw-ctrl-l*
|
||||
netrw-curdir pi_netrw.txt /*netrw-curdir*
|
||||
netrw-d pi_netrw.txt /*netrw-d*
|
||||
netrw-debug pi_netrw.txt /*netrw-debug*
|
||||
netrw-del pi_netrw.txt /*netrw-del*
|
||||
netrw-delete pi_netrw.txt /*netrw-delete*
|
||||
netrw-dir pi_netrw.txt /*netrw-dir*
|
||||
netrw-dirlist pi_netrw.txt /*netrw-dirlist*
|
||||
@@ -5945,7 +6073,6 @@ netrw-externapp pi_netrw.txt /*netrw-externapp*
|
||||
netrw-file pi_netrw.txt /*netrw-file*
|
||||
netrw-fixup pi_netrw.txt /*netrw-fixup*
|
||||
netrw-ftp pi_netrw.txt /*netrw-ftp*
|
||||
netrw-h pi_netrw.txt /*netrw-h*
|
||||
netrw-handler pi_netrw.txt /*netrw-handler*
|
||||
netrw-help pi_netrw.txt /*netrw-help*
|
||||
netrw-hexplore pi_netrw.txt /*netrw-hexplore*
|
||||
@@ -5976,6 +6103,7 @@ netrw-pexplore pi_netrw.txt /*netrw-pexplore*
|
||||
netrw-preview pi_netrw.txt /*netrw-preview*
|
||||
netrw-problems pi_netrw.txt /*netrw-problems*
|
||||
netrw-protocol pi_netrw.txt /*netrw-protocol*
|
||||
netrw-prvwin pi_netrw.txt /*netrw-prvwin*
|
||||
netrw-q pi_netrw.txt /*netrw-q*
|
||||
netrw-r pi_netrw.txt /*netrw-r*
|
||||
netrw-read pi_netrw.txt /*netrw-read*
|
||||
@@ -5988,6 +6116,7 @@ netrw-sexplore pi_netrw.txt /*netrw-sexplore*
|
||||
netrw-sort pi_netrw.txt /*netrw-sort*
|
||||
netrw-sortsequence pi_netrw.txt /*netrw-sortsequence*
|
||||
netrw-starstar pi_netrw.txt /*netrw-starstar*
|
||||
netrw-start pi_netrw.txt /*netrw-start*
|
||||
netrw-transparent pi_netrw.txt /*netrw-transparent*
|
||||
netrw-u pi_netrw.txt /*netrw-u*
|
||||
netrw-uidpass pi_netrw.txt /*netrw-uidpass*
|
||||
@@ -6001,6 +6130,7 @@ netrw-write pi_netrw.txt /*netrw-write*
|
||||
netrw-x pi_netrw.txt /*netrw-x*
|
||||
netrw-xfer pi_netrw.txt /*netrw-xfer*
|
||||
netrw.vim pi_netrw.txt /*netrw.vim*
|
||||
netrw_filehandler pi_netrw.txt /*netrw_filehandler*
|
||||
netterm-mouse options.txt /*netterm-mouse*
|
||||
network pi_netrw.txt /*network*
|
||||
new-5 version5.txt /*new-5*
|
||||
@@ -6038,6 +6168,7 @@ new-indent-flex version6.txt /*new-indent-flex*
|
||||
new-items-6 version6.txt /*new-items-6*
|
||||
new-items-7 version7.txt /*new-items-7*
|
||||
new-line-continuation version5.txt /*new-line-continuation*
|
||||
new-location-list version7.txt /*new-location-list*
|
||||
new-manpage-trans version7.txt /*new-manpage-trans*
|
||||
new-multi-byte version5.txt /*new-multi-byte*
|
||||
new-multi-lang version6.txt /*new-multi-lang*
|
||||
@@ -6218,6 +6349,7 @@ progname-variable eval.txt /*progname-variable*
|
||||
progress.vim syntax.txt /*progress.vim*
|
||||
ptcap.vim syntax.txt /*ptcap.vim*
|
||||
pterm-mouse options.txt /*pterm-mouse*
|
||||
pumvisible() eval.txt /*pumvisible()*
|
||||
put change.txt /*put*
|
||||
put-Visual-mode change.txt /*put-Visual-mode*
|
||||
python if_pyth.txt /*python*
|
||||
@@ -6438,6 +6570,8 @@ search-range pattern.txt /*search-range*
|
||||
search-replace change.txt /*search-replace*
|
||||
searchdecl() eval.txt /*searchdecl()*
|
||||
searchpair() eval.txt /*searchpair()*
|
||||
searchpairpos() eval.txt /*searchpairpos()*
|
||||
searchpos() eval.txt /*searchpos()*
|
||||
section motion.txt /*section*
|
||||
sed.vim syntax.txt /*sed.vim*
|
||||
self eval.txt /*self*
|
||||
@@ -6454,9 +6588,11 @@ set-spc-auto spell.txt /*set-spc-auto*
|
||||
setbufvar() eval.txt /*setbufvar()*
|
||||
setcmdpos() eval.txt /*setcmdpos()*
|
||||
setline() eval.txt /*setline()*
|
||||
setloclist() eval.txt /*setloclist()*
|
||||
setqflist() eval.txt /*setqflist()*
|
||||
setreg() eval.txt /*setreg()*
|
||||
setting-guifont gui.txt /*setting-guifont*
|
||||
setting-tabline tabpage.txt /*setting-tabline*
|
||||
setwinvar() eval.txt /*setwinvar()*
|
||||
sftp pi_netrw.txt /*sftp*
|
||||
sgml.vim syntax.txt /*sgml.vim*
|
||||
@@ -6553,6 +6689,7 @@ spell-SOFOTO spell.txt /*spell-SOFOTO*
|
||||
spell-SUGSWITHDOTS spell.txt /*spell-SUGSWITHDOTS*
|
||||
spell-SYLLABLE spell.txt /*spell-SYLLABLE*
|
||||
spell-SYLLABLENUM spell.txt /*spell-SYLLABLENUM*
|
||||
spell-SpellFileMissing spell.txt /*spell-SpellFileMissing*
|
||||
spell-TRY spell.txt /*spell-TRY*
|
||||
spell-UPP spell.txt /*spell-UPP*
|
||||
spell-VERSION spell.txt /*spell-VERSION*
|
||||
@@ -6583,6 +6720,7 @@ spell-wordlist-format spell.txt /*spell-wordlist-format*
|
||||
spell-yiddish spell.txt /*spell-yiddish*
|
||||
spell.txt spell.txt /*spell.txt*
|
||||
spellbadword() eval.txt /*spellbadword()*
|
||||
spellfile.vim spell.txt /*spellfile.vim*
|
||||
spellsuggest() eval.txt /*spellsuggest()*
|
||||
split() eval.txt /*split()*
|
||||
splitfind windows.txt /*splitfind*
|
||||
@@ -6825,6 +6963,15 @@ t_vi term.txt /*t_vi*
|
||||
t_vs term.txt /*t_vs*
|
||||
t_xs term.txt /*t_xs*
|
||||
tab intro.txt /*tab*
|
||||
tab-page tabpage.txt /*tab-page*
|
||||
tab-page-commands tabpage.txt /*tab-page-commands*
|
||||
tab-page-intro tabpage.txt /*tab-page-intro*
|
||||
tab-page-other tabpage.txt /*tab-page-other*
|
||||
tabpage tabpage.txt /*tabpage*
|
||||
tabpage.txt tabpage.txt /*tabpage.txt*
|
||||
tabpagebuflist() eval.txt /*tabpagebuflist()*
|
||||
tabpagenr() eval.txt /*tabpagenr()*
|
||||
tabpagewinnr() eval.txt /*tabpagewinnr()*
|
||||
tag tagsrch.txt /*tag*
|
||||
tag-! tagsrch.txt /*tag-!*
|
||||
tag-any-white tagsrch.txt /*tag-any-white*
|
||||
@@ -6836,6 +6983,7 @@ tag-highlight syntax.txt /*tag-highlight*
|
||||
tag-matchlist tagsrch.txt /*tag-matchlist*
|
||||
tag-old-static tagsrch.txt /*tag-old-static*
|
||||
tag-overloaded version5.txt /*tag-overloaded*
|
||||
tag-preview tagsrch.txt /*tag-preview*
|
||||
tag-priority tagsrch.txt /*tag-priority*
|
||||
tag-regexp tagsrch.txt /*tag-regexp*
|
||||
tag-search tagsrch.txt /*tag-search*
|
||||
@@ -6916,6 +7064,7 @@ termcap-changed version4.txt /*termcap-changed*
|
||||
termcap-colors term.txt /*termcap-colors*
|
||||
termcap-cursor-color term.txt /*termcap-cursor-color*
|
||||
termcap-cursor-shape term.txt /*termcap-cursor-shape*
|
||||
termcap-options term.txt /*termcap-options*
|
||||
termcap-title term.txt /*termcap-title*
|
||||
terminal-colors os_unix.txt /*terminal-colors*
|
||||
terminal-info term.txt /*terminal-info*
|
||||
@@ -7144,6 +7293,7 @@ v_b_r_example visual.txt /*v_b_r_example*
|
||||
v_c change.txt /*v_c*
|
||||
v_d change.txt /*v_d*
|
||||
v_g? change.txt /*v_g?*
|
||||
v_gF editing.txt /*v_gF*
|
||||
v_gJ change.txt /*v_gJ*
|
||||
v_gV visual.txt /*v_gV*
|
||||
v_g] tagsrch.txt /*v_g]*
|
||||
|
||||
@@ -257,6 +257,17 @@ g CTRL-] Like CTRL-], but use ":tjump" instead of ":tag".
|
||||
:tl[ast][!] Jump to last matching tag. See |tag-!| for [!]. {not
|
||||
in Vi}
|
||||
|
||||
*:lt* *:ltag*
|
||||
:lt[ag][!] [ident] Jump to tag [ident] and add the matching tags to a new
|
||||
location list for the current window. [ident] can be
|
||||
a regexp pattern, see |tag-regexp|. When [ident] is
|
||||
not given, the last tag name from the tag stack is
|
||||
used. The search pattern to locate the tag line is
|
||||
prefixed with "\V" to escape all the special
|
||||
characters (very nomagic). The location list showing
|
||||
the matching tags is independent of the tag stack.
|
||||
See |tag-!| for [!].
|
||||
{not in Vi}
|
||||
|
||||
When there is no other message, Vim shows which matching tag has been jumped
|
||||
to, and the number of matching tags: >
|
||||
@@ -275,6 +286,7 @@ skipped and the next matching tag is used. Vim reports this, to notify you of
|
||||
missing files. When the end of the list of matches has been reached, an error
|
||||
message is given.
|
||||
|
||||
*tag-preview*
|
||||
The tag match list can also be used in the preview window. The commands are
|
||||
the same as above, with a "p" prepended.
|
||||
{not available when compiled without the |+quickfix| feature}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*term.txt* For Vim version 7.0aa. Last change: 2005 Dec 14
|
||||
*term.txt* For Vim version 7.0aa. Last change: 2006 Feb 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -208,7 +208,7 @@ starts with CSI, it assumes that the terminal is in 8-bit mode and will
|
||||
convert all key sequences to their 8-bit variants.
|
||||
|
||||
==============================================================================
|
||||
2. Terminal options *terminal-options* *E436*
|
||||
2. Terminal options *terminal-options* *termcap-options* *E436*
|
||||
|
||||
The terminal options can be set just like normal options. But they are not
|
||||
shown with the ":set all" command. Instead use ":set termcap".
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*tips.txt* For Vim version 7.0aa. Last change: 2005 Apr 19
|
||||
*tips.txt* For Vim version 7.0aa. Last change: 2006 Feb 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -24,6 +24,7 @@ Compressing the help files |gzip-helpfile|
|
||||
Hex editing |hex-editing|
|
||||
Executing shell commands in a window |shell-window|
|
||||
Using <> notation in autocommands |autocmd-<>|
|
||||
Highlighting matching parens |match-parens|
|
||||
|
||||
==============================================================================
|
||||
Editing C programs *C-editing*
|
||||
@@ -443,4 +444,63 @@ forget to double the number of existing backslashes and put a backslash before
|
||||
For a real buffer menu, user functions should be used (see |:function|), but
|
||||
then the <> notation isn't used, which defeats using it as an example here.
|
||||
|
||||
==============================================================================
|
||||
Highlighting matching parens *match-parens*
|
||||
|
||||
This example shows the use of a few advanced tricks:
|
||||
- using the |CursorMoved| autocommand event
|
||||
- using |searchpairpos()| to find a matching paren
|
||||
- using |synID()| to detect whether the cursor is in a string or comment
|
||||
- using |:match| to highlight something
|
||||
- using a |pattern| to match a specific position in the file.
|
||||
|
||||
This should be put in a Vim script file, since it uses script-local variables.
|
||||
It skips matches in strings or comments, unless the cursor started in string
|
||||
or comment. This requires syntax highlighting.
|
||||
>
|
||||
let s:paren_hl_on = 0
|
||||
function s:Highlight_Matching_Paren()
|
||||
if s:paren_hl_on
|
||||
match none
|
||||
let s:paren_hl_on = 0
|
||||
endif
|
||||
|
||||
let c_lnum = line('.')
|
||||
let c_col = col('.')
|
||||
|
||||
let c = getline(c_lnum)[c_col - 1]
|
||||
let plist = split(&matchpairs, ':\|,')
|
||||
let i = index(plist, c)
|
||||
if i < 0
|
||||
return
|
||||
endif
|
||||
if i % 2 == 0
|
||||
let s_flags = 'nW'
|
||||
let c2 = plist[i + 1]
|
||||
else
|
||||
let s_flags = 'nbW'
|
||||
let c2 = c
|
||||
let c = plist[i - 1]
|
||||
endif
|
||||
if c == '['
|
||||
let c = '\['
|
||||
let c2 = '\]'
|
||||
endif
|
||||
let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' .
|
||||
\ '=~? "string\\|comment"'
|
||||
execute 'if' s_skip '| let s_skip = 0 | endif'
|
||||
|
||||
let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip)
|
||||
|
||||
if m_lnum > 0 && m_lnum >= line('w0') && m_lnum <= line('w$')
|
||||
exe 'match Search /\(\%' . c_lnum . 'l\%' . c_col .
|
||||
\ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/'
|
||||
let s:paren_hl_on = 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
autocmd CursorMoved,CursorMovedI * call s:Highlight_Matching_Paren()
|
||||
autocmd InsertEnter * match none
|
||||
<
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 7.0aa. Last change: 2006 Jan 20
|
||||
*todo.txt* For Vim version 7.0aa. Last change: 2006 Feb 23
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -30,38 +30,59 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
ccomplete:
|
||||
- When using page-up/page-down in menu it sometimes jumps more than a page.
|
||||
- When an option is set: In completion mode and the user types (identifier)
|
||||
characters, advance to the first match instead of removing the popup menu.
|
||||
If there is no match remove the selection. (Yegappan Lakshmanan)
|
||||
- Complete the longest common match instead of the first match?
|
||||
For all kinds of completions? Configurable?
|
||||
- Window resize when poup is displayed.
|
||||
- When completing something that is a structure, add the "." or "->" right
|
||||
away. How to figure out if it's a pointer or not?
|
||||
- When a typedef or struct is local to a file only use it in that file?
|
||||
- Extra info for each entry to show in a tooltip kind of thing.
|
||||
Should use a dictionary for each entry. Fields could be:
|
||||
word the completed word
|
||||
menu menu text (use word when missing)
|
||||
info extra info, to be displayed in balloon (e.g., function args)
|
||||
kind single letter indicating the type of word:
|
||||
v = variable, f = function/method, c = composite (object,
|
||||
struct pointer).
|
||||
- Special mappings for when the popup menu is visible? Would allow for making
|
||||
a specific selection (e.g, methods vs variables).
|
||||
- Provide a function to popup the menu, so that an insert mode mapping can
|
||||
start it (with a specific selection).
|
||||
- !_TAG_FILE_FORMAT and it's ilk are listed in the global completions
|
||||
Can't reproduce it right now...
|
||||
:tablast
|
||||
:tabfirst
|
||||
Also support:
|
||||
:tabdup split the tab with all its windows.
|
||||
:tab ball tab page for each buffer
|
||||
:tab all tab page for each argument
|
||||
:tabdo cmd ":tabdo windo cmd" should also work
|
||||
|
||||
In GUI: right click can popup a menu to close a specific tab.
|
||||
Option to put tab line at the left or right? Need an option to specify its
|
||||
witdh. It's like a separate window with ":tabs" output.
|
||||
|
||||
Add an argument to search functions to stop at a certain line number.
|
||||
search('{', 'b', line('w0'))
|
||||
search('{', '', line('w$'))
|
||||
Also start at a specified position?
|
||||
|
||||
undo could remember the '< and '> marks.
|
||||
|
||||
Support WINDOW TABS. Works like several pages, each with their own split
|
||||
windows. Let's call them "tab pages".
|
||||
- line at top of frame with tabs.
|
||||
Add 'tabtext' option, like 'statusline'.
|
||||
- Need to be able to search the windows in inactive tabs, e.g. for the
|
||||
quickfix window?
|
||||
- docs:
|
||||
Add info to the user manual somewhere.
|
||||
|
||||
Crash with X command server (Ciaran McCreesh).
|
||||
|
||||
Make virtcol([lnum, col]) work?
|
||||
|
||||
"dip" in end empty lines at end of file leaves one line. (Matt Mzyzik)
|
||||
|
||||
Ctags still hasn't included the patch. Darren is looking for someone to do
|
||||
maintanance.
|
||||
|
||||
Script ID is only remembered for global options. Should remember it for every
|
||||
local option separately.
|
||||
|
||||
"fsutil hardlink" can create a hard link on an NTFS file system. (Daniel
|
||||
Einspanjer) What library function can detect that?
|
||||
|
||||
Win32: use GetFileInformationByHandle() to detect hard links on NTFS?
|
||||
(George Reilly)
|
||||
|
||||
spelling:
|
||||
- Also use the spelling dictionary for dictionary completion.
|
||||
When 'dictionary' is empty and/or when "kspell" is in 'complete'.
|
||||
- Use runtime/cleanadd script to cleanup .add files. When to invoke it?
|
||||
After deleting a word and some timestamp difference perhaps?
|
||||
After deleting a word with "zw" and some timestamp difference perhaps?
|
||||
Store it as spell/cleanadd.vim.
|
||||
- suggestion for "KG" to "kg" when it's keepcase.
|
||||
- Autocommand event for when a spell file is missing. Allows making a plugin
|
||||
that fetches the file over internet. Pattern == language.
|
||||
- Using KEEPCASE flag still allows all-upper word, docs say it doesn't.
|
||||
Don't allow it, because there is no other way to do this.
|
||||
- Implement NOSUGGEST flag (used for obscene words).
|
||||
@@ -71,7 +92,6 @@ spelling:
|
||||
- Check out Hunspell 1.1.3.
|
||||
what does MAXNGRAMSUGS do?
|
||||
See announcement (Nemeth, 5 jan)
|
||||
use "\/" instead of SLASH item?
|
||||
is COMPLEXPREFIXES necessary now that we have flags for affixes?
|
||||
- Look into hungarian dictionary:
|
||||
http://magyarispell.sourceforge.net/hu_HU-1.0.tar.gz
|
||||
@@ -93,41 +113,23 @@ spelling:
|
||||
obtain). But new Myspell wordlist will come (Hagen)
|
||||
- Finding suggestions with sound folding is slow. Somehow store the
|
||||
sound-folded words and link to the words it comes from?
|
||||
- Also use the spelling dictionary for dictionary completion.
|
||||
- Have "zg" and "zw" report the file that was modified. (Marvin Renich)
|
||||
- Add a command like "zg" that selects one of the files 'spellfile'.
|
||||
- Add a "zug" command that undoes "zg"? Deletes the good word instead of
|
||||
adding a bad word like "zw" would. Use "zuw" to undo "zw"? (Antonio
|
||||
Colombo)
|
||||
|
||||
GTK: get an X error while exiting quickly after starting (running the tests).
|
||||
Caused by new GTK library?
|
||||
X Error: BadWindow (invalid Window parameter) 3
|
||||
An error in a function uses a line number that doesn't take line continuation
|
||||
into account. (Mikolaj Machowski) Store line count in an extra array?
|
||||
|
||||
Support saving and restoring session for X windows? It should work to do
|
||||
":mksession" and use "-S fname" for the restart command. The
|
||||
gui_x11_wm_protocol_handler() already takes care of the rest.
|
||||
global_event_filter() for GTK.
|
||||
Is it possible to keep the command-line window open? Would actually work like
|
||||
closing it, executing the command and re-opening it (at the same position).
|
||||
|
||||
Is it easy to have an item in a pattern that matches with a mark location?
|
||||
Similar to |/\%>l| and |/\%c|. (Benji Fisher)
|
||||
|
||||
Win32 installer: Default _vimrc contains absolute path to diff.exe. After
|
||||
upgrading it becomes invalid. Fix it automatically somehow? Use $VIMRUNTIME
|
||||
in the path instead of filling it the path? At least give a clear error
|
||||
message.
|
||||
|
||||
In diff mode deleting lines is very slow. E.g., when diffing two .po files
|
||||
and then sourcing po/cleaup.vim.
|
||||
|
||||
7 Add plugins for formatting. Should be able to make a choice depending on
|
||||
the language of a file (English/Korean/Japanese/etc.).
|
||||
Setting the 'langformat' option to "chinese" would load the
|
||||
"format/chinese.vim" plugin.
|
||||
Edward L. Fox explains how it should be done for most Asian languages. (2005
|
||||
Nov 24)
|
||||
":keepundo": add change to existing undo chain, so that one "u" undoes them
|
||||
all. (Gautam Iyer)
|
||||
|
||||
Mac unicode patch (Da Woon Jung):
|
||||
- configuration option for platform: i386, ppc or both.
|
||||
- selecting proportional font breaks display
|
||||
- UTF-8 text causes display problems. Font replacement causes this.
|
||||
- Command-key mappings do not work. (Alan Schmitt)
|
||||
@@ -137,10 +139,9 @@ Mac unicode patch (Da Woon Jung):
|
||||
(Alan Schmitt)
|
||||
|
||||
Patch to add a few flags to search(). (Benji Fisher, Nov 29, doc update Dec 1)
|
||||
Also add search???() function that returns list with lnum and col.
|
||||
|
||||
Win32: Use the free downloadable compiler 7.1. Figure out how to do debugging
|
||||
(with Agide?) and describe it. (George Reilly)
|
||||
Win32: Use the free downloadable compiler 7.1 (2003). Figure out how to do
|
||||
debugging (with Agide?) and describe it. (George Reilly)
|
||||
Try out using the free MS compiler and debugger, using Make_mvc.mak.
|
||||
Try using Visual C++ Express 2005. (Ilya Bobir Dec 20)
|
||||
Disadvantage: Annoying warning messages, requires ..._NO_DEPRECATE, this
|
||||
@@ -149,9 +150,6 @@ Try using Visual C++ Express 2005. (Ilya Bobir Dec 20)
|
||||
Win32: Check that installer puts menu items in "all users" dir when possible,
|
||||
not administrator dir.
|
||||
|
||||
CTRL-X CTRL-L only completes from loaded buffers. Make it work for unloaded
|
||||
buffers too?
|
||||
|
||||
Autoload:
|
||||
- Add a Vim script in $VIMRUNTIME/tools that takes a file with a list of
|
||||
script names and a help file and produces a script that can be sourced to
|
||||
@@ -180,50 +178,32 @@ Awaiting response:
|
||||
- mblen(NULL, 0) also in Vim 6.3?
|
||||
|
||||
|
||||
PLANNED FOR VERSION 7.0:
|
||||
CONSIDERED FOR VERSION 7.0:
|
||||
|
||||
- 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 '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.
|
||||
Omni completion:
|
||||
ccomplete:
|
||||
- Finding out if an item has members (to add '.' or '->') requires a grep
|
||||
in the tags files, that is very slow. Is there another solution? At
|
||||
least stop at the first match.
|
||||
Could build the list of items for each structure in memory. Is that
|
||||
faster? Not using too much memory?
|
||||
- For C add tag "kind" field to each match?
|
||||
- Flickering because of syntax highlighting redrawing further lines.
|
||||
- When a typedef or struct is local to a file only use it in that file?
|
||||
|
||||
UI:
|
||||
- Complete longest common string first, like 'wildmode' "longest:full".
|
||||
- Add an "auto" mode: after typing a character (or string) completion is
|
||||
done for the longest common string. plugin defines the possible
|
||||
characters/strings. (Martin Stubenschrott)
|
||||
And/or: Provide a function to popup the menu, so that an insert mode
|
||||
mapping can start it (with a specific selection).
|
||||
- GUI implementation of the popup menu.
|
||||
- When using tags, show match in preview window (function prototype,
|
||||
struct member, etc.).
|
||||
- Show "info" from a match in preview window.
|
||||
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.
|
||||
|
||||
In function arguments suggest variables of expected type.
|
||||
Tags file has "signature" field.
|
||||
|
||||
List of completions is a Dictionary with items:
|
||||
complist[0]['text'] = completion text
|
||||
complist[0]['type'] = type of completion (e.g. function, var, arg)
|
||||
complist[0]['help'] = help text (e.g. function declaration)
|
||||
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
|
||||
@@ -236,10 +216,6 @@ PLANNED FOR VERSION 7.0:
|
||||
Uses ctags to find the info:
|
||||
ctags -f $allTagsFile --fields=+aiKmnsSz --language-force=C++ --C++-kinds=+cefgmnpsut-dlux -u $files
|
||||
|
||||
UI: popup menu with list of alternatives, icon to indicate type
|
||||
optional popup window with info about selected alternative
|
||||
Unrelated settings are changed (e.g. 'mousemodel').
|
||||
|
||||
www.vim.org script 1213 (Java Development Environment) (Fuchuan Wang)
|
||||
IComplete: http://www.vim.org/scripts/script.php?script_id=1265
|
||||
and http://stud4.tuwien.ac.at/~e0125672/icomplete/
|
||||
@@ -247,16 +223,12 @@ PLANNED FOR VERSION 7.0:
|
||||
Ivan Villanueva has something for Java.
|
||||
Emads: http://www.xref-tech.com/xrefactory/more_c_completion.html
|
||||
Ideas from the Vim 7 BOF at SANE:
|
||||
- It's not possible to have one solution for all languages. Design an
|
||||
interface for completion plugins. The matches can be done in a
|
||||
Vim-script list.
|
||||
- For interpreted languages, use the interpreter to obtain information.
|
||||
Should work for Java (Eclipse does this), Python, Tcl, etc.
|
||||
Richard Emberson mentioned working on an interface to Java.
|
||||
- Check Readline for its completion interface.
|
||||
- Use ctags for other languages. Writing a file could trigger running
|
||||
ctags, merging the tags of the changed file.
|
||||
"Visual Assist" http://www.wholetomato.com/products:
|
||||
Completion in .NET framework SharpDevelop: http://www.icsharpcode.net
|
||||
|
||||
- Pre-expand abbreviations, show which abbrevs would match?
|
||||
@@ -281,22 +253,6 @@ PLANNED FOR VERSION 7.0:
|
||||
before some time/date can be flushed. 'undopersist' gives maximum time to
|
||||
keep undo: "3h", "1d", "2w", "1y", etc. For the file use dot and
|
||||
extension: ".filename.un~" (like swapfile but "un~" instead of "swp").
|
||||
7 Support WINDOW TABS. Works like several pages, each with their own
|
||||
split windows.
|
||||
In Emacs these are called frames. Could also call them "pages".
|
||||
Use the name of the first buffer in the tab (ignoring the help window,
|
||||
unless it's the only one). Add a number for the window count.
|
||||
First make it work on the console. Use a line of text with highlighting.
|
||||
Then add GUI Tabs for some systems.
|
||||
Patch for GTK 1.2 passed on by Christian Michon, 2004 Jan 6.
|
||||
Simple patch for GTK by Luis M (nov 7).
|
||||
Don't forget to provide an "X" to close a tab.
|
||||
Implementation: keep the list of windows as-is. When switching to another
|
||||
tab make the buffers in the current windows hidden, save the window
|
||||
layout, buildup the other window layout and fill with buffers.
|
||||
Need to be able to search the windows in inactive tabs, e.g. for the
|
||||
quickfix window.
|
||||
Use "1gt" - "99gt" to switch to a tab?
|
||||
- EMBEDDING: Make it possible to run Vim inside a window of another program.
|
||||
For Xwindows this can be done with XReparentWindow().
|
||||
For GTK Neil Bird has a patch to use Vim like a widget.
|
||||
@@ -417,26 +373,6 @@ Also place vimtutor.bat in %windir%?
|
||||
|
||||
Add gui_mch_browsedir() for Motif, Mac OS/X.
|
||||
|
||||
Add extra list of file locations. A bit like the quickfix list, but there is
|
||||
one per window. Can be used with:
|
||||
:ltag list of matching tags, like :tselect
|
||||
Patch from Yegappan Lakshmanan, Jan 13.
|
||||
Commands to use the location list:
|
||||
:lnext next location
|
||||
:lprevious :lNext previous location
|
||||
:lnfile location in next file
|
||||
:lNfile :lpfile location in previous file
|
||||
:lrewind :lfirst first location
|
||||
:llast last location
|
||||
:ll [N] go to location N (current one if N omitted)
|
||||
:lwindow open window with locations (separate from quickfix window)
|
||||
:lopen open window with locations
|
||||
:lclose close window with locations
|
||||
:llist list locations
|
||||
:lfile read locations from file using 'errorformat'
|
||||
:lgetfile idem, don't jump to first one
|
||||
:lbuffer idem, from current buffer.
|
||||
|
||||
HTML indenting can be slow, find out why. Any way to do some kind of
|
||||
profiling for Vim script? At least add a function to get the current time in
|
||||
usec. reltime([start, [end]])
|
||||
@@ -471,7 +407,7 @@ Awaiting updated patches:
|
||||
7 Completion of network shares, patch by Yasuhiro Matsumoto.
|
||||
Update 2004 Sep 6.
|
||||
How does this work? Missing comments.
|
||||
gettext() Translate a message. (Patch from Yasuhiro Matsumoto)
|
||||
- gettext() Translate a message. (Patch from Yasuhiro Matsumoto)
|
||||
Update 2004 Sep 10
|
||||
Another patch from Edward L. Fox (2005 Nov 24)
|
||||
Search in 'runtimepath'?
|
||||
@@ -548,6 +484,16 @@ Patch for "paranoid mode" by Kevin Collins, March 7. Needs much more work.
|
||||
Check if file explorer can handle directory names and links with a single
|
||||
quote. (Nieko Maatjes, 2005 Jan 4)
|
||||
|
||||
Future enhancements for tab pages:
|
||||
- Add GUI Tabs for all systems.
|
||||
Patch for GTK 1.2 passed on by Christian Michon, 2004 Jan 6.
|
||||
Simple patch for GTK by Luis M (nov 7).
|
||||
- ":tabsplit" makes a copy of the current tab page.
|
||||
- Add local variables for each tab page?
|
||||
- Add local options for each tab page? E.g., 'diffopt' could differ
|
||||
between tab pages.
|
||||
- Add local highlighting for a tab page?
|
||||
|
||||
|
||||
Vi incompatibility:
|
||||
8 With undo/redo only marks in the changed lines should be changed. Other
|
||||
@@ -1445,6 +1391,10 @@ User Friendlier:
|
||||
7 When Vim detects a file is being edited elsewhere and it's a gvim session
|
||||
of the same user it should offer a "Raise" button, so that the other gvim
|
||||
window can be displayed. (Eduard)
|
||||
8 Support saving and restoring session for X windows? It should work to do
|
||||
":mksession" and use "-S fname" for the restart command. The
|
||||
gui_x11_wm_protocol_handler() already takes care of the rest.
|
||||
global_event_filter() for GTK.
|
||||
|
||||
|
||||
Spell checking:
|
||||
@@ -2121,14 +2071,13 @@ Shared libraries:
|
||||
|
||||
|
||||
Tags:
|
||||
8 Add a function that returns the line in the tags file for a matching tag.
|
||||
Can be used to extract more info (class name, inheritance, etc.) (Rico
|
||||
Hendriks)
|
||||
7 Can CTRL-] (jump to tag) include a following "." and "->" to restrict the
|
||||
number of possible matches? Check tags file for an item that has members.
|
||||
(Flemming Madsen)
|
||||
7 Count before CTRL-]: jump to N'th match
|
||||
8 Scope arguments for ":tag", e.g.: ":tag class:cPage open", like Elvis.
|
||||
8 When output of ":tselect" is long, getting the more-prompt, should be able
|
||||
to type the tag number directly.
|
||||
7 Add a tag-select window. Works like ":cwindow". (Michal Malecki)
|
||||
7 Add the possibility to use the "-t {tag}" argument multiple times. Open a
|
||||
window for each tag.
|
||||
7 Make output of ":tselect" a bit nicer. Use highlighting?
|
||||
@@ -2289,31 +2238,25 @@ Autocommands:
|
||||
8 Add ScriptReadCmd event: used to load remote Vim scripts, e.g.
|
||||
"vim -u http://mach/path/vimrc".
|
||||
7 Add TagJump event: do something after jumping to a tag.
|
||||
8 Add "TagJumpFile" autocommand: When jumping to another file for a tag.
|
||||
Can be used to open "main.c.gz" when "main.c" isn't found.
|
||||
8 Use another option than 'updatetime' for the CursorHold event. The two
|
||||
things are unrelated for the user (but the implementation is more
|
||||
difficult).
|
||||
8 Add an event like CursorHold that is triggered repeatedly, not just once.
|
||||
8 Also trigger CursorHold in Insert mode?
|
||||
7 Add autocommand event for when a buffer cannot be abandoned. So that user
|
||||
can define the action taking (autowrite, dialog, fail) based on the kind
|
||||
of file. (Yakov Lerner) Or is BufLeave sufficient?
|
||||
8 Can't use ":normal" in CursorHold autocommands. Make the CursorHold event
|
||||
insert a special key code, and call the autocommand functions from a
|
||||
higher level, so that vgetc() isn't used recursively.
|
||||
8 Autocommands should not change registers. And marks? And the jumplist?
|
||||
And anything else?
|
||||
8 Add an event like CursorHold that is triggered repeatedly, not just once
|
||||
after typing something.
|
||||
7 Add autocommand event for when a buffer cannot be abandoned. So that the
|
||||
user can define the action taking (autowrite, dialog, fail) based on the
|
||||
kind of file. (Yakov Lerner) Or is BufLeave sufficient?
|
||||
8 Autocommand for when modified files have been found, when getting input
|
||||
focus again (e.g., FileChangedFocus).
|
||||
Check when: getting focus, jumping to another buffer, ...
|
||||
8 Autocommands should not change registers. And marks? And the jumplist?
|
||||
And anything else? Add a command to save and restore these things.
|
||||
8 Add autocommands, user functions and user commands to ":mkvimrc".
|
||||
8 Add "TagJumpFile" autocommand: When jumping to another file for a tag.
|
||||
Can be used to open "main.c.gz" when "main.c" isn't found.
|
||||
6 Add KeymapChanged event, so that the effects of a different keymap can be
|
||||
handled (e.g., other font) (Ron Aaron)
|
||||
7 Add a way to skip an autocommand if going from one *.c file to another *.c
|
||||
file.
|
||||
7 When trying to open a directory, don't load the file but trigger an
|
||||
autocommand event OpenDirectory.
|
||||
7 When trying to open a directory, trigger an OpenDirectory event.
|
||||
7 Add file type in front of file pattern: <d> for directory, <l> for link,
|
||||
<x> for executable, etc. <&xxx> for Risc OS. With commas to separate
|
||||
alternatives. The autocommand is only executed when both the file type
|
||||
@@ -2330,7 +2273,6 @@ Autocommands:
|
||||
- Add events to autocommands:
|
||||
Error - When an error happens
|
||||
NormalEnter - Entering Normal mode
|
||||
InsertEnter - Entering Insert mode
|
||||
ReplaceEnter - Entering Replace mode
|
||||
CmdEnter - Entering Cmdline mode
|
||||
VisualEnter - Entering Visual mode
|
||||
@@ -3335,14 +3277,20 @@ Debug mode:
|
||||
|
||||
|
||||
Various improvements:
|
||||
7 Add plugins for formatting? Should be able to make a choice depending on
|
||||
the language of a file (English/Korean/Japanese/etc.).
|
||||
Setting the 'langformat' option to "chinese" would load the
|
||||
"format/chinese.vim" plugin.
|
||||
The plugin would set 'formatexpr' and define the function being called.
|
||||
Edward L. Fox explains how it should be done for most Asian languages.
|
||||
(2005 Nov 24)
|
||||
7 [t to move to previous xml/html tag (like "vatov"), ]t to move to next
|
||||
("vatv").
|
||||
7 [< to move to previous xml/html tag, e.g., previous <li>. ]< to move to
|
||||
next <li>, ]< to next </li>, [< to previous </li>.
|
||||
8 Add ":rename" command: rename the file of the current buffer and rename
|
||||
the buffer. Buffer may be modified.
|
||||
- Perhaps ":cexpr" could read errors from a list?
|
||||
Add %b to 'errorformat': buffer number. (Yegappan Lakshmanan / Suresh
|
||||
- Add %b to 'errorformat': buffer number. (Yegappan Lakshmanan / Suresh
|
||||
Govindachar)
|
||||
6 In the quickfix window statusline add the command used to get the list of
|
||||
errors, e.g. ":make foo", ":grep something *.c".
|
||||
@@ -3467,9 +3415,6 @@ Various improvements:
|
||||
paragraph. Both start a new paragraph on any indent change.
|
||||
7 Add a way to define an item list with a pattern in 'formatoptions'. The
|
||||
'n' flag doesn't work for "6.3" or "6a.".
|
||||
8 Add 'formatexpr' option: Used for formatting operator "gq" instead of the
|
||||
builtin formatting or 'formatprg'. Or use a string that starts with "="
|
||||
in 'formatprg': "=MyFormat()".
|
||||
8 Allow using a trailing space to signal a paragraph that continues on the
|
||||
next line (MIME text/plain; format=flowed, RFC 2646). Can be used for
|
||||
continuous formatting. Could use 'autoformat' option, which specifies a
|
||||
@@ -3814,6 +3759,8 @@ Far future and "big" extensions:
|
||||
are reflected in each Vim immediately. Could work with local files but
|
||||
also over the internet. See http://www.codingmonkeys.de/subethaedit/.
|
||||
|
||||
When using "do" or ":diffget" in a buffer with changes in every line an extra
|
||||
empty line would appear.
|
||||
|
||||
vim:tw=78:sw=4:sts=4:ts=8:ft=help:norl:
|
||||
vim: set fo+=n :
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_06.txt* For Vim version 7.0aa. Last change: 2002 Jul 14
|
||||
*usr_06.txt* For Vim version 7.0aa. Last change: 2006 Feb 16
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -179,10 +179,9 @@ You could also write your own color scheme. This is how you do it:
|
||||
colorscheme mine
|
||||
|
||||
If you want to see what the most often used color combinations look like, use
|
||||
these commands: >
|
||||
this command: >
|
||||
|
||||
:edit $VIMRUNTIME/syntax/colortest.vim
|
||||
:source %
|
||||
:runtime syntax/colortest.vim
|
||||
|
||||
You will see text in various color combinations. You can check which ones are
|
||||
readable and look nice.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_41.txt* For Vim version 7.0aa. Last change: 2005 Nov 30
|
||||
*usr_41.txt* For Vim version 7.0aa. Last change: 2006 Feb 22
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -654,7 +654,9 @@ Working with text in the current buffer:
|
||||
nextnonblank() find next non-blank line
|
||||
prevnonblank() find previous non-blank line
|
||||
search() find a match for a pattern
|
||||
searchpos() find a match for a pattern
|
||||
searchpair() find the other end of a start/skip/end
|
||||
searchpairpos() find the other end of a start/skip/end
|
||||
|
||||
System functions and manipulation of files:
|
||||
browse() put up a file requester
|
||||
@@ -747,6 +749,7 @@ Various:
|
||||
exists() check if a variable, function, etc. exists
|
||||
has() check if a feature is supported in Vim
|
||||
getqflist() list of quickfix errors
|
||||
getloclist() list of location list items
|
||||
cscope_connection() check if a cscope connection exists
|
||||
did_filetype() check if a FileType autocommand was used
|
||||
eventhandler() check if invoked by an event handler
|
||||
@@ -758,7 +761,8 @@ Various:
|
||||
libcallnr() idem, returning a number
|
||||
getreg() get contents of a register
|
||||
getregtype() get type of a register
|
||||
setqflist() create a quickfix list
|
||||
setqflist() modify a quickfix list
|
||||
setloclist() modify a location list
|
||||
setreg() set contents and type of a register
|
||||
taglist() get list of matching tags
|
||||
|
||||
@@ -830,7 +834,7 @@ For people who like short functions, this does the same thing: >
|
||||
: return a:num2
|
||||
:endfunction
|
||||
|
||||
A user defined function is called in exactly the same way as a builtin
|
||||
A user defined function is called in exactly the same way as a built-in
|
||||
function. Only the name is different. The Min function can be used like
|
||||
this: >
|
||||
|
||||
@@ -2241,7 +2245,7 @@ organize your functions in library scripts. But you must use function names
|
||||
where the part before the '#' matches the script name. Otherwise Vim would
|
||||
not know what script to load.
|
||||
|
||||
If you get really enthousiastic and write lots of library scripts, you may
|
||||
If you get really enthusiastic and write lots of library scripts, you may
|
||||
want to use subdirectories. Example: >
|
||||
|
||||
call netlib#ftp#read('somefile')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*various.txt* For Vim version 7.0aa. Last change: 2006 Jan 08
|
||||
*various.txt* For Vim version 7.0aa. Last change: 2006 Feb 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -94,7 +94,8 @@ g8 Print the hex values of the bytes used in the
|
||||
*:nu* *:number*
|
||||
:[range]nu[mber] [count] [flags]
|
||||
Same as :print, but precede each line with its line
|
||||
number. (See also 'highlight' option).
|
||||
number. (See also 'highlight' and 'numberwidth'
|
||||
option).
|
||||
See |ex-flags| for [flags].
|
||||
|
||||
*:#*
|
||||
@@ -648,6 +649,15 @@ g CTRL-A Only when Vim was compiled with MEM_PROFILING defined
|
||||
compresses the help files).
|
||||
{not in Vi}
|
||||
|
||||
*:lh* *:lhelpgrep*
|
||||
:lh[elpgrep] {pattern}[@xx]
|
||||
Same as ":helpgrep", except the location list is used
|
||||
instead of the quickfix list. If the help window is
|
||||
already opened, then the location list for that window
|
||||
is used. Otherwise, a new help window is opened and
|
||||
the location list for that window is set. The
|
||||
location list for the current window is not changed.
|
||||
|
||||
*:exu* *:exusage*
|
||||
:exu[sage] Show help on Ex commands. Added to simulate the Nvi
|
||||
command. {not in Vi}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*version7.txt* For Vim version 7.0aa. Last change: 2006 Jan 21
|
||||
*version7.txt* For Vim version 7.0aa. Last change: 2006 Feb 23
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -30,6 +30,7 @@ POSIX compatibility |new-posix|
|
||||
Debugger support |new-debug-support|
|
||||
Remote file explorer |new-netrw-explore|
|
||||
Define an operator |new-define-operator|
|
||||
Location list |new-location-list|
|
||||
Various new items |new-items-7|
|
||||
|
||||
IMPROVEMENTS |improvements-7|
|
||||
@@ -191,8 +192,8 @@ 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.
|
||||
figure out what could be following. This may suggest struct and class
|
||||
members, system functions, etc.
|
||||
|
||||
Use CTRL-X CTRL-O in Insert mode to start the completion. |i_CTRL-X_CTRL-O|
|
||||
|
||||
@@ -200,8 +201,11 @@ The 'omnifunc' option is set by filetype plugins to define the function that
|
||||
figures out the completion.
|
||||
|
||||
Currently supported languages:
|
||||
C |ft-c-omni|
|
||||
XHTML |ft-html-omni|
|
||||
C |ft-c-omni|
|
||||
(X)HTML with CSS |ft-html-omni|
|
||||
JavaScript |ft-javascript-omni|
|
||||
any language wih syntax highligting |ft-syntax-omni|
|
||||
XML |ft-xml-omni|
|
||||
|
||||
When the 'completeopt' option contains "menu" then matches for Insert mode
|
||||
completion are displayed in a popup menu.
|
||||
@@ -357,6 +361,16 @@ through the |g@| operator.
|
||||
See |:map-operator| for the explanation and an example.
|
||||
|
||||
|
||||
Location list *new-location-list*
|
||||
-------------
|
||||
|
||||
The support for a per-window quickfix list (location list) is added. The
|
||||
location list can be displayed in a location window (similar to the quickfix
|
||||
window). You can open more than one location list window. A set of commands
|
||||
similar to the quickfix commands are added to browse the location list.
|
||||
(Yegappan Lakshmanan)
|
||||
|
||||
|
||||
Various new items *new-items-7*
|
||||
-----------------
|
||||
|
||||
@@ -374,6 +388,14 @@ CTRL-W <Enter> In the quickfix window: opens a new window to show the
|
||||
<A-RightMouse> ('mousemodel' "extend")
|
||||
Make a blockwise selection. |<A-LeftMouse>|
|
||||
|
||||
gF Start editing the filename under the cursor and jump
|
||||
to the line number following the file name.
|
||||
(Yegappan Lakshmanan)
|
||||
|
||||
CTRL-W F Start editing the filename under the cursor in a new
|
||||
window and jump to the line number following the file
|
||||
name. (Yegappan Lakshmanan)
|
||||
|
||||
Insert mode commands: ~
|
||||
|
||||
CTRL-\ CTRL-O Execute a Normal mode command. Like CTRL-O but
|
||||
@@ -400,6 +422,8 @@ Options: ~
|
||||
(based on an idea from Yegappan Lakshmanan)
|
||||
'formatlistpat' pattern to recognize a numbered list for formatting.
|
||||
(idea by Hugo Haas)
|
||||
'formatexpr' expression for formatting text with |gq| and when text
|
||||
goes over 'textwidth' in Insert mode.
|
||||
'spell' switch spell checking on/off
|
||||
'spelllang' languages to check spelling for
|
||||
'spellsuggest' methods for spell suggestions
|
||||
@@ -440,6 +464,40 @@ Win32: The ":winpos" command now also works in the console. (Vipin Aravind)
|
||||
|
||||
|:caddexpr| Add error messages from a Vim expression to an
|
||||
existing quickfix list. (Yegappan Lakshmanan).
|
||||
|:caddbuffer| Add errors from the current buffer to the quickfix
|
||||
list.
|
||||
|
||||
|:lfile| Like |:cfile| but use the location list.
|
||||
|:lgetfile| Like |:cgetfile| but use the location list.
|
||||
|:laddfile| Like |:caddfile| but use the location list.
|
||||
|:lbuffer| Like |:cbuffer| but use the location list.
|
||||
|:laddbuffer| Like |:caddbuffer| but use the location list.
|
||||
|:lexpr| Like |:cexpr| but use the location list.
|
||||
|:laddexpr| Like |:caddexpr| but use the location list.
|
||||
|:ll| Like |:cc| but use the location list.
|
||||
|:llist| Like |:clist| but use the location list.
|
||||
|:lnext| Like |:cnext| but use the location list.
|
||||
|:lprevious| Like |:cprevious| but use the location list.
|
||||
|:lNext| Like |:cNext| but use the location list.
|
||||
|:lfirst| Like |:cfirst| but use the location list.
|
||||
|:lrewind| Like |:crewind| but use the location list.
|
||||
|:llast| Like |:clast| but use the location list.
|
||||
|:lnfile| Like |:cnfile| but use the location list.
|
||||
|:lpfile| Like |:cpfile| but use the location list.
|
||||
|:lNfile| Like |:cNfile| but use the location list.
|
||||
|:lolder| Like |:colder| but use the location list.
|
||||
|:lnewer| Like |:cnewer| but use the location list.
|
||||
|:lwindow| Like |:cwindow| but use the location list.
|
||||
|:lopen| Like |:copen| but use the location list.
|
||||
|:lclose| Like |:cclose| but use the location list.
|
||||
|:lmake| Like |:make| but use the location list.
|
||||
|:lgrep| Like |:grep| but use the location list.
|
||||
|:lgrepadd| Like |:grepadd| but use the location list.
|
||||
|:lvimgrep| Like |:vimgrep| but use the location list.
|
||||
|:lvimgrepadd| Like |:vimgrepadd| but use the location list.
|
||||
|:lhelpgrep| Like |:helpgrep| but use the location list.
|
||||
|:lcscope| Like |:cscope| but use the location list.
|
||||
|:ltag| Jump to a tag and add matching tags to a location list.
|
||||
|
||||
|
||||
Ex command modifiers: ~
|
||||
@@ -474,6 +532,7 @@ New and extended functions: ~
|
||||
|count()| count nr of times a value is in a List or Dictionary
|
||||
|deepcopy()| make a full copy of a List or Dictionary
|
||||
|empty()| check if List or Dictionary is empty
|
||||
|getloclist()| list of location list items (Yegappan Lakshmanan)
|
||||
|getqflist()| list of quickfix errors (Yegappan Lakshmanan)
|
||||
|extend()| append one List to another or add items from one
|
||||
Dictionary to another
|
||||
@@ -509,7 +568,10 @@ New and extended functions: ~
|
||||
|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)
|
||||
|searchpairpos()| return a List with the position of the match
|
||||
|searchpos()| return a List with the position of the match
|
||||
|setloclist()| modify a location list (Yegappan Lakshmanan)
|
||||
|setqflist()| modify a quickfix list (Yegappan Lakshmanan)
|
||||
|sort()| sort a List
|
||||
|soundfold()| get the sound-a-like equivalent of a word
|
||||
|split()| split a String into a List
|
||||
@@ -537,6 +599,12 @@ New autocommand events: ~
|
||||
|QuickFixCmdPost| after :make, :grep et al. (Ciaran McCreesh)
|
||||
|SessionLoadPost| after loading a session file. (Yegappan Lakshmanan)
|
||||
|
||||
|SpellFileMissing| when a spell file can't be found
|
||||
|
||||
|CursorHoldI| the user doesn't press a key for a while in Insert mode
|
||||
|CursorMoved| the cursor was moved in Normal mode
|
||||
|CursorMovedI| the cursor was moved in Insert mode
|
||||
|
||||
|
||||
New items in search patterns: ~
|
||||
|/\%d| \%d123 search for character with decimal number
|
||||
@@ -550,9 +618,15 @@ New items in search patterns: ~
|
||||
|/\%U| \%U1234abcd search for character with 8 pos. hex number
|
||||
|/\]| [\U1234abcd] idem, in a colletion
|
||||
(The above partly by Ciaran McCreesh)
|
||||
|
||||
|/[[=| [[=a=]] an equivalence class (only for latin1 characters)
|
||||
|/[[.| [[.a.]] a collation element (only works with single char)
|
||||
|
||||
|/\%'m| \%'m match at mark m
|
||||
|/\%<'m| \%<'m match before mark m
|
||||
|/\%>'m| \%>'m match after mark m
|
||||
|/\%V| \%V match in Visual area
|
||||
|
||||
Nesting |/multi| items no longer is an error when an empty match is possible.
|
||||
|
||||
It is now possible to use \{0}, it matches the preceding atom zero times. Not
|
||||
@@ -581,11 +655,16 @@ Moved all the indent settings from the filetype plugin to the indent file.
|
||||
Implemented b:undo_indent to undo indent settings when setting 'filetype' to a
|
||||
different value.
|
||||
|
||||
VHDL indent file (Gerald Lai)
|
||||
|
||||
MGL syntax file. (Gero Kuhlmann)
|
||||
|
||||
New Keymaps: ~
|
||||
|
||||
Sinhala (Sri Lanka) (Harshula Jayasuriya)
|
||||
|
||||
Tamil in TSCII encoding (Yegappan Lakshmanan)
|
||||
|
||||
|
||||
New message translations: ~
|
||||
|
||||
@@ -682,6 +761,9 @@ from happening.
|
||||
":breakadd here" and ":breakdel here" can be used to set or delete a
|
||||
breakpoint at the cursor.
|
||||
|
||||
It is now possible to define a function with: >
|
||||
:exe "func Test()\n ...\n endfunc"
|
||||
|
||||
The tutor was updated to make it simpler to use and added text to explain a
|
||||
few more important commands. Used ideas from Gabriel Zachmann.
|
||||
|
||||
@@ -727,9 +809,6 @@ upper case. Add color support to the builtin vt320 terminal codes.
|
||||
For the '%' item in 'viminfo', allow a number to set a maximum for the number
|
||||
of buffers.
|
||||
|
||||
The 'statusline' option can be local to the window, so that each window can
|
||||
have a different value. (partly by Yegappan Lakshmanan)
|
||||
|
||||
When a file looks like a shell script, check for an "exec" command that starts
|
||||
the tcl interpreter. (suggested by Alexios Zavras)
|
||||
|
||||
@@ -940,6 +1019,24 @@ itself.
|
||||
":saveas asdf.c" will set 'filetype' to c when it's empty. Also for ":w
|
||||
asdf.c" when it sets the filename for the buffer.
|
||||
|
||||
Insert mode completion for whole lines now also searches unloaded buffers.
|
||||
|
||||
The colortest.vim script can now be invoked directly with ":source" or
|
||||
":runtime".
|
||||
|
||||
The 'statusline' option can be local to the window, so that each window can
|
||||
have a different value. (partly by Yegappan Lakshmanan)
|
||||
|
||||
The 'statusline' option and other options that support the same format can now
|
||||
use these new features:
|
||||
- When it starts with "%!" the value is first evaluated as an expression
|
||||
before parsing the value.
|
||||
- "%#HLname#" can be used to start highlighting with HLname.
|
||||
|
||||
When 'statusline' is set to something that causes an error message then it is
|
||||
made empty to avoid an endless redraw loop. Also for other options, such at
|
||||
'tabline'. ":verbose set statusline" will mention that it was set in an error
|
||||
handler.
|
||||
|
||||
==============================================================================
|
||||
COMPILE TIME CHANGES *compile-changes-7*
|
||||
@@ -1599,4 +1696,48 @@ the quickfix window to leave an unlisted "No Name" buffer behind every time.
|
||||
Win32: when using two screens of different size, setting 'lines' to a large
|
||||
value didn't fill the whole screen. (SungHyun Nam)
|
||||
|
||||
Win32 installer: The generated _vimrc contained an absolute path to diff.exe.
|
||||
After upgrading it becomes invalid. Now use $VIMRUNTIME instead.
|
||||
|
||||
The command line was cleared to often when 'showmode' was set and ":silent
|
||||
normal vy" was used. Don't clear the command line unless the mode was
|
||||
actually displayed. Added the "mode_displayed" variable.
|
||||
|
||||
The "load session" toolbar item could not handle a space or other special
|
||||
characters in v:this_session.
|
||||
|
||||
":set sta ts=8 sw=4 sts=2" deleted 4 spaces halfway a line instead of 2.
|
||||
|
||||
In a multi-byte file the foldmarker could be recognized in the trail byte.
|
||||
(Taro Muraoka)
|
||||
|
||||
Pasting with CTRL-V and menu didn't work properly when some commands are
|
||||
mapped. Use ":normal!" instead of ":normal". (Tony Apuzzo)
|
||||
|
||||
Crashed when expanding a file name argument in backticks.
|
||||
|
||||
In some situations the menu and scrollbar didn't work, when the value contains
|
||||
a CSI byte. (Yukihiro Nakadaira)
|
||||
|
||||
GTK GUI: When drawing the balloon focus changes and we might get a key release
|
||||
event that removed the balloon again. Ignore the key release event.
|
||||
|
||||
'titleold' was included in ":mkexrc" and ":mksession" files.
|
||||
|
||||
":set background&" didn't use the same logic as was used when starting up.
|
||||
|
||||
When "umask" is set such that nothing is writable then the viminfo file would
|
||||
be written without write permission. (Julian Bridle)
|
||||
|
||||
Motif: In diff mode dragging one scrollbar didn't update the scrollbar of the
|
||||
other diff'ed window.
|
||||
|
||||
When editing in an xterm with a different number of colors than expected the
|
||||
screen would be cleared and redrawn, causing the message about the edited file
|
||||
to be cleared. Now set "keep_msg" to redraw the last message.
|
||||
|
||||
For a color terminal: When the Normal HL uses bold, possibly to make the color
|
||||
lighter, and another HL group specifies a color it might become light as well.
|
||||
Now reset bold if a HL group doesn't specify bold itself.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*visual.txt* For Vim version 7.0aa. Last change: 2005 Oct 09
|
||||
*visual.txt* For Vim version 7.0aa. Last change: 2006 Jan 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -258,6 +258,11 @@ operator character: "v{move-around}3>" (move lines 3 indents to the right).
|
||||
The {move-around} is any sequence of movement commands. Note the difference
|
||||
with {motion}, which is only ONE movement command.
|
||||
|
||||
Another way to operate on the Visual area is using the |/\%V| item in a
|
||||
pattern. For example, to replace all '(' in the Visual area with '#': >
|
||||
|
||||
:%s/\%V(/X/g
|
||||
|
||||
==============================================================================
|
||||
5. Blockwise operators *blockwise-operators*
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*windows.txt* For Vim version 7.0aa. Last change: 2006 Jan 19
|
||||
*windows.txt* For Vim version 7.0aa. Last change: 2006 Feb 23
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -68,6 +68,9 @@ inactive no no ' '
|
||||
Note: All CTRL-W commands can also be executed with |:wincmd|, for those
|
||||
places where a Normal mode command can't be used or is inconvenient.
|
||||
|
||||
The main Vim window can hold several split windows. There are also tab pages
|
||||
|tab-page|, each of which can hold multiple windows.
|
||||
|
||||
==============================================================================
|
||||
2. Starting Vim *windows-starting*
|
||||
|
||||
@@ -255,6 +258,9 @@ CTRL-W c *CTRL-W_c* *:clo* *:close*
|
||||
:clo[se][!] Close current window. When the 'hidden' option is set, or
|
||||
when the buffer was changed and the [!] is used, the buffer
|
||||
becomes hidden (unless there is another window editing it).
|
||||
When there is only one window in the current tab page and
|
||||
there is another tab page, this closes the current tab page.
|
||||
|tab-page|.
|
||||
This command fails when: *E444*
|
||||
- There is only one window on the screen.
|
||||
- When 'hidden' is not set, [!] is not used, the buffer has
|
||||
@@ -271,6 +277,8 @@ CTRL-W CTRL-C *CTRL-W_CTRL-C*
|
||||
:hid[e] Quit current window, unless it is the last window on the
|
||||
screen. The buffer becomes hidden (unless there is another
|
||||
window editing it or 'bufhidden' is "unload" or "delete").
|
||||
If the window is the last one in the current tab page the tab
|
||||
page is closed. |tab-page|
|
||||
The value of 'hidden' is irrelevant for this command.
|
||||
Changes to the buffer are not written and won't get lost, so
|
||||
this is a "safe" command.
|
||||
@@ -551,6 +559,7 @@ can also get to them with the buffer list commands, like ":bnext".
|
||||
Rearrange the screen to open one window for each argument.
|
||||
All other windows are closed. When a count is given, this is
|
||||
the maximum number of windows to open.
|
||||
Only uses the current tab page |tab-page|.
|
||||
When the 'hidden' option is set, all buffers in closed windows
|
||||
become hidden.
|
||||
When 'hidden' is not set, and the 'autowrite' option is set,
|
||||
@@ -620,7 +629,8 @@ can also get to them with the buffer list commands, like ":bnext".
|
||||
CTRL-W w
|
||||
:{cmd}
|
||||
etc.
|
||||
< When an error is detected on one window, further
|
||||
< This only works in the current tab page.
|
||||
When an error is detected on one window, further
|
||||
windows will not be visited.
|
||||
The last window (or where an error occurred) becomes
|
||||
the current window.
|
||||
@@ -704,6 +714,11 @@ CTRL-W CTRL-F Split current window in two. Edit file name under cursor.
|
||||
{not available when the |+file_in_path| feature was disabled
|
||||
at compile time}
|
||||
|
||||
CTRL-W F *CTRL-W_F*
|
||||
Split current window in two. Edit file name under cursor and
|
||||
jump to the line number following the file name. See |gF| for
|
||||
details on how the line number is obtained.
|
||||
|
||||
Also see |CTRL-W_CTRL-I|: open window for an included file that includes
|
||||
the keyword under the cursor.
|
||||
|
||||
@@ -939,9 +954,10 @@ list of buffers. |unlisted-buffer|
|
||||
:bw[ipeout][!] {bufname}
|
||||
:N,Mbw[ipeout][!]
|
||||
:bw[ipeout][!] N1 N2 ...
|
||||
Like |:bdelete|, but really delete the buffer. All marks in
|
||||
this buffer become invalid, option settings are lost, etc.
|
||||
Don't use this unless you know what you are doing.
|
||||
Like |:bdelete|, but really delete the buffer. Everything
|
||||
related to the buffer is lost. All marks in this buffer
|
||||
become invalid, option settings are lost, etc. Don't use this
|
||||
unless you know what you are doing.
|
||||
|
||||
:[N]bun[load][!] *:bun* *:bunload* *E515*
|
||||
:bun[load][!] [N]
|
||||
@@ -992,9 +1008,11 @@ list of buffers. |unlisted-buffer|
|
||||
Split window and edit buffer for {filename} from the buffer
|
||||
list. This will also edit a buffer that is not in the buffer
|
||||
list, without setting the 'buflisted' flag.
|
||||
Note: If what you want to do is split the buffer, make a copy
|
||||
under another name, you can do it this way: >
|
||||
:w foobar | sp #
|
||||
|
||||
*:bn* *:bnext* *E87*
|
||||
:[N]bn[ext][!] [N]
|
||||
:[N]bn[ext][!] [N] *:bn* *:bnext* *E87*
|
||||
Go to [N]th next buffer in buffer list. [N] defaults to one.
|
||||
Wraps around the end of the buffer list.
|
||||
See |:buffer-!| for [!].
|
||||
@@ -1071,6 +1089,7 @@ list of buffers. |unlisted-buffer|
|
||||
of windows opened ('winwidth' if |:vertical| was prepended).
|
||||
Buf/Win Enter/Leave autocommands are not executed for the new
|
||||
windows here, that's only done when they are really entered.
|
||||
Only uses the current tab page |tab-page|.
|
||||
|
||||
Note: All the commands above that start editing another buffer, keep the
|
||||
'readonly' flag as it was. This differs from the ":edit" command, which sets
|
||||
@@ -1089,9 +1108,10 @@ purposes. A few options can be set to change the behavior of a buffer:
|
||||
|
||||
A few useful kinds of a buffer:
|
||||
|
||||
quickfix Used to contain the error list. See |:cwindow|. This command
|
||||
sets the 'buftype' option to "quickfix". You are not supposed
|
||||
to change this! 'swapfile' is off.
|
||||
quickfix Used to contain the error list or the location list. See
|
||||
|:cwindow| and |:lwindow|. This command sets the 'buftype'
|
||||
option to "quickfix". You are not supposed to change this!
|
||||
'swapfile' is off.
|
||||
|
||||
help Contains a help file. Will only be created with the |:help|
|
||||
command. The flag that indicates a help buffer is internal
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2006 Jan 12
|
||||
" Last Change: 2006 Feb 23
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@@ -891,6 +891,9 @@ au BufNewFile,BufRead *.mf setf mf
|
||||
" MetaPost
|
||||
au BufNewFile,BufRead *.mp setf mp
|
||||
|
||||
" MGL
|
||||
au BufNewFile,BufRead *.mgl setf mgl
|
||||
|
||||
" MMIX or VMS makefile
|
||||
au BufNewFile,BufRead *.mms call s:FTmms()
|
||||
|
||||
|
||||
13
runtime/ftplugin/javascript.vim
Normal file
13
runtime/ftplugin/javascript.vim
Normal file
@@ -0,0 +1,13 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Javascript
|
||||
" Maintainer: Bram Moolenaar (for now)
|
||||
" Last Change: 2006 Jan 30
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
if exists('&ofu')
|
||||
setlocal ofu=javascriptcomplete#CompleteJS
|
||||
endif
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim settings file
|
||||
" Language: LambdaProlog (Teyjus)
|
||||
" Maintainer: Markus Mottl <markus@oefai.at>
|
||||
" URL: http://www.oefai.at/~markus/vim/ftplugin/lprolog.vim
|
||||
" Last Change: 2001 Oct 02 - fixed uncommenting bug (MM)
|
||||
" Maintainer: Markus Mottl <markus.mottl@gmail.com>
|
||||
" URL: http://www.ocaml.info/vim/ftplugin/lprolog.vim
|
||||
" Last Change: 2006 Feb 05
|
||||
" 2001 Sep 16 - fixed 'no_mail_maps'-bug (MM)
|
||||
" 2001 Sep 02 - initial release (MM)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
" Markus Mottl <markus.mottl@gmail.com>
|
||||
" Stefano Zacchiroli <zack@bononia.it>
|
||||
" URL: http://www.ocaml.info/vim/ftplugin/ocaml.vim
|
||||
" Last Change: 2005 Oct 13 - removed GPL; better matchit support (MM, SZ)
|
||||
" Last Change: 2006 Feb 05
|
||||
"
|
||||
" if exists("b:did_ftplugin")
|
||||
" finish
|
||||
@@ -377,4 +377,3 @@ let &cpoptions=s:cposet
|
||||
unlet s:cposet
|
||||
|
||||
" vim:sw=2
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: VHDL
|
||||
" Maintainer: R.Shankar (shankar at txc.stpn.soft.net)
|
||||
" Last Change: Tue Oct 8
|
||||
|
||||
" VHDL filetype plugin
|
||||
" Language: VHDL
|
||||
" Maintainer: R.Shankar <shankar.r?freescale.com>
|
||||
" Modified By: Gerald Lai <laigera+vim?gmail.com>
|
||||
" Last Change: 2006 Feb 16
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -20,7 +20,7 @@ let b:did_ftplugin = 1
|
||||
"setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
|
||||
|
||||
" Format comments to be up to 78 characters long
|
||||
setlocal tw=75
|
||||
"setlocal tw=75
|
||||
|
||||
set cpo-=C
|
||||
|
||||
@@ -34,8 +34,51 @@ set cpo-=C
|
||||
if ! exists("b:match_words") && exists("loaded_matchit")
|
||||
let b:match_ignorecase=1
|
||||
let s:notend = '\%(\<end\s\+\)\@<!'
|
||||
let b:match_words=
|
||||
\ s:notend . '\<if\>:\<elsif\>:\<else\>:\<end\>\s\+\<if\>,' .
|
||||
\ s:notend . '\<case\>:\<when\>:\<end\>\s\+\<case\>,' .
|
||||
\ s:notend . '\<process\>:\<end\>\s\+\<process\>'
|
||||
let b:match_words =
|
||||
\ s:notend.'\<if\>:\<elsif\>:\<else\>:\<end\s\+if\>,'.
|
||||
\ s:notend.'\<case\>:\<when\>:\<end\s\+case\>,'.
|
||||
\ s:notend.'\<loop\>:\<end\s\+loop\>,'.
|
||||
\ s:notend.'\<for\>:\<end\s\+for\>,'.
|
||||
\ s:notend.'\<generate\>:\<end\s\+generate\>,'.
|
||||
\ s:notend.'\<record\>:\<end\s\+record\>,'.
|
||||
\ s:notend.'\<units\>:\<end\s\+units\>,'.
|
||||
\ s:notend.'\<process\>:\<end\s\+process\>,'.
|
||||
\ s:notend.'\<block\>:\<end\s\+block\>,'.
|
||||
\ s:notend.'\<function\>:\<end\s\+function\>,'.
|
||||
\ s:notend.'\<entity\>:\<end\s\+entity\>,'.
|
||||
\ s:notend.'\<component\>:\<end\s\+component\>,'.
|
||||
\ s:notend.'\<architecture\>:\<end\s\+architecture\>,'.
|
||||
\ s:notend.'\<package\>:\<end\s\+package\>,'.
|
||||
\ s:notend.'\<procedure\>:\<end\s\+procedure\>,'.
|
||||
\ s:notend.'\<configuration\>:\<end\s\+configuration\>'
|
||||
endif
|
||||
|
||||
" count repeat
|
||||
function! <SID>CountWrapper(cmd)
|
||||
let i = v:count1
|
||||
if a:cmd[0] == ":"
|
||||
while i > 0
|
||||
execute a:cmd
|
||||
let i = i - 1
|
||||
endwhile
|
||||
else
|
||||
execute "normal! gv\<Esc>"
|
||||
execute "normal ".i.a:cmd
|
||||
let curcol = col(".")
|
||||
let curline = line(".")
|
||||
normal! gv
|
||||
call cursor(curline, curcol)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" explore motion
|
||||
" keywords: "architecture", "block", "configuration", "component", "entity", "function", "package", "procedure", "process", "record", "units"
|
||||
let b:vhdl_explore = '\%(architecture\|block\|configuration\|component\|entity\|function\|package\|procedure\|process\|record\|units\)'
|
||||
noremap <buffer><silent>[[ :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\%(\\<end\\s\\+\\)\\@<!\\<".b:vhdl_explore."\\>\\c\\<Bar>\\%^","bW")')<CR>
|
||||
noremap <buffer><silent>]] :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\%(\\<end\\s\\+\\)\\@<!\\<".b:vhdl_explore."\\>\\c\\<Bar>\\%$","W")')<CR>
|
||||
noremap <buffer><silent>[] :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\<end\\s\\+".b:vhdl_explore."\\>\\c\\<Bar>\\%^","bW")')<CR>
|
||||
noremap <buffer><silent>][ :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\<end\\s\\+".b:vhdl_explore."\\>\\c\\<Bar>\\%$","W")')<CR>
|
||||
vnoremap <buffer><silent>[[ :<C-u>cal <SID>CountWrapper('[[')<CR>
|
||||
vnoremap <buffer><silent>]] :<C-u>cal <SID>CountWrapper(']]')<CR>
|
||||
vnoremap <buffer><silent>[] :<C-u>cal <SID>CountWrapper('[]')<CR>
|
||||
vnoremap <buffer><silent>][ :<C-u>cal <SID>CountWrapper('][')<CR>
|
||||
|
||||
464
runtime/indent/vhdl.vim
Normal file
464
runtime/indent/vhdl.vim
Normal file
@@ -0,0 +1,464 @@
|
||||
" VHDL indent ('93 syntax)
|
||||
" Language: VHDL
|
||||
" Maintainer: Gerald Lai <laigera+vim?gmail.com>
|
||||
" Version: 1.34
|
||||
" Last Change: 2006 Feb 11
|
||||
" URL: http://www.vim.org/scripts/script.php?script_id=1450
|
||||
|
||||
" only load this indent file when no other was loaded
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
" setup indent options for local VHDL buffer
|
||||
setlocal indentexpr=GetVHDLindent()
|
||||
setlocal indentkeys=!^F,o,O,e,0(,0)
|
||||
setlocal indentkeys+==~if,=~then,=~elsif,=~else
|
||||
setlocal indentkeys+==~begin,=~is,=~select,=~--
|
||||
|
||||
" count repeat
|
||||
function! <SID>CountWrapper(cmd)
|
||||
let i = v:count1
|
||||
if a:cmd[0] == ":"
|
||||
while i > 0
|
||||
execute a:cmd
|
||||
let i = i - 1
|
||||
endwhile
|
||||
else
|
||||
execute "normal! gv\<Esc>"
|
||||
execute "normal ".i.a:cmd
|
||||
let curcol = col(".")
|
||||
let curline = line(".")
|
||||
normal! gv
|
||||
call cursor(curline, curcol)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" explore motion
|
||||
" keywords: "architecture", "block", "configuration", "component", "entity", "function", "package", "procedure", "process", "record", "units"
|
||||
let b:vhdl_explore = '\%(architecture\|block\|configuration\|component\|entity\|function\|package\|procedure\|process\|record\|units\)'
|
||||
noremap <buffer><silent>[[ :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\%(\\<end\\s\\+\\)\\@<!\\<".b:vhdl_explore."\\>\\c\\<Bar>\\%^","bW")')<CR>
|
||||
noremap <buffer><silent>]] :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\%(\\<end\\s\\+\\)\\@<!\\<".b:vhdl_explore."\\>\\c\\<Bar>\\%$","W")')<CR>
|
||||
noremap <buffer><silent>[] :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\<end\\s\\+".b:vhdl_explore."\\>\\c\\<Bar>\\%^","bW")')<CR>
|
||||
noremap <buffer><silent>][ :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\<end\\s\\+".b:vhdl_explore."\\>\\c\\<Bar>\\%$","W")')<CR>
|
||||
vnoremap <buffer><silent>[[ :<C-u>cal <SID>CountWrapper('[[')<CR>
|
||||
vnoremap <buffer><silent>]] :<C-u>cal <SID>CountWrapper(']]')<CR>
|
||||
vnoremap <buffer><silent>[] :<C-u>cal <SID>CountWrapper('[]')<CR>
|
||||
vnoremap <buffer><silent>][ :<C-u>cal <SID>CountWrapper('][')<CR>
|
||||
|
||||
" constants
|
||||
" not a comment
|
||||
let s:NC = '\%(--.*\)\@<!'
|
||||
" end of string
|
||||
let s:ES = '\s*\%(--.*\)\=$'
|
||||
" no "end" keyword in front
|
||||
let s:NE = '\%(\<end\s\+\)\@<!'
|
||||
|
||||
" for matchit plugin
|
||||
if exists("loaded_matchit")
|
||||
let b:match_ignorecase = 1
|
||||
let b:match_words =
|
||||
\ s:NE.'\<if\>:\<elsif\>:\<else\>:\<end\s\+if\>,'.
|
||||
\ s:NE.'\<case\>:\<when\>:\<end\s\+case\>,'.
|
||||
\ s:NE.'\<loop\>:\<end\s\+loop\>,'.
|
||||
\ s:NE.'\<for\>:\<end\s\+for\>,'.
|
||||
\ s:NE.'\<generate\>:\<end\s\+generate\>,'.
|
||||
\ s:NE.'\<record\>:\<end\s\+record\>,'.
|
||||
\ s:NE.'\<units\>:\<end\s\+units\>,'.
|
||||
\ s:NE.'\<process\>:\<end\s\+process\>,'.
|
||||
\ s:NE.'\<block\>:\<end\s\+block\>,'.
|
||||
\ s:NE.'\<function\>:\<end\s\+function\>,'.
|
||||
\ s:NE.'\<entity\>:\<end\s\+entity\>,'.
|
||||
\ s:NE.'\<component\>:\<end\s\+component\>,'.
|
||||
\ s:NE.'\<architecture\>:\<end\s\+architecture\>,'.
|
||||
\ s:NE.'\<package\>:\<end\s\+package\>,'.
|
||||
\ s:NE.'\<procedure\>:\<end\s\+procedure\>,'.
|
||||
\ s:NE.'\<configuration\>:\<end\s\+configuration\>'
|
||||
endif
|
||||
|
||||
" only define indent function once
|
||||
if exists("*GetVHDLindent")
|
||||
finish
|
||||
endif
|
||||
|
||||
function GetVHDLindent()
|
||||
" store current line & string
|
||||
let curn = v:lnum
|
||||
let curs = getline(curn)
|
||||
|
||||
" find previous line that is not a comment
|
||||
let prevn = prevnonblank(curn - 1)
|
||||
let prevs = getline(prevn)
|
||||
while prevn > 0 && prevs =~ '^\s*--'
|
||||
let prevn = prevnonblank(prevn - 1)
|
||||
let prevs = getline(prevn)
|
||||
endwhile
|
||||
|
||||
" default indent starts as previous non-comment line's indent
|
||||
let ind = prevn > 0 ? indent(prevn) : 0
|
||||
" backup default
|
||||
let ind2 = ind
|
||||
|
||||
" indent: special; kill string so it would not affect other filters
|
||||
" keywords: "report" + string
|
||||
" where: anywhere in current or previous line
|
||||
let s0 = s:NC.'\<report\>\s*".*"'
|
||||
if curs =~? s0
|
||||
let curs = ""
|
||||
endif
|
||||
if prevs =~? s0
|
||||
let prevs = ""
|
||||
endif
|
||||
|
||||
" indent: previous line's comment position, otherwise follow next non-comment line if possible
|
||||
" keyword: "--"
|
||||
" where: start of current line
|
||||
if curs =~ '^\s*--'
|
||||
let pn = curn - 1
|
||||
let ps = getline(pn)
|
||||
if ps =~ '--'
|
||||
return stridx(ps, '--')
|
||||
else
|
||||
" find nextnonblank line that is not a comment
|
||||
let nn = nextnonblank(curn + 1)
|
||||
let ns = getline(nn)
|
||||
while nn > 0 && ns =~ '^\s*--'
|
||||
let nn = nextnonblank(nn + 1)
|
||||
let ns = getline(nn)
|
||||
endwhile
|
||||
let n = indent(nn)
|
||||
return n != -1 ? n : ind
|
||||
endif
|
||||
endif
|
||||
|
||||
" ****************************************************************************************
|
||||
" indent: align generic variables & port names
|
||||
" keywords: "generic", "map", "port" + "(", provided current line is part of mapping
|
||||
" where: anywhere in previous 2 lines
|
||||
" find following previous non-comment line
|
||||
let pn = prevnonblank(prevn - 1)
|
||||
let ps = getline(pn)
|
||||
while pn > 0 && ps =~ '^\s*--'
|
||||
let pn = prevnonblank(pn - 1)
|
||||
let ps = getline(pn)
|
||||
endwhile
|
||||
if (curs =~ '^\s*)' || curs =~? '^\s*\%(\<\%(generic\|map\|port\)\>.*\)\@<!\S\+\s*\%(=>\s*\S\+\|:[^=]\@=\s*\%(\%(in\|out\|inout\|buffer\|linkage\)\>\|\w\+\s\+:=\)\)') && (prevs =~? s:NC.'\<\%(generic\|map\|port\)\s*(\%(\s*\w\)\=' || (ps =~? s:NC.'\<\%(generic\|map\|port\)'.s:ES && prevs =~ '^\s*('))
|
||||
" align closing ")" with opening "("
|
||||
if curs =~ '^\s*)'
|
||||
return stridx(prevs, '(')
|
||||
endif
|
||||
let m = matchend(prevs, '(\s*\ze\w')
|
||||
if m != -1
|
||||
return m
|
||||
else
|
||||
return stridx(prevs, '(') + &sw
|
||||
endif
|
||||
endif
|
||||
|
||||
" indent: align conditional/select statement
|
||||
" keywords: variable + "<=" without ";" ending
|
||||
" where: start of previous line
|
||||
if prevs =~? '^\s*\S\+\s*<=[^;]*'.s:ES
|
||||
return matchend(prevs, '<=\s*\ze.')
|
||||
endif
|
||||
|
||||
" indent: backtrace previous non-comment lines for next smaller or equal size indent
|
||||
" keywords: "end" + "record", "units"
|
||||
" where: start of previous line
|
||||
" keyword: ")"
|
||||
" where: start of previous line
|
||||
" keyword: without "<=" + ";" ending
|
||||
" where: anywhere in previous line
|
||||
" keyword: "=>" + ")" ending, provided current line does not begin with ")"
|
||||
" where: anywhere in previous line
|
||||
" _note_: indent allowed to leave this filter
|
||||
let m = 0
|
||||
if prevs =~? '^\s*end\s\+\%(record\|units\)\>'
|
||||
let m = 3
|
||||
elseif prevs =~ '^\s*)'
|
||||
let m = 1
|
||||
elseif prevs =~ s:NC.'\%(<=.*\)\@<!;'.s:ES || (curs !~ '^\s*)' && prevs =~ s:NC.'=>.*'.s:NC.')'.s:ES)
|
||||
let m = 2
|
||||
endif
|
||||
|
||||
if m > 0
|
||||
let pn = prevnonblank(prevn - 1)
|
||||
let ps = getline(pn)
|
||||
while pn > 0
|
||||
let t = indent(pn)
|
||||
if ps !~ '^\s*--' && t < ind
|
||||
" make sure one of these is true
|
||||
" keywords: variable + "<=" without ";" ending
|
||||
" where: start of previous non-comment line
|
||||
" keywords: "generic", "map", "port"
|
||||
" where: anywhere in previous non-comment line
|
||||
" keyword: "("
|
||||
" where: start of previous non-comment line
|
||||
if m < 3 && ps !~? '^\s*\S\+\s*<=[^;]*'.s:ES
|
||||
if ps =~? s:NC.'\<\%(generic\|map\|port\)\>' || ps =~ '^\s*('
|
||||
let ind = t
|
||||
endif
|
||||
break
|
||||
endif
|
||||
let ind = t
|
||||
if m > 1
|
||||
" find following previous non-comment line
|
||||
let ppn = prevnonblank(pn - 1)
|
||||
let pps = getline(ppn)
|
||||
while ppn > 0 && pps =~ '^\s*--'
|
||||
let ppn = prevnonblank(ppn - 1)
|
||||
let pps = getline(ppn)
|
||||
endwhile
|
||||
" indent: follow
|
||||
" keyword: "select"
|
||||
" where: end of following previous non-comment line
|
||||
" keyword: "type"
|
||||
" where: start of following previous non-comment line
|
||||
if m == 2
|
||||
let s1 = s:NC.'\<select'.s:ES
|
||||
if ps !~? s1 && pps =~? s1
|
||||
let ind = indent(ppn)
|
||||
endif
|
||||
elseif m == 3
|
||||
let s1 = '^\s*type\>'
|
||||
if ps !~? s1 && pps =~? s1
|
||||
let ind = indent(ppn)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
break
|
||||
endif
|
||||
let pn = prevnonblank(pn - 1)
|
||||
let ps = getline(pn)
|
||||
endwhile
|
||||
endif
|
||||
|
||||
" indent: follow indent of previous opening statement, otherwise -sw
|
||||
" keyword: "begin"
|
||||
" where: anywhere in current line
|
||||
if curs =~? s:NC.'\<begin\>'
|
||||
let ind = ind - &sw
|
||||
" find previous opening statement of
|
||||
" keywords: "architecture", "block", "entity", "function", "generate", "procedure", "process"
|
||||
let s2 = s:NC.s:NE.'\<\%(architecture\|block\|entity\|function\|generate\|procedure\|process\)\>'
|
||||
if curs !~? s2.'.*'.s:NC.'\<begin\>.*'.s:ES && prevs =~? s2
|
||||
let ind = ind + &sw
|
||||
endif
|
||||
return ind
|
||||
endif
|
||||
|
||||
" indent: +sw if previous line is previous opening statement
|
||||
" keywords: "record", "units"
|
||||
" where: anywhere in current line
|
||||
if curs =~? s:NC.s:NE.'\<\%(record\|units\)\>'
|
||||
" find previous opening statement of
|
||||
" keyword: "type"
|
||||
let s3 = s:NC.s:NE.'\<type\>'
|
||||
if curs !~? s3.'.*'.s:NC.'\<\%(record\|units\)\>.*'.s:ES && prevs =~? s3
|
||||
let ind = ind + &sw
|
||||
endif
|
||||
return ind
|
||||
endif
|
||||
|
||||
" ****************************************************************************************
|
||||
" indent: 0
|
||||
" keywords: "architecture", "configuration", "entity", "library", "package"
|
||||
" where: start of current line
|
||||
if curs =~? '^\s*\%(architecture\|configuration\|entity\|library\|package\)\>'
|
||||
return 0
|
||||
endif
|
||||
|
||||
" indent: maintain indent of previous opening statement
|
||||
" keyword: "is"
|
||||
" where: start of current line
|
||||
" find previous opening statement of
|
||||
" keywords: "architecture", "block", "configuration", "entity", "function", "package", "procedure", "process", "type"
|
||||
if curs =~? '^\s*\<is\>' && prevs =~? s:NC.s:NE.'\<\%(architecture\|block\|configuration\|entity\|function\|package\|procedure\|process\|type\)\>'
|
||||
return ind2
|
||||
endif
|
||||
|
||||
" indent: maintain indent of previous opening statement
|
||||
" keyword: "then"
|
||||
" where: start of current line
|
||||
" find previous opening statement of
|
||||
" keywords: "elsif", "if"
|
||||
if curs =~? '^\s*\<then\>' && prevs =~? s:NC.'\%(\<elsif\>\|'.s:NE.'\<if\>\)'
|
||||
return ind2
|
||||
endif
|
||||
|
||||
" indent: maintain indent of previous opening statement
|
||||
" keyword: "generate"
|
||||
" where: start of current line
|
||||
" find previous opening statement of
|
||||
" keywords: "for", "if"
|
||||
if curs =~? '^\s*\<generate\>' && prevs =~? s:NC.s:NE.'\%(\%(\<wait\s\+\)\@<!\<for\>\|\<if\>\)'
|
||||
return ind2
|
||||
endif
|
||||
|
||||
" indent: +sw
|
||||
" keywords: "begin", "block", "loop", "process", "record", "units"
|
||||
" removed: "case", "elsif", "if", "while"
|
||||
" where: anywhere in previous line
|
||||
if prevs =~? s:NC.'\%(\<begin\>\|'.s:NE.'\<\%(block\|loop\|process\|record\|units\)\>\)'
|
||||
return ind + &sw
|
||||
endif
|
||||
|
||||
" indent: +sw
|
||||
" keywords: "architecture", "component", "configuration", "entity", "for", "package"
|
||||
" removed: "when", "with"
|
||||
" where: start of previous line
|
||||
if prevs =~? '^\s*\%(architecture\|component\|configuration\|entity\|for\|package\)\>'
|
||||
return ind + &sw
|
||||
endif
|
||||
|
||||
" indent: +sw
|
||||
" keyword: "generate", "is", "select", "=>"
|
||||
" where: end of previous line
|
||||
if prevs =~? s:NC.'\%(\%('.s:NE.'\<generate\|\<is\|\<select\)\|=>\)'.s:ES
|
||||
return ind + &sw
|
||||
endif
|
||||
|
||||
" indent: +sw
|
||||
" keyword: "else"
|
||||
" where: start of previous line
|
||||
" keyword: "then"
|
||||
" where: end of previous line
|
||||
" _note_: indent allowed to leave this filter
|
||||
if prevs =~? '^\s*else\>' || prevs =~? s:NC.'\<then'.s:ES
|
||||
let ind = ind + &sw
|
||||
endif
|
||||
|
||||
" ****************************************************************************************
|
||||
" indent: -sw
|
||||
" keywords: "when", provided previous line does not begin with "when"
|
||||
" where: start of current line
|
||||
let s4 = '^\s*when\>'
|
||||
if curs =~? s4
|
||||
if prevs !~? s4
|
||||
return ind - &sw
|
||||
else
|
||||
return ind2
|
||||
endif
|
||||
endif
|
||||
|
||||
" indent: -sw
|
||||
" keywords: "else", "elsif", provided previous line does not contain "then"
|
||||
" where: start of current line
|
||||
if curs =~? '^\s*\%(else\|elsif\)\>'
|
||||
if prevs !~? s:NC.'\<then\>'
|
||||
return ind - &sw
|
||||
else
|
||||
return ind2
|
||||
endif
|
||||
endif
|
||||
|
||||
" indent: -sw
|
||||
" keywords: "end" + "if", provided previous line does not begin with "else", not contain "then"
|
||||
" where: start of current line
|
||||
if curs =~? '^\s*end\s\+if\>'
|
||||
if prevs !~? '^\s*else\>' && prevs !~? s:NC.'\<then\>'
|
||||
return ind - &sw
|
||||
else
|
||||
return ind2
|
||||
endif
|
||||
endif
|
||||
|
||||
" indent: -sw
|
||||
" keywords: "end" + "function", "procedure", provided previous line does not contain "begin"
|
||||
" where: start of current line
|
||||
if curs =~? '^\s*end\s\+\%(function\|procedure\)\>'
|
||||
if prevs !~? s:NC.'\<begin\>'
|
||||
return ind - &sw
|
||||
else
|
||||
return ind2
|
||||
endif
|
||||
endif
|
||||
|
||||
" indent: -sw
|
||||
" keywords: "end" + "block", "for", "generate", "loop", "process", "record", "units"
|
||||
" where: start of current line
|
||||
if curs =~? '^\s*end\s\+\%(block\|for\|generate\|loop\|process\|record\|units\)\>'
|
||||
return ind - &sw
|
||||
endif
|
||||
|
||||
" indent: backtrace previous non-comment lines
|
||||
" keyword: "end" + "case", "component"
|
||||
" where: start of current line
|
||||
let m = 0
|
||||
if curs =~? '^\s*end\s\+case\>'
|
||||
let m = 1
|
||||
elseif curs =~? '^\s*end\s\+component\>'
|
||||
let m = 2
|
||||
endif
|
||||
|
||||
if m > 0
|
||||
" find following previous non-comment line
|
||||
let pn = prevn
|
||||
let ps = getline(pn)
|
||||
while pn > 0
|
||||
if ps !~ '^\s*--'
|
||||
"indent: -2sw
|
||||
"keywords: "end" + "case"
|
||||
"where: start of previous non-comment line
|
||||
"indent: -sw
|
||||
"keywords: "when"
|
||||
"where: start of previous non-comment line
|
||||
"indent: follow
|
||||
"keywords: "case"
|
||||
"where: start of previous non-comment line
|
||||
if m == 1
|
||||
if ps =~? '^\s*end\s\+case\>'
|
||||
return indent(pn) - 2 * &sw
|
||||
elseif ps =~? '^\s*when\>'
|
||||
return indent(pn) - &sw
|
||||
elseif ps =~? '^\s*case\>'
|
||||
return indent(pn)
|
||||
endif
|
||||
"indent: follow
|
||||
"keyword: "component"
|
||||
"where: anywhere in previous non-comment line
|
||||
elseif m == 2
|
||||
if ps =~? s:NC.s:NE.'\<component\>'
|
||||
return indent(pn)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
let pn = prevnonblank(pn - 1)
|
||||
let ps = getline(pn)
|
||||
endwhile
|
||||
return ind - &sw
|
||||
endif
|
||||
|
||||
" indent: -sw
|
||||
" keyword: ")"
|
||||
" where: start of current line
|
||||
if curs =~ '^\s*)'
|
||||
return ind - &sw
|
||||
endif
|
||||
|
||||
" indent: 0
|
||||
" keywords: "end" + "architecture", "configuration", "entity", "package"
|
||||
" where: start of current line
|
||||
if curs =~? '^\s*end\s\+\%(architecture\|configuration\|entity\|package\)\>'
|
||||
return 0
|
||||
endif
|
||||
|
||||
" indent: -sw
|
||||
" keywords: "end" + identifier
|
||||
" where: start of current line
|
||||
if curs =~? '^\s*end\s\+\w\+\>'
|
||||
return ind - &sw
|
||||
endif
|
||||
|
||||
" ****************************************************************************************
|
||||
" indent: maintain indent of previous opening statement
|
||||
" keywords: without "generic", "map", "port" + ":" but not ":=" + "in", "out", "inout", "buffer", "linkage", variable & ":="
|
||||
" where: start of current line
|
||||
if curs =~? '^\s*\%(\<\%(generic\|map\|port\)\>.*\)\@<!\S\+\s*:[^=]\@=\s*\%(\%(in\|out\|inout\|buffer\|linkage\)\>\|\w\+\s\+:=\)'
|
||||
return ind2
|
||||
endif
|
||||
|
||||
" return leftover filtered indent
|
||||
return ind
|
||||
endfunction
|
||||
@@ -2,7 +2,7 @@
|
||||
"
|
||||
" Menu Translations: Japanese (EUC-JP)
|
||||
" Translated By: MURAOKA Taro <koron@tka.att.ne.jp>
|
||||
" Last Change: 29-Apr-2004.
|
||||
" Last Change: 04-Feb-2006.
|
||||
|
||||
" Quit when menu translations have already been done.
|
||||
if exists("did_menu_trans")
|
||||
@@ -142,7 +142,23 @@ menutrans &Open<Tab>:copen
|
||||
menutrans &Close<Tab>:cclose <09>Ĥ<EFBFBD><EFBFBD><EFBFBD>(&C)<Tab>:cclose
|
||||
menutrans &Convert\ to\ HEX<Tab>:%!xxd HEX<EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>(&C)<Tab>:%!xxd
|
||||
menutrans Conve&rt\ back<Tab>:%!xxd\ -r HEX<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>(&R)<Tab>%!xxd\ -r
|
||||
menutrans &Set\ Compiler <09><><EFBFBD><EFBFBD><EFBFBD>ѥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(&S)
|
||||
menutrans Se&T\ Compiler <09><><EFBFBD><EFBFBD><EFBFBD>ѥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(&T)
|
||||
|
||||
" Tools.Spelling Menu
|
||||
menutrans &Spelling <09><><EFBFBD>ڥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(&S)
|
||||
menutrans &Spell\ Check\ On <09><><EFBFBD>ڥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD>ͭ<EFBFBD><EFBFBD>(&S)
|
||||
menutrans Spell\ Check\ &Off <09><><EFBFBD>ڥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD>ͭ<EFBFBD><EFBFBD>(&O)
|
||||
menutrans To\ &Next\ error<Tab>]s <09><><EFBFBD>Υ<EFBFBD><EFBFBD>顼(&N)<Tab>]s
|
||||
menutrans To\ &Previous\ error<Tab>[s <09><><EFBFBD>Υ<EFBFBD><EFBFBD>顼(&P)<Tab>[s
|
||||
menutrans Suggest\ &Corrections<Tab>z? <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(&C)<Tab>z?
|
||||
menutrans &Repeat\ correction<Tab>:spellrepall <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F2B7ABA4>֤<EFBFBD>(&R)<Tab>:spellrepall
|
||||
menutrans Set\ language\ to\ "en" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en"\ <20><><EFBFBD><EFBFBD><EFBFBD>ꤹ<EFBFBD><EFBFBD>
|
||||
menutrans Set\ language\ to\ "en_au" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en_au"\ <20><><EFBFBD><EFBFBD><EFBFBD>ꤹ<EFBFBD><EFBFBD>
|
||||
menutrans Set\ language\ to\ "en_ca" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en_ca"\ <20><><EFBFBD><EFBFBD><EFBFBD>ꤹ<EFBFBD><EFBFBD>
|
||||
menutrans Set\ language\ to\ "en_gb" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en_gb"\ <20><><EFBFBD><EFBFBD><EFBFBD>ꤹ<EFBFBD><EFBFBD>
|
||||
menutrans Set\ language\ to\ "en_nz" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en_nz"\ <20><><EFBFBD><EFBFBD><EFBFBD>ꤹ<EFBFBD><EFBFBD>
|
||||
menutrans Set\ language\ to\ "en_us" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en_us"\ <20><><EFBFBD><EFBFBD><EFBFBD>ꤹ<EFBFBD><EFBFBD>
|
||||
menutrans &Find\ More\ Languages ¾<>θ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(&F)
|
||||
|
||||
" Tools.Fold Menu
|
||||
menutrans &Folding <09><EFBFBD><DEBE><EFBFBD>(&F)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"
|
||||
" Menu Translations: Japanese (UTF-8)
|
||||
" Translated By: MURAOKA Taro <koron@tka.att.ne.jp>
|
||||
" Last Change: 29-Apr-2004.
|
||||
" Last Change: 04-Feb-2006.
|
||||
|
||||
" Quit when menu translations have already been done.
|
||||
if exists("did_menu_trans")
|
||||
@@ -142,7 +142,23 @@ menutrans &Open<Tab>:copen 開く(&O)<Tab>:copen
|
||||
menutrans &Close<Tab>:cclose 閉じる(&C)<Tab>:cclose
|
||||
menutrans &Convert\ to\ HEX<Tab>:%!xxd HEXへ変換(&C)<Tab>:%!xxd
|
||||
menutrans Conve&rt\ back<Tab>:%!xxd\ -r HEXから逆変換(&R)<Tab>%!xxd\ -r
|
||||
menutrans &Set\ Compiler コンパイラ設定(&S)
|
||||
menutrans Se&T\ Compiler コンパイラ設定(&T)
|
||||
|
||||
" Tools.Spelling Menu
|
||||
menutrans &Spelling スペリング(&S)
|
||||
menutrans &Spell\ Check\ On スペルチェック有効(&S)
|
||||
menutrans Spell\ Check\ &Off スペルチェック有効(&O)
|
||||
menutrans To\ &Next\ error<Tab>]s 次のエラー(&N)<Tab>]s
|
||||
menutrans To\ &Previous\ error<Tab>[s 前のエラー(&P)<Tab>[s
|
||||
menutrans Suggest\ &Corrections<Tab>z? 修正候補(&C)<Tab>z?
|
||||
menutrans &Repeat\ correction<Tab>:spellrepall 修正を繰り返す(&R)<Tab>:spellrepall
|
||||
menutrans Set\ language\ to\ "en" 言語を\ "en"\ に設定する
|
||||
menutrans Set\ language\ to\ "en_au" 言語を\ "en_au"\ に設定する
|
||||
menutrans Set\ language\ to\ "en_ca" 言語を\ "en_ca"\ に設定する
|
||||
menutrans Set\ language\ to\ "en_gb" 言語を\ "en_gb"\ に設定する
|
||||
menutrans Set\ language\ to\ "en_nz" 言語を\ "en_nz"\ に設定する
|
||||
menutrans Set\ language\ to\ "en_us" 言語を\ "en_us"\ に設定する
|
||||
menutrans &Find\ More\ Languages 他の言語を検索する(&F)
|
||||
|
||||
" Tools.Fold Menu
|
||||
menutrans &Folding 折畳み(&F)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"
|
||||
" Menu Translations: Japanese (CP932)
|
||||
" Translated By: MURAOKA Taro <koron@tka.att.ne.jp>
|
||||
" Last Change: 29-Apr-2004.
|
||||
" Last Change: 04-Feb-2006.
|
||||
|
||||
" Quit when menu translations have already been done.
|
||||
if exists("did_menu_trans")
|
||||
@@ -142,7 +142,23 @@ menutrans &Open<Tab>:copen
|
||||
menutrans &Close<Tab>:cclose <09><EFBFBD><C282><EFBFBD>(&C)<Tab>:cclose
|
||||
menutrans &Convert\ to\ HEX<Tab>:%!xxd HEX<EFBFBD>֕ϊ<EFBFBD>(&C)<Tab>:%!xxd
|
||||
menutrans Conve&rt\ back<Tab>:%!xxd\ -r HEX<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>t<EFBFBD>ϊ<EFBFBD>(&R)<Tab>%!xxd\ -r
|
||||
menutrans &Set\ Compiler <09>R<EFBFBD><EFBFBD><EFBFBD>p<EFBFBD>C<EFBFBD><EFBFBD><EFBFBD>ݒ<EFBFBD>(&S)
|
||||
menutrans Se&T\ Compiler <09>R<EFBFBD><EFBFBD><EFBFBD>p<EFBFBD>C<EFBFBD><EFBFBD><EFBFBD>ݒ<EFBFBD>(&T)
|
||||
|
||||
" Tools.Spelling Menu
|
||||
menutrans &Spelling <09>X<EFBFBD>y<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>O(&S)
|
||||
menutrans &Spell\ Check\ On <09>X<EFBFBD>y<EFBFBD><EFBFBD><EFBFBD>`<60>F<EFBFBD>b<EFBFBD>N<EFBFBD>L<EFBFBD><EFBFBD>(&S)
|
||||
menutrans Spell\ Check\ &Off <09>X<EFBFBD>y<EFBFBD><EFBFBD><EFBFBD>`<60>F<EFBFBD>b<EFBFBD>N<EFBFBD>L<EFBFBD><EFBFBD>(&O)
|
||||
menutrans To\ &Next\ error<Tab>]s <09><><EFBFBD>̃G<EFBFBD><EFBFBD><EFBFBD>[(&N)<Tab>]s
|
||||
menutrans To\ &Previous\ error<Tab>[s <09>O<EFBFBD>̃G<EFBFBD><EFBFBD><EFBFBD>[(&P)<Tab>[s
|
||||
menutrans Suggest\ &Corrections<Tab>z? <09>C<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(&C)<Tab>z?
|
||||
menutrans &Repeat\ correction<Tab>:spellrepall <09>C<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>J<EFBFBD><EFBFBD><EFBFBD>Ԃ<EFBFBD>(&R)<Tab>:spellrepall
|
||||
menutrans Set\ language\ to\ "en" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en"\ <20>ɐݒ肷<EFBFBD><EFBFBD>
|
||||
menutrans Set\ language\ to\ "en_au" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en_au"\ <20>ɐݒ肷<EFBFBD><EFBFBD>
|
||||
menutrans Set\ language\ to\ "en_ca" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en_ca"\ <20>ɐݒ肷<EFBFBD><EFBFBD>
|
||||
menutrans Set\ language\ to\ "en_gb" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en_gb"\ <20>ɐݒ肷<EFBFBD><EFBFBD>
|
||||
menutrans Set\ language\ to\ "en_nz" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en_nz"\ <20>ɐݒ肷<EFBFBD><EFBFBD>
|
||||
menutrans Set\ language\ to\ "en_us" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en_us"\ <20>ɐݒ肷<EFBFBD><EFBFBD>
|
||||
menutrans &Find\ More\ Languages <09><><EFBFBD>̌<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(&F)
|
||||
|
||||
" Tools.Fold Menu
|
||||
menutrans &Folding <09><EFBFBD><DC8F><EFBFBD>(&F)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" You can also use this as a start for your own set of menus.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2005 Oct 01
|
||||
" Last Change: 2006 Feb 02
|
||||
|
||||
" Note that ":an" (short for ":anoremenu") is often used to make a menu work
|
||||
" in all modes and avoid side effects from mappings defined by the user.
|
||||
@@ -140,14 +140,14 @@ if has("virtualedit")
|
||||
func! <SID>Paste()
|
||||
let ove = &ve
|
||||
set ve=all
|
||||
normal `^
|
||||
normal! `^
|
||||
if @+ != ''
|
||||
normal "+gP
|
||||
normal! "+gP
|
||||
endif
|
||||
let c = col(".")
|
||||
normal i
|
||||
normal! i
|
||||
if col(".") < c " compensate for i<ESC> moving the cursor left
|
||||
normal l
|
||||
normal! l
|
||||
endif
|
||||
let &ve = ove
|
||||
endfunc
|
||||
@@ -1034,7 +1034,7 @@ endif
|
||||
" Select a session to load; default to current session name if present
|
||||
fun! s:LoadVimSesn()
|
||||
if strlen(v:this_session) > 0
|
||||
let name = v:this_session
|
||||
let name = escape(v:this_session, ' \t#%$|<>"*?[{`')
|
||||
else
|
||||
let name = "Session.vim"
|
||||
endif
|
||||
@@ -1046,7 +1046,7 @@ fun! s:SaveVimSesn()
|
||||
if strlen(v:this_session) == 0
|
||||
let v:this_session = "Session.vim"
|
||||
endif
|
||||
execute "browse mksession! " . v:this_session
|
||||
execute "browse mksession! " . escape(v:this_session, ' \t#%$|<>"*?[{`')
|
||||
endfun
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Set options and add mapping such that Vim behaves a lot like MS-Windows
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last change: 2005 Dec 28
|
||||
" Last change: 2006 Feb 02
|
||||
|
||||
" bail out if this isn't wanted (mrsvim.vim uses this).
|
||||
if exists("g:skip_loading_mswin") && g:skip_loading_mswin
|
||||
@@ -47,18 +47,18 @@ if has("virtualedit")
|
||||
func! <SID>Paste()
|
||||
let ove = &ve
|
||||
set ve=all
|
||||
normal `^
|
||||
normal! `^
|
||||
if @+ != ''
|
||||
normal "+gP
|
||||
normal! "+gP
|
||||
endif
|
||||
let c = col(".")
|
||||
normal i
|
||||
normal! i
|
||||
if col(".") < c " compensate for i<ESC> moving the cursor left
|
||||
" Avoid a beep when the text ends at the window edge.
|
||||
let vb_save = &vb
|
||||
let t_vb_save = &t_vb
|
||||
set vb t_vb=
|
||||
normal l
|
||||
normal! l
|
||||
let &vb = vb_save
|
||||
let &t_vb = t_vb_save
|
||||
endif
|
||||
|
||||
@@ -35,7 +35,7 @@ set cpo&vim
|
||||
" Local Browsing: {{{2
|
||||
augroup FileExplorer
|
||||
au!
|
||||
au BufEnter * call s:LocalBrowse(expand("<amatch>"))
|
||||
au BufEnter * silent! call s:LocalBrowse(expand("<amatch>"))
|
||||
augroup END
|
||||
|
||||
" Network Browsing Reading Writing: {{{2
|
||||
@@ -47,10 +47,10 @@ augroup Network
|
||||
au BufReadCmd file://* exe "silent doau BufReadPre ".netrw#RFC2396(expand("<amatch>"))|exe 'e '.substitute(netrw#RFC2396(expand("<amatch>")),'file://\(.*\)','\1',"")|exe "silent doau BufReadPost ".netrw#RFC2396(expand("<amatch>"))
|
||||
au BufReadCmd file://localhost/* exe "silent doau BufReadPre ".netrw#RFC2396(expand("<amatch>"))|exe 'e '.substitute(netrw#RFC2396(expand("<amatch>")),'file://localhost/\(.*\)','\1',"")|exe "silent doau BufReadPost ".netrw#RFC2396(expand("<amatch>"))
|
||||
endif
|
||||
au BufReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau BufReadPre ".expand("<amatch>")|exe "Nread 0r ".expand("<amatch>")|exe "silent doau BufReadPost ".expand("<amatch>")
|
||||
au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau FileReadPre ".expand("<amatch>")|exe "Nread " .expand("<amatch>")|exe "silent doau FileReadPost ".expand("<amatch>")
|
||||
au BufWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau BufWritePre ".expand("<amatch>")|exe "Nwrite " .expand("<amatch>")|exe "silent doau BufWritePost ".expand("<amatch>")
|
||||
au FileWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau FileWritePre ".expand("<amatch>")|exe "'[,']Nwrite " .expand("<amatch>")|exe "silent doau FileWritePost ".expand("<amatch>")
|
||||
au BufReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau BufReadPre ".expand("<amatch>")|exe 'Nread 0r "'.expand("<amatch>").'"'|exe "silent doau BufReadPost ".expand("<amatch>")
|
||||
au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau FileReadPre ".expand("<amatch>")|exe 'Nread "' .expand("<amatch>").'"'|exe "silent doau FileReadPost ".expand("<amatch>")
|
||||
au BufWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau BufWritePre ".expand("<amatch>")|exe 'Nwrite "' .expand("<amatch>").'"'|exe "silent doau BufWritePost ".expand("<amatch>")
|
||||
au FileWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau FileWritePre ".expand("<amatch>")|exe "'[,']".'Nwrite "' .expand("<amatch>").'"'|exe "silent doau FileWritePost ".expand("<amatch>")
|
||||
augroup END
|
||||
|
||||
" Commands: :Nread, :Nwrite, :NetUserPass {{{2
|
||||
@@ -69,6 +69,12 @@ com! -nargs=? -bar -bang Pexplore call netrw#Explore(-2,0,0,<q-args>)
|
||||
" Commands: NetrwSettings {{{2
|
||||
com! -nargs=0 NetrwSettings :call netrwSettings#NetrwSettings()
|
||||
|
||||
" Maps:
|
||||
if !hasmapto('<Plug>NetrwBrowseX')
|
||||
nmap <unique> gx <Plug>NetrwBrowseX
|
||||
endif
|
||||
nno <silent> <Plug>NetrwBrowseX :call netrw#NetBrowseX(expand("<cWORD>"),0)<cr>
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" LocalBrowse: {{{2
|
||||
fun! s:LocalBrowse(dirname)
|
||||
@@ -76,7 +82,7 @@ fun! s:LocalBrowse(dirname)
|
||||
" the BufEnter event causes triggering when attempts to write to
|
||||
" the DBG buffer are made.
|
||||
if isdirectory(a:dirname)
|
||||
call netrw#DirBrowse(a:dirname)
|
||||
silent! call netrw#DirBrowse(a:dirname)
|
||||
endif
|
||||
" not a directory, ignore it
|
||||
endfun
|
||||
|
||||
15
runtime/plugin/spellfile.vim
Normal file
15
runtime/plugin/spellfile.vim
Normal file
@@ -0,0 +1,15 @@
|
||||
" Vim plugin for downloading spell files
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2006 Feb 01
|
||||
|
||||
" Exit quickly when:
|
||||
" - this plugin was already loaded
|
||||
" - when 'compatible' is set
|
||||
" - some autocommands are already taking care of spell files
|
||||
if exists("loaded_spellfile_plugin") || &cp || exists("#SpellFileMissing")
|
||||
finish
|
||||
endif
|
||||
let loaded_spellfile_plugin = 1
|
||||
|
||||
" The function is in the autoload directory.
|
||||
autocmd SpellFileMissing * call spellfile#LoadFile(expand('<amatch>'))
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types in scripts
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last change: 2005 Oct 12
|
||||
" Last change: 2006 Feb 01
|
||||
|
||||
" This file is called by an autocommand for every file that has just been
|
||||
" loaded into a buffer. It checks if the type of file can be recognized by
|
||||
@@ -184,7 +184,7 @@ else
|
||||
" - "*** " in first line and "--- " in second line (context diff).
|
||||
" - "# It was generated by makepatch " in the second line (makepatch diff).
|
||||
" - "Index: <filename>" in the first line (CVS file)
|
||||
elseif s:line1 =~ '^\(diff\>\|Only in \|\d\+\(,\d\+\)\=[cda]\d\+\>\|# It was generated by makepatch \|Index:\s\+\f\+$\|===== \f\+ \d\+\.\d\+ vs edited\|==== //\f\+#\d\+\)'
|
||||
elseif s:line1 =~ '^\(diff\>\|Only in \|\d\+\(,\d\+\)\=[cda]\d\+\>\|# It was generated by makepatch \|Index:\s\+\f\+\r\=$\|===== \f\+ \d\+\.\d\+ vs edited\|==== //\f\+#\d\+\)'
|
||||
\ || (s:line1 =~ '^--- ' && s:line2 =~ '^+++ ')
|
||||
\ || (s:line1 =~ '^\* looking for ' && s:line2 =~ '^\* comparing to ')
|
||||
\ || (s:line1 =~ '^\*\*\* ' && s:line2 =~ '^--- ')
|
||||
|
||||
22
runtime/spell/cleanadd.vim
Normal file
22
runtime/spell/cleanadd.vim
Normal file
@@ -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"
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -4,12 +4,11 @@
|
||||
# aap generate all the .spl files
|
||||
# aap diff create all the diff files
|
||||
|
||||
# "hu" is at the end, because it takes a very long time.
|
||||
LANG = af am bg ca cs cy da de el en eo es fr fo ga gd gl he hr id it ku
|
||||
la lt lv mg mi ms nb nl nn ny pl pt ro ru rw sk sl sv sw
|
||||
tet th tl tn uk yi zu hu
|
||||
|
||||
# "hu" is at the end, because it takes a very long time.
|
||||
#
|
||||
# TODO:
|
||||
# Finnish doesn't work, the dictionary fi_FI.zip file contains hyphenation...
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
*** sv_SE.orig.aff Wed Aug 31 21:00:19 2005
|
||||
--- sv_SE.aff Fri Sep 30 14:09:19 2005
|
||||
*** sv_SE.orig.aff 2003-08-14 14:00:32.000000000 +0200
|
||||
--- sv_SE.aff 2006-02-21 20:33:31.687500000 +0100
|
||||
***************
|
||||
*** 6,7 ****
|
||||
--- 6,22 ----
|
||||
@@ -139,547 +139,82 @@
|
||||
+ SAL <20> E
|
||||
+ SAL <20>G(IE)-6 <09>K # vokal+g(ie) ger ej j-ljud
|
||||
+ SAL <20> <09>
|
||||
*** sv_SE.orig.dic 2003-08-14 13:02:06.000000000 +0200
|
||||
--- sv_SE.dic 2005-10-15 18:15:52.171875000 +0200
|
||||
*** sv_SE.orig.dic 2003-08-14 14:02:06.000000000 +0200
|
||||
--- sv_SE.dic 2006-02-23 18:39:11.218750000 +0100
|
||||
***************
|
||||
*** 108,113 ****
|
||||
--- 108,114 ----
|
||||
adoption/ADHS
|
||||
adoptivbarn/BDS
|
||||
adoptivson/ADS
|
||||
+ adr.
|
||||
adrenalin/BS
|
||||
adress/DHS
|
||||
adressat/ADHS
|
||||
***************
|
||||
*** 608,613 ****
|
||||
--- 609,615 ----
|
||||
anl<6E>ps/S
|
||||
anl<6E>pta/JRS
|
||||
anm
|
||||
+ anm.
|
||||
anmaning/ADGS
|
||||
anmoda/ABCDEFMNPS
|
||||
anmodande/ACEFS
|
||||
***************
|
||||
*** 973,978 ****
|
||||
--- 975,981 ----
|
||||
arrogant/OS
|
||||
arsenal/DHS
|
||||
arsenik/DS
|
||||
+ art.
|
||||
art/ADHOS
|
||||
arta/CHJMNPS
|
||||
artefakt/DHS
|
||||
***************
|
||||
*** 1094,1099 ****
|
||||
--- 1097,1103 ----
|
||||
audiens/DHS
|
||||
auditorie/CIS
|
||||
auditorium/JS
|
||||
+ aug.
|
||||
August/A
|
||||
augusti/AS
|
||||
auktion/ADHS
|
||||
***************
|
||||
*** 2376,2381 ****
|
||||
--- 2380,2386 ----
|
||||
bikupa/AEGS
|
||||
bikupe/S
|
||||
bikups/S
|
||||
+ bil.
|
||||
bil/ADGS
|
||||
bila/EGIJOS
|
||||
bilaga/EGOS
|
||||
***************
|
||||
*** 2490,2495 ****
|
||||
--- 2495,2501 ----
|
||||
Bj<42>rn
|
||||
bj<62>rn/ADGS
|
||||
Bj<42>rns
|
||||
+ bl.a.
|
||||
bla/JS
|
||||
black/DGS
|
||||
blackout/DHS
|
||||
***************
|
||||
*** 3645,3650 ****
|
||||
--- 3651,3657 ----
|
||||
debut/ADHS
|
||||
debutant/DHS
|
||||
debutera/JMS
|
||||
+ dec.
|
||||
december/AS
|
||||
decennie/CIS
|
||||
decennium/AJS
|
||||
***************
|
||||
*** 4117,4122 ****
|
||||
--- 4124,4130 ----
|
||||
dotterson/ADS
|
||||
Douglas
|
||||
dov/OPS
|
||||
+ dr
|
||||
dra/AJS
|
||||
drabant/DHS
|
||||
drabba/ACMNPS
|
||||
***************
|
||||
*** 4315,4321 ****
|
||||
duven/MS
|
||||
dvala/EGJS
|
||||
*** 4317,4319 ****
|
||||
dvaldes/S
|
||||
! dvs
|
||||
dv<64>ljas/S
|
||||
dv<64>ljes/S
|
||||
dv<64>ljs/NS
|
||||
--- 4323,4330 ----
|
||||
duven/MS
|
||||
dvala/EGJS
|
||||
--- 4317,4319 ----
|
||||
dvaldes/S
|
||||
! dvs.
|
||||
! d.v.s.
|
||||
! #dvs Removed by Stefan.
|
||||
dv<64>ljas/S
|
||||
dv<64>ljes/S
|
||||
dv<64>ljs/NS
|
||||
***************
|
||||
*** 4463,4468 ****
|
||||
--- 4472,4478 ----
|
||||
Ebbas
|
||||
Ecuador/A
|
||||
ed/ADHS
|
||||
+ e.d.
|
||||
Edberg/A
|
||||
eder/AJMS
|
||||
Edit/A
|
||||
***************
|
||||
*** 4612,4617 ****
|
||||
--- 4622,4628 ----
|
||||
ekorre/AEGS
|
||||
ekosystem/BDS
|
||||
ekos<6F>ndning/ADGS
|
||||
*** 24490 ****
|
||||
--- 24490,24554 ----
|
||||
<EFBFBD>vila/MS
|
||||
+
|
||||
+ # Additions by Stefan:
|
||||
+ SEK
|
||||
+ adr.
|
||||
+ anm.
|
||||
+ art.
|
||||
+ aug.
|
||||
+ bl.a.
|
||||
+ d.v.s.
|
||||
+ dec.
|
||||
+ dr
|
||||
+ dvs.
|
||||
+ e.Kr.
|
||||
eksem/BDS
|
||||
Eksj<73>/A
|
||||
ekumenik/DS
|
||||
***************
|
||||
*** 4825,4830 ****
|
||||
--- 4836,4842 ----
|
||||
enkrona/EGS
|
||||
enk<6E>t/DHS
|
||||
Enk<6E>ping/A
|
||||
+ e.d.
|
||||
+ enl.
|
||||
enlighet/S
|
||||
enligt/S
|
||||
enorm/OPS
|
||||
***************
|
||||
*** 4990,4995 ****
|
||||
--- 5002,5008 ----
|
||||
etanol/DS
|
||||
etapp/DHS
|
||||
etc
|
||||
+ etc.
|
||||
etcetera/S
|
||||
eten/BDS
|
||||
eter/ES
|
||||
***************
|
||||
*** 5334,5341 ****
|
||||
--- 5347,5356 ----
|
||||
favorisera/ACDMNPS
|
||||
favorit/ADHS
|
||||
fav<61>r/DHS
|
||||
+ f.d.
|
||||
fe/EFHS
|
||||
feber/ES
|
||||
+ febr.
|
||||
febril/MOPS
|
||||
februari/AS
|
||||
federal/MOS
|
||||
***************
|
||||
*** 5451,5456 ****
|
||||
--- 5466,5472 ----
|
||||
fiffla/ACDMNS
|
||||
fifflar/DJQS
|
||||
fifflare/AEJS
|
||||
+ fig.
|
||||
figur/ADHS
|
||||
figurativ/OS
|
||||
figurera/ACJMNPS
|
||||
***************
|
||||
*** 5635,5640 ****
|
||||
--- 5651,5657 ----
|
||||
fj<66>sk/ABS
|
||||
fj<66>ska/JMS
|
||||
fj<66>ttra/CMNPS
|
||||
+ f.Kr.
|
||||
flack/OPS
|
||||
flacka/ABCDJMNS
|
||||
fladder/CS
|
||||
***************
|
||||
*** 5913,5918 ****
|
||||
--- 5930,5936 ----
|
||||
fortplanta/ACMNPS
|
||||
fortplantning/ADGS
|
||||
fortran/S
|
||||
+ forts.
|
||||
fortsatt/OQS
|
||||
fortskrida/KS
|
||||
forts<74>tta/AJS
|
||||
***************
|
||||
*** 6075,6080 ****
|
||||
--- 6093,6099 ----
|
||||
fras/DHS
|
||||
frasa/BDHJMS
|
||||
frasering/ADS
|
||||
+ fre.
|
||||
fred/ADS
|
||||
freda/ACJMNPS
|
||||
fredag/ADGS
|
||||
***************
|
||||
*** 6170,6175 ****
|
||||
--- 6189,6195 ----
|
||||
frivol/MOS
|
||||
froda/ACMNPS
|
||||
frodig/OS
|
||||
+ fr.o.m.
|
||||
from/KLMNS
|
||||
fromhet/ADS
|
||||
fromt/S
|
||||
***************
|
||||
*** 6453,6458 ****
|
||||
--- 6473,6479 ----
|
||||
f<>stman/AFS
|
||||
f<>stm<74>/AEIS
|
||||
f<>stning/ADGS
|
||||
+ f.d.
|
||||
+ f.n.
|
||||
+ f.<2E>.
|
||||
f<>da/ADEJKLRS
|
||||
f<>dd/OQS
|
||||
f<>delse/AES
|
||||
***************
|
||||
*** 10493,10498 ****
|
||||
--- 10514,10520 ----
|
||||
Jan/A
|
||||
Janne/A
|
||||
Janos
|
||||
+ febr.
|
||||
+ fig.
|
||||
+ fil.kand.
|
||||
+ fil.lic.
|
||||
+ forts.
|
||||
+ fr.o.m.
|
||||
+ fre.
|
||||
+ jan.
|
||||
januari/AS
|
||||
japan/DHS
|
||||
Japans
|
||||
***************
|
||||
*** 10520,10525 ****
|
||||
--- 10542,10548 ----
|
||||
jetflyg/ABS
|
||||
jetmotor/EHS
|
||||
jetplan/ABDS
|
||||
+ jfr
|
||||
jiddisch/DS
|
||||
Jimmy/A
|
||||
jippo/ACES
|
||||
***************
|
||||
*** 10870,10875 ****
|
||||
--- 10893,10899 ----
|
||||
kaos/BS
|
||||
kaotisk/OS
|
||||
Kap
|
||||
+ kap.
|
||||
kap/BDS
|
||||
kapa/ACJMNPS
|
||||
kapabel/KMS
|
||||
***************
|
||||
*** 11119,11124 ****
|
||||
--- 11143,11149 ----
|
||||
Kjell/A
|
||||
kjol/ADGS
|
||||
kjortel/EIS
|
||||
+ kl.
|
||||
kl
|
||||
klack/DGS
|
||||
klacka/IJMS
|
||||
***************
|
||||
*** 13445,13450 ****
|
||||
--- 13470,13476 ----
|
||||
l<>pning/ADGS
|
||||
l<>psedel/AEIS
|
||||
l<>ptid/DS
|
||||
+ l<>r.
|
||||
l<>rdag/ADGS
|
||||
l<>s/AORS
|
||||
l<>sa/ABDJKLQRS
|
||||
***************
|
||||
*** 13783,13788 ****
|
||||
--- 13809,13815 ----
|
||||
Mauretanien/A
|
||||
Mauritius
|
||||
mausoleum/JS
|
||||
+ max.
|
||||
max
|
||||
maxim/DHS
|
||||
maximal/MOS
|
||||
***************
|
||||
*** 13965,13970 ****
|
||||
--- 13992,13998 ----
|
||||
mexikan/DHS
|
||||
mexikanska/AEGS
|
||||
Mexiko/A
|
||||
+ m.fl.
|
||||
mg
|
||||
MHz
|
||||
Michael/A
|
||||
***************
|
||||
*** 14016,14021 ****
|
||||
--- 14044,14050 ----
|
||||
milsl<73>ng/OS
|
||||
milstolpe/AEGS
|
||||
mimosa/AES
|
||||
+ min.
|
||||
min/ACDFHS
|
||||
mina/HJS
|
||||
minderv<72>rdig/OQRS
|
||||
***************
|
||||
*** 14136,14141 ****
|
||||
--- 14165,14171 ----
|
||||
mj<6D>lnar/DJQS
|
||||
mj<6D>lnare/AEJS
|
||||
ml
|
||||
+ m.m.
|
||||
mm
|
||||
mo/AEGS
|
||||
mobba/ACMNPS
|
||||
***************
|
||||
*** 14539,14544 ****
|
||||
--- 14569,14575 ----
|
||||
m<>lstyrd/OS
|
||||
m<>ls<6C>ttning/ADGS
|
||||
m<>ltid/ADHS
|
||||
+ max.
|
||||
+ min.
|
||||
+ m<>n.
|
||||
m<>n/DGQS
|
||||
m<>na/IJMPRS
|
||||
m<>nad/ADHQS
|
||||
***************
|
||||
*** 14792,14797 ****
|
||||
--- 14823,14830 ----
|
||||
neutron/DHS
|
||||
nev<65>/ES
|
||||
New
|
||||
+ ngn
|
||||
+ ngt
|
||||
nia/EGJQS
|
||||
Nicaragua/A
|
||||
nick/DGS
|
||||
***************
|
||||
*** 14920,14931 ****
|
||||
--- 14953,14966 ----
|
||||
notifikation/ADS
|
||||
notis/DHS
|
||||
notorisk/OS
|
||||
+ nov.
|
||||
nova/AES
|
||||
novell/DHS
|
||||
novellmagasin/ABDS
|
||||
novellsamling/ADGS
|
||||
november/AS
|
||||
novis/DHS
|
||||
+ nr.
|
||||
nr
|
||||
nu/BS
|
||||
nubb/S
|
||||
***************
|
||||
*** 15243,15248 ****
|
||||
--- 15278,15284 ----
|
||||
obrottslig/OS
|
||||
obrukbar/MOS
|
||||
obruten/MS
|
||||
+ obs.
|
||||
obs
|
||||
observant/OPS
|
||||
observation/ADHS
|
||||
***************
|
||||
*** 15470,15475 ****
|
||||
--- 15506,15512 ----
|
||||
okonventionell/MOS
|
||||
okritisk/OS
|
||||
okryddade/OS
|
||||
+ okt.
|
||||
oktagon/HS
|
||||
oktal/MOS
|
||||
oktav/DHS
|
||||
***************
|
||||
*** 15741,15746 ****
|
||||
--- 15778,15784 ----
|
||||
onjutbar/MOS
|
||||
onkel/AES
|
||||
onormal/MOS
|
||||
+ ons.
|
||||
onsdag/ADGS
|
||||
onyanserade/OS
|
||||
onykter/MS
|
||||
***************
|
||||
*** 15977,15983 ****
|
||||
--- 16015,16023 ----
|
||||
ostrukturerade/OS
|
||||
ost<73>rd/OS
|
||||
osund/OS
|
||||
+ osv.
|
||||
osv
|
||||
+ o.s.v.
|
||||
osvensk/OS
|
||||
osviklig/OPS
|
||||
osympatisk/OPQS
|
||||
***************
|
||||
*** 16378,16383 ****
|
||||
--- 16418,16424 ----
|
||||
petitum/ES
|
||||
Petra/A
|
||||
Pettersson/A
|
||||
+ obs.
|
||||
+ okt.
|
||||
+ ons.
|
||||
+ osv.
|
||||
+ p.g.a.
|
||||
pga
|
||||
Philips
|
||||
pi/FS
|
||||
***************
|
||||
*** 17457,17462 ****
|
||||
--- 17498,17504 ----
|
||||
resonabel/MS
|
||||
resonemang/ABDS
|
||||
resonera/ACMNS
|
||||
+ resp.
|
||||
resp/S
|
||||
respekt/S
|
||||
respektabel/LMS
|
||||
***************
|
||||
*** 18328,18333 ****
|
||||
--- 18370,18376 ----
|
||||
sentimentalitet/ADS
|
||||
separat/OS
|
||||
separera/ACMNPS
|
||||
+ sept.
|
||||
september/AS
|
||||
seraf/DHS
|
||||
serenad/DHS
|
||||
***************
|
||||
*** 18652,18657 ****
|
||||
--- 18695,18701 ----
|
||||
sj<73>slag/S
|
||||
sj<73>ss/S
|
||||
sj<73>pig/OS
|
||||
+ s.k.
|
||||
ska/GJMPS
|
||||
skada/ABCDEGJMNPS
|
||||
skadedjur/BDS
|
||||
***************
|
||||
*** 20767,20772 ****
|
||||
--- 20811,20817 ----
|
||||
s<>mnl<6E>s/OQRS
|
||||
s<>mnl<6E>shet/ADS
|
||||
s<>mnmedel/ACFS
|
||||
+ sept.
|
||||
+ s<>n.
|
||||
s<>ndag/ADGS
|
||||
s<>nder/S
|
||||
s<>nderbruten/MS
|
||||
***************
|
||||
*** 20832,20837 ****
|
||||
--- 20877,20883 ----
|
||||
s<>v<EFBFBD>l/S
|
||||
s<>v<EFBFBD>rst/S
|
||||
ta/AKRS
|
||||
+ tab.
|
||||
tabbe/S
|
||||
tabell/DHS
|
||||
tabernaklet/AS
|
||||
***************
|
||||
*** 21063,21068 ****
|
||||
--- 21109,21115 ----
|
||||
testar/DJQS
|
||||
testare/AEJS
|
||||
testning/ADGS
|
||||
+ t.ex.
|
||||
tex
|
||||
Texas
|
||||
text/DHOS
|
||||
***************
|
||||
*** 21336,21341 ****
|
||||
--- 21383,21389 ----
|
||||
tippa/ACMNPS
|
||||
tips/BDS
|
||||
tipsa/ACJMNPS
|
||||
+ tis.
|
||||
tisdag/ADGS
|
||||
tistel/EIS
|
||||
titan/S
|
||||
***************
|
||||
*** 21463,21468 ****
|
||||
--- 21511,21517 ----
|
||||
tolv<6C>rig/OS
|
||||
tolv<6C>rs/S
|
||||
Tom
|
||||
+ t.o.m.
|
||||
tom/LMS
|
||||
Tomas
|
||||
tomat/DHS
|
||||
***************
|
||||
*** 21513,21518 ****
|
||||
--- 21562,21568 ----
|
||||
torped/ADHS
|
||||
torpedb<64>t/ADGS
|
||||
torr/MOPS
|
||||
+ tab.
|
||||
+ tis.
|
||||
+ tors.
|
||||
torsdag/ADGS
|
||||
torsk/DGS
|
||||
Torsten/A
|
||||
***************
|
||||
*** 22359,22364 ****
|
||||
--- 22409,22415 ----
|
||||
uppkomst/DS
|
||||
uppkoppling/ADGS
|
||||
uppkrupen/MS
|
||||
+ u.a.
|
||||
+ uppl.
|
||||
upplaga/AEGOS
|
||||
upplagd/OS
|
||||
upplage/S
|
||||
***************
|
||||
*** 22639,22644 ****
|
||||
--- 22690,22696 ----
|
||||
utf<74>rar/DJQS
|
||||
utf<74>rare/AEJS
|
||||
utf<74>rlig/OPS
|
||||
+ utg.
|
||||
utgallra/ACMNPS
|
||||
utgamla/S
|
||||
utgammal/MS
|
||||
***************
|
||||
*** 23003,23008 ****
|
||||
--- 23055,23061 ----
|
||||
varannan/S
|
||||
varav/S
|
||||
Varberg/A
|
||||
+ vard.
|
||||
varda/BDS
|
||||
vardag/ADGS
|
||||
vardaglig/OPS
|
||||
***************
|
||||
*** 23091,23096 ****
|
||||
--- 23144,23150 ----
|
||||
Vaxholm/A
|
||||
vaxljus/BDS
|
||||
Vaxmora
|
||||
+ vd
|
||||
VD
|
||||
ve/GS
|
||||
veck/ABDS
|
||||
***************
|
||||
*** 23203,23208 ****
|
||||
--- 23257,23264 ----
|
||||
vettl<74>s/OS
|
||||
vev/DS
|
||||
veva/ACJMNPS
|
||||
+ v.g.
|
||||
+ v.g.v.
|
||||
vi/ACEOS
|
||||
vibration/ADHS
|
||||
vibrator/AES
|
||||
***************
|
||||
*** 23416,23421 ****
|
||||
--- 23472,23478 ----
|
||||
VM
|
||||
vokabul<75>r/S
|
||||
vokal/DHS
|
||||
+ vard.
|
||||
+ vd
|
||||
+ vol.
|
||||
volont<6E>r/ADHS
|
||||
volt/S
|
||||
Volvo/A
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim script for testing colors
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Contributors: Rafael Garcia-Suarez, Charles Campbell
|
||||
" Last Change: 2001 Jul 28
|
||||
" Last Change: 2006 Feb 20
|
||||
|
||||
" edit this file, then do ":source %", and check if the colors match
|
||||
|
||||
@@ -52,6 +52,16 @@
|
||||
" lightcyan lightcyan_on_white white_on_lightcyan
|
||||
" lightcyan_on_black black_on_lightcyan
|
||||
|
||||
" Open this file in a window if it isn't edited yet.
|
||||
" Use the current window if it's empty.
|
||||
if expand('%:p') != expand('<sfile>:p')
|
||||
if &mod || line('$') != 1 || getline(1) != ''
|
||||
exe "new " . expand('<sfile>')
|
||||
else
|
||||
exe "edit " . expand('<sfile>')
|
||||
endif
|
||||
endif
|
||||
|
||||
syn clear
|
||||
8
|
||||
while search("_on_", "W") < 55
|
||||
@@ -60,6 +70,5 @@ while search("_on_", "W") < 55
|
||||
exec 'hi col_'.col1.'_'.col2.' ctermfg='.col1.' guifg='.col1.' ctermbg='.col2.' guibg='.col2
|
||||
exec 'syn keyword col_'.col1.'_'.col2.' '.col1.'_on_'.col2
|
||||
endwhile
|
||||
8,55g/^" \a/exec 'hi col_'.expand("<cword>").' ctermfg='.expand("<cword>").' guifg='.expand("<cword>")|
|
||||
\ exec 'syn keyword col_'.expand("<cword>")." ".expand("<cword>")
|
||||
8,54g/^" \a/exec 'hi col_'.expand("<cword>").' ctermfg='.expand("<cword>").' guifg='.expand("<cword>")| exec 'syn keyword col_'.expand("<cword>")." ".expand("<cword>")
|
||||
nohlsearch
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
" Vim syntax file
|
||||
" Language: Dot
|
||||
" Filenames: *.dot
|
||||
" Maintainer: Markus Mottl <markus@oefai.at>
|
||||
" URL: http://www.oefai.at/~markus/vim/syntax/dot.vim
|
||||
" Last Change: 2004 Jul 26
|
||||
" Maintainer: Markus Mottl <markus.mottl@gmail.com>
|
||||
" URL: http://www.ocaml.info/vim/syntax/dot.vim
|
||||
" Last Change: 2006 Feb 05
|
||||
" 2001 May 04 - initial version
|
||||
|
||||
" For version 5.x: Clear all syntax items
|
||||
|
||||
@@ -138,7 +138,7 @@ syn keyword gnuplotType boxxy[errorbars] csplines dots fsteps histeps impulses
|
||||
syn keyword gnuplotType line[s] linesp[oints] points poiinttype sbezier splines steps
|
||||
" w lt lw ls = optional
|
||||
syn keyword gnuplotType vectors xerr[orbars] xyerr[orbars] yerr[orbars] financebars candlesticks vector
|
||||
syn keyword gnuplotType errorb[ars surface
|
||||
syn keyword gnuplotType errorb[ars] surface
|
||||
syn keyword gnuplotType filledcurve[s] pm3d x1 x2 y1 y2 xy closed
|
||||
syn keyword gnuplotType at pi front
|
||||
syn keyword gnuplotType errorlines xerrorlines yerrorlines xyerrorlines
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
" Vim syntax file
|
||||
" Language: LambdaProlog (Teyjus)
|
||||
" Filenames: *.mod *.sig
|
||||
" Maintainer: Markus Mottl <markus@oefai.at>
|
||||
" URL: http://www.oefai.at/~markus/vim/syntax/lprolog.vim
|
||||
" Last Change: 2004 Jul 26
|
||||
" Maintainer: Markus Mottl <markus.mottl@gmail.com>
|
||||
" URL: http://www.ocaml.info/vim/syntax/lprolog.vim
|
||||
" Last Change: 2006 Feb 05
|
||||
" 2001 Apr 26 - Upgraded for new Vim version
|
||||
" 2000 Jun 5 - Initial release
|
||||
|
||||
|
||||
128
runtime/syntax/mgl.vim
Normal file
128
runtime/syntax/mgl.vim
Normal file
@@ -0,0 +1,128 @@
|
||||
" Vim syntax file
|
||||
" Language: MGL
|
||||
" Version: 1.0
|
||||
" Last Change: 2006 Feb 21
|
||||
" Maintainer: Gero Kuhlmann <gero@gkminix.han.de>
|
||||
"
|
||||
" $Id$
|
||||
"
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
syn sync lines=250
|
||||
|
||||
syn keyword mglBoolean true false
|
||||
syn keyword mglConditional if else then
|
||||
syn keyword mglConstant nil
|
||||
syn keyword mglPredefined maxint
|
||||
syn keyword mglLabel case goto label
|
||||
syn keyword mglOperator to downto in of with
|
||||
syn keyword mglOperator and not or xor div mod
|
||||
syn keyword mglRepeat do for repeat while to until
|
||||
syn keyword mglStatement procedure function break continue return restart
|
||||
syn keyword mglStatement program begin end const var type
|
||||
syn keyword mglStruct record
|
||||
syn keyword mglType integer string char boolean char ipaddr array
|
||||
|
||||
|
||||
" String
|
||||
if !exists("mgl_one_line_string")
|
||||
syn region mglString matchgroup=mglString start=+'+ end=+'+ contains=mglStringEscape
|
||||
syn region mglString matchgroup=mglString start=+"+ end=+"+ contains=mglStringEscapeGPC
|
||||
else
|
||||
"wrong strings
|
||||
syn region mglStringError matchgroup=mglStringError start=+'+ end=+'+ end=+$+ contains=mglStringEscape
|
||||
syn region mglStringError matchgroup=mglStringError start=+"+ end=+"+ end=+$+ contains=mglStringEscapeGPC
|
||||
"right strings
|
||||
syn region mglString matchgroup=mglString start=+'+ end=+'+ oneline contains=mglStringEscape
|
||||
syn region mglString matchgroup=mglString start=+"+ end=+"+ oneline contains=mglStringEscapeGPC
|
||||
end
|
||||
syn match mglStringEscape contained "''"
|
||||
syn match mglStringEscapeGPC contained '""'
|
||||
|
||||
|
||||
if exists("mgl_symbol_operator")
|
||||
syn match mglSymbolOperator "[+\-/*=\%]"
|
||||
syn match mglSymbolOperator "[<>]=\="
|
||||
syn match mglSymbolOperator "<>"
|
||||
syn match mglSymbolOperator ":="
|
||||
syn match mglSymbolOperator "[()]"
|
||||
syn match mglSymbolOperator "\.\."
|
||||
syn match mglMatrixDelimiter "(."
|
||||
syn match mglMatrixDelimiter ".)"
|
||||
syn match mglMatrixDelimiter "[][]"
|
||||
endif
|
||||
|
||||
syn match mglNumber "-\=\<\d\+\>"
|
||||
syn match mglHexNumber "\$[0-9a-fA-F]\+\>"
|
||||
syn match mglCharacter "\#[0-9]\+\>"
|
||||
syn match mglIpAddr "[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\>"
|
||||
|
||||
syn region mglComment start="(\*" end="\*)"
|
||||
syn region mglComment start="{" end="}"
|
||||
syn region mglComment start="//" end="$"
|
||||
|
||||
if !exists("mgl_no_functions")
|
||||
syn keyword mglFunction dispose new
|
||||
syn keyword mglFunction get load print select
|
||||
syn keyword mglFunction odd pred succ
|
||||
syn keyword mglFunction chr ord abs sqr
|
||||
syn keyword mglFunction exit
|
||||
syn keyword mglOperator at timeout
|
||||
endif
|
||||
|
||||
|
||||
syn region mglPreProc start="(\*\$" end="\*)"
|
||||
syn region mglPreProc start="{\$" end="}"
|
||||
|
||||
syn keyword mglException try except raise
|
||||
syn keyword mglPredefined exception
|
||||
|
||||
|
||||
" Define the default highlighting.
|
||||
" For version 5.7 and earlier: only when not done already
|
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
||||
if version >= 508 || !exists("did_mgl_syn_inits")
|
||||
if version < 508
|
||||
let did_mgl_syn_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
HiLink mglBoolean Boolean
|
||||
HiLink mglComment Comment
|
||||
HiLink mglConditional Conditional
|
||||
HiLink mglConstant Constant
|
||||
HiLink mglException Exception
|
||||
HiLink mglFunction Function
|
||||
HiLink mglLabel Label
|
||||
HiLink mglMatrixDelimiter Identifier
|
||||
HiLink mglNumber Number
|
||||
HiLink mglHexNumber Number
|
||||
HiLink mglCharacter Number
|
||||
HiLink mglIpAddr Number
|
||||
HiLink mglOperator Operator
|
||||
HiLink mglPredefined mglFunction
|
||||
HiLink mglPreProc PreProc
|
||||
HiLink mglRepeat Repeat
|
||||
HiLink mglStatement Statement
|
||||
HiLink mglString String
|
||||
HiLink mglStringEscape Special
|
||||
HiLink mglStringEscapeGPC Special
|
||||
HiLink mglStringError Error
|
||||
HiLink mglStruct mglStatement
|
||||
HiLink mglSymbolOperator mglOperator
|
||||
HiLink mglType Type
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
|
||||
let b:current_syntax = "mgl"
|
||||
|
||||
" vim: ts=8 sw=2
|
||||
@@ -2,8 +2,8 @@
|
||||
" Language: shell (sh) Korn shell (ksh) bash (sh)
|
||||
" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
|
||||
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
|
||||
" Last Change: Dec 29, 2005
|
||||
" Version: 79
|
||||
" Last Change: Feb 01, 2006
|
||||
" Version: 80
|
||||
" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
|
||||
"
|
||||
" Using the following VIM variables: {{{1
|
||||
@@ -173,7 +173,7 @@ syn match shComma contained ","
|
||||
" ====
|
||||
syn match shCaseBar contained skipwhite "[^|"`'()]\{-}|"hs=e nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote
|
||||
syn match shCaseStart contained skipwhite skipnl "(" nextgroup=shCase,shCaseBar
|
||||
syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="[^#$()]\{-})"ms=s,hs=e end=";;" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,,shComment
|
||||
syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="[^#$()'"]\{-})"ms=s,hs=e end=";;" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment
|
||||
syn region shCaseEsac matchgroup=shConditional start="\<case\>" end="\<esac\>" contains=@shCaseEsacList
|
||||
syn keyword shCaseIn contained skipwhite skipnl in nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote
|
||||
if exists("b:is_bash")
|
||||
@@ -181,7 +181,7 @@ if exists("b:is_bash")
|
||||
else
|
||||
syn region shCaseExSingleQuote matchgroup=Error start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained
|
||||
endif
|
||||
syn region shCaseSingleQuote matchgroup=shOperator start=+'+ end=+'+ contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained
|
||||
syn region shCaseSingleQuote matchgroup=shOperator start=+'+ end=+'+ contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained
|
||||
syn region shCaseDoubleQuote matchgroup=shOperator start=+"+ skip=+\\\\\|\\.+ end=+"+ contains=@shDblQuoteList,shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained
|
||||
syn region shCaseCommandSub start=+`+ skip=+\\\\\|\\.+ end=+`+ contains=@shCommandSubList skipwhite skipnl nextgroup=shCaseBar contained
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
" Vim syntax file
|
||||
" Language: SML
|
||||
" Filenames: *.sml *.sig
|
||||
" Maintainers: Markus Mottl <markus@oefai.at>
|
||||
" Maintainers: Markus Mottl <markus.mottl@gmail.com>
|
||||
" Fabrizio Zeno Cornelli <zeno@filibusta.crema.unimi.it>
|
||||
" URL: http://www.oefai.at/~markus/vim/syntax/sml.vim
|
||||
" Last Change: 2004 Jul 26
|
||||
" URL: http://www.ocaml.info/vim/syntax/sml.vim
|
||||
" Last Change: 2006 Feb 05
|
||||
" 2001 Nov 20 - Fixed small highlighting bug with modules (MM)
|
||||
" 2001 Aug 29 - Fixed small highlighting bug (MM)
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: Vim 7.0 script
|
||||
" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
|
||||
" Last Change: Jan 09, 2006
|
||||
" Version: 7.0-22
|
||||
" Last Change: February 21, 2006
|
||||
" Version: 7.0-27
|
||||
" Automatically generated keyword lists: {{{1
|
||||
|
||||
" Quit when a syntax file was already loaded {{{2
|
||||
@@ -16,11 +16,11 @@ syn keyword vimTodo contained COMBAK NOT RELEASED TODO WIP
|
||||
syn cluster vimCommentGroup contains=vimTodo,@Spell
|
||||
|
||||
" regular vim commands {{{2
|
||||
syn keyword vimCommand contained ab[breviate] abc[lear] abo[veleft] al[l] arga[dd] argd[elete] argdo arge[dit] argg[lobal] argl[ocal] ar[gs] argu[ment] as[cii] bad[d] ba[ll] bd[elete] be bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bN[ext] bo[tright] bp[revious] brea[k] breaka[dd] breakd[el] breakl[ist] br[ewind] bro[wse] bufdo b[uffer] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] cad[dfile] cal[l] cat[ch] cb[uffer] cc ccl[ose] cd ce[nter] cex[pr] cf[ile] cfir[st] cg[etfile] c[hange] changes chd[ir] che[ckpath] checkt[ime] cla[st] cl[ist] clo[se] cmapc[lear] cnew[er] cn[ext] cN[ext] cnf[ile] cNf[ile] cnorea[bbrev] col[der] colo[rscheme] comc[lear] comp[iler] conf[irm] con[tinue] cope[n] co[py] cpf[ile] cp[revious] cq[uit] cr[ewind] cuna[bbrev] cu[nmap] cw[indow] debugg[reedy] delc[ommand] d[elete] DeleteFirst delf[unction] delm[arks] diffg[et] diffoff diffpatch diffpu[t] diffsplit diffthis diffu[pdate] dig[raphs] di[splay] dj[ump] dl[ist] dr[op] ds[earch] dsp[lit] echoe[rr] echom[sg] echon e[dit] el[se] elsei[f] em[enu] emenu* endfo[r] endf[unction] en[dif] endt[ry] endw[hile] ene[w] ex exi[t] Explore exu[sage] f[ile] files filetype fina[lly] fin[d] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] folddoc[losed] foldd[oopen] foldo[pen] for fu[nction] g[lobal] go[to] gr[ep] grepa[dd] ha[rdcopy] h[elp] helpf[ind] helpg[rep] helpt[ags] Hexplore hid[e] his[tory] I ia[bbrev] iabc[lear] if ij[ump] il[ist] imapc[lear] inorea[bbrev] is[earch] isp[lit] iuna[bbrev] iu[nmap] j[oin] ju[mps] k keepalt keepj[umps] kee[pmarks] lan[guage] la[st] lc[d] lch[dir] le[ft] lefta[bove] l[ist] lm[ap] lmapc[lear] ln[oremap] lo[adview] loc[kmarks] lockv[ar] ls lu[nmap] mak[e] ma[rk] marks mat[ch] menut[ranslate] mk[exrc] mks[ession] mksp[ell] mkvie[w] mkv[imrc] mod[e] m[ove] mzf[ile] mz[scheme] nbkey NetrwSettings new n[ext] N[ext] nmapc[lear] noh[lsearch] norea[bbrev] Nread nu[mber] nun[map] Nw omapc[lear] on[ly] o[pen] opt[ions] ou[nmap] pc[lose] ped[it] pe[rl] perld[o] po[p] popu popu[p] pp[op] pre[serve] prev[ious] p[rint] P[rint] profd[el] prof[ile] prompt promptf[ind] promptr[epl] ps[earch] pta[g] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptN[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] pyf[ile] py[thon] qa[ll] q[uit] quita[ll] r[ead] rec[over] redi[r] red[o] redr[aw] redraws[tatus] reg[isters] res[ize] ret[ab] retu[rn] rew[ind] ri[ght] rightb[elow] rub[y] rubyd[o] rubyf[ile] ru[ntime] rv[iminfo] sal[l] san[dbox] sa[rgument] sav[eas] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbN[ext] sbp[revious] sbr[ewind] sb[uffer] scripte[ncoding] scrip[tnames] se[t] setf[iletype] setg[lobal] setl[ocal] Sexplore sf[ind] sfir[st] sh[ell] sign sil[ent] sim[alt] sla[st] sl[eep] sm[agic] sn[ext] sN[ext] sni[ff] sno[magic] sor[t] so[urce] spelld[ump] spe[llgood] spellr[epall] spellw[rong] sp[lit] spr[evious] sre[wind] sta[g] star[tinsert] startr[eplace] stj[ump] st[op] stopi[nsert] sts[elect] sun[hide] sus[pend] sv[iew] syncbind t ta[g] tags tc[l] tcld[o] tclf[ile] te[aroff] tf[irst] the th[row] tj[ump] tl[ast] tm tm[enu] tn[ext] tN[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] tu tu[nmenu] una[bbreviate] u[ndo] unh[ide] unlo[ckvar] unm[ap] up[date] verb[ose] ve[rsion] vert[ical] Vexplore v[global] vie[w] vim[grep] vimgrepa[dd] vi[sual] viu[sage] vmapc[lear] vne[w] vs[plit] vu[nmap] wa[ll] wh[ile] winc[md] windo winp[os] win[size] wn[ext] wN[ext] wp[revious] wq wqa[ll] w[rite] ws[verb] wv[iminfo] X xa[ll] x[it] XMLent XMLns y[ank]
|
||||
syn keyword vimCommand contained ab[breviate] abc[lear] abo[veleft] al[l] arga[dd] argd[elete] argdo arge[dit] argg[lobal] argl[ocal] ar[gs] argu[ment] as[cii] bad[d] ba[ll] bd[elete] be bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bN[ext] bo[tright] bp[revious] brea[k] breaka[dd] breakd[el] breakl[ist] br[ewind] bro[wse] bufdo b[uffer] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] caddb[uffer] cad[dexpr] caddf[ile] cal[l] cat[ch] cb[uffer] cc ccl[ose] cd ce[nter] cex[pr] cf[ile] cfir[st] cg[etfile] c[hange] changes chd[ir] che[ckpath] checkt[ime] cla[st] cl[ist] clo[se] cmapc[lear] cnew[er] cn[ext] cN[ext] cnf[ile] cNf[ile] cnorea[bbrev] col[der] colo[rscheme] comc[lear] comp[iler] conf[irm] con[tinue] cope[n] co[py] cpf[ile] cp[revious] cq[uit] cr[ewind] cuna[bbrev] cu[nmap] cw[indow] debugg[reedy] delc[ommand] d[elete] DeleteFirst delf[unction] delm[arks] diffg[et] diffoff diffpatch diffpu[t] diffsplit diffthis diffu[pdate] dig[raphs] di[splay] dj[ump] dl[ist] dr[op] ds[earch] dsp[lit] echoe[rr] echom[sg] echon e[dit] el[se] elsei[f] em[enu] emenu* endfo[r] endf[unction] en[dif] endt[ry] endw[hile] ene[w] ex exi[t] Explore exu[sage] f[ile] files filetype fina[lly] fin[d] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] folddoc[losed] foldd[oopen] foldo[pen] for fu[nction] g[lobal] go[to] gr[ep] grepa[dd] ha[rdcopy] h[elp] helpf[ind] helpg[rep] helpt[ags] Hexplore hid[e] his[tory] I ia[bbrev] iabc[lear] if ij[ump] il[ist] imapc[lear] inorea[bbrev] is[earch] isp[lit] iuna[bbrev] iu[nmap] j[oin] ju[mps] k keepalt keepj[umps] kee[pmarks] laddb[uffer] lad[dexpr] laddf[ile] lan[guage] la[st] lb[uffer] lc[d] lch[dir] lcl[ose] le[ft] lefta[bove] lex[pr] lf[ile] lfir[st] lg[etfile] lgr[ep] lgrepa[dd] lh[elpgrep] l[ist] ll lla[st] lli[st] lmak[e] lm[ap] lmapc[lear] lnew[er] lne[xt] lN[ext] lnf[ile] lNf[ile] ln[oremap] lo[adview] loc[kmarks] lockv[ar] lol[der] lop[en] lpf[ile] lp[revious] lr[ewind] ls lt[ag] lu[nmap] lv[imgrep] lvimgrepa[dd] lw[indow] mak[e] ma[rk] marks mat[ch] menut[ranslate] mk[exrc] mks[ession] mksp[ell] mkvie[w] mkv[imrc] mod[e] m[ove] mzf[ile] mz[scheme] nbkey NetrwSettings new n[ext] N[ext] nmapc[lear] noh[lsearch] norea[bbrev] Nread nu[mber] nun[map] Nw omapc[lear] on[ly] o[pen] opt[ions] ou[nmap] pc[lose] ped[it] pe[rl] perld[o] po[p] popu popu[p] pp[op] pre[serve] prev[ious] p[rint] P[rint] profd[el] prof[ile] prompt promptf[ind] promptr[epl] ps[earch] pta[g] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptN[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] pyf[ile] py[thon] qa[ll] q[uit] quita[ll] r[ead] rec[over] redi[r] red[o] redr[aw] redraws[tatus] reg[isters] res[ize] ret[ab] retu[rn] rew[ind] ri[ght] rightb[elow] rub[y] rubyd[o] rubyf[ile] ru[ntime] rv[iminfo] sal[l] san[dbox] sa[rgument] sav[eas] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbN[ext] sbp[revious] sbr[ewind] sb[uffer] scripte[ncoding] scrip[tnames] se[t] setf[iletype] setg[lobal] setl[ocal] Sexplore sf[ind] sfir[st] sh[ell] sign sil[ent] sim[alt] sla[st] sl[eep] sm[agic] sn[ext] sN[ext] sni[ff] sno[magic] sor[t] so[urce] spelld[ump] spe[llgood] spellr[epall] spellw[rong] sp[lit] spr[evious] sre[wind] sta[g] startg[replace] star[tinsert] startr[eplace] stj[ump] st[op] stopi[nsert] sts[elect] sun[hide] sus[pend] sv[iew] syncbind t tab tabc[lose] tabe[dit] tabf[ind] tabn[ew] tabo[nly] tabs ta[g] tags tc[l] tcld[o] tclf[ile] te[aroff] tf[irst] the th[row] tj[ump] tl[ast] tm tm[enu] tn[ext] tN[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] tu tu[nmenu] una[bbreviate] u[ndo] unh[ide] unlo[ckvar] unm[ap] up[date] verb[ose] ve[rsion] vert[ical] Vexplore v[global] vie[w] vim[grep] vimgrepa[dd] vi[sual] viu[sage] vmapc[lear] vne[w] vs[plit] vu[nmap] wa[ll] wh[ile] winc[md] windo winp[os] win[size] wn[ext] wN[ext] wp[revious] wq wqa[ll] w[rite] ws[verb] wv[iminfo] X xa[ll] x[it] XMLent XMLns y[ank]
|
||||
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 completeopt confirm consk conskey copyindent cot 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 oft ofu omnifunc 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 completeopt confirm consk conskey copyindent cot 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 fex 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 formatexpr 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 oft ofu omnifunc operatorfunc opfunc 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 showtabline 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 stal startofline statusline stl stmp sts su sua suffixes suffixesadd sw swapfile swapsync swb swf switchbuf sws sxq syn synmaxcol syntax ta tabline tabstop tag tagbsearch taglength tagrelative tags tagstack tal 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
|
||||
@@ -42,20 +42,20 @@ syn match vimOption contained "t_k;"
|
||||
" unsupported settings: these are supported by vi but don't do anything in vim {{{2
|
||||
syn keyword vimErrSetting contained hardtabs ht w1200 w300 w9600
|
||||
|
||||
" AutoBuf Events {{{2
|
||||
" AutoCmd Events {{{2
|
||||
syn case ignore
|
||||
syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre Cmd-event CmdwinEnter CmdwinLeave ColorScheme CursorHold E135 E143 E200 E201 E203 E204 EncodingChanged FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter InsertChange InsertEnter InsertLeave MenuPopup QuickFixCmdPost QuickFixCmdPre RemoteReply SessionLoadPost StdinReadPost StdinReadPre SwapExists Syntax TermChanged TermResponse User UserGettingBored VimEnter VimLeave VimLeavePre WinEnter WinLeave
|
||||
syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre Cmd-event CmdwinEnter CmdwinLeave ColorScheme CursorHold CursorHoldI CursorMoved CursorMovedI E135 E143 E200 E201 E203 E204 EncodingChanged FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter InsertChange InsertEnter InsertLeave MenuPopup QuickFixCmdPost QuickFixCmdPre RemoteReply SessionLoadPost SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabEnter TabLeave TermChanged TermResponse User UserGettingBored VimEnter VimLeave VimLeavePre WinEnter WinLeave
|
||||
|
||||
" Highlight commonly used Groupnames {{{2
|
||||
syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo
|
||||
|
||||
" Default highlighting groups {{{2
|
||||
syn keyword vimHLGroup contained Cursor CursorIM DiffAdd DiffChange DiffDelete DiffText Directory ErrorMsg FoldColumn Folded IncSearch LineNr Menu ModeMsg MoreMsg NonText Normal Pmenu PmenuSbar PmenuSel PmenuThumb Question Scrollbar Search SignColumn SpecialKey SpellBad SpellCap SpellLocal SpellRare StatusLine StatusLineNC Title Tooltip VertSplit Visual VisualNOS WarningMsg WildMenu
|
||||
syn keyword vimHLGroup contained Cursor CursorIM DiffAdd DiffChange DiffDelete DiffText Directory ErrorMsg FoldColumn Folded IncSearch LineNr Menu ModeMsg MoreMsg NonText Normal Pmenu PmenuSbar PmenuSel PmenuThumb Question Scrollbar Search SignColumn SpecialKey SpellBad SpellCap SpellLocal SpellRare StatusLine StatusLineNC TabLine TabLineFill TabLineSel Title Tooltip VertSplit Visual VisualNOS WarningMsg WildMenu
|
||||
syn match vimHLGroup contained "Conceal"
|
||||
syn case match
|
||||
|
||||
" Function Names {{{2
|
||||
syn keyword vimFuncName contained add append argc argidx argv browse browsedir bufexists buflisted bufloaded bufname bufnr bufwinnr byte2line byteidx call char2nr cindent col complete_add complete_check confirm copy count cscope_connection cursor deepcopy delete did_filetype diff_filler diff_hlID empty escape eval eventhandler executable exists expand expr8 extend filereadable filewritable filter finddir findfile fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreground function garbagecollect get getbufline getbufvar getchar getcharmod getcmdline getcmdpos getcmdtype getcwd getfontname getfperm getfsize getftime getftype getline getqflist getreg getregtype getwinposx getwinposy getwinvar glob globpath has has_key hasmapto histadd histdel histget histnr hlexists hlID hostname iconv indent index input inputdialog inputlist inputrestore inputsave inputsecret insert isdirectory islocked items join keys len libcall libcallnr line line2byte lispindent localtime map maparg mapcheck match matchend matchlist matchstr max min mkdir mode nextnonblank nr2char prevnonblank printf range readfile remote_expr remote_foreground remote_peek remote_read remote_send remove rename repeat resolve reverse search searchdecl searchpair server2client serverlist setbufvar setcmdpos setline setqflist setreg setwinvar simplify sort soundfold spellbadword spellsuggest split strftime stridx string strlen strpart strridx strtrans submatch substitute synID synIDattr synIDtrans system tagfiles taglist tempname tolower toupper tr type values virtcol visualmode winbufnr wincol winheight winline winnr winrestcmd winwidth writefile
|
||||
syn keyword vimFuncName contained add append argc argidx argv browse browsedir bufexists buflisted bufloaded bufname bufnr bufwinnr byte2line byteidx call char2nr cindent col complete_add complete_check confirm copy count cscope_connection cursor deepcopy delete did_filetype diff_filler diff_hlID empty escape eval eventhandler executable exists expand expr8 extend filereadable filewritable filter finddir findfile fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreground function garbagecollect get getbufline getbufvar getchar getcharmod getcmdline getcmdpos getcmdtype getcwd getfontname getfperm getfsize getftime getftype getline getloclist getqflist getreg getregtype getwinposx getwinposy getwinvar glob globpath has has_key hasmapto histadd histdel histget histnr hlexists hlID hostname iconv indent index input inputdialog inputlist inputrestore inputsave inputsecret insert isdirectory islocked items join keys len libcall libcallnr line line2byte lispindent localtime map maparg mapcheck match matchend matchlist matchstr max min mkdir mode nextnonblank nr2char prevnonblank printf pumvisible range readfile remote_expr remote_foreground remote_peek remote_read remote_send remove rename repeat resolve reverse search searchdecl searchpair searchpairpos searchpos server2client serverlist setbufvar setcmdpos setline setloclist setqflist setreg setwinvar simplify sort soundfold spellbadword spellsuggest split strftime stridx string strlen strpart strridx strtrans submatch substitute synID synIDattr synIDtrans system tabpagebuflist tabpagenr tabpagewinnr tagfiles taglist tempname tolower toupper tr type values virtcol visualmode winbufnr wincol winheight winline winnr winrestcmd winwidth writefile
|
||||
|
||||
"--- syntax above generated by mkvimvim ---
|
||||
" Special Vim Highlighting (not automatic) {{{1
|
||||
@@ -126,7 +126,7 @@ syn keyword vimPattern contained start skip end
|
||||
syn cluster vimOperGroup contains=vimOper,vimOperParen,vimNumber,vimString,vimOperOk,vimRegister,vimContinue
|
||||
syn match vimOper "\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile
|
||||
syn match vimOper "||\|&&\|[-+.]" skipwhite nextgroup=vimString,vimSpecFile
|
||||
syn region vimOperParen oneline matchgroup=vimOper start="(" end=")" contains=@vimOperGroup
|
||||
syn region vimOperParen matchgroup=vimOper start="(" end=")" contains=@vimOperGroup
|
||||
syn region vimOperParen matchgroup=vimSep start="{" end="}" contains=@vimOperGroup nextgroup=vimVar
|
||||
syn match vimOperOk "\<[aiAIrR][()]"
|
||||
if !exists("g:vimsyntax_noerror")
|
||||
@@ -185,7 +185,6 @@ syn match vimEnvvar "\${\I\i*}"
|
||||
" In-String Specials: {{{2
|
||||
" Try to catch strings, if nothing else matches (therefore it must precede the others!)
|
||||
" vimEscapeBrace handles ["] []"] (ie. "s don't terminate string inside [])
|
||||
" COMBAK: I don't know why the \ze is needed in vimPatSepZone
|
||||
syn region vimEscapeBrace oneline contained transparent start="[^\\]\(\\\\\)*\[\^\=\]\=" skip="\\\\\|\\\]" end="\]"me=e-1
|
||||
syn match vimPatSepErr contained "\\)"
|
||||
syn match vimPatSep contained "\\|"
|
||||
@@ -194,7 +193,7 @@ syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%
|
||||
syn match vimNotPatSep contained "\\\\"
|
||||
syn cluster vimStringGroup contains=vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone
|
||||
syn region vimString oneline keepend start=+[^:a-zA-Z>!\\@]"+lc=1 skip=+\\\\\|\\"+ end=+"+ contains=@vimStringGroup
|
||||
syn region vimString oneline keepend start=+[^:a-zA-Z>!\\@]'+lc=1 end=+'+ contains=@vimStringGroup
|
||||
syn region vimString oneline keepend start=+[^:a-zA-Z>!\\@]'+lc=1 end=+'+
|
||||
syn region vimString oneline start=+=!+lc=1 skip=+\\\\\|\\!+ end=+!+ contains=@vimStringGroup
|
||||
syn region vimString oneline start="=+"lc=1 skip="\\\\\|\\+" end="+" contains=@vimStringGroup
|
||||
syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup
|
||||
@@ -221,7 +220,7 @@ syn match vimSubstFlagErr contained "[^< \t\r|]\+" contains=vimSubstFlags
|
||||
syn match vimSubstFlags contained "[&cegiIpr]\+"
|
||||
|
||||
" 'String': {{{2
|
||||
syn match vimString "[^(,]'[^']\{-}'"lc=1 contains=@vimStringGroup
|
||||
syn match vimString "[^(,]'[^']\{-}\zs'"
|
||||
|
||||
" Marks, Registers, Addresses, Filters: {{{2
|
||||
syn match vimMark "'[a-zA-Z0-9]\ze[-+,!]" nextgroup=vimOper,vimMarkNumber,vimSubst
|
||||
@@ -249,8 +248,8 @@ syn match vimFilter contained "\A!.\{-}\(|\|$\)"ms=s+1 contains=vimSpecFile
|
||||
"syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\)'
|
||||
|
||||
" Set command and associated set-options (vimOptions) with comment {{{2
|
||||
syn region vimSet matchgroup=vimCommand start="\<setlocal\|set\>" end="|"me=e-1 end="$" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vimSetString,vimSetMod
|
||||
syn region vimSetEqual contained start="=" skip="\\\\\|\\\s" end="[| \t]\|$"me=e-1 contains=vimCtrlChar,vimSetSep,vimNotation
|
||||
syn region vimSet matchgroup=vimCommand start="\<setlocal\|set\>" skip="\%(\\\\\)*\\." end="$" matchgroup=vimNotation end="<[cC][rR]>" keepend oneline contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vimSetString,vimSetMod
|
||||
syn region vimSetEqual contained start="=" skip="\\\\\|\\\s" end="[| \t]\|$"me=e-1 contains=vimCtrlChar,vimSetSep,vimNotation oneline
|
||||
syn region vimSetString contained start=+="+hs=s+1 skip=+\\\\\|\\"+ end=+"+ contains=vimCtrlChar
|
||||
syn match vimSetSep contained "[,:]"
|
||||
syn match vimSetMod contained "&vim\|[!&]\|all&"
|
||||
@@ -277,12 +276,13 @@ syn case match
|
||||
|
||||
" Maps {{{2
|
||||
" ====
|
||||
syn cluster vimMapGroup contains=vimMapBang,vimMapLhs,vimMapMod
|
||||
syn match vimMap "map\ze\s*[^(]"
|
||||
syn keyword vimMap cm[ap] cno[remap] im[ap] ino[remap] nm[ap] nn[oremap] no[remap] om[ap] ono[remap] vm[ap] vn[oremap] skipwhite nextgroup=@vimMapGroup
|
||||
syn match vimMapLhs contained "\S\+" contains=vimNotation,vimCtrlChar
|
||||
syn match vimMapBang contained "!" skipwhite nextgroup=vimMapLhs
|
||||
syn match vimMapMod contained "\c<\(buffer\|\(local\)\=leader\|plug\|script\|sid\|unique\|silent\)\+>" skipwhite contains=vimMapModKey,vimMapModErr nextgroup=@vimMapGroup
|
||||
syn match vimMap "\<map!\=\ze\s*[^(]" skipwhite nextgroup=vimMapMod,vimMapLhs
|
||||
syn keyword vimMap cm[ap] cno[remap] im[ap] ino[remap] nm[ap] nn[oremap] no[remap] om[ap] ono[remap] vm[ap] vn[oremap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
|
||||
syn match vimMapLhs contained "\S\+" contains=vimNotation,vimCtrlChar skipwhite nextgroup=vimMapRhs
|
||||
syn match vimMapBang contained "!" skipwhite nextgroup=vimMapMod,vimMapLhs
|
||||
syn match vimMapMod contained "\c<\(buffer\|\(local\)\=leader\|plug\|script\|sid\|unique\|silent\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs
|
||||
syn match vimMapRhs contained ".*" contains=vimNotation,vimCtrlChar skipnl nextgroup=vimMapRhsExtend
|
||||
syn match vimMapRhsExtend contained "^\s*\\.*$" contains=vimContinue
|
||||
syn case ignore
|
||||
syn keyword vimMapModKey contained buffer leader localleader plug script sid silent unique
|
||||
syn case match
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
" Vim syntax file
|
||||
" Language: Yacc
|
||||
" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
|
||||
" Last Change: Sep 06, 2005
|
||||
" Version: 3
|
||||
" Last Change: Feb 22, 2006
|
||||
" Version: 4
|
||||
" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
|
||||
"
|
||||
" Option:
|
||||
" yacc_uses_cpp : if this variable exists, then C++ is loaded rather than C
|
||||
" g:yacc_uses_cpp : if this variable exists, then C++ is loaded rather than C
|
||||
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
@@ -18,12 +18,12 @@ endif
|
||||
|
||||
" Read the C syntax to start with
|
||||
if version >= 600
|
||||
if exists("yacc_uses_cpp")
|
||||
if exists("g:yacc_uses_cpp")
|
||||
runtime! syntax/cpp.vim
|
||||
else
|
||||
runtime! syntax/c.vim
|
||||
endif
|
||||
elseif exists("yacc_uses_cpp")
|
||||
elseif exists("g:yacc_uses_cpp")
|
||||
so <sfile>:p:h/cpp.vim
|
||||
else
|
||||
so <sfile>:p:h/c.vim
|
||||
@@ -47,7 +47,7 @@ syn region yaccUnion contained matchgroup=yaccCurly start="{" matchgroup=yaccCur
|
||||
syn region yaccUnionCurly contained matchgroup=yaccCurly start="{" matchgroup=yaccCurly end="}" contains=@yaccUnionGroup
|
||||
syn match yaccBrkt contained "[<>]"
|
||||
syn match yaccType "<[a-zA-Z_][a-zA-Z0-9_]*>" contains=yaccBrkt
|
||||
syn match yaccDefinition "^[A-Za-z][A-Za-z0-9_]*[ \t]*:"
|
||||
syn match yaccDefinition "^[A-Za-z][A-Za-z0-9_]*\_s*:"
|
||||
|
||||
" special Yacc separators
|
||||
syn match yaccSectionSep "^[ \t]*%%"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -36,13 +36,16 @@ MacOS Classic is no longer supported. If you really want it use Vim 6.4.
|
||||
directory. You can move this bundle (the Vim.app directory) anywhere
|
||||
you want, for example, /Applications.
|
||||
|
||||
You need at least Xcode 1.5 to compile Vim 7.0.
|
||||
|
||||
|
||||
1.2 X-Windows or Plain Text
|
||||
|
||||
If you do not want the Carbon interface, you must explicitly tell
|
||||
configure to use a different GUI.
|
||||
|
||||
cd ..
|
||||
./configure --enable-gui=gtk2
|
||||
./configure --disable-darwin --enable-gui=gtk2
|
||||
make; make install
|
||||
|
||||
NOTE: The following GUI options are supported:
|
||||
|
||||
@@ -675,6 +675,8 @@ LINK_PDB = /PDB:$(OUTDIR)/$(VIM).pdb -debug:full -debugtype:cv,fixup
|
||||
|
||||
conflags = /nologo /subsystem:$(SUBSYSTEM) /incremental:no
|
||||
|
||||
PATHDEF_SRC = $(OUTDIR)\pathdef.c
|
||||
|
||||
!IF "$(MAP)" == "yes"
|
||||
# "/map" is for debugging
|
||||
conflags = $(conflags) /map
|
||||
@@ -736,7 +738,6 @@ notags:
|
||||
|
||||
clean:
|
||||
- if exist $(OUTDIR)/nul $(DEL_TREE) $(OUTDIR)
|
||||
- if exist auto/pathdef.c del auto/pathdef.c
|
||||
- if exist *.obj del *.obj
|
||||
- if exist $(VIM).exe del $(VIM).exe
|
||||
- if exist $(VIM).ilk del $(VIM).ilk
|
||||
@@ -894,8 +895,8 @@ $(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
|
||||
|
||||
$(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
|
||||
|
||||
$(OUTDIR)/pathdef.obj: $(OUTDIR) auto/pathdef.c $(INCL)
|
||||
$(CC) $(CFLAGS) auto/pathdef.c
|
||||
$(OUTDIR)/pathdef.obj: $(OUTDIR) $(PATHDEF_SRC) $(INCL)
|
||||
$(CC) $(CFLAGS) $(PATHDEF_SRC)
|
||||
|
||||
$(OUTDIR)/popupmenu.obj: $(OUTDIR) popupmenu.c $(INCL)
|
||||
|
||||
@@ -943,16 +944,16 @@ $(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
|
||||
E0_CFLAGS = $(CFLAGS:\=\\)
|
||||
E_CFLAGS = $(E0_CFLAGS:"=\")
|
||||
|
||||
auto/pathdef.c: auto
|
||||
@echo creating auto/pathdef.c
|
||||
@echo /* pathdef.c */ > auto\pathdef.c
|
||||
@echo #include "vim.h" >> auto\pathdef.c
|
||||
@echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> auto\pathdef.c
|
||||
@echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> auto\pathdef.c
|
||||
@echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> auto\pathdef.c
|
||||
@echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(LINKARGS2:\=\\)"; >> auto\pathdef.c
|
||||
@echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> auto\pathdef.c
|
||||
@echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> auto\pathdef.c
|
||||
$(PATHDEF_SRC): auto
|
||||
@echo creating $(PATHDEF_SRC)
|
||||
@echo /* pathdef.c */ > $(PATHDEF_SRC)
|
||||
@echo #include "vim.h" >> $(PATHDEF_SRC)
|
||||
@echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> $(PATHDEF_SRC)
|
||||
@echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> $(PATHDEF_SRC)
|
||||
@echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> $(PATHDEF_SRC)
|
||||
@echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(LINKARGS2:\=\\)"; >> $(PATHDEF_SRC)
|
||||
@echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC)
|
||||
@echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC)
|
||||
|
||||
auto:
|
||||
if not exist auto/nul mkdir auto
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Makefile for Vim on OpenVMS
|
||||
#
|
||||
# Maintainer: Zoltan Arpadffy <arpadffy@polarhome.com>
|
||||
# Last change: 2005 Jul 23
|
||||
# Last change: 2006 Feb 23
|
||||
#
|
||||
# This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64
|
||||
# with MMS and MMK
|
||||
@@ -288,7 +288,7 @@ ALL_LIBS = $(LIBS) $(GUI_LIB_DIR) $(GUI_LIB) \
|
||||
SRC = buffer.c charset.c diff.c digraph.c edit.c eval.c ex_cmds.c ex_cmds2.c \
|
||||
ex_docmd.c ex_eval.c ex_getln.c if_xcmdsrv.c fileio.c fold.c getchar.c \
|
||||
hardcopy.c hashtable.c main.c mark.c menu.c mbyte.c memfile.c memline.c message.c misc1.c \
|
||||
misc2.c move.c normal.c ops.c option.c quickfix.c regexp.c search.c \
|
||||
misc2.c move.c normal.c ops.c option.c popupmenu.c quickfix.c regexp.c search.c \
|
||||
spell.c syntax.c tag.c term.c termlib.c ui.c undo.c version.c screen.c \
|
||||
window.c os_unix.c os_vms.c pathdef.c \
|
||||
$(GUI_SRC) $(PERL_SRC) $(PYTHON_SRC) $(TCL_SRC) $(SNIFF_SRC) \
|
||||
@@ -298,7 +298,7 @@ OBJ = buffer.obj charset.obj diff.obj digraph.obj edit.obj eval.obj \
|
||||
ex_cmds.obj ex_cmds2.obj ex_docmd.obj ex_eval.obj ex_getln.obj \
|
||||
if_xcmdsrv.obj fileio.obj fold.obj getchar.obj hardcopy.obj hashtable.obj main.obj mark.obj \
|
||||
menu.obj memfile.obj memline.obj message.obj misc1.obj misc2.obj \
|
||||
move.obj mbyte.obj normal.obj ops.obj option.obj quickfix.obj \
|
||||
move.obj mbyte.obj normal.obj ops.obj option.obj popupmenu.obj quickfix.obj \
|
||||
regexp.obj search.obj spell.obj syntax.obj tag.obj term.obj termlib.obj \
|
||||
ui.obj undo.obj screen.obj version.obj window.obj os_unix.obj \
|
||||
os_vms.obj pathdef.obj \
|
||||
@@ -607,6 +607,10 @@ pathdef.obj : pathdef.c vim.h [.auto]config.h feature.h os_unix.h \
|
||||
ascii.h keymap.h term.h macros.h structs.h regexp.h \
|
||||
gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
|
||||
globals.h farsi.h arabic.h
|
||||
popupmenu.obj : popupmenu.c vim.h [.auto]config.h feature.h os_unix.h \
|
||||
ascii.h keymap.h term.h macros.h structs.h regexp.h \
|
||||
gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
|
||||
globals.h farsi.h arabic.h
|
||||
quickfix.obj : quickfix.c vim.h [.auto]config.h feature.h os_unix.h \
|
||||
ascii.h keymap.h term.h macros.h structs.h regexp.h \
|
||||
gui.h gui_beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
|
||||
|
||||
19
src/Makefile
19
src/Makefile
@@ -547,6 +547,10 @@ LINT_OPTIONS = -beprxzF
|
||||
#PROFILE_CFLAGS = -DEXITFREE
|
||||
#PROFILE_LIBS = -lccmalloc
|
||||
|
||||
# MAC OS X platform
|
||||
#MAC_OSX_ARCH = -arch ppc
|
||||
MAC_OSX_ARCH = -arch i386 -arch ppc
|
||||
|
||||
#####################################################
|
||||
### Specific systems, check if yours is listed! ### {{{
|
||||
#####################################################
|
||||
@@ -1197,11 +1201,11 @@ PHOTONGUI_BUNDLE =
|
||||
# CARBON GUI
|
||||
CARBONGUI_SRC = gui.c gui_mac.c
|
||||
CARBONGUI_OBJ = objects/gui.o objects/gui_mac.o objects/pty.o
|
||||
CARBONGUI_DEFS = -DFEAT_GUI_MAC -arch ppc -fno-common -fpascal-strings \
|
||||
CARBONGUI_DEFS = -DFEAT_GUI_MAC $(MAC_OSX_ARCH) -fno-common -fpascal-strings \
|
||||
-Wall -Wno-unknown-pragmas \
|
||||
-mdynamic-no-pic -pipe
|
||||
CARBONGUI_IPATH = -I. -Iproto
|
||||
CARBONGUI_LIBS_DIR =
|
||||
CARBONGUI_LIBS_DIR = $(MAC_OSX_ARCH)
|
||||
CARBONGUI_LIBS1 = -framework Carbon
|
||||
CARBONGUI_LIBS2 =
|
||||
CARBONGUI_INSTALL = install_macosx
|
||||
@@ -1510,6 +1514,8 @@ PRO_AUTO = \
|
||||
$(ALL_GUI_PRO) \
|
||||
$(TCL_PRO)
|
||||
|
||||
ICON_APP = gui_mac.icns
|
||||
|
||||
PRO_MANUAL = os_amiga.pro os_msdos.pro os_win16.pro os_win32.pro \
|
||||
os_mswin.pro os_beos.pro os_vms.pro os_riscos.pro $(PERL_PRO)
|
||||
|
||||
@@ -1699,10 +1705,10 @@ types.vim: $(TAGS_SRC) $(TAGS_INCL)
|
||||
#
|
||||
test check:
|
||||
$(MAKE) -f Makefile $(VIMTARGET)
|
||||
cd testdir; $(MAKE) -f Makefile $(GUI_TESTTARGET) VIMPROG=../$(VIMTARGET) $(GUI_TESTARG)
|
||||
@if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \
|
||||
-@if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \
|
||||
cd $(PODIR); $(MAKE) -f Makefile check VIM=../$(VIMTARGET); \
|
||||
fi
|
||||
cd testdir; $(MAKE) -f Makefile $(GUI_TESTTARGET) VIMPROG=../$(VIMTARGET) $(GUI_TESTARG)
|
||||
|
||||
testclean:
|
||||
cd testdir; $(MAKE) -f Makefile clean
|
||||
@@ -2131,6 +2137,10 @@ shadow: runtime pixmaps
|
||||
cp config.mk.dist $(SHADOWDIR)
|
||||
mkdir $(SHADOWDIR)/xxd
|
||||
cd $(SHADOWDIR)/xxd; ln -s ../../xxd/*.[ch] ../../xxd/Make* .
|
||||
if test -f $(ICON_APP); then \
|
||||
cd $(SHADOWDIR); \
|
||||
ln -s ../$(ICON_APP) ../os_mac.rsr.hqx ../dehqx.py .; \
|
||||
fi
|
||||
mkdir $(SHADOWDIR)/testdir
|
||||
cd $(SHADOWDIR)/testdir; ln -s ../../testdir/Makefile \
|
||||
../../testdir/vimrc.unix \
|
||||
@@ -2494,7 +2504,6 @@ M4FLAGSX = $(M4FLAGS) -DAPP_EXE=$(VIMNAME) -DAPP_NAME=$(VIMNAME) \
|
||||
-DAPP_VER=$(VERSION) -DICON_APP=$(ICON_APP)
|
||||
|
||||
### Icons
|
||||
ICON_APP = gui_mac.icns
|
||||
ICONS = $(RESDIR)/$(ICON_APP)
|
||||
|
||||
# If you uncomment the following lines the *.icns in the src directory will be
|
||||
|
||||
8
src/auto/configure
vendored
8
src/auto/configure
vendored
@@ -1009,7 +1009,7 @@ gives unlimited permission to copy, distribute and modify it.
|
||||
_ACEOF
|
||||
exit 0
|
||||
fi
|
||||
exec 5>config.log
|
||||
exec 5>auto/config.log
|
||||
cat >&5 <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
@@ -15088,7 +15088,7 @@ echo $ECHO_N "checking for GCC 3 or later... $ECHO_C" >&6
|
||||
DEPEND_CFLAGS_FILTER=
|
||||
if test "$GCC" = yes; then
|
||||
gccmajor=`"$CC" --version | sed -e '2,$d;s/^[^0-9]*\([1-9]\)\.[0-9.]*.*$/\1/g'`
|
||||
if test "$gccmajor" > "2"; then
|
||||
if test "$gccmajor" -gt "2"; then
|
||||
DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'"
|
||||
fi
|
||||
fi
|
||||
@@ -15455,7 +15455,7 @@ exec 6>&1
|
||||
# Open the log real soon, to keep \$[0] and so on meaningful, and to
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling. Logging --version etc. is OK.
|
||||
exec 5>>config.log
|
||||
exec 5>>auto/config.log
|
||||
{
|
||||
echo
|
||||
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
|
||||
@@ -16285,7 +16285,7 @@ if test "$no_create" != yes; then
|
||||
ac_config_status_args="$ac_config_status_args --quiet"
|
||||
exec 5>/dev/null
|
||||
$SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
|
||||
exec 5>>config.log
|
||||
exec 5>>auto/config.log
|
||||
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
|
||||
# would make configure fail if this is the last instruction.
|
||||
$ac_cs_success || { (exit 1); exit 1; }
|
||||
|
||||
191
src/buffer.c
191
src/buffer.c
@@ -1062,21 +1062,7 @@ do_buffer(action, start, dir, count, forceit)
|
||||
|
||||
/* Close any other windows on this buffer, then make it empty. */
|
||||
#ifdef FEAT_WINDOWS
|
||||
{
|
||||
win_T *wp, *nextwp;
|
||||
|
||||
for (wp = firstwin; wp != NULL; wp = nextwp)
|
||||
{
|
||||
nextwp = wp->w_next;
|
||||
if (wp != curwin && wp->w_buffer == buf)
|
||||
{
|
||||
/* Start all over, autocommands may change the window
|
||||
* layout. */
|
||||
nextwp = firstwin;
|
||||
win_close(wp, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
close_windows(buf, TRUE);
|
||||
#endif
|
||||
setpcmark();
|
||||
retval = do_ecmd(0, NULL, NULL, NULL, ECMD_ONE,
|
||||
@@ -1095,9 +1081,11 @@ do_buffer(action, start, dir, count, forceit)
|
||||
#ifdef FEAT_WINDOWS
|
||||
/*
|
||||
* If the deleted buffer is the current one, close the current window
|
||||
* (unless it's the only window).
|
||||
* (unless it's the only window). Repeat this so long as we end up in
|
||||
* a window with this buffer.
|
||||
*/
|
||||
while (buf == curbuf && firstwin != lastwin)
|
||||
while (buf == curbuf
|
||||
&& (firstwin != lastwin || first_tabpage->tp_next != NULL))
|
||||
win_close(curwin, FALSE);
|
||||
#endif
|
||||
|
||||
@@ -1107,7 +1095,7 @@ do_buffer(action, start, dir, count, forceit)
|
||||
if (buf != curbuf)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
close_windows(buf);
|
||||
close_windows(buf, FALSE);
|
||||
#endif
|
||||
if (buf != curbuf && buf_valid(buf) && buf->b_nwindows <= 0)
|
||||
close_buffer(NULL, buf, action);
|
||||
@@ -1317,7 +1305,7 @@ set_curbuf(buf, action)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (unload)
|
||||
close_windows(prevbuf);
|
||||
close_windows(prevbuf, FALSE);
|
||||
#endif
|
||||
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
if (buf_valid(prevbuf) && !aborting())
|
||||
@@ -1365,7 +1353,8 @@ enter_buffer(buf)
|
||||
++curbuf->b_nwindows;
|
||||
|
||||
#ifdef FEAT_DIFF
|
||||
diff_new_buffer();
|
||||
if (curwin->w_p_diff)
|
||||
diff_buf_add(curbuf);
|
||||
#endif
|
||||
|
||||
/* Cursor on first line by default. */
|
||||
@@ -1700,6 +1689,9 @@ free_buf_options(buf, free_p_ff)
|
||||
clear_string_option(&buf->b_p_inde);
|
||||
clear_string_option(&buf->b_p_indk);
|
||||
#endif
|
||||
#if defined(FEAT_EVAL)
|
||||
clear_string_option(&buf->b_p_fex);
|
||||
#endif
|
||||
#ifdef FEAT_CRYPT
|
||||
clear_string_option(&buf->b_p_key);
|
||||
#endif
|
||||
@@ -2840,9 +2832,12 @@ buf_same_ino(buf, stp)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Print info about the current buffer.
|
||||
*/
|
||||
void
|
||||
fileinfo(fullname, shorthelp, dont_truncate)
|
||||
int fullname;
|
||||
int fullname; /* when non-zero print full path */
|
||||
int shorthelp;
|
||||
int dont_truncate;
|
||||
{
|
||||
@@ -2952,15 +2947,12 @@ fileinfo(fullname, shorthelp, dont_truncate)
|
||||
{
|
||||
p = msg_trunc_attr(buffer, FALSE, 0);
|
||||
if (restart_edit != 0 || (msg_scrolled && !need_wait_return))
|
||||
{
|
||||
/* Need to repeat the message after redrawing when:
|
||||
* - When restart_edit is set (otherwise there will be a delay
|
||||
* before redrawing).
|
||||
* - When the screen was scrolled but there is no wait-return
|
||||
* prompt. */
|
||||
set_keep_msg(p);
|
||||
keep_msg_attr = 0;
|
||||
}
|
||||
set_keep_msg(p, 0);
|
||||
}
|
||||
|
||||
vim_free(buffer);
|
||||
@@ -3023,9 +3015,15 @@ maketitle()
|
||||
if (*p_titlestring != NUL)
|
||||
{
|
||||
#ifdef FEAT_STL_OPT
|
||||
int use_sandbox = FALSE;
|
||||
|
||||
# ifdef FEAT_EVAL
|
||||
use_sandbox = was_set_insecurely((char_u *)"titlestring", 0);
|
||||
# endif
|
||||
if (stl_syntax & STL_IN_TITLE)
|
||||
build_stl_str_hl(curwin, t_str, sizeof(buf),
|
||||
p_titlestring, 0, maxlen, NULL);
|
||||
p_titlestring, use_sandbox,
|
||||
0, maxlen, NULL, NULL);
|
||||
else
|
||||
#endif
|
||||
t_str = p_titlestring;
|
||||
@@ -3114,9 +3112,15 @@ maketitle()
|
||||
if (*p_iconstring != NUL)
|
||||
{
|
||||
#ifdef FEAT_STL_OPT
|
||||
int use_sandbox = FALSE;
|
||||
|
||||
# ifdef FEAT_EVAL
|
||||
use_sandbox = was_set_insecurely((char_u *)"iconstring", 0);
|
||||
# endif
|
||||
if (stl_syntax & STL_IN_ICON)
|
||||
build_stl_str_hl(curwin, i_str, sizeof(buf),
|
||||
p_iconstring, 0, 0, NULL);
|
||||
p_iconstring, use_sandbox,
|
||||
0, 0, NULL, NULL);
|
||||
else
|
||||
#endif
|
||||
i_str = p_iconstring;
|
||||
@@ -3195,9 +3199,12 @@ free_titles()
|
||||
|
||||
#if defined(FEAT_STL_OPT) || defined(PROTO)
|
||||
/*
|
||||
* Build a string from the status line items in fmt.
|
||||
* Build a string from the status line items in "fmt".
|
||||
* Return length of string in screen cells.
|
||||
*
|
||||
* Normally works for window "wp", except when working for 'tabline' then it
|
||||
* is "curwin".
|
||||
*
|
||||
* Items are drawn interspersed with the text that surrounds it
|
||||
* Specials: %-<wid>(xxx%) => group, %= => middle marker, %< => truncation
|
||||
* Item: %-<minwid>.<maxwid><itemch> All but <itemch> are optional
|
||||
@@ -3206,14 +3213,16 @@ free_titles()
|
||||
* or truncated if too long, fillchar is used for all whitespace.
|
||||
*/
|
||||
int
|
||||
build_stl_str_hl(wp, out, outlen, fmt, fillchar, maxwidth, hl)
|
||||
build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hltab, tabtab)
|
||||
win_T *wp;
|
||||
char_u *out; /* buffer to write into */
|
||||
size_t outlen; /* length of out[] */
|
||||
char_u *fmt;
|
||||
int use_sandbox; /* "fmt" was set insecurely, use sandbox */
|
||||
int fillchar;
|
||||
int maxwidth;
|
||||
struct stl_hlrec *hl;
|
||||
struct stl_hlrec *hltab; /* return: HL attributes (can be NULL) */
|
||||
struct stl_hlrec *tabtab; /* return: tab page nrs (can be NULL) */
|
||||
{
|
||||
char_u *p;
|
||||
char_u *s;
|
||||
@@ -3250,6 +3259,7 @@ build_stl_str_hl(wp, out, outlen, fmt, fillchar, maxwidth, hl)
|
||||
Group,
|
||||
Middle,
|
||||
Highlight,
|
||||
TabPage,
|
||||
Trunc
|
||||
} type;
|
||||
} item[STL_MAX_ITEM];
|
||||
@@ -3260,6 +3270,21 @@ build_stl_str_hl(wp, out, outlen, fmt, fillchar, maxwidth, hl)
|
||||
char_u opt;
|
||||
#define TMPLEN 70
|
||||
char_u tmp[TMPLEN];
|
||||
char_u *usefmt = fmt;
|
||||
struct stl_hlrec *sp;
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
/*
|
||||
* When the format starts with "%!" then evaluate it as an expression and
|
||||
* use the result as the actual format string.
|
||||
*/
|
||||
if (fmt[0] == '%' && fmt[1] == '!')
|
||||
{
|
||||
usefmt = eval_to_string_safe(fmt + 2, NULL, use_sandbox);
|
||||
if (usefmt == NULL)
|
||||
usefmt = (char_u *)"";
|
||||
}
|
||||
#endif
|
||||
|
||||
if (fillchar == 0)
|
||||
fillchar = ' ';
|
||||
@@ -3275,7 +3300,7 @@ build_stl_str_hl(wp, out, outlen, fmt, fillchar, maxwidth, hl)
|
||||
curitem = 0;
|
||||
prevchar_isflag = TRUE;
|
||||
prevchar_isitem = FALSE;
|
||||
for (s = fmt; *s;)
|
||||
for (s = usefmt; *s; )
|
||||
{
|
||||
if (*s != NUL && *s != '%')
|
||||
prevchar_isflag = prevchar_isitem = FALSE;
|
||||
@@ -3421,7 +3446,7 @@ build_stl_str_hl(wp, out, outlen, fmt, fillchar, maxwidth, hl)
|
||||
if (minwid < 0) /* overflow */
|
||||
minwid = 0;
|
||||
}
|
||||
if (*s == STL_HIGHLIGHT)
|
||||
if (*s == STL_USER_HL)
|
||||
{
|
||||
item[curitem].type = Highlight;
|
||||
item[curitem].start = p;
|
||||
@@ -3430,6 +3455,32 @@ build_stl_str_hl(wp, out, outlen, fmt, fillchar, maxwidth, hl)
|
||||
curitem++;
|
||||
continue;
|
||||
}
|
||||
if (*s == STL_TABPAGENR || *s == STL_TABCLOSENR)
|
||||
{
|
||||
if (*s == STL_TABCLOSENR)
|
||||
{
|
||||
if (minwid == 0)
|
||||
{
|
||||
/* %X ends the close label, go back to the previously
|
||||
* define tab label nr. */
|
||||
for (n = curitem - 1; n >= 0; --n)
|
||||
if (item[n].type == TabPage && item[n].minwid >= 0)
|
||||
{
|
||||
minwid = item[n].minwid;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
/* close nrs are stored as negative values */
|
||||
minwid = - minwid;
|
||||
}
|
||||
item[curitem].type = TabPage;
|
||||
item[curitem].start = p;
|
||||
item[curitem].minwid = minwid;
|
||||
s++;
|
||||
curitem++;
|
||||
continue;
|
||||
}
|
||||
if (*s == '.')
|
||||
{
|
||||
s++;
|
||||
@@ -3476,7 +3527,7 @@ build_stl_str_hl(wp, out, outlen, fmt, fillchar, maxwidth, hl)
|
||||
else
|
||||
{
|
||||
t = (opt == STL_FULLPATH) ? wp->w_buffer->b_ffname
|
||||
: wp->w_buffer->b_fname;
|
||||
: wp->w_buffer->b_fname;
|
||||
home_replace(wp->w_buffer, t, NameBuff, MAXPATHL, TRUE);
|
||||
}
|
||||
trans_characters(NameBuff, MAXPATHL);
|
||||
@@ -3506,8 +3557,7 @@ build_stl_str_hl(wp, out, outlen, fmt, fillchar, maxwidth, hl)
|
||||
curwin = wp;
|
||||
curbuf = wp->w_buffer;
|
||||
|
||||
str = eval_to_string_safe(p, &t,
|
||||
was_set_insecurely((char_u *)"statusline"));
|
||||
str = eval_to_string_safe(p, &t, use_sandbox);
|
||||
|
||||
curwin = o_curwin;
|
||||
curbuf = o_curbuf;
|
||||
@@ -3688,6 +3738,20 @@ build_stl_str_hl(wp, out, outlen, fmt, fillchar, maxwidth, hl)
|
||||
case 7: str = (char_u *)",+-"; break;
|
||||
}
|
||||
break;
|
||||
|
||||
case STL_HIGHLIGHT:
|
||||
t = s;
|
||||
while (*s != '#' && *s != NUL)
|
||||
++s;
|
||||
if (*s == '#')
|
||||
{
|
||||
item[curitem].type = Highlight;
|
||||
item[curitem].start = p;
|
||||
item[curitem].minwid = -syn_namen2id(t, s - t);
|
||||
curitem++;
|
||||
}
|
||||
++s;
|
||||
continue;
|
||||
}
|
||||
|
||||
item[curitem].start = p;
|
||||
@@ -3804,6 +3868,11 @@ build_stl_str_hl(wp, out, outlen, fmt, fillchar, maxwidth, hl)
|
||||
*p = NUL;
|
||||
itemcnt = curitem;
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
if (usefmt != fmt)
|
||||
vim_free(usefmt);
|
||||
#endif
|
||||
|
||||
width = vim_strsize(out);
|
||||
if (maxwidth > 0 && width > maxwidth)
|
||||
{
|
||||
@@ -3913,19 +3982,38 @@ build_stl_str_hl(wp, out, outlen, fmt, fillchar, maxwidth, hl)
|
||||
}
|
||||
}
|
||||
|
||||
if (hl != NULL)
|
||||
/* Store the info about highlighting. */
|
||||
if (hltab != NULL)
|
||||
{
|
||||
sp = hltab;
|
||||
for (l = 0; l < itemcnt; l++)
|
||||
{
|
||||
if (item[l].type == Highlight)
|
||||
{
|
||||
hl->start = item[l].start;
|
||||
hl->userhl = item[l].minwid;
|
||||
hl++;
|
||||
sp->start = item[l].start;
|
||||
sp->userhl = item[l].minwid;
|
||||
sp++;
|
||||
}
|
||||
}
|
||||
hl->start = NULL;
|
||||
hl->userhl = 0;
|
||||
sp->start = NULL;
|
||||
sp->userhl = 0;
|
||||
}
|
||||
|
||||
/* Store the info about tab pages labels. */
|
||||
if (tabtab != NULL)
|
||||
{
|
||||
sp = tabtab;
|
||||
for (l = 0; l < itemcnt; l++)
|
||||
{
|
||||
if (item[l].type == TabPage)
|
||||
{
|
||||
sp->start = item[l].start;
|
||||
sp->userhl = item[l].minwid;
|
||||
sp++;
|
||||
}
|
||||
}
|
||||
sp->start = NULL;
|
||||
sp->userhl = 0;
|
||||
}
|
||||
|
||||
return width;
|
||||
@@ -4181,7 +4269,7 @@ do_arg_all(count, forceit)
|
||||
#endif
|
||||
}
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (firstwin == lastwin) /* can't close last window */
|
||||
if (firstwin == lastwin) /* don't close last window */
|
||||
#endif
|
||||
use_firstwin = TRUE;
|
||||
#ifdef FEAT_WINDOWS
|
||||
@@ -4701,6 +4789,7 @@ write_viminfo_bufferlist(fp)
|
||||
buf_T *buf;
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *win;
|
||||
tabpage_T *tp;
|
||||
#endif
|
||||
char_u *line;
|
||||
int max_buffers;
|
||||
@@ -4717,7 +4806,7 @@ write_viminfo_bufferlist(fp)
|
||||
return;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
for (win = firstwin; win != NULL; win = win->w_next)
|
||||
FOR_ALL_TAB_WINDOWS(tp, win)
|
||||
set_last_cursor(win);
|
||||
#else
|
||||
set_last_cursor(curwin);
|
||||
@@ -4758,7 +4847,21 @@ buf_spname(buf)
|
||||
{
|
||||
#if defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)
|
||||
if (bt_quickfix(buf))
|
||||
return _("[Error List]");
|
||||
{
|
||||
win_T *win;
|
||||
|
||||
/*
|
||||
* For location list window, w_llist_ref points to the location list.
|
||||
* For quickfix window, w_llist_ref is NULL.
|
||||
*/
|
||||
FOR_ALL_WINDOWS(win)
|
||||
if (win->w_buffer == buf)
|
||||
break;
|
||||
if (win != NULL && win->w_llist_ref != NULL)
|
||||
return _("[Location List]");
|
||||
else
|
||||
return _("[Error List]");
|
||||
}
|
||||
#endif
|
||||
#ifdef FEAT_QUICKFIX
|
||||
/* There is no _file_ when 'buftype' is "nofile", b_sfname
|
||||
|
||||
@@ -106,7 +106,7 @@ if test "`(uname) 2>/dev/null`" = Darwin; then
|
||||
MACOSX=yes
|
||||
OS_EXTRA_SCR="os_macosx.c os_mac_conv.c";
|
||||
OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o"
|
||||
CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp"
|
||||
CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp -arch i386 -arch ppc"
|
||||
|
||||
dnl If Carbon is found, assume we don't want X11
|
||||
dnl unless it was specifically asked for (--with-x)
|
||||
@@ -2761,7 +2761,7 @@ AC_MSG_CHECKING(for GCC 3 or later)
|
||||
DEPEND_CFLAGS_FILTER=
|
||||
if test "$GCC" = yes; then
|
||||
gccmajor=`"$CC" --version | sed -e '2,$d;s/^[[^0-9]]*\([[1-9]]\)\.[[0-9.]]*.*$/\1/g'`
|
||||
if test "$gccmajor" > "2"; then
|
||||
if test "$gccmajor" -gt "2"; then
|
||||
DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'"
|
||||
fi
|
||||
fi
|
||||
|
||||
378
src/diff.c
378
src/diff.c
@@ -15,36 +15,6 @@
|
||||
|
||||
#if defined(FEAT_DIFF) || defined(PROTO)
|
||||
|
||||
#define DB_COUNT 4 /* up to four buffers can be diff'ed */
|
||||
|
||||
/*
|
||||
* Each diffblock defines where a block of lines starts in each of the buffers
|
||||
* and how many lines it occupies in that buffer. When the lines are missing
|
||||
* in the buffer the df_count[] is zero. This is all counted in
|
||||
* buffer lines.
|
||||
* There is always at least one unchanged line in between the diffs.
|
||||
* Otherwise it would have been included in the diff above or below it.
|
||||
* df_lnum[] + df_count[] is the lnum below the change. When in one buffer
|
||||
* lines have been inserted, in the other buffer df_lnum[] is the line below
|
||||
* the insertion and df_count[] is zero. When appending lines at the end of
|
||||
* the buffer, df_lnum[] is one beyond the end!
|
||||
* This is using a linked list, because the number of differences is expected
|
||||
* to be reasonable small. The list is sorted on lnum.
|
||||
*/
|
||||
typedef struct diffblock diff_T;
|
||||
struct diffblock
|
||||
{
|
||||
diff_T *df_next;
|
||||
linenr_T df_lnum[DB_COUNT]; /* line number in buffer */
|
||||
linenr_T df_count[DB_COUNT]; /* nr of inserted/changed lines */
|
||||
};
|
||||
|
||||
static diff_T *first_diff = NULL;
|
||||
|
||||
static buf_T *(diffbuf[DB_COUNT]);
|
||||
|
||||
static int diff_invalid = TRUE; /* list of diffs is outdated */
|
||||
|
||||
static int diff_busy = FALSE; /* ex_diffgetput() is busy */
|
||||
|
||||
/* flags obtained from the 'diffopt' option */
|
||||
@@ -64,8 +34,10 @@ static int diff_bin_works = MAYBE; /* TRUE when "diff --binary" works, FALSE
|
||||
#endif
|
||||
|
||||
static int diff_buf_idx __ARGS((buf_T *buf));
|
||||
static void diff_check_unchanged __ARGS((diff_T *dp));
|
||||
static int diff_check_sanity __ARGS((diff_T *dp));
|
||||
static int diff_buf_idx_tp __ARGS((buf_T *buf, tabpage_T *tp));
|
||||
static void diff_mark_adjust_tp __ARGS((tabpage_T *tp, int idx, linenr_T line1, linenr_T line2, long amount, long amount_after));
|
||||
static void diff_check_unchanged __ARGS((tabpage_T *tp, diff_T *dp));
|
||||
static int diff_check_sanity __ARGS((tabpage_T *tp, diff_T *dp));
|
||||
static void diff_redraw __ARGS((int dofold));
|
||||
static int diff_write __ARGS((buf_T *buf, char_u *fname));
|
||||
static void diff_file __ARGS((char_u *tmp_orig, char_u *tmp_new, char_u *tmp_diff));
|
||||
@@ -76,42 +48,30 @@ static void diff_fold_update __ARGS((diff_T *dp, int skip_idx));
|
||||
#endif
|
||||
static void diff_read __ARGS((int idx_orig, int idx_new, char_u *fname));
|
||||
static void diff_copy_entry __ARGS((diff_T *dprev, diff_T *dp, int idx_orig, int idx_new));
|
||||
static diff_T *diff_alloc_new __ARGS((diff_T *dprev, diff_T *dp));
|
||||
static diff_T *diff_alloc_new __ARGS((tabpage_T *tp, diff_T *dprev, diff_T *dp));
|
||||
|
||||
#ifndef USE_CR
|
||||
# define tag_fgets vim_fgets
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Call this when a new buffer is being edited in the current window. curbuf
|
||||
* must already have been set.
|
||||
* Marks the current buffer as being part of the diff and requireing updating.
|
||||
* This must be done before any autocmd, because a command the uses info
|
||||
* about the screen contents.
|
||||
*/
|
||||
void
|
||||
diff_new_buffer()
|
||||
{
|
||||
if (curwin->w_p_diff)
|
||||
diff_buf_add(curbuf);
|
||||
}
|
||||
|
||||
/*
|
||||
* Called when deleting or unloading a buffer: No longer make a diff with it.
|
||||
* Also called when 'diff' is reset in the last window showing a diff for a
|
||||
* buffer.
|
||||
*/
|
||||
void
|
||||
diff_buf_delete(buf)
|
||||
buf_T *buf;
|
||||
{
|
||||
int i;
|
||||
tabpage_T *tp;
|
||||
|
||||
i = diff_buf_idx(buf);
|
||||
if (i != DB_COUNT)
|
||||
for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
|
||||
{
|
||||
diffbuf[i] = NULL;
|
||||
diff_invalid = TRUE;
|
||||
i = diff_buf_idx_tp(buf, tp);
|
||||
if (i != DB_COUNT)
|
||||
{
|
||||
tp->tp_diffbuf[i] = NULL;
|
||||
tp->tp_diff_invalid = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,6 +84,7 @@ diff_buf_adjust(win)
|
||||
win_T *win;
|
||||
{
|
||||
win_T *wp;
|
||||
int i;
|
||||
|
||||
if (!win->w_p_diff)
|
||||
{
|
||||
@@ -133,7 +94,14 @@ diff_buf_adjust(win)
|
||||
if (wp->w_buffer == win->w_buffer && wp->w_p_diff)
|
||||
break;
|
||||
if (wp == NULL)
|
||||
diff_buf_delete(win->w_buffer);
|
||||
{
|
||||
i = diff_buf_idx(win->w_buffer);
|
||||
if (i != DB_COUNT)
|
||||
{
|
||||
curtab->tp_diffbuf[i] = NULL;
|
||||
curtab->tp_diff_invalid = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
diff_buf_add(win->w_buffer);
|
||||
@@ -141,6 +109,11 @@ diff_buf_adjust(win)
|
||||
|
||||
/*
|
||||
* Add a buffer to make diffs for.
|
||||
* Call this when a new buffer is being edited in the current window where
|
||||
* 'diff' is set.
|
||||
* Marks the current buffer as being part of the diff and requireing updating.
|
||||
* This must be done before any autocmd, because a command may use info
|
||||
* about the screen contents.
|
||||
*/
|
||||
void
|
||||
diff_buf_add(buf)
|
||||
@@ -152,10 +125,10 @@ diff_buf_add(buf)
|
||||
return; /* It's already there. */
|
||||
|
||||
for (i = 0; i < DB_COUNT; ++i)
|
||||
if (diffbuf[i] == NULL)
|
||||
if (curtab->tp_diffbuf[i] == NULL)
|
||||
{
|
||||
diffbuf[i] = buf;
|
||||
diff_invalid = TRUE;
|
||||
curtab->tp_diffbuf[i] = buf;
|
||||
curtab->tp_diff_invalid = TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -163,7 +136,7 @@ diff_buf_add(buf)
|
||||
}
|
||||
|
||||
/*
|
||||
* Find buffer "buf" in the list of diff buffers.
|
||||
* Find buffer "buf" in the list of diff buffers for the current tab page.
|
||||
* Return its index or DB_COUNT if not found.
|
||||
*/
|
||||
static int
|
||||
@@ -173,30 +146,53 @@ diff_buf_idx(buf)
|
||||
int idx;
|
||||
|
||||
for (idx = 0; idx < DB_COUNT; ++idx)
|
||||
if (diffbuf[idx] == buf)
|
||||
if (curtab->tp_diffbuf[idx] == buf)
|
||||
break;
|
||||
return idx;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark the diff info as invalid, it will be updated when info is requested.
|
||||
* Find buffer "buf" in the list of diff buffers for tab page "tp".
|
||||
* Return its index or DB_COUNT if not found.
|
||||
*/
|
||||
static int
|
||||
diff_buf_idx_tp(buf, tp)
|
||||
buf_T *buf;
|
||||
tabpage_T *tp;
|
||||
{
|
||||
int idx;
|
||||
|
||||
for (idx = 0; idx < DB_COUNT; ++idx)
|
||||
if (tp->tp_diffbuf[idx] == buf)
|
||||
break;
|
||||
return idx;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark the diff info involving buffer "buf" as invalid, it will be updated
|
||||
* when info is requested.
|
||||
*/
|
||||
void
|
||||
diff_invalidate()
|
||||
diff_invalidate(buf)
|
||||
buf_T *buf;
|
||||
{
|
||||
if (curwin->w_p_diff)
|
||||
tabpage_T *tp;
|
||||
int i;
|
||||
|
||||
for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
|
||||
{
|
||||
diff_invalid = TRUE;
|
||||
diff_redraw(TRUE);
|
||||
i = diff_buf_idx_tp(buf, tp);
|
||||
if (i != DB_COUNT)
|
||||
{
|
||||
tp->tp_diff_invalid = TRUE;
|
||||
if (tp == curtab)
|
||||
diff_redraw(TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Called by mark_adjust(): update line numbers.
|
||||
* This attempts to update the changes as much as possible:
|
||||
* When inserting/deleting lines outside of existing change blocks, create a
|
||||
* new change block and update the line numbers in following blocks.
|
||||
* When inserting/deleting lines in existing change blocks, update them.
|
||||
* Called by mark_adjust(): update line numbers in "curbuf".
|
||||
*/
|
||||
void
|
||||
diff_mark_adjust(line1, line2, amount, amount_after)
|
||||
@@ -204,11 +200,38 @@ diff_mark_adjust(line1, line2, amount, amount_after)
|
||||
linenr_T line2;
|
||||
long amount;
|
||||
long amount_after;
|
||||
{
|
||||
int idx;
|
||||
tabpage_T *tp;
|
||||
|
||||
/* Handle all tab pages that use the current buffer in a diff. */
|
||||
for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
|
||||
{
|
||||
idx = diff_buf_idx_tp(curbuf, tp);
|
||||
if (idx != DB_COUNT)
|
||||
diff_mark_adjust_tp(tp, idx, line1, line2, amount, amount_after);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Update line numbers in tab page "tp" for "curbuf" with index "idx".
|
||||
* This attempts to update the changes as much as possible:
|
||||
* When inserting/deleting lines outside of existing change blocks, create a
|
||||
* new change block and update the line numbers in following blocks.
|
||||
* When inserting/deleting lines in existing change blocks, update them.
|
||||
*/
|
||||
static void
|
||||
diff_mark_adjust_tp(tp, idx, line1, line2, amount, amount_after)
|
||||
tabpage_T *tp;
|
||||
int idx;
|
||||
linenr_T line1;
|
||||
linenr_T line2;
|
||||
long amount;
|
||||
long amount_after;
|
||||
{
|
||||
diff_T *dp;
|
||||
diff_T *dprev;
|
||||
diff_T *dnext;
|
||||
int idx;
|
||||
int i;
|
||||
int inserted, deleted;
|
||||
int n, off;
|
||||
@@ -216,11 +239,6 @@ diff_mark_adjust(line1, line2, amount, amount_after)
|
||||
linenr_T lnum_deleted = line1; /* lnum of remaining deletion */
|
||||
int check_unchanged;
|
||||
|
||||
/* Find the index for the current buffer. */
|
||||
idx = diff_buf_idx(curbuf);
|
||||
if (idx == DB_COUNT)
|
||||
return; /* This buffer doesn't have diffs. */
|
||||
|
||||
if (line2 == MAXLNUM)
|
||||
{
|
||||
/* mark_adjust(99, MAXLNUM, 9, 0): insert lines */
|
||||
@@ -241,7 +259,7 @@ diff_mark_adjust(line1, line2, amount, amount_after)
|
||||
}
|
||||
|
||||
dprev = NULL;
|
||||
dp = first_diff;
|
||||
dp = tp->tp_first_diff;
|
||||
for (;;)
|
||||
{
|
||||
/* If the change is after the previous diff block and before the next
|
||||
@@ -253,14 +271,14 @@ diff_mark_adjust(line1, line2, amount, amount_after)
|
||||
|| dprev->df_lnum[idx] + dprev->df_count[idx] < line1)
|
||||
&& !diff_busy)
|
||||
{
|
||||
dnext = diff_alloc_new(dprev, dp);
|
||||
dnext = diff_alloc_new(tp, dprev, dp);
|
||||
if (dnext == NULL)
|
||||
return;
|
||||
|
||||
dnext->df_lnum[idx] = line1;
|
||||
dnext->df_count[idx] = inserted;
|
||||
for (i = 0; i < DB_COUNT; ++i)
|
||||
if (diffbuf[i] != NULL && i != idx)
|
||||
if (tp->tp_diffbuf[i] != NULL && i != idx)
|
||||
{
|
||||
if (dprev == NULL)
|
||||
dnext->df_lnum[i] = line1;
|
||||
@@ -367,7 +385,7 @@ diff_mark_adjust(line1, line2, amount, amount_after)
|
||||
}
|
||||
|
||||
for (i = 0; i < DB_COUNT; ++i)
|
||||
if (diffbuf[i] != NULL && i != idx)
|
||||
if (tp->tp_diffbuf[i] != NULL && i != idx)
|
||||
{
|
||||
dp->df_lnum[i] -= off;
|
||||
dp->df_count[i] += n;
|
||||
@@ -390,7 +408,7 @@ diff_mark_adjust(line1, line2, amount, amount_after)
|
||||
/* Check if inserted lines are equal, may reduce the
|
||||
* size of the diff. TODO: also check for equal lines
|
||||
* in the middle and perhaps split the block. */
|
||||
diff_check_unchanged(dp);
|
||||
diff_check_unchanged(tp, dp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -399,7 +417,7 @@ diff_mark_adjust(line1, line2, amount, amount_after)
|
||||
== dp->df_lnum[idx])
|
||||
{
|
||||
for (i = 0; i < DB_COUNT; ++i)
|
||||
if (diffbuf[i] != NULL)
|
||||
if (tp->tp_diffbuf[i] != NULL)
|
||||
dprev->df_count[i] += dp->df_count[i];
|
||||
dprev->df_next = dp->df_next;
|
||||
vim_free(dp);
|
||||
@@ -414,12 +432,12 @@ diff_mark_adjust(line1, line2, amount, amount_after)
|
||||
}
|
||||
|
||||
dprev = NULL;
|
||||
dp = first_diff;
|
||||
dp = tp->tp_first_diff;
|
||||
while (dp != NULL)
|
||||
{
|
||||
/* All counts are zero, remove this entry. */
|
||||
for (i = 0; i < DB_COUNT; ++i)
|
||||
if (diffbuf[i] != NULL && dp->df_count[i] != 0)
|
||||
if (tp->tp_diffbuf[i] != NULL && dp->df_count[i] != 0)
|
||||
break;
|
||||
if (i == DB_COUNT)
|
||||
{
|
||||
@@ -427,7 +445,7 @@ diff_mark_adjust(line1, line2, amount, amount_after)
|
||||
vim_free(dp);
|
||||
dp = dnext;
|
||||
if (dprev == NULL)
|
||||
first_diff = dnext;
|
||||
tp->tp_first_diff = dnext;
|
||||
else
|
||||
dprev->df_next = dnext;
|
||||
}
|
||||
@@ -439,18 +457,24 @@ diff_mark_adjust(line1, line2, amount, amount_after)
|
||||
}
|
||||
|
||||
}
|
||||
diff_redraw(TRUE);
|
||||
|
||||
/* Recompute the scroll binding, may remove or add filler lines (e.g.,
|
||||
* when adding lines above w_topline). */
|
||||
check_scrollbind((linenr_T)0, 0L);
|
||||
if (tp == curtab)
|
||||
{
|
||||
diff_redraw(TRUE);
|
||||
|
||||
/* Need to recompute the scroll binding, may remove or add filler
|
||||
* lines (e.g., when adding lines above w_topline). But it's slow when
|
||||
* making many changes, postpone until redrawing. */
|
||||
diff_need_scrollbind = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate a new diff block and link it between "dprev" and "dp".
|
||||
*/
|
||||
static diff_T *
|
||||
diff_alloc_new(dprev, dp)
|
||||
diff_alloc_new(tp, dprev, dp)
|
||||
tabpage_T *tp;
|
||||
diff_T *dprev;
|
||||
diff_T *dp;
|
||||
{
|
||||
@@ -461,7 +485,7 @@ diff_alloc_new(dprev, dp)
|
||||
{
|
||||
dnew->df_next = dp;
|
||||
if (dprev == NULL)
|
||||
first_diff = dnew;
|
||||
tp->tp_first_diff = dnew;
|
||||
else
|
||||
dprev->df_next = dnew;
|
||||
}
|
||||
@@ -475,7 +499,8 @@ diff_alloc_new(dprev, dp)
|
||||
* must take care of removing it.
|
||||
*/
|
||||
static void
|
||||
diff_check_unchanged(dp)
|
||||
diff_check_unchanged(tp, dp)
|
||||
tabpage_T *tp;
|
||||
diff_T *dp;
|
||||
{
|
||||
int i_org;
|
||||
@@ -487,12 +512,12 @@ diff_check_unchanged(dp)
|
||||
/* Find the first buffers, use it as the original, compare the other
|
||||
* buffer lines against this one. */
|
||||
for (i_org = 0; i_org < DB_COUNT; ++i_org)
|
||||
if (diffbuf[i_org] != NULL)
|
||||
if (tp->tp_diffbuf[i_org] != NULL)
|
||||
break;
|
||||
if (i_org == DB_COUNT) /* safety check */
|
||||
return;
|
||||
|
||||
if (diff_check_sanity(dp) == FAIL)
|
||||
if (diff_check_sanity(tp, dp) == FAIL)
|
||||
return;
|
||||
|
||||
/* First check lines at the top, then at the bottom. */
|
||||
@@ -507,20 +532,20 @@ diff_check_unchanged(dp)
|
||||
/* Copy the line, the next ml_get() will invalidate it. */
|
||||
if (dir == BACKWARD)
|
||||
off_org = dp->df_count[i_org] - 1;
|
||||
line_org = vim_strsave(ml_get_buf(diffbuf[i_org],
|
||||
line_org = vim_strsave(ml_get_buf(tp->tp_diffbuf[i_org],
|
||||
dp->df_lnum[i_org] + off_org, FALSE));
|
||||
if (line_org == NULL)
|
||||
return;
|
||||
for (i_new = i_org + 1; i_new < DB_COUNT; ++i_new)
|
||||
{
|
||||
if (diffbuf[i_new] == NULL)
|
||||
if (tp->tp_diffbuf[i_new] == NULL)
|
||||
continue;
|
||||
if (dir == BACKWARD)
|
||||
off_new = dp->df_count[i_new] - 1;
|
||||
/* if other buffer doesn't have this line, it was inserted */
|
||||
if (off_new < 0 || off_new >= dp->df_count[i_new])
|
||||
break;
|
||||
if (diff_cmp(line_org, ml_get_buf(diffbuf[i_new],
|
||||
if (diff_cmp(line_org, ml_get_buf(tp->tp_diffbuf[i_new],
|
||||
dp->df_lnum[i_new] + off_new, FALSE)) != 0)
|
||||
break;
|
||||
}
|
||||
@@ -532,7 +557,7 @@ diff_check_unchanged(dp)
|
||||
|
||||
/* Line matched in all buffers, remove it from the diff. */
|
||||
for (i_new = i_org; i_new < DB_COUNT; ++i_new)
|
||||
if (diffbuf[i_new] != NULL)
|
||||
if (tp->tp_diffbuf[i_new] != NULL)
|
||||
{
|
||||
if (dir == FORWARD)
|
||||
++dp->df_lnum[i_new];
|
||||
@@ -550,21 +575,22 @@ diff_check_unchanged(dp)
|
||||
* This can happen when the diff program returns invalid results.
|
||||
*/
|
||||
static int
|
||||
diff_check_sanity(dp)
|
||||
diff_check_sanity(tp, dp)
|
||||
tabpage_T *tp;
|
||||
diff_T *dp;
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < DB_COUNT; ++i)
|
||||
if (diffbuf[i] != NULL)
|
||||
if (tp->tp_diffbuf[i] != NULL)
|
||||
if (dp->df_lnum[i] + dp->df_count[i] - 1
|
||||
> diffbuf[i]->b_ml.ml_line_count)
|
||||
> tp->tp_diffbuf[i]->b_ml.ml_line_count)
|
||||
return FAIL;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark all diff buffers for redraw.
|
||||
* Mark all diff buffers in the current tab page for redraw.
|
||||
*/
|
||||
static void
|
||||
diff_redraw(dofold)
|
||||
@@ -623,7 +649,7 @@ diff_write(buf, fname)
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
ex_diffupdate(eap)
|
||||
exarg_T *eap;
|
||||
exarg_T *eap; /* can be NULL, it's not used */
|
||||
{
|
||||
buf_T *buf;
|
||||
int idx_orig;
|
||||
@@ -635,19 +661,19 @@ ex_diffupdate(eap)
|
||||
int ok;
|
||||
|
||||
/* Delete all diffblocks. */
|
||||
diff_clear();
|
||||
diff_invalid = FALSE;
|
||||
diff_clear(curtab);
|
||||
curtab->tp_diff_invalid = FALSE;
|
||||
|
||||
/* Use the first buffer as the original text. */
|
||||
for (idx_orig = 0; idx_orig < DB_COUNT; ++idx_orig)
|
||||
if (diffbuf[idx_orig] != NULL)
|
||||
if (curtab->tp_diffbuf[idx_orig] != NULL)
|
||||
break;
|
||||
if (idx_orig == DB_COUNT)
|
||||
return;
|
||||
|
||||
/* Only need to do something when there is another buffer. */
|
||||
for (idx_new = idx_orig + 1; idx_new < DB_COUNT; ++idx_new)
|
||||
if (diffbuf[idx_new] != NULL)
|
||||
if (curtab->tp_diffbuf[idx_new] != NULL)
|
||||
break;
|
||||
if (idx_new == DB_COUNT)
|
||||
return;
|
||||
@@ -742,14 +768,14 @@ ex_diffupdate(eap)
|
||||
}
|
||||
|
||||
/* Write the first buffer to a tempfile. */
|
||||
buf = diffbuf[idx_orig];
|
||||
buf = curtab->tp_diffbuf[idx_orig];
|
||||
if (diff_write(buf, tmp_orig) == FAIL)
|
||||
goto theend;
|
||||
|
||||
/* Make a difference between the first buffer and every other. */
|
||||
for (idx_new = idx_orig + 1; idx_new < DB_COUNT; ++idx_new)
|
||||
{
|
||||
buf = diffbuf[idx_new];
|
||||
buf = curtab->tp_diffbuf[idx_new];
|
||||
if (buf == NULL)
|
||||
continue;
|
||||
if (diff_write(buf, tmp_new) == FAIL)
|
||||
@@ -948,6 +974,9 @@ ex_diffpatch(eap)
|
||||
#ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
#endif
|
||||
/* don't use a new tab page, each tab page has its own diffs */
|
||||
cmdmod.tab = 0;
|
||||
|
||||
if (win_split(0, 0) != FAIL)
|
||||
{
|
||||
/* Pretend it was a ":split fname" command */
|
||||
@@ -1005,6 +1034,9 @@ ex_diffsplit(eap)
|
||||
#ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
#endif
|
||||
/* don't use a new tab page, each tab page has its own diffs */
|
||||
cmdmod.tab = 0;
|
||||
|
||||
if (win_split(0, 0) != FAIL)
|
||||
{
|
||||
/* Pretend it was a ":split fname" command */
|
||||
@@ -1052,6 +1084,9 @@ diff_win_options(wp, addbuf)
|
||||
curbuf = curwin->w_buffer;
|
||||
set_string_option_direct((char_u *)"fdm", -1, (char_u *)"diff",
|
||||
OPT_LOCAL|OPT_FREE);
|
||||
# ifdef FEAT_EVAL
|
||||
set_option_scriptID((char_u *)"fdm", current_SID);
|
||||
# endif
|
||||
curwin = old_curwin;
|
||||
curbuf = curwin->w_buffer;
|
||||
wp->w_p_fdc = 2;
|
||||
@@ -1074,6 +1109,7 @@ diff_win_options(wp, addbuf)
|
||||
|
||||
/*
|
||||
* Set options not to show diffs. For the current window or all windows.
|
||||
* Only in the current tab page.
|
||||
*/
|
||||
void
|
||||
ex_diffoff(eap)
|
||||
@@ -1098,6 +1134,9 @@ ex_diffoff(eap)
|
||||
curbuf = curwin->w_buffer;
|
||||
set_string_option_direct((char_u *)"fdm", -1,
|
||||
(char_u *)"manual", OPT_LOCAL|OPT_FREE);
|
||||
# ifdef FEAT_EVAL
|
||||
set_option_scriptID((char_u *)"fdm", current_SID);
|
||||
# endif
|
||||
curwin = old_curwin;
|
||||
curbuf = curwin->w_buffer;
|
||||
wp->w_p_fdc = 0;
|
||||
@@ -1132,7 +1171,7 @@ diff_read(idx_orig, idx_new, fname)
|
||||
{
|
||||
FILE *fd;
|
||||
diff_T *dprev = NULL;
|
||||
diff_T *dp = first_diff;
|
||||
diff_T *dp = curtab->tp_first_diff;
|
||||
diff_T *dn, *dpl;
|
||||
long f1, l1, f2, l2;
|
||||
char_u linebuf[LBUFLEN]; /* only need to hold the diff line */
|
||||
@@ -1235,7 +1274,7 @@ diff_read(idx_orig, idx_new, fname)
|
||||
if (off > 0)
|
||||
{
|
||||
for (i = idx_orig; i < idx_new; ++i)
|
||||
if (diffbuf[i] != NULL)
|
||||
if (curtab->tp_diffbuf[i] != NULL)
|
||||
dp->df_lnum[i] -= off;
|
||||
dp->df_lnum[idx_new] = lnum_new;
|
||||
dp->df_count[idx_new] = count_new;
|
||||
@@ -1263,7 +1302,7 @@ diff_read(idx_orig, idx_new, fname)
|
||||
off = 0;
|
||||
}
|
||||
for (i = idx_orig; i < idx_new + !notset; ++i)
|
||||
if (diffbuf[i] != NULL)
|
||||
if (curtab->tp_diffbuf[i] != NULL)
|
||||
dp->df_count[i] = dpl->df_lnum[i] + dpl->df_count[i]
|
||||
- dp->df_lnum[i] + off;
|
||||
|
||||
@@ -1280,7 +1319,7 @@ diff_read(idx_orig, idx_new, fname)
|
||||
else
|
||||
{
|
||||
/* Allocate a new diffblock. */
|
||||
dp = diff_alloc_new(dprev, dp);
|
||||
dp = diff_alloc_new(curtab, dprev, dp);
|
||||
if (dp == NULL)
|
||||
return;
|
||||
|
||||
@@ -1293,7 +1332,7 @@ diff_read(idx_orig, idx_new, fname)
|
||||
* original buffer, otherwise there would have been a change
|
||||
* already. */
|
||||
for (i = idx_orig + 1; i < idx_new; ++i)
|
||||
if (diffbuf[i] != NULL)
|
||||
if (curtab->tp_diffbuf[i] != NULL)
|
||||
diff_copy_entry(dprev, dp, idx_orig, i);
|
||||
}
|
||||
notset = FALSE; /* "*dp" has been set */
|
||||
@@ -1334,19 +1373,20 @@ diff_copy_entry(dprev, dp, idx_orig, idx_new)
|
||||
}
|
||||
|
||||
/*
|
||||
* Clear the list of diffblocks.
|
||||
* Clear the list of diffblocks for tab page "tp".
|
||||
*/
|
||||
void
|
||||
diff_clear()
|
||||
diff_clear(tp)
|
||||
tabpage_T *tp;
|
||||
{
|
||||
diff_T *p, *next_p;
|
||||
|
||||
for (p = first_diff; p != NULL; p = next_p)
|
||||
for (p = tp->tp_first_diff; p != NULL; p = next_p)
|
||||
{
|
||||
next_p = p->df_next;
|
||||
vim_free(p);
|
||||
}
|
||||
first_diff = NULL;
|
||||
tp->tp_first_diff = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1363,17 +1403,17 @@ diff_check(wp, lnum)
|
||||
win_T *wp;
|
||||
linenr_T lnum;
|
||||
{
|
||||
int idx; /* index in diffbuf[] for this buffer */
|
||||
int idx; /* index in tp_diffbuf[] for this buffer */
|
||||
diff_T *dp;
|
||||
int maxcount;
|
||||
int i;
|
||||
buf_T *buf = wp->w_buffer;
|
||||
int cmp;
|
||||
|
||||
if (diff_invalid)
|
||||
if (curtab->tp_diff_invalid)
|
||||
ex_diffupdate(NULL); /* update after a big change */
|
||||
|
||||
if (first_diff == NULL || !wp->w_p_diff) /* no diffs at all */
|
||||
if (curtab->tp_first_diff == NULL || !wp->w_p_diff) /* no diffs at all */
|
||||
return 0;
|
||||
|
||||
/* safety check: "lnum" must be a buffer line */
|
||||
@@ -1391,7 +1431,7 @@ diff_check(wp, lnum)
|
||||
#endif
|
||||
|
||||
/* search for a change that includes "lnum" in the list of diffblocks. */
|
||||
for (dp = first_diff; dp != NULL; dp = dp->df_next)
|
||||
for (dp = curtab->tp_first_diff; dp != NULL; dp = dp->df_next)
|
||||
if (lnum <= dp->df_lnum[idx] + dp->df_count[idx])
|
||||
break;
|
||||
if (dp == NULL || lnum < dp->df_lnum[idx])
|
||||
@@ -1406,7 +1446,7 @@ diff_check(wp, lnum)
|
||||
* count, check if the lines are identical. */
|
||||
cmp = FALSE;
|
||||
for (i = 0; i < DB_COUNT; ++i)
|
||||
if (i != idx && diffbuf[i] != NULL)
|
||||
if (i != idx && curtab->tp_diffbuf[i] != NULL)
|
||||
{
|
||||
if (dp->df_count[i] == 0)
|
||||
zero = TRUE;
|
||||
@@ -1422,7 +1462,7 @@ diff_check(wp, lnum)
|
||||
/* Compare all lines. If they are equal the lines were inserted
|
||||
* in some buffers, deleted in others, but not changed. */
|
||||
for (i = 0; i < DB_COUNT; ++i)
|
||||
if (i != idx && diffbuf[i] != NULL && dp->df_count[i] != 0)
|
||||
if (i != idx && curtab->tp_diffbuf[i] != NULL && dp->df_count[i] != 0)
|
||||
if (!diff_equal_entry(dp, idx, i))
|
||||
return -1;
|
||||
}
|
||||
@@ -1444,7 +1484,7 @@ diff_check(wp, lnum)
|
||||
* 0 when this buf had the max count. */
|
||||
maxcount = 0;
|
||||
for (i = 0; i < DB_COUNT; ++i)
|
||||
if (diffbuf[i] != NULL && dp->df_count[i] > maxcount)
|
||||
if (curtab->tp_diffbuf[i] != NULL && dp->df_count[i] > maxcount)
|
||||
maxcount = dp->df_count[i];
|
||||
return maxcount - dp->df_count[idx];
|
||||
}
|
||||
@@ -1464,15 +1504,15 @@ diff_equal_entry(dp, idx1, idx2)
|
||||
|
||||
if (dp->df_count[idx1] != dp->df_count[idx2])
|
||||
return FALSE;
|
||||
if (diff_check_sanity(dp) == FAIL)
|
||||
if (diff_check_sanity(curtab, dp) == FAIL)
|
||||
return FALSE;
|
||||
for (i = 0; i < dp->df_count[idx1]; ++i)
|
||||
{
|
||||
line = vim_strsave(ml_get_buf(diffbuf[idx1],
|
||||
line = vim_strsave(ml_get_buf(curtab->tp_diffbuf[idx1],
|
||||
dp->df_lnum[idx1] + i, FALSE));
|
||||
if (line == NULL)
|
||||
return FALSE;
|
||||
cmp = diff_cmp(line, ml_get_buf(diffbuf[idx2],
|
||||
cmp = diff_cmp(line, ml_get_buf(curtab->tp_diffbuf[idx2],
|
||||
dp->df_lnum[idx2] + i, FALSE));
|
||||
vim_free(line);
|
||||
if (cmp != 0)
|
||||
@@ -1585,13 +1625,13 @@ diff_set_topline(fromwin, towin)
|
||||
if (idx == DB_COUNT)
|
||||
return; /* safety check */
|
||||
|
||||
if (diff_invalid)
|
||||
if (curtab->tp_diff_invalid)
|
||||
ex_diffupdate(NULL); /* update after a big change */
|
||||
|
||||
towin->w_topfill = 0;
|
||||
|
||||
/* search for a change that includes "lnum" in the list of diffblocks. */
|
||||
for (dp = first_diff; dp != NULL; dp = dp->df_next)
|
||||
for (dp = curtab->tp_first_diff; dp != NULL; dp = dp->df_next)
|
||||
if (lnum <= dp->df_lnum[idx] + dp->df_count[idx])
|
||||
break;
|
||||
if (dp == NULL)
|
||||
@@ -1666,6 +1706,7 @@ diffopt_changed()
|
||||
char_u *p;
|
||||
int diff_context_new = 6;
|
||||
int diff_flags_new = 0;
|
||||
tabpage_T *tp;
|
||||
|
||||
p = p_dip;
|
||||
while (*p != NUL)
|
||||
@@ -1698,7 +1739,8 @@ diffopt_changed()
|
||||
|
||||
/* If "icase" or "iwhite" was added or removed, need to update the diff. */
|
||||
if (diff_flags != diff_flags_new)
|
||||
diff_invalid = TRUE;
|
||||
for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
|
||||
tp->tp_diff_invalid = TRUE;
|
||||
|
||||
diff_flags = diff_flags_new;
|
||||
diff_context = diff_context_new;
|
||||
@@ -1742,22 +1784,22 @@ diff_find_change(wp, lnum, startp, endp)
|
||||
return FALSE;
|
||||
|
||||
/* search for a change that includes "lnum" in the list of diffblocks. */
|
||||
for (dp = first_diff; dp != NULL; dp = dp->df_next)
|
||||
for (dp = curtab->tp_first_diff; dp != NULL; dp = dp->df_next)
|
||||
if (lnum <= dp->df_lnum[idx] + dp->df_count[idx])
|
||||
break;
|
||||
if (dp == NULL || diff_check_sanity(dp) == FAIL)
|
||||
if (dp == NULL || diff_check_sanity(curtab, dp) == FAIL)
|
||||
return FALSE;
|
||||
|
||||
off = lnum - dp->df_lnum[idx];
|
||||
|
||||
for (i = 0; i < DB_COUNT; ++i)
|
||||
if (diffbuf[i] != NULL && i != idx)
|
||||
if (curtab->tp_diffbuf[i] != NULL && i != idx)
|
||||
{
|
||||
/* Skip lines that are not in the other change (filler lines). */
|
||||
if (off >= dp->df_count[i])
|
||||
continue;
|
||||
added = FALSE;
|
||||
line_new = ml_get_buf(diffbuf[i], dp->df_lnum[i] + off, FALSE);
|
||||
line_new = ml_get_buf(curtab->tp_diffbuf[i], dp->df_lnum[i] + off, FALSE);
|
||||
|
||||
/* Search for start of difference */
|
||||
for (si = 0; line_org[si] != NUL && line_org[si] == line_new[si]; )
|
||||
@@ -1817,9 +1859,9 @@ diff_infold(wp, lnum)
|
||||
|
||||
for (i = 0; i < DB_COUNT; ++i)
|
||||
{
|
||||
if (diffbuf[i] == wp->w_buffer)
|
||||
if (curtab->tp_diffbuf[i] == wp->w_buffer)
|
||||
idx = i;
|
||||
else if (diffbuf[i] != NULL)
|
||||
else if (curtab->tp_diffbuf[i] != NULL)
|
||||
other = TRUE;
|
||||
}
|
||||
|
||||
@@ -1827,14 +1869,14 @@ diff_infold(wp, lnum)
|
||||
if (idx == -1 || !other)
|
||||
return FALSE;
|
||||
|
||||
if (diff_invalid)
|
||||
if (curtab->tp_diff_invalid)
|
||||
ex_diffupdate(NULL); /* update after a big change */
|
||||
|
||||
/* Return if there are no diff blocks. All lines will be folded. */
|
||||
if (first_diff == NULL)
|
||||
if (curtab->tp_first_diff == NULL)
|
||||
return TRUE;
|
||||
|
||||
for (dp = first_diff; dp != NULL; dp = dp->df_next)
|
||||
for (dp = curtab->tp_first_diff; dp != NULL; dp = dp->df_next)
|
||||
{
|
||||
/* If this change is below the line there can't be any further match. */
|
||||
if (dp->df_lnum[idx] - diff_context > lnum)
|
||||
@@ -1892,6 +1934,7 @@ ex_diffgetput(eap)
|
||||
buf_T *buf;
|
||||
int start_skip, end_skip;
|
||||
int new_count;
|
||||
int buf_empty;
|
||||
|
||||
/* Find the current buffer in the list of diff buffers. */
|
||||
idx_cur = diff_buf_idx(curbuf);
|
||||
@@ -1905,10 +1948,10 @@ ex_diffgetput(eap)
|
||||
{
|
||||
/* No argument: Find the other buffer in the list of diff buffers. */
|
||||
for (idx_other = 0; idx_other < DB_COUNT; ++idx_other)
|
||||
if (diffbuf[idx_other] != curbuf
|
||||
&& diffbuf[idx_other] != NULL
|
||||
if (curtab->tp_diffbuf[idx_other] != curbuf
|
||||
&& curtab->tp_diffbuf[idx_other] != NULL
|
||||
&& (eap->cmdidx != CMD_diffput
|
||||
|| diffbuf[idx_other]->b_p_ma))
|
||||
|| curtab->tp_diffbuf[idx_other]->b_p_ma))
|
||||
break;
|
||||
if (idx_other == DB_COUNT)
|
||||
{
|
||||
@@ -1918,9 +1961,9 @@ ex_diffgetput(eap)
|
||||
|
||||
/* Check that there isn't a third buffer in the list */
|
||||
for (i = idx_other + 1; i < DB_COUNT; ++i)
|
||||
if (diffbuf[i] != curbuf
|
||||
&& diffbuf[i] != NULL
|
||||
&& (eap->cmdidx != CMD_diffput || diffbuf[i]->b_p_ma))
|
||||
if (curtab->tp_diffbuf[i] != curbuf
|
||||
&& curtab->tp_diffbuf[i] != NULL
|
||||
&& (eap->cmdidx != CMD_diffput || curtab->tp_diffbuf[i]->b_p_ma))
|
||||
{
|
||||
EMSG(_("E101: More than two buffers in diff mode, don't know which one to use"));
|
||||
return;
|
||||
@@ -1984,11 +2027,11 @@ ex_diffgetput(eap)
|
||||
/* Need to make the other buffer the current buffer to be able to make
|
||||
* changes in it. */
|
||||
/* set curwin/curbuf to buf and save a few things */
|
||||
aucmd_prepbuf(&aco, diffbuf[idx_other]);
|
||||
aucmd_prepbuf(&aco, curtab->tp_diffbuf[idx_other]);
|
||||
}
|
||||
|
||||
dprev = NULL;
|
||||
for (dp = first_diff; dp != NULL; )
|
||||
for (dp = curtab->tp_first_diff; dp != NULL; )
|
||||
{
|
||||
if (dp->df_lnum[idx_cur] > eap->line2 + off)
|
||||
break; /* past the range that was specified */
|
||||
@@ -2046,9 +2089,12 @@ ex_diffgetput(eap)
|
||||
end_skip = 0;
|
||||
}
|
||||
|
||||
buf_empty = FALSE;
|
||||
added = 0;
|
||||
for (i = 0; i < count; ++i)
|
||||
{
|
||||
/* remember deleting the last line of the buffer */
|
||||
buf_empty = curbuf->b_ml.ml_line_count == 1;
|
||||
ml_delete(lnum, FALSE);
|
||||
--added;
|
||||
}
|
||||
@@ -2057,14 +2103,21 @@ ex_diffgetput(eap)
|
||||
linenr_T nr;
|
||||
|
||||
nr = dp->df_lnum[idx_from] + start_skip + i;
|
||||
if (nr > diffbuf[idx_from]->b_ml.ml_line_count)
|
||||
if (nr > curtab->tp_diffbuf[idx_from]->b_ml.ml_line_count)
|
||||
break;
|
||||
p = vim_strsave(ml_get_buf(diffbuf[idx_from], nr, FALSE));
|
||||
p = vim_strsave(ml_get_buf(curtab->tp_diffbuf[idx_from], nr, FALSE));
|
||||
if (p != NULL)
|
||||
{
|
||||
ml_append(lnum + i - 1, p, 0, FALSE);
|
||||
vim_free(p);
|
||||
++added;
|
||||
if (buf_empty && curbuf->b_ml.ml_line_count == 2)
|
||||
{
|
||||
/* Added the first line into an empty buffer, need to
|
||||
* delete the dummy empty line. */
|
||||
buf_empty = FALSE;
|
||||
ml_delete((linenr_T)2, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
new_count = dp->df_count[idx_to] + added;
|
||||
@@ -2075,7 +2128,7 @@ ex_diffgetput(eap)
|
||||
/* Check if there are any other buffers and if the diff is
|
||||
* equal in them. */
|
||||
for (i = 0; i < DB_COUNT; ++i)
|
||||
if (diffbuf[i] != NULL && i != idx_from && i != idx_to
|
||||
if (curtab->tp_diffbuf[i] != NULL && i != idx_from && i != idx_to
|
||||
&& !diff_equal_entry(dp, idx_from, i))
|
||||
break;
|
||||
if (i == DB_COUNT)
|
||||
@@ -2084,7 +2137,7 @@ ex_diffgetput(eap)
|
||||
dfree = dp;
|
||||
dp = dp->df_next;
|
||||
if (dprev == NULL)
|
||||
first_diff = dp;
|
||||
curtab->tp_first_diff = dp;
|
||||
else
|
||||
dprev->df_next = dp;
|
||||
}
|
||||
@@ -2169,7 +2222,7 @@ diff_fold_update(dp, skip_idx)
|
||||
|
||||
for (wp = firstwin; wp != NULL; wp = wp->w_next)
|
||||
for (i = 0; i < DB_COUNT; ++i)
|
||||
if (diffbuf[i] == wp->w_buffer && i != skip_idx)
|
||||
if (curtab->tp_diffbuf[i] == wp->w_buffer && i != skip_idx)
|
||||
foldUpdate(wp, dp->df_lnum[i],
|
||||
dp->df_lnum[i] + dp->df_count[i]);
|
||||
}
|
||||
@@ -2182,7 +2235,12 @@ diff_fold_update(dp, skip_idx)
|
||||
diff_mode_buf(buf)
|
||||
buf_T *buf;
|
||||
{
|
||||
return diff_buf_idx(buf) != DB_COUNT;
|
||||
tabpage_T *tp;
|
||||
|
||||
for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
|
||||
if (diff_buf_idx_tp(buf, tp) != DB_COUNT)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2199,22 +2257,22 @@ diff_move_to(dir, count)
|
||||
diff_T *dp;
|
||||
|
||||
idx = diff_buf_idx(curbuf);
|
||||
if (idx == DB_COUNT || first_diff == NULL)
|
||||
if (idx == DB_COUNT || curtab->tp_first_diff == NULL)
|
||||
return FAIL;
|
||||
|
||||
if (diff_invalid)
|
||||
if (curtab->tp_diff_invalid)
|
||||
ex_diffupdate(NULL); /* update after a big change */
|
||||
|
||||
if (first_diff == NULL) /* no diffs today */
|
||||
if (curtab->tp_first_diff == NULL) /* no diffs today */
|
||||
return FAIL;
|
||||
|
||||
while (--count >= 0)
|
||||
{
|
||||
/* Check if already before first diff. */
|
||||
if (dir == BACKWARD && lnum <= first_diff->df_lnum[idx])
|
||||
if (dir == BACKWARD && lnum <= curtab->tp_first_diff->df_lnum[idx])
|
||||
break;
|
||||
|
||||
for (dp = first_diff; ; dp = dp->df_next)
|
||||
for (dp = curtab->tp_first_diff; ; dp = dp->df_next)
|
||||
{
|
||||
if (dp == NULL)
|
||||
break;
|
||||
@@ -2263,11 +2321,11 @@ diff_lnum_win(lnum, wp)
|
||||
if (idx == DB_COUNT) /* safety check */
|
||||
return (linenr_T)0;
|
||||
|
||||
if (diff_invalid)
|
||||
if (curtab->tp_diff_invalid)
|
||||
ex_diffupdate(NULL); /* update after a big change */
|
||||
|
||||
/* search for a change that includes "lnum" in the list of diffblocks. */
|
||||
for (dp = first_diff; dp != NULL; dp = dp->df_next)
|
||||
for (dp = curtab->tp_first_diff; dp != NULL; dp = dp->df_next)
|
||||
if (lnum <= dp->df_lnum[idx] + dp->df_count[idx])
|
||||
break;
|
||||
|
||||
|
||||
@@ -1194,24 +1194,25 @@ install_vimrc(int idx)
|
||||
fprintf(fd, " if arg2 =~ ' ' | let arg2 = '\"' . arg2 . '\"' | endif\n");
|
||||
fprintf(fd, " let arg3 = v:fname_out\n");
|
||||
fprintf(fd, " if arg3 =~ ' ' | let arg3 = '\"' . arg3 . '\"' | endif\n");
|
||||
p = strchr(installdir, ' ');
|
||||
if (p != NULL)
|
||||
{
|
||||
/* The path has a space. When using cmd.exe (Win NT/2000/XP) put
|
||||
* quotes around the whole command and around the diff command.
|
||||
* Otherwise put a double quote just before the space and at the
|
||||
* end of the command. Putting quotes around the whole thing
|
||||
* doesn't work on Win 95/98/ME. This is mostly guessed! */
|
||||
fprintf(fd, " if &sh =~ '\\<cmd'\n");
|
||||
fprintf(fd, " silent execute '!\"\"%s\\diff\" ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . '\"'\n", installdir);
|
||||
fprintf(fd, " else\n");
|
||||
*p = NUL;
|
||||
fprintf(fd, " silent execute '!%s\" %s\\diff\" ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3\n", installdir, p + 1);
|
||||
*p = ' ';
|
||||
fprintf(fd, " endif\n");
|
||||
}
|
||||
else
|
||||
fprintf(fd, " silent execute '!%s\\diff ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3\n", installdir);
|
||||
|
||||
/* If the path has a space: When using cmd.exe (Win NT/2000/XP) put
|
||||
* quotes around the whole command and around the diff command.
|
||||
* Otherwise put a double quote just before the space and at the
|
||||
* end of the command. Putting quotes around the whole thing
|
||||
* doesn't work on Win 95/98/ME. This is mostly guessed! */
|
||||
fprintf(fd, " let eq = ''\n");
|
||||
fprintf(fd, " if $VIMRUNTIME =~ ' '\n");
|
||||
fprintf(fd, " if &sh =~ '\\<cmd'\n");
|
||||
fprintf(fd, " let cmd = '\"\"' . $VIMRUNTIME . '\\diff\"'\n");
|
||||
fprintf(fd, " let eq = '\"'\n");
|
||||
fprintf(fd, " else\n");
|
||||
fprintf(fd, " let cmd = substitute($VIMRUNTIME, ' ', '\" ', '') . '\\diff\"'\n");
|
||||
fprintf(fd, " endif\n");
|
||||
fprintf(fd, " else\n");
|
||||
fprintf(fd, " let cmd = $VIMRUNTIME . '\\diff'\n");
|
||||
fprintf(fd, " endif\n");
|
||||
fprintf(fd, " silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq\n");
|
||||
|
||||
fprintf(fd, "endfunction\n");
|
||||
fprintf(fd, "\n");
|
||||
}
|
||||
|
||||
1458
src/edit.c
1458
src/edit.c
File diff suppressed because it is too large
Load Diff
528
src/eval.c
528
src/eval.c
@@ -400,8 +400,6 @@ static int get_option_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate));
|
||||
static int get_string_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate));
|
||||
static int get_lit_string_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate));
|
||||
static int get_list_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate));
|
||||
static list_T *list_alloc __ARGS((void));
|
||||
static void list_free __ARGS((list_T *l));
|
||||
static listitem_T *listitem_alloc __ARGS((void));
|
||||
static void listitem_free __ARGS((listitem_T *item));
|
||||
static void listitem_remove __ARGS((list_T *l, listitem_T *item));
|
||||
@@ -575,6 +573,7 @@ static void f_nextnonblank __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_nr2char __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_prevnonblank __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_printf __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_pumvisible __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_range __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_readfile __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_remote_expr __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
@@ -590,11 +589,14 @@ static void f_reverse __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_search __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_searchdecl __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_searchpair __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_searchpairpos __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_searchpos __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_server2client __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_serverlist __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_setbufvar __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_setcmdpos __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_setline __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_setloclist __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_setqflist __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_setreg __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_setwinvar __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
@@ -619,6 +621,9 @@ static void f_synID __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_synIDattr __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_synIDtrans __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_system __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_tabpagebuflist __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_tabpagenr __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_tabpagewinnr __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_taglist __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_tagfiles __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_tempname __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
@@ -704,6 +709,9 @@ static void func_unref __ARGS((char_u *name));
|
||||
static void func_ref __ARGS((char_u *name));
|
||||
static void call_user_func __ARGS((ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rettv, linenr_T firstline, linenr_T lastline, dict_T *selfdict));
|
||||
static void add_nr_var __ARGS((dict_T *dp, dictitem_T *v, char *name, varnumber_T nr));
|
||||
static win_T *find_win_by_nr __ARGS((typval_T *vp));
|
||||
static int searchpair_cmn __ARGS((typval_T *argvars, pos_T *match_pos));
|
||||
static int search_cmn __ARGS((typval_T *argvars, pos_T *match_pos));
|
||||
|
||||
/* Character used as separated in autoload function/variable names. */
|
||||
#define AUTOLOAD_CHAR '#'
|
||||
@@ -1572,7 +1580,8 @@ eval_foldexpr(arg, cp)
|
||||
typval_T tv;
|
||||
int retval;
|
||||
char_u *s;
|
||||
int use_sandbox = was_set_insecurely((char_u *)"foldexpr");
|
||||
int use_sandbox = was_set_insecurely((char_u *)"foldexpr",
|
||||
OPT_LOCAL);
|
||||
|
||||
++emsg_off;
|
||||
if (use_sandbox)
|
||||
@@ -5195,7 +5204,7 @@ failret:
|
||||
* Allocate an empty header for a list.
|
||||
* Caller should take care of the reference count.
|
||||
*/
|
||||
static list_T *
|
||||
list_T *
|
||||
list_alloc()
|
||||
{
|
||||
list_T *l;
|
||||
@@ -5229,7 +5238,7 @@ list_unref(l)
|
||||
* Free a list, including all items it points to.
|
||||
* Ignores the reference count.
|
||||
*/
|
||||
static void
|
||||
void
|
||||
list_free(l)
|
||||
list_T *l;
|
||||
{
|
||||
@@ -6342,20 +6351,26 @@ dict_find(d, key, len)
|
||||
}
|
||||
|
||||
/*
|
||||
* Get a string item from a dictionary in allocated memory.
|
||||
* Get a string item from a dictionary.
|
||||
* When "save" is TRUE allocate memory for it.
|
||||
* Returns NULL if the entry doesn't exist or out of memory.
|
||||
*/
|
||||
char_u *
|
||||
get_dict_string(d, key)
|
||||
get_dict_string(d, key, save)
|
||||
dict_T *d;
|
||||
char_u *key;
|
||||
int save;
|
||||
{
|
||||
dictitem_T *di;
|
||||
char_u *s;
|
||||
|
||||
di = dict_find(d, key, -1);
|
||||
if (di == NULL)
|
||||
return NULL;
|
||||
return vim_strsave(get_tv_string(&di->di_tv));
|
||||
s = get_tv_string(&di->di_tv);
|
||||
if (save && s != NULL)
|
||||
s = vim_strsave(s);
|
||||
return s;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -6863,6 +6878,7 @@ static struct fst
|
||||
{"getftime", 1, 1, f_getftime},
|
||||
{"getftype", 1, 1, f_getftype},
|
||||
{"getline", 1, 2, f_getline},
|
||||
{"getloclist", 1, 1, f_getqflist},
|
||||
{"getqflist", 0, 0, f_getqflist},
|
||||
{"getreg", 0, 2, f_getreg},
|
||||
{"getregtype", 0, 1, f_getregtype},
|
||||
@@ -6923,6 +6939,7 @@ static struct fst
|
||||
{"nr2char", 1, 1, f_nr2char},
|
||||
{"prevnonblank", 1, 1, f_prevnonblank},
|
||||
{"printf", 2, 19, f_printf},
|
||||
{"pumvisible", 0, 0, f_pumvisible},
|
||||
{"range", 1, 3, f_range},
|
||||
{"readfile", 1, 3, f_readfile},
|
||||
{"remote_expr", 2, 3, f_remote_expr},
|
||||
@@ -6938,11 +6955,14 @@ static struct fst
|
||||
{"search", 1, 2, f_search},
|
||||
{"searchdecl", 1, 3, f_searchdecl},
|
||||
{"searchpair", 3, 5, f_searchpair},
|
||||
{"searchpairpos", 3, 5, f_searchpairpos},
|
||||
{"searchpos", 1, 2, f_searchpos},
|
||||
{"server2client", 2, 2, f_server2client},
|
||||
{"serverlist", 0, 0, f_serverlist},
|
||||
{"setbufvar", 3, 3, f_setbufvar},
|
||||
{"setcmdpos", 1, 1, f_setcmdpos},
|
||||
{"setline", 2, 2, f_setline},
|
||||
{"setloclist", 2, 3, f_setloclist},
|
||||
{"setqflist", 1, 2, f_setqflist},
|
||||
{"setreg", 2, 3, f_setreg},
|
||||
{"setwinvar", 3, 3, f_setwinvar},
|
||||
@@ -6967,6 +6987,9 @@ static struct fst
|
||||
{"synIDattr", 2, 3, f_synIDattr},
|
||||
{"synIDtrans", 1, 1, f_synIDtrans},
|
||||
{"system", 1, 2, f_system},
|
||||
{"tabpagebuflist", 0, 1, f_tabpagebuflist},
|
||||
{"tabpagenr", 0, 1, f_tabpagenr},
|
||||
{"tabpagewinnr", 1, 2, f_tabpagewinnr},
|
||||
{"tagfiles", 0, 0, f_tagfiles},
|
||||
{"taglist", 1, 1, f_taglist},
|
||||
{"tempname", 0, 0, f_tempname},
|
||||
@@ -7174,7 +7197,8 @@ get_func_tv(name, len, rettv, arg, firstline, lastline, doesrange,
|
||||
|
||||
/*
|
||||
* Call a function with its resolved parameters
|
||||
* Return OK or FAIL.
|
||||
* Return OK when the function can't be called, FAIL otherwise.
|
||||
* Also returns OK when an error was encountered while executing the function.
|
||||
*/
|
||||
static int
|
||||
call_func(name, len, rettv, argcount, argvars, firstline, lastline,
|
||||
@@ -8011,11 +8035,23 @@ f_complete_add(argvars, rettv)
|
||||
typval_T *argvars;
|
||||
typval_T *rettv;
|
||||
{
|
||||
char_u *s;
|
||||
char_u *word;
|
||||
char_u *extra = NULL;
|
||||
int icase = FALSE;
|
||||
|
||||
s = get_tv_string_chk(&argvars[0]);
|
||||
if (s != NULL)
|
||||
rettv->vval.v_number = ins_compl_add(s, -1, NULL, FORWARD, 0);
|
||||
if (argvars[0].v_type == VAR_DICT && argvars[0].vval.v_dict != NULL)
|
||||
{
|
||||
word = get_dict_string(argvars[0].vval.v_dict,
|
||||
(char_u *)"word", FALSE);
|
||||
extra = get_dict_string(argvars[0].vval.v_dict,
|
||||
(char_u *)"menu", FALSE);
|
||||
icase = get_dict_number(argvars[0].vval.v_dict, (char_u *)"icase");
|
||||
}
|
||||
else
|
||||
word = get_tv_string_chk(&argvars[0]);
|
||||
if (word != NULL)
|
||||
rettv->vval.v_number = ins_compl_add(word, -1, icase,
|
||||
NULL, extra, 0, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -8824,7 +8860,7 @@ filter_map(argvars, rettv, map)
|
||||
int rem;
|
||||
int todo;
|
||||
char_u *msg = map ? (char_u *)"map()" : (char_u *)"filter()";
|
||||
|
||||
int save_called_emsg;
|
||||
|
||||
rettv->vval.v_number = 0;
|
||||
if (argvars[0].v_type == VAR_LIST)
|
||||
@@ -8854,6 +8890,12 @@ filter_map(argvars, rettv, map)
|
||||
prepare_vimvar(VV_VAL, &save_val);
|
||||
expr = skipwhite(expr);
|
||||
|
||||
/* We reset "called_emsg" to be able to detect whether an error
|
||||
* occurred during evaluation of the expression. "did_emsg" can't be
|
||||
* used, because it is reset when calling a function. */
|
||||
save_called_emsg = called_emsg;
|
||||
called_emsg = FALSE;
|
||||
|
||||
if (argvars[0].v_type == VAR_DICT)
|
||||
{
|
||||
prepare_vimvar(VV_KEY, &save_key);
|
||||
@@ -8871,7 +8913,8 @@ filter_map(argvars, rettv, map)
|
||||
if (tv_check_lock(di->di_tv.v_lock, msg))
|
||||
break;
|
||||
vimvars[VV_KEY].vv_str = vim_strsave(di->di_key);
|
||||
if (filter_map_one(&di->di_tv, expr, map, &rem) == FAIL)
|
||||
if (filter_map_one(&di->di_tv, expr, map, &rem) == FAIL
|
||||
|| called_emsg)
|
||||
break;
|
||||
if (!map && rem)
|
||||
dictitem_remove(d, di);
|
||||
@@ -8889,7 +8932,8 @@ filter_map(argvars, rettv, map)
|
||||
if (tv_check_lock(li->li_tv.v_lock, msg))
|
||||
break;
|
||||
nli = li->li_next;
|
||||
if (filter_map_one(&li->li_tv, expr, map, &rem) == FAIL)
|
||||
if (filter_map_one(&li->li_tv, expr, map, &rem) == FAIL
|
||||
|| called_emsg)
|
||||
break;
|
||||
if (!map && rem)
|
||||
listitem_remove(l, li);
|
||||
@@ -8897,6 +8941,8 @@ filter_map(argvars, rettv, map)
|
||||
}
|
||||
|
||||
restore_vimvar(VV_VAL, &save_val);
|
||||
|
||||
called_emsg |= save_called_emsg;
|
||||
}
|
||||
|
||||
copy_tv(&argvars[0], rettv);
|
||||
@@ -9791,7 +9837,7 @@ f_getline(argvars, rettv)
|
||||
}
|
||||
|
||||
/*
|
||||
* "getqflist()" function
|
||||
* "getqflist()" and "getloclist()" functions
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
@@ -9801,6 +9847,7 @@ f_getqflist(argvars, rettv)
|
||||
{
|
||||
#ifdef FEAT_QUICKFIX
|
||||
list_T *l;
|
||||
win_T *wp;
|
||||
#endif
|
||||
|
||||
rettv->vval.v_number = FALSE;
|
||||
@@ -9811,7 +9858,15 @@ f_getqflist(argvars, rettv)
|
||||
rettv->vval.v_list = l;
|
||||
rettv->v_type = VAR_LIST;
|
||||
++l->lv_refcount;
|
||||
(void)get_errorlist(l);
|
||||
wp = NULL;
|
||||
if (argvars[0].v_type != VAR_UNKNOWN) /* getloclist() */
|
||||
{
|
||||
wp = find_win_by_nr(&argvars[0]);
|
||||
if (wp == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
(void)get_errorlist(wp, l);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -9937,8 +9992,6 @@ f_getwinposy(argvars, rettv)
|
||||
#endif
|
||||
}
|
||||
|
||||
static win_T *find_win_by_nr __ARGS((typval_T *vp));
|
||||
|
||||
static win_T *
|
||||
find_win_by_nr(vp)
|
||||
typval_T *vp;
|
||||
@@ -12178,6 +12231,22 @@ f_printf(argvars, rettv)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* "pumvisible()" function
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
f_pumvisible(argvars, rettv)
|
||||
typval_T *argvars;
|
||||
typval_T *rettv;
|
||||
{
|
||||
rettv->vval.v_number = 0;
|
||||
#ifdef FEAT_INS_EXPAND
|
||||
if (pum_visible())
|
||||
rettv->vval.v_number = 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* "range()" function
|
||||
*/
|
||||
@@ -13100,12 +13169,12 @@ get_search_arg(varp, flagsp)
|
||||
}
|
||||
|
||||
/*
|
||||
* "search()" function
|
||||
* Shared by search() and searchpos() functions
|
||||
*/
|
||||
static void
|
||||
f_search(argvars, rettv)
|
||||
static int
|
||||
search_cmn(argvars, match_pos)
|
||||
typval_T *argvars;
|
||||
typval_T *rettv;
|
||||
pos_T *match_pos;
|
||||
{
|
||||
char_u *pat;
|
||||
pos_T pos;
|
||||
@@ -13113,8 +13182,7 @@ f_search(argvars, rettv)
|
||||
int save_p_ws = p_ws;
|
||||
int dir;
|
||||
int flags = 0;
|
||||
|
||||
rettv->vval.v_number = 0; /* default: FAIL */
|
||||
int retval = 0; /* default: FAIL */
|
||||
|
||||
pat = get_tv_string(&argvars[0]);
|
||||
dir = get_search_arg(&argvars[1], &flags); /* may set p_ws */
|
||||
@@ -13137,10 +13205,16 @@ f_search(argvars, rettv)
|
||||
if (searchit(curwin, curbuf, &pos, dir, pat, 1L,
|
||||
SEARCH_KEEP, RE_SEARCH) != FAIL)
|
||||
{
|
||||
rettv->vval.v_number = pos.lnum;
|
||||
retval = pos.lnum;
|
||||
if (flags & SP_SETPCMARK)
|
||||
setpcmark();
|
||||
curwin->w_cursor = pos;
|
||||
if (match_pos != NULL)
|
||||
{
|
||||
/* Store the match cursor position */
|
||||
match_pos->lnum = pos.lnum;
|
||||
match_pos->col = pos.col + 1;
|
||||
}
|
||||
/* "/$" will put the cursor after the end of the line, may need to
|
||||
* correct that here */
|
||||
check_cursor();
|
||||
@@ -13151,6 +13225,19 @@ f_search(argvars, rettv)
|
||||
curwin->w_cursor = save_cursor;
|
||||
theend:
|
||||
p_ws = save_p_ws;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* "search()" function
|
||||
*/
|
||||
static void
|
||||
f_search(argvars, rettv)
|
||||
typval_T *argvars;
|
||||
typval_T *rettv;
|
||||
{
|
||||
rettv->vval.v_number = search_cmn(argvars, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -13181,12 +13268,12 @@ f_searchdecl(argvars, rettv)
|
||||
}
|
||||
|
||||
/*
|
||||
* "searchpair()" function
|
||||
* Used by searchpair() and searchpairpos()
|
||||
*/
|
||||
static void
|
||||
f_searchpair(argvars, rettv)
|
||||
static int
|
||||
searchpair_cmn(argvars, match_pos)
|
||||
typval_T *argvars;
|
||||
typval_T *rettv;
|
||||
pos_T *match_pos;
|
||||
{
|
||||
char_u *spat, *mpat, *epat;
|
||||
char_u *skip;
|
||||
@@ -13196,8 +13283,7 @@ f_searchpair(argvars, rettv)
|
||||
char_u nbuf1[NUMBUFLEN];
|
||||
char_u nbuf2[NUMBUFLEN];
|
||||
char_u nbuf3[NUMBUFLEN];
|
||||
|
||||
rettv->vval.v_number = 0; /* default: FAIL */
|
||||
int retval = 0; /* default: FAIL */
|
||||
|
||||
/* Get the three pattern arguments: start, middle, end. */
|
||||
spat = get_tv_string_chk(&argvars[0]);
|
||||
@@ -13219,7 +13305,7 @@ f_searchpair(argvars, rettv)
|
||||
goto theend;
|
||||
}
|
||||
|
||||
/* Optional fifth argument: skip expresion */
|
||||
/* Optional fifth argument: skip expression */
|
||||
if (argvars[3].v_type == VAR_UNKNOWN
|
||||
|| argvars[4].v_type == VAR_UNKNOWN)
|
||||
skip = (char_u *)"";
|
||||
@@ -13228,10 +13314,55 @@ f_searchpair(argvars, rettv)
|
||||
if (skip == NULL)
|
||||
goto theend; /* type error */
|
||||
|
||||
rettv->vval.v_number = do_searchpair(spat, mpat, epat, dir, skip, flags);
|
||||
retval = do_searchpair(spat, mpat, epat, dir, skip, flags, match_pos);
|
||||
|
||||
theend:
|
||||
p_ws = save_p_ws;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* "searchpair()" function
|
||||
*/
|
||||
static void
|
||||
f_searchpair(argvars, rettv)
|
||||
typval_T *argvars;
|
||||
typval_T *rettv;
|
||||
{
|
||||
rettv->vval.v_number = searchpair_cmn(argvars, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* "searchpairpos()" function
|
||||
*/
|
||||
static void
|
||||
f_searchpairpos(argvars, rettv)
|
||||
typval_T *argvars;
|
||||
typval_T *rettv;
|
||||
{
|
||||
list_T *l;
|
||||
pos_T match_pos;
|
||||
int lnum = 0;
|
||||
int col = 0;
|
||||
|
||||
rettv->vval.v_number = 0;
|
||||
|
||||
l = list_alloc();
|
||||
if (l == NULL)
|
||||
return;
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = l;
|
||||
++l->lv_refcount;
|
||||
|
||||
if (searchpair_cmn(argvars, &match_pos) > 0)
|
||||
{
|
||||
lnum = match_pos.lnum;
|
||||
col = match_pos.col;
|
||||
}
|
||||
|
||||
list_append_number(l, (varnumber_T)lnum);
|
||||
list_append_number(l, (varnumber_T)col);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -13240,13 +13371,14 @@ theend:
|
||||
* Returns 0 or -1 for no match,
|
||||
*/
|
||||
long
|
||||
do_searchpair(spat, mpat, epat, dir, skip, flags)
|
||||
do_searchpair(spat, mpat, epat, dir, skip, flags, match_pos)
|
||||
char_u *spat; /* start pattern */
|
||||
char_u *mpat; /* middle pattern */
|
||||
char_u *epat; /* end pattern */
|
||||
int dir; /* BACKWARD or FORWARD */
|
||||
char_u *skip; /* skip expression */
|
||||
int flags; /* SP_RETCOUNT, SP_REPEAT, SP_NOMOVE */
|
||||
pos_T *match_pos;
|
||||
{
|
||||
char_u *save_cpo;
|
||||
char_u *pat, *pat2 = NULL, *pat3 = NULL;
|
||||
@@ -13354,6 +13486,13 @@ do_searchpair(spat, mpat, epat, dir, skip, flags)
|
||||
}
|
||||
}
|
||||
|
||||
if (match_pos != NULL)
|
||||
{
|
||||
/* Store the match cursor position */
|
||||
match_pos->lnum = curwin->w_cursor.lnum;
|
||||
match_pos->col = curwin->w_cursor.col + 1;
|
||||
}
|
||||
|
||||
/* If 'n' flag is used or search failed: restore cursor position. */
|
||||
if ((flags & SP_NOMOVE) || retval == 0)
|
||||
curwin->w_cursor = save_cursor;
|
||||
@@ -13366,6 +13505,40 @@ theend:
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* "searchpos()" function
|
||||
*/
|
||||
static void
|
||||
f_searchpos(argvars, rettv)
|
||||
typval_T *argvars;
|
||||
typval_T *rettv;
|
||||
{
|
||||
list_T *l;
|
||||
pos_T match_pos;
|
||||
int lnum = 0;
|
||||
int col = 0;
|
||||
|
||||
rettv->vval.v_number = 0;
|
||||
|
||||
l = list_alloc();
|
||||
if (l == NULL)
|
||||
return;
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = l;
|
||||
++l->lv_refcount;
|
||||
|
||||
if (search_cmn(argvars, &match_pos) > 0)
|
||||
{
|
||||
lnum = match_pos.lnum;
|
||||
col = match_pos.col;
|
||||
}
|
||||
|
||||
list_append_number(l, (varnumber_T)lnum);
|
||||
list_append_number(l, (varnumber_T)col);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
f_server2client(argvars, rettv)
|
||||
@@ -13571,12 +13744,14 @@ f_setline(argvars, rettv)
|
||||
}
|
||||
|
||||
/*
|
||||
* "setqflist()" function
|
||||
* Used by "setqflist()" and "setloclist()" functions
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
f_setqflist(argvars, rettv)
|
||||
typval_T *argvars;
|
||||
set_qf_ll_list(wp, list_arg, action_arg, rettv)
|
||||
win_T *wp;
|
||||
typval_T *list_arg;
|
||||
typval_T *action_arg;
|
||||
typval_T *rettv;
|
||||
{
|
||||
#ifdef FEAT_QUICKFIX
|
||||
@@ -13587,27 +13762,57 @@ f_setqflist(argvars, rettv)
|
||||
rettv->vval.v_number = -1;
|
||||
|
||||
#ifdef FEAT_QUICKFIX
|
||||
if (argvars[0].v_type != VAR_LIST)
|
||||
if (list_arg->v_type != VAR_LIST)
|
||||
EMSG(_(e_listreq));
|
||||
else
|
||||
{
|
||||
list_T *l = argvars[0].vval.v_list;
|
||||
list_T *l = list_arg->vval.v_list;
|
||||
|
||||
if (argvars[1].v_type == VAR_STRING)
|
||||
if (action_arg->v_type == VAR_STRING)
|
||||
{
|
||||
act = get_tv_string_chk(&argvars[1]);
|
||||
act = get_tv_string_chk(action_arg);
|
||||
if (act == NULL)
|
||||
return; /* type error; errmsg already given */
|
||||
if (*act == 'a' || *act == 'r')
|
||||
action = *act;
|
||||
}
|
||||
|
||||
if (l != NULL && set_errorlist(l, action) == OK)
|
||||
if (l != NULL && set_errorlist(wp, l, action) == OK)
|
||||
rettv->vval.v_number = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* "setloclist()" function
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
f_setloclist(argvars, rettv)
|
||||
typval_T *argvars;
|
||||
typval_T *rettv;
|
||||
{
|
||||
win_T *win;
|
||||
|
||||
rettv->vval.v_number = -1;
|
||||
|
||||
win = find_win_by_nr(&argvars[0]);
|
||||
if (win != NULL)
|
||||
set_qf_ll_list(win, &argvars[1], &argvars[2], rettv);
|
||||
}
|
||||
|
||||
/*
|
||||
* "setqflist()" function
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
f_setqflist(argvars, rettv)
|
||||
typval_T *argvars;
|
||||
typval_T *rettv;
|
||||
{
|
||||
set_qf_ll_list(NULL, &argvars[0], &argvars[1], rettv);
|
||||
}
|
||||
|
||||
/*
|
||||
* "setreg()" function
|
||||
*/
|
||||
@@ -13960,11 +14165,9 @@ f_spellbadword(argvars, rettv)
|
||||
typval_T *rettv;
|
||||
{
|
||||
char_u *word = (char_u *)"";
|
||||
#ifdef FEAT_SYN_HL
|
||||
int len = 0;
|
||||
hlf_T attr = HLF_COUNT;
|
||||
int len = 0;
|
||||
list_T *l;
|
||||
#endif
|
||||
|
||||
l = list_alloc();
|
||||
if (l == NULL)
|
||||
@@ -14674,6 +14877,155 @@ done:
|
||||
rettv->vval.v_string = res;
|
||||
}
|
||||
|
||||
/*
|
||||
* "tabpagebuflist()" function
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
f_tabpagebuflist(argvars, rettv)
|
||||
typval_T *argvars;
|
||||
typval_T *rettv;
|
||||
{
|
||||
#ifndef FEAT_WINDOWS
|
||||
rettv->vval.v_number = 0;
|
||||
#else
|
||||
tabpage_T *tp;
|
||||
win_T *wp = NULL;
|
||||
list_T *l;
|
||||
|
||||
if (argvars[0].v_type == VAR_UNKNOWN)
|
||||
wp = firstwin;
|
||||
else
|
||||
{
|
||||
tp = find_tabpage((int)get_tv_number(&argvars[0]));
|
||||
if (tp != NULL)
|
||||
wp = (tp == curtab) ? firstwin : tp->tp_firstwin;
|
||||
}
|
||||
if (wp == NULL)
|
||||
rettv->vval.v_number = 0;
|
||||
else
|
||||
{
|
||||
l = list_alloc();
|
||||
if (l == NULL)
|
||||
rettv->vval.v_number = 0;
|
||||
else
|
||||
{
|
||||
rettv->vval.v_list = l;
|
||||
rettv->v_type = VAR_LIST;
|
||||
++l->lv_refcount;
|
||||
|
||||
for (; wp != NULL; wp = wp->w_next)
|
||||
if (list_append_number(l, wp->w_buffer->b_fnum) == FAIL)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* "tabpagenr()" function
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
f_tabpagenr(argvars, rettv)
|
||||
typval_T *argvars;
|
||||
typval_T *rettv;
|
||||
{
|
||||
int nr = 1;
|
||||
#ifdef FEAT_WINDOWS
|
||||
tabpage_T *tp;
|
||||
char_u *arg;
|
||||
|
||||
if (argvars[0].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
arg = get_tv_string_chk(&argvars[0]);
|
||||
nr = 0;
|
||||
if (arg != NULL)
|
||||
{
|
||||
if (STRCMP(arg, "$") == 0)
|
||||
for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
|
||||
++nr;
|
||||
else
|
||||
EMSG2(_(e_invexpr2), arg);
|
||||
}
|
||||
}
|
||||
else
|
||||
for (tp = first_tabpage; tp != curtab; tp = tp->tp_next)
|
||||
++nr;
|
||||
#endif
|
||||
rettv->vval.v_number = nr;
|
||||
}
|
||||
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
static int get_winnr __ARGS((tabpage_T *tp, typval_T *argvar));
|
||||
|
||||
/*
|
||||
* Common code for tabpagewinnr() and winnr().
|
||||
*/
|
||||
static int
|
||||
get_winnr(tp, argvar)
|
||||
tabpage_T *tp;
|
||||
typval_T *argvar;
|
||||
{
|
||||
win_T *twin;
|
||||
int nr = 1;
|
||||
win_T *wp;
|
||||
char_u *arg;
|
||||
|
||||
twin = (tp == curtab) ? curwin : tp->tp_curwin;
|
||||
if (argvar->v_type != VAR_UNKNOWN)
|
||||
{
|
||||
arg = get_tv_string_chk(argvar);
|
||||
if (arg == NULL)
|
||||
nr = 0; /* type error; errmsg already given */
|
||||
else if (STRCMP(arg, "$") == 0)
|
||||
twin = (tp == curtab) ? lastwin : tp->tp_lastwin;
|
||||
else if (STRCMP(arg, "#") == 0)
|
||||
{
|
||||
twin = (tp == curtab) ? prevwin : tp->tp_prevwin;
|
||||
if (twin == NULL)
|
||||
nr = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
EMSG2(_(e_invexpr2), arg);
|
||||
nr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (nr > 0)
|
||||
for (wp = (tp == curtab) ? firstwin : tp->tp_firstwin;
|
||||
wp != twin; wp = wp->w_next)
|
||||
++nr;
|
||||
return nr;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* "tabpagewinnr()" function
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
f_tabpagewinnr(argvars, rettv)
|
||||
typval_T *argvars;
|
||||
typval_T *rettv;
|
||||
{
|
||||
int nr = 1;
|
||||
#ifdef FEAT_WINDOWS
|
||||
tabpage_T *tp;
|
||||
|
||||
tp = find_tabpage((int)get_tv_number(&argvars[0]));
|
||||
if (tp == NULL)
|
||||
nr = 0;
|
||||
else
|
||||
nr = get_winnr(tp, &argvars[1]);
|
||||
#endif
|
||||
rettv->vval.v_number = nr;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* "tagfiles()" function
|
||||
*/
|
||||
@@ -15128,34 +15480,9 @@ f_winnr(argvars, rettv)
|
||||
typval_T *rettv;
|
||||
{
|
||||
int nr = 1;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *wp;
|
||||
win_T *twin = curwin;
|
||||
char_u *arg;
|
||||
|
||||
if (argvars[0].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
arg = get_tv_string_chk(&argvars[0]);
|
||||
if (arg == NULL)
|
||||
nr = 0; /* type error; errmsg already given */
|
||||
else if (STRCMP(arg, "$") == 0)
|
||||
twin = lastwin;
|
||||
else if (STRCMP(arg, "#") == 0)
|
||||
{
|
||||
twin = prevwin;
|
||||
if (prevwin == NULL)
|
||||
nr = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
EMSG2(_(e_invexpr2), arg);
|
||||
nr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (nr > 0)
|
||||
for (wp = firstwin; wp != twin; wp = wp->w_next)
|
||||
++nr;
|
||||
nr = get_winnr(curtab, &argvars[0]);
|
||||
#endif
|
||||
rettv->vval.v_number = nr;
|
||||
}
|
||||
@@ -15311,7 +15638,23 @@ var2fpos(varp, lnum)
|
||||
return NULL;
|
||||
return pp;
|
||||
}
|
||||
if (name[0] == '$') /* last column or line */
|
||||
if (name[0] == 'w' && lnum)
|
||||
{
|
||||
pos.col = 0;
|
||||
if (name[1] == '0') /* "w0": first visible line */
|
||||
{
|
||||
update_topline();
|
||||
pos.lnum = curwin->w_topline;
|
||||
return &pos;
|
||||
}
|
||||
else if (name[1] == '$') /* "w$": last visible line */
|
||||
{
|
||||
validate_botline();
|
||||
pos.lnum = curwin->w_botline - 1;
|
||||
return &pos;
|
||||
}
|
||||
}
|
||||
else if (name[0] == '$') /* last column or line */
|
||||
{
|
||||
if (lnum)
|
||||
{
|
||||
@@ -17049,6 +17392,7 @@ ex_function(eap)
|
||||
char_u *name = NULL;
|
||||
char_u *p;
|
||||
char_u *arg;
|
||||
char_u *line_arg = NULL;
|
||||
garray_T newargs;
|
||||
garray_T newlines;
|
||||
int varargs = FALSE;
|
||||
@@ -17322,7 +17666,11 @@ ex_function(eap)
|
||||
break;
|
||||
}
|
||||
|
||||
if (*p != NUL && *p != '"' && *p != '\n' && !eap->skip && !did_emsg)
|
||||
/* When there is a line break use what follows for the function body.
|
||||
* Makes 'exe "func Test()\n...\nendfunc"' work. */
|
||||
if (*p == '\n')
|
||||
line_arg = p + 1;
|
||||
else if (*p != NUL && *p != '"' && !eap->skip && !did_emsg)
|
||||
EMSG(_(e_trailing));
|
||||
|
||||
/*
|
||||
@@ -17354,7 +17702,20 @@ ex_function(eap)
|
||||
{
|
||||
msg_scroll = TRUE;
|
||||
need_wait_return = FALSE;
|
||||
if (eap->getline == NULL)
|
||||
if (line_arg != NULL)
|
||||
{
|
||||
/* Use eap->arg, split up in parts by line breaks. */
|
||||
theline = line_arg;
|
||||
p = vim_strchr(theline, '\n');
|
||||
if (p == NULL)
|
||||
line_arg += STRLEN(line_arg);
|
||||
else
|
||||
{
|
||||
*p = NUL;
|
||||
line_arg = p + 1;
|
||||
}
|
||||
}
|
||||
else if (eap->getline == NULL)
|
||||
theline = getcmdline(':', 0L, indent);
|
||||
else
|
||||
theline = eap->getline(':', eap->cookie, indent);
|
||||
@@ -17385,7 +17746,8 @@ ex_function(eap)
|
||||
/* Check for "endfunction". */
|
||||
if (checkforcmd(&p, "endfunction", 4) && nesting-- == 0)
|
||||
{
|
||||
vim_free(theline);
|
||||
if (line_arg == NULL)
|
||||
vim_free(theline);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -17451,7 +17813,8 @@ ex_function(eap)
|
||||
/* Add the line to the function. */
|
||||
if (ga_grow(&newlines, 1) == FAIL)
|
||||
{
|
||||
vim_free(theline);
|
||||
if (line_arg == NULL)
|
||||
vim_free(theline);
|
||||
goto erret;
|
||||
}
|
||||
|
||||
@@ -17461,12 +17824,17 @@ ex_function(eap)
|
||||
p = vim_strsave(theline);
|
||||
if (p != NULL)
|
||||
{
|
||||
vim_free(theline);
|
||||
if (line_arg == NULL)
|
||||
vim_free(theline);
|
||||
theline = p;
|
||||
}
|
||||
|
||||
((char_u **)(newlines.ga_data))[newlines.ga_len] = theline;
|
||||
newlines.ga_len++;
|
||||
|
||||
/* Check for end of eap->arg. */
|
||||
if (line_arg != NULL && *line_arg == NUL)
|
||||
line_arg = NULL;
|
||||
}
|
||||
|
||||
/* Don't define the function when skipping commands or when an error was
|
||||
|
||||
@@ -1212,11 +1212,8 @@ do_filter(line1, line2, eap, cmd, do_in, do_out)
|
||||
vim_snprintf((char *)msg_buf, sizeof(msg_buf),
|
||||
_("%ld lines filtered"), (long)linecount);
|
||||
if (msg(msg_buf) && !msg_scroll)
|
||||
{
|
||||
/* save message to display it after redraw */
|
||||
set_keep_msg(msg_buf);
|
||||
keep_msg_attr = 0;
|
||||
}
|
||||
set_keep_msg(msg_buf, 0);
|
||||
}
|
||||
else
|
||||
msgmore((long)linecount);
|
||||
@@ -1811,15 +1808,18 @@ write_viminfo(file, forceit)
|
||||
|
||||
/* Use mch_open() to be able to use O_NOFOLLOW and set file
|
||||
* protection:
|
||||
* Unix: same as original file, but strip s-bit.
|
||||
* Unix: same as original file, but strip s-bit. Reset umask to
|
||||
* avoid it getting in the way.
|
||||
* Others: r&w for user only. */
|
||||
#ifdef UNIX
|
||||
umask_save = umask(0);
|
||||
fd = mch_open((char *)tempname,
|
||||
O_CREAT|O_EXTRA|O_EXCL|O_WRONLY|O_NOFOLLOW,
|
||||
(int)((st_old.st_mode & 0777) | 0600));
|
||||
(void)umask(umask_save);
|
||||
#else
|
||||
fd = mch_open((char *)tempname,
|
||||
O_CREAT|O_EXTRA|O_EXCL|O_WRONLY|O_NOFOLLOW, 0600);
|
||||
O_CREAT|O_EXTRA|O_EXCL|O_WRONLY|O_NOFOLLOW, 0600);
|
||||
#endif
|
||||
if (fd < 0)
|
||||
fp_out = NULL;
|
||||
@@ -3266,6 +3266,9 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags)
|
||||
#ifdef FEAT_QUICKFIX
|
||||
set_string_option_direct((char_u *)"buftype", -1,
|
||||
(char_u *)"help", OPT_FREE|OPT_LOCAL);
|
||||
# ifdef FEAT_EVAL
|
||||
set_option_scriptID((char_u *)"buftype", current_SID);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -3285,6 +3288,9 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags)
|
||||
{
|
||||
set_string_option_direct((char_u *)"isk", -1, p,
|
||||
OPT_FREE|OPT_LOCAL);
|
||||
# ifdef FEAT_EVAL
|
||||
set_option_scriptID((char_u *)"isk", current_SID);
|
||||
# endif
|
||||
check_buf_options(curbuf);
|
||||
(void)buf_init_chartab(curbuf, FALSE);
|
||||
}
|
||||
@@ -3422,7 +3428,7 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags)
|
||||
* autocommands. This allows for the autocommands to position the
|
||||
* cursor.
|
||||
*/
|
||||
win_init(curwin);
|
||||
curwin_init();
|
||||
|
||||
#ifdef FEAT_FOLDING
|
||||
/* It's like all lines in the buffer changed. Need to update
|
||||
@@ -3504,8 +3510,11 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags)
|
||||
/* Tell the diff stuff that this buffer is new and/or needs updating.
|
||||
* Also needed when re-editing the same buffer, because unloading will
|
||||
* have removed it as a diff buffer. */
|
||||
diff_new_buffer();
|
||||
diff_invalidate();
|
||||
if (curwin->w_p_diff)
|
||||
{
|
||||
diff_buf_add(curbuf);
|
||||
diff_invalidate(curbuf);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (command == NULL)
|
||||
@@ -4904,11 +4913,8 @@ do_sub_msg(count_only)
|
||||
vim_snprintf((char *)msg_buf + len, sizeof(msg_buf) - len,
|
||||
_(" on %ld lines"), (long)sub_nlines);
|
||||
if (msg(msg_buf))
|
||||
{
|
||||
/* save message to display it after redraw */
|
||||
set_keep_msg(msg_buf);
|
||||
keep_msg_attr = 0;
|
||||
}
|
||||
set_keep_msg(msg_buf, 0);
|
||||
return TRUE;
|
||||
}
|
||||
if (got_int)
|
||||
@@ -5294,13 +5300,21 @@ ex_help(eap)
|
||||
|
||||
/*
|
||||
* Re-use an existing help window or open a new one.
|
||||
* Always open a new one for ":tab help".
|
||||
*/
|
||||
if (!curwin->w_buffer->b_help)
|
||||
if (!curwin->w_buffer->b_help
|
||||
#ifdef FEAT_WINDOWS
|
||||
|| cmdmod.tab != 0
|
||||
#endif
|
||||
)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
for (wp = firstwin; wp != NULL; wp = wp->w_next)
|
||||
if (wp->w_buffer != NULL && wp->w_buffer->b_help)
|
||||
break;
|
||||
if (cmdmod.tab != 0)
|
||||
wp = NULL;
|
||||
else
|
||||
for (wp = firstwin; wp != NULL; wp = wp->w_next)
|
||||
if (wp->w_buffer != NULL && wp->w_buffer->b_help)
|
||||
break;
|
||||
if (wp != NULL && wp->w_buffer->b_nwindows > 0)
|
||||
win_enter(wp, TRUE);
|
||||
else
|
||||
@@ -5319,19 +5333,21 @@ ex_help(eap)
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* Split off help window; put it at far top if no position
|
||||
* specified, the current window is vertically split and narrow. */
|
||||
* specified, the current window is vertically split and
|
||||
* narrow. */
|
||||
n = WSP_HELP;
|
||||
# ifdef FEAT_VERTSPLIT
|
||||
if (cmdmod.split == 0 && curwin->w_width != Columns
|
||||
&& curwin->w_width < 80)
|
||||
&& curwin->w_width < 80)
|
||||
n |= WSP_TOP;
|
||||
# endif
|
||||
if (win_split(0, n) == FAIL)
|
||||
goto erret;
|
||||
#else
|
||||
/* use current window */
|
||||
if (!can_abandon(curbuf, FALSE))
|
||||
#endif
|
||||
goto erret;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (curwin->w_height < p_hh)
|
||||
|
||||
@@ -187,6 +187,8 @@ EX(CMD_cabbrev, "cabbrev", ex_abbreviate,
|
||||
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
|
||||
EX(CMD_cabclear, "cabclear", ex_abclear,
|
||||
EXTRA|TRLBAR|CMDWIN),
|
||||
EX(CMD_caddbuffer, "caddbuffer", ex_cbuffer,
|
||||
RANGE|NOTADR|WORD1|TRLBAR),
|
||||
EX(CMD_caddexpr, "caddexpr", ex_cexpr,
|
||||
NEEDARG|WORD1|NOTRLCOM|TRLBAR|BANG),
|
||||
EX(CMD_caddfile, "caddfile", ex_cfile,
|
||||
@@ -473,26 +475,70 @@ EX(CMD_keepalt, "keepalt", ex_wrongmodifier,
|
||||
NEEDARG|EXTRA|NOTRLCOM),
|
||||
EX(CMD_list, "list", ex_print,
|
||||
RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN),
|
||||
EX(CMD_lNext, "lNext", ex_cnext,
|
||||
RANGE|NOTADR|COUNT|TRLBAR|BANG),
|
||||
EX(CMD_lNfile, "lNfile", ex_cnext,
|
||||
RANGE|NOTADR|COUNT|TRLBAR|BANG),
|
||||
EX(CMD_last, "last", ex_last,
|
||||
EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR),
|
||||
EX(CMD_language, "language", ex_language,
|
||||
EXTRA|TRLBAR|CMDWIN),
|
||||
EX(CMD_laddexpr, "laddexpr", ex_cexpr,
|
||||
NEEDARG|WORD1|NOTRLCOM|TRLBAR|BANG),
|
||||
EX(CMD_laddbuffer, "laddbuffer", ex_cbuffer,
|
||||
RANGE|NOTADR|WORD1|TRLBAR),
|
||||
EX(CMD_laddfile, "laddfile", ex_cfile,
|
||||
TRLBAR|FILE1),
|
||||
EX(CMD_lbuffer, "lbuffer", ex_cbuffer,
|
||||
RANGE|NOTADR|WORD1|TRLBAR),
|
||||
EX(CMD_lcd, "lcd", ex_cd,
|
||||
BANG|FILE1|TRLBAR|CMDWIN),
|
||||
EX(CMD_lchdir, "lchdir", ex_cd,
|
||||
BANG|FILE1|TRLBAR|CMDWIN),
|
||||
EX(CMD_lclose, "lclose", ex_cclose,
|
||||
RANGE|NOTADR|COUNT|TRLBAR),
|
||||
EX(CMD_lcscope, "lcscope", do_cscope,
|
||||
EXTRA|NOTRLCOM|SBOXOK|XFILE),
|
||||
EX(CMD_left, "left", ex_align,
|
||||
TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
|
||||
EX(CMD_leftabove, "leftabove", ex_wrongmodifier,
|
||||
NEEDARG|EXTRA|NOTRLCOM),
|
||||
EX(CMD_let, "let", ex_let,
|
||||
EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
|
||||
EX(CMD_lexpr, "lexpr", ex_cexpr,
|
||||
NEEDARG|WORD1|NOTRLCOM|TRLBAR|BANG),
|
||||
EX(CMD_lfile, "lfile", ex_cfile,
|
||||
TRLBAR|FILE1|BANG),
|
||||
EX(CMD_lfirst, "lfirst", ex_cc,
|
||||
RANGE|NOTADR|COUNT|TRLBAR|BANG),
|
||||
EX(CMD_lgetfile, "lgetfile", ex_cfile,
|
||||
TRLBAR|FILE1|BANG),
|
||||
EX(CMD_lgrep, "lgrep", ex_make,
|
||||
BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
|
||||
EX(CMD_lgrepadd, "lgrepadd", ex_make,
|
||||
BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
|
||||
EX(CMD_lhelpgrep, "lhelpgrep", ex_helpgrep,
|
||||
EXTRA|NOTRLCOM|NEEDARG),
|
||||
EX(CMD_ll, "ll", ex_cc,
|
||||
RANGE|NOTADR|COUNT|TRLBAR|BANG),
|
||||
EX(CMD_llast, "llast", ex_cc,
|
||||
RANGE|NOTADR|COUNT|TRLBAR|BANG),
|
||||
EX(CMD_llist, "llist", qf_list,
|
||||
BANG|EXTRA|TRLBAR|CMDWIN),
|
||||
EX(CMD_lmap, "lmap", ex_map,
|
||||
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
|
||||
EX(CMD_lmapclear, "lmapclear", ex_mapclear,
|
||||
EXTRA|TRLBAR|CMDWIN),
|
||||
EX(CMD_lmake, "lmake", ex_make,
|
||||
BANG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
|
||||
EX(CMD_lnoremap, "lnoremap", ex_map,
|
||||
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
|
||||
EX(CMD_lnext, "lnext", ex_cnext,
|
||||
RANGE|NOTADR|COUNT|TRLBAR|BANG),
|
||||
EX(CMD_lnewer, "lnewer", qf_age,
|
||||
RANGE|NOTADR|COUNT|TRLBAR),
|
||||
EX(CMD_lnfile, "lnfile", ex_cnext,
|
||||
RANGE|NOTADR|COUNT|TRLBAR|BANG),
|
||||
EX(CMD_loadview, "loadview", ex_loadview,
|
||||
FILE1|TRLBAR),
|
||||
EX(CMD_loadkeymap, "loadkeymap", ex_loadkeymap,
|
||||
@@ -501,8 +547,26 @@ EX(CMD_lockmarks, "lockmarks", ex_wrongmodifier,
|
||||
NEEDARG|EXTRA|NOTRLCOM),
|
||||
EX(CMD_lockvar, "lockvar", ex_lockvar,
|
||||
BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN),
|
||||
EX(CMD_lolder, "lolder", qf_age,
|
||||
RANGE|NOTADR|COUNT|TRLBAR),
|
||||
EX(CMD_lopen, "lopen", ex_copen,
|
||||
RANGE|NOTADR|COUNT|TRLBAR),
|
||||
EX(CMD_lprevious, "lprevious", ex_cnext,
|
||||
RANGE|NOTADR|COUNT|TRLBAR|BANG),
|
||||
EX(CMD_lpfile, "lpfile", ex_cnext,
|
||||
RANGE|NOTADR|COUNT|TRLBAR|BANG),
|
||||
EX(CMD_lrewind, "lrewind", ex_cc,
|
||||
RANGE|NOTADR|COUNT|TRLBAR|BANG),
|
||||
EX(CMD_ltag, "ltag", ex_tag,
|
||||
NOTADR|TRLBAR|BANG|WORD1),
|
||||
EX(CMD_lunmap, "lunmap", ex_unmap,
|
||||
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
|
||||
EX(CMD_lvimgrep, "lvimgrep", ex_vimgrep,
|
||||
BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
|
||||
EX(CMD_lvimgrepadd, "lvimgrepadd", ex_vimgrep,
|
||||
BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
|
||||
EX(CMD_lwindow, "lwindow", ex_cwindow,
|
||||
RANGE|NOTADR|COUNT|TRLBAR),
|
||||
EX(CMD_ls, "ls", buflist_list,
|
||||
BANG|TRLBAR|CMDWIN),
|
||||
EX(CMD_move, "move", ex_copymove,
|
||||
@@ -813,6 +877,28 @@ EX(CMD_tag, "tag", ex_tag,
|
||||
RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR),
|
||||
EX(CMD_tags, "tags", do_tags,
|
||||
TRLBAR|CMDWIN),
|
||||
EX(CMD_tab, "tab", ex_wrongmodifier,
|
||||
NEEDARG|EXTRA|NOTRLCOM),
|
||||
EX(CMD_tabclose, "tabclose", ex_tabclose,
|
||||
RANGE|NOTADR|COUNT|BANG|TRLBAR|CMDWIN),
|
||||
EX(CMD_tabedit, "tabedit", ex_splitview,
|
||||
BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
|
||||
EX(CMD_tabfind, "tabfind", ex_splitview,
|
||||
BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|NEEDARG|TRLBAR),
|
||||
EX(CMD_tabmove, "tabmove", ex_tabmove,
|
||||
RANGE|NOTADR|COUNT|TRLBAR|ZEROR),
|
||||
EX(CMD_tabnext, "tabnext", ex_tabnext,
|
||||
RANGE|NOTADR|COUNT|TRLBAR),
|
||||
EX(CMD_tabnew, "tabnew", ex_splitview,
|
||||
BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
|
||||
EX(CMD_tabonly, "tabonly", ex_tabonly,
|
||||
TRLBAR|CMDWIN),
|
||||
EX(CMD_tabprevious, "tabprevious", ex_tabprevious,
|
||||
RANGE|NOTADR|COUNT|TRLBAR),
|
||||
EX(CMD_tabNext, "tabNext", ex_tabprevious,
|
||||
RANGE|NOTADR|COUNT|TRLBAR),
|
||||
EX(CMD_tabs, "tabs", ex_tabs,
|
||||
TRLBAR|CMDWIN),
|
||||
EX(CMD_tcl, "tcl", ex_tcl,
|
||||
RANGE|EXTRA|NEEDARG|CMDWIN),
|
||||
EX(CMD_tcldo, "tcldo", ex_tcldo,
|
||||
|
||||
@@ -1608,8 +1608,7 @@ get_arglist(gap, str)
|
||||
return OK;
|
||||
}
|
||||
|
||||
#if defined(FEAT_QUICKFIX) || (defined(FEAT_SYN_HL) && defined(FEAT_MBYTE)) \
|
||||
|| defined(PROTO)
|
||||
#if defined(FEAT_QUICKFIX) || defined(FEAT_SYN_HL) || defined(PROTO)
|
||||
/*
|
||||
* Parse a list of arguments (file names), expand them and return in
|
||||
* "fnames[fcountp]".
|
||||
@@ -1762,8 +1761,9 @@ alist_check_arg_idx()
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *win;
|
||||
tabpage_T *tp;
|
||||
|
||||
for (win = firstwin; win != NULL; win = win->w_next)
|
||||
FOR_ALL_TAB_WINDOWS(tp, win)
|
||||
if (win->w_alist == curwin->w_alist)
|
||||
check_arg_idx(win);
|
||||
#else
|
||||
@@ -1983,7 +1983,8 @@ do_argfile(eap, argn)
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (*eap->cmd == 's') /* split window first */
|
||||
/* split window or create new tab page first */
|
||||
if (*eap->cmd == 's' || cmdmod.tab != 0)
|
||||
{
|
||||
if (win_split(0, 0) == FAIL)
|
||||
return;
|
||||
@@ -2232,7 +2233,7 @@ ex_listdo(eap)
|
||||
if (!win_valid(win))
|
||||
break;
|
||||
win_goto(win);
|
||||
win = win->w_next;
|
||||
win = curwin->w_next;
|
||||
}
|
||||
#endif
|
||||
else if (eap->cmdidx == CMD_bufdo)
|
||||
@@ -3077,13 +3078,15 @@ get_scriptname(id)
|
||||
scid_T id;
|
||||
{
|
||||
if (id == SID_MODELINE)
|
||||
return (char_u *)"modeline";
|
||||
return (char_u *)_("modeline");
|
||||
if (id == SID_CMDARG)
|
||||
return (char_u *)"--cmd argument";
|
||||
return (char_u *)_("--cmd argument");
|
||||
if (id == SID_CARG)
|
||||
return (char_u *)"-c argument";
|
||||
return (char_u *)_("-c argument");
|
||||
if (id == SID_ENV)
|
||||
return (char_u *)"environment variable";
|
||||
return (char_u *)_("environment variable");
|
||||
if (id == SID_ERROR)
|
||||
return (char_u *)_("error handler");
|
||||
return SCRIPT_ITEM(id).sn_name;
|
||||
}
|
||||
|
||||
|
||||
426
src/ex_docmd.c
426
src/ex_docmd.c
@@ -148,11 +148,17 @@ static void ex_cquit __ARGS((exarg_T *eap));
|
||||
static void ex_quit_all __ARGS((exarg_T *eap));
|
||||
#ifdef FEAT_WINDOWS
|
||||
static void ex_close __ARGS((exarg_T *eap));
|
||||
static void ex_win_close __ARGS((exarg_T *eap, win_T *win));
|
||||
static void ex_win_close __ARGS((int forceit, win_T *win, tabpage_T *tp));
|
||||
static void ex_only __ARGS((exarg_T *eap));
|
||||
static void ex_all __ARGS((exarg_T *eap));
|
||||
static void ex_resize __ARGS((exarg_T *eap));
|
||||
static void ex_stag __ARGS((exarg_T *eap));
|
||||
static void ex_tabclose __ARGS((exarg_T *eap));
|
||||
static void ex_tabonly __ARGS((exarg_T *eap));
|
||||
static void ex_tabnext __ARGS((exarg_T *eap));
|
||||
static void ex_tabprevious __ARGS((exarg_T *eap));
|
||||
static void ex_tabmove __ARGS((exarg_T *eap));
|
||||
static void ex_tabs __ARGS((exarg_T *eap));
|
||||
#else
|
||||
# define ex_close ex_ni
|
||||
# define ex_only ex_ni
|
||||
@@ -160,6 +166,12 @@ static void ex_stag __ARGS((exarg_T *eap));
|
||||
# define ex_resize ex_ni
|
||||
# define ex_splitview ex_ni
|
||||
# define ex_stag ex_ni
|
||||
# define ex_tabnext ex_ni
|
||||
# define ex_tabprevious ex_ni
|
||||
# define ex_tabmove ex_ni
|
||||
# define ex_tabs ex_ni
|
||||
# define ex_tabclose ex_ni
|
||||
# define ex_tabonly ex_ni
|
||||
#endif
|
||||
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
|
||||
static void ex_pclose __ARGS((exarg_T *eap));
|
||||
@@ -1850,7 +1862,25 @@ do_one_cmd(cmdlinep, sourcing,
|
||||
}
|
||||
continue;
|
||||
|
||||
case 't': if (!checkforcmd(&ea.cmd, "topleft", 2))
|
||||
case 't': if (checkforcmd(&p, "tab", 3))
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
tabpage_T *tp;
|
||||
|
||||
if (vim_isdigit(*ea.cmd))
|
||||
cmdmod.tab = atoi((char *)ea.cmd) + 1;
|
||||
else
|
||||
{
|
||||
cmdmod.tab = 2;
|
||||
for (tp = first_tabpage; tp != curtab;
|
||||
tp = tp->tp_next)
|
||||
++cmdmod.tab;
|
||||
}
|
||||
ea.cmd = p;
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
if (!checkforcmd(&ea.cmd, "topleft", 2))
|
||||
break;
|
||||
#ifdef FEAT_WINDOWS
|
||||
cmdmod.split |= WSP_TOP;
|
||||
@@ -2373,7 +2403,7 @@ do_one_cmd(cmdlinep, sourcing,
|
||||
{
|
||||
n = getdigits(&ea.arg);
|
||||
ea.arg = skipwhite(ea.arg);
|
||||
if (n <= 0 && !ni)
|
||||
if (n <= 0 && !ni && (ea.argt & ZEROR) == 0)
|
||||
{
|
||||
errormsg = (char_u *)_(e_zerocount);
|
||||
goto doend;
|
||||
@@ -3502,6 +3532,7 @@ set_one_cmd_context(xp, buff)
|
||||
case CMD_tag:
|
||||
case CMD_stag:
|
||||
case CMD_ptag:
|
||||
case CMD_ltag:
|
||||
case CMD_tselect:
|
||||
case CMD_stselect:
|
||||
case CMD_ptselect:
|
||||
@@ -4000,8 +4031,10 @@ skip_grep_pat(eap)
|
||||
{
|
||||
char_u *p = eap->arg;
|
||||
|
||||
if (*p != NUL && (eap->cmdidx == CMD_vimgrep
|
||||
|| eap->cmdidx == CMD_vimgrepadd || grep_internal(eap->cmdidx)))
|
||||
if (*p != NUL && (eap->cmdidx == CMD_vimgrep || eap->cmdidx == CMD_lvimgrep
|
||||
|| eap->cmdidx == CMD_vimgrepadd
|
||||
|| eap->cmdidx == CMD_lvimgrepadd
|
||||
|| grep_internal(eap->cmdidx)))
|
||||
{
|
||||
p = skip_vimgrep_pat(p, NULL, NULL);
|
||||
if (p == NULL)
|
||||
@@ -4030,11 +4063,14 @@ replace_makeprg(eap, p, cmdlinep)
|
||||
/*
|
||||
* Don't do it when ":vimgrep" is used for ":grep".
|
||||
*/
|
||||
if ((eap->cmdidx == CMD_make
|
||||
|| eap->cmdidx == CMD_grep || eap->cmdidx == CMD_grepadd)
|
||||
if ((eap->cmdidx == CMD_make || eap->cmdidx == CMD_lmake
|
||||
|| eap->cmdidx == CMD_grep || eap->cmdidx == CMD_lgrep
|
||||
|| eap->cmdidx == CMD_grepadd
|
||||
|| eap->cmdidx == CMD_lgrepadd)
|
||||
&& !grep_internal(eap->cmdidx))
|
||||
{
|
||||
if (eap->cmdidx == CMD_grep || eap->cmdidx == CMD_grepadd)
|
||||
if (eap->cmdidx == CMD_grep || eap->cmdidx == CMD_lgrep
|
||||
|| eap->cmdidx == CMD_grepadd || eap->cmdidx == CMD_lgrepadd)
|
||||
{
|
||||
if (*curbuf->b_p_gp == NUL)
|
||||
program = p_gp;
|
||||
@@ -4173,8 +4209,11 @@ expand_filename(eap, cmdlinep, errormsgp)
|
||||
if (!eap->usefilter
|
||||
&& eap->cmdidx != CMD_bang
|
||||
&& eap->cmdidx != CMD_make
|
||||
&& eap->cmdidx != CMD_lmake
|
||||
&& eap->cmdidx != CMD_grep
|
||||
&& eap->cmdidx != CMD_lgrep
|
||||
&& eap->cmdidx != CMD_grepadd
|
||||
&& eap->cmdidx != CMD_lgrepadd
|
||||
#ifndef UNIX
|
||||
&& !(eap->argt & NOSPC)
|
||||
#endif
|
||||
@@ -4857,8 +4896,8 @@ check_more(message, forceit)
|
||||
{
|
||||
int n = ARGCOUNT - curwin->w_arg_idx - 1;
|
||||
|
||||
if (!forceit && only_one_window() && ARGCOUNT > 1 && !arg_had_last
|
||||
&& n >= 0 && quitmore == 0)
|
||||
if (!forceit && only_one_window()
|
||||
&& ARGCOUNT > 1 && !arg_had_last && n >= 0 && quitmore == 0)
|
||||
{
|
||||
if (message)
|
||||
{
|
||||
@@ -6129,19 +6168,43 @@ ex_close(eap)
|
||||
else
|
||||
# endif
|
||||
if (!text_locked())
|
||||
ex_win_close(eap, curwin);
|
||||
ex_win_close(eap->forceit, curwin, NULL);
|
||||
}
|
||||
|
||||
#ifdef FEAT_QUICKFIX
|
||||
/*
|
||||
* ":pclose": Close any preview window.
|
||||
*/
|
||||
static void
|
||||
ex_win_close(eap, win)
|
||||
ex_pclose(eap)
|
||||
exarg_T *eap;
|
||||
{
|
||||
win_T *win;
|
||||
|
||||
for (win = firstwin; win != NULL; win = win->w_next)
|
||||
if (win->w_p_pvw)
|
||||
{
|
||||
ex_win_close(eap->forceit, win, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Close window "win" and take care of handling closing the last window for a
|
||||
* modified buffer.
|
||||
*/
|
||||
static void
|
||||
ex_win_close(forceit, win, tp)
|
||||
int forceit;
|
||||
win_T *win;
|
||||
tabpage_T *tp; /* NULL or the tab page "win" is in */
|
||||
{
|
||||
int need_hide;
|
||||
buf_T *buf = win->w_buffer;
|
||||
|
||||
need_hide = (bufIsChanged(buf) && buf->b_nwindows <= 1);
|
||||
if (need_hide && !P_HID(buf) && !eap->forceit)
|
||||
if (need_hide && !P_HID(buf) && !forceit)
|
||||
{
|
||||
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
if ((p_confirm || cmdmod.confirm) && p_write)
|
||||
@@ -6162,28 +6225,143 @@ ex_win_close(eap, win)
|
||||
#ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
#endif
|
||||
|
||||
/* free buffer when not hiding it or when it's a scratch buffer */
|
||||
win_close(win, !need_hide && !P_HID(buf));
|
||||
if (tp == NULL)
|
||||
win_close(win, !need_hide && !P_HID(buf));
|
||||
else
|
||||
win_close_othertab(win, !need_hide && !P_HID(buf), tp);
|
||||
}
|
||||
|
||||
#ifdef FEAT_QUICKFIX
|
||||
/*
|
||||
* ":pclose": Close any preview window.
|
||||
* ":tabclose": close current tab page, unless it is the last one.
|
||||
* ":tabclose N": close tab page N.
|
||||
*/
|
||||
static void
|
||||
ex_pclose(eap)
|
||||
ex_tabclose(eap)
|
||||
exarg_T *eap;
|
||||
{
|
||||
win_T *win;
|
||||
tabpage_T *tp;
|
||||
int h = tabpageline_height();
|
||||
|
||||
for (win = firstwin; win != NULL; win = win->w_next)
|
||||
if (win->w_p_pvw)
|
||||
# ifdef FEAT_CMDWIN
|
||||
if (cmdwin_type != 0)
|
||||
cmdwin_result = K_IGNORE;
|
||||
else
|
||||
# endif
|
||||
if (first_tabpage->tp_next == NULL)
|
||||
EMSG(_("E784: Cannot close last tab page"));
|
||||
else
|
||||
{
|
||||
ex_win_close(eap, win);
|
||||
break;
|
||||
if (eap->addr_count > 0)
|
||||
{
|
||||
tp = find_tabpage((int)eap->line2);
|
||||
if (tp == NULL)
|
||||
{
|
||||
beep_flush();
|
||||
return;
|
||||
}
|
||||
if (tp != curtab)
|
||||
{
|
||||
tabpage_close_other(tp, eap->forceit);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!text_locked())
|
||||
tabpage_close(eap->forceit);
|
||||
}
|
||||
|
||||
if (h != tabpageline_height())
|
||||
shell_new_rows();
|
||||
}
|
||||
|
||||
/*
|
||||
* ":tabonly": close all tab pages except the current one
|
||||
*/
|
||||
static void
|
||||
ex_tabonly(eap)
|
||||
exarg_T *eap;
|
||||
{
|
||||
tabpage_T *tp;
|
||||
int done;
|
||||
int h = tabpageline_height();
|
||||
|
||||
# ifdef FEAT_CMDWIN
|
||||
if (cmdwin_type != 0)
|
||||
cmdwin_result = K_IGNORE;
|
||||
else
|
||||
# endif
|
||||
if (first_tabpage->tp_next == NULL)
|
||||
MSG(_("Already only one tab page"));
|
||||
else
|
||||
{
|
||||
/* Repeat this up to a 1000 times, because autocommands may mess
|
||||
* up the lists. */
|
||||
for (done = 0; done < 1000; ++done)
|
||||
{
|
||||
for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
|
||||
if (tp->tp_topframe != topframe)
|
||||
{
|
||||
tabpage_close_other(tp, eap->forceit);
|
||||
/* if we failed to close it quit */
|
||||
if (valid_tabpage(tp))
|
||||
done = 1000;
|
||||
/* start over, "tp" is now invalid */
|
||||
break;
|
||||
}
|
||||
if (first_tabpage->tp_next == NULL)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (h != tabpageline_height())
|
||||
shell_new_rows();
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the current tab page.
|
||||
*/
|
||||
void
|
||||
tabpage_close(forceit)
|
||||
int forceit;
|
||||
{
|
||||
/* First close all the windows but the current one. If that worked then
|
||||
* close the last window in this tab, that will close it. */
|
||||
if (lastwin != firstwin)
|
||||
close_others(TRUE, forceit);
|
||||
if (lastwin == firstwin)
|
||||
ex_win_close(forceit, curwin, NULL);
|
||||
# ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
# endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Close tab page "tp", which is not the current tab page.
|
||||
* Note that autocommands may make "tp" invalid.
|
||||
*/
|
||||
void
|
||||
tabpage_close_other(tp, forceit)
|
||||
tabpage_T *tp;
|
||||
int forceit;
|
||||
{
|
||||
int done = 0;
|
||||
win_T *wp;
|
||||
|
||||
/* Limit to 1000 windows, autocommands may add a window while we close
|
||||
* one. OK, so I'm paranoid... */
|
||||
while (++done < 1000)
|
||||
{
|
||||
wp = tp->tp_firstwin;
|
||||
ex_win_close(forceit, wp, tp);
|
||||
|
||||
/* Autocommands may delete the tab page under our fingers and we may
|
||||
* fail to close a window with a modified buffer. */
|
||||
if (!valid_tabpage(tp) || tp->tp_firstwin == wp)
|
||||
break;
|
||||
}
|
||||
redraw_tabline = TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ":only".
|
||||
@@ -6646,13 +6824,14 @@ alist_slash_adjust()
|
||||
int i;
|
||||
# ifdef FEAT_WINDOWS
|
||||
win_T *wp;
|
||||
tabpage_T *tp;
|
||||
# endif
|
||||
|
||||
for (i = 0; i < GARGCOUNT; ++i)
|
||||
if (GARGLIST[i].ae_fname != NULL)
|
||||
slash_adjust(GARGLIST[i].ae_fname);
|
||||
# ifdef FEAT_WINDOWS
|
||||
for (wp = firstwin; wp != NULL; wp = wp->w_next)
|
||||
FOR_ALL_TAB_WINDOWS(tp, wp)
|
||||
if (wp->w_alist != &global_alist)
|
||||
for (i = 0; i < WARGCOUNT(wp); ++i)
|
||||
if (WARGLIST(wp)[i].ae_fname != NULL)
|
||||
@@ -6707,48 +6886,52 @@ ex_wrongmodifier(eap)
|
||||
* :new [[+command] file] split window with no or new file
|
||||
* :vnew [[+command] file] split vertically window with no or new file
|
||||
* :sfind [+command] file split window with file in 'path'
|
||||
*
|
||||
* :tabedit open new Tab page with empty window
|
||||
* :tabedit [+command] file open new Tab page and edit "file"
|
||||
* :tabnew [[+command] file] just like :tabedit
|
||||
* :tabfind [+command] file open new Tab page and find "file"
|
||||
*/
|
||||
void
|
||||
ex_splitview(eap)
|
||||
exarg_T *eap;
|
||||
{
|
||||
win_T *old_curwin;
|
||||
#if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE)
|
||||
win_T *old_curwin = curwin;
|
||||
# if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE)
|
||||
char_u *fname = NULL;
|
||||
#endif
|
||||
#ifdef FEAT_BROWSE
|
||||
# endif
|
||||
# ifdef FEAT_BROWSE
|
||||
int browse_flag = cmdmod.browse;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#ifndef FEAT_VERTSPLIT
|
||||
# ifndef FEAT_VERTSPLIT
|
||||
if (eap->cmdidx == CMD_vsplit || eap->cmdidx == CMD_vnew)
|
||||
{
|
||||
ex_ni(eap);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
# endif
|
||||
|
||||
old_curwin = curwin;
|
||||
#ifdef FEAT_GUI
|
||||
# ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#ifdef FEAT_QUICKFIX
|
||||
# ifdef FEAT_QUICKFIX
|
||||
/* A ":split" in the quickfix window works like ":new". Don't want two
|
||||
* quickfix windows. */
|
||||
if (bt_quickfix(curbuf))
|
||||
{
|
||||
if (eap->cmdidx == CMD_split)
|
||||
eap->cmdidx = CMD_new;
|
||||
# ifdef FEAT_VERTSPLIT
|
||||
# ifdef FEAT_VERTSPLIT
|
||||
if (eap->cmdidx == CMD_vsplit)
|
||||
eap->cmdidx = CMD_vnew;
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#ifdef FEAT_SEARCHPATH
|
||||
if (eap->cmdidx == CMD_sfind)
|
||||
# ifdef FEAT_SEARCHPATH
|
||||
if (eap->cmdidx == CMD_sfind || eap->cmdidx == CMD_tabfind)
|
||||
{
|
||||
fname = find_file_in_path(eap->arg, (int)STRLEN(eap->arg),
|
||||
FNAME_MESS, TRUE, curbuf->b_ffname);
|
||||
@@ -6756,15 +6939,15 @@ ex_splitview(eap)
|
||||
goto theend;
|
||||
eap->arg = fname;
|
||||
}
|
||||
# ifdef FEAT_BROWSE
|
||||
# ifdef FEAT_BROWSE
|
||||
else
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#ifdef FEAT_BROWSE
|
||||
# ifdef FEAT_BROWSE
|
||||
if (cmdmod.browse
|
||||
# ifdef FEAT_VERTSPLIT
|
||||
# ifdef FEAT_VERTSPLIT
|
||||
&& eap->cmdidx != CMD_vnew
|
||||
#endif
|
||||
# endif
|
||||
&& eap->cmdidx != CMD_new)
|
||||
{
|
||||
if (
|
||||
@@ -6788,36 +6971,146 @@ ex_splitview(eap)
|
||||
}
|
||||
}
|
||||
cmdmod.browse = FALSE; /* Don't browse again in do_ecmd(). */
|
||||
#endif
|
||||
# endif
|
||||
|
||||
if (win_split(eap->addr_count > 0 ? (int)eap->line2 : 0,
|
||||
/*
|
||||
* Either open new tab page or split the window.
|
||||
*/
|
||||
if (eap->cmdidx == CMD_tabedit
|
||||
|| eap->cmdidx == CMD_tabfind
|
||||
|| eap->cmdidx == CMD_tabnew)
|
||||
{
|
||||
if (win_new_tabpage(cmdmod.tab) != FAIL)
|
||||
{
|
||||
do_exedit(eap, NULL);
|
||||
|
||||
/* set the alternate buffer for the window we came from */
|
||||
if (curwin != old_curwin
|
||||
&& win_valid(old_curwin)
|
||||
&& old_curwin->w_buffer != curbuf
|
||||
&& !cmdmod.keepalt)
|
||||
old_curwin->w_alt_fnum = curbuf->b_fnum;
|
||||
}
|
||||
}
|
||||
else if (win_split(eap->addr_count > 0 ? (int)eap->line2 : 0,
|
||||
*eap->cmd == 'v' ? WSP_VERT : 0) != FAIL)
|
||||
{
|
||||
#ifdef FEAT_SCROLLBIND
|
||||
# ifdef FEAT_SCROLLBIND
|
||||
/* Reset 'scrollbind' when editing another file, but keep it when
|
||||
* doing ":split" without arguments. */
|
||||
if (*eap->arg != NUL
|
||||
#ifdef FEAT_BROWSE
|
||||
# ifdef FEAT_BROWSE
|
||||
|| cmdmod.browse
|
||||
#endif
|
||||
# endif
|
||||
)
|
||||
curwin->w_p_scb = FALSE;
|
||||
else
|
||||
do_check_scrollbind(FALSE);
|
||||
#endif
|
||||
# endif
|
||||
do_exedit(eap, old_curwin);
|
||||
}
|
||||
|
||||
#ifdef FEAT_BROWSE
|
||||
# ifdef FEAT_BROWSE
|
||||
cmdmod.browse = browse_flag;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE)
|
||||
# if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE)
|
||||
theend:
|
||||
vim_free(fname);
|
||||
#endif
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Open a new tab page.
|
||||
*/
|
||||
void
|
||||
tabpage_new()
|
||||
{
|
||||
exarg_T ea;
|
||||
|
||||
vim_memset(&ea, 0, sizeof(ea));
|
||||
ea.cmdidx = CMD_tabnew;
|
||||
ea.cmd = (char_u *)"tabn";
|
||||
ea.arg = (char_u *)"";
|
||||
ex_splitview(&ea);
|
||||
}
|
||||
|
||||
/*
|
||||
* :tabnext command
|
||||
*/
|
||||
static void
|
||||
ex_tabnext(eap)
|
||||
exarg_T *eap;
|
||||
{
|
||||
goto_tabpage(eap->addr_count == 0 ? 0 : (int)eap->line2);
|
||||
}
|
||||
|
||||
/*
|
||||
* :tabprevious and :tabNext command
|
||||
*/
|
||||
static void
|
||||
ex_tabprevious(eap)
|
||||
exarg_T *eap;
|
||||
{
|
||||
goto_tabpage(eap->addr_count == 0 ? -1 : -(int)eap->line2);
|
||||
}
|
||||
|
||||
/*
|
||||
* :tabmove command
|
||||
*/
|
||||
static void
|
||||
ex_tabmove(eap)
|
||||
exarg_T *eap;
|
||||
{
|
||||
tabpage_move(eap->addr_count == 0 ? 9999 : (int)eap->line2);
|
||||
}
|
||||
|
||||
/*
|
||||
* :tabs command: List tabs and their contents.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
ex_tabs(eap)
|
||||
exarg_T *eap;
|
||||
{
|
||||
tabpage_T *tp;
|
||||
win_T *wp;
|
||||
int tabcount = 1;
|
||||
|
||||
msg_start();
|
||||
msg_scroll = TRUE;
|
||||
for (tp = first_tabpage; tp != NULL && !got_int; tp = tp->tp_next)
|
||||
{
|
||||
msg_putchar('\n');
|
||||
vim_snprintf((char *)IObuff, IOSIZE, _("Tab page %d"), tabcount++);
|
||||
msg_outtrans_attr(IObuff, hl_attr(HLF_T));
|
||||
out_flush(); /* output one line at a time */
|
||||
ui_breakcheck();
|
||||
|
||||
if (tp == curtab)
|
||||
wp = firstwin;
|
||||
else
|
||||
wp = tp->tp_firstwin;
|
||||
for ( ; wp != NULL && !got_int; wp = wp->w_next)
|
||||
{
|
||||
msg_putchar('\n');
|
||||
msg_putchar(wp == curwin ? '>' : ' ');
|
||||
msg_putchar(' ');
|
||||
msg_putchar(bufIsChanged(wp->w_buffer) ? '+' : ' ');
|
||||
msg_putchar(' ');
|
||||
if (buf_spname(wp->w_buffer) != NULL)
|
||||
STRCPY(IObuff, buf_spname(wp->w_buffer));
|
||||
else
|
||||
home_replace(wp->w_buffer, wp->w_buffer->b_fname,
|
||||
IObuff, IOSIZE, TRUE);
|
||||
msg_outtrans(IObuff);
|
||||
out_flush(); /* output one line at a time */
|
||||
ui_breakcheck();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* FEAT_WINDOWS */
|
||||
|
||||
/*
|
||||
* ":mode": Set screen mode.
|
||||
@@ -7027,12 +7320,14 @@ do_exedit(eap, old_curwin)
|
||||
}
|
||||
|
||||
if ((eap->cmdidx == CMD_new
|
||||
|| eap->cmdidx == CMD_tabnew
|
||||
|| eap->cmdidx == CMD_tabedit
|
||||
#ifdef FEAT_VERTSPLIT
|
||||
|| eap->cmdidx == CMD_vnew
|
||||
#endif
|
||||
) && *eap->arg == NUL)
|
||||
{
|
||||
/* ":new" without argument: edit an new empty buffer */
|
||||
/* ":new" or ":tabnew" without argument: edit an new empty buffer */
|
||||
setpcmark();
|
||||
(void)do_ecmd(0, NULL, NULL, eap, ECMD_ONE,
|
||||
ECMD_HIDE + (eap->forceit ? ECMD_FORCEIT : 0));
|
||||
@@ -8801,6 +9096,16 @@ ex_tag_cmd(eap, name)
|
||||
break;
|
||||
}
|
||||
|
||||
if (name[0] == 'l')
|
||||
{
|
||||
#ifndef FEAT_QUICKFIX
|
||||
ex_ni(eap);
|
||||
return;
|
||||
#else
|
||||
cmd = DT_LTAG;
|
||||
#endif
|
||||
}
|
||||
|
||||
do_tag(eap->arg, cmd, eap->addr_count > 0 ? (int)eap->line2 : 1,
|
||||
eap->forceit, TRUE);
|
||||
}
|
||||
@@ -8980,7 +9285,7 @@ eval_vars(src, usedlen, lnump, errormsg, srcstart)
|
||||
|
||||
#ifdef FEAT_SEARCHPATH
|
||||
case SPEC_CFILE: /* file name under cursor */
|
||||
result = file_name_at_cursor(FNAME_MESS|FNAME_HYP, 1L);
|
||||
result = file_name_at_cursor(FNAME_MESS|FNAME_HYP, 1L, NULL);
|
||||
if (result == NULL)
|
||||
{
|
||||
*errormsg = (char_u *)"";
|
||||
@@ -10328,6 +10633,11 @@ ex_match(eap)
|
||||
eap->errmsg = e_trailing;
|
||||
return;
|
||||
}
|
||||
if (*end != *p)
|
||||
{
|
||||
EMSG2(_(e_invarg2), p);
|
||||
return;
|
||||
}
|
||||
|
||||
c = *end;
|
||||
*end = NUL;
|
||||
|
||||
@@ -2939,6 +2939,14 @@ redrawcmd()
|
||||
if (cmd_silent)
|
||||
return;
|
||||
|
||||
/* when 'incsearch' is set there may be no command line while redrawing */
|
||||
if (ccline.cmdbuff == NULL)
|
||||
{
|
||||
windgoto(cmdline_row, 0);
|
||||
msg_clr_eos();
|
||||
return;
|
||||
}
|
||||
|
||||
msg_start();
|
||||
redrawcmdprompt();
|
||||
|
||||
@@ -5635,6 +5643,9 @@ ex_window()
|
||||
/* Don't execute autocommands while creating the window. */
|
||||
++autocmd_block;
|
||||
# endif
|
||||
/* don't use a new tab page */
|
||||
cmdmod.tab = 0;
|
||||
|
||||
/* Create a window for the command-line buffer. */
|
||||
if (win_split((int)p_cwh, WSP_BOT) == FAIL)
|
||||
{
|
||||
|
||||
149
src/fileio.c
149
src/fileio.c
@@ -65,7 +65,12 @@ static void msg_add_eol __ARGS((void));
|
||||
static int check_mtime __ARGS((buf_T *buf, struct stat *s));
|
||||
static int time_differs __ARGS((long t1, long t2));
|
||||
#ifdef FEAT_AUTOCMD
|
||||
static int apply_autocmds_exarg __ARGS((EVENT_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf, exarg_T *eap));
|
||||
static int apply_autocmds_exarg __ARGS((event_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf, exarg_T *eap));
|
||||
static int au_find_group __ARGS((char_u *name));
|
||||
|
||||
# define AUGROUP_DEFAULT -1 /* default autocmd group */
|
||||
# define AUGROUP_ERROR -2 /* errornouse autocmd group */
|
||||
# define AUGROUP_ALL -3 /* all autocmd groups */
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_CRYPT) || defined(FEAT_MBYTE)
|
||||
@@ -578,8 +583,13 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
|
||||
/* set forced 'fileencoding' */
|
||||
fenc = enc_canonize(eap->cmd + eap->force_enc);
|
||||
if (fenc != NULL)
|
||||
{
|
||||
set_string_option_direct((char_u *)"fenc", -1,
|
||||
fenc, OPT_FREE|OPT_LOCAL);
|
||||
# ifdef FEAT_EVAL
|
||||
set_option_scriptID((char_u *)"fenc", current_SID);
|
||||
# endif
|
||||
}
|
||||
vim_free(fenc);
|
||||
}
|
||||
#endif
|
||||
@@ -2103,8 +2113,13 @@ failed:
|
||||
#ifdef FEAT_MBYTE
|
||||
/* If editing a new file: set 'fenc' for the current buffer. */
|
||||
if (newfile)
|
||||
{
|
||||
set_string_option_direct((char_u *)"fenc", -1, fenc,
|
||||
OPT_FREE|OPT_LOCAL);
|
||||
# ifdef FEAT_EVAL
|
||||
set_option_scriptID((char_u *)"fenc", current_SID);
|
||||
# endif
|
||||
}
|
||||
if (fenc_alloced)
|
||||
vim_free(fenc);
|
||||
# ifdef USE_ICONV
|
||||
@@ -2166,8 +2181,8 @@ failed:
|
||||
#ifdef FEAT_DIFF
|
||||
/* After reading the text into the buffer the diff info needs to be
|
||||
* updated. */
|
||||
if ((newfile || read_buffer))
|
||||
diff_invalidate();
|
||||
if (newfile || read_buffer)
|
||||
diff_invalidate(curbuf);
|
||||
#endif
|
||||
#ifndef ALWAYS_USE_GUI
|
||||
/*
|
||||
@@ -2313,16 +2328,13 @@ failed:
|
||||
p = msg_trunc_attr(IObuff, FALSE, 0);
|
||||
if (read_stdin || read_buffer || restart_edit != 0
|
||||
|| (msg_scrolled != 0 && !need_wait_return))
|
||||
{
|
||||
/* Need to repeat the message after redrawing when:
|
||||
* - When reading from stdin (the screen will be cleared next).
|
||||
* - When restart_edit is set (otherwise there will be a delay
|
||||
* before redrawing).
|
||||
* - When the screen was scrolled but there is no wait-return
|
||||
* prompt. */
|
||||
set_keep_msg(p);
|
||||
keep_msg_attr = 0;
|
||||
}
|
||||
set_keep_msg(p, 0);
|
||||
msg_scrolled_ign = FALSE;
|
||||
}
|
||||
|
||||
@@ -2330,6 +2342,7 @@ failed:
|
||||
if (newfile && (error
|
||||
#ifdef FEAT_MBYTE
|
||||
|| conv_error != 0
|
||||
|| (illegal_byte > 0 && bad_char_behavior != BAD_KEEP)
|
||||
#endif
|
||||
))
|
||||
curbuf->b_p_ro = TRUE;
|
||||
@@ -4372,8 +4385,7 @@ restore_backup:
|
||||
STRCAT(IObuff, shortmess(SHM_WRI) ? _(" [w]") : _(" written"));
|
||||
}
|
||||
|
||||
set_keep_msg(msg_trunc_attr(IObuff, FALSE, 0));
|
||||
keep_msg_attr = 0;
|
||||
set_keep_msg(msg_trunc_attr(IObuff, FALSE, 0), 0);
|
||||
}
|
||||
|
||||
/* When written everything correctly: reset 'modified'. Unless not
|
||||
@@ -4628,7 +4640,8 @@ set_rw_fname(fname, sfname)
|
||||
/* Do filetype detection now if 'filetype' is empty. */
|
||||
if (*curbuf->b_p_ft == NUL)
|
||||
{
|
||||
(void)do_doautocmd((char_u *)"filetypedetect BufRead", TRUE);
|
||||
if (au_find_group((char_u *)"filetypedetect") != AUGROUP_ERROR)
|
||||
(void)do_doautocmd((char_u *)"filetypedetect BufRead", FALSE);
|
||||
do_modelines(FALSE);
|
||||
}
|
||||
#endif
|
||||
@@ -5524,6 +5537,7 @@ shorten_fnames(force)
|
||||
}
|
||||
#ifdef FEAT_WINDOWS
|
||||
status_redraw_all();
|
||||
redraw_tabline = TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -6497,7 +6511,7 @@ buf_reload(buf, orig_mode)
|
||||
|
||||
#ifdef FEAT_DIFF
|
||||
/* Invalidate diff info if necessary. */
|
||||
diff_invalidate();
|
||||
diff_invalidate(buf);
|
||||
#endif
|
||||
|
||||
/* Restore the topline and cursor position and check it (lines may
|
||||
@@ -6894,7 +6908,7 @@ typedef struct AutoPat
|
||||
static struct event_name
|
||||
{
|
||||
char *name; /* event name */
|
||||
EVENT_T event; /* event number */
|
||||
event_T event; /* event number */
|
||||
} event_names[] =
|
||||
{
|
||||
{"BufAdd", EVENT_BUFADD},
|
||||
@@ -6922,9 +6936,12 @@ static struct event_name
|
||||
{"CmdwinEnter", EVENT_CMDWINENTER},
|
||||
{"CmdwinLeave", EVENT_CMDWINLEAVE},
|
||||
{"ColorScheme", EVENT_COLORSCHEME},
|
||||
{"CursorHold", EVENT_CURSORHOLD},
|
||||
{"CursorHoldI", EVENT_CURSORHOLDI},
|
||||
{"CursorMoved", EVENT_CURSORMOVED},
|
||||
{"CursorMovedI", EVENT_CURSORMOVEDI},
|
||||
{"EncodingChanged", EVENT_ENCODINGCHANGED},
|
||||
{"FileEncoding", EVENT_ENCODINGCHANGED},
|
||||
{"CursorHold", EVENT_CURSORHOLD},
|
||||
{"FileAppendPost", EVENT_FILEAPPENDPOST},
|
||||
{"FileAppendPre", EVENT_FILEAPPENDPRE},
|
||||
{"FileAppendCmd", EVENT_FILEAPPENDCMD},
|
||||
@@ -6953,10 +6970,13 @@ static struct event_name
|
||||
{"QuickFixCmdPre", EVENT_QUICKFIXCMDPRE},
|
||||
{"RemoteReply", EVENT_REMOTEREPLY},
|
||||
{"SessionLoadPost", EVENT_SESSIONLOADPOST},
|
||||
{"SpellFileMissing",EVENT_SPELLFILEMISSING},
|
||||
{"StdinReadPost", EVENT_STDINREADPOST},
|
||||
{"StdinReadPre", EVENT_STDINREADPRE},
|
||||
{"Syntax", EVENT_SYNTAX},
|
||||
{"SwapExists", EVENT_SWAPEXISTS},
|
||||
{"Syntax", EVENT_SYNTAX},
|
||||
{"TabEnter", EVENT_TABENTER},
|
||||
{"TabLeave", EVENT_TABLEAVE},
|
||||
{"TermChanged", EVENT_TERMCHANGED},
|
||||
{"TermResponse", EVENT_TERMRESPONSE},
|
||||
{"User", EVENT_USER},
|
||||
@@ -6965,7 +6985,7 @@ static struct event_name
|
||||
{"VimLeavePre", EVENT_VIMLEAVEPRE},
|
||||
{"WinEnter", EVENT_WINENTER},
|
||||
{"WinLeave", EVENT_WINLEAVE},
|
||||
{NULL, (EVENT_T)0}
|
||||
{NULL, (event_T)0}
|
||||
};
|
||||
|
||||
static AutoPat *first_autopat[NUM_EVENTS] =
|
||||
@@ -6989,7 +7009,7 @@ typedef struct AutoPatCmd
|
||||
char_u *fname; /* fname to match with */
|
||||
char_u *sfname; /* sfname to match with */
|
||||
char_u *tail; /* tail of fname */
|
||||
EVENT_T event; /* current event */
|
||||
event_T event; /* current event */
|
||||
int arg_bufnr; /* initially equal to <abuf>, set to zero when
|
||||
buf is deleted */
|
||||
struct AutoPatCmd *next; /* chain of active apc-s for auto-invalidation*/
|
||||
@@ -7006,32 +7026,28 @@ static garray_T augroups = {0, 0, sizeof(char_u *), 10, NULL};
|
||||
/*
|
||||
* The ID of the current group. Group 0 is the default one.
|
||||
*/
|
||||
#define AUGROUP_DEFAULT -1 /* default autocmd group */
|
||||
#define AUGROUP_ERROR -2 /* errornouse autocmd group */
|
||||
#define AUGROUP_ALL -3 /* all autocmd groups */
|
||||
static int current_augroup = AUGROUP_DEFAULT;
|
||||
|
||||
static int au_need_clean = FALSE; /* need to delete marked patterns */
|
||||
|
||||
static void show_autocmd __ARGS((AutoPat *ap, EVENT_T event));
|
||||
static void show_autocmd __ARGS((AutoPat *ap, event_T event));
|
||||
static void au_remove_pat __ARGS((AutoPat *ap));
|
||||
static void au_remove_cmds __ARGS((AutoPat *ap));
|
||||
static void au_cleanup __ARGS((void));
|
||||
static int au_new_group __ARGS((char_u *name));
|
||||
static void au_del_group __ARGS((char_u *name));
|
||||
static int au_find_group __ARGS((char_u *name));
|
||||
static EVENT_T event_name2nr __ARGS((char_u *start, char_u **end));
|
||||
static char_u *event_nr2name __ARGS((EVENT_T event));
|
||||
static event_T event_name2nr __ARGS((char_u *start, char_u **end));
|
||||
static char_u *event_nr2name __ARGS((event_T event));
|
||||
static char_u *find_end_event __ARGS((char_u *arg, int have_group));
|
||||
static int event_ignored __ARGS((EVENT_T event));
|
||||
static int event_ignored __ARGS((event_T event));
|
||||
static int au_get_grouparg __ARGS((char_u **argp));
|
||||
static int do_autocmd_event __ARGS((EVENT_T event, char_u *pat, int nested, char_u *cmd, int forceit, int group));
|
||||
static int do_autocmd_event __ARGS((event_T event, char_u *pat, int nested, char_u *cmd, int forceit, int group));
|
||||
static char_u *getnextac __ARGS((int c, void *cookie, int indent));
|
||||
static int apply_autocmds_group __ARGS((EVENT_T event, char_u *fname, char_u *fname_io, int force, int group, buf_T *buf, exarg_T *eap));
|
||||
static int apply_autocmds_group __ARGS((event_T event, char_u *fname, char_u *fname_io, int force, int group, buf_T *buf, exarg_T *eap));
|
||||
static void auto_next_pat __ARGS((AutoPatCmd *apc, int stop_at_last));
|
||||
|
||||
|
||||
static EVENT_T last_event;
|
||||
static event_T last_event;
|
||||
static int last_group;
|
||||
|
||||
/*
|
||||
@@ -7040,7 +7056,7 @@ static int last_group;
|
||||
static void
|
||||
show_autocmd(ap, event)
|
||||
AutoPat *ap;
|
||||
EVENT_T event;
|
||||
event_T event;
|
||||
{
|
||||
AutoCmd *ac;
|
||||
|
||||
@@ -7139,14 +7155,14 @@ au_cleanup()
|
||||
{
|
||||
AutoPat *ap, **prev_ap;
|
||||
AutoCmd *ac, **prev_ac;
|
||||
EVENT_T event;
|
||||
event_T event;
|
||||
|
||||
if (autocmd_busy || !au_need_clean)
|
||||
return;
|
||||
|
||||
/* loop over all events */
|
||||
for (event = (EVENT_T)0; (int)event < (int)NUM_EVENTS;
|
||||
event = (EVENT_T)((int)event + 1))
|
||||
for (event = (event_T)0; (int)event < (int)NUM_EVENTS;
|
||||
event = (event_T)((int)event + 1))
|
||||
{
|
||||
/* loop over all autocommand patterns */
|
||||
prev_ap = &(first_autopat[(int)event]);
|
||||
@@ -7192,7 +7208,7 @@ aubuflocal_remove(buf)
|
||||
buf_T *buf;
|
||||
{
|
||||
AutoPat *ap;
|
||||
EVENT_T event;
|
||||
event_T event;
|
||||
AutoPatCmd *apc;
|
||||
|
||||
/* invalidate currently executing autocommands */
|
||||
@@ -7201,8 +7217,8 @@ aubuflocal_remove(buf)
|
||||
apc->arg_bufnr = 0;
|
||||
|
||||
/* invalidate buflocals looping through events */
|
||||
for (event = (EVENT_T)0; (int)event < (int)NUM_EVENTS;
|
||||
event = (EVENT_T)((int)event + 1))
|
||||
for (event = (event_T)0; (int)event < (int)NUM_EVENTS;
|
||||
event = (event_T)((int)event + 1))
|
||||
/* loop over all autocommand patterns */
|
||||
for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next)
|
||||
if (ap->buflocal_nr == buf->b_fnum)
|
||||
@@ -7351,7 +7367,7 @@ free_all_autocmds()
|
||||
* Return NUM_EVENTS if the event name was not found.
|
||||
* Return a pointer to the next event name in "end".
|
||||
*/
|
||||
static EVENT_T
|
||||
static event_T
|
||||
event_name2nr(start, end)
|
||||
char_u *start;
|
||||
char_u **end;
|
||||
@@ -7382,7 +7398,7 @@ event_name2nr(start, end)
|
||||
*/
|
||||
static char_u *
|
||||
event_nr2name(event)
|
||||
EVENT_T event;
|
||||
event_T event;
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -7434,7 +7450,7 @@ find_end_event(arg, have_group)
|
||||
*/
|
||||
static int
|
||||
event_ignored(event)
|
||||
EVENT_T event;
|
||||
event_T event;
|
||||
{
|
||||
char_u *p = p_ei;
|
||||
|
||||
@@ -7546,7 +7562,7 @@ do_autocmd(arg, forceit)
|
||||
char_u *pat;
|
||||
char_u *envpat = NULL;
|
||||
char_u *cmd;
|
||||
EVENT_T event;
|
||||
event_T event;
|
||||
int need_free = FALSE;
|
||||
int nested = FALSE;
|
||||
int group;
|
||||
@@ -7627,12 +7643,12 @@ do_autocmd(arg, forceit)
|
||||
/*
|
||||
* Loop over the events.
|
||||
*/
|
||||
last_event = (EVENT_T)-1; /* for listing the event name */
|
||||
last_event = (event_T)-1; /* for listing the event name */
|
||||
last_group = AUGROUP_ERROR; /* for listing the group name */
|
||||
if (*arg == '*' || *arg == NUL)
|
||||
{
|
||||
for (event = (EVENT_T)0; (int)event < (int)NUM_EVENTS;
|
||||
event = (EVENT_T)((int)event + 1))
|
||||
for (event = (event_T)0; (int)event < (int)NUM_EVENTS;
|
||||
event = (event_T)((int)event + 1))
|
||||
if (do_autocmd_event(event, pat,
|
||||
nested, cmd, forceit, group) == FAIL)
|
||||
break;
|
||||
@@ -7690,7 +7706,7 @@ au_get_grouparg(argp)
|
||||
*/
|
||||
static int
|
||||
do_autocmd_event(event, pat, nested, cmd, forceit, group)
|
||||
EVENT_T event;
|
||||
event_T event;
|
||||
char_u *pat;
|
||||
int nested;
|
||||
char_u *cmd;
|
||||
@@ -8161,7 +8177,7 @@ static int autocmd_nested = FALSE;
|
||||
*/
|
||||
int
|
||||
apply_autocmds(event, fname, fname_io, force, buf)
|
||||
EVENT_T event;
|
||||
event_T event;
|
||||
char_u *fname; /* NULL or empty means use actual file name */
|
||||
char_u *fname_io; /* fname to use for <afile> on cmdline */
|
||||
int force; /* when TRUE, ignore autocmd_busy */
|
||||
@@ -8177,7 +8193,7 @@ apply_autocmds(event, fname, fname_io, force, buf)
|
||||
*/
|
||||
static int
|
||||
apply_autocmds_exarg(event, fname, fname_io, force, buf, eap)
|
||||
EVENT_T event;
|
||||
event_T event;
|
||||
char_u *fname;
|
||||
char_u *fname_io;
|
||||
int force;
|
||||
@@ -8196,7 +8212,7 @@ apply_autocmds_exarg(event, fname, fname_io, force, buf, eap)
|
||||
*/
|
||||
int
|
||||
apply_autocmds_retval(event, fname, fname_io, force, buf, retval)
|
||||
EVENT_T event;
|
||||
event_T event;
|
||||
char_u *fname; /* NULL or empty means use actual file name */
|
||||
char_u *fname_io; /* fname to use for <afile> on cmdline */
|
||||
int force; /* when TRUE, ignore autocmd_busy */
|
||||
@@ -8221,14 +8237,14 @@ apply_autocmds_retval(event, fname, fname_io, force, buf, retval)
|
||||
return did_cmd;
|
||||
}
|
||||
|
||||
#if defined(FEAT_AUTOCMD) || defined(PROTO)
|
||||
/*
|
||||
* Return TRUE when there is a CursorHold autocommand defined.
|
||||
*/
|
||||
int
|
||||
has_cursorhold()
|
||||
{
|
||||
return (first_autopat[(int)EVENT_CURSORHOLD] != NULL);
|
||||
return (first_autopat[(int)(get_real_state() == NORMAL_BUSY
|
||||
? EVENT_CURSORHOLD : EVENT_CURSORHOLDI)] != NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -8237,16 +8253,38 @@ has_cursorhold()
|
||||
int
|
||||
trigger_cursorhold()
|
||||
{
|
||||
return (!did_cursorhold
|
||||
&& has_cursorhold()
|
||||
&& !Recording
|
||||
&& get_real_state() == NORMAL_BUSY);
|
||||
int state;
|
||||
|
||||
if (!did_cursorhold && has_cursorhold() && !Recording)
|
||||
{
|
||||
state = get_real_state();
|
||||
if (state == NORMAL_BUSY || (state & INSERT) != 0)
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE when there is a CursorMoved autocommand defined.
|
||||
*/
|
||||
int
|
||||
has_cursormoved()
|
||||
{
|
||||
return (first_autopat[(int)EVENT_CURSORMOVED] != NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE when there is a CursorMovedI autocommand defined.
|
||||
*/
|
||||
int
|
||||
has_cursormovedI()
|
||||
{
|
||||
return (first_autopat[(int)EVENT_CURSORMOVEDI] != NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
|
||||
EVENT_T event;
|
||||
event_T event;
|
||||
char_u *fname; /* NULL or empty means use actual file name */
|
||||
char_u *fname_io; /* fname to use for <afile> on cmdline, NULL means
|
||||
use fname */
|
||||
@@ -8406,6 +8444,7 @@ apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
|
||||
if (event == EVENT_FILETYPE
|
||||
|| event == EVENT_SYNTAX
|
||||
|| event == EVENT_REMOTEREPLY
|
||||
|| event == EVENT_SPELLFILEMISSING
|
||||
|| event == EVENT_QUICKFIXCMDPRE
|
||||
|| event == EVENT_QUICKFIXCMDPOST)
|
||||
fname = vim_strsave(fname);
|
||||
@@ -8733,7 +8772,7 @@ getnextac(c, cookie, indent)
|
||||
*/
|
||||
int
|
||||
has_autocmd(event, sfname, buf)
|
||||
EVENT_T event;
|
||||
event_T event;
|
||||
char_u *sfname;
|
||||
buf_T *buf;
|
||||
{
|
||||
@@ -8900,7 +8939,7 @@ au_exists(arg)
|
||||
char_u *pattern = NULL;
|
||||
char_u *event_name;
|
||||
char_u *p;
|
||||
EVENT_T event;
|
||||
event_T event;
|
||||
AutoPat *ap;
|
||||
buf_T *buflocal_buf = NULL;
|
||||
int group;
|
||||
|
||||
@@ -1939,7 +1939,7 @@ get_foldtext(wp, lnum, lnume, foldinfo, buf)
|
||||
|
||||
++emsg_off;
|
||||
text = eval_to_string_safe(wp->w_p_fdt, NULL,
|
||||
was_set_insecurely((char_u *)"foldtext"));
|
||||
was_set_insecurely((char_u *)"foldtext", OPT_LOCAL));
|
||||
--emsg_off;
|
||||
|
||||
curwin = save_curwin;
|
||||
@@ -3188,7 +3188,7 @@ foldlevelMarker(flp)
|
||||
--flp->lvl_next;
|
||||
}
|
||||
else
|
||||
++s;
|
||||
mb_ptr_adv(s);
|
||||
}
|
||||
|
||||
/* The level can't go negative, must be missing a start marker. */
|
||||
|
||||
@@ -1534,7 +1534,7 @@ vgetc()
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_GTK2) && defined(FEAT_MENU)
|
||||
#if defined(FEAT_GUI) && defined(HAVE_GTK2) && defined(FEAT_MENU)
|
||||
/* GTK: <F10> normally selects the menu, but it's passed until
|
||||
* here to allow mapping it. Intercept and invoke the GTK
|
||||
* behavior if it's not mapped. */
|
||||
@@ -2365,7 +2365,7 @@ vgetorpeek(advance)
|
||||
colnr_T col = 0, vcol;
|
||||
char_u *ptr;
|
||||
|
||||
if (p_smd)
|
||||
if (mode_displayed)
|
||||
{
|
||||
unshowmode(TRUE);
|
||||
mode_deleted = TRUE;
|
||||
@@ -2641,9 +2641,9 @@ vgetorpeek(advance)
|
||||
* if we return an ESC to exit insert mode, the message is deleted
|
||||
* if we don't return an ESC but deleted the message before, redisplay it
|
||||
*/
|
||||
if (advance && p_smd && (State & INSERT))
|
||||
if (advance && p_smd && msg_silent == 0 && (State & INSERT))
|
||||
{
|
||||
if (c == ESC && !mode_deleted && !no_mapping)
|
||||
if (c == ESC && !mode_deleted && !no_mapping && mode_displayed)
|
||||
{
|
||||
if (typebuf.tb_len && !KeyTyped)
|
||||
redraw_cmdline = TRUE; /* delete mode later */
|
||||
|
||||
@@ -42,7 +42,7 @@ EXTERN long Columns INIT(= 80); /* nr of columns in the screen */
|
||||
EXTERN schar_T *ScreenLines INIT(= NULL);
|
||||
EXTERN sattr_T *ScreenAttrs INIT(= NULL);
|
||||
EXTERN unsigned *LineOffset INIT(= NULL);
|
||||
EXTERN char_u *LineWraps INIT(= NULL);
|
||||
EXTERN char_u *LineWraps INIT(= NULL); /* line wraps to next line */
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
/*
|
||||
@@ -61,6 +61,17 @@ EXTERN u8char_T *ScreenLinesC2 INIT(= NULL); /* second composing char */
|
||||
EXTERN schar_T *ScreenLines2 INIT(= NULL);
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/*
|
||||
* Indexes for tab page line:
|
||||
* N > 0 for label of tab page N
|
||||
* N == 0 for no label
|
||||
* N < 0 for closing tab page -N
|
||||
* N == -999 for closing current tab page
|
||||
*/
|
||||
EXTERN short *TabPageIdxs INIT(= NULL);
|
||||
#endif
|
||||
|
||||
EXTERN int screen_Rows INIT(= 0); /* actual size of ScreenLines[] */
|
||||
EXTERN int screen_Columns INIT(= 0); /* actual size of ScreenLines[] */
|
||||
|
||||
@@ -83,6 +94,7 @@ EXTERN int cmdline_row;
|
||||
|
||||
EXTERN int redraw_cmdline INIT(= FALSE); /* cmdline must be redrawn */
|
||||
EXTERN int clear_cmdline INIT(= FALSE); /* cmdline must be cleared */
|
||||
EXTERN int mode_displayed INIT(= FALSE); /* mode is being displayed */
|
||||
#if defined(FEAT_CRYPT) || defined(FEAT_EVAL)
|
||||
EXTERN int cmdline_star INIT(= FALSE); /* cmdline is crypted */
|
||||
#endif
|
||||
@@ -104,8 +116,8 @@ EXTERN colnr_T dollar_vcol INIT(= 0);
|
||||
* Variables for Insert mode completion.
|
||||
*/
|
||||
|
||||
/* length of the text being completed (this is deleted to be replaced by the
|
||||
* match) */
|
||||
/* Length in bytes of the text being completed (this is deleted to be replaced
|
||||
* by the match.) */
|
||||
EXTERN int compl_length INIT(= 0);
|
||||
|
||||
/* Set when character typed while looking for matches and it means we should
|
||||
@@ -398,6 +410,7 @@ EXTERN int drag_sep_line INIT(= FALSE); /* dragging vert separator */
|
||||
#ifdef FEAT_DIFF
|
||||
/* Value set from 'diffopt'. */
|
||||
EXTERN int diff_context INIT(= 6); /* context for folds */
|
||||
EXTERN int diff_need_scrollbind INIT(= FALSE);
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_MENU
|
||||
@@ -480,12 +493,18 @@ EXTERN win_T *lastwin; /* last window */
|
||||
EXTERN win_T *prevwin INIT(= NULL); /* previous window */
|
||||
# define W_NEXT(wp) ((wp)->w_next)
|
||||
# define FOR_ALL_WINDOWS(wp) for (wp = firstwin; wp != NULL; wp = wp->w_next)
|
||||
#define FOR_ALL_TAB_WINDOWS(tp, wp) \
|
||||
for ((tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next) \
|
||||
for ((wp) = ((tp) == curtab) \
|
||||
? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next)
|
||||
#else
|
||||
# define firstwin curwin
|
||||
# define lastwin curwin
|
||||
# define W_NEXT(wp) NULL
|
||||
# define FOR_ALL_WINDOWS(wp) wp = curwin;
|
||||
# define FOR_ALL_TAB_WINDOWS(tp, wp) wp = curwin;
|
||||
#endif
|
||||
|
||||
EXTERN win_T *curwin; /* currently active window */
|
||||
|
||||
/*
|
||||
@@ -494,6 +513,16 @@ EXTERN win_T *curwin; /* currently active window */
|
||||
*/
|
||||
EXTERN frame_T *topframe; /* top of the window frame tree */
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/*
|
||||
* Tab pages are alternative topframes. "first_tabpage" points to the first
|
||||
* one in the list, "curtab" is the current one.
|
||||
*/
|
||||
EXTERN tabpage_T *first_tabpage;
|
||||
EXTERN tabpage_T *curtab;
|
||||
EXTERN int redraw_tabline INIT(= FALSE); /* need to redraw tabline */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* All buffers are linked in a list. 'firstbuf' points to the first entry,
|
||||
* 'lastbuf' to the last entry and 'curbuf' to the currently active buffer.
|
||||
@@ -779,8 +808,10 @@ EXTERN int xim_changed_while_preediting INIT(= FALSE);
|
||||
# else
|
||||
EXTERN XIC xic INIT(= NULL);
|
||||
# endif
|
||||
# ifdef FEAT_GUI
|
||||
EXTERN guicolor_T xim_fg_color INIT(= INVALCOLOR);
|
||||
EXTERN guicolor_T xim_bg_color INIT(= INVALCOLOR);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_HANGULIN
|
||||
@@ -950,7 +981,12 @@ EXTERN char_u *new_last_cmdline INIT(= NULL); /* new value for last_cmdline */
|
||||
EXTERN char_u *autocmd_fname INIT(= NULL); /* fname for <afile> on cmdline */
|
||||
EXTERN int autocmd_bufnr INIT(= 0); /* fnum for <abuf> on cmdline */
|
||||
EXTERN char_u *autocmd_match INIT(= NULL); /* name for <amatch> on cmdline */
|
||||
EXTERN int did_cursorhold INIT(= FALSE); /* set when CursorHold triggered */
|
||||
EXTERN int did_cursorhold INIT(= FALSE); /* set when CursorHold t'gerd */
|
||||
EXTERN pos_T last_cursormoved /* for CursorMoved event */
|
||||
# ifdef DO_INIT
|
||||
= INIT_POS_T
|
||||
# endif
|
||||
;
|
||||
#endif
|
||||
|
||||
EXTERN linenr_T write_no_eol_lnum INIT(= 0); /* non-zero lnum when last line
|
||||
@@ -1365,6 +1401,7 @@ EXTERN char_u e_prev_dir[] INIT(= N_("E459: Cannot go back to previous directory
|
||||
|
||||
#ifdef FEAT_QUICKFIX
|
||||
EXTERN char_u e_quickfix[] INIT(= N_("E42: No Errors"));
|
||||
EXTERN char_u e_loclist[] INIT(= N_("E776: No location list"));
|
||||
#endif
|
||||
EXTERN char_u e_re_damg[] INIT(= N_("E43: Damaged match string"));
|
||||
EXTERN char_u e_re_corr[] INIT(= N_("E44: Corrupted regexp program"));
|
||||
@@ -1416,7 +1453,10 @@ EXTERN char_u e_invexprmsg[] INIT(= N_("E449: Invalid expression received"));
|
||||
EXTERN char_u e_guarded[] INIT(= N_("E463: Region is guarded, cannot modify"));
|
||||
EXTERN char_u e_nbreadonly[] INIT(= N_("E744: NetBeans does not allow changes in read-only files"));
|
||||
#endif
|
||||
#if defined(FEAT_INS_EXPAND) || defined(FEAT_EVAL) || defined(FEAT_SYN_HL) \
|
||||
|| defined(FEAT_WINDOWS)
|
||||
EXTERN char_u e_intern2[] INIT(= N_("E685: Internal error: %s"));
|
||||
#endif
|
||||
EXTERN char_u e_maxmempat[] INIT(= N_("E363: pattern uses more memory than 'maxmempattern'"));
|
||||
EXTERN char_u e_emptybuf[] INIT(= N_("E749: empty buffer"));
|
||||
|
||||
|
||||
73
src/gui.c
73
src/gui.c
@@ -786,6 +786,9 @@ set_guifontwide(name)
|
||||
gui.wide_font = font;
|
||||
set_string_option_direct((char_u *)"gfw", -1,
|
||||
wide_name, OPT_FREE);
|
||||
# ifdef FEAT_EVAL
|
||||
set_option_scriptID((char_u *)"gfw", current_SID);
|
||||
# endif
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1292,6 +1295,7 @@ again:
|
||||
#endif
|
||||
|
||||
busy = FALSE;
|
||||
|
||||
/*
|
||||
* We could have been called again while redrawing the screen.
|
||||
* Need to do it all again with the latest size then.
|
||||
@@ -1405,6 +1409,9 @@ gui_set_shellsize(mustset, fit_to_display)
|
||||
|
||||
min_width = base_width + MIN_COLUMNS * gui.char_width;
|
||||
min_height = base_height + MIN_LINES * gui.char_height;
|
||||
# ifdef FEAT_WINDOWS
|
||||
min_height += tabpageline_height() * gui.char_height;
|
||||
# endif
|
||||
|
||||
gui_mch_set_shellsize(width, height, min_width, min_height,
|
||||
base_width, base_height);
|
||||
@@ -3055,7 +3062,7 @@ gui_xy2colrow(x, y, colp)
|
||||
gui_menu_cb(menu)
|
||||
vimmenu_T *menu;
|
||||
{
|
||||
char_u bytes[3 + sizeof(long_u)];
|
||||
char_u bytes[sizeof(long_u)];
|
||||
|
||||
/* Don't put events in the input queue now. */
|
||||
if (hold_gui_events)
|
||||
@@ -3064,11 +3071,14 @@ gui_menu_cb(menu)
|
||||
bytes[0] = CSI;
|
||||
bytes[1] = KS_MENU;
|
||||
bytes[2] = KE_FILLER;
|
||||
add_long_to_buf((long_u)menu, bytes + 3);
|
||||
add_to_input_buf(bytes, 3 + sizeof(long_u));
|
||||
add_to_input_buf(bytes, 3);
|
||||
add_long_to_buf((long_u)menu, bytes);
|
||||
add_to_input_buf_csi(bytes, sizeof(long_u));
|
||||
}
|
||||
#endif
|
||||
|
||||
static int prev_which_scrollbars[3] = {-1, -1, -1};
|
||||
|
||||
/*
|
||||
* Set which components are present.
|
||||
* If "oldval" is not NULL, "oldval" is the previous value, the new * value is
|
||||
@@ -3079,7 +3089,6 @@ gui_menu_cb(menu)
|
||||
gui_init_which_components(oldval)
|
||||
char_u *oldval;
|
||||
{
|
||||
static int prev_which_scrollbars[3] = {-1, -1, -1};
|
||||
#ifdef FEAT_MENU
|
||||
static int prev_menu_is_active = -1;
|
||||
#endif
|
||||
@@ -3277,6 +3286,32 @@ gui_init_which_components(oldval)
|
||||
* Scrollbar stuff:
|
||||
*/
|
||||
|
||||
#if defined(FEAT_WINDOWS) || defined(PROTO)
|
||||
/*
|
||||
* Remove all scrollbars. Used before switching to another tab page.
|
||||
*/
|
||||
void
|
||||
gui_remove_scrollbars()
|
||||
{
|
||||
int i;
|
||||
win_T *wp;
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
if (i == SBAR_BOTTOM)
|
||||
gui_mch_enable_scrollbar(&gui.bottom_sbar, FALSE);
|
||||
else
|
||||
{
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
{
|
||||
gui_do_scrollbar(wp, i, FALSE);
|
||||
}
|
||||
}
|
||||
prev_which_scrollbars[i] = -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
gui_create_scrollbar(sb, type, wp)
|
||||
scrollbar_T *sb;
|
||||
@@ -3358,7 +3393,7 @@ gui_drag_scrollbar(sb, value, still_dragging)
|
||||
int old_topfill = curwin->w_topfill;
|
||||
# endif
|
||||
#else
|
||||
char_u bytes[4 + sizeof(long_u)];
|
||||
char_u bytes[sizeof(long_u)];
|
||||
int byte_count;
|
||||
#endif
|
||||
|
||||
@@ -3528,8 +3563,9 @@ gui_drag_scrollbar(sb, value, still_dragging)
|
||||
out_flush();
|
||||
gui_update_cursor(FALSE, TRUE);
|
||||
#else
|
||||
add_long_to_buf((long)value, bytes + byte_count);
|
||||
add_to_input_buf(bytes, byte_count + sizeof(long_u));
|
||||
add_to_input_buf(bytes, byte_count);
|
||||
add_long_to_buf((long_u)value, bytes);
|
||||
add_to_input_buf_csi(bytes, sizeof(long_u));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -3565,14 +3601,9 @@ gui_update_scrollbars(force)
|
||||
* have both a left and right scrollbar, and we drag one of them, we still
|
||||
* need to update the other one.
|
||||
*/
|
||||
if ( (gui.dragged_sb == SBAR_LEFT
|
||||
|| gui.dragged_sb == SBAR_RIGHT)
|
||||
&& (!gui.which_scrollbars[SBAR_LEFT]
|
||||
|| !gui.which_scrollbars[SBAR_RIGHT])
|
||||
&& !force)
|
||||
return;
|
||||
|
||||
if (!force && (gui.dragged_sb == SBAR_LEFT || gui.dragged_sb == SBAR_RIGHT))
|
||||
if (!force && (gui.dragged_sb == SBAR_LEFT || gui.dragged_sb == SBAR_RIGHT)
|
||||
&& gui.which_scrollbars[SBAR_LEFT]
|
||||
&& gui.which_scrollbars[SBAR_RIGHT])
|
||||
{
|
||||
/*
|
||||
* If we have two scrollbars and one of them is being dragged, just
|
||||
@@ -3585,7 +3616,6 @@ gui_update_scrollbars(force)
|
||||
gui.dragged_wp->w_scrollbars[0].value,
|
||||
gui.dragged_wp->w_scrollbars[0].size,
|
||||
gui.dragged_wp->w_scrollbars[0].max);
|
||||
return;
|
||||
}
|
||||
|
||||
/* avoid that moving components around generates events */
|
||||
@@ -3595,6 +3625,12 @@ gui_update_scrollbars(force)
|
||||
{
|
||||
if (wp->w_buffer == NULL) /* just in case */
|
||||
continue;
|
||||
/* Skip a scrollbar that is being dragged. */
|
||||
if (!force && (gui.dragged_sb == SBAR_LEFT
|
||||
|| gui.dragged_sb == SBAR_RIGHT)
|
||||
&& gui.dragged_wp == wp)
|
||||
continue;
|
||||
|
||||
#ifdef SCROLL_PAST_END
|
||||
max = wp->w_buffer->b_ml.ml_line_count - 1;
|
||||
#else
|
||||
@@ -3726,11 +3762,12 @@ gui_update_scrollbars(force)
|
||||
#endif
|
||||
sb->size = size;
|
||||
sb->max = max;
|
||||
if (gui.which_scrollbars[SBAR_LEFT] && gui.dragged_sb != SBAR_LEFT)
|
||||
if (gui.which_scrollbars[SBAR_LEFT]
|
||||
&& (gui.dragged_sb != SBAR_LEFT || gui.dragged_wp != wp))
|
||||
gui_mch_set_scrollbar_thumb(&wp->w_scrollbars[SBAR_LEFT],
|
||||
val, size, max);
|
||||
if (gui.which_scrollbars[SBAR_RIGHT]
|
||||
&& gui.dragged_sb != SBAR_RIGHT)
|
||||
&& (gui.dragged_sb != SBAR_RIGHT || gui.dragged_wp != wp))
|
||||
gui_mch_set_scrollbar_thumb(&wp->w_scrollbars[SBAR_RIGHT],
|
||||
val, size, max);
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@
|
||||
typedef struct GuiScrollbar
|
||||
{
|
||||
long ident; /* Unique identifier for each scrollbar */
|
||||
struct window *wp; /* Scrollbar's window, NULL for bottom */
|
||||
win_T *wp; /* Scrollbar's window, NULL for bottom */
|
||||
int type; /* one of SBAR_{LEFT,RIGHT,BOTTOM} */
|
||||
long value; /* Represents top line number visible */
|
||||
#ifdef FEAT_GUI_ATHENA
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user