mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge #6613 from justinmk/vim-patches
This commit is contained in:
commit
9f6d693e26
@ -1,6 +1,6 @@
|
|||||||
" Vim autoload file for editing compressed files.
|
" Vim autoload file for editing compressed files.
|
||||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||||
" Last Change: 2014 Nov 05
|
" Last Change: 2016 Sep 28
|
||||||
|
|
||||||
" These functions are used by the gzip plugin.
|
" These functions are used by the gzip plugin.
|
||||||
|
|
||||||
@ -63,6 +63,9 @@ fun gzip#read(cmd)
|
|||||||
" set 'modifiable'
|
" set 'modifiable'
|
||||||
let ma_save = &ma
|
let ma_save = &ma
|
||||||
setlocal ma
|
setlocal ma
|
||||||
|
" set 'write'
|
||||||
|
let write_save = &write
|
||||||
|
set write
|
||||||
" Reset 'foldenable', otherwise line numbers get adjusted.
|
" Reset 'foldenable', otherwise line numbers get adjusted.
|
||||||
if has("folding")
|
if has("folding")
|
||||||
let fen_save = &fen
|
let fen_save = &fen
|
||||||
@ -127,6 +130,7 @@ fun gzip#read(cmd)
|
|||||||
let &pm = pm_save
|
let &pm = pm_save
|
||||||
let &cpo = cpo_save
|
let &cpo = cpo_save
|
||||||
let &l:ma = ma_save
|
let &l:ma = ma_save
|
||||||
|
let &write = write_save
|
||||||
if has("folding")
|
if has("folding")
|
||||||
let &l:fen = fen_save
|
let &l:fen = fen_save
|
||||||
endif
|
endif
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
if &cp || exists("g:loaded_netrw")
|
if &cp || exists("g:loaded_netrw")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
" netrw requires vim having patch 213; netrw will benefit from vim's having patch#656, too
|
" netrw requires vim having patch 7.4.213; netrw will benefit from vim's having patch#656, too
|
||||||
if v:version < 704 || !has("patch213")
|
if v:version < 704 || (v:version == 704 && !has("patch213"))
|
||||||
if !exists("s:needpatch213")
|
if !exists("s:needpatch213")
|
||||||
unsilent echomsg "***sorry*** this version of netrw requires vim v7.4 with patch 213"
|
unsilent echomsg "***sorry*** this version of netrw requires vim v7.4 with patch 213"
|
||||||
endif
|
endif
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
" Maintainer: Dávid Szabó ( complex857 AT gmail DOT com )
|
" Maintainer: Dávid Szabó ( complex857 AT gmail DOT com )
|
||||||
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||||
" URL: https://github.com/shawncplus/phpcomplete.vim
|
" URL: https://github.com/shawncplus/phpcomplete.vim
|
||||||
" Last Change: 2015 Jul 13
|
" Last Change: 2016 Oct 10
|
||||||
"
|
"
|
||||||
" OPTIONS:
|
" OPTIONS:
|
||||||
"
|
"
|
||||||
@ -195,6 +195,8 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
|
|||||||
" }}}
|
" }}}
|
||||||
elseif context =~? 'implements'
|
elseif context =~? 'implements'
|
||||||
return phpcomplete#CompleteClassName(a:base, ['i'], current_namespace, imports)
|
return phpcomplete#CompleteClassName(a:base, ['i'], current_namespace, imports)
|
||||||
|
elseif context =~? 'instanceof'
|
||||||
|
return phpcomplete#CompleteClassName(a:base, ['c', 'n'], current_namespace, imports)
|
||||||
elseif context =~? 'extends\s\+.\+$' && a:base == ''
|
elseif context =~? 'extends\s\+.\+$' && a:base == ''
|
||||||
return ['implements']
|
return ['implements']
|
||||||
elseif context =~? 'extends'
|
elseif context =~? 'extends'
|
||||||
@ -787,6 +789,8 @@ function! phpcomplete#CompleteClassName(base, kinds, current_namespace, imports)
|
|||||||
|
|
||||||
if kinds == ['c', 'i']
|
if kinds == ['c', 'i']
|
||||||
let filterstr = 'v:val =~? "\\(class\\|interface\\)\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"'
|
let filterstr = 'v:val =~? "\\(class\\|interface\\)\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"'
|
||||||
|
elseif kinds == ['c', 'n']
|
||||||
|
let filterstr = 'v:val =~? "\\(class\\|namespace\\)\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"'
|
||||||
elseif kinds == ['c']
|
elseif kinds == ['c']
|
||||||
let filterstr = 'v:val =~? "class\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"'
|
let filterstr = 'v:val =~? "class\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"'
|
||||||
elseif kinds == ['i']
|
elseif kinds == ['i']
|
||||||
@ -931,7 +935,7 @@ function! phpcomplete#EvaluateModifiers(modifiers, required_modifiers, prohibite
|
|||||||
endfor
|
endfor
|
||||||
|
|
||||||
for modifier in a:modifiers
|
for modifier in a:modifiers
|
||||||
" if the modifier is prohibited its a no match
|
" if the modifier is prohibited it's a no match
|
||||||
if index(a:prohibited_modifiers, modifier) != -1
|
if index(a:prohibited_modifiers, modifier) != -1
|
||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
@ -996,7 +1000,7 @@ function! phpcomplete#CompleteUserClass(context, base, sccontent, visibility) "
|
|||||||
let required_modifiers += ['static']
|
let required_modifiers += ['static']
|
||||||
endif
|
endif
|
||||||
let all_variable = filter(deepcopy(a:sccontent),
|
let all_variable = filter(deepcopy(a:sccontent),
|
||||||
\ 'v:val =~ "^\\s*\\(var\\s\\+\\|public\\s\\+\\|protected\\s\\+\\|private\\s\\+\\|final\\s\\+\\|abstract\\s\\+\\|static\\s\\+\\)\\+\\$"')
|
\ 'v:val =~ "\\(^\\s*\\(var\\s\\+\\|public\\s\\+\\|protected\\s\\+\\|private\\s\\+\\|final\\s\\+\\|abstract\\s\\+\\|static\\s\\+\\)\\+\\$\\|^\\s*\\(\\/\\|\\*\\)*\\s*@property\\s\\+\\S\\+\\s\\S\\{-}\\s*$\\)"')
|
||||||
|
|
||||||
let variables = []
|
let variables = []
|
||||||
for i in all_variable
|
for i in all_variable
|
||||||
@ -1160,6 +1164,14 @@ function! phpcomplete#GetTaglist(pattern) " {{{
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let tags = taglist(a:pattern)
|
let tags = taglist(a:pattern)
|
||||||
|
for tag in tags
|
||||||
|
for prop in keys(tag)
|
||||||
|
if prop == 'cmd' || prop == 'static' || prop == 'kind' || prop == 'builtin'
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
let tag[prop] = substitute(tag[prop], '\\\\', '\\', 'g')
|
||||||
|
endfor
|
||||||
|
endfor
|
||||||
let s:cache_tags[a:pattern] = tags
|
let s:cache_tags[a:pattern] = tags
|
||||||
let has_key = has_key(s:cache_tags, a:pattern)
|
let has_key = has_key(s:cache_tags, a:pattern)
|
||||||
let s:cache_tags_checksum = cache_checksum
|
let s:cache_tags_checksum = cache_checksum
|
||||||
@ -1379,7 +1391,7 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat
|
|||||||
" Get Structured information of all classes and subclasses including namespace and includes
|
" Get Structured information of all classes and subclasses including namespace and includes
|
||||||
" try to find the method's return type in docblock comment
|
" try to find the method's return type in docblock comment
|
||||||
for classstructure in classcontents
|
for classstructure in classcontents
|
||||||
let docblock_target_pattern = 'function\s\+&\?'.method.'\|\(public\|private\|protected\|var\).\+\$'.method
|
let docblock_target_pattern = 'function\s\+&\?'.method.'\>\|\(public\|private\|protected\|var\).\+\$'.method.'\>\|@property.\+\$'.method.'\>'
|
||||||
let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), docblock_target_pattern)
|
let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), docblock_target_pattern)
|
||||||
if doc_str != ''
|
if doc_str != ''
|
||||||
break
|
break
|
||||||
@ -1387,8 +1399,17 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat
|
|||||||
endfor
|
endfor
|
||||||
if doc_str != ''
|
if doc_str != ''
|
||||||
let docblock = phpcomplete#ParseDocBlock(doc_str)
|
let docblock = phpcomplete#ParseDocBlock(doc_str)
|
||||||
if has_key(docblock.return, 'type') || has_key(docblock.var, 'type')
|
if has_key(docblock.return, 'type') || has_key(docblock.var, 'type') || len(docblock.properties) > 0
|
||||||
let type = has_key(docblock.return, 'type') ? docblock.return.type : docblock.var.type
|
let type = has_key(docblock.return, 'type') ? docblock.return.type : has_key(docblock.var, 'type') ? docblock.var.type : ''
|
||||||
|
|
||||||
|
if type == ''
|
||||||
|
for property in docblock.properties
|
||||||
|
if property.description =~? method
|
||||||
|
let type = property.type
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
endif
|
||||||
|
|
||||||
" there's a namespace in the type, threat the type as FQCN
|
" there's a namespace in the type, threat the type as FQCN
|
||||||
if type =~ '\\'
|
if type =~ '\\'
|
||||||
@ -1554,6 +1575,9 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
|||||||
elseif get(methodstack, 0) =~# function_invocation_pattern
|
elseif get(methodstack, 0) =~# function_invocation_pattern
|
||||||
let function_name = matchstr(methodstack[0], '^\s*\zs'.function_name_pattern)
|
let function_name = matchstr(methodstack[0], '^\s*\zs'.function_name_pattern)
|
||||||
let function_file = phpcomplete#GetFunctionLocation(function_name, a:current_namespace)
|
let function_file = phpcomplete#GetFunctionLocation(function_name, a:current_namespace)
|
||||||
|
if function_file == ''
|
||||||
|
let function_file = phpcomplete#GetFunctionLocation(function_name, '\')
|
||||||
|
endif
|
||||||
|
|
||||||
if function_file == 'VIMPHP_BUILTINFUNCTION'
|
if function_file == 'VIMPHP_BUILTINFUNCTION'
|
||||||
" built in function, grab the return type from the info string
|
" built in function, grab the return type from the info string
|
||||||
@ -1569,7 +1593,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
|||||||
let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines)
|
let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines)
|
||||||
" try to expand the classname of the returned type with the context got from the function's source file
|
" try to expand the classname of the returned type with the context got from the function's source file
|
||||||
|
|
||||||
let [classname_candidate, unused] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports)
|
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
if classname_candidate != ''
|
if classname_candidate != ''
|
||||||
@ -1650,9 +1674,10 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
|||||||
let sub_methodstack = phpcomplete#GetMethodStack(matchstr(line, '^\s*'.object.'\s*=&\?\s*\s\+\zs.*'))
|
let sub_methodstack = phpcomplete#GetMethodStack(matchstr(line, '^\s*'.object.'\s*=&\?\s*\s\+\zs.*'))
|
||||||
let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(
|
let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(
|
||||||
\ classname,
|
\ classname,
|
||||||
\ a:current_namespace,
|
\ namespace_for_class,
|
||||||
\ a:imports,
|
\ a:imports,
|
||||||
\ sub_methodstack)
|
\ sub_methodstack)
|
||||||
|
|
||||||
return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate
|
return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@ -1783,6 +1808,9 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
|||||||
let [function_name, function_namespace] = phpcomplete#ExpandClassName(function_name, a:current_namespace, a:imports)
|
let [function_name, function_namespace] = phpcomplete#ExpandClassName(function_name, a:current_namespace, a:imports)
|
||||||
|
|
||||||
let function_file = phpcomplete#GetFunctionLocation(function_name, function_namespace)
|
let function_file = phpcomplete#GetFunctionLocation(function_name, function_namespace)
|
||||||
|
if function_file == ''
|
||||||
|
let function_file = phpcomplete#GetFunctionLocation(function_name, '\')
|
||||||
|
endif
|
||||||
|
|
||||||
if function_file == 'VIMPHP_BUILTINFUNCTION'
|
if function_file == 'VIMPHP_BUILTINFUNCTION'
|
||||||
" built in function, grab the return type from the info string
|
" built in function, grab the return type from the info string
|
||||||
@ -1798,7 +1826,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
|||||||
let classname_candidate = docblock.return.type
|
let classname_candidate = docblock.return.type
|
||||||
let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines)
|
let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines)
|
||||||
" try to expand the classname of the returned type with the context got from the function's source file
|
" try to expand the classname of the returned type with the context got from the function's source file
|
||||||
let [classname_candidate, unused] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports)
|
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports)
|
||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@ -1861,6 +1889,8 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
|||||||
for tag in tags
|
for tag in tags
|
||||||
if tag.kind ==? 'v' && tag.cmd =~? '=\s*new\s\+\zs'.class_name_pattern.'\ze'
|
if tag.kind ==? 'v' && tag.cmd =~? '=\s*new\s\+\zs'.class_name_pattern.'\ze'
|
||||||
let classname = matchstr(tag.cmd, '=\s*new\s\+\zs'.class_name_pattern.'\ze')
|
let classname = matchstr(tag.cmd, '=\s*new\s\+\zs'.class_name_pattern.'\ze')
|
||||||
|
" unescape the classname, it would have "\" doubled since it is an ex command
|
||||||
|
let classname = substitute(classname, '\\\(\_.\)', '\1', 'g')
|
||||||
return classname
|
return classname
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
@ -2077,6 +2107,19 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
|
|||||||
endif
|
endif
|
||||||
call searchpair('{', '', '}', 'W')
|
call searchpair('{', '', '}', 'W')
|
||||||
let class_closing_bracket_line = line('.')
|
let class_closing_bracket_line = line('.')
|
||||||
|
|
||||||
|
" Include class docblock
|
||||||
|
let doc_line = cfline - 1
|
||||||
|
if getline(doc_line) =~? '^\s*\*/'
|
||||||
|
while doc_line != 0
|
||||||
|
if getline(doc_line) =~? '^\s*/\*\*'
|
||||||
|
let cfline = doc_line
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
let doc_line -= 1
|
||||||
|
endwhile
|
||||||
|
endif
|
||||||
|
|
||||||
let classcontent = join(getline(cfline, class_closing_bracket_line), "\n")
|
let classcontent = join(getline(cfline, class_closing_bracket_line), "\n")
|
||||||
|
|
||||||
let used_traits = []
|
let used_traits = []
|
||||||
@ -2241,8 +2284,19 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{
|
|||||||
let line = a:sccontent[i]
|
let line = a:sccontent[i]
|
||||||
" search for a function declaration
|
" search for a function declaration
|
||||||
if line =~? a:search
|
if line =~? a:search
|
||||||
let l = i - 1
|
if line =~? '@property'
|
||||||
" start backward serch for the comment block
|
let doc_line = i
|
||||||
|
while doc_line != sccontent_len - 1
|
||||||
|
if a:sccontent[doc_line] =~? '^\s*\*/'
|
||||||
|
let l = doc_line
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
let doc_line += 1
|
||||||
|
endwhile
|
||||||
|
else
|
||||||
|
let l = i - 1
|
||||||
|
endif
|
||||||
|
" start backward search for the comment block
|
||||||
while l != 0
|
while l != 0
|
||||||
let line = a:sccontent[l]
|
let line = a:sccontent[l]
|
||||||
" if it's a one line docblock like comment and we can just return it right away
|
" if it's a one line docblock like comment and we can just return it right away
|
||||||
@ -2263,7 +2317,7 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{
|
|||||||
return ''
|
return ''
|
||||||
end
|
end
|
||||||
|
|
||||||
while l != 0
|
while l >= 0
|
||||||
let line = a:sccontent[l]
|
let line = a:sccontent[l]
|
||||||
if line =~? '^\s*/\*\*'
|
if line =~? '^\s*/\*\*'
|
||||||
let comment_start = l
|
let comment_start = l
|
||||||
@ -2297,9 +2351,10 @@ function! phpcomplete#ParseDocBlock(docblock) " {{{
|
|||||||
\ 'return': {},
|
\ 'return': {},
|
||||||
\ 'throws': [],
|
\ 'throws': [],
|
||||||
\ 'var': {},
|
\ 'var': {},
|
||||||
|
\ 'properties': [],
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
let res.description = substitute(matchstr(a:docblock, '\zs\_.\{-}\ze\(@var\|@param\|@return\|$\)'), '\(^\_s*\|\_s*$\)', '', 'g')
|
let res.description = substitute(matchstr(a:docblock, '\zs\_.\{-}\ze\(@type\|@var\|@param\|@return\|$\)'), '\(^\_s*\|\_s*$\)', '', 'g')
|
||||||
let docblock_lines = split(a:docblock, "\n")
|
let docblock_lines = split(a:docblock, "\n")
|
||||||
|
|
||||||
let param_lines = filter(copy(docblock_lines), 'v:val =~? "^@param"')
|
let param_lines = filter(copy(docblock_lines), 'v:val =~? "^@param"')
|
||||||
@ -2334,15 +2389,26 @@ function! phpcomplete#ParseDocBlock(docblock) " {{{
|
|||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
let var_line = filter(copy(docblock_lines), 'v:val =~? "^@var"')
|
let var_line = filter(copy(docblock_lines), 'v:val =~? "^\\(@var\\|@type\\)"')
|
||||||
if len(var_line) > 0
|
if len(var_line) > 0
|
||||||
let var_parts = matchlist(var_line[0], '@var\s\+\(\S\+\)\s*\(.*\)')
|
let var_parts = matchlist(var_line[0], '\(@var\|@type\)\s\+\(\S\+\)\s*\(.*\)')
|
||||||
let res['var'] = {
|
let res['var'] = {
|
||||||
\ 'line': var_parts[0],
|
\ 'line': var_parts[0],
|
||||||
\ 'type': phpcomplete#GetTypeFromDocBlockParam(get(var_parts, 1, '')),
|
\ 'type': phpcomplete#GetTypeFromDocBlockParam(get(var_parts, 2, '')),
|
||||||
\ 'description': get(var_parts, 2, '')}
|
\ 'description': get(var_parts, 3, '')}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let property_lines = filter(copy(docblock_lines), 'v:val =~? "^@property"')
|
||||||
|
for property_line in property_lines
|
||||||
|
let parts = matchlist(property_line, '\(@property\)\s\+\(\S\+\)\s*\(.*\)')
|
||||||
|
if len(parts) > 0
|
||||||
|
call add(res.properties, {
|
||||||
|
\ 'line': parts[0],
|
||||||
|
\ 'type': phpcomplete#GetTypeFromDocBlockParam(get(parts, 2, '')),
|
||||||
|
\ 'description': get(parts, 3, '')})
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
return res
|
return res
|
||||||
endfunction
|
endfunction
|
||||||
" }}}
|
" }}}
|
||||||
@ -2498,6 +2564,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
|||||||
let name = matchstr(name, '\\\zs[^\\]\+\ze$')
|
let name = matchstr(name, '\\\zs[^\\]\+\ze$')
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" leading slash is not required use imports are always absolute
|
" leading slash is not required use imports are always absolute
|
||||||
let imports[name] = {'name': object, 'kind': ''}
|
let imports[name] = {'name': object, 'kind': ''}
|
||||||
endfor
|
endfor
|
||||||
@ -2533,6 +2600,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
|||||||
elseif !exists('no_namespace_candidate')
|
elseif !exists('no_namespace_candidate')
|
||||||
" save the first namespacless match to be used if no better
|
" save the first namespacless match to be used if no better
|
||||||
" candidate found later on
|
" candidate found later on
|
||||||
|
let tag.namespace = namespace_for_classes
|
||||||
let no_namespace_candidate = tag
|
let no_namespace_candidate = tag
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
@ -93,7 +93,7 @@ function! s:GetBufferRubyEntity( name, type, ... )
|
|||||||
|
|
||||||
let stopline = 1
|
let stopline = 1
|
||||||
|
|
||||||
let crex = '^\s*\<' . a:type . '\>\s*\<' . a:name . '\>\s*\(<\s*.*\s*\)\?'
|
let crex = '^\s*\<' . a:type . '\>\s*\<' . escape(a:name, '*') . '\>\s*\(<\s*.*\s*\)\?'
|
||||||
let [lnum,lcol] = searchpos( crex, 'w' )
|
let [lnum,lcol] = searchpos( crex, 'w' )
|
||||||
"let [lnum,lcol] = searchpairpos( crex . '\zs', '', '\(end\|}\)', 'w' )
|
"let [lnum,lcol] = searchpairpos( crex . '\zs', '', '\(end\|}\)', 'w' )
|
||||||
|
|
||||||
@ -149,7 +149,7 @@ function! s:GetRubyVarType(v)
|
|||||||
let ctors = ctors.'\)'
|
let ctors = ctors.'\)'
|
||||||
|
|
||||||
let fstr = '=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%[xwQqr][(\[{@]\|[A-Za-z0-9@:\-()\.]\+...\?\|lambda\|&\)'
|
let fstr = '=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%[xwQqr][(\[{@]\|[A-Za-z0-9@:\-()\.]\+...\?\|lambda\|&\)'
|
||||||
let sstr = ''.a:v.'\>\s*[+\-*/]*'.fstr
|
let sstr = ''.escape(a:v, '*').'\>\s*[+\-*/]*'.fstr
|
||||||
let [lnum,lcol] = searchpos(sstr,'nb',stopline)
|
let [lnum,lcol] = searchpos(sstr,'nb',stopline)
|
||||||
if lnum != 0 && lcol != 0
|
if lnum != 0 && lcol != 0
|
||||||
let str = matchstr(getline(lnum),fstr,lcol)
|
let str = matchstr(getline(lnum),fstr,lcol)
|
||||||
@ -196,7 +196,7 @@ function! rubycomplete#Complete(findstart, base)
|
|||||||
if c =~ '\w'
|
if c =~ '\w'
|
||||||
continue
|
continue
|
||||||
elseif ! c =~ '\.'
|
elseif ! c =~ '\.'
|
||||||
idx = -1
|
let idx = -1
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
break
|
break
|
||||||
@ -266,6 +266,28 @@ class VimRubyCompletion
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def load_gems
|
||||||
|
fpath = VIM::evaluate("get(g:, 'rubycomplete_gemfile_path', 'Gemfile')")
|
||||||
|
return unless File.file?(fpath) && File.readable?(fpath)
|
||||||
|
want_bundler = VIM::evaluate("get(g:, 'rubycomplete_use_bundler')")
|
||||||
|
parse_file = !want_bundler
|
||||||
|
begin
|
||||||
|
require 'bundler'
|
||||||
|
Bundler.setup
|
||||||
|
Bundler.require
|
||||||
|
rescue Exception
|
||||||
|
parse_file = true
|
||||||
|
end
|
||||||
|
if parse_file
|
||||||
|
File.new(fpath).each_line do |line|
|
||||||
|
begin
|
||||||
|
require $1 if /\s*gem\s*['"]([^'"]+)/.match(line)
|
||||||
|
rescue Exception
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def load_buffer_class(name)
|
def load_buffer_class(name)
|
||||||
dprint "load_buffer_class(%s) START" % name
|
dprint "load_buffer_class(%s) START" % name
|
||||||
classdef = get_buffer_entity(name, 's:GetBufferRubyClass("%s")')
|
classdef = get_buffer_entity(name, 's:GetBufferRubyClass("%s")')
|
||||||
@ -588,6 +610,10 @@ class VimRubyCompletion
|
|||||||
load_rails
|
load_rails
|
||||||
end
|
end
|
||||||
|
|
||||||
|
want_gems = VIM::evaluate("get(g:, 'rubycomplete_load_gemfile')")
|
||||||
|
load_gems unless want_gems.to_i.zero?
|
||||||
|
|
||||||
|
|
||||||
input = VIM::Buffer.current.line
|
input = VIM::Buffer.current.line
|
||||||
cpos = VIM::Window.current.cursor[1] - 1
|
cpos = VIM::Window.current.cursor[1] - 1
|
||||||
input = input[0..cpos]
|
input = input[0..cpos]
|
||||||
@ -678,7 +704,9 @@ class VimRubyCompletion
|
|||||||
cv = eval("self.class.constants")
|
cv = eval("self.class.constants")
|
||||||
vartype = get_var_type( receiver )
|
vartype = get_var_type( receiver )
|
||||||
dprint "vartype: %s" % vartype
|
dprint "vartype: %s" % vartype
|
||||||
if vartype != ''
|
|
||||||
|
invalid_vartype = ['', "gets"]
|
||||||
|
if !invalid_vartype.include?(vartype)
|
||||||
load_buffer_class( vartype )
|
load_buffer_class( vartype )
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -706,7 +734,7 @@ class VimRubyCompletion
|
|||||||
methods.concat m.instance_methods(false)
|
methods.concat m.instance_methods(false)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
variables += add_rails_columns( "#{vartype}" ) if vartype && vartype.length > 0
|
variables += add_rails_columns( "#{vartype}" ) if vartype && !invalid_vartype.include?(vartype)
|
||||||
|
|
||||||
when /^\(?\s*[A-Za-z0-9:^@.%\/+*\(\)]+\.\.\.?[A-Za-z0-9:^@.%\/+*\(\)]+\s*\)?\.([^.]*)/
|
when /^\(?\s*[A-Za-z0-9:^@.%\/+*\(\)]+\.\.\.?[A-Za-z0-9:^@.%\/+*\(\)]+\s*\)?\.([^.]*)/
|
||||||
message = $1
|
message = $1
|
||||||
|
@ -117,7 +117,7 @@ fun! tar#Browse(tarfile)
|
|||||||
if !filereadable(a:tarfile)
|
if !filereadable(a:tarfile)
|
||||||
" call Decho('a:tarfile<'.a:tarfile.'> not filereadable')
|
" call Decho('a:tarfile<'.a:tarfile.'> not filereadable')
|
||||||
if a:tarfile !~# '^\a\+://'
|
if a:tarfile !~# '^\a\+://'
|
||||||
" if its an url, don't complain, let url-handlers such as vim do its thing
|
" if it's an url, don't complain, let url-handlers such as vim do its thing
|
||||||
redraw!
|
redraw!
|
||||||
echohl Error | echo "***error*** (tar#Browse) File not readable<".a:tarfile.">" | echohl None
|
echohl Error | echo "***error*** (tar#Browse) File not readable<".a:tarfile.">" | echohl None
|
||||||
endif
|
endif
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" zip.vim: Handles browsing zipfiles
|
" zip.vim: Handles browsing zipfiles
|
||||||
" AUTOLOAD PORTION
|
" AUTOLOAD PORTION
|
||||||
" Date: Jul 02, 2013
|
" Date: Sep 13, 2016
|
||||||
" Version: 27
|
" Version: 28
|
||||||
" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
|
" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
|
||||||
" License: Vim License (see vim's :help license)
|
" License: Vim License (see vim's :help license)
|
||||||
" Copyright: Copyright (C) 2005-2013 Charles E. Campbell {{{1
|
" Copyright: Copyright (C) 2005-2013 Charles E. Campbell {{{1
|
||||||
@ -20,10 +20,10 @@
|
|||||||
if &cp || exists("g:loaded_zip")
|
if &cp || exists("g:loaded_zip")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let g:loaded_zip= "v27"
|
let g:loaded_zip= "v28"
|
||||||
if v:version < 702
|
if v:version < 702
|
||||||
echohl WarningMsg
|
echohl WarningMsg
|
||||||
echo "***warning*** this version of zip needs vim 7.2"
|
echo "***warning*** this version of zip needs vim 7.2 or later"
|
||||||
echohl Normal
|
echohl Normal
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
@ -53,6 +53,9 @@ endif
|
|||||||
if !exists("g:zip_unzipcmd")
|
if !exists("g:zip_unzipcmd")
|
||||||
let g:zip_unzipcmd= "unzip"
|
let g:zip_unzipcmd= "unzip"
|
||||||
endif
|
endif
|
||||||
|
if !exists("g:zip_extractcmd")
|
||||||
|
let g:zip_extractcmd= g:zip_unzipcmd
|
||||||
|
endif
|
||||||
|
|
||||||
" ----------------
|
" ----------------
|
||||||
" Functions: {{{1
|
" Functions: {{{1
|
||||||
@ -62,14 +65,14 @@ endif
|
|||||||
" zip#Browse: {{{2
|
" zip#Browse: {{{2
|
||||||
fun! zip#Browse(zipfile)
|
fun! zip#Browse(zipfile)
|
||||||
" call Dfunc("zip#Browse(zipfile<".a:zipfile.">)")
|
" call Dfunc("zip#Browse(zipfile<".a:zipfile.">)")
|
||||||
" sanity check: insure that the zipfile has "PK" as its first two letters
|
" sanity check: ensure that the zipfile has "PK" as its first two letters
|
||||||
" (zipped files have a leading PK as a "magic cookie")
|
" (zipped files have a leading PK as a "magic cookie")
|
||||||
if !filereadable(a:zipfile) || readfile(a:zipfile, "", 1)[0] !~ '^PK'
|
if !filereadable(a:zipfile) || readfile(a:zipfile, "", 1)[0] !~ '^PK'
|
||||||
exe "noautocmd e ".fnameescape(a:zipfile)
|
exe "noautocmd e ".fnameescape(a:zipfile)
|
||||||
" call Dret("zip#Browse : not a zipfile<".a:zipfile.">")
|
" call Dret("zip#Browse : not a zipfile<".a:zipfile.">")
|
||||||
return
|
return
|
||||||
" else " Decho
|
" else " Decho
|
||||||
" call Decho("zip#Browse: a:zipfile<".a:zipfile."> passed PK test - its a zip file")
|
" call Decho("zip#Browse: a:zipfile<".a:zipfile."> passed PK test - it's a zip file")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let repkeep= &report
|
let repkeep= &report
|
||||||
@ -92,7 +95,7 @@ fun! zip#Browse(zipfile)
|
|||||||
endif
|
endif
|
||||||
if !filereadable(a:zipfile)
|
if !filereadable(a:zipfile)
|
||||||
if a:zipfile !~# '^\a\+://'
|
if a:zipfile !~# '^\a\+://'
|
||||||
" if its an url, don't complain, let url-handlers such as vim do its thing
|
" if it's an url, don't complain, let url-handlers such as vim do its thing
|
||||||
redraw!
|
redraw!
|
||||||
echohl Error | echo "***error*** (zip#Browse) File not readable<".a:zipfile.">" | echohl None
|
echohl Error | echo "***error*** (zip#Browse) File not readable<".a:zipfile.">" | echohl None
|
||||||
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||||
@ -136,8 +139,10 @@ fun! zip#Browse(zipfile)
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Maps associated with zip plugin
|
||||||
setlocal noma nomod ro
|
setlocal noma nomod ro
|
||||||
noremap <silent> <buffer> <cr> :call <SID>ZipBrowseSelect()<cr>
|
noremap <silent> <buffer> <cr> :call <SID>ZipBrowseSelect()<cr>
|
||||||
|
noremap <silent> <buffer> x :call zip#Extract()<cr>
|
||||||
|
|
||||||
let &report= repkeep
|
let &report= repkeep
|
||||||
" call Dret("zip#Browse")
|
" call Dret("zip#Browse")
|
||||||
@ -204,6 +209,15 @@ fun! zip#Read(fname,mode)
|
|||||||
endif
|
endif
|
||||||
" call Decho("zipfile<".zipfile.">")
|
" call Decho("zipfile<".zipfile.">")
|
||||||
" call Decho("fname <".fname.">")
|
" call Decho("fname <".fname.">")
|
||||||
|
" sanity check
|
||||||
|
if !executable(substitute(g:zip_unzipcmd,'\s\+.*$','',''))
|
||||||
|
redraw!
|
||||||
|
echohl Error | echo "***error*** (zip#Read) sorry, your system doesn't appear to have the ".g:zip_unzipcmd." program" | echohl None
|
||||||
|
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||||
|
let &report= repkeep
|
||||||
|
" call Dret("zip#Write")
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
" the following code does much the same thing as
|
" the following code does much the same thing as
|
||||||
" exe "keepj sil! r! ".g:zip_unzipcmd." -p -- ".s:Escape(zipfile,1)." ".s:Escape(fnameescape(fname),1)
|
" exe "keepj sil! r! ".g:zip_unzipcmd." -p -- ".s:Escape(zipfile,1)." ".s:Escape(fnameescape(fname),1)
|
||||||
@ -236,9 +250,9 @@ fun! zip#Write(fname)
|
|||||||
set report=10
|
set report=10
|
||||||
|
|
||||||
" sanity checks
|
" sanity checks
|
||||||
if !executable(g:zip_zipcmd)
|
if !executable(substitute(g:zip_zipcmd,'\s\+.*$','',''))
|
||||||
redraw!
|
redraw!
|
||||||
echohl Error | echo "***error*** (zip#Write) sorry, your system doesn't appear to have the zip pgm" | echohl None
|
echohl Error | echo "***error*** (zip#Write) sorry, your system doesn't appear to have the ".g:zip_zipcmd." program" | echohl None
|
||||||
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||||
let &report= repkeep
|
let &report= repkeep
|
||||||
" call Dret("zip#Write")
|
" call Dret("zip#Write")
|
||||||
@ -344,6 +358,48 @@ fun! zip#Write(fname)
|
|||||||
" call Dret("zip#Write")
|
" call Dret("zip#Write")
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" zip#Extract: extract a file from a zip archive {{{2
|
||||||
|
fun! zip#Extract()
|
||||||
|
" call Dfunc("zip#Extract()")
|
||||||
|
|
||||||
|
let repkeep= &report
|
||||||
|
set report=10
|
||||||
|
let fname= getline(".")
|
||||||
|
" call Decho("fname<".fname.">")
|
||||||
|
|
||||||
|
" sanity check
|
||||||
|
if fname =~ '^"'
|
||||||
|
let &report= repkeep
|
||||||
|
" call Dret("zip#Extract")
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
if fname =~ '/$'
|
||||||
|
redraw!
|
||||||
|
echohl Error | echo "***error*** (zip#Extract) Please specify a file, not a directory" | echohl None
|
||||||
|
let &report= repkeep
|
||||||
|
" call Dret("zip#Extract")
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
" extract the file mentioned under the cursor
|
||||||
|
" call Decho("system(".g:zip_extractcmd." ".shellescape(b:zipfile)." ".shellescape(shell).")")
|
||||||
|
call system(g:zip_extractcmd." ".shellescape(b:zipfile)." ".shellescape(shell))
|
||||||
|
" call Decho("zipfile<".b:zipfile.">")
|
||||||
|
if v:shell_error != 0
|
||||||
|
echohl Error | echo "***error*** ".g:zip_extractcmd." ".b:zipfile." ".fname.": failed!" | echohl NONE
|
||||||
|
elseif !filereadable(fname)
|
||||||
|
echohl Error | echo "***error*** attempted to extract ".fname." but it doesn't appear to be present!"
|
||||||
|
else
|
||||||
|
echo "***note*** successfully extracted ".fname
|
||||||
|
endif
|
||||||
|
|
||||||
|
" restore option
|
||||||
|
let &report= repkeep
|
||||||
|
|
||||||
|
" call Dret("zip#Extract")
|
||||||
|
endfun
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" s:Escape: {{{2
|
" s:Escape: {{{2
|
||||||
fun! s:Escape(fname,isfilt)
|
fun! s:Escape(fname,isfilt)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
" Vim color file
|
" Vim color file
|
||||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||||
" Last Change: 2006 Apr 14
|
" Last Change: 2016 Oct 10
|
||||||
|
|
||||||
" This color scheme uses a dark grey background.
|
" This color scheme uses a dark grey background.
|
||||||
|
|
||||||
@ -45,8 +45,8 @@ hi CursorColumn term=reverse ctermbg=Black guibg=grey40
|
|||||||
hi CursorLine term=underline cterm=underline guibg=grey40
|
hi CursorLine term=underline cterm=underline guibg=grey40
|
||||||
|
|
||||||
" Groups for syntax highlighting
|
" Groups for syntax highlighting
|
||||||
hi Constant term=underline ctermfg=Magenta guifg=#ffa0a0 guibg=grey5
|
hi Constant term=underline ctermfg=Magenta guifg=#ffa0a0
|
||||||
hi Special term=bold ctermfg=LightRed guifg=Orange guibg=grey5
|
hi Special term=bold ctermfg=LightRed guifg=Orange
|
||||||
if &t_Co > 8
|
if &t_Co > 8
|
||||||
hi Statement term=bold cterm=bold ctermfg=Yellow guifg=#ffff60 gui=bold
|
hi Statement term=bold cterm=bold ctermfg=Yellow guifg=#ffff60 gui=bold
|
||||||
endif
|
endif
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
" vim: tw=0 ts=4 sw=4
|
" vim: tw=0 ts=4 sw=4
|
||||||
" Vim color file
|
" Vim color file
|
||||||
" Maintainer: Ron Aaron <ron@ronware.org>
|
" Maintainer: Ron Aaron <ron@ronware.org>
|
||||||
" Last Change: 2013 May 23
|
" Last Change: 2016 Sep 04
|
||||||
|
|
||||||
hi clear
|
hi clear
|
||||||
set background=dark
|
set background=dark
|
||||||
@ -45,6 +45,7 @@ hi TabLineFill term=bold,reverse cterm=bold ctermfg=lightblue ctermbg=white g
|
|||||||
hi TabLineSel term=reverse ctermfg=white ctermbg=lightblue guifg=white guibg=blue
|
hi TabLineSel term=reverse ctermfg=white ctermbg=lightblue guifg=white guibg=blue
|
||||||
hi Underlined term=underline cterm=bold,underline ctermfg=lightblue guifg=lightblue gui=bold,underline
|
hi Underlined term=underline cterm=bold,underline ctermfg=lightblue guifg=lightblue gui=bold,underline
|
||||||
hi Ignore ctermfg=black ctermbg=black guifg=black guibg=black
|
hi Ignore ctermfg=black ctermbg=black guifg=black guibg=black
|
||||||
|
hi EndOfBuffer term=bold cterm=bold ctermfg=darkred guifg=#cc0000 gui=bold
|
||||||
hi link IncSearch Visual
|
hi link IncSearch Visual
|
||||||
hi link String Constant
|
hi link String Constant
|
||||||
hi link Character Constant
|
hi link Character Constant
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Vim compiler file
|
" Vim compiler file
|
||||||
" Compiler: Cucumber
|
" Compiler: Cucumber
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2010 Aug 09
|
" Last Change: 2016 Aug 29
|
||||||
|
|
||||||
if exists("current_compiler")
|
if exists("current_compiler")
|
||||||
finish
|
finish
|
||||||
@ -19,7 +19,7 @@ CompilerSet makeprg=cucumber
|
|||||||
|
|
||||||
CompilerSet errorformat=
|
CompilerSet errorformat=
|
||||||
\%W%m\ (Cucumber::Undefined),
|
\%W%m\ (Cucumber::Undefined),
|
||||||
\%E%m\ (%.%#),
|
\%E%m\ (%\\S%#),
|
||||||
\%Z%f:%l,
|
\%Z%f:%l,
|
||||||
\%Z%f:%l:%.%#
|
\%Z%f:%l:%.%#
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Vim compiler file
|
" Vim compiler file
|
||||||
" Compiler: Haml
|
" Compiler: Haml
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2013 May 30
|
" Last Change: 2016 Aug 29
|
||||||
|
|
||||||
if exists("current_compiler")
|
if exists("current_compiler")
|
||||||
finish
|
finish
|
||||||
@ -15,7 +15,7 @@ endif
|
|||||||
let s:cpo_save = &cpo
|
let s:cpo_save = &cpo
|
||||||
set cpo-=C
|
set cpo-=C
|
||||||
|
|
||||||
CompilerSet makeprg=haml\ -c
|
CompilerSet makeprg=haml
|
||||||
|
|
||||||
CompilerSet errorformat=
|
CompilerSet errorformat=
|
||||||
\Haml\ %trror\ on\ line\ %l:\ %m,
|
\Haml\ %trror\ on\ line\ %l:\ %m,
|
||||||
|
@ -27,7 +27,11 @@ CompilerSet errorformat=
|
|||||||
\%\\s%#[%f:%l:\ %#%m,
|
\%\\s%#[%f:%l:\ %#%m,
|
||||||
\%\\s%#%f:%l:\ %#%m,
|
\%\\s%#%f:%l:\ %#%m,
|
||||||
\%\\s%#%f:%l:,
|
\%\\s%#%f:%l:,
|
||||||
\%m\ [%f:%l]:
|
\%m\ [%f:%l]:,
|
||||||
|
\%+Erake\ aborted!,
|
||||||
|
\%+EDon't\ know\ how\ to\ build\ task\ %.%#,
|
||||||
|
\%+Einvalid\ option:%.%#,
|
||||||
|
\%+Irake\ %\\S%\\+%\\s%\\+#\ %.%#
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
let &cpo = s:cpo_save
|
||||||
unlet s:cpo_save
|
unlet s:cpo_save
|
||||||
|
@ -22,9 +22,10 @@ CompilerSet errorformat=
|
|||||||
\%f:%l:\ %tarning:\ %m,
|
\%f:%l:\ %tarning:\ %m,
|
||||||
\%E%.%#:in\ `load':\ %f:%l:%m,
|
\%E%.%#:in\ `load':\ %f:%l:%m,
|
||||||
\%E%f:%l:in\ `%*[^']':\ %m,
|
\%E%f:%l:in\ `%*[^']':\ %m,
|
||||||
\%-Z\ \ \ \ \ \#\ %f:%l:%.%#,
|
\%-Z\ \ \ \ \ %\\+\#\ %f:%l:%.%#,
|
||||||
\%E\ \ %\\d%\\+)%.%#,
|
\%E\ \ %\\d%\\+)%.%#,
|
||||||
\%C\ \ \ \ \ %m,
|
\%C\ \ \ \ \ %m,
|
||||||
|
\%C%\\s%#,
|
||||||
\%-G%.%#
|
\%-G%.%#
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
let &cpo = s:cpo_save
|
||||||
|
@ -17,6 +17,8 @@ let s:cpo_save = &cpo
|
|||||||
set cpo-=C
|
set cpo-=C
|
||||||
|
|
||||||
CompilerSet makeprg=testrb
|
CompilerSet makeprg=testrb
|
||||||
|
" CompilerSet makeprg=ruby\ -Itest
|
||||||
|
" CompilerSet makeprg=m
|
||||||
|
|
||||||
CompilerSet errorformat=\%W\ %\\+%\\d%\\+)\ Failure:,
|
CompilerSet errorformat=\%W\ %\\+%\\d%\\+)\ Failure:,
|
||||||
\%C%m\ [%f:%l]:,
|
\%C%m\ [%f:%l]:,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Vim compiler file
|
" Vim compiler file
|
||||||
" Compiler: Sass
|
" Compiler: Sass
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2013 May 30
|
" Last Change: 2016 Aug 29
|
||||||
|
|
||||||
if exists("current_compiler")
|
if exists("current_compiler")
|
||||||
finish
|
finish
|
||||||
@ -15,7 +15,7 @@ endif
|
|||||||
let s:cpo_save = &cpo
|
let s:cpo_save = &cpo
|
||||||
set cpo-=C
|
set cpo-=C
|
||||||
|
|
||||||
CompilerSet makeprg=sass\ -c
|
CompilerSet makeprg=sass
|
||||||
|
|
||||||
CompilerSet errorformat=
|
CompilerSet errorformat=
|
||||||
\%f:%l:%m\ (Sass::Syntax%trror),
|
\%f:%l:%m\ (Sass::Syntax%trror),
|
||||||
|
@ -76,11 +76,15 @@ exception is that "<sfile>" is expanded when the autocmd is defined. Example:
|
|||||||
|
|
||||||
Here Vim expands <sfile> to the name of the file containing this line.
|
Here Vim expands <sfile> to the name of the file containing this line.
|
||||||
|
|
||||||
When your vimrc file is sourced twice, the autocommands will appear twice.
|
`:autocmd` adds to the list of autocommands regardless of whether they are
|
||||||
To avoid this, put this command in your vimrc file, before defining
|
already present. When your .vimrc file is sourced twice, the autocommands
|
||||||
autocommands: >
|
will appear twice. To avoid this, define your autocommands in a group, so
|
||||||
|
that you can easily clear them: >
|
||||||
|
|
||||||
:autocmd! " Remove ALL autocommands for the current group.
|
augroup vimrc
|
||||||
|
autocmd! " Remove all vimrc autocommands
|
||||||
|
au BufNewFile,BufRead *.html so <sfile>:h/html.vim
|
||||||
|
augroup END
|
||||||
|
|
||||||
If you don't want to remove all autocommands, you can instead use a variable
|
If you don't want to remove all autocommands, you can instead use a variable
|
||||||
to ensure that Vim includes the autocommands only once: >
|
to ensure that Vim includes the autocommands only once: >
|
||||||
@ -127,8 +131,13 @@ prompt. When one command outputs two messages this can happen anyway.
|
|||||||
|
|
||||||
:au[tocmd]! [group] {event}
|
:au[tocmd]! [group] {event}
|
||||||
Remove ALL autocommands for {event}.
|
Remove ALL autocommands for {event}.
|
||||||
|
Warning: You should not do this without a group for
|
||||||
|
|BufRead| and other common events, it can break
|
||||||
|
plugins, syntax highlighting, etc.
|
||||||
|
|
||||||
:au[tocmd]! [group] Remove ALL autocommands.
|
:au[tocmd]! [group] Remove ALL autocommands.
|
||||||
|
Warning: You should normally not do this without a
|
||||||
|
group, it breaks plugins, syntax highlighting, etc.
|
||||||
|
|
||||||
When the [group] argument is not given, Vim uses the current group (as defined
|
When the [group] argument is not given, Vim uses the current group (as defined
|
||||||
with ":augroup"); otherwise, Vim uses the group defined with [group].
|
with ":augroup"); otherwise, Vim uses the group defined with [group].
|
||||||
@ -422,8 +431,8 @@ BufUnload Before unloading a buffer. This is when the
|
|||||||
NOTE: When this autocommand is executed, the
|
NOTE: When this autocommand is executed, the
|
||||||
current buffer "%" may be different from the
|
current buffer "%" may be different from the
|
||||||
buffer being unloaded "<afile>".
|
buffer being unloaded "<afile>".
|
||||||
Don't change to another buffer, it will cause
|
Don't change to another buffer or window, it
|
||||||
problems.
|
will cause problems!
|
||||||
When exiting and v:dying is 2 or more this
|
When exiting and v:dying is 2 or more this
|
||||||
event is not triggered.
|
event is not triggered.
|
||||||
*BufWinEnter*
|
*BufWinEnter*
|
||||||
@ -794,7 +803,9 @@ QuickFixCmdPre Before a quickfix command is run (|:make|,
|
|||||||
|:vimgrepadd|, |:lvimgrepadd|, |:cscope|,
|
|:vimgrepadd|, |:lvimgrepadd|, |:cscope|,
|
||||||
|:cfile|, |:cgetfile|, |:caddfile|, |:lfile|,
|
|:cfile|, |:cgetfile|, |:caddfile|, |:lfile|,
|
||||||
|:lgetfile|, |:laddfile|, |:helpgrep|,
|
|:lgetfile|, |:laddfile|, |:helpgrep|,
|
||||||
|:lhelpgrep|).
|
|:lhelpgrep|, |:cexpr|, |:cgetexpr|,
|
||||||
|
|:caddexpr|, |:cbuffer|, |:cgetbuffer|,
|
||||||
|
|:caddbuffer|).
|
||||||
The pattern is matched against the command
|
The pattern is matched against the command
|
||||||
being run. When |:grep| is used but 'grepprg'
|
being run. When |:grep| is used but 'grepprg'
|
||||||
is set to "internal" it still matches "grep".
|
is set to "internal" it still matches "grep".
|
||||||
@ -1002,7 +1013,7 @@ WinLeave Before leaving a window. If the window to be
|
|||||||
|
|
||||||
*WinNew*
|
*WinNew*
|
||||||
WinNew When a new window was created. Not done for
|
WinNew When a new window was created. Not done for
|
||||||
the fist window, when Vim has just started.
|
the first window, when Vim has just started.
|
||||||
Before a WinEnter event.
|
Before a WinEnter event.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
@ -1086,6 +1097,9 @@ Note that for all systems the '/' character is used for path separator (even
|
|||||||
Windows). This was done because the backslash is difficult to use in a pattern
|
Windows). This was done because the backslash is difficult to use in a pattern
|
||||||
and to make the autocommands portable across different systems.
|
and to make the autocommands portable across different systems.
|
||||||
|
|
||||||
|
It is possible to use |pattern| items, but they may not work as expected,
|
||||||
|
because of the translation done for the above.
|
||||||
|
|
||||||
*autocmd-changes*
|
*autocmd-changes*
|
||||||
Matching with the pattern is done when an event is triggered. Changing the
|
Matching with the pattern is done when an event is triggered. Changing the
|
||||||
buffer name in one of the autocommands, or even deleting the buffer, does not
|
buffer name in one of the autocommands, or even deleting the buffer, does not
|
||||||
@ -1184,11 +1198,12 @@ name!
|
|||||||
different from existing {event} names, as this
|
different from existing {event} names, as this
|
||||||
most likely will not do what you intended.
|
most likely will not do what you intended.
|
||||||
|
|
||||||
*:augroup-delete* *E367* *W19*
|
*:augroup-delete* *E367* *W19* *E936*
|
||||||
:aug[roup]! {name} Delete the autocmd group {name}. Don't use
|
:aug[roup]! {name} Delete the autocmd group {name}. Don't use
|
||||||
this if there is still an autocommand using
|
this if there is still an autocommand using
|
||||||
this group! You will get a warning if doing
|
this group! You will get a warning if doing
|
||||||
it anyway.
|
it anyway. when the group is the current group
|
||||||
|
you will get error E936.
|
||||||
|
|
||||||
To enter autocommands for a specific group, use this method:
|
To enter autocommands for a specific group, use this method:
|
||||||
1. Select the group with ":augroup {name}".
|
1. Select the group with ":augroup {name}".
|
||||||
|
@ -833,6 +833,7 @@ The numbering of "\1", "\2" etc. is done based on which "\(" comes first in
|
|||||||
the pattern (going left to right). When a parentheses group matches several
|
the pattern (going left to right). When a parentheses group matches several
|
||||||
times, the last one will be used for "\1", "\2", etc. Example: >
|
times, the last one will be used for "\1", "\2", etc. Example: >
|
||||||
:s/\(\(a[a-d] \)*\)/\2/ modifies "aa ab x" to "ab x"
|
:s/\(\(a[a-d] \)*\)/\2/ modifies "aa ab x" to "ab x"
|
||||||
|
The "\2" is for "\(a[a-d] \)". At first it matches "aa ", secondly "ab ".
|
||||||
|
|
||||||
When using parentheses in combination with '|', like in \([ab]\)\|\([cd]\),
|
When using parentheses in combination with '|', like in \([ab]\)\|\([cd]\),
|
||||||
either the first or second pattern in parentheses did not match, so either
|
either the first or second pattern in parentheses did not match, so either
|
||||||
|
@ -219,9 +219,10 @@ CTRL-Y When there is a modeless selection, copy the selection into
|
|||||||
the clipboard. |modeless-selection|
|
the clipboard. |modeless-selection|
|
||||||
If there is no selection CTRL-Y is inserted as a character.
|
If there is no selection CTRL-Y is inserted as a character.
|
||||||
|
|
||||||
CTRL-J *c_CTRL-J* *c_<NL>* *c_<CR>* *c_CR*
|
CTRL-M or CTRL-J *c_CTRL-M* *c_CTRL-J* *c_<NL>* *c_<CR>* *c_CR*
|
||||||
<CR> or <NL> start entered command
|
<CR> or <NL> start entered command
|
||||||
*c_<Esc>* *c_Esc*
|
|
||||||
|
CTRL-[ *c_CTRL-[* *c_<Esc>* *c_Esc*
|
||||||
<Esc> When typed and 'x' not present in 'cpoptions', quit
|
<Esc> When typed and 'x' not present in 'cpoptions', quit
|
||||||
Command-line mode without executing. In macros or when 'x'
|
Command-line mode without executing. In macros or when 'x'
|
||||||
present in 'cpoptions', start entered command.
|
present in 'cpoptions', start entered command.
|
||||||
|
@ -160,7 +160,8 @@ start editing another file, Vim will refuse this. In order to overrule this
|
|||||||
protection, add a '!' to the command. The changes will then be lost. For
|
protection, add a '!' to the command. The changes will then be lost. For
|
||||||
example: ":q" will not work if the buffer was changed, but ":q!" will. To see
|
example: ":q" will not work if the buffer was changed, but ":q!" will. To see
|
||||||
whether the buffer was changed use the "CTRL-G" command. The message includes
|
whether the buffer was changed use the "CTRL-G" command. The message includes
|
||||||
the string "[Modified]" if the buffer has been changed.
|
the string "[Modified]" if the buffer has been changed, or "+" if the 'm' flag
|
||||||
|
is in 'shortmess'.
|
||||||
|
|
||||||
If you want to automatically save the changes without asking, switch on the
|
If you want to automatically save the changes without asking, switch on the
|
||||||
'autowriteall' option. 'autowrite' is the associated Vi-compatible option
|
'autowriteall' option. 'autowrite' is the associated Vi-compatible option
|
||||||
|
@ -107,7 +107,7 @@ To test for a non-empty string, use empty(): >
|
|||||||
*non-zero-arg*
|
*non-zero-arg*
|
||||||
Function arguments often behave slightly different from |TRUE|: If the
|
Function arguments often behave slightly different from |TRUE|: If the
|
||||||
argument is present and it evaluates to a non-zero Number, |v:true| or a
|
argument is present and it evaluates to a non-zero Number, |v:true| or a
|
||||||
non-empty String, then the value is considere to be TRUE.
|
non-empty String, then the value is considered to be TRUE.
|
||||||
Note that " " and "0" are also non-empty strings, thus cause the mode to be
|
Note that " " and "0" are also non-empty strings, thus cause the mode to be
|
||||||
cleared. A List, Dictionary or Float is not a Number or String, thus
|
cleared. A List, Dictionary or Float is not a Number or String, thus
|
||||||
evaluates to FALSE.
|
evaluates to FALSE.
|
||||||
@ -631,13 +631,17 @@ It's possible to form a variable name with curly braces, see
|
|||||||
|
|
||||||
Expression syntax summary, from least to most significant:
|
Expression syntax summary, from least to most significant:
|
||||||
|
|
||||||
|expr1| expr2 ? expr1 : expr1 if-then-else
|
|expr1| expr2
|
||||||
|
expr2 ? expr1 : expr1 if-then-else
|
||||||
|
|
||||||
|expr2| expr3 || expr3 .. logical OR
|
|expr2| expr3
|
||||||
|
expr3 || expr3 .. logical OR
|
||||||
|
|
||||||
|expr3| expr4 && expr4 .. logical AND
|
|expr3| expr4
|
||||||
|
expr4 && expr4 .. logical AND
|
||||||
|
|
||||||
|expr4| expr5 == expr5 equal
|
|expr4| expr5
|
||||||
|
expr5 == expr5 equal
|
||||||
expr5 != expr5 not equal
|
expr5 != expr5 not equal
|
||||||
expr5 > expr5 greater than
|
expr5 > expr5 greater than
|
||||||
expr5 >= expr5 greater than or equal
|
expr5 >= expr5 greater than or equal
|
||||||
@ -654,24 +658,28 @@ Expression syntax summary, from least to most significant:
|
|||||||
expr5 is expr5 same |List| instance
|
expr5 is expr5 same |List| instance
|
||||||
expr5 isnot expr5 different |List| instance
|
expr5 isnot expr5 different |List| instance
|
||||||
|
|
||||||
|expr5| expr6 + expr6 .. number addition or list concatenation
|
|expr5| expr6
|
||||||
|
expr6 + expr6 .. number addition or list concatenation
|
||||||
expr6 - expr6 .. number subtraction
|
expr6 - expr6 .. number subtraction
|
||||||
expr6 . expr6 .. string concatenation
|
expr6 . expr6 .. string concatenation
|
||||||
|
|
||||||
|expr6| expr7 * expr7 .. number multiplication
|
|expr6| expr7
|
||||||
|
expr7 * expr7 .. number multiplication
|
||||||
expr7 / expr7 .. number division
|
expr7 / expr7 .. number division
|
||||||
expr7 % expr7 .. number modulo
|
expr7 % expr7 .. number modulo
|
||||||
|
|
||||||
|expr7| ! expr7 logical NOT
|
|expr7| expr8
|
||||||
|
! expr7 logical NOT
|
||||||
- expr7 unary minus
|
- expr7 unary minus
|
||||||
+ expr7 unary plus
|
+ expr7 unary plus
|
||||||
|
|
||||||
|expr8| expr8[expr1] byte of a String or item of a |List|
|
|expr8| expr9
|
||||||
|
expr8[expr1] byte of a String or item of a |List|
|
||||||
expr8[expr1 : expr1] substring of a String or sublist of a |List|
|
expr8[expr1 : expr1] substring of a String or sublist of a |List|
|
||||||
expr8.name entry in a |Dictionary|
|
expr8.name entry in a |Dictionary|
|
||||||
expr8(expr1, ...) function call with |Funcref| variable
|
expr8(expr1, ...) function call with |Funcref| variable
|
||||||
|
|
||||||
|expr9| number number constant
|
|expr9| number number constant
|
||||||
"string" string constant, backslash is special
|
"string" string constant, backslash is special
|
||||||
'string' string constant, ' is doubled
|
'string' string constant, ' is doubled
|
||||||
[expr1, ...] |List|
|
[expr1, ...] |List|
|
||||||
@ -931,7 +939,7 @@ expr8[expr1] item of String or |List| *expr-[]* *E111*
|
|||||||
|
|
||||||
If expr8 is a Number or String this results in a String that contains the
|
If expr8 is a Number or String this results in a String that contains the
|
||||||
expr1'th single byte from expr8. expr8 is used as a String, expr1 as a
|
expr1'th single byte from expr8. expr8 is used as a String, expr1 as a
|
||||||
Number. This doesn't recognize multi-byte encodings, see |byteidx()| for
|
Number. This doesn't recognize multi-byte encodings, see `byteidx()` for
|
||||||
an alternative, or use `split()` to turn the string into a list of characters.
|
an alternative, or use `split()` to turn the string into a list of characters.
|
||||||
|
|
||||||
Index zero gives the first byte. This is like it works in C. Careful:
|
Index zero gives the first byte. This is like it works in C. Careful:
|
||||||
@ -1214,7 +1222,7 @@ The arguments are optional. Example: >
|
|||||||
< error function
|
< error function
|
||||||
*closure*
|
*closure*
|
||||||
Lambda expressions can access outer scope variables and arguments. This is
|
Lambda expressions can access outer scope variables and arguments. This is
|
||||||
often called a closure. Example where "i" a and "a:arg" are used in a lambda
|
often called a closure. Example where "i" and "a:arg" are used in a lambda
|
||||||
while they exist in the function scope. They remain valid even after the
|
while they exist in the function scope. They remain valid even after the
|
||||||
function returns: >
|
function returns: >
|
||||||
:function Foo(arg)
|
:function Foo(arg)
|
||||||
@ -1233,7 +1241,7 @@ Examples for using a lambda expression with |sort()|, |map()| and |filter()|: >
|
|||||||
:echo sort([3,7,2,1,4], {a, b -> a - b})
|
:echo sort([3,7,2,1,4], {a, b -> a - b})
|
||||||
< [1, 2, 3, 4, 7]
|
< [1, 2, 3, 4, 7]
|
||||||
|
|
||||||
The lambda expression is also useful for Channel, Job and timer: >
|
The lambda expression is also useful for jobs and timers: >
|
||||||
:let timer = timer_start(500,
|
:let timer = timer_start(500,
|
||||||
\ {-> execute("echo 'Handler called'", "")},
|
\ {-> execute("echo 'Handler called'", "")},
|
||||||
\ {'repeat': 3})
|
\ {'repeat': 3})
|
||||||
@ -2023,8 +2031,8 @@ expand({expr} [, {nosuf} [, {list}]])
|
|||||||
feedkeys({string} [, {mode}]) Number add key sequence to typeahead buffer
|
feedkeys({string} [, {mode}]) Number add key sequence to typeahead buffer
|
||||||
filereadable({file}) Number |TRUE| if {file} is a readable file
|
filereadable({file}) Number |TRUE| if {file} is a readable file
|
||||||
filewritable({file}) Number |TRUE| if {file} is a writable file
|
filewritable({file}) Number |TRUE| if {file} is a writable file
|
||||||
filter({expr}, {string}) List/Dict remove items from {expr} where
|
filter({expr1}, {expr2}) List/Dict remove items from {expr1} where
|
||||||
{string} is 0
|
{expr2} is 0
|
||||||
finddir({name}[, {path}[, {count}]])
|
finddir({name}[, {path}[, {count}]])
|
||||||
String find directory {name} in {path}
|
String find directory {name} in {path}
|
||||||
findfile({name}[, {path}[, {count}]])
|
findfile({name}[, {path}[, {count}]])
|
||||||
@ -2048,7 +2056,7 @@ garbagecollect([{atexit}]) none free memory, breaking cyclic references
|
|||||||
get({list}, {idx} [, {def}]) any get item {idx} from {list} or {def}
|
get({list}, {idx} [, {def}]) any get item {idx} from {list} or {def}
|
||||||
get({dict}, {key} [, {def}]) any get item {key} from {dict} or {def}
|
get({dict}, {key} [, {def}]) any get item {key} from {dict} or {def}
|
||||||
get({func}, {what}) any get property of funcref/partial {func}
|
get({func}, {what}) any get property of funcref/partial {func}
|
||||||
getbufinfo( [{expr}]) List information about buffers
|
getbufinfo([{expr}]) List information about buffers
|
||||||
getbufline({expr}, {lnum} [, {end}])
|
getbufline({expr}, {lnum} [, {end}])
|
||||||
List lines {lnum} to {end} of buffer {expr}
|
List lines {lnum} to {end} of buffer {expr}
|
||||||
getbufvar({expr}, {varname} [, {def}])
|
getbufvar({expr}, {varname} [, {def}])
|
||||||
@ -2147,7 +2155,7 @@ lispindent({lnum}) Number Lisp indent for line {lnum}
|
|||||||
localtime() Number current time
|
localtime() Number current time
|
||||||
log({expr}) Float natural logarithm (base e) of {expr}
|
log({expr}) Float natural logarithm (base e) of {expr}
|
||||||
log10({expr}) Float logarithm of Float {expr} to base 10
|
log10({expr}) Float logarithm of Float {expr} to base 10
|
||||||
map({expr}, {string}) List/Dict change each item in {expr} to {expr}
|
map({expr1}, {expr2}) List/Dict change each item in {expr1} to {expr}
|
||||||
maparg({name}[, {mode} [, {abbr} [, {dict}]]])
|
maparg({name}[, {mode} [, {abbr} [, {dict}]]])
|
||||||
String or Dict
|
String or Dict
|
||||||
rhs of mapping {name} in mode {mode}
|
rhs of mapping {name} in mode {mode}
|
||||||
@ -3044,6 +3052,8 @@ delete({fname} [, {flags}]) *delete()*
|
|||||||
|
|
||||||
When {flags} is "rf": Deletes the directory by the name
|
When {flags} is "rf": Deletes the directory by the name
|
||||||
{fname} and everything in it, recursively. BE CAREFUL!
|
{fname} and everything in it, recursively. BE CAREFUL!
|
||||||
|
Note: on MS-Windows it is not possible to delete a directory
|
||||||
|
that is being used.
|
||||||
|
|
||||||
The result is a Number, which is 0 if the delete operation was
|
The result is a Number, which is 0 if the delete operation was
|
||||||
successful and -1 when the deletion failed or partly failed.
|
successful and -1 when the deletion failed or partly failed.
|
||||||
@ -3478,9 +3488,10 @@ filter({expr1}, {expr2}) *filter()*
|
|||||||
is zero remove the item from the |List| or |Dictionary|.
|
is zero remove the item from the |List| or |Dictionary|.
|
||||||
{expr2} must be a |string| or |Funcref|.
|
{expr2} must be a |string| or |Funcref|.
|
||||||
|
|
||||||
if {expr2} is a |string|, inside {expr2} |v:val| has the value
|
If {expr2} is a |string|, inside {expr2} |v:val| has the value
|
||||||
of the current item. For a |Dictionary| |v:key| has the key
|
of the current item. For a |Dictionary| |v:key| has the key
|
||||||
of the current item.
|
of the current item and for a |List| |v:key| has the index of
|
||||||
|
the current item.
|
||||||
For a |Dictionary| |v:key| has the key of the current item.
|
For a |Dictionary| |v:key| has the key of the current item.
|
||||||
Examples: >
|
Examples: >
|
||||||
call filter(mylist, 'v:val !~ "OLD"')
|
call filter(mylist, 'v:val !~ "OLD"')
|
||||||
@ -3503,6 +3514,10 @@ filter({expr1}, {expr2}) *filter()*
|
|||||||
return a:idx % 2 == 1
|
return a:idx % 2 == 1
|
||||||
endfunc
|
endfunc
|
||||||
call filter(mylist, function('Odd'))
|
call filter(mylist, function('Odd'))
|
||||||
|
< It is shorter when using a |lambda|: >
|
||||||
|
call filter(myList, {idx, val -> idx * val <= 42})
|
||||||
|
< If you do not use "val" you can leave it out: >
|
||||||
|
call filter(myList, {idx -> idx % 2 == 1})
|
||||||
<
|
<
|
||||||
The operation is done in-place. If you want a |List| or
|
The operation is done in-place. If you want a |List| or
|
||||||
|Dictionary| to remain unmodified make a copy first: >
|
|Dictionary| to remain unmodified make a copy first: >
|
||||||
@ -4538,6 +4553,7 @@ histadd({history}, {item}) *histadd()*
|
|||||||
"expr" or "=" typed expression history
|
"expr" or "=" typed expression history
|
||||||
"input" or "@" input line history
|
"input" or "@" input line history
|
||||||
"debug" or ">" debug command history
|
"debug" or ">" debug command history
|
||||||
|
empty the current or last used history
|
||||||
The {history} string does not need to be the whole name, one
|
The {history} string does not need to be the whole name, one
|
||||||
character is sufficient.
|
character is sufficient.
|
||||||
If {item} does already exist in the history, it will be
|
If {item} does already exist in the history, it will be
|
||||||
@ -5140,6 +5156,10 @@ map({expr1}, {expr2}) *map()*
|
|||||||
return a:key . '-' . a:val
|
return a:key . '-' . a:val
|
||||||
endfunc
|
endfunc
|
||||||
call map(myDict, function('KeyValue'))
|
call map(myDict, function('KeyValue'))
|
||||||
|
< It is shorter when using a |lambda|: >
|
||||||
|
call map(myDict, {key, val -> key . '-' . val})
|
||||||
|
< If you do not use "val" you can leave it out: >
|
||||||
|
call map(myDict, {key -> 'item: ' . key})
|
||||||
<
|
<
|
||||||
The operation is done in-place. If you want a |List| or
|
The operation is done in-place. If you want a |List| or
|
||||||
|Dictionary| to remain unmodified make a copy first: >
|
|Dictionary| to remain unmodified make a copy first: >
|
||||||
@ -6167,7 +6187,7 @@ rpcstop({channel}) {Nvim} *rpcstop()*
|
|||||||
connecting to |v:servername|.
|
connecting to |v:servername|.
|
||||||
|
|
||||||
screenattr(row, col) *screenattr()*
|
screenattr(row, col) *screenattr()*
|
||||||
Like screenchar(), but return the attribute. This is a rather
|
Like |screenchar()|, but return the attribute. This is a rather
|
||||||
arbitrary number that can only be used to compare to the
|
arbitrary number that can only be used to compare to the
|
||||||
attribute at other positions.
|
attribute at other positions.
|
||||||
|
|
||||||
@ -7579,13 +7599,14 @@ timer_start({time}, {callback} [, {options}])
|
|||||||
busy or Vim is not waiting for input the time will be longer.
|
busy or Vim is not waiting for input the time will be longer.
|
||||||
|
|
||||||
{callback} is the function to call. It can be the name of a
|
{callback} is the function to call. It can be the name of a
|
||||||
function or a Funcref. It is called with one argument, which
|
function or a |Funcref|. It is called with one argument, which
|
||||||
is the timer ID. The callback is only invoked when Vim is
|
is the timer ID. The callback is only invoked when Vim is
|
||||||
waiting for input.
|
waiting for input.
|
||||||
|
|
||||||
{options} is a dictionary. Supported entries:
|
{options} is a dictionary. Supported entries:
|
||||||
"repeat" Number of times to repeat calling the
|
"repeat" Number of times to repeat calling the
|
||||||
callback. -1 means forever.
|
callback. -1 means forever. When not present
|
||||||
|
the callback will be called once.
|
||||||
|
|
||||||
Example: >
|
Example: >
|
||||||
func MyHandler(timer)
|
func MyHandler(timer)
|
||||||
|
@ -565,6 +565,17 @@ These maps can be disabled with >
|
|||||||
:let g:no_pdf_maps = 1
|
:let g:no_pdf_maps = 1
|
||||||
<
|
<
|
||||||
|
|
||||||
|
PYTHON *ft-python-plugin* *PEP8*
|
||||||
|
|
||||||
|
By default the following options are set, in accordance with PEP8: >
|
||||||
|
|
||||||
|
setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8
|
||||||
|
|
||||||
|
To disable this behaviour, set the following variable in your vimrc: >
|
||||||
|
|
||||||
|
let g:python_recommended_style = 0
|
||||||
|
|
||||||
|
|
||||||
RPM SPEC *ft-spec-plugin*
|
RPM SPEC *ft-spec-plugin*
|
||||||
|
|
||||||
Since the text for this plugin is rather long it has been put in a separate
|
Since the text for this plugin is rather long it has been put in a separate
|
||||||
|
@ -48,7 +48,11 @@ Example: >
|
|||||||
print 'EAT ME'
|
print 'EAT ME'
|
||||||
EOF
|
EOF
|
||||||
endfunction
|
endfunction
|
||||||
<
|
|
||||||
|
To see what version of Python you have: >
|
||||||
|
:python import sys
|
||||||
|
:python print(sys.version)
|
||||||
|
|
||||||
Note: Python is very sensitive to the indenting. Make sure the "class" line
|
Note: Python is very sensitive to the indenting. Make sure the "class" line
|
||||||
and "EOF" do not have any indent.
|
and "EOF" do not have any indent.
|
||||||
|
|
||||||
@ -692,6 +696,10 @@ functions to evaluate Python expressions and pass their values to VimL.
|
|||||||
The `:py3` and `:python3` commands work similar to `:python`. A simple check
|
The `:py3` and `:python3` commands work similar to `:python`. A simple check
|
||||||
if the `:py3` command is working: >
|
if the `:py3` command is working: >
|
||||||
:py3 print("Hello")
|
:py3 print("Hello")
|
||||||
|
|
||||||
|
To see what version of Python you have: >
|
||||||
|
:py3 import sys
|
||||||
|
:py3 print(sys.version)
|
||||||
< *:py3file*
|
< *:py3file*
|
||||||
The `:py3file` command works similar to `:pyfile`.
|
The `:py3file` command works similar to `:pyfile`.
|
||||||
*:py3do*
|
*:py3do*
|
||||||
|
@ -54,6 +54,9 @@ Example Vim script: >
|
|||||||
EOF
|
EOF
|
||||||
endfunction
|
endfunction
|
||||||
<
|
<
|
||||||
|
To see what version of Ruby you have: >
|
||||||
|
:ruby print RUBY_VERSION
|
||||||
|
<
|
||||||
|
|
||||||
*:rubydo* *:rubyd* *E265*
|
*:rubydo* *:rubyd* *E265*
|
||||||
:[range]rubyd[o] {cmd} Evaluate Ruby command {cmd} for each line in the
|
:[range]rubyd[o] {cmd} Evaluate Ruby command {cmd} for each line in the
|
||||||
|
@ -982,7 +982,7 @@ tag command action in Command-line editing mode ~
|
|||||||
|c_CTRL-E| CTRL-E cursor to end of command-line
|
|c_CTRL-E| CTRL-E cursor to end of command-line
|
||||||
|'cedit'| CTRL-F default value for 'cedit': opens the
|
|'cedit'| CTRL-F default value for 'cedit': opens the
|
||||||
command-line window; otherwise not used
|
command-line window; otherwise not used
|
||||||
CTRL-G not used
|
|c_CTRL-G| CTRL-G next match when 'incsearch' is active
|
||||||
|c_<BS>| <BS> delete the character in front of the cursor
|
|c_<BS>| <BS> delete the character in front of the cursor
|
||||||
|c_digraph| {char1} <BS> {char2}
|
|c_digraph| {char1} <BS> {char2}
|
||||||
enter digraph when 'digraph' is on
|
enter digraph when 'digraph' is on
|
||||||
@ -1000,7 +1000,7 @@ tag command action in Command-line editing mode ~
|
|||||||
|c_CTRL-L| CTRL-L do completion on the pattern in front of the
|
|c_CTRL-L| CTRL-L do completion on the pattern in front of the
|
||||||
cursor and insert the longest common part
|
cursor and insert the longest common part
|
||||||
|c_<CR>| <CR> execute entered command
|
|c_<CR>| <CR> execute entered command
|
||||||
|c_<CR>| CTRL-M same as <CR>
|
|c_CTRL-M| CTRL-M same as <CR>
|
||||||
|c_CTRL-N| CTRL-N after using 'wildchar' with multiple matches:
|
|c_CTRL-N| CTRL-N after using 'wildchar' with multiple matches:
|
||||||
go to next match, otherwise: same as <Down>
|
go to next match, otherwise: same as <Down>
|
||||||
CTRL-O not used
|
CTRL-O not used
|
||||||
@ -1015,7 +1015,7 @@ tag command action in Command-line editing mode ~
|
|||||||
insert the contents of a register or object
|
insert the contents of a register or object
|
||||||
under the cursor literally
|
under the cursor literally
|
||||||
CTRL-S (used for terminal control flow)
|
CTRL-S (used for terminal control flow)
|
||||||
CTRL-T not used
|
|c_CTRL-T| CTRL-T previous match when 'incsearch' is active
|
||||||
|c_CTRL-U| CTRL-U remove all characters
|
|c_CTRL-U| CTRL-U remove all characters
|
||||||
|c_CTRL-V| CTRL-V insert next non-digit literally, insert three
|
|c_CTRL-V| CTRL-V insert next non-digit literally, insert three
|
||||||
digit decimal number as a single byte.
|
digit decimal number as a single byte.
|
||||||
@ -1024,7 +1024,7 @@ tag command action in Command-line editing mode ~
|
|||||||
CTRL-Y copy (yank) modeless selection
|
CTRL-Y copy (yank) modeless selection
|
||||||
CTRL-Z not used (reserved for suspend)
|
CTRL-Z not used (reserved for suspend)
|
||||||
|c_<Esc>| <Esc> abandon command-line without executing it
|
|c_<Esc>| <Esc> abandon command-line without executing it
|
||||||
|c_<Esc>| CTRL-[ same as <Esc>
|
|c_CTRL-[| CTRL-[ same as <Esc>
|
||||||
|c_CTRL-\_CTRL-N| CTRL-\ CTRL-N go to Normal mode, abandon command-line
|
|c_CTRL-\_CTRL-N| CTRL-\ CTRL-N go to Normal mode, abandon command-line
|
||||||
|c_CTRL-\_CTRL-G| CTRL-\ CTRL-G go to mode specified with 'insertmode',
|
|c_CTRL-\_CTRL-G| CTRL-\ CTRL-G go to mode specified with 'insertmode',
|
||||||
abandon command-line
|
abandon command-line
|
||||||
|
@ -126,10 +126,7 @@ http://www.vim.org/maillist.php
|
|||||||
|
|
||||||
Bug reports: *bugs* *bug-reports* *bugreport.vim*
|
Bug reports: *bugs* *bug-reports* *bugreport.vim*
|
||||||
|
|
||||||
Send bug reports to: Vim Developers <vim-dev@vim.org>
|
Report bugs on GitHub: https://github.com/neovim/neovim/issues
|
||||||
This is a maillist, you need to become a member first and many people will see
|
|
||||||
the message. If you don't want that, e.g. because it is a security issue,
|
|
||||||
send it to <bugs@vim.org>, this only goes to the Vim maintainer (that's Bram).
|
|
||||||
|
|
||||||
Please be brief; all the time that is spent on answering mail is subtracted
|
Please be brief; all the time that is spent on answering mail is subtracted
|
||||||
from the time that is spent on improving Vim! Always give a reproducible
|
from the time that is spent on improving Vim! Always give a reproducible
|
||||||
|
@ -437,6 +437,9 @@ with a space.
|
|||||||
Note: When using mappings for Visual mode, you can use the "'<" mark, which
|
Note: When using mappings for Visual mode, you can use the "'<" mark, which
|
||||||
is the start of the last selected Visual area in the current buffer |'<|.
|
is the start of the last selected Visual area in the current buffer |'<|.
|
||||||
|
|
||||||
|
The |:filter| command can be used to select what mappings to list. The
|
||||||
|
pattern is matched against the {lhs} and {rhs} in the raw form.
|
||||||
|
|
||||||
*:map-verbose*
|
*:map-verbose*
|
||||||
When 'verbose' is non-zero, listing a key map will also display where it was
|
When 'verbose' is non-zero, listing a key map will also display where it was
|
||||||
last defined. Example: >
|
last defined. Example: >
|
||||||
@ -1136,6 +1139,10 @@ scripts.
|
|||||||
" Command has the -register attribute
|
" Command has the -register attribute
|
||||||
b Command is local to current buffer
|
b Command is local to current buffer
|
||||||
(see below for details on attributes)
|
(see below for details on attributes)
|
||||||
|
The list can be filtered on command name with
|
||||||
|
|:filter|, e.g., to list all commands with "Pyth" in
|
||||||
|
the name: >
|
||||||
|
filter Pyth command
|
||||||
|
|
||||||
:com[mand] {cmd} List the user-defined commands that start with {cmd}
|
:com[mand] {cmd} List the user-defined commands that start with {cmd}
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ back.
|
|||||||
Note: If the output has been stopped with "q" at the more prompt, it will only
|
Note: If the output has been stopped with "q" at the more prompt, it will only
|
||||||
be displayed up to this point.
|
be displayed up to this point.
|
||||||
The previous command output is cleared when another command produces output.
|
The previous command output is cleared when another command produces output.
|
||||||
|
The "g<" output is not redirected.
|
||||||
|
|
||||||
If you want to find help on a specific (error) message, use the ID at the
|
If you want to find help on a specific (error) message, use the ID at the
|
||||||
start of the message. For example, to get help on the message: >
|
start of the message. For example, to get help on the message: >
|
||||||
|
@ -10,7 +10,7 @@ Options *options*
|
|||||||
2. Automatically setting options |auto-setting|
|
2. Automatically setting options |auto-setting|
|
||||||
3. Options summary |option-summary|
|
3. Options summary |option-summary|
|
||||||
|
|
||||||
For an overview of options see help.txt |option-list|.
|
For an overview of options see quickref.txt |option-list|.
|
||||||
|
|
||||||
Vim has a number of internal variables and switches which can be set to
|
Vim has a number of internal variables and switches which can be set to
|
||||||
achieve special effects. These options come in three forms:
|
achieve special effects. These options come in three forms:
|
||||||
@ -2092,7 +2092,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
uhex Show unprintable characters hexadecimal as <xx>
|
uhex Show unprintable characters hexadecimal as <xx>
|
||||||
instead of using ^C and ~C.
|
instead of using ^C and ~C.
|
||||||
|
|
||||||
When neither "lastline" or "truncate" is included, a last line that
|
When neither "lastline" nor "truncate" is included, a last line that
|
||||||
doesn't fit is replaced with "@" lines.
|
doesn't fit is replaced with "@" lines.
|
||||||
|
|
||||||
*'eadirection'* *'ead'*
|
*'eadirection'* *'ead'*
|
||||||
@ -2219,10 +2219,15 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'exrc'* *'ex'* *'noexrc'* *'noex'*
|
*'exrc'* *'ex'* *'noexrc'* *'noex'*
|
||||||
'exrc' 'ex' boolean (default off)
|
'exrc' 'ex' boolean (default off)
|
||||||
global
|
global
|
||||||
Enables the reading of .nvimrc and .exrc in the current directory.
|
Enables the reading of .vimrc and .exrc in the current directory.
|
||||||
If you switch this option on you should also consider setting the
|
Setting this option is a potential security leak. E.g., consider
|
||||||
'secure' option (see |initialization|). Using this option comes
|
unpacking a package or fetching files from github, a .vimrc in there
|
||||||
with a potential security risk, use with care!
|
might be a trojan horse. BETTER NOT SET THIS OPTION!
|
||||||
|
Instead, define an autocommand in your .vimrc to set options for a
|
||||||
|
matching directory.
|
||||||
|
|
||||||
|
If you do switch this option on you should also consider setting the
|
||||||
|
'secure' option (see |initialization|).
|
||||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||||
security reasons.
|
security reasons.
|
||||||
Also see |init.vim| and |gui-init|.
|
Also see |init.vim| and |gui-init|.
|
||||||
@ -3426,6 +3431,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
original position when no match is found and when pressing <Esc>. You
|
original position when no match is found and when pressing <Esc>. You
|
||||||
still need to finish the search command with <Enter> to move the
|
still need to finish the search command with <Enter> to move the
|
||||||
cursor to the match.
|
cursor to the match.
|
||||||
|
You can use the CTRL-G and CTRL-T keys to move to the next and
|
||||||
|
previous match. |c_CTRL-G| |c_CTRL-T|
|
||||||
Vim only searches for about half a second. With a complicated
|
Vim only searches for about half a second. With a complicated
|
||||||
pattern and/or a lot of text the match may not be found. This is to
|
pattern and/or a lot of text the match may not be found. This is to
|
||||||
avoid that Vim hangs while you are typing the pattern.
|
avoid that Vim hangs while you are typing the pattern.
|
||||||
@ -3915,10 +3922,11 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
global
|
global
|
||||||
Changes the special characters that can be used in search patterns.
|
Changes the special characters that can be used in search patterns.
|
||||||
See |pattern|.
|
See |pattern|.
|
||||||
NOTE: To avoid portability problems with using patterns, always keep
|
WARNING: Switching this option off most likely breaks plugins! That
|
||||||
this option at the default "on". Only switch it off when working with
|
is because many patterns assume it's on and will fail when it's off.
|
||||||
old Vi scripts. In any other situation write patterns that work when
|
Only switch it off when working with old Vi scripts. In any other
|
||||||
'magic' is on. Include "\M" when you want to |/\M|.
|
situation write patterns that work when 'magic' is on. Include "\M"
|
||||||
|
when you want to |/\M|.
|
||||||
|
|
||||||
*'makeef'* *'mef'*
|
*'makeef'* *'mef'*
|
||||||
'makeef' 'mef' string (default: "")
|
'makeef' 'mef' string (default: "")
|
||||||
@ -4884,7 +4892,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
ordering. This is for preferences to overrule or add to the
|
ordering. This is for preferences to overrule or add to the
|
||||||
distributed defaults or system-wide settings (rarely needed).
|
distributed defaults or system-wide settings (rarely needed).
|
||||||
|
|
||||||
More entries are added when using |packages|.
|
More entries are added when using |packages|. If it gets very long
|
||||||
|
then `:set rtp` will be truncated, use `:echo &rtp` to see the full
|
||||||
|
string.
|
||||||
|
|
||||||
Note that, unlike 'path', no wildcards like "**" are allowed. Normal
|
Note that, unlike 'path', no wildcards like "**" are allowed. Normal
|
||||||
wildcards are allowed, but can significantly slow down searching for
|
wildcards are allowed, but can significantly slow down searching for
|
||||||
|
@ -354,8 +354,8 @@ For starters, read chapter 27 of the user manual |usr_27.txt|.
|
|||||||
*/\%#=* *two-engines* *NFA*
|
*/\%#=* *two-engines* *NFA*
|
||||||
Vim includes two regexp engines:
|
Vim includes two regexp engines:
|
||||||
1. An old, backtracking engine that supports everything.
|
1. An old, backtracking engine that supports everything.
|
||||||
2. A new, NFA engine that works much faster on some patterns, but does not
|
2. A new, NFA engine that works much faster on some patterns, possibly slower
|
||||||
support everything.
|
on some patterns.
|
||||||
|
|
||||||
Vim will automatically select the right engine for you. However, if you run
|
Vim will automatically select the right engine for you. However, if you run
|
||||||
into a problem or want to specifically select one engine or the other, you can
|
into a problem or want to specifically select one engine or the other, you can
|
||||||
|
@ -530,7 +530,7 @@ variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to
|
|||||||
let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"'
|
let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"'
|
||||||
<
|
<
|
||||||
(note: it has been reported that windows 7 with putty v0.6's "-batch" option
|
(note: it has been reported that windows 7 with putty v0.6's "-batch" option
|
||||||
doesn't work, so its best to leave it off for that system)
|
doesn't work, so it's best to leave it off for that system)
|
||||||
|
|
||||||
See |netrw-p8| for more about putty, pscp, psftp, etc.
|
See |netrw-p8| for more about putty, pscp, psftp, etc.
|
||||||
|
|
||||||
@ -1204,7 +1204,7 @@ The :NetrwMB command is available outside of netrw buffers (once netrw has been
|
|||||||
invoked in the session).
|
invoked in the session).
|
||||||
|
|
||||||
The file ".netrwbook" holds bookmarks when netrw (and vim) is not active. By
|
The file ".netrwbook" holds bookmarks when netrw (and vim) is not active. By
|
||||||
default, its stored on the first directory on the user's |'runtimepath'|.
|
default, it's stored on the first directory on the user's |'runtimepath'|.
|
||||||
|
|
||||||
Related Topics:
|
Related Topics:
|
||||||
|netrw-gb| how to return (go) to a bookmark
|
|netrw-gb| how to return (go) to a bookmark
|
||||||
@ -1429,7 +1429,7 @@ be used in that count.
|
|||||||
*.netrwhist*
|
*.netrwhist*
|
||||||
See |g:netrw_dirhistmax| for how to control the quantity of history stack
|
See |g:netrw_dirhistmax| for how to control the quantity of history stack
|
||||||
slots. The file ".netrwhist" holds history when netrw (and vim) is not
|
slots. The file ".netrwhist" holds history when netrw (and vim) is not
|
||||||
active. By default, its stored on the first directory on the user's
|
active. By default, it's stored on the first directory on the user's
|
||||||
|'runtimepath'|.
|
|'runtimepath'|.
|
||||||
|
|
||||||
Related Topics:
|
Related Topics:
|
||||||
@ -3269,7 +3269,7 @@ The user function is passed one argument; it resembles >
|
|||||||
|
|
||||||
fun! ExampleUserMapFunc(islocal)
|
fun! ExampleUserMapFunc(islocal)
|
||||||
<
|
<
|
||||||
where a:islocal is 1 if its a local-directory system call or 0 when
|
where a:islocal is 1 if it's a local-directory system call or 0 when
|
||||||
remote-directory system call.
|
remote-directory system call.
|
||||||
|
|
||||||
Use netrw#Expose("varname") to access netrw-internal (script-local)
|
Use netrw#Expose("varname") to access netrw-internal (script-local)
|
||||||
@ -3593,7 +3593,7 @@ Example: Clear netrw's marked file list via a mapping on gu >
|
|||||||
|
|
||||||
*netrw-p16*
|
*netrw-p16*
|
||||||
P16. When editing remote files (ex. :e ftp://hostname/path/file),
|
P16. When editing remote files (ex. :e ftp://hostname/path/file),
|
||||||
under Windows I get an |E303| message complaining that its unable
|
under Windows I get an |E303| message complaining that it's unable
|
||||||
to open a swap file.
|
to open a swap file.
|
||||||
|
|
||||||
(romainl) It looks like you are starting Vim from a protected
|
(romainl) It looks like you are starting Vim from a protected
|
||||||
@ -3647,7 +3647,7 @@ Example: Clear netrw's marked file list via a mapping on gu >
|
|||||||
P21. I've made a directory (or file) with an accented character, but
|
P21. I've made a directory (or file) with an accented character, but
|
||||||
netrw isn't letting me enter that directory/read that file:
|
netrw isn't letting me enter that directory/read that file:
|
||||||
|
|
||||||
Its likely that the shell or o/s is using a different encoding
|
It's likely that the shell or o/s is using a different encoding
|
||||||
than you have vim (netrw) using. A patch to vim supporting
|
than you have vim (netrw) using. A patch to vim supporting
|
||||||
"systemencoding" may address this issue in the future; for
|
"systemencoding" may address this issue in the future; for
|
||||||
now, just have netrw use the proper encoding. For example: >
|
now, just have netrw use the proper encoding. For example: >
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
Author: Charles E. Campbell <NdrOchip@ScampbellPfamily.AbizM>
|
Author: Charles E. Campbell <NdrOchip@ScampbellPfamily.AbizM>
|
||||||
(remove NOSPAM from Campbell's email first)
|
(remove NOSPAM from Campbell's email first)
|
||||||
Copyright: Copyright (C) 2005-2012 Charles E Campbell *zip-copyright*
|
Copyright: Copyright (C) 2005-2015 Charles E Campbell *zip-copyright*
|
||||||
The VIM LICENSE (see |copyright|) applies to the files in this
|
The VIM LICENSE (see |copyright|) applies to the files in this
|
||||||
package, including zipPlugin.vim, zip.vim, and pi_zip.vim. except use
|
package, including zipPlugin.vim, zip.vim, and pi_zip.vim. except use
|
||||||
"zip.vim" instead of "VIM". Like anything else that's free, zip.vim
|
"zip.vim" instead of "VIM". Like anything else that's free, zip.vim
|
||||||
@ -33,6 +33,9 @@ Copyright: Copyright (C) 2005-2012 Charles E Campbell *zip-copyright*
|
|||||||
also write to the file. Currently, one may not make a new file in
|
also write to the file. Currently, one may not make a new file in
|
||||||
zip archives via the plugin.
|
zip archives via the plugin.
|
||||||
|
|
||||||
|
*zip-x*
|
||||||
|
x : may extract a listed file when the cursor is atop it
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
|
|
||||||
*g:zip_nomax*
|
*g:zip_nomax*
|
||||||
@ -60,6 +63,11 @@ Copyright: Copyright (C) 2005-2012 Charles E Campbell *zip-copyright*
|
|||||||
It's used during the writing (updating) of a file already in a zip
|
It's used during the writing (updating) of a file already in a zip
|
||||||
file; by default: >
|
file; by default: >
|
||||||
let g:zip_zipcmd= "zip"
|
let g:zip_zipcmd= "zip"
|
||||||
|
<
|
||||||
|
*g:zip_extractcmd*
|
||||||
|
This option specifies the program (and any options needed) used to
|
||||||
|
extract a file from a zip archive. By default, >
|
||||||
|
let g:zip_extractcmd= g:zip_unzipcmd
|
||||||
<
|
<
|
||||||
PREVENTING LOADING~
|
PREVENTING LOADING~
|
||||||
|
|
||||||
@ -83,8 +91,26 @@ Copyright: Copyright (C) 2005-2012 Charles E Campbell *zip-copyright*
|
|||||||
One can simply extend this line to accommodate additional extensions that
|
One can simply extend this line to accommodate additional extensions that
|
||||||
should be treated as zip files.
|
should be treated as zip files.
|
||||||
|
|
||||||
|
Alternatively, one may change *g:zipPlugin_ext* in one's .vimrc.
|
||||||
|
Currently (11/30/15) it holds: >
|
||||||
|
|
||||||
|
let g:zipPlugin_ext= '*.zip,*.jar,*.xpi,*.ja,*.war,*.ear,*.celzip,
|
||||||
|
\ *.oxt,*.kmz,*.wsz,*.xap,*.docx,*.docm,*.dotx,*.dotm,*.potx,*.potm,
|
||||||
|
\ *.ppsx,*.ppsm,*.pptx,*.pptm,*.ppam,*.sldx,*.thmx,*.xlam,*.xlsx,*.xlsm,
|
||||||
|
\ *.xlsb,*.xltx,*.xltm,*.xlam,*.crtx,*.vdw,*.glox,*.gcsx,*.gqsx,*.epub'
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
4. History *zip-history* {{{1
|
4. History *zip-history* {{{1
|
||||||
|
v28 Oct 08, 2014 * changed the sanity checks for executables to reflect
|
||||||
|
the command actually to be attempted in zip#Read()
|
||||||
|
and zip#Write()
|
||||||
|
* added the extraction of a file capability
|
||||||
|
Nov 30, 2015 * added *.epub to the |g:zipPlugin_ext| list
|
||||||
|
Sep 13, 2016 * added *.apk to the |g:zipPlugin_ext| list and
|
||||||
|
sorted the suffices.
|
||||||
|
v27 Jul 02, 2013 * sanity check: zipfile must have "PK" as its first
|
||||||
|
two bytes.
|
||||||
|
* modified to allow zipfile: entries in quickfix lists
|
||||||
v26 Nov 15, 2012 * (Jason Spiro) provided a lot of new extensions that
|
v26 Nov 15, 2012 * (Jason Spiro) provided a lot of new extensions that
|
||||||
are synonyms for .zip
|
are synonyms for .zip
|
||||||
v25 Jun 27, 2011 * using keepj with unzip -Z
|
v25 Jun 27, 2011 * using keepj with unzip -Z
|
||||||
|
@ -152,7 +152,7 @@ q Stops recording.
|
|||||||
:[addr]@: Repeat last command-line. First set cursor at line
|
:[addr]@: Repeat last command-line. First set cursor at line
|
||||||
[addr] (default is current line).
|
[addr] (default is current line).
|
||||||
|
|
||||||
*:@@*
|
:[addr]@ *:@@*
|
||||||
:[addr]@@ Repeat the previous :@{0-9a-z"}. First set cursor at
|
:[addr]@@ Repeat the previous :@{0-9a-z"}. First set cursor at
|
||||||
line [addr] (default is current line).
|
line [addr] (default is current line).
|
||||||
|
|
||||||
|
@ -425,7 +425,7 @@ accordingly. Vim proceeds in this order:
|
|||||||
- The environment variable EXINIT.
|
- The environment variable EXINIT.
|
||||||
The value of $EXINIT is used as an Ex command line.
|
The value of $EXINIT is used as an Ex command line.
|
||||||
|
|
||||||
c. If the 'exrc' option is on (which is not the default), the current
|
c. If the 'exrc' option is on (which is NOT the default), the current
|
||||||
directory is searched for three files. The first that exists is used,
|
directory is searched for three files. The first that exists is used,
|
||||||
the others are ignored.
|
the others are ignored.
|
||||||
- The file ".nvimrc" (for Unix)
|
- The file ".nvimrc" (for Unix)
|
||||||
@ -1184,6 +1184,9 @@ running) you have additional options:
|
|||||||
file. This list is read on startup and only changes
|
file. This list is read on startup and only changes
|
||||||
afterwards with ":rshada!". Also see |v:oldfiles|.
|
afterwards with ":rshada!". Also see |v:oldfiles|.
|
||||||
The number can be used with |c_#<|.
|
The number can be used with |c_#<|.
|
||||||
|
The output can be filtered with |:filter|, e.g.: >
|
||||||
|
filter /\.vim/ oldfiles
|
||||||
|
< The filtering happens on the file name.
|
||||||
|
|
||||||
:bro[wse] o[ldfiles][!]
|
:bro[wse] o[ldfiles][!]
|
||||||
List file names as with |:oldfiles|, and then prompt
|
List file names as with |:oldfiles|, and then prompt
|
||||||
|
@ -2656,7 +2656,75 @@ your vimrc: *g:filetype_r*
|
|||||||
|
|
||||||
RUBY *ruby.vim* *ft-ruby-syntax*
|
RUBY *ruby.vim* *ft-ruby-syntax*
|
||||||
|
|
||||||
There are a number of options to the Ruby syntax highlighting.
|
Ruby: Operator highlighting |ruby_operators|
|
||||||
|
Ruby: Whitespace errors |ruby_space_errors|
|
||||||
|
Ruby: Folding |ruby_fold| |ruby_foldable_groups|
|
||||||
|
Ruby: Reducing expensive operations |ruby_no_expensive| |ruby_minlines|
|
||||||
|
Ruby: Spellchecking strings |ruby_spellcheck_strings|
|
||||||
|
|
||||||
|
*ruby_operators*
|
||||||
|
Ruby: Operator highlighting ~
|
||||||
|
|
||||||
|
Operators can be highlighted by defining "ruby_operators": >
|
||||||
|
|
||||||
|
:let ruby_operators = 1
|
||||||
|
<
|
||||||
|
*ruby_space_errors*
|
||||||
|
Ruby: Whitespace errors ~
|
||||||
|
|
||||||
|
Whitespace errors can be highlighted by defining "ruby_space_errors": >
|
||||||
|
|
||||||
|
:let ruby_space_errors = 1
|
||||||
|
<
|
||||||
|
This will highlight trailing whitespace and tabs preceded by a space character
|
||||||
|
as errors. This can be refined by defining "ruby_no_trail_space_error" and
|
||||||
|
"ruby_no_tab_space_error" which will ignore trailing whitespace and tabs after
|
||||||
|
spaces respectively.
|
||||||
|
|
||||||
|
*ruby_fold* *ruby_foldable_groups*
|
||||||
|
Ruby: Folding ~
|
||||||
|
|
||||||
|
Folding can be enabled by defining "ruby_fold": >
|
||||||
|
|
||||||
|
:let ruby_fold = 1
|
||||||
|
<
|
||||||
|
This will set the value of 'foldmethod' to "syntax" locally to the current
|
||||||
|
buffer or window, which will enable syntax-based folding when editing Ruby
|
||||||
|
filetypes.
|
||||||
|
|
||||||
|
Default folding is rather detailed, i.e., small syntax units like "if", "do",
|
||||||
|
"%w[]" may create corresponding fold levels.
|
||||||
|
|
||||||
|
You can set "ruby_foldable_groups" to restrict which groups are foldable: >
|
||||||
|
|
||||||
|
:let ruby_foldable_groups = 'if case %'
|
||||||
|
<
|
||||||
|
The value is a space-separated list of keywords:
|
||||||
|
|
||||||
|
keyword meaning ~
|
||||||
|
-------- ------------------------------------- ~
|
||||||
|
ALL Most block syntax (default)
|
||||||
|
NONE Nothing
|
||||||
|
if "if" or "unless" block
|
||||||
|
def "def" block
|
||||||
|
class "class" block
|
||||||
|
module "module" block
|
||||||
|
do "do" block
|
||||||
|
begin "begin" block
|
||||||
|
case "case" block
|
||||||
|
for "for", "while", "until" loops
|
||||||
|
{ Curly bracket block or hash literal
|
||||||
|
[ Array literal
|
||||||
|
% Literal with "%" notation, e.g.: %w(STRING), %!STRING!
|
||||||
|
/ Regexp
|
||||||
|
string String and shell command output (surrounded by ', ", `)
|
||||||
|
: Symbol
|
||||||
|
# Multiline comment
|
||||||
|
<< Here documents
|
||||||
|
__END__ Source code after "__END__" directive
|
||||||
|
|
||||||
|
*ruby_no_expensive*
|
||||||
|
Ruby: Reducing expensive operations ~
|
||||||
|
|
||||||
By default, the "end" keyword is colorized according to the opening statement
|
By default, the "end" keyword is colorized according to the opening statement
|
||||||
of the block it closes. While useful, this feature can be expensive; if you
|
of the block it closes. While useful, this feature can be expensive; if you
|
||||||
@ -2667,6 +2735,8 @@ you may want to turn it off by defining the "ruby_no_expensive" variable: >
|
|||||||
<
|
<
|
||||||
In this case the same color will be used for all control keywords.
|
In this case the same color will be used for all control keywords.
|
||||||
|
|
||||||
|
*ruby_minlines*
|
||||||
|
|
||||||
If you do want this feature enabled, but notice highlighting errors while
|
If you do want this feature enabled, but notice highlighting errors while
|
||||||
scrolling backwards, which are fixed when redrawing with CTRL-L, try setting
|
scrolling backwards, which are fixed when redrawing with CTRL-L, try setting
|
||||||
the "ruby_minlines" variable to a value larger than 50: >
|
the "ruby_minlines" variable to a value larger than 50: >
|
||||||
@ -2676,48 +2746,13 @@ the "ruby_minlines" variable to a value larger than 50: >
|
|||||||
Ideally, this value should be a number of lines large enough to embrace your
|
Ideally, this value should be a number of lines large enough to embrace your
|
||||||
largest class or module.
|
largest class or module.
|
||||||
|
|
||||||
Highlighting of special identifiers can be disabled by removing the
|
*ruby_spellcheck_strings*
|
||||||
rubyIdentifier highlighting: >
|
Ruby: Spellchecking strings ~
|
||||||
|
|
||||||
:hi link rubyIdentifier NONE
|
Ruby syntax will perform spellchecking of strings if you define
|
||||||
<
|
"ruby_spellcheck_strings": >
|
||||||
This will prevent highlighting of special identifiers like "ConstantName",
|
|
||||||
"$global_var", "@@class_var", "@instance_var", "| block_param |", and
|
|
||||||
":symbol".
|
|
||||||
|
|
||||||
Significant methods of Kernel, Module and Object are highlighted by default.
|
:let ruby_spellcheck_strings = 1
|
||||||
This can be disabled by defining "ruby_no_special_methods": >
|
|
||||||
|
|
||||||
:let ruby_no_special_methods = 1
|
|
||||||
<
|
|
||||||
This will prevent highlighting of important methods such as "require", "attr",
|
|
||||||
"private", "raise" and "proc".
|
|
||||||
|
|
||||||
Ruby operators can be highlighted. This is enabled by defining
|
|
||||||
"ruby_operators": >
|
|
||||||
|
|
||||||
:let ruby_operators = 1
|
|
||||||
<
|
|
||||||
Whitespace errors can be highlighted by defining "ruby_space_errors": >
|
|
||||||
|
|
||||||
:let ruby_space_errors = 1
|
|
||||||
<
|
|
||||||
This will highlight trailing whitespace and tabs preceded by a space character
|
|
||||||
as errors. This can be refined by defining "ruby_no_trail_space_error" and
|
|
||||||
"ruby_no_tab_space_error" which will ignore trailing whitespace and tabs after
|
|
||||||
spaces respectively.
|
|
||||||
|
|
||||||
Folding can be enabled by defining "ruby_fold": >
|
|
||||||
|
|
||||||
:let ruby_fold = 1
|
|
||||||
<
|
|
||||||
This will set the 'foldmethod' option to "syntax" and allow folding of
|
|
||||||
classes, modules, methods, code blocks, heredocs and comments.
|
|
||||||
|
|
||||||
Folding of multiline comments can be disabled by defining
|
|
||||||
"ruby_no_comment_fold": >
|
|
||||||
|
|
||||||
:let ruby_no_comment_fold = 1
|
|
||||||
<
|
<
|
||||||
|
|
||||||
SCHEME *scheme.vim* *ft-scheme-syntax*
|
SCHEME *scheme.vim* *ft-scheme-syntax*
|
||||||
@ -2815,9 +2850,11 @@ vimrc file: >
|
|||||||
(Adapted from the html.vim help text by Claudio Fleiner <claudio@fleiner.com>)
|
(Adapted from the html.vim help text by Claudio Fleiner <claudio@fleiner.com>)
|
||||||
|
|
||||||
|
|
||||||
SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax*
|
*ft-posix-synax* *ft-dash-syntax*
|
||||||
|
SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax*
|
||||||
|
|
||||||
This covers the "normal" Unix (Bourne) sh, bash and the Korn shell.
|
This covers syntax highlighting for the older Unix (Bourne) sh, and newer
|
||||||
|
shells such as bash, dash, posix, and the Korn shells.
|
||||||
|
|
||||||
Vim attempts to determine which shell type is in use by specifying that
|
Vim attempts to determine which shell type is in use by specifying that
|
||||||
various filenames are of specific types: >
|
various filenames are of specific types: >
|
||||||
@ -2826,28 +2863,31 @@ various filenames are of specific types: >
|
|||||||
bash: .bashrc* bashrc bash.bashrc .bash_profile* *.bash
|
bash: .bashrc* bashrc bash.bashrc .bash_profile* *.bash
|
||||||
<
|
<
|
||||||
If none of these cases pertain, then the first line of the file is examined
|
If none of these cases pertain, then the first line of the file is examined
|
||||||
(ex. /bin/sh /bin/ksh /bin/bash). If the first line specifies a shelltype,
|
(ex. looking for /bin/sh /bin/ksh /bin/bash). If the first line specifies a
|
||||||
then that shelltype is used. However some files (ex. .profile) are known to
|
shelltype, then that shelltype is used. However some files (ex. .profile) are
|
||||||
be shell files but the type is not apparent. Furthermore, on many systems
|
known to be shell files but the type is not apparent. Furthermore, on many
|
||||||
sh is symbolically linked to "bash" (Linux, Windows+cygwin) or "ksh" (Posix).
|
systems sh is symbolically linked to "bash" (Linux, Windows+cygwin) or "ksh"
|
||||||
|
(Posix).
|
||||||
|
|
||||||
One may specify a global default by instantiating one of the following three
|
One may specify a global default by instantiating one of the following
|
||||||
variables in your vimrc:
|
variables in your vimrc:
|
||||||
|
|
||||||
ksh: >
|
ksh: >
|
||||||
let g:is_kornshell = 1
|
let g:is_kornshell = 1
|
||||||
< posix: (using this is the same as setting is_kornshell to 1) >
|
< posix: (using this is the nearly the same as setting g:is_kornshell to 1) >
|
||||||
let g:is_posix = 1
|
let g:is_posix = 1
|
||||||
< bash: >
|
< bash: >
|
||||||
let g:is_bash = 1
|
let g:is_bash = 1
|
||||||
< sh: (default) Bourne shell >
|
< sh: (default) Bourne shell >
|
||||||
let g:is_sh = 1
|
let g:is_sh = 1
|
||||||
|
|
||||||
|
< (dash users should use posix)
|
||||||
|
|
||||||
If there's no "#! ..." line, and the user hasn't availed himself/herself of a
|
If there's no "#! ..." line, and the user hasn't availed himself/herself of a
|
||||||
default sh.vim syntax setting as just shown, then syntax/sh.vim will assume
|
default sh.vim syntax setting as just shown, then syntax/sh.vim will assume
|
||||||
the Bourne shell syntax. No need to quote RFCs or market penetration
|
the Bourne shell syntax. No need to quote RFCs or market penetration
|
||||||
statistics in error reports, please -- just select the default version of the
|
statistics in error reports, please -- just select the default version of the
|
||||||
sh your system uses in your vimrc.
|
sh your system uses and install the associated "let..." in your <.vimrc>.
|
||||||
|
|
||||||
The syntax/sh.vim file provides several levels of syntax-based folding: >
|
The syntax/sh.vim file provides several levels of syntax-based folding: >
|
||||||
|
|
||||||
@ -2856,7 +2896,7 @@ The syntax/sh.vim file provides several levels of syntax-based folding: >
|
|||||||
let g:sh_fold_enabled= 2 (enable heredoc folding)
|
let g:sh_fold_enabled= 2 (enable heredoc folding)
|
||||||
let g:sh_fold_enabled= 4 (enable if/do/for folding)
|
let g:sh_fold_enabled= 4 (enable if/do/for folding)
|
||||||
>
|
>
|
||||||
then various syntax items (HereDocuments and function bodies) become
|
then various syntax items (ie. HereDocuments and function bodies) become
|
||||||
syntax-foldable (see |:syn-fold|). You also may add these together
|
syntax-foldable (see |:syn-fold|). You also may add these together
|
||||||
to get multiple types of folding: >
|
to get multiple types of folding: >
|
||||||
|
|
||||||
@ -2880,14 +2920,7 @@ reduce this, the "sh_maxlines" internal variable can be set. Example: >
|
|||||||
The default is to use the twice sh_minlines. Set it to a smaller number to
|
The default is to use the twice sh_minlines. Set it to a smaller number to
|
||||||
speed up displaying. The disadvantage is that highlight errors may appear.
|
speed up displaying. The disadvantage is that highlight errors may appear.
|
||||||
|
|
||||||
*g:sh_isk* *g:sh_noisk*
|
|
||||||
The shell languages appear to let "." be part of words, commands, etc;
|
|
||||||
consequently it should be in the isk for sh.vim. As of v116 of syntax/sh.vim,
|
|
||||||
syntax/sh.vim will append the "." to |'iskeyword'| by default; you may control
|
|
||||||
this behavior with: >
|
|
||||||
let g:sh_isk = '..whatever characters you want as part of iskeyword'
|
|
||||||
let g:sh_noisk= 1 " otherwise, if this exists, the isk will NOT chg
|
|
||||||
<
|
|
||||||
*sh-embed* *sh-awk*
|
*sh-embed* *sh-awk*
|
||||||
Sh: EMBEDDING LANGUAGES~
|
Sh: EMBEDDING LANGUAGES~
|
||||||
|
|
||||||
@ -3461,8 +3494,8 @@ SYNTAX ISKEYWORD SETTING *:syn-iskeyword*
|
|||||||
and also determines where |:syn-keyword| will be checked for a new
|
and also determines where |:syn-keyword| will be checked for a new
|
||||||
match.
|
match.
|
||||||
|
|
||||||
It is recommended when writing syntax files, to use this command
|
It is recommended when writing syntax files, to use this command to
|
||||||
to the correct value for the specific syntax language and not change
|
set the correct value for the specific syntax language and not change
|
||||||
the 'iskeyword' option.
|
the 'iskeyword' option.
|
||||||
|
|
||||||
DEFINING KEYWORDS *:syn-keyword*
|
DEFINING KEYWORDS *:syn-keyword*
|
||||||
@ -3520,7 +3553,11 @@ DEFINING KEYWORDS *:syn-keyword*
|
|||||||
|
|
||||||
DEFINING MATCHES *:syn-match*
|
DEFINING MATCHES *:syn-match*
|
||||||
|
|
||||||
:sy[ntax] match {group-name} [{options}] [excludenl] {pattern} [{options}]
|
:sy[ntax] match {group-name} [{options}]
|
||||||
|
[excludenl]
|
||||||
|
[keepend]
|
||||||
|
{pattern}
|
||||||
|
[{options}]
|
||||||
|
|
||||||
This defines one match.
|
This defines one match.
|
||||||
|
|
||||||
@ -3529,6 +3566,9 @@ DEFINING MATCHES *:syn-match*
|
|||||||
[excludenl] Don't make a pattern with the end-of-line "$"
|
[excludenl] Don't make a pattern with the end-of-line "$"
|
||||||
extend a containing match or region. Must be
|
extend a containing match or region. Must be
|
||||||
given before the pattern. |:syn-excludenl|
|
given before the pattern. |:syn-excludenl|
|
||||||
|
keepend Don't allow contained matches to go past a
|
||||||
|
match with the end pattern. See
|
||||||
|
|:syn-keepend|.
|
||||||
{pattern} The search pattern that defines the match.
|
{pattern} The search pattern that defines the match.
|
||||||
See |:syn-pattern| below.
|
See |:syn-pattern| below.
|
||||||
Note that the pattern may match more than one
|
Note that the pattern may match more than one
|
||||||
|
@ -195,6 +195,12 @@ Other commands:
|
|||||||
:tabs List the tab pages and the windows they contain.
|
:tabs List the tab pages and the windows they contain.
|
||||||
Shows a ">" for the current window.
|
Shows a ">" for the current window.
|
||||||
Shows a "+" for modified buffers.
|
Shows a "+" for modified buffers.
|
||||||
|
For example:
|
||||||
|
Tab page 1 ~
|
||||||
|
+ tabpage.txt ~
|
||||||
|
ex_docmd.c ~
|
||||||
|
Tab page 2 ~
|
||||||
|
> main.c ~
|
||||||
|
|
||||||
|
|
||||||
REORDERING TAB PAGES:
|
REORDERING TAB PAGES:
|
||||||
|
@ -85,6 +85,8 @@ g8 Print the hex values of the bytes used in the
|
|||||||
on paper see |:hardcopy|. In the GUI you can use the
|
on paper see |:hardcopy|. In the GUI you can use the
|
||||||
File.Print menu entry.
|
File.Print menu entry.
|
||||||
See |ex-flags| for [flags].
|
See |ex-flags| for [flags].
|
||||||
|
The |:filter| command can be used to only show lines
|
||||||
|
matching a pattern.
|
||||||
|
|
||||||
:[range]p[rint] {count} [flags]
|
:[range]p[rint] {count} [flags]
|
||||||
Print {count} lines, starting with [range] (default
|
Print {count} lines, starting with [range] (default
|
||||||
@ -367,7 +369,7 @@ N *+statusline* Options 'statusline', 'rulerformat' and special
|
|||||||
formats of 'titlestring' and 'iconstring'
|
formats of 'titlestring' and 'iconstring'
|
||||||
N *+syntax* Syntax highlighting |syntax|
|
N *+syntax* Syntax highlighting |syntax|
|
||||||
N *+tablineat* 'tabline' option recognizing %@Func@ items.
|
N *+tablineat* 'tabline' option recognizing %@Func@ items.
|
||||||
N *+tag_binary* binary searching in tags file |tag-binary-search|
|
T *+tag_binary* binary searching in tags file |tag-binary-search|
|
||||||
N *+tag_old_static* old method for static tags |tag-old-static|
|
N *+tag_old_static* old method for static tags |tag-old-static|
|
||||||
m *+tag_any_white* any white space allowed in tags file |tag-any-white|
|
m *+tag_any_white* any white space allowed in tags file |tag-any-white|
|
||||||
B *+termguicolors* 24-bit color in xterm-compatible terminals support
|
B *+termguicolors* 24-bit color in xterm-compatible terminals support
|
||||||
@ -461,6 +463,29 @@ m *+xpm_w32* Win32 GUI only: pixmap support |w32-xpm-support|
|
|||||||
|
|
||||||
:redi[r] END End redirecting messages.
|
:redi[r] END End redirecting messages.
|
||||||
|
|
||||||
|
*:filt* *:filter*
|
||||||
|
:filt[er][!] {pat} {command}
|
||||||
|
:filt[er][!] /{pat}/ {command}
|
||||||
|
Restrict the output of {command} to lines matching
|
||||||
|
with {pat}. For example, to list only xml files: >
|
||||||
|
:filter /\.xml$/ oldfiles
|
||||||
|
< If the [!] is given, restrict the output of {command}
|
||||||
|
to lines that do NOT match {pat}.
|
||||||
|
|
||||||
|
{pat} is a Vim search pattern. Instead of enclosing
|
||||||
|
it in / any non-ID character (see |'isident'|) can be
|
||||||
|
used, so long as it does not appear in {pat}. Without
|
||||||
|
the enclosing character the pattern cannot include the
|
||||||
|
bar character.
|
||||||
|
|
||||||
|
The pattern is matched against the relevant part of
|
||||||
|
the output, not necessarily the whole line. Only some
|
||||||
|
commands support filtering, try it out to check if it
|
||||||
|
works.
|
||||||
|
|
||||||
|
Only normal messages are filtered, error messages are
|
||||||
|
not.
|
||||||
|
|
||||||
*:sil* *:silent* *:silent!*
|
*:sil* *:silent* *:silent!*
|
||||||
:sil[ent][!] {command} Execute {command} silently. Normal messages will not
|
:sil[ent][!] {command} Execute {command} silently. Normal messages will not
|
||||||
be given or added to the message history.
|
be given or added to the message history.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Vim support file to detect file types
|
" Vim support file to detect file types
|
||||||
"
|
"
|
||||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||||
" Last Change: 2016 Aug 26
|
" Last Change: 2016 Sep 22
|
||||||
|
|
||||||
" Listen very carefully, I will say this only once
|
" Listen very carefully, I will say this only once
|
||||||
if exists("did_load_filetypes")
|
if exists("did_load_filetypes")
|
||||||
@ -672,6 +672,9 @@ au BufNewFile,BufRead *.dts,*.dtsi setf dts
|
|||||||
" EDIF (*.edf,*.edif,*.edn,*.edo)
|
" EDIF (*.edf,*.edif,*.edn,*.edo)
|
||||||
au BufNewFile,BufRead *.ed\(f\|if\|n\|o\) setf edif
|
au BufNewFile,BufRead *.ed\(f\|if\|n\|o\) setf edif
|
||||||
|
|
||||||
|
" EditorConfig (close enough to dosini)
|
||||||
|
au BufNewFile,BufRead .editorconfig setf dosini
|
||||||
|
|
||||||
" Embedix Component Description
|
" Embedix Component Description
|
||||||
au BufNewFile,BufRead *.ecd setf ecd
|
au BufNewFile,BufRead *.ecd setf ecd
|
||||||
|
|
||||||
@ -802,6 +805,10 @@ au BufNewFile,BufRead *.gp,.gprc setf gp
|
|||||||
au BufNewFile,BufRead */.gnupg/options setf gpg
|
au BufNewFile,BufRead */.gnupg/options setf gpg
|
||||||
au BufNewFile,BufRead */.gnupg/gpg.conf setf gpg
|
au BufNewFile,BufRead */.gnupg/gpg.conf setf gpg
|
||||||
au BufNewFile,BufRead */usr/*/gnupg/options.skel setf gpg
|
au BufNewFile,BufRead */usr/*/gnupg/options.skel setf gpg
|
||||||
|
if !empty($GNUPGHOME)
|
||||||
|
au BufNewFile,BufRead $GNUPGHOME/options setf gpg
|
||||||
|
au BufNewFile,BufRead $GNUPGHOME/gpg.conf setf gpg
|
||||||
|
endif
|
||||||
|
|
||||||
" gnash(1) configuration files
|
" gnash(1) configuration files
|
||||||
au BufNewFile,BufRead gnashrc,.gnashrc,gnashpluginrc,.gnashpluginrc setf gnash
|
au BufNewFile,BufRead gnashrc,.gnashrc,gnashpluginrc,.gnashpluginrc setf gnash
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Vim filetype plugin
|
" Vim filetype plugin
|
||||||
" Language: Cucumber
|
" Language: Cucumber
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2013 Jun 01
|
" Last Change: 2016 Aug 29
|
||||||
|
|
||||||
" Only do this when not done yet for this buffer
|
" Only do this when not done yet for this buffer
|
||||||
if (exists("b:did_ftplugin"))
|
if (exists("b:did_ftplugin"))
|
||||||
@ -19,27 +19,23 @@ setlocal omnifunc=CucumberComplete
|
|||||||
let b:undo_ftplugin = "setl fo< com< cms< ofu<"
|
let b:undo_ftplugin = "setl fo< com< cms< ofu<"
|
||||||
|
|
||||||
let b:cucumber_root = expand('%:p:h:s?.*[\/]\%(features\|stories\)\zs[\/].*??')
|
let b:cucumber_root = expand('%:p:h:s?.*[\/]\%(features\|stories\)\zs[\/].*??')
|
||||||
|
if !exists("b:cucumber_steps_glob")
|
||||||
|
let b:cucumber_steps_glob = b:cucumber_root.'/**/*.rb'
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists("g:no_plugin_maps") && !exists("g:no_cucumber_maps")
|
if !exists("g:no_plugin_maps") && !exists("g:no_cucumber_maps")
|
||||||
nnoremap <silent><buffer> <C-]> :<C-U>exe <SID>jump('edit',v:count)<CR>
|
cnoremap <SID>foldopen <Bar>if &foldopen =~# 'tag'<Bar>exe 'norm! zv'<Bar>endif
|
||||||
nnoremap <silent><buffer> [<C-D> :<C-U>exe <SID>jump('edit',v:count)<CR>
|
nnoremap <silent> <script> <buffer> [<C-D> :<C-U>exe <SID>jump('edit',v:count)<SID>foldopen<CR>
|
||||||
nnoremap <silent><buffer> ]<C-D> :<C-U>exe <SID>jump('edit',v:count)<CR>
|
nnoremap <silent> <script> <buffer> ]<C-D> :<C-U>exe <SID>jump('edit',v:count)<SID>foldopen<CR>
|
||||||
nnoremap <silent><buffer> <C-W>] :<C-U>exe <SID>jump('split',v:count)<CR>
|
nnoremap <silent> <script> <buffer> <C-W>d :<C-U>exe <SID>jump('split',v:count)<SID>foldopen<CR>
|
||||||
nnoremap <silent><buffer> <C-W><C-]> :<C-U>exe <SID>jump('split',v:count)<CR>
|
nnoremap <silent> <script> <buffer> <C-W><C-D> :<C-U>exe <SID>jump('split',v:count)<SID>foldopen<CR>
|
||||||
nnoremap <silent><buffer> <C-W>d :<C-U>exe <SID>jump('split',v:count)<CR>
|
nnoremap <silent> <script> <buffer> [d :<C-U>exe <SID>jump('pedit',v:count)<CR>
|
||||||
nnoremap <silent><buffer> <C-W><C-D> :<C-U>exe <SID>jump('split',v:count)<CR>
|
nnoremap <silent> <script> <buffer> ]d :<C-U>exe <SID>jump('pedit',v:count)<CR>
|
||||||
nnoremap <silent><buffer> <C-W>} :<C-U>exe <SID>jump('pedit',v:count)<CR>
|
|
||||||
nnoremap <silent><buffer> [d :<C-U>exe <SID>jump('pedit',v:count)<CR>
|
|
||||||
nnoremap <silent><buffer> ]d :<C-U>exe <SID>jump('pedit',v:count)<CR>
|
|
||||||
let b:undo_ftplugin .=
|
let b:undo_ftplugin .=
|
||||||
\ "|sil! nunmap <buffer> <C-]>" .
|
|
||||||
\ "|sil! nunmap <buffer> [<C-D>" .
|
\ "|sil! nunmap <buffer> [<C-D>" .
|
||||||
\ "|sil! nunmap <buffer> ]<C-D>" .
|
\ "|sil! nunmap <buffer> ]<C-D>" .
|
||||||
\ "|sil! nunmap <buffer> <C-W>]" .
|
|
||||||
\ "|sil! nunmap <buffer> <C-W><C-]>" .
|
|
||||||
\ "|sil! nunmap <buffer> <C-W>d" .
|
\ "|sil! nunmap <buffer> <C-W>d" .
|
||||||
\ "|sil! nunmap <buffer> <C-W><C-D>" .
|
\ "|sil! nunmap <buffer> <C-W><C-D>" .
|
||||||
\ "|sil! nunmap <buffer> <C-W>}" .
|
|
||||||
\ "|sil! nunmap <buffer> [d" .
|
\ "|sil! nunmap <buffer> [d" .
|
||||||
\ "|sil! nunmap <buffer> ]d"
|
\ "|sil! nunmap <buffer> ]d"
|
||||||
endif
|
endif
|
||||||
@ -59,7 +55,7 @@ endfunction
|
|||||||
function! s:allsteps()
|
function! s:allsteps()
|
||||||
let step_pattern = '\C^\s*\K\k*\>\s*(\=\s*\zs\S.\{-\}\ze\s*)\=\s*\%(do\|{\)\s*\%(|[^|]*|\s*\)\=\%($\|#\)'
|
let step_pattern = '\C^\s*\K\k*\>\s*(\=\s*\zs\S.\{-\}\ze\s*)\=\s*\%(do\|{\)\s*\%(|[^|]*|\s*\)\=\%($\|#\)'
|
||||||
let steps = []
|
let steps = []
|
||||||
for file in split(glob(b:cucumber_root.'/**/*.rb'),"\n")
|
for file in split(glob(b:cucumber_steps_glob),"\n")
|
||||||
let lines = readfile(file)
|
let lines = readfile(file)
|
||||||
let num = 0
|
let num = 0
|
||||||
for line in lines
|
for line in lines
|
||||||
|
@ -27,7 +27,7 @@ elseif !exists("b:eruby_subtype")
|
|||||||
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
|
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
|
||||||
let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+')
|
let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+')
|
||||||
if b:eruby_subtype == ''
|
if b:eruby_subtype == ''
|
||||||
let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+$')
|
let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+\%(\ze+\w\+\)\=$')
|
||||||
endif
|
endif
|
||||||
if b:eruby_subtype == 'rhtml'
|
if b:eruby_subtype == 'rhtml'
|
||||||
let b:eruby_subtype = 'html'
|
let b:eruby_subtype = 'html'
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Vim filetype plugin
|
" Vim filetype plugin
|
||||||
" Language: generic git output
|
" Language: generic git output
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2013 May 30
|
" Last Change: 2016 Aug 29
|
||||||
|
|
||||||
" Only do this when not done yet for this buffer
|
" Only do this when not done yet for this buffer
|
||||||
if (exists("b:did_ftplugin"))
|
if (exists("b:did_ftplugin"))
|
||||||
@ -12,6 +12,8 @@ let b:did_ftplugin = 1
|
|||||||
if !exists('b:git_dir')
|
if !exists('b:git_dir')
|
||||||
if expand('%:p') =~# '[\/]\.git[\/]modules[\/]'
|
if expand('%:p') =~# '[\/]\.git[\/]modules[\/]'
|
||||||
" Stay out of the way
|
" Stay out of the way
|
||||||
|
elseif expand('%:p') =~# '[\/]\.git[\/]worktrees'
|
||||||
|
let b:git_dir = matchstr(expand('%:p'),'.*\.git[\/]worktrees[\/][^\/]\+\>')
|
||||||
elseif expand('%:p') =~# '\.git\>'
|
elseif expand('%:p') =~# '\.git\>'
|
||||||
let b:git_dir = matchstr(expand('%:p'),'.*\.git\>')
|
let b:git_dir = matchstr(expand('%:p'),'.*\.git\>')
|
||||||
elseif $GIT_DIR != ''
|
elseif $GIT_DIR != ''
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Vim filetype plugin
|
" Vim filetype plugin
|
||||||
" Language: git commit file
|
" Language: git commit file
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2013 May 30
|
" Last Change: 2016 Aug 29
|
||||||
|
|
||||||
" Only do this when not done yet for this buffer
|
" Only do this when not done yet for this buffer
|
||||||
if (exists("b:did_ftplugin"))
|
if (exists("b:did_ftplugin"))
|
||||||
@ -11,15 +11,10 @@ endif
|
|||||||
runtime! ftplugin/git.vim
|
runtime! ftplugin/git.vim
|
||||||
let b:did_ftplugin = 1
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
setlocal nomodeline tabstop=8 formatoptions-=croq formatoptions+=tl
|
setlocal comments=:# commentstring=#\ %s
|
||||||
|
setlocal nomodeline tabstop=8 formatoptions+=tl textwidth=72
|
||||||
let b:undo_ftplugin = 'setl modeline< tabstop< formatoptions<'
|
setlocal formatoptions-=c formatoptions-=r formatoptions-=o formatoptions-=q
|
||||||
|
let b:undo_ftplugin = 'setl modeline< tabstop< formatoptions< tw< com< cms<'
|
||||||
if &textwidth == 0
|
|
||||||
" make sure that log messages play nice with git-log on standard terminals
|
|
||||||
setlocal textwidth=72
|
|
||||||
let b:undo_ftplugin .= "|setl tw<"
|
|
||||||
endif
|
|
||||||
|
|
||||||
if exists("g:no_gitcommit_commands") || v:version < 700
|
if exists("g:no_gitcommit_commands") || v:version < 700
|
||||||
finish
|
finish
|
||||||
@ -31,6 +26,8 @@ endif
|
|||||||
|
|
||||||
command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(<bang>0,b:git_dir,<f-args>)
|
command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(<bang>0,b:git_dir,<f-args>)
|
||||||
|
|
||||||
|
let b:undo_ftplugin = b:undo_ftplugin . "|delc DiffGitCached"
|
||||||
|
|
||||||
function! s:diffcomplete(A,L,P)
|
function! s:diffcomplete(A,L,P)
|
||||||
let args = ""
|
let args = ""
|
||||||
if a:P <= match(a:L." -- "," -- ")+3
|
if a:P <= match(a:L." -- "," -- ")+3
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Vim filetype plugin
|
" Vim filetype plugin
|
||||||
" Language: git rebase --interactive
|
" Language: git rebase --interactive
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2010 May 21
|
" Last Change: 2016 Aug 29
|
||||||
|
|
||||||
" Only do this when not done yet for this buffer
|
" Only do this when not done yet for this buffer
|
||||||
if (exists("b:did_ftplugin"))
|
if (exists("b:did_ftplugin"))
|
||||||
@ -12,10 +12,11 @@ runtime! ftplugin/git.vim
|
|||||||
let b:did_ftplugin = 1
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
setlocal comments=:# commentstring=#\ %s formatoptions-=t
|
setlocal comments=:# commentstring=#\ %s formatoptions-=t
|
||||||
|
setlocal nomodeline
|
||||||
if !exists("b:undo_ftplugin")
|
if !exists("b:undo_ftplugin")
|
||||||
let b:undo_ftplugin = ""
|
let b:undo_ftplugin = ""
|
||||||
endif
|
endif
|
||||||
let b:undo_ftplugin = b:undo_ftplugin."|setl com< cms< fo<"
|
let b:undo_ftplugin = b:undo_ftplugin."|setl com< cms< fo< ml<"
|
||||||
|
|
||||||
function! s:choose(word)
|
function! s:choose(word)
|
||||||
s/^\(\w\+\>\)\=\(\s*\)\ze\x\{4,40\}\>/\=(strlen(submatch(1)) == 1 ? a:word[0] : a:word) . substitute(submatch(2),'^$',' ','')/e
|
s/^\(\w\+\>\)\=\(\s*\)\ze\x\{4,40\}\>/\=(strlen(submatch(1)) == 1 ? a:word[0] : a:word) . substitute(submatch(2),'^$',' ','')/e
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Vim filetype plugin
|
" Vim filetype plugin
|
||||||
" Language: Haml
|
" Language: Haml
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2013 Jun 01
|
" Last Change: 2016 Aug 29
|
||||||
|
|
||||||
" Only do this when not done yet for this buffer
|
" Only do this when not done yet for this buffer
|
||||||
if exists("b:did_ftplugin")
|
if exists("b:did_ftplugin")
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Vim filetype plugin
|
" Vim filetype plugin
|
||||||
" Language: Markdown
|
" Language: Markdown
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2013 May 30
|
" Last Change: 2016 Aug 29
|
||||||
|
|
||||||
if exists("b:did_ftplugin")
|
if exists("b:did_ftplugin")
|
||||||
finish
|
finish
|
||||||
@ -11,7 +11,7 @@ runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
|
|||||||
|
|
||||||
setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s
|
setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s
|
||||||
setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o
|
setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o
|
||||||
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+
|
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:
|
||||||
|
|
||||||
if exists('b:undo_ftplugin')
|
if exists('b:undo_ftplugin')
|
||||||
let b:undo_ftplugin .= "|setl cms< com< fo< flp<"
|
let b:undo_ftplugin .= "|setl cms< com< fo< flp<"
|
||||||
@ -19,4 +19,32 @@ else
|
|||||||
let b:undo_ftplugin = "setl cms< com< fo< flp<"
|
let b:undo_ftplugin = "setl cms< com< fo< flp<"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
function! MarkdownFold()
|
||||||
|
let line = getline(v:lnum)
|
||||||
|
|
||||||
|
" Regular headers
|
||||||
|
let depth = match(line, '\(^#\+\)\@<=\( .*$\)\@=')
|
||||||
|
if depth > 0
|
||||||
|
return ">" . depth
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Setext style headings
|
||||||
|
let nextline = getline(v:lnum + 1)
|
||||||
|
if (line =~ '^.\+$') && (nextline =~ '^=\+$')
|
||||||
|
return ">1"
|
||||||
|
endif
|
||||||
|
|
||||||
|
if (line =~ '^.\+$') && (nextline =~ '^-\+$')
|
||||||
|
return ">2"
|
||||||
|
endif
|
||||||
|
|
||||||
|
return "="
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
if has("folding") && exists("g:markdown_folding")
|
||||||
|
setlocal foldexpr=MarkdownFold()
|
||||||
|
setlocal foldmethod=expr
|
||||||
|
let b:undo_ftplugin .= " foldexpr< foldmethod<"
|
||||||
|
endif
|
||||||
|
|
||||||
" vim:set sw=2:
|
" vim:set sw=2:
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
" Vim filetype plugin file
|
" Vim filetype plugin file
|
||||||
" Language: MetaFont
|
" Language: METAFONT
|
||||||
" Maintainer: Nikolai Weibull <now@bitwi.se>
|
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||||
" Latest Revision: 2008-07-09
|
" Former Maintainers: Nikolai Weibull <now@bitwi.se>
|
||||||
|
" Latest Revision: 2016 Oct 2
|
||||||
|
|
||||||
if exists("b:did_ftplugin")
|
if exists("b:did_ftplugin")
|
||||||
finish
|
finish
|
||||||
@ -11,9 +12,59 @@ let b:did_ftplugin = 1
|
|||||||
let s:cpo_save = &cpo
|
let s:cpo_save = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
let b:undo_ftplugin = "setl com< cms< fo<"
|
let b:undo_ftplugin = "setl com< cms< fo< sua< inc< def< ofu<"
|
||||||
|
\ . "| unlet! b:match_ignorecase b:match_words b:match_skip"
|
||||||
|
|
||||||
setlocal comments=:% commentstring=%\ %s formatoptions-=t formatoptions+=croql
|
setlocal comments=:% commentstring=%\ %s formatoptions-=t formatoptions+=cjroql2
|
||||||
|
setlocal suffixesadd=.mf
|
||||||
|
let &l:include = '\<input\>'
|
||||||
|
let &l:define = '\<\%(let\|newinternal\|interim\|def\|vardef\)\>\|\<\%(primary\|secondary\|tertiary\)def\>\s*[^ .]\+'
|
||||||
|
setlocal omnifunc=syntaxcomplete#Complete
|
||||||
|
let g:omni_syntax_group_include_mf = 'mf\w\+'
|
||||||
|
let g:omni_syntax_group_exclude_mf = 'mfTodoComment'
|
||||||
|
|
||||||
|
let s:mp_regex = {
|
||||||
|
\ 'beginsection' : '^\s*\%(\%(\|var\|primary\|secondary\|tertiary\)def\|beginchar\|beginlogochar\)\>',
|
||||||
|
\ 'endsection' : '^\s*\%(enddef\|endchar\)\>',
|
||||||
|
\ 'beginblock' : '^\s*\%(begingroup\|if\|for\%(\|suffixes\|ever\)\)\>',
|
||||||
|
\ 'endblock' : '^\s*\%(endgroup\|fi\|endfor\)\>'
|
||||||
|
\ }
|
||||||
|
|
||||||
|
function! s:move_around(count, what, flags, visual)
|
||||||
|
if a:visual
|
||||||
|
exe "normal! gv"
|
||||||
|
endif
|
||||||
|
call search(s:mp_regex[a:what], a:flags.'s') " 's' sets previous context mark
|
||||||
|
call map(range(2, a:count), 'search(s:mp_regex[a:what], a:flags)')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
" Move around macros.
|
||||||
|
nnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:false) <CR>
|
||||||
|
vnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:true) <CR>
|
||||||
|
nnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:false) <CR>
|
||||||
|
vnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:true) <CR>
|
||||||
|
nnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:false) <CR>
|
||||||
|
vnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:true) <CR>
|
||||||
|
nnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:false) <CR>
|
||||||
|
vnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:true) <CR>
|
||||||
|
nnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:false) <CR>
|
||||||
|
vnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:true) <CR>
|
||||||
|
nnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:false) <CR>
|
||||||
|
vnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:true) <CR>
|
||||||
|
|
||||||
|
if exists("loaded_matchit")
|
||||||
|
let b:match_ignorecase = 0
|
||||||
|
let b:match_words =
|
||||||
|
\ '\<if\>:\<else\%[if]\>:\<fi\>,' .
|
||||||
|
\ '\<for\%(\|suffixes\|ever\)\>:\<exit\%(if\|unless\)\>:\<endfor\>,' .
|
||||||
|
\ '\<\%(\|var\|primary\|secondary\|tertiary\)def\>:\<enddef\>,' .
|
||||||
|
\ '\<begingroup\>:\<endgroup\>,' .
|
||||||
|
\ '\<begin\%(logo\)\?char\>:\<endchar\>'
|
||||||
|
" Ignore comments and strings
|
||||||
|
let b:match_skip = 'synIDattr(synID(line("."), col("."), 1), "name")
|
||||||
|
\ =~# "mf\\(Comment\\|String\\)$"'
|
||||||
|
endif
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
let &cpo = s:cpo_save
|
||||||
unlet s:cpo_save
|
unlet s:cpo_save
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
" Vim filetype plugin file
|
" Vim filetype plugin file
|
||||||
" Language: MetaPost
|
" Language: MetaPost
|
||||||
" Maintainer: Nikolai Weibull <now@bitwi.se>
|
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||||
" Latest Revision: 2008-07-09
|
" Former Maintainers: Nikolai Weibull <now@bitwi.se>
|
||||||
|
" Latest Revision: 2016 Oct 2
|
||||||
|
|
||||||
if exists("b:did_ftplugin")
|
if exists("b:did_ftplugin")
|
||||||
finish
|
finish
|
||||||
@ -11,9 +12,16 @@ let b:did_ftplugin = 1
|
|||||||
let s:cpo_save = &cpo
|
let s:cpo_save = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
let b:undo_ftplugin = "setl com< cms< fo<"
|
let b:undo_ftplugin = "setl com< cms< fo< sua< inc< def< ofu<"
|
||||||
|
\ . "| unlet! b:match_ignorecase b:match_words b:match_skip"
|
||||||
|
|
||||||
setlocal comments=:% commentstring=%\ %s formatoptions-=t formatoptions+=croql
|
setlocal comments=:% commentstring=%\ %s formatoptions-=t formatoptions+=cjroql2
|
||||||
|
setlocal suffixesadd=.mp,.mpiv
|
||||||
|
let &l:include = '\<\%(input\|loadmodule\)\>' " loadmodule is in MetaFun
|
||||||
|
let &l:define = '\<\%(let\|newinternal\|interim\|def\|vardef\)\>\|\<\%(primary\|secondary\|tertiary\)def\>\s*[^ .]\+'
|
||||||
|
setlocal omnifunc=syntaxcomplete#Complete
|
||||||
|
let g:omni_syntax_group_include_mp = 'mf\w\+,mp\w\+'
|
||||||
|
let g:omni_syntax_group_exclude_mp = 'mfTodoComment'
|
||||||
|
|
||||||
if exists(":FixBeginfigs") != 2
|
if exists(":FixBeginfigs") != 2
|
||||||
command -nargs=0 FixBeginfigs call s:fix_beginfigs()
|
command -nargs=0 FixBeginfigs call s:fix_beginfigs()
|
||||||
@ -24,5 +32,51 @@ if exists(":FixBeginfigs") != 2
|
|||||||
endfunction
|
endfunction
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let s:mp_regex = {
|
||||||
|
\ 'beginsection' : '^\s*\%(\%(\|var\|primary\|secondary\|tertiary\)def\|begin\%(fig\|char\|logochar\|glyph\|graph\)\)\>',
|
||||||
|
\ 'endsection' : '^\s*\%(enddef\|end\%(fig\|char\|glyph\|graph\)\)\>',
|
||||||
|
\ 'beginblock' : '^\s*\%(begingroup\|if\|for\%(\|suffixes\|ever\)\)\>',
|
||||||
|
\ 'endblock' : '^\s*\%(endgroup\|fi\|endfor\)\>'
|
||||||
|
\ }
|
||||||
|
|
||||||
|
function! s:move_around(count, what, flags, visual)
|
||||||
|
if a:visual
|
||||||
|
exe "normal! gv"
|
||||||
|
endif
|
||||||
|
call search(s:mp_regex[a:what], a:flags.'s') " 's' sets previous context mark
|
||||||
|
call map(range(2, a:count), 'search(s:mp_regex[a:what], a:flags)')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
" Move around macros.
|
||||||
|
nnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:false) <CR>
|
||||||
|
vnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:true) <CR>
|
||||||
|
nnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:false) <CR>
|
||||||
|
vnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:true) <CR>
|
||||||
|
nnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:false) <CR>
|
||||||
|
vnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:true) <CR>
|
||||||
|
nnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:false) <CR>
|
||||||
|
vnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:true) <CR>
|
||||||
|
nnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:false) <CR>
|
||||||
|
vnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:true) <CR>
|
||||||
|
nnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:false) <CR>
|
||||||
|
vnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:true) <CR>
|
||||||
|
|
||||||
|
if exists("loaded_matchit")
|
||||||
|
let b:match_ignorecase = 0
|
||||||
|
let b:match_words =
|
||||||
|
\ '\<if\>:\<else\%[if]\>:\<fi\>,' .
|
||||||
|
\ '\<for\%(\|suffixes\|ever\)\>:\<exit\%(if\|unless\)\>:\<endfor\>,' .
|
||||||
|
\ '\<\%(\|var\|primary\|secondary\|tertiary\)def\>:\<enddef\>,' .
|
||||||
|
\ '\<beginfig\>:\<endfig\>,' .
|
||||||
|
\ '\<begingroup\>:\<endgroup\>,' .
|
||||||
|
\ '\<begin\%(logo\)\?char\>:\<endchar\>,' .
|
||||||
|
\ '\<beginglyph\>:\<endglyph\>,' .
|
||||||
|
\ '\<begingraph\>:\<endgraph\>'
|
||||||
|
" Ignore comments and strings
|
||||||
|
let b:match_skip = 'synIDattr(synID(line("."), col("."), 1), "name")
|
||||||
|
\ =~# "^mf\\%(Comment\\|String\\|\\)$\\|^mpTeXinsert$"'
|
||||||
|
endif
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
let &cpo = s:cpo_save
|
||||||
unlet s:cpo_save
|
unlet s:cpo_save
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
" Language: python
|
" Language: python
|
||||||
" Maintainer: James Sully <sullyj3@gmail.com>
|
" Maintainer: James Sully <sullyj3@gmail.com>
|
||||||
" Previous Maintainer: Johannes Zellner <johannes@zellner.org>
|
" Previous Maintainer: Johannes Zellner <johannes@zellner.org>
|
||||||
" Last Change: Wed, 29 June 2016
|
" Last Change: Tue, 09 October 2016
|
||||||
" https://github.com/sullyj3/vim-ftplugin-python
|
" https://github.com/sullyj3/vim-ftplugin-python
|
||||||
|
|
||||||
if exists("b:did_ftplugin") | finish | endif
|
if exists("b:did_ftplugin") | finish | endif
|
||||||
@ -22,15 +22,25 @@ setlocal omnifunc=pythoncomplete#Complete
|
|||||||
|
|
||||||
set wildignore+=*.pyc
|
set wildignore+=*.pyc
|
||||||
|
|
||||||
nnoremap <silent> <buffer> ]] :call <SID>Python_jump('n', '\v%$\|^(class\|def)>', 'W')<cr>
|
let b:next_toplevel='\v%$\|^(class\|def\|async def)>'
|
||||||
nnoremap <silent> <buffer> [[ :call <SID>Python_jump('n', '\v^(class\|def)>', 'Wb')<cr>
|
let b:prev_toplevel='\v^(class\|def\|async def)>'
|
||||||
nnoremap <silent> <buffer> ]m :call <SID>Python_jump('n', '\v%$\|^\s*(class\|def)>', 'W')<cr>
|
let b:next='\v%$\|^\s*(class\|def\|async def)>'
|
||||||
nnoremap <silent> <buffer> [m :call <SID>Python_jump('n', '\v^\s*(class\|def)>', 'Wb')<cr>
|
let b:prev='\v^\s*(class\|def\|async def)>'
|
||||||
|
|
||||||
xnoremap <silent> <buffer> ]] :call <SID>Python_jump('x', '\v%$\|^(class\|def)>', 'W')<cr>
|
execute "nnoremap <silent> <buffer> ]] :call <SID>Python_jump('n', '". b:next_toplevel."', 'W')<cr>"
|
||||||
xnoremap <silent> <buffer> [[ :call <SID>Python_jump('x', '\v^(class\|def)>', 'Wb')<cr>
|
execute "nnoremap <silent> <buffer> [[ :call <SID>Python_jump('n', '". b:prev_toplevel."', 'Wb')<cr>"
|
||||||
xnoremap <silent> <buffer> ]m :call <SID>Python_jump('x', '\v%$\|^\s*(class\|def)>', 'W')<cr>
|
execute "nnoremap <silent> <buffer> ]m :call <SID>Python_jump('n', '". b:next."', 'W')<cr>"
|
||||||
xnoremap <silent> <buffer> [m :call <SID>Python_jump('x', '\v^\s*(class\|def)>', 'Wb')<cr>
|
execute "nnoremap <silent> <buffer> [m :call <SID>Python_jump('n', '". b:prev."', 'Wb')<cr>"
|
||||||
|
|
||||||
|
execute "onoremap <silent> <buffer> ]] :call <SID>Python_jump('o', '". b:next_toplevel."', 'W')<cr>"
|
||||||
|
execute "onoremap <silent> <buffer> [[ :call <SID>Python_jump('o', '". b:prev_toplevel."', 'Wb')<cr>"
|
||||||
|
execute "onoremap <silent> <buffer> ]m :call <SID>Python_jump('o', '". b:next."', 'W')<cr>"
|
||||||
|
execute "onoremap <silent> <buffer> [m :call <SID>Python_jump('o', '". b:prev."', 'Wb')<cr>"
|
||||||
|
|
||||||
|
execute "xnoremap <silent> <buffer> ]] :call <SID>Python_jump('x', '". b:next_toplevel."', 'W')<cr>"
|
||||||
|
execute "xnoremap <silent> <buffer> [[ :call <SID>Python_jump('x', '". b:prev_toplevel."', 'Wb')<cr>"
|
||||||
|
execute "xnoremap <silent> <buffer> ]m :call <SID>Python_jump('x', '". b:next."', 'W')<cr>"
|
||||||
|
execute "xnoremap <silent> <buffer> [m :call <SID>Python_jump('x', '". b:prev."', 'Wb')<cr>"
|
||||||
|
|
||||||
if !exists('*<SID>Python_jump')
|
if !exists('*<SID>Python_jump')
|
||||||
fun! <SID>Python_jump(mode, motion, flags) range
|
fun! <SID>Python_jump(mode, motion, flags) range
|
||||||
@ -56,8 +66,10 @@ if has("browsefilter") && !exists("b:browsefilter")
|
|||||||
\ "All Files (*.*)\t*.*\n"
|
\ "All Files (*.*)\t*.*\n"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" As suggested by PEP8.
|
if !exists("g:python_recommended_style") || g:python_recommended_style != 0
|
||||||
setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8
|
" As suggested by PEP8.
|
||||||
|
setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8
|
||||||
|
endif
|
||||||
|
|
||||||
" First time: try finding "pydoc".
|
" First time: try finding "pydoc".
|
||||||
if !exists('g:pydoc_executable')
|
if !exists('g:pydoc_executable')
|
||||||
|
@ -28,12 +28,13 @@ if exists("loaded_matchit") && !exists("b:match_words")
|
|||||||
\ ':' .
|
\ ':' .
|
||||||
\ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' .
|
\ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' .
|
||||||
\ ':' .
|
\ ':' .
|
||||||
\ '\<end\>' .
|
\ '\%(^\|[^.\:@$]\)\@<=\<end\:\@!\>' .
|
||||||
\ ',{:},\[:\],(:)'
|
\ ',{:},\[:\],(:)'
|
||||||
|
|
||||||
let b:match_skip =
|
let b:match_skip =
|
||||||
\ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" .
|
\ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" .
|
||||||
\ "\\<ruby\\%(String\\|StringDelimiter\\|ASCIICode\\|Escape\\|" .
|
\ "\\<ruby\\%(String\\|StringDelimiter\\|ASCIICode\\|Escape\\|" .
|
||||||
|
\ "Regexp\\|RegexpDelimiter\\|" .
|
||||||
\ "Interpolation\\|NoInterpolation\\|Comment\\|Documentation\\|" .
|
\ "Interpolation\\|NoInterpolation\\|Comment\\|Documentation\\|" .
|
||||||
\ "ConditionalModifier\\|RepeatModifier\\|OptionalDo\\|" .
|
\ "ConditionalModifier\\|RepeatModifier\\|OptionalDo\\|" .
|
||||||
\ "Function\\|BlockArgument\\|KeywordAsMethod\\|ClassVariable\\|" .
|
\ "Function\\|BlockArgument\\|KeywordAsMethod\\|ClassVariable\\|" .
|
||||||
@ -43,7 +44,7 @@ endif
|
|||||||
setlocal formatoptions-=t formatoptions+=croql
|
setlocal formatoptions-=t formatoptions+=croql
|
||||||
|
|
||||||
setlocal include=^\\s*\\<\\(load\\>\\\|require\\>\\\|autoload\\s*:\\=[\"']\\=\\h\\w*[\"']\\=,\\)
|
setlocal include=^\\s*\\<\\(load\\>\\\|require\\>\\\|autoload\\s*:\\=[\"']\\=\\h\\w*[\"']\\=,\\)
|
||||||
setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.rb','')
|
setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'\%(\.rb\)\=$','.rb','')
|
||||||
setlocal suffixesadd=.rb
|
setlocal suffixesadd=.rb
|
||||||
|
|
||||||
if exists("&ofu") && has("ruby")
|
if exists("&ofu") && has("ruby")
|
||||||
@ -66,32 +67,32 @@ if !exists('g:ruby_version_paths')
|
|||||||
let g:ruby_version_paths = {}
|
let g:ruby_version_paths = {}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! s:query_path(root)
|
function! s:query_path(root) abort
|
||||||
let code = "print $:.join %q{,}"
|
let code = "print $:.join %q{,}"
|
||||||
if &shell =~# 'sh' && $PATH !~# '\s'
|
if &shell =~# 'sh'
|
||||||
let prefix = 'env PATH='.$PATH.' '
|
let prefix = 'env PATH='.shellescape($PATH).' '
|
||||||
else
|
else
|
||||||
let prefix = ''
|
let prefix = ''
|
||||||
endif
|
endif
|
||||||
if &shellxquote == "'"
|
if &shellxquote == "'"
|
||||||
let path_check = prefix.'ruby -e "' . code . '"'
|
let path_check = prefix.'ruby --disable-gems -e "' . code . '"'
|
||||||
else
|
else
|
||||||
let path_check = prefix."ruby -e '" . code . "'"
|
let path_check = prefix."ruby --disable-gems -e '" . code . "'"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let cd = haslocaldir() ? 'lcd' : 'cd'
|
let cd = haslocaldir() ? 'lcd' : 'cd'
|
||||||
let cwd = getcwd()
|
let cwd = fnameescape(getcwd())
|
||||||
try
|
try
|
||||||
exe cd fnameescape(a:root)
|
exe cd fnameescape(a:root)
|
||||||
let path = split(system(path_check),',')
|
let path = split(system(path_check),',')
|
||||||
exe cd fnameescape(cwd)
|
exe cd cwd
|
||||||
return path
|
return path
|
||||||
finally
|
finally
|
||||||
exe cd fnameescape(cwd)
|
exe cd cwd
|
||||||
endtry
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:build_path(path)
|
function! s:build_path(path) abort
|
||||||
let path = join(map(copy(a:path), 'v:val ==# "." ? "" : v:val'), ',')
|
let path = join(map(copy(a:path), 'v:val ==# "." ? "" : v:val'), ',')
|
||||||
if &g:path !~# '\v^\.%(,/%(usr|emx)/include)=,,$'
|
if &g:path !~# '\v^\.%(,/%(usr|emx)/include)=,,$'
|
||||||
let path = substitute(&g:path,',,$',',','') . ',' . path
|
let path = substitute(&g:path,',,$',',','') . ',' . path
|
||||||
@ -101,7 +102,7 @@ endfunction
|
|||||||
|
|
||||||
if !exists('b:ruby_version') && !exists('g:ruby_path') && isdirectory(expand('%:p:h'))
|
if !exists('b:ruby_version') && !exists('g:ruby_path') && isdirectory(expand('%:p:h'))
|
||||||
let s:version_file = findfile('.ruby-version', '.;')
|
let s:version_file = findfile('.ruby-version', '.;')
|
||||||
if !empty(s:version_file)
|
if !empty(s:version_file) && filereadable(s:version_file)
|
||||||
let b:ruby_version = get(readfile(s:version_file, '', 1), '')
|
let b:ruby_version = get(readfile(s:version_file, '', 1), '')
|
||||||
if !has_key(g:ruby_version_paths, b:ruby_version)
|
if !has_key(g:ruby_version_paths, b:ruby_version)
|
||||||
let g:ruby_version_paths[b:ruby_version] = s:query_path(fnamemodify(s:version_file, ':p:h'))
|
let g:ruby_version_paths[b:ruby_version] = s:query_path(fnamemodify(s:version_file, ':p:h'))
|
||||||
@ -135,7 +136,7 @@ if exists('s:ruby_paths') && stridx(&l:tags, join(map(copy(s:ruby_paths),'v:val.
|
|||||||
let &l:tags = &tags . ',' . join(map(copy(s:ruby_paths),'v:val."/tags"'),',')
|
let &l:tags = &tags . ',' . join(map(copy(s:ruby_paths),'v:val."/tags"'),',')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if has("gui_win32") && !exists("b:browsefilter")
|
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||||
let b:browsefilter = "Ruby Source Files (*.rb)\t*.rb\n" .
|
let b:browsefilter = "Ruby Source Files (*.rb)\t*.rb\n" .
|
||||||
\ "All Files (*.*)\t*.*\n"
|
\ "All Files (*.*)\t*.*\n"
|
||||||
endif
|
endif
|
||||||
@ -145,7 +146,22 @@ let b:undo_ftplugin = "setl fo< inc< inex< sua< def< com< cms< path< tags< kp<"
|
|||||||
\."| if exists('&ofu') && has('ruby') | setl ofu< | endif"
|
\."| if exists('&ofu') && has('ruby') | setl ofu< | endif"
|
||||||
\."| if has('balloon_eval') && exists('+bexpr') | setl bexpr< | endif"
|
\."| if has('balloon_eval') && exists('+bexpr') | setl bexpr< | endif"
|
||||||
|
|
||||||
|
function! s:map(mode, flags, map) abort
|
||||||
|
let from = matchstr(a:map, '\S\+')
|
||||||
|
if empty(mapcheck(from, a:mode))
|
||||||
|
exe a:mode.'map' '<buffer>'.(a:0 ? a:1 : '') a:map
|
||||||
|
let b:undo_ftplugin .= '|sil! '.a:mode.'unmap <buffer> '.from
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
cmap <buffer><script><expr> <Plug><cword> substitute(RubyCursorIdentifier(),'^$',"\022\027",'')
|
||||||
|
cmap <buffer><script><expr> <Plug><cfile> substitute(RubyCursorFile(),'^$',"\022\006",'')
|
||||||
|
let b:undo_ftplugin .= "| sil! cunmap <buffer> <Plug><cword>| sil! cunmap <buffer> <Plug><cfile>"
|
||||||
|
|
||||||
if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
|
if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
|
||||||
|
nmap <buffer><script> <SID>: :<C-U>
|
||||||
|
nmap <buffer><script> <SID>c: :<C-U><C-R>=v:count ? v:count : ''<CR>
|
||||||
|
|
||||||
nnoremap <silent> <buffer> [m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','b','n')<CR>
|
nnoremap <silent> <buffer> [m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','b','n')<CR>
|
||||||
nnoremap <silent> <buffer> ]m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','','n')<CR>
|
nnoremap <silent> <buffer> ]m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','','n')<CR>
|
||||||
nnoremap <silent> <buffer> [M :<C-U>call <SID>searchsyn('\<end\>','rubyDefine','b','n')<CR>
|
nnoremap <silent> <buffer> [M :<C-U>call <SID>searchsyn('\<end\>','rubyDefine','b','n')<CR>
|
||||||
@ -168,7 +184,7 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
|
|||||||
\."| sil! exe 'unmap <buffer> [[' | sil! exe 'unmap <buffer> ]]' | sil! exe 'unmap <buffer> []' | sil! exe 'unmap <buffer> ]['"
|
\."| sil! exe 'unmap <buffer> [[' | sil! exe 'unmap <buffer> ]]' | sil! exe 'unmap <buffer> []' | sil! exe 'unmap <buffer> ]['"
|
||||||
\."| sil! exe 'unmap <buffer> [m' | sil! exe 'unmap <buffer> ]m' | sil! exe 'unmap <buffer> [M' | sil! exe 'unmap <buffer> ]M'"
|
\."| sil! exe 'unmap <buffer> [m' | sil! exe 'unmap <buffer> ]m' | sil! exe 'unmap <buffer> [M' | sil! exe 'unmap <buffer> ]M'"
|
||||||
|
|
||||||
if maparg('im','n') == ''
|
if maparg('im','x') == '' && maparg('im','o') == '' && maparg('am','x') == '' && maparg('am','o') == ''
|
||||||
onoremap <silent> <buffer> im :<C-U>call <SID>wrap_i('[m',']M')<CR>
|
onoremap <silent> <buffer> im :<C-U>call <SID>wrap_i('[m',']M')<CR>
|
||||||
onoremap <silent> <buffer> am :<C-U>call <SID>wrap_a('[m',']M')<CR>
|
onoremap <silent> <buffer> am :<C-U>call <SID>wrap_a('[m',']M')<CR>
|
||||||
xnoremap <silent> <buffer> im :<C-U>call <SID>wrap_i('[m',']M')<CR>
|
xnoremap <silent> <buffer> im :<C-U>call <SID>wrap_i('[m',']M')<CR>
|
||||||
@ -178,7 +194,7 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
|
|||||||
\."| sil! exe 'xunmap <buffer> im' | sil! exe 'xunmap <buffer> am'"
|
\."| sil! exe 'xunmap <buffer> im' | sil! exe 'xunmap <buffer> am'"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if maparg('iM','n') == ''
|
if maparg('iM','x') == '' && maparg('iM','o') == '' && maparg('aM','x') == '' && maparg('aM','o') == ''
|
||||||
onoremap <silent> <buffer> iM :<C-U>call <SID>wrap_i('[[','][')<CR>
|
onoremap <silent> <buffer> iM :<C-U>call <SID>wrap_i('[[','][')<CR>
|
||||||
onoremap <silent> <buffer> aM :<C-U>call <SID>wrap_a('[[','][')<CR>
|
onoremap <silent> <buffer> aM :<C-U>call <SID>wrap_a('[[','][')<CR>
|
||||||
xnoremap <silent> <buffer> iM :<C-U>call <SID>wrap_i('[[','][')<CR>
|
xnoremap <silent> <buffer> iM :<C-U>call <SID>wrap_i('[[','][')<CR>
|
||||||
@ -188,33 +204,24 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
|
|||||||
\."| sil! exe 'xunmap <buffer> iM' | sil! exe 'xunmap <buffer> aM'"
|
\."| sil! exe 'xunmap <buffer> iM' | sil! exe 'xunmap <buffer> aM'"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if maparg("\<C-]>",'n') == ''
|
call s:map('c', '', '<C-R><C-W> <Plug><cword>')
|
||||||
nnoremap <silent> <buffer> <C-]> :<C-U>exe v:count1."tag <C-R>=RubyCursorIdentifier()<CR>"<CR>
|
call s:map('c', '', '<C-R><C-F> <Plug><cfile>')
|
||||||
nnoremap <silent> <buffer> g<C-]> :<C-U>exe "tjump <C-R>=RubyCursorIdentifier()<CR>"<CR>
|
|
||||||
nnoremap <silent> <buffer> g] :<C-U>exe "tselect <C-R>=RubyCursorIdentifier()<CR>"<CR>
|
|
||||||
nnoremap <silent> <buffer> <C-W>] :<C-U>exe v:count1."stag <C-R>=RubyCursorIdentifier()<CR>"<CR>
|
|
||||||
nnoremap <silent> <buffer> <C-W><C-]> :<C-U>exe v:count1."stag <C-R>=RubyCursorIdentifier()<CR>"<CR>
|
|
||||||
nnoremap <silent> <buffer> <C-W>g<C-]> :<C-U>exe "stjump <C-R>=RubyCursorIdentifier()<CR>"<CR>
|
|
||||||
nnoremap <silent> <buffer> <C-W>g] :<C-U>exe "stselect <C-R>=RubyCursorIdentifier()<CR>"<CR>
|
|
||||||
nnoremap <silent> <buffer> <C-W>} :<C-U>exe "ptag <C-R>=RubyCursorIdentifier()<CR>"<CR>
|
|
||||||
nnoremap <silent> <buffer> <C-W>g} :<C-U>exe "ptjump <C-R>=RubyCursorIdentifier()<CR>"<CR>
|
|
||||||
let b:undo_ftplugin = b:undo_ftplugin
|
|
||||||
\."| sil! exe 'nunmap <buffer> <C-]>'| sil! exe 'nunmap <buffer> g<C-]>'| sil! exe 'nunmap <buffer> g]'"
|
|
||||||
\."| sil! exe 'nunmap <buffer> <C-W>]'| sil! exe 'nunmap <buffer> <C-W><C-]>'"
|
|
||||||
\."| sil! exe 'nunmap <buffer> <C-W>g<C-]>'| sil! exe 'nunmap <buffer> <C-W>g]'"
|
|
||||||
\."| sil! exe 'nunmap <buffer> <C-W>}'| sil! exe 'nunmap <buffer> <C-W>g}'"
|
|
||||||
endif
|
|
||||||
|
|
||||||
if maparg("gf",'n') == ''
|
cmap <buffer><script><expr> <SID>tagzv &foldopen =~# 'tag' ? '<Bar>norm! zv' : ''
|
||||||
" By using findfile() rather than gf's normal behavior, we prevent
|
call s:map('n', '<silent>', '<C-]> <SID>:exe v:count1."tag <Plug><cword>"<SID>tagzv<CR>')
|
||||||
" erroneously editing a directory.
|
call s:map('n', '<silent>', 'g<C-]> <SID>:exe "tjump <Plug><cword>"<SID>tagzv<CR>')
|
||||||
nnoremap <silent> <buffer> gf :<C-U>exe <SID>gf(v:count1,"gf",'edit')<CR>
|
call s:map('n', '<silent>', 'g] <SID>:exe "tselect <Plug><cword>"<SID>tagzv<CR>')
|
||||||
nnoremap <silent> <buffer> <C-W>f :<C-U>exe <SID>gf(v:count1,"\<Lt>C-W>f",'split')<CR>
|
call s:map('n', '<silent>', '<C-W>] <SID>:exe v:count1."stag <Plug><cword>"<SID>tagzv<CR>')
|
||||||
nnoremap <silent> <buffer> <C-W><C-F> :<C-U>exe <SID>gf(v:count1,"\<Lt>C-W>\<Lt>C-F>",'split')<CR>
|
call s:map('n', '<silent>', '<C-W><C-]> <SID>:exe v:count1."stag <Plug><cword>"<SID>tagzv<CR>')
|
||||||
nnoremap <silent> <buffer> <C-W>gf :<C-U>exe <SID>gf(v:count1,"\<Lt>C-W>gf",'tabedit')<CR>
|
call s:map('n', '<silent>', '<C-W>g<C-]> <SID>:exe "stjump <Plug><cword>"<SID>tagzv<CR>')
|
||||||
let b:undo_ftplugin = b:undo_ftplugin
|
call s:map('n', '<silent>', '<C-W>g] <SID>:exe "stselect <Plug><cword>"<SID>tagzv<CR>')
|
||||||
\."| sil! exe 'nunmap <buffer> gf' | sil! exe 'nunmap <buffer> <C-W>f' | sil! exe 'nunmap <buffer> <C-W><C-F>' | sil! exe 'nunmap <buffer> <C-W>gf'"
|
call s:map('n', '<silent>', '<C-W>} <SID>:exe v:count1."ptag <Plug><cword>"<CR>')
|
||||||
endif
|
call s:map('n', '<silent>', '<C-W>g} <SID>:exe "ptjump <Plug><cword>"<CR>')
|
||||||
|
|
||||||
|
call s:map('n', '<silent>', 'gf <SID>c:find <Plug><cfile><CR>')
|
||||||
|
call s:map('n', '<silent>', '<C-W>f <SID>c:sfind <Plug><cfile><CR>')
|
||||||
|
call s:map('n', '<silent>', '<C-W><C-F> <SID>c:sfind <Plug><cfile><CR>')
|
||||||
|
call s:map('n', '<silent>', '<C-W>gf <SID>c:tabfind <Plug><cfile><CR>')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
let &cpo = s:cpo_save
|
||||||
@ -225,7 +232,7 @@ if exists("g:did_ruby_ftplugin_functions")
|
|||||||
endif
|
endif
|
||||||
let g:did_ruby_ftplugin_functions = 1
|
let g:did_ruby_ftplugin_functions = 1
|
||||||
|
|
||||||
function! RubyBalloonexpr()
|
function! RubyBalloonexpr() abort
|
||||||
if !exists('s:ri_found')
|
if !exists('s:ri_found')
|
||||||
let s:ri_found = executable('ri')
|
let s:ri_found = executable('ri')
|
||||||
endif
|
endif
|
||||||
@ -274,13 +281,13 @@ function! RubyBalloonexpr()
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:searchsyn(pattern,syn,flags,mode)
|
function! s:searchsyn(pattern, syn, flags, mode) abort
|
||||||
|
let cnt = v:count1
|
||||||
norm! m'
|
norm! m'
|
||||||
if a:mode ==# 'v'
|
if a:mode ==# 'v'
|
||||||
norm! gv
|
norm! gv
|
||||||
endif
|
endif
|
||||||
let i = 0
|
let i = 0
|
||||||
let cnt = v:count ? v:count : 1
|
|
||||||
while i < cnt
|
while i < cnt
|
||||||
let i = i + 1
|
let i = i + 1
|
||||||
let line = line('.')
|
let line = line('.')
|
||||||
@ -296,11 +303,11 @@ function! s:searchsyn(pattern,syn,flags,mode)
|
|||||||
endwhile
|
endwhile
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:synname()
|
function! s:synname() abort
|
||||||
return synIDattr(synID(line('.'),col('.'),0),'name')
|
return synIDattr(synID(line('.'),col('.'),0),'name')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:wrap_i(back,forward)
|
function! s:wrap_i(back,forward) abort
|
||||||
execute 'norm k'.a:forward
|
execute 'norm k'.a:forward
|
||||||
let line = line('.')
|
let line = line('.')
|
||||||
execute 'norm '.a:back
|
execute 'norm '.a:back
|
||||||
@ -310,7 +317,7 @@ function! s:wrap_i(back,forward)
|
|||||||
execute 'norm jV'.a:forward.'k'
|
execute 'norm jV'.a:forward.'k'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:wrap_a(back,forward)
|
function! s:wrap_a(back,forward) abort
|
||||||
execute 'norm '.a:forward
|
execute 'norm '.a:forward
|
||||||
if line('.') < line('$') && getline(line('.')+1) ==# ''
|
if line('.') < line('$') && getline(line('.')+1) ==# ''
|
||||||
let after = 1
|
let after = 1
|
||||||
@ -328,37 +335,55 @@ function! s:wrap_a(back,forward)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! RubyCursorIdentifier()
|
function! RubyCursorIdentifier() abort
|
||||||
let asciicode = '\%(\w\|[]})\"'."'".']\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)'
|
let asciicode = '\%(\w\|[]})\"'."'".']\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)'
|
||||||
let number = '\%(\%(\w\|[]})\"'."'".']\s*\)\@<!-\)\=\%(\<[[:digit:]_]\+\%(\.[[:digit:]_]\+\)\=\%([Ee][[:digit:]_]\+\)\=\>\|\<0[xXbBoOdD][[:xdigit:]_]\+\>\)\|'.asciicode
|
let number = '\%(\%(\w\|[]})\"'."'".']\s*\)\@<!-\)\=\%(\<[[:digit:]_]\+\%(\.[[:digit:]_]\+\)\=\%([Ee][[:digit:]_]\+\)\=\>\|\<0[xXbBoOdD][[:xdigit:]_]\+\>\)\|'.asciicode
|
||||||
let operator = '\%(\[\]\|<<\|<=>\|[!<>]=\=\|===\=\|[!=]\~\|>>\|\*\*\|\.\.\.\=\|=>\|[~^&|*/%+-]\)'
|
let operator = '\%(\[\]\|<<\|<=>\|[!<>]=\=\|===\=\|[!=]\~\|>>\|\*\*\|\.\.\.\=\|=>\|[~^&|*/%+-]\)'
|
||||||
let method = '\%(\<[_a-zA-Z]\w*\>\%([?!]\|\s*=>\@!\)\=\)'
|
let method = '\%(\.[_a-zA-Z]\w*\s*=>\@!\|\<[_a-zA-Z]\w*\>[?!]\=\)'
|
||||||
let global = '$\%([!$&"'."'".'*+,./:;<=>?@\`~]\|-\=\w\+\>\)'
|
let global = '$\%([!$&"'."'".'*+,./:;<=>?@\`~]\|-\=\w\+\>\)'
|
||||||
let symbolizable = '\%(\%(@@\=\)\w\+\>\|'.global.'\|'.method.'\|'.operator.'\)'
|
let symbolizable = '\%(\%(@@\=\)\w\+\>\|'.global.'\|'.method.'\|'.operator.'\)'
|
||||||
let pattern = '\C\s*\%('.number.'\|\%(:\@<!:\)\='.symbolizable.'\)'
|
let pattern = '\C\s*\%('.number.'\|\%(:\@<!:\)\='.symbolizable.'\)'
|
||||||
let [lnum, col] = searchpos(pattern,'bcn',line('.'))
|
let [lnum, col] = searchpos(pattern,'bcn',line('.'))
|
||||||
let raw = matchstr(getline('.')[col-1 : ],pattern)
|
let raw = matchstr(getline('.')[col-1 : ],pattern)
|
||||||
let stripped = substitute(substitute(raw,'\s\+=$','=',''),'^\s*:\=','','')
|
let stripped = substitute(substitute(raw,'\s\+=$','=',''),'^\s*[:.]\=','','')
|
||||||
return stripped == '' ? expand("<cword>") : stripped
|
return stripped == '' ? expand("<cword>") : stripped
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:gf(count,map,edit) abort
|
function! RubyCursorFile() abort
|
||||||
if getline('.') =~# '^\s*require_relative\s*\(["'']\).*\1\s*$'
|
let isfname = &isfname
|
||||||
let target = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1')
|
try
|
||||||
return a:edit.' %:h/'.target.'.rb'
|
set isfname+=:
|
||||||
elseif getline('.') =~# '^\s*\%(require[( ]\|load[( ]\|autoload[( ]:\w\+,\)\s*\s*\%(::\)\=File\.expand_path(\(["'']\)\.\./.*\1,\s*__FILE__)\s*$'
|
let cfile = expand('<cfile>')
|
||||||
let target = matchstr(getline('.'),'\(["'']\)\.\./\zs.\{-\}\ze\1')
|
finally
|
||||||
return a:edit.' %:h/'.target.'.rb'
|
let isfname = &isfname
|
||||||
|
endtry
|
||||||
|
let pre = matchstr(strpart(getline('.'), 0, col('.')-1), '.*\f\@<!')
|
||||||
|
let post = matchstr(strpart(getline('.'), col('.')), '\f\@!.*')
|
||||||
|
let ext = getline('.') =~# '^\s*\%(require\%(_relative\)\=\|autoload\)\>' && cfile !~# '\.rb$' ? '.rb' : ''
|
||||||
|
if s:synname() ==# 'rubyConstant'
|
||||||
|
let cfile = substitute(cfile,'\.\w\+[?!=]\=$','','')
|
||||||
|
let cfile = substitute(cfile,'::','/','g')
|
||||||
|
let cfile = substitute(cfile,'\(\u\+\)\(\u\l\)','\1_\2', 'g')
|
||||||
|
let cfile = substitute(cfile,'\(\l\|\d\)\(\u\)','\1_\2', 'g')
|
||||||
|
return tolower(cfile) . '.rb'
|
||||||
|
elseif getline('.') =~# '^\s*require_relative\s*\(["'']\).*\1\s*$'
|
||||||
|
let cfile = expand('%:p:h') . '/' . matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1') . ext
|
||||||
|
elseif getline('.') =~# '^\s*\%(require[( ]\|load[( ]\|autoload[( ]:\w\+,\)\s*\%(::\)\=File\.expand_path(\(["'']\)\.\./.*\1,\s*__FILE__)\s*$'
|
||||||
|
let target = matchstr(getline('.'),'\(["'']\)\.\.\zs/.\{-\}\ze\1')
|
||||||
|
let cfile = expand('%:p:h') . target . ext
|
||||||
elseif getline('.') =~# '^\s*\%(require \|load \|autoload :\w\+,\)\s*\(["'']\).*\1\s*$'
|
elseif getline('.') =~# '^\s*\%(require \|load \|autoload :\w\+,\)\s*\(["'']\).*\1\s*$'
|
||||||
let target = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1')
|
let cfile = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1') . ext
|
||||||
|
elseif pre.post =~# '\<File.expand_path[( ].*[''"]\{2\}, *__FILE__\>' && cfile =~# '^\.\.'
|
||||||
|
let cfile = expand('%:p:h') . strpart(cfile, 2)
|
||||||
else
|
else
|
||||||
let target = expand('<cfile>')
|
return substitute(cfile, '\C\v^(.*):(\d+)%(:in)=$', '+\2 \1', '')
|
||||||
endif
|
endif
|
||||||
let found = findfile(target, &path, a:count)
|
let cwdpat = '^\M' . substitute(getcwd(), '[\/]', '\\[\\/]', 'g').'\ze\[\/]'
|
||||||
if found ==# ''
|
let cfile = substitute(cfile, cwdpat, '.', '')
|
||||||
return 'norm! '.a:count.a:map
|
if fnameescape(cfile) !=# cfile
|
||||||
|
return '+ '.fnameescape(cfile)
|
||||||
else
|
else
|
||||||
return a:edit.' '.fnameescape(found)
|
return cfile
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Vim filetype plugin
|
" Vim filetype plugin
|
||||||
" Language: Sass
|
" Language: Sass
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2010 Jul 26
|
" Last Change: 2016 Aug 29
|
||||||
|
|
||||||
" Only do this when not done yet for this buffer
|
" Only do this when not done yet for this buffer
|
||||||
if exists("b:did_ftplugin")
|
if exists("b:did_ftplugin")
|
||||||
@ -9,8 +9,9 @@ if exists("b:did_ftplugin")
|
|||||||
endif
|
endif
|
||||||
let b:did_ftplugin = 1
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
let b:undo_ftplugin = "setl cms< def< inc< inex< ofu< sua<"
|
let b:undo_ftplugin = "setl com< cms< def< inc< inex< ofu< sua<"
|
||||||
|
|
||||||
|
setlocal comments=://
|
||||||
setlocal commentstring=//\ %s
|
setlocal commentstring=//\ %s
|
||||||
setlocal define=^\\s*\\%(@mixin\\\|=\\)
|
setlocal define=^\\s*\\%(@mixin\\\|=\\)
|
||||||
setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','')
|
setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','')
|
||||||
|
@ -32,6 +32,4 @@ setlocal includeexpr='substitute(v:fname,"\\.","/","g")'
|
|||||||
setlocal path+=src/main/scala,src/test/scala
|
setlocal path+=src/main/scala,src/test/scala
|
||||||
setlocal suffixesadd=.scala
|
setlocal suffixesadd=.scala
|
||||||
|
|
||||||
compiler sbt
|
|
||||||
|
|
||||||
" vim:set sw=2 sts=2 ts=8 et:
|
" vim:set sw=2 sts=2 ts=8 et:
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
" Vim filetype plugin
|
" Vim filetype plugin
|
||||||
" Language: SCSS
|
" Language: SCSS
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2010 Jul 26
|
" Last Change: 2016 Aug 29
|
||||||
|
|
||||||
if exists("b:did_ftplugin")
|
if exists("b:did_ftplugin")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
runtime! ftplugin/sass.vim
|
runtime! ftplugin/sass.vim
|
||||||
|
setlocal comments=s1:/*,mb:*,ex:*/,://
|
||||||
|
|
||||||
" vim:set sw=2:
|
" vim:set sw=2:
|
||||||
|
@ -16,7 +16,7 @@ if exists("*CdlGetIndent")
|
|||||||
"finish
|
"finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" find out if an "...=..." expresion its an asignment (or a conditional)
|
" find out if an "...=..." expresion is an assignment (or a conditional)
|
||||||
" it scans 'line' first, and then the previos lines
|
" it scans 'line' first, and then the previos lines
|
||||||
fun! CdlAsignment(lnum, line)
|
fun! CdlAsignment(lnum, line)
|
||||||
let f = -1
|
let f = -1
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Vim indent file
|
" Vim indent file
|
||||||
" Language: Cucumber
|
" Language: Cucumber
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2013 May 30
|
" Last Change: 2016 Aug 29
|
||||||
|
|
||||||
if exists("b:did_indent")
|
if exists("b:did_indent")
|
||||||
finish
|
finish
|
||||||
@ -27,6 +27,7 @@ function! GetCucumberIndent()
|
|||||||
let line = getline(prevnonblank(v:lnum-1))
|
let line = getline(prevnonblank(v:lnum-1))
|
||||||
let cline = getline(v:lnum)
|
let cline = getline(v:lnum)
|
||||||
let nline = getline(nextnonblank(v:lnum+1))
|
let nline = getline(nextnonblank(v:lnum+1))
|
||||||
|
let sw = exists('*shiftwidth') ? shiftwidth() : &sw
|
||||||
let syn = s:syn(prevnonblank(v:lnum-1))
|
let syn = s:syn(prevnonblank(v:lnum-1))
|
||||||
let csyn = s:syn(v:lnum)
|
let csyn = s:syn(v:lnum)
|
||||||
let nsyn = s:syn(nextnonblank(v:lnum+1))
|
let nsyn = s:syn(nextnonblank(v:lnum+1))
|
||||||
@ -35,38 +36,38 @@ function! GetCucumberIndent()
|
|||||||
return 0
|
return 0
|
||||||
elseif csyn ==# 'cucumberExamples' || cline =~# '^\s*\%(Examples\|Scenarios\):'
|
elseif csyn ==# 'cucumberExamples' || cline =~# '^\s*\%(Examples\|Scenarios\):'
|
||||||
" examples heading
|
" examples heading
|
||||||
return 2 * &sw
|
return 2 * sw
|
||||||
elseif csyn =~# '^cucumber\%(Background\|Scenario\|ScenarioOutline\)$' || cline =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):'
|
elseif csyn =~# '^cucumber\%(Background\|Scenario\|ScenarioOutline\)$' || cline =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):'
|
||||||
" background, scenario or outline heading
|
" background, scenario or outline heading
|
||||||
return &sw
|
return sw
|
||||||
elseif syn ==# 'cucumberFeature' || line =~# '^\s*Feature:'
|
elseif syn ==# 'cucumberFeature' || line =~# '^\s*Feature:'
|
||||||
" line after feature heading
|
" line after feature heading
|
||||||
return &sw
|
return sw
|
||||||
elseif syn ==# 'cucumberExamples' || line =~# '^\s*\%(Examples\|Scenarios\):'
|
elseif syn ==# 'cucumberExamples' || line =~# '^\s*\%(Examples\|Scenarios\):'
|
||||||
" line after examples heading
|
" line after examples heading
|
||||||
return 3 * &sw
|
return 3 * sw
|
||||||
elseif syn =~# '^cucumber\%(Background\|Scenario\|ScenarioOutline\)$' || line =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):'
|
elseif syn =~# '^cucumber\%(Background\|Scenario\|ScenarioOutline\)$' || line =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):'
|
||||||
" line after background, scenario or outline heading
|
" line after background, scenario or outline heading
|
||||||
return 2 * &sw
|
return 2 * sw
|
||||||
elseif cline =~# '^\s*[@#]' && (nsyn == 'cucumberFeature' || nline =~# '^\s*Feature:' || indent(prevnonblank(v:lnum-1)) <= 0)
|
elseif cline =~# '^\s*[@#]' && (nsyn == 'cucumberFeature' || nline =~# '^\s*Feature:' || indent(prevnonblank(v:lnum-1)) <= 0)
|
||||||
" tag or comment before a feature heading
|
" tag or comment before a feature heading
|
||||||
return 0
|
return 0
|
||||||
elseif cline =~# '^\s*@'
|
elseif cline =~# '^\s*@'
|
||||||
" other tags
|
" other tags
|
||||||
return &sw
|
return sw
|
||||||
elseif cline =~# '^\s*[#|]' && line =~# '^\s*|'
|
elseif cline =~# '^\s*[#|]' && line =~# '^\s*|'
|
||||||
" mid-table
|
" mid-table
|
||||||
" preserve indent
|
" preserve indent
|
||||||
return indent(prevnonblank(v:lnum-1))
|
return indent(prevnonblank(v:lnum-1))
|
||||||
elseif cline =~# '^\s*|' && line =~# '^\s*[^|]'
|
elseif cline =~# '^\s*|' && line =~# '^\s*[^|]'
|
||||||
" first line of a table, relative indent
|
" first line of a table, relative indent
|
||||||
return indent(prevnonblank(v:lnum-1)) + &sw
|
return indent(prevnonblank(v:lnum-1)) + sw
|
||||||
elseif cline =~# '^\s*[^|]' && line =~# '^\s*|'
|
elseif cline =~# '^\s*[^|]' && line =~# '^\s*|'
|
||||||
" line after a table, relative unindent
|
" line after a table, relative unindent
|
||||||
return indent(prevnonblank(v:lnum-1)) - &sw
|
return indent(prevnonblank(v:lnum-1)) - sw
|
||||||
elseif cline =~# '^\s*#' && getline(v:lnum-1) =~ '^\s*$' && (nsyn =~# '^cucumber\%(Background\|Scenario\|ScenarioOutline\)$' || nline =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):')
|
elseif cline =~# '^\s*#' && getline(v:lnum-1) =~ '^\s*$' && (nsyn =~# '^cucumber\%(Background\|Scenario\|ScenarioOutline\)$' || nline =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):')
|
||||||
" comments on scenarios
|
" comments on scenarios
|
||||||
return &sw
|
return sw
|
||||||
endif
|
endif
|
||||||
return indent(prevnonblank(v:lnum-1))
|
return indent(prevnonblank(v:lnum-1))
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -19,6 +19,9 @@ else
|
|||||||
endif
|
endif
|
||||||
unlet! b:did_indent
|
unlet! b:did_indent
|
||||||
|
|
||||||
|
" Force HTML indent to not keep state.
|
||||||
|
let b:html_indent_usestate = 0
|
||||||
|
|
||||||
if &l:indentexpr == ''
|
if &l:indentexpr == ''
|
||||||
if &l:cindent
|
if &l:cindent
|
||||||
let &l:indentexpr = 'cindent(v:lnum)'
|
let &l:indentexpr = 'cindent(v:lnum)'
|
||||||
@ -38,7 +41,18 @@ if exists("*GetErubyIndent")
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" this file uses line continuations
|
||||||
|
let s:cpo_sav = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
function! GetErubyIndent(...)
|
function! GetErubyIndent(...)
|
||||||
|
" The value of a single shift-width
|
||||||
|
if exists('*shiftwidth')
|
||||||
|
let sw = shiftwidth()
|
||||||
|
else
|
||||||
|
let sw = &sw
|
||||||
|
endif
|
||||||
|
|
||||||
if a:0 && a:1 == '.'
|
if a:0 && a:1 == '.'
|
||||||
let v:lnum = line('.')
|
let v:lnum = line('.')
|
||||||
elseif a:0 && a:1 =~ '^\d'
|
elseif a:0 && a:1 =~ '^\d'
|
||||||
@ -52,31 +66,44 @@ function! GetErubyIndent(...)
|
|||||||
let ind = GetRubyIndent(v:lnum)
|
let ind = GetRubyIndent(v:lnum)
|
||||||
else
|
else
|
||||||
exe "let ind = ".b:eruby_subtype_indentexpr
|
exe "let ind = ".b:eruby_subtype_indentexpr
|
||||||
|
|
||||||
|
" Workaround for Andy Wokula's HTML indent. This should be removed after
|
||||||
|
" some time, since the newest version is fixed in a different way.
|
||||||
|
if b:eruby_subtype_indentexpr =~# '^HtmlIndent('
|
||||||
|
\ && exists('b:indent')
|
||||||
|
\ && type(b:indent) == type({})
|
||||||
|
\ && has_key(b:indent, 'lnum')
|
||||||
|
" Force HTML indent to not keep state
|
||||||
|
let b:indent.lnum = -1
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
let lnum = prevnonblank(v:lnum-1)
|
let lnum = prevnonblank(v:lnum-1)
|
||||||
let line = getline(lnum)
|
let line = getline(lnum)
|
||||||
let cline = getline(v:lnum)
|
let cline = getline(v:lnum)
|
||||||
if cline =~# '^\s*<%[-=]\=\s*\%(}\|end\|else\|\%(ensure\|rescue\|elsif\|when\).\{-\}\)\s*\%([-=]\=%>\|$\)'
|
if cline =~# '^\s*<%[-=]\=\s*\%(}\|end\|else\|\%(ensure\|rescue\|elsif\|when\).\{-\}\)\s*\%([-=]\=%>\|$\)'
|
||||||
let ind = ind - &sw
|
let ind = ind - sw
|
||||||
endif
|
endif
|
||||||
if line =~# '\S\s*<%[-=]\=\s*\%(}\|end\).\{-\}\s*\%([-=]\=%>\|$\)'
|
if line =~# '\S\s*<%[-=]\=\s*\%(}\|end\).\{-\}\s*\%([-=]\=%>\|$\)'
|
||||||
let ind = ind - &sw
|
let ind = ind - sw
|
||||||
endif
|
endif
|
||||||
if line =~# '\%({\|\<do\)\%(\s*|[^|]*|\)\=\s*[-=]\=%>'
|
if line =~# '\%({\|\<do\)\%(\s*|[^|]*|\)\=\s*[-=]\=%>'
|
||||||
let ind = ind + &sw
|
let ind = ind + sw
|
||||||
elseif line =~# '<%[-=]\=\s*\%(module\|class\|def\|if\|for\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\)\>.*%>'
|
elseif line =~# '<%[-=]\=\s*\%(module\|class\|def\|if\|for\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\)\>.*%>'
|
||||||
let ind = ind + &sw
|
let ind = ind + sw
|
||||||
endif
|
endif
|
||||||
if line =~# '^\s*<%[=#-]\=\s*$' && cline !~# '^\s*end\>'
|
if line =~# '^\s*<%[=#-]\=\s*$' && cline !~# '^\s*end\>'
|
||||||
let ind = ind + &sw
|
let ind = ind + sw
|
||||||
endif
|
endif
|
||||||
if line !~# '^\s*<%' && line =~# '%>\s*$'
|
if line !~# '^\s*<%' && line =~# '%>\s*$' && line !~# '^\s*end\>'
|
||||||
let ind = ind - &sw
|
let ind = ind - sw
|
||||||
endif
|
endif
|
||||||
if cline =~# '^\s*[-=]\=%>\s*$'
|
if cline =~# '^\s*[-=]\=%>\s*$'
|
||||||
let ind = ind - &sw
|
let ind = ind - sw
|
||||||
endif
|
endif
|
||||||
return ind
|
return ind
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
let &cpo = s:cpo_sav
|
||||||
|
unlet! s:cpo_sav
|
||||||
|
|
||||||
" vim:set sw=2 sts=2 ts=8 noet:
|
" vim:set sw=2 sts=2 ts=8 noet:
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
" Vim indent file
|
" Vim indent file
|
||||||
" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77)
|
" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77)
|
||||||
" Version: 0.45
|
" Version: 0.46
|
||||||
" Last Change: 2016 Aug. 18
|
" Last Change: 2016 Sep. 27
|
||||||
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
|
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
|
||||||
" Usage: For instructions, do :help fortran-indent from Vim
|
" Usage: For instructions, do :help fortran-indent from Vim
|
||||||
" Credits:
|
" Credits:
|
||||||
" Useful suggestions were made by: Albert Oliver Serra and Takuya Fujiwara.
|
" Useful suggestions were made, in chronological order, by:
|
||||||
|
" Albert Oliver Serra, Takuya Fujiwara and Philipp Edelmann.
|
||||||
|
|
||||||
" Only load this indent file when no other was loaded.
|
" Only load this indent file when no other was loaded.
|
||||||
if exists("b:did_indent")
|
if exists("b:did_indent")
|
||||||
@ -121,7 +122,8 @@ function FortranGetIndent(lnum)
|
|||||||
let prefix='\(\(pure\|impure\|elemental\|recursive\)\s\+\)\{,2}'
|
let prefix='\(\(pure\|impure\|elemental\|recursive\)\s\+\)\{,2}'
|
||||||
let type='\(\(integer\|real\|double\s\+precision\|complex\|logical'
|
let type='\(\(integer\|real\|double\s\+precision\|complex\|logical'
|
||||||
\.'\|character\|type\|class\)\s*\S*\s\+\)\='
|
\.'\|character\|type\|class\)\s*\S*\s\+\)\='
|
||||||
if prevstat =~? '^\s*\(module\|contains\/submodule\|program\)\>'
|
if prevstat =~? '^\s*\(contains\|submodule\|program\)\>'
|
||||||
|
\ ||prevstat =~? '^\s*'.'module\>\(\s*\procedure\)\@!'
|
||||||
\ ||prevstat =~? '^\s*'.prefix.'subroutine\>'
|
\ ||prevstat =~? '^\s*'.prefix.'subroutine\>'
|
||||||
\ ||prevstat =~? '^\s*'.prefix.type.'function\>'
|
\ ||prevstat =~? '^\s*'.prefix.type.'function\>'
|
||||||
\ ||prevstat =~? '^\s*'.type.prefix.'function\>'
|
\ ||prevstat =~? '^\s*'.type.prefix.'function\>'
|
||||||
@ -129,7 +131,7 @@ function FortranGetIndent(lnum)
|
|||||||
endif
|
endif
|
||||||
if getline(v:lnum) =~? '^\s*contains\>'
|
if getline(v:lnum) =~? '^\s*contains\>'
|
||||||
\ ||getline(v:lnum)=~? '^\s*end\s*'
|
\ ||getline(v:lnum)=~? '^\s*end\s*'
|
||||||
\ .'\(function\|subroutine\|module\/submodule\|program\)\>'
|
\ .'\(function\|subroutine\|module\|submodule\|program\)\>'
|
||||||
let ind = ind - shiftwidth()
|
let ind = ind - shiftwidth()
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@ -152,9 +154,6 @@ function FortranGetIndent(lnum)
|
|||||||
if prevstat =~ '&\s*$' && prev2stat !~ '&\s*$'
|
if prevstat =~ '&\s*$' && prev2stat !~ '&\s*$'
|
||||||
let ind = ind + shiftwidth()
|
let ind = ind + shiftwidth()
|
||||||
endif
|
endif
|
||||||
if prevstat =~ '&\s*$' && prevstat =~ '\<else\s*if\>'
|
|
||||||
let ind = ind - shiftwidth()
|
|
||||||
endif
|
|
||||||
"Line after last continuation line
|
"Line after last continuation line
|
||||||
if prevstat !~ '&\s*$' && prev2stat =~ '&\s*$' && prevstat !~? '\<then\>'
|
if prevstat !~ '&\s*$' && prev2stat =~ '&\s*$' && prevstat !~? '\<then\>'
|
||||||
let ind = ind - shiftwidth()
|
let ind = ind - shiftwidth()
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Vim indent file
|
" Vim indent file
|
||||||
" Language: git config file
|
" Language: git config file
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2013 May 30
|
" Last Change: 2016 Aug 29
|
||||||
|
|
||||||
if exists("b:did_indent")
|
if exists("b:did_indent")
|
||||||
finish
|
finish
|
||||||
@ -20,17 +20,18 @@ if exists("*GetGitconfigIndent")
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
function! GetGitconfigIndent()
|
function! GetGitconfigIndent()
|
||||||
|
let sw = exists('*shiftwidth') ? shiftwidth() : &sw
|
||||||
let line = getline(prevnonblank(v:lnum-1))
|
let line = getline(prevnonblank(v:lnum-1))
|
||||||
let cline = getline(v:lnum)
|
let cline = getline(v:lnum)
|
||||||
if line =~ '\\\@<!\%(\\\\\)*\\$'
|
if line =~ '\\\@<!\%(\\\\\)*\\$'
|
||||||
" odd number of slashes, in a line continuation
|
" odd number of slashes, in a line continuation
|
||||||
return 2 * &sw
|
return 2 * sw
|
||||||
elseif cline =~ '^\s*\['
|
elseif cline =~ '^\s*\['
|
||||||
return 0
|
return 0
|
||||||
elseif cline =~ '^\s*\a'
|
elseif cline =~ '^\s*\a'
|
||||||
return &sw
|
return sw
|
||||||
elseif cline == '' && line =~ '^\['
|
elseif cline == '' && line =~ '^\['
|
||||||
return &sw
|
return sw
|
||||||
else
|
else
|
||||||
return -1
|
return -1
|
||||||
endif
|
endif
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Vim indent file
|
" Vim indent file
|
||||||
" Language: Haml
|
" Language: Haml
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2013 May 30
|
" Last Change: 2016 Aug 29
|
||||||
|
|
||||||
if exists("b:did_indent")
|
if exists("b:did_indent")
|
||||||
finish
|
finish
|
||||||
@ -37,10 +37,11 @@ function! GetHamlIndent()
|
|||||||
let line = substitute(line,'^\s\+','','')
|
let line = substitute(line,'^\s\+','','')
|
||||||
let indent = indent(lnum)
|
let indent = indent(lnum)
|
||||||
let cindent = indent(v:lnum)
|
let cindent = indent(v:lnum)
|
||||||
|
let sw = exists('*shiftwidth') ? shiftwidth() : &sw
|
||||||
if cline =~# '\v^-\s*%(elsif|else|when)>'
|
if cline =~# '\v^-\s*%(elsif|else|when)>'
|
||||||
let indent = cindent < indent ? cindent : indent - &sw
|
let indent = cindent < indent ? cindent : indent - sw
|
||||||
endif
|
endif
|
||||||
let increase = indent + &sw
|
let increase = indent + sw
|
||||||
if indent == indent(lnum)
|
if indent == indent(lnum)
|
||||||
let indent = cindent <= indent ? -1 : increase
|
let indent = cindent <= indent ? -1 : increase
|
||||||
endif
|
endif
|
||||||
|
@ -749,7 +749,7 @@ func! s:CssPrevNonComment(lnum, stopline)
|
|||||||
while 1
|
while 1
|
||||||
let ccol = match(getline(lnum), '\*/')
|
let ccol = match(getline(lnum), '\*/')
|
||||||
if ccol < 0
|
if ccol < 0
|
||||||
" No comment end thus its something else.
|
" No comment end thus it's something else.
|
||||||
return lnum
|
return lnum
|
||||||
endif
|
endif
|
||||||
call cursor(lnum, ccol + 1)
|
call cursor(lnum, ccol + 1)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Vim indent file
|
" Vim indent file
|
||||||
" Language: Liquid
|
" Language: Liquid
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2013 May 30
|
" Last Change: 2016 Aug 29
|
||||||
|
|
||||||
if exists('b:did_indent')
|
if exists('b:did_indent')
|
||||||
finish
|
finish
|
||||||
@ -54,9 +54,10 @@ function! GetLiquidIndent(...)
|
|||||||
let line = substitute(line,'\C^\%(\s*{%\s*end\w*\s*%}\)\+','','')
|
let line = substitute(line,'\C^\%(\s*{%\s*end\w*\s*%}\)\+','','')
|
||||||
let line .= matchstr(cline,'\C^\%(\s*{%\s*end\w*\s*%}\)\+')
|
let line .= matchstr(cline,'\C^\%(\s*{%\s*end\w*\s*%}\)\+')
|
||||||
let cline = substitute(cline,'\C^\%(\s*{%\s*end\w*\s*%}\)\+','','')
|
let cline = substitute(cline,'\C^\%(\s*{%\s*end\w*\s*%}\)\+','','')
|
||||||
let ind += &sw * s:count(line,'{%\s*\%(if\|elsif\|else\|unless\|ifchanged\|case\|when\|for\|empty\|tablerow\|capture\)\>')
|
let sw = exists('*shiftwidth') ? shiftwidth() : &sw
|
||||||
let ind -= &sw * s:count(line,'{%\s*end\%(if\|unless\|ifchanged\|case\|for\|tablerow\|capture\)\>')
|
let ind += sw * s:count(line,'{%\s*\%(if\|elsif\|else\|unless\|ifchanged\|case\|when\|for\|empty\|tablerow\|capture\)\>')
|
||||||
let ind -= &sw * s:count(cline,'{%\s*\%(elsif\|else\|when\|empty\)\>')
|
let ind -= sw * s:count(line,'{%\s*end\%(if\|unless\|ifchanged\|case\|for\|tablerow\|capture\)\>')
|
||||||
let ind -= &sw * s:count(cline,'{%\s*end\w*$')
|
let ind -= sw * s:count(cline,'{%\s*\%(elsif\|else\|when\|empty\)\>')
|
||||||
|
let ind -= sw * s:count(cline,'{%\s*end\w*$')
|
||||||
return ind
|
return ind
|
||||||
endfunction
|
endfunction
|
||||||
|
6
runtime/indent/mf.vim
Normal file
6
runtime/indent/mf.vim
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
" METAFONT indent file
|
||||||
|
" Language: METAFONT
|
||||||
|
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||||
|
" Last Change: 2016 Oct 1
|
||||||
|
|
||||||
|
runtime! indent/mp.vim
|
@ -1,56 +1,19 @@
|
|||||||
" MetaPost indent file
|
" MetaPost indent file
|
||||||
" Language: MetaPost
|
" Language: MetaPost
|
||||||
" Maintainer: Eugene Minkovskii <emin@mccme.ru>
|
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||||
" Last Change: 2012 May 18
|
" Former Maintainers: Eugene Minkovskii <emin@mccme.ru>
|
||||||
" Version: 0.1
|
" Last Change: 2016 Oct 2, 4:13pm
|
||||||
" ==========================================================================
|
" Version: 0.2
|
||||||
|
|
||||||
" Identation Rules: {{{1
|
|
||||||
" First of all, MetaPost language don't expect any identation rules.
|
|
||||||
" This screept need for you only if you (not MetaPost) need to do
|
|
||||||
" exactly code. If you don't need to use indentation, see
|
|
||||||
" :help filetype-indent-off
|
|
||||||
"
|
|
||||||
" Note: Every rules of identation in MetaPost or TeX languages (and in some
|
|
||||||
" other of course) is very subjective. I can release only my vision of this
|
|
||||||
" promlem.
|
|
||||||
"
|
|
||||||
" ..........................................................................
|
|
||||||
" Example of correct (by me) identation {{{2
|
|
||||||
" shiftwidth=4
|
|
||||||
" ==========================================================================
|
|
||||||
" for i=0 upto 99:
|
|
||||||
" z[i] = (0,1u) rotated (i*360/100);
|
|
||||||
" endfor
|
|
||||||
" draw z0 -- z10 -- z20
|
|
||||||
" withpen ... % <- 2sw because breaked line
|
|
||||||
" withcolor ...; % <- same as previous
|
|
||||||
" draw z0 for i=1 upto 99:
|
|
||||||
" -- z[i] % <- 1sw from left end of 'for' satement
|
|
||||||
" endfor withpen ... % <- 0sw from left end of 'for' satement
|
|
||||||
" withcolor ...; % <- 2sw because breaked line
|
|
||||||
" draw if One: % <- This is internal if (like 'for' above)
|
|
||||||
" one
|
|
||||||
" elsif Other:
|
|
||||||
" other
|
|
||||||
" fi withpen ...;
|
|
||||||
" if one: % <- This is external if
|
|
||||||
" draw one;
|
|
||||||
" elseif other:
|
|
||||||
" draw other;
|
|
||||||
" fi
|
|
||||||
" draw z0; draw z1;
|
|
||||||
" }}}
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" Only load this indent file when no other was loaded.
|
|
||||||
if exists("b:did_indent")
|
if exists("b:did_indent")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let b:did_indent = 1
|
let b:did_indent = 1
|
||||||
|
|
||||||
setlocal indentexpr=GetMetaPostIndent()
|
setlocal indentexpr=GetMetaPostIndent()
|
||||||
setlocal indentkeys+=;,<:>,=if,=for,=def,=end,=else,=fi
|
setlocal indentkeys+==end,=else,=fi,=fill,0),0]
|
||||||
|
|
||||||
|
let b:undo_indent = "setl indentkeys< indentexpr<"
|
||||||
|
|
||||||
" Only define the function once.
|
" Only define the function once.
|
||||||
if exists("*GetMetaPostIndent")
|
if exists("*GetMetaPostIndent")
|
||||||
@ -59,151 +22,337 @@ endif
|
|||||||
let s:keepcpo= &cpo
|
let s:keepcpo= &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
" Auxiliary Definitions: {{{1
|
function GetMetaPostIndent()
|
||||||
function! MetaNextNonblankNoncomment(pos)
|
let ignorecase_save = &ignorecase
|
||||||
" Like nextnonblank() but ignore comment lines
|
try
|
||||||
let tmp = nextnonblank(a:pos)
|
let &ignorecase = 0
|
||||||
while tmp && getline(tmp) =~ '^\s*%'
|
return GetMetaPostIndentIntern()
|
||||||
let tmp = nextnonblank(tmp+1)
|
finally
|
||||||
|
let &ignorecase = ignorecase_save
|
||||||
|
endtry
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
" Regexps {{{
|
||||||
|
" Note: the next three variables are made global so that a user may add
|
||||||
|
" further keywords.
|
||||||
|
"
|
||||||
|
" Example:
|
||||||
|
"
|
||||||
|
" Put these in ~/.vim/after/indent/mp.vim
|
||||||
|
"
|
||||||
|
" let g:mp_open_tag .= '\|\<begintest\>'
|
||||||
|
" let g:mp_close_tag .= '\|\<endtest\>'
|
||||||
|
|
||||||
|
" Expressions starting indented blocks
|
||||||
|
let g:mp_open_tag = ''
|
||||||
|
\ . '\<if\>'
|
||||||
|
\ . '\|\<else\%[if]\>'
|
||||||
|
\ . '\|\<for\%(\|ever\|suffixes\)\>'
|
||||||
|
\ . '\|\<begingroup\>'
|
||||||
|
\ . '\|\<\%(\|var\|primary\|secondary\|tertiary\)def\>'
|
||||||
|
\ . '\|^\s*\<begin\%(fig\|graph\|glyph\|char\|logochar\)\>'
|
||||||
|
\ . '\|[([{]'
|
||||||
|
|
||||||
|
" Expressions ending indented blocks
|
||||||
|
let g:mp_close_tag = ''
|
||||||
|
\ . '\<fi\>'
|
||||||
|
\ . '\|\<else\%[if]\>'
|
||||||
|
\ . '\|\<end\%(\|for\|group\|def\|fig\|char\|glyph\|graph\)\>'
|
||||||
|
\ . '\|[)\]}]'
|
||||||
|
|
||||||
|
" Statements that may span multiple lines and are ended by a semicolon. To
|
||||||
|
" keep this list short, statements that are unlikely to be very long or are
|
||||||
|
" not very common (e.g., keywords like `interim` or `showtoken`) are not
|
||||||
|
" included.
|
||||||
|
"
|
||||||
|
" The regex for assignments and equations (the last branch) is tricky, because
|
||||||
|
" it must not match things like `for i :=`, `if a=b`, `def...=`, etc... It is
|
||||||
|
" not perfect, but it works reasonably well.
|
||||||
|
let g:mp_statement = ''
|
||||||
|
\ . '\<\%(\|un\|cut\)draw\>'
|
||||||
|
\ . '\|\<\%(\|un\)fill\%[draw]\>'
|
||||||
|
\ . '\|\<draw\%(dbl\)\=arrow\>'
|
||||||
|
\ . '\|\<clip\>'
|
||||||
|
\ . '\|\<addto\>'
|
||||||
|
\ . '\|\<save\>'
|
||||||
|
\ . '\|\<setbounds\>'
|
||||||
|
\ . '\|\<message\>'
|
||||||
|
\ . '\|\<errmessage\>'
|
||||||
|
\ . '\|\<errhelp\>'
|
||||||
|
\ . '\|\<fontmapline\>'
|
||||||
|
\ . '\|\<pickup\>'
|
||||||
|
\ . '\|\<show\>'
|
||||||
|
\ . '\|\<special\>'
|
||||||
|
\ . '\|\<write\>'
|
||||||
|
\ . '\|\%(^\|;\)\%([^;=]*\%('.g:mp_open_tag.'\)\)\@!.\{-}:\=='
|
||||||
|
|
||||||
|
" A line ends with zero or more spaces, possibly followed by a comment.
|
||||||
|
let s:eol = '\s*\%($\|%\)'
|
||||||
|
" }}}
|
||||||
|
|
||||||
|
" Auxiliary functions {{{
|
||||||
|
" Returns 1 if (0-based) position immediately preceding `pos` in `line` is
|
||||||
|
" inside a string or a comment; returns 0 otherwise.
|
||||||
|
|
||||||
|
" This is the function that is called more often when indenting, so it is
|
||||||
|
" critical that it is efficient. The method we use is significantly faster
|
||||||
|
" than using syntax attributes, and more general (it does not require
|
||||||
|
" syntax_items). It is also faster than using a single regex matching an even
|
||||||
|
" number of quotes. It helps that MetaPost strings cannot span more than one
|
||||||
|
" line and cannot contain escaped quotes.
|
||||||
|
function! s:CommentOrString(line, pos)
|
||||||
|
let in_string = 0
|
||||||
|
let q = stridx(a:line, '"')
|
||||||
|
let c = stridx(a:line, '%')
|
||||||
|
while q >= 0 && q < a:pos
|
||||||
|
if c >= 0 && c < q
|
||||||
|
if in_string " Find next percent symbol
|
||||||
|
let c = stridx(a:line, '%', q + 1)
|
||||||
|
else " Inside comment
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
let in_string = 1 - in_string
|
||||||
|
let q = stridx(a:line, '"', q + 1) " Find next quote
|
||||||
endwhile
|
endwhile
|
||||||
return tmp
|
return in_string || (c >= 0 && c <= a:pos)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! MetaPrevNonblankNoncomment(pos)
|
" Find the first non-comment non-blank line before the current line.
|
||||||
" Like prevnonblank() but ignore comment lines
|
function! s:PrevNonBlankNonComment(lnum)
|
||||||
let tmp = prevnonblank(a:pos)
|
let l:lnum = prevnonblank(a:lnum - 1)
|
||||||
while tmp && getline(tmp) =~ '^\s*%'
|
while getline(l:lnum) =~# '^\s*%'
|
||||||
let tmp = prevnonblank(tmp-1)
|
let l:lnum = prevnonblank(l:lnum - 1)
|
||||||
endwhile
|
endwhile
|
||||||
return tmp
|
return l:lnum
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! MetaSearchNoncomment(pattern, ...)
|
" Returns true if the last tag appearing in the line is an open tag; returns
|
||||||
" Like search() but ignore commented areas
|
" false otherwise.
|
||||||
if a:0
|
function! s:LastTagIsOpen(line)
|
||||||
let flags = a:1
|
let o = s:LastValidMatchEnd(a:line, g:mp_open_tag, 0)
|
||||||
elseif &wrapscan
|
if o == - 1 | return v:false | endif
|
||||||
let flags = "w"
|
return s:LastValidMatchEnd(a:line, g:mp_close_tag, o) < 0
|
||||||
else
|
endfunction
|
||||||
let flags = "W"
|
|
||||||
endif
|
" A simple, efficient and quite effective heuristics is used to test whether
|
||||||
let cl = line(".")
|
" a line should cause the next line to be indented: count the "opening tags"
|
||||||
let cc = col(".")
|
" (if, for, def, ...) in the line, count the "closing tags" (endif, endfor,
|
||||||
let tmp = search(a:pattern, flags)
|
" ...) in the line, and compute the difference. We call the result the
|
||||||
while tmp && synIDattr(synID(line("."), col("."), 1), "name") =~
|
" "weight" of the line. If the weight is positive, then the next line should
|
||||||
\ 'm[fp]\(Comment\|TeXinsert\|String\)'
|
" most likely be indented. Note that `else` and `elseif` are both opening and
|
||||||
let tmp = search(a:pattern, flags)
|
" closing tags, so they "cancel out" in almost all cases, the only exception
|
||||||
|
" being a leading `else[if]`, which is counted as an opening tag, but not as
|
||||||
|
" a closing tag (so that, for instance, a line containing a single `else:`
|
||||||
|
" will have weight equal to one, not zero). We do not treat a trailing
|
||||||
|
" `else[if]` in any special way, because lines ending with an open tag are
|
||||||
|
" dealt with separately before this function is called (see
|
||||||
|
" GetMetaPostIndentIntern()).
|
||||||
|
"
|
||||||
|
" Example:
|
||||||
|
"
|
||||||
|
" forsuffixes $=a,b: if x.$ = y.$ : draw else: fill fi
|
||||||
|
" % This line will be indented because |{forsuffixes,if,else}| > |{else,fi}| (3 > 2)
|
||||||
|
" endfor
|
||||||
|
|
||||||
|
function! s:Weight(line)
|
||||||
|
let [o, i] = [0, s:ValidMatchEnd(a:line, g:mp_open_tag, 0)]
|
||||||
|
while i > 0
|
||||||
|
let o += 1
|
||||||
|
let i = s:ValidMatchEnd(a:line, g:mp_open_tag, i)
|
||||||
endwhile
|
endwhile
|
||||||
if !tmp
|
let [c, i] = [0, matchend(a:line, '^\s*\<else\%[if]\>')] " Skip a leading else[if]
|
||||||
call cursor(cl,cc)
|
let i = s:ValidMatchEnd(a:line, g:mp_close_tag, i)
|
||||||
|
while i > 0
|
||||||
|
let c += 1
|
||||||
|
let i = s:ValidMatchEnd(a:line, g:mp_close_tag, i)
|
||||||
|
endwhile
|
||||||
|
return o - c
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Similar to matchend(), but skips strings and comments.
|
||||||
|
" line: a String
|
||||||
|
function! s:ValidMatchEnd(line, pat, start)
|
||||||
|
let i = matchend(a:line, a:pat, a:start)
|
||||||
|
while i > 0 && s:CommentOrString(a:line, i)
|
||||||
|
let i = matchend(a:line, a:pat, i)
|
||||||
|
endwhile
|
||||||
|
return i
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Like s:ValidMatchEnd(), but returns the end position of the last (i.e.,
|
||||||
|
" rightmost) match.
|
||||||
|
function! s:LastValidMatchEnd(line, pat, start)
|
||||||
|
let last_found = -1
|
||||||
|
let i = matchend(a:line, a:pat, a:start)
|
||||||
|
while i > 0
|
||||||
|
if !s:CommentOrString(a:line, i)
|
||||||
|
let last_found = i
|
||||||
|
endif
|
||||||
|
let i = matchend(a:line, a:pat, i)
|
||||||
|
endwhile
|
||||||
|
return last_found
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:DecreaseIndentOnClosingTag(curr_indent)
|
||||||
|
let cur_text = getline(v:lnum)
|
||||||
|
if cur_text =~# '^\s*\%('.g:mp_close_tag.'\)'
|
||||||
|
return max([a:curr_indent - shiftwidth(), 0])
|
||||||
endif
|
endif
|
||||||
return tmp
|
return a:curr_indent
|
||||||
endfunction
|
endfunction
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
function! GetMetaPostIndent()
|
" Main function {{{
|
||||||
" not indent in comment ???
|
"
|
||||||
if synIDattr(synID(line("."), col("."), 1), "name") =~
|
" Note: Every rule of indentation in MetaPost is very subjective. We might get
|
||||||
\ 'm[fp]\(Comment\|TeXinsert\|String\)'
|
" creative, but things get murky very soon (there are too many corner cases).
|
||||||
|
" So, we provide a means for the user to decide what to do when this script
|
||||||
|
" doesn't get it. We use a simple idea: use '%>', '%<' and '%=' to explicitly
|
||||||
|
" control indentation. The '<' and '>' symbols may be repeated many times
|
||||||
|
" (e.g., '%>>' will cause the next line to be indented twice).
|
||||||
|
"
|
||||||
|
" By using '%>...', '%<...' and '%=', the indentation the user wants is
|
||||||
|
" preserved by commands like gg=G, even if it does not follow the rules of
|
||||||
|
" this script.
|
||||||
|
"
|
||||||
|
" Example:
|
||||||
|
"
|
||||||
|
" def foo =
|
||||||
|
" makepen(
|
||||||
|
" subpath(T-n,t) of r %>
|
||||||
|
" shifted .5down %>
|
||||||
|
" --subpath(t,T) of r shifted .5up -- cycle %<<<
|
||||||
|
" )
|
||||||
|
" withcolor black
|
||||||
|
" enddef
|
||||||
|
"
|
||||||
|
" The default indentation of the previous example would be:
|
||||||
|
"
|
||||||
|
" def foo =
|
||||||
|
" makepen(
|
||||||
|
" subpath(T-n,t) of r
|
||||||
|
" shifted .5down
|
||||||
|
" --subpath(t,T) of r shifted .5up -- cycle
|
||||||
|
" )
|
||||||
|
" withcolor black
|
||||||
|
" enddef
|
||||||
|
"
|
||||||
|
" Personally, I prefer the latter, but anyway...
|
||||||
|
function! GetMetaPostIndentIntern()
|
||||||
|
" Do not touch indentation inside verbatimtex/btex.. etex blocks.
|
||||||
|
if synIDattr(synID(v:lnum, 1, 1), "name") =~# '^mpTeXinsert$\|^tex\|^Delimiter'
|
||||||
return -1
|
return -1
|
||||||
endif
|
endif
|
||||||
" Some RegExps: {{{1
|
|
||||||
" end_of_item: all of end by ';'
|
|
||||||
" + all of end by :endfor, :enddef, :endfig, :endgroup, :fi
|
|
||||||
" + all of start by :beginfig(num), :begingroup
|
|
||||||
" + all of start by :for, :if, :else, :elseif and end by ':'
|
|
||||||
" + all of start by :def, :vardef and end by '='
|
|
||||||
let end_of_item = '\(' .
|
|
||||||
\ ';\|' .
|
|
||||||
\ '\<\(end\(for\|def\|fig\|group\)\|fi\)\>\|' .
|
|
||||||
\ '\<begin\(group\>\|fig\s*(\s*\d\+\s*)\)\|' .
|
|
||||||
\ '\<\(for\|if\|else\(if\)\=\)\>.\+:\|' .
|
|
||||||
\ '\<\(var\)\=def\>.\+=' . '\)'
|
|
||||||
" }}}
|
|
||||||
" Save: current position {{{1
|
|
||||||
let cl = line (".")
|
|
||||||
let cc = col (".")
|
|
||||||
let cs = getline(".")
|
|
||||||
" if it is :beginfig or :endfig use zero indent
|
|
||||||
if cs =~ '^\s*\(begin\|end\)fig\>'
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
" }}}
|
|
||||||
" Initialise: ind variable {{{1
|
|
||||||
" search previous item not in current line
|
|
||||||
let p_semicol_l = MetaSearchNoncomment(end_of_item,"bW")
|
|
||||||
while p_semicol_l == cl
|
|
||||||
let p_semicol_l = MetaSearchNoncomment(end_of_item,"bW")
|
|
||||||
endwhile
|
|
||||||
" if this is first item in program use zero indent
|
|
||||||
if !p_semicol_l
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
" if this is multiline item, remember first indent
|
|
||||||
if MetaNextNonblankNoncomment(p_semicol_l+1) < cl
|
|
||||||
let ind = indent(MetaNextNonblankNoncomment(p_semicol_l+1))
|
|
||||||
" else --- search pre-previous item for search first line in previous item
|
|
||||||
else
|
|
||||||
" search pre-previous item not in current line
|
|
||||||
let pp_semicol_l = MetaSearchNoncomment(end_of_item,"bW")
|
|
||||||
while pp_semicol_l == p_semicol_l
|
|
||||||
let pp_semicol_l = MetaSearchNoncomment(end_of_item,"bW")
|
|
||||||
endwhile
|
|
||||||
" if we find pre-previous item, remember indent of previous item
|
|
||||||
" else --- remember zero
|
|
||||||
if pp_semicol_l
|
|
||||||
let ind = indent(MetaNextNonblankNoncomment(line(".")+1))
|
|
||||||
else
|
|
||||||
let ind = 0
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
" }}}
|
|
||||||
" Increase Indent: {{{1
|
|
||||||
" if it is an internal/external :for or :if statements {{{2
|
|
||||||
let pnn_s = getline(MetaPrevNonblankNoncomment(cl-1))
|
|
||||||
if pnn_s =~ '\<\(for\|if\)\>.\+:\s*\($\|%\)'
|
|
||||||
let ind = match(pnn_s, '\<\(for\|if\)\>.\+:\s*\($\|%\)') + &sw
|
|
||||||
" }}}
|
|
||||||
" if it is a :def, :vardef, :beginfig, :begingroup, :else, :elseif {{{2
|
|
||||||
elseif pnn_s =~ '^\s*\(' .
|
|
||||||
\ '\(var\)\=def\|' .
|
|
||||||
\ 'begin\(group\|fig\s*(\s*\d\+\s*)\)\|' .
|
|
||||||
\ 'else\(if\)\=' . '\)\>'
|
|
||||||
let ind = ind + &sw
|
|
||||||
" }}}
|
|
||||||
" if it is a broken line {{{2
|
|
||||||
elseif pnn_s !~ end_of_item.'\s*\($\|%\)'
|
|
||||||
let ind = ind + (2 * &sw)
|
|
||||||
endif
|
|
||||||
" }}}
|
|
||||||
" }}}
|
|
||||||
" Decrease Indent: {{{1
|
|
||||||
" if this is :endfor or :enddef statements {{{2
|
|
||||||
" this is correct because :def cannot be inside :for
|
|
||||||
if cs =~ '\<end\(for\|def\)\=\>'
|
|
||||||
call MetaSearchNoncomment('\<for\>.\+:\s*\($\|%\)' . '\|' .
|
|
||||||
\ '^\s*\(var\)\=def\>',"bW")
|
|
||||||
if col(".") > 1
|
|
||||||
let ind = col(".") - 1
|
|
||||||
else
|
|
||||||
let ind = indent(".")
|
|
||||||
endif
|
|
||||||
" }}}
|
|
||||||
" if this is :fi, :else, :elseif statements {{{2
|
|
||||||
elseif cs =~ '\<\(else\(if\)\=\|fi\)\>'
|
|
||||||
call MetaSearchNoncomment('\<if\>.\+:\s*\($\|%\)',"bW")
|
|
||||||
let ind = col(".") - 1
|
|
||||||
" }}}
|
|
||||||
" if this is :endgroup statement {{{2
|
|
||||||
elseif cs =~ '^\s*endgroup\>'
|
|
||||||
let ind = ind - &sw
|
|
||||||
endif
|
|
||||||
" }}}
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
return ind
|
" This is the reference line relative to which the current line is indented
|
||||||
|
" (but see below).
|
||||||
|
let lnum = s:PrevNonBlankNonComment(v:lnum)
|
||||||
|
|
||||||
|
" At the start of the file use zero indent.
|
||||||
|
if lnum == 0
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
let prev_text = getline(lnum)
|
||||||
|
|
||||||
|
" User-defined overrides take precedence over anything else.
|
||||||
|
" See above for an example.
|
||||||
|
let j = match(prev_text, '%[<>=]')
|
||||||
|
if j > 0
|
||||||
|
let i = strlen(matchstr(prev_text, '%>\+', j)) - 1
|
||||||
|
if i > 0
|
||||||
|
return indent(lnum) + i * shiftwidth()
|
||||||
|
endif
|
||||||
|
|
||||||
|
let i = strlen(matchstr(prev_text, '%<\+', j)) - 1
|
||||||
|
if i > 0
|
||||||
|
return max([indent(lnum) - i * shiftwidth(), 0])
|
||||||
|
endif
|
||||||
|
|
||||||
|
if match(prev_text, '%=', j)
|
||||||
|
return indent(lnum)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
" If the reference line ends with an open tag, indent.
|
||||||
|
"
|
||||||
|
" Example:
|
||||||
|
"
|
||||||
|
" if c:
|
||||||
|
" 0
|
||||||
|
" else:
|
||||||
|
" 1
|
||||||
|
" fi if c2: % Note that this line has weight equal to zero.
|
||||||
|
" ... % This line will be indented
|
||||||
|
if s:LastTagIsOpen(prev_text)
|
||||||
|
return s:DecreaseIndentOnClosingTag(indent(lnum) + shiftwidth())
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Lines with a positive weight are unbalanced and should likely be indented.
|
||||||
|
"
|
||||||
|
" Example:
|
||||||
|
"
|
||||||
|
" def f = enddef for i = 1 upto 5: if x[i] > 0: 1 else: 2 fi
|
||||||
|
" ... % This line will be indented (because of the unterminated `for`)
|
||||||
|
if s:Weight(prev_text) > 0
|
||||||
|
return s:DecreaseIndentOnClosingTag(indent(lnum) + shiftwidth())
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Unterminated statements cause indentation to kick in.
|
||||||
|
"
|
||||||
|
" Example:
|
||||||
|
"
|
||||||
|
" draw unitsquare
|
||||||
|
" withcolor black; % This line is indented because of `draw`.
|
||||||
|
" x := a + b + c
|
||||||
|
" + d + e; % This line is indented because of `:=`.
|
||||||
|
"
|
||||||
|
let i = s:LastValidMatchEnd(prev_text, g:mp_statement, 0)
|
||||||
|
if i >= 0 " Does the line contain a statement?
|
||||||
|
if s:ValidMatchEnd(prev_text, ';', i) < 0 " Is the statement unterminated?
|
||||||
|
return indent(lnum) + shiftwidth()
|
||||||
|
else
|
||||||
|
return s:DecreaseIndentOnClosingTag(indent(lnum))
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Deal with the special case of a statement spanning multiple lines. If the
|
||||||
|
" current reference line L ends with a semicolon, search backwards for
|
||||||
|
" another semicolon or a statement keyword. If the latter is found first,
|
||||||
|
" its line is used as the reference line for indenting the current line
|
||||||
|
" instead of L.
|
||||||
|
"
|
||||||
|
" Example:
|
||||||
|
"
|
||||||
|
" if cond:
|
||||||
|
" draw if a: z0 else: z1 fi
|
||||||
|
" shifted S
|
||||||
|
" scaled T; % L
|
||||||
|
"
|
||||||
|
" for i = 1 upto 3: % <-- Current line: this gets the same indent as `draw ...`
|
||||||
|
"
|
||||||
|
" NOTE: we get here only if L does not contain a statement (among those
|
||||||
|
" listed in g:mp_statement).
|
||||||
|
if s:ValidMatchEnd(prev_text, ';'.s:eol, 0) >= 0 " L ends with a semicolon
|
||||||
|
let stm_lnum = s:PrevNonBlankNonComment(lnum)
|
||||||
|
while stm_lnum > 0
|
||||||
|
let prev_text = getline(stm_lnum)
|
||||||
|
let sc_pos = s:LastValidMatchEnd(prev_text, ';', 0)
|
||||||
|
let stm_pos = s:ValidMatchEnd(prev_text, g:mp_statement, sc_pos)
|
||||||
|
if stm_pos > sc_pos
|
||||||
|
let lnum = stm_lnum
|
||||||
|
break
|
||||||
|
elseif sc_pos > stm_pos
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
let stm_lnum = s:PrevNonBlankNonComment(stm_lnum)
|
||||||
|
endwhile
|
||||||
|
endif
|
||||||
|
|
||||||
|
return s:DecreaseIndentOnClosingTag(indent(lnum))
|
||||||
endfunction
|
endfunction
|
||||||
"
|
" }}}
|
||||||
|
|
||||||
let &cpo = s:keepcpo
|
let &cpo = s:keepcpo
|
||||||
unlet s:keepcpo
|
unlet s:keepcpo
|
||||||
|
@ -13,12 +13,23 @@ if exists("b:did_indent")
|
|||||||
endif
|
endif
|
||||||
let b:did_indent = 1
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
if !exists('g:ruby_indent_access_modifier_style')
|
||||||
|
" Possible values: "normal", "indent", "outdent"
|
||||||
|
let g:ruby_indent_access_modifier_style = 'normal'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:ruby_indent_block_style')
|
||||||
|
" Possible values: "expression", "do"
|
||||||
|
let g:ruby_indent_block_style = 'expression'
|
||||||
|
endif
|
||||||
|
|
||||||
setlocal nosmartindent
|
setlocal nosmartindent
|
||||||
|
|
||||||
" Now, set up our indentation expression and keys that trigger it.
|
" Now, set up our indentation expression and keys that trigger it.
|
||||||
setlocal indentexpr=GetRubyIndent(v:lnum)
|
setlocal indentexpr=GetRubyIndent(v:lnum)
|
||||||
setlocal indentkeys=0{,0},0),0],!^F,o,O,e
|
setlocal indentkeys=0{,0},0),0],!^F,o,O,e,:,.
|
||||||
setlocal indentkeys+==end,=else,=elsif,=when,=ensure,=rescue,==begin,==end
|
setlocal indentkeys+==end,=else,=elsif,=when,=ensure,=rescue,==begin,==end
|
||||||
|
setlocal indentkeys+==private,=protected,=public
|
||||||
|
|
||||||
" Only define the function once.
|
" Only define the function once.
|
||||||
if exists("*GetRubyIndent")
|
if exists("*GetRubyIndent")
|
||||||
@ -34,7 +45,7 @@ set cpo&vim
|
|||||||
" Regex of syntax group names that are or delimit strings/symbols or are comments.
|
" Regex of syntax group names that are or delimit strings/symbols or are comments.
|
||||||
let s:syng_strcom = '\<ruby\%(Regexp\|RegexpDelimiter\|RegexpEscape' .
|
let s:syng_strcom = '\<ruby\%(Regexp\|RegexpDelimiter\|RegexpEscape' .
|
||||||
\ '\|Symbol\|String\|StringDelimiter\|StringEscape\|ASCIICode' .
|
\ '\|Symbol\|String\|StringDelimiter\|StringEscape\|ASCIICode' .
|
||||||
\ '\|Interpolation\|NoInterpolation\|Comment\|Documentation\)\>'
|
\ '\|Interpolation\|InterpolationDelimiter\|NoInterpolation\|Comment\|Documentation\)\>'
|
||||||
|
|
||||||
" Regex of syntax group names that are strings.
|
" Regex of syntax group names that are strings.
|
||||||
let s:syng_string =
|
let s:syng_string =
|
||||||
@ -49,9 +60,10 @@ let s:skip_expr =
|
|||||||
\ "synIDattr(synID(line('.'),col('.'),1),'name') =~ '".s:syng_strcom."'"
|
\ "synIDattr(synID(line('.'),col('.'),1),'name') =~ '".s:syng_strcom."'"
|
||||||
|
|
||||||
" Regex used for words that, at the start of a line, add a level of indent.
|
" Regex used for words that, at the start of a line, add a level of indent.
|
||||||
let s:ruby_indent_keywords = '^\s*\zs\<\%(module\|class\|def\|if\|for' .
|
let s:ruby_indent_keywords =
|
||||||
\ '\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure' .
|
\ '^\s*\zs\<\%(module\|class\|if\|for' .
|
||||||
\ '\|rescue\):\@!\>' .
|
\ '\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue' .
|
||||||
|
\ '\|\%(public\|protected\|private\)\=\s*def\):\@!\>' .
|
||||||
\ '\|\%([=,*/%+-]\|<<\|>>\|:\s\)\s*\zs' .
|
\ '\|\%([=,*/%+-]\|<<\|>>\|:\s\)\s*\zs' .
|
||||||
\ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>'
|
\ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>'
|
||||||
|
|
||||||
@ -64,7 +76,8 @@ let s:ruby_deindent_keywords =
|
|||||||
" TODO: the do here should be restricted somewhat (only at end of line)?
|
" TODO: the do here should be restricted somewhat (only at end of line)?
|
||||||
let s:end_start_regex =
|
let s:end_start_regex =
|
||||||
\ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' .
|
\ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' .
|
||||||
\ '\<\%(module\|class\|def\|if\|for\|while\|until\|case\|unless\|begin\):\@!\>' .
|
\ '\<\%(module\|class\|if\|for\|while\|until\|case\|unless\|begin' .
|
||||||
|
\ '\|\%(public\|protected\|private\)\=\s*def\):\@!\>' .
|
||||||
\ '\|\%(^\|[^.:@$]\)\@<=\<do:\@!\>'
|
\ '\|\%(^\|[^.:@$]\)\@<=\<do:\@!\>'
|
||||||
|
|
||||||
" Regex that defines the middle-match for the 'end' keyword.
|
" Regex that defines the middle-match for the 'end' keyword.
|
||||||
@ -79,19 +92,39 @@ let s:end_skip_expr = s:skip_expr .
|
|||||||
\ ' && getline(".") =~ "^\\s*\\<\\(while\\|until\\|for\\):\\@!\\>")'
|
\ ' && getline(".") =~ "^\\s*\\<\\(while\\|until\\|for\\):\\@!\\>")'
|
||||||
|
|
||||||
" Regex that defines continuation lines, not including (, {, or [.
|
" Regex that defines continuation lines, not including (, {, or [.
|
||||||
let s:non_bracket_continuation_regex = '\%([\\.,:*/%+]\|\<and\|\<or\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$'
|
let s:non_bracket_continuation_regex =
|
||||||
|
\ '\%([\\.,:*/%+]\|\<and\|\<or\|\%(<%\)\@<![=-]\|:\@<![^[:alnum:]:][|&?]\|||\|&&\)\s*\%(#.*\)\=$'
|
||||||
|
|
||||||
" Regex that defines continuation lines.
|
" Regex that defines continuation lines.
|
||||||
" TODO: this needs to deal with if ...: and so on
|
|
||||||
let s:continuation_regex =
|
let s:continuation_regex =
|
||||||
\ '\%(%\@<![({[\\.,:*/%+]\|\<and\|\<or\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$'
|
\ '\%(%\@<![({[\\.,:*/%+]\|\<and\|\<or\|\%(<%\)\@<![=-]\|:\@<![^[:alnum:]:][|&?]\|||\|&&\)\s*\%(#.*\)\=$'
|
||||||
|
|
||||||
|
" Regex that defines continuable keywords
|
||||||
|
let s:continuable_regex =
|
||||||
|
\ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' .
|
||||||
|
\ '\<\%(if\|for\|while\|until\|unless\):\@!\>'
|
||||||
|
|
||||||
" Regex that defines bracket continuations
|
" Regex that defines bracket continuations
|
||||||
let s:bracket_continuation_regex = '%\@<!\%([({[]\)\s*\%(#.*\)\=$'
|
let s:bracket_continuation_regex = '%\@<!\%([({[]\)\s*\%(#.*\)\=$'
|
||||||
|
|
||||||
|
" Regex that defines dot continuations
|
||||||
|
let s:dot_continuation_regex = '%\@<!\.\s*\%(#.*\)\=$'
|
||||||
|
|
||||||
|
" Regex that defines backslash continuations
|
||||||
|
let s:backslash_continuation_regex = '%\@<!\\\s*$'
|
||||||
|
|
||||||
|
" Regex that defines end of bracket continuation followed by another continuation
|
||||||
|
let s:bracket_switch_continuation_regex = '^\([^(]\+\zs).\+\)\+'.s:continuation_regex
|
||||||
|
|
||||||
" Regex that defines the first part of a splat pattern
|
" Regex that defines the first part of a splat pattern
|
||||||
let s:splat_regex = '[[,(]\s*\*\s*\%(#.*\)\=$'
|
let s:splat_regex = '[[,(]\s*\*\s*\%(#.*\)\=$'
|
||||||
|
|
||||||
|
" Regex that describes all indent access modifiers
|
||||||
|
let s:access_modifier_regex = '\C^\s*\%(public\|protected\|private\)\s*\%(#.*\)\=$'
|
||||||
|
|
||||||
|
" Regex that describes the indent access modifiers (excludes public)
|
||||||
|
let s:indent_access_modifier_regex = '\C^\s*\%(protected\|private\)\s*\%(#.*\)\=$'
|
||||||
|
|
||||||
" Regex that defines blocks.
|
" Regex that defines blocks.
|
||||||
"
|
"
|
||||||
" Note that there's a slight problem with this regex and s:continuation_regex.
|
" Note that there's a slight problem with this regex and s:continuation_regex.
|
||||||
@ -102,10 +135,13 @@ let s:splat_regex = '[[,(]\s*\*\s*\%(#.*\)\=$'
|
|||||||
" The reason is that the pipe matches a hanging "|" operator.
|
" The reason is that the pipe matches a hanging "|" operator.
|
||||||
"
|
"
|
||||||
let s:block_regex =
|
let s:block_regex =
|
||||||
\ '\%(\<do:\@!\>\|%\@<!{\)\s*\%(|\s*(*\s*\%([*@&]\=\h\w*,\=\s*\)\%(,\s*(*\s*[*@&]\=\h\w*\s*)*\s*\)*|\)\=\s*\%(#.*\)\=$'
|
\ '\%(\<do:\@!\>\|%\@<!{\)\s*\%(|[^|]*|\)\=\s*\%(#.*\)\=$'
|
||||||
|
|
||||||
let s:block_continuation_regex = '^\s*[^])}\t ].*'.s:block_regex
|
let s:block_continuation_regex = '^\s*[^])}\t ].*'.s:block_regex
|
||||||
|
|
||||||
|
" Regex that describes a leading operator (only a method call's dot for now)
|
||||||
|
let s:leading_operator_regex = '^\s*[.]'
|
||||||
|
|
||||||
" 2. Auxiliary Functions {{{1
|
" 2. Auxiliary Functions {{{1
|
||||||
" ======================
|
" ======================
|
||||||
|
|
||||||
@ -165,7 +201,21 @@ function s:GetMSL(lnum)
|
|||||||
" Otherwise, terminate search as we have found our MSL already.
|
" Otherwise, terminate search as we have found our MSL already.
|
||||||
let line = getline(lnum)
|
let line = getline(lnum)
|
||||||
|
|
||||||
if s:Match(lnum, s:splat_regex)
|
if !s:Match(msl, s:backslash_continuation_regex) &&
|
||||||
|
\ s:Match(lnum, s:backslash_continuation_regex)
|
||||||
|
" If the current line doesn't end in a backslash, but the previous one
|
||||||
|
" does, look for that line's msl
|
||||||
|
"
|
||||||
|
" Example:
|
||||||
|
" foo = "bar" \
|
||||||
|
" "baz"
|
||||||
|
"
|
||||||
|
let msl = lnum
|
||||||
|
elseif s:Match(msl, s:leading_operator_regex)
|
||||||
|
" If the current line starts with a leading operator, keep its indent
|
||||||
|
" and keep looking for an MSL.
|
||||||
|
let msl = lnum
|
||||||
|
elseif s:Match(lnum, s:splat_regex)
|
||||||
" If the above line looks like the "*" of a splat, use the current one's
|
" If the above line looks like the "*" of a splat, use the current one's
|
||||||
" indentation.
|
" indentation.
|
||||||
"
|
"
|
||||||
@ -175,7 +225,7 @@ function s:GetMSL(lnum)
|
|||||||
" something
|
" something
|
||||||
"
|
"
|
||||||
return msl
|
return msl
|
||||||
elseif s:Match(line, s:non_bracket_continuation_regex) &&
|
elseif s:Match(lnum, s:non_bracket_continuation_regex) &&
|
||||||
\ s:Match(msl, s:non_bracket_continuation_regex)
|
\ s:Match(msl, s:non_bracket_continuation_regex)
|
||||||
" If the current line is a non-bracket continuation and so is the
|
" If the current line is a non-bracket continuation and so is the
|
||||||
" previous one, keep its indent and continue looking for an MSL.
|
" previous one, keep its indent and continue looking for an MSL.
|
||||||
@ -186,6 +236,18 @@ function s:GetMSL(lnum)
|
|||||||
" three
|
" three
|
||||||
"
|
"
|
||||||
let msl = lnum
|
let msl = lnum
|
||||||
|
elseif s:Match(lnum, s:dot_continuation_regex) &&
|
||||||
|
\ (s:Match(msl, s:bracket_continuation_regex) || s:Match(msl, s:block_continuation_regex))
|
||||||
|
" If the current line is a bracket continuation or a block-starter, but
|
||||||
|
" the previous is a dot, keep going to see if the previous line is the
|
||||||
|
" start of another continuation.
|
||||||
|
"
|
||||||
|
" Example:
|
||||||
|
" parent.
|
||||||
|
" method_call {
|
||||||
|
" three
|
||||||
|
"
|
||||||
|
let msl = lnum
|
||||||
elseif s:Match(lnum, s:non_bracket_continuation_regex) &&
|
elseif s:Match(lnum, s:non_bracket_continuation_regex) &&
|
||||||
\ (s:Match(msl, s:bracket_continuation_regex) || s:Match(msl, s:block_continuation_regex))
|
\ (s:Match(msl, s:bracket_continuation_regex) || s:Match(msl, s:block_continuation_regex))
|
||||||
" If the current line is a bracket continuation or a block-starter, but
|
" If the current line is a bracket continuation or a block-starter, but
|
||||||
@ -299,18 +361,39 @@ function s:ExtraBrackets(lnum)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:Match(lnum, regex)
|
function s:Match(lnum, regex)
|
||||||
let col = match(getline(a:lnum), '\C'.a:regex) + 1
|
let line = getline(a:lnum)
|
||||||
return col > 0 && !s:IsInStringOrComment(a:lnum, col) ? col : 0
|
let offset = match(line, '\C'.a:regex)
|
||||||
|
let col = offset + 1
|
||||||
|
|
||||||
|
while offset > -1 && s:IsInStringOrComment(a:lnum, col)
|
||||||
|
let offset = match(line, '\C'.a:regex, offset + 1)
|
||||||
|
let col = offset + 1
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
if offset > -1
|
||||||
|
return col
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:MatchLast(lnum, regex)
|
" Locates the containing class/module's definition line, ignoring nested classes
|
||||||
let line = getline(a:lnum)
|
" along the way.
|
||||||
let col = match(line, '.*\zs' . a:regex)
|
"
|
||||||
while col != -1 && s:IsInStringOrComment(a:lnum, col)
|
function! s:FindContainingClass()
|
||||||
let line = strpart(line, 0, col)
|
let saved_position = getpos('.')
|
||||||
let col = match(line, '.*' . a:regex)
|
|
||||||
|
while searchpair(s:end_start_regex, s:end_middle_regex, s:end_end_regex, 'bW',
|
||||||
|
\ s:end_skip_expr) > 0
|
||||||
|
if expand('<cword>') =~# '\<class\|module\>'
|
||||||
|
let found_lnum = line('.')
|
||||||
|
call setpos('.', saved_position)
|
||||||
|
return found_lnum
|
||||||
|
endif
|
||||||
endwhile
|
endwhile
|
||||||
return col + 1
|
|
||||||
|
call setpos('.', saved_position)
|
||||||
|
return 0
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" 3. GetRubyIndent Function {{{1
|
" 3. GetRubyIndent Function {{{1
|
||||||
@ -320,6 +403,13 @@ function GetRubyIndent(...)
|
|||||||
" 3.1. Setup {{{2
|
" 3.1. Setup {{{2
|
||||||
" ----------
|
" ----------
|
||||||
|
|
||||||
|
" The value of a single shift-width
|
||||||
|
if exists('*shiftwidth')
|
||||||
|
let sw = shiftwidth()
|
||||||
|
else
|
||||||
|
let sw = &sw
|
||||||
|
endif
|
||||||
|
|
||||||
" For the current line, use the first argument if given, else v:lnum
|
" For the current line, use the first argument if given, else v:lnum
|
||||||
let clnum = a:0 ? a:1 : v:lnum
|
let clnum = a:0 ? a:1 : v:lnum
|
||||||
|
|
||||||
@ -333,6 +423,24 @@ function GetRubyIndent(...)
|
|||||||
let line = getline(clnum)
|
let line = getline(clnum)
|
||||||
let ind = -1
|
let ind = -1
|
||||||
|
|
||||||
|
" If this line is an access modifier keyword, align according to the closest
|
||||||
|
" class declaration.
|
||||||
|
if g:ruby_indent_access_modifier_style == 'indent'
|
||||||
|
if s:Match(clnum, s:access_modifier_regex)
|
||||||
|
let class_line = s:FindContainingClass()
|
||||||
|
if class_line > 0
|
||||||
|
return indent(class_line) + sw
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
elseif g:ruby_indent_access_modifier_style == 'outdent'
|
||||||
|
if s:Match(clnum, s:access_modifier_regex)
|
||||||
|
let class_line = s:FindContainingClass()
|
||||||
|
if class_line > 0
|
||||||
|
return indent(class_line)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
" If we got a closing bracket on an empty line, find its match and indent
|
" If we got a closing bracket on an empty line, find its match and indent
|
||||||
" according to it. For parentheses we indent to its column - 1, for the
|
" according to it. For parentheses we indent to its column - 1, for the
|
||||||
" others we indent to the containing line's MSL's level. Return -1 if fail.
|
" others we indent to the containing line's MSL's level. Return -1 if fail.
|
||||||
@ -343,7 +451,9 @@ function GetRubyIndent(...)
|
|||||||
if searchpair(escape(bs[0], '\['), '', bs[1], 'bW', s:skip_expr) > 0
|
if searchpair(escape(bs[0], '\['), '', bs[1], 'bW', s:skip_expr) > 0
|
||||||
if line[col-1]==')' && col('.') != col('$') - 1
|
if line[col-1]==')' && col('.') != col('$') - 1
|
||||||
let ind = virtcol('.') - 1
|
let ind = virtcol('.') - 1
|
||||||
else
|
elseif g:ruby_indent_block_style == 'do'
|
||||||
|
let ind = indent(line('.'))
|
||||||
|
else " g:ruby_indent_block_style == 'expression'
|
||||||
let ind = indent(s:GetMSL(line('.')))
|
let ind = indent(s:GetMSL(line('.')))
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@ -366,10 +476,17 @@ function GetRubyIndent(...)
|
|||||||
|
|
||||||
if strpart(line, 0, col('.') - 1) =~ '=\s*$' &&
|
if strpart(line, 0, col('.') - 1) =~ '=\s*$' &&
|
||||||
\ strpart(line, col('.') - 1, 2) !~ 'do'
|
\ strpart(line, col('.') - 1, 2) !~ 'do'
|
||||||
|
" assignment to case/begin/etc, on the same line, hanging indent
|
||||||
let ind = virtcol('.') - 1
|
let ind = virtcol('.') - 1
|
||||||
|
elseif g:ruby_indent_block_style == 'do'
|
||||||
|
" align to line of the "do", not to the MSL
|
||||||
|
let ind = indent(line('.'))
|
||||||
elseif getline(msl) =~ '=\s*\(#.*\)\=$'
|
elseif getline(msl) =~ '=\s*\(#.*\)\=$'
|
||||||
|
" in the case of assignment to the MSL, align to the starting line,
|
||||||
|
" not to the MSL
|
||||||
let ind = indent(line('.'))
|
let ind = indent(line('.'))
|
||||||
else
|
else
|
||||||
|
" align to the MSL
|
||||||
let ind = indent(msl)
|
let ind = indent(msl)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@ -389,6 +506,11 @@ function GetRubyIndent(...)
|
|||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" If the current line starts with a leading operator, add a level of indent.
|
||||||
|
if s:Match(clnum, s:leading_operator_regex)
|
||||||
|
return indent(s:GetMSL(clnum)) + sw
|
||||||
|
endif
|
||||||
|
|
||||||
" 3.3. Work on the previous line. {{{2
|
" 3.3. Work on the previous line. {{{2
|
||||||
" -------------------------------
|
" -------------------------------
|
||||||
|
|
||||||
@ -409,14 +531,50 @@ function GetRubyIndent(...)
|
|||||||
let line = getline(lnum)
|
let line = getline(lnum)
|
||||||
let ind = indent(lnum)
|
let ind = indent(lnum)
|
||||||
|
|
||||||
|
if g:ruby_indent_access_modifier_style == 'indent'
|
||||||
|
" If the previous line was a private/protected keyword, add a
|
||||||
|
" level of indent.
|
||||||
|
if s:Match(lnum, s:indent_access_modifier_regex)
|
||||||
|
return indent(lnum) + sw
|
||||||
|
endif
|
||||||
|
elseif g:ruby_indent_access_modifier_style == 'outdent'
|
||||||
|
" If the previous line was a private/protected/public keyword, add
|
||||||
|
" a level of indent, since the keyword has been out-dented.
|
||||||
|
if s:Match(lnum, s:access_modifier_regex)
|
||||||
|
return indent(lnum) + sw
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if s:Match(lnum, s:continuable_regex) && s:Match(lnum, s:continuation_regex)
|
||||||
|
return indent(s:GetMSL(lnum)) + sw + sw
|
||||||
|
endif
|
||||||
|
|
||||||
" If the previous line ended with a block opening, add a level of indent.
|
" If the previous line ended with a block opening, add a level of indent.
|
||||||
if s:Match(lnum, s:block_regex)
|
if s:Match(lnum, s:block_regex)
|
||||||
return indent(s:GetMSL(lnum)) + &sw
|
let msl = s:GetMSL(lnum)
|
||||||
|
|
||||||
|
if g:ruby_indent_block_style == 'do'
|
||||||
|
" don't align to the msl, align to the "do"
|
||||||
|
let ind = indent(lnum) + sw
|
||||||
|
elseif getline(msl) =~ '=\s*\(#.*\)\=$'
|
||||||
|
" in the case of assignment to the msl, align to the starting line,
|
||||||
|
" not to the msl
|
||||||
|
let ind = indent(lnum) + sw
|
||||||
|
else
|
||||||
|
let ind = indent(msl) + sw
|
||||||
|
endif
|
||||||
|
return ind
|
||||||
|
endif
|
||||||
|
|
||||||
|
" If the previous line started with a leading operator, use its MSL's level
|
||||||
|
" of indent
|
||||||
|
if s:Match(lnum, s:leading_operator_regex)
|
||||||
|
return indent(s:GetMSL(lnum))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" If the previous line ended with the "*" of a splat, add a level of indent
|
" If the previous line ended with the "*" of a splat, add a level of indent
|
||||||
if line =~ s:splat_regex
|
if line =~ s:splat_regex
|
||||||
return indent(lnum) + &sw
|
return indent(lnum) + sw
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" If the previous line contained unclosed opening brackets and we are still
|
" If the previous line contained unclosed opening brackets and we are still
|
||||||
@ -431,22 +589,22 @@ function GetRubyIndent(...)
|
|||||||
if opening.pos != -1
|
if opening.pos != -1
|
||||||
if opening.type == '(' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
|
if opening.type == '(' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
|
||||||
if col('.') + 1 == col('$')
|
if col('.') + 1 == col('$')
|
||||||
return ind + &sw
|
return ind + sw
|
||||||
else
|
else
|
||||||
return virtcol('.')
|
return virtcol('.')
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
let nonspace = matchend(line, '\S', opening.pos + 1) - 1
|
let nonspace = matchend(line, '\S', opening.pos + 1) - 1
|
||||||
return nonspace > 0 ? nonspace : ind + &sw
|
return nonspace > 0 ? nonspace : ind + sw
|
||||||
endif
|
endif
|
||||||
elseif closing.pos != -1
|
elseif closing.pos != -1
|
||||||
call cursor(lnum, closing.pos + 1)
|
call cursor(lnum, closing.pos + 1)
|
||||||
normal! %
|
normal! %
|
||||||
|
|
||||||
if s:Match(line('.'), s:ruby_indent_keywords)
|
if s:Match(line('.'), s:ruby_indent_keywords)
|
||||||
return indent('.') + &sw
|
return indent('.') + sw
|
||||||
else
|
else
|
||||||
return indent('.')
|
return indent(s:GetMSL(line('.')))
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
call cursor(clnum, vcol)
|
call cursor(clnum, vcol)
|
||||||
@ -473,7 +631,7 @@ function GetRubyIndent(...)
|
|||||||
let col = s:Match(lnum, s:ruby_indent_keywords)
|
let col = s:Match(lnum, s:ruby_indent_keywords)
|
||||||
if col > 0
|
if col > 0
|
||||||
call cursor(lnum, col)
|
call cursor(lnum, col)
|
||||||
let ind = virtcol('.') - 1 + &sw
|
let ind = virtcol('.') - 1 + sw
|
||||||
" TODO: make this better (we need to count them) (or, if a searchpair
|
" TODO: make this better (we need to count them) (or, if a searchpair
|
||||||
" fails, we know that something is lacking an end and thus we indent a
|
" fails, we know that something is lacking an end and thus we indent a
|
||||||
" level
|
" level
|
||||||
@ -490,10 +648,14 @@ function GetRubyIndent(...)
|
|||||||
let p_lnum = lnum
|
let p_lnum = lnum
|
||||||
let lnum = s:GetMSL(lnum)
|
let lnum = s:GetMSL(lnum)
|
||||||
|
|
||||||
" If the previous line wasn't a MSL and is continuation return its indent.
|
" If the previous line wasn't a MSL.
|
||||||
" TODO: the || s:IsInString() thing worries me a bit.
|
|
||||||
if p_lnum != lnum
|
if p_lnum != lnum
|
||||||
if s:Match(p_lnum, s:non_bracket_continuation_regex) || s:IsInString(p_lnum,strlen(line))
|
" If previous line ends bracket and begins non-bracket continuation decrease indent by 1.
|
||||||
|
if s:Match(p_lnum, s:bracket_switch_continuation_regex)
|
||||||
|
return ind - 1
|
||||||
|
" If previous line is a continuation return its indent.
|
||||||
|
" TODO: the || s:IsInString() thing worries me a bit.
|
||||||
|
elseif s:Match(p_lnum, s:non_bracket_continuation_regex) || s:IsInString(p_lnum,strlen(line))
|
||||||
return ind
|
return ind
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@ -506,9 +668,9 @@ function GetRubyIndent(...)
|
|||||||
" TODO: this does not take into account contrived things such as
|
" TODO: this does not take into account contrived things such as
|
||||||
" module Foo; class Bar; end
|
" module Foo; class Bar; end
|
||||||
if s:Match(lnum, s:ruby_indent_keywords)
|
if s:Match(lnum, s:ruby_indent_keywords)
|
||||||
let ind = msl_ind + &sw
|
let ind = msl_ind + sw
|
||||||
if s:Match(lnum, s:end_end_regex)
|
if s:Match(lnum, s:end_end_regex)
|
||||||
let ind = ind - &sw
|
let ind = ind - sw
|
||||||
endif
|
endif
|
||||||
return ind
|
return ind
|
||||||
endif
|
endif
|
||||||
@ -517,7 +679,7 @@ function GetRubyIndent(...)
|
|||||||
" closing bracket, indent one extra level.
|
" closing bracket, indent one extra level.
|
||||||
if s:Match(lnum, s:non_bracket_continuation_regex) && !s:Match(lnum, '^\s*\([\])}]\|end\)')
|
if s:Match(lnum, s:non_bracket_continuation_regex) && !s:Match(lnum, '^\s*\([\])}]\|end\)')
|
||||||
if lnum == p_lnum
|
if lnum == p_lnum
|
||||||
let ind = msl_ind + &sw
|
let ind = msl_ind + sw
|
||||||
else
|
else
|
||||||
let ind = msl_ind
|
let ind = msl_ind
|
||||||
endif
|
endif
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Vim indent file
|
" Vim indent file
|
||||||
" Language: Sass
|
" Language: Sass
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2013 May 30
|
" Last Change: 2016 Aug 29
|
||||||
|
|
||||||
if exists("b:did_indent")
|
if exists("b:did_indent")
|
||||||
finish
|
finish
|
||||||
@ -29,9 +29,7 @@ function! GetSassIndent()
|
|||||||
let indent = indent(lnum)
|
let indent = indent(lnum)
|
||||||
let cindent = indent(v:lnum)
|
let cindent = indent(v:lnum)
|
||||||
if line !~ s:property && line !~ s:extend && cline =~ s:property
|
if line !~ s:property && line !~ s:extend && cline =~ s:property
|
||||||
return indent + &sw
|
return indent + (exists('*shiftwidth') ? shiftwidth() : &sw)
|
||||||
"elseif line =~ s:property && cline !~ s:property
|
|
||||||
"return indent - &sw
|
|
||||||
else
|
else
|
||||||
return -1
|
return -1
|
||||||
endif
|
endif
|
||||||
|
@ -347,7 +347,7 @@ fun! vimball#Vimball(really,...)
|
|||||||
" call Decho("exe tabn ".curtabnr)
|
" call Decho("exe tabn ".curtabnr)
|
||||||
exe "tabn ".curtabnr
|
exe "tabn ".curtabnr
|
||||||
|
|
||||||
" set up help if its a doc/*.txt file
|
" set up help if it's a doc/*.txt file
|
||||||
" call Decho("didhelp<".didhelp."> fname<".fname.">")
|
" call Decho("didhelp<".didhelp."> fname<".fname.">")
|
||||||
if a:really && didhelp == "" && fname =~ 'doc/[^/]\+\.\(txt\|..x\)$'
|
if a:really && didhelp == "" && fname =~ 'doc/[^/]\+\.\(txt\|..x\)$'
|
||||||
let didhelp= substitute(fname,'^\(.*\<doc\)[/\\][^.]*\.\(txt\|..x\)$','\1','')
|
let didhelp= substitute(fname,'^\(.*\<doc\)[/\\][^.]*\.\(txt\|..x\)$','\1','')
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
" zipPlugin.vim: Handles browsing zipfiles
|
" zipPlugin.vim: Handles browsing zipfiles
|
||||||
" PLUGIN PORTION
|
" PLUGIN PORTION
|
||||||
" Date: Jun 07, 2013
|
" Date: Sep 13, 2016
|
||||||
" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
|
" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
|
||||||
" License: Vim License (see vim's :help license)
|
" License: Vim License (see vim's :help license)
|
||||||
" Copyright: Copyright (C) 2005-2013 Charles E. Campbell {{{1
|
" Copyright: Copyright (C) 2005-2016 Charles E. Campbell {{{1
|
||||||
" Permission is hereby granted to use and distribute this code,
|
" Permission is hereby granted to use and distribute this code,
|
||||||
" with or without modifications, provided that this copyright
|
" with or without modifications, provided that this copyright
|
||||||
" notice is copied with it. Like anything else that's free,
|
" notice is copied with it. Like anything else that's free,
|
||||||
@ -20,14 +20,14 @@
|
|||||||
if &cp || exists("g:loaded_zipPlugin")
|
if &cp || exists("g:loaded_zipPlugin")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let g:loaded_zipPlugin = "v27"
|
let g:loaded_zipPlugin = "v28"
|
||||||
let s:keepcpo = &cpo
|
let s:keepcpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" Options: {{{1
|
" Options: {{{1
|
||||||
if !exists("g:zipPlugin_ext")
|
if !exists("g:zipPlugin_ext")
|
||||||
let g:zipPlugin_ext= '*.zip,*.jar,*.xpi,*.ja,*.war,*.ear,*.celzip,*.oxt,*.kmz,*.wsz,*.xap,*.docx,*.docm,*.dotx,*.dotm,*.potx,*.potm,*.ppsx,*.ppsm,*.pptx,*.pptm,*.ppam,*.sldx,*.thmx,*.xlam,*.xlsx,*.xlsm,*.xlsb,*.xltx,*.xltm,*.xlam,*.crtx,*.vdw,*.glox,*.gcsx,*.gqsx'
|
let g:zipPlugin_ext='*.apk,*.celzip,*.crtx,*.docm,*.docx,*.dotm,*.dotx,*.ear,*.epub,*.gcsx,*.glox,*.gqsx,*.ja,*.jar,*.kmz,*.oxt,*.potm,*.potx,*.ppam,*.ppsm,*.ppsx,*.pptm,*.pptx,*.sldx,*.thmx,*.vdw,*.war,*.wsz,*.xap,*.xlam,*.xlam,*.xlsb,*.xlsm,*.xlsx,*.xltm,*.xltx,*.xpi,*.zip'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
|
@ -61,7 +61,6 @@ an 50.10.320 &Syntax.AB.Ascii\ Doc :cal SetSyn("asciidoc")<CR>
|
|||||||
an 50.10.330 &Syntax.AB.ASP\ with\ VBScript :cal SetSyn("aspvbs")<CR>
|
an 50.10.330 &Syntax.AB.ASP\ with\ VBScript :cal SetSyn("aspvbs")<CR>
|
||||||
an 50.10.340 &Syntax.AB.ASP\ with\ Perl :cal SetSyn("aspperl")<CR>
|
an 50.10.340 &Syntax.AB.ASP\ with\ Perl :cal SetSyn("aspperl")<CR>
|
||||||
an 50.10.350 &Syntax.AB.Assembly.680x0 :cal SetSyn("asm68k")<CR>
|
an 50.10.350 &Syntax.AB.Assembly.680x0 :cal SetSyn("asm68k")<CR>
|
||||||
an 50.10.355 &Syntax.AB.Assembly.AVR :cal SetSyn("avra")<CR>
|
|
||||||
an 50.10.360 &Syntax.AB.Assembly.Flat :cal SetSyn("fasm")<CR>
|
an 50.10.360 &Syntax.AB.Assembly.Flat :cal SetSyn("fasm")<CR>
|
||||||
an 50.10.370 &Syntax.AB.Assembly.GNU :cal SetSyn("asm")<CR>
|
an 50.10.370 &Syntax.AB.Assembly.GNU :cal SetSyn("asm")<CR>
|
||||||
an 50.10.380 &Syntax.AB.Assembly.GNU\ H-8300 :cal SetSyn("asmh8300")<CR>
|
an 50.10.380 &Syntax.AB.Assembly.GNU\ H-8300 :cal SetSyn("asmh8300")<CR>
|
||||||
@ -162,31 +161,31 @@ an 50.30.290 &Syntax.DE.Doxygen.C\ with\ doxygen :cal SetSyn("c.doxygen")<CR>
|
|||||||
an 50.30.300 &Syntax.DE.Doxygen.C++\ with\ doxygen :cal SetSyn("cpp.doxygen")<CR>
|
an 50.30.300 &Syntax.DE.Doxygen.C++\ with\ doxygen :cal SetSyn("cpp.doxygen")<CR>
|
||||||
an 50.30.310 &Syntax.DE.Doxygen.IDL\ with\ doxygen :cal SetSyn("idl.doxygen")<CR>
|
an 50.30.310 &Syntax.DE.Doxygen.IDL\ with\ doxygen :cal SetSyn("idl.doxygen")<CR>
|
||||||
an 50.30.320 &Syntax.DE.Doxygen.Java\ with\ doxygen :cal SetSyn("java.doxygen")<CR>
|
an 50.30.320 &Syntax.DE.Doxygen.Java\ with\ doxygen :cal SetSyn("java.doxygen")<CR>
|
||||||
an 50.30.320 &Syntax.DE.Doxygen.DataScript\ with\ doxygen :cal SetSyn("datascript.doxygen")<CR>
|
an 50.30.330 &Syntax.DE.Doxygen.DataScript\ with\ doxygen :cal SetSyn("datascript.doxygen")<CR>
|
||||||
an 50.30.330 &Syntax.DE.Dracula :cal SetSyn("dracula")<CR>
|
an 50.30.340 &Syntax.DE.Dracula :cal SetSyn("dracula")<CR>
|
||||||
an 50.30.340 &Syntax.DE.DSSSL :cal SetSyn("dsl")<CR>
|
an 50.30.350 &Syntax.DE.DSSSL :cal SetSyn("dsl")<CR>
|
||||||
an 50.30.350 &Syntax.DE.DTD :cal SetSyn("dtd")<CR>
|
an 50.30.360 &Syntax.DE.DTD :cal SetSyn("dtd")<CR>
|
||||||
an 50.30.360 &Syntax.DE.DTML\ (Zope) :cal SetSyn("dtml")<CR>
|
an 50.30.370 &Syntax.DE.DTML\ (Zope) :cal SetSyn("dtml")<CR>
|
||||||
an 50.30.370 &Syntax.DE.DTrace :cal SetSyn("dtrace")<CR>
|
an 50.30.380 &Syntax.DE.DTrace :cal SetSyn("dtrace")<CR>
|
||||||
an 50.30.380 &Syntax.DE.Dts/dtsi :cal SetSyn("dts")<CR>
|
an 50.30.390 &Syntax.DE.Dts/dtsi :cal SetSyn("dts")<CR>
|
||||||
an 50.30.390 &Syntax.DE.Dylan.Dylan :cal SetSyn("dylan")<CR>
|
an 50.30.400 &Syntax.DE.Dylan.Dylan :cal SetSyn("dylan")<CR>
|
||||||
an 50.30.400 &Syntax.DE.Dylan.Dylan\ interface :cal SetSyn("dylanintr")<CR>
|
an 50.30.410 &Syntax.DE.Dylan.Dylan\ interface :cal SetSyn("dylanintr")<CR>
|
||||||
an 50.30.410 &Syntax.DE.Dylan.Dylan\ lid :cal SetSyn("dylanlid")<CR>
|
an 50.30.420 &Syntax.DE.Dylan.Dylan\ lid :cal SetSyn("dylanlid")<CR>
|
||||||
an 50.30.430 &Syntax.DE.EDIF :cal SetSyn("edif")<CR>
|
an 50.30.440 &Syntax.DE.EDIF :cal SetSyn("edif")<CR>
|
||||||
an 50.30.440 &Syntax.DE.Eiffel :cal SetSyn("eiffel")<CR>
|
an 50.30.450 &Syntax.DE.Eiffel :cal SetSyn("eiffel")<CR>
|
||||||
an 50.30.450 &Syntax.DE.Elinks\ config :cal SetSyn("elinks")<CR>
|
an 50.30.460 &Syntax.DE.Elinks\ config :cal SetSyn("elinks")<CR>
|
||||||
an 50.30.460 &Syntax.DE.Elm\ filter\ rules :cal SetSyn("elmfilt")<CR>
|
an 50.30.470 &Syntax.DE.Elm\ filter\ rules :cal SetSyn("elmfilt")<CR>
|
||||||
an 50.30.470 &Syntax.DE.Embedix\ Component\ Description :cal SetSyn("ecd")<CR>
|
an 50.30.480 &Syntax.DE.Embedix\ Component\ Description :cal SetSyn("ecd")<CR>
|
||||||
an 50.30.480 &Syntax.DE.ERicsson\ LANGuage :cal SetSyn("erlang")<CR>
|
an 50.30.490 &Syntax.DE.ERicsson\ LANGuage :cal SetSyn("erlang")<CR>
|
||||||
an 50.30.490 &Syntax.DE.ESMTP\ rc :cal SetSyn("esmtprc")<CR>
|
an 50.30.500 &Syntax.DE.ESMTP\ rc :cal SetSyn("esmtprc")<CR>
|
||||||
an 50.30.500 &Syntax.DE.ESQL-C :cal SetSyn("esqlc")<CR>
|
an 50.30.510 &Syntax.DE.ESQL-C :cal SetSyn("esqlc")<CR>
|
||||||
an 50.30.510 &Syntax.DE.Essbase\ script :cal SetSyn("csc")<CR>
|
an 50.30.520 &Syntax.DE.Essbase\ script :cal SetSyn("csc")<CR>
|
||||||
an 50.30.520 &Syntax.DE.Esterel :cal SetSyn("esterel")<CR>
|
an 50.30.530 &Syntax.DE.Esterel :cal SetSyn("esterel")<CR>
|
||||||
an 50.30.530 &Syntax.DE.Eterm\ config :cal SetSyn("eterm")<CR>
|
an 50.30.540 &Syntax.DE.Eterm\ config :cal SetSyn("eterm")<CR>
|
||||||
an 50.30.540 &Syntax.DE.Eviews :cal SetSyn("eviews")<CR>
|
an 50.30.550 &Syntax.DE.Eviews :cal SetSyn("eviews")<CR>
|
||||||
an 50.30.550 &Syntax.DE.Exim\ conf :cal SetSyn("exim")<CR>
|
an 50.30.560 &Syntax.DE.Exim\ conf :cal SetSyn("exim")<CR>
|
||||||
an 50.30.560 &Syntax.DE.Expect :cal SetSyn("expect")<CR>
|
an 50.30.570 &Syntax.DE.Expect :cal SetSyn("expect")<CR>
|
||||||
an 50.30.570 &Syntax.DE.Exports :cal SetSyn("exports")<CR>
|
an 50.30.580 &Syntax.DE.Exports :cal SetSyn("exports")<CR>
|
||||||
an 50.40.100 &Syntax.FG.Falcon :cal SetSyn("falcon")<CR>
|
an 50.40.100 &Syntax.FG.Falcon :cal SetSyn("falcon")<CR>
|
||||||
an 50.40.110 &Syntax.FG.Fantom :cal SetSyn("fan")<CR>
|
an 50.40.110 &Syntax.FG.Fantom :cal SetSyn("fan")<CR>
|
||||||
an 50.40.120 &Syntax.FG.Fetchmail :cal SetSyn("fetchmail")<CR>
|
an 50.40.120 &Syntax.FG.Fetchmail :cal SetSyn("fetchmail")<CR>
|
||||||
@ -328,7 +327,6 @@ an 50.70.270 &Syntax.M.Messages\ (/var/log) :cal SetSyn("messages")<CR>
|
|||||||
an 50.70.280 &Syntax.M.Metafont :cal SetSyn("mf")<CR>
|
an 50.70.280 &Syntax.M.Metafont :cal SetSyn("mf")<CR>
|
||||||
an 50.70.290 &Syntax.M.MetaPost :cal SetSyn("mp")<CR>
|
an 50.70.290 &Syntax.M.MetaPost :cal SetSyn("mp")<CR>
|
||||||
an 50.70.300 &Syntax.M.MGL :cal SetSyn("mgl")<CR>
|
an 50.70.300 &Syntax.M.MGL :cal SetSyn("mgl")<CR>
|
||||||
an 50.70.305 &Syntax.M.MIX :cal SetSyn("mix")<CR>
|
|
||||||
an 50.70.310 &Syntax.M.MMIX :cal SetSyn("mmix")<CR>
|
an 50.70.310 &Syntax.M.MMIX :cal SetSyn("mmix")<CR>
|
||||||
an 50.70.320 &Syntax.M.Modconf :cal SetSyn("modconf")<CR>
|
an 50.70.320 &Syntax.M.Modconf :cal SetSyn("modconf")<CR>
|
||||||
an 50.70.330 &Syntax.M.Model :cal SetSyn("model")<CR>
|
an 50.70.330 &Syntax.M.Model :cal SetSyn("model")<CR>
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: xa 6502 cross assembler
|
" Language: xa 6502 cross assembler
|
||||||
" Maintainer: Clemens Kirchgatterer <clemens@1541.org>
|
" Maintainer: Clemens Kirchgatterer <clemens@1541.org>
|
||||||
" Last Change: 2014 Jan 05
|
" Last Change: 2016 Aug 31
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -138,29 +135,19 @@ syn match a65End excludenl /end$/ contained
|
|||||||
syn match a65Continue "\\$" contained
|
syn match a65Continue "\\$" contained
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
if version >= 508 || !exists("did_a65_syntax_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_a65_syntax_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
HiLink a65Section Special
|
hi def link a65Section Special
|
||||||
HiLink a65Address Special
|
hi def link a65Address Special
|
||||||
HiLink a65Comment Comment
|
hi def link a65Comment Comment
|
||||||
HiLink a65PreProc PreProc
|
hi def link a65PreProc PreProc
|
||||||
HiLink a65Number Number
|
hi def link a65Number Number
|
||||||
HiLink a65String String
|
hi def link a65String String
|
||||||
HiLink a65Type Statement
|
hi def link a65Type Statement
|
||||||
HiLink a65Opcode Type
|
hi def link a65Opcode Type
|
||||||
HiLink a65PC Error
|
hi def link a65PC Error
|
||||||
HiLink a65Todo Todo
|
hi def link a65Todo Todo
|
||||||
HiLink a65HiLo Number
|
hi def link a65HiLo Number
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "a65"
|
let b:current_syntax = "a65"
|
||||||
|
@ -5,11 +5,8 @@
|
|||||||
" Last Change: 2013 Jun 13
|
" Last Change: 2013 Jun 13
|
||||||
" Comment: Thanks to EPI-USE Labs for all your assistance. :)
|
" Comment: Thanks to EPI-USE Labs for all your assistance. :)
|
||||||
|
|
||||||
" For version < 6.0: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version >= 6.0: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -43,11 +40,7 @@ syn match abapStringEscape contained "``"
|
|||||||
syn match abapNumber "\-\=\<\d\+\>"
|
syn match abapNumber "\-\=\<\d\+\>"
|
||||||
syn region abapHex matchgroup=abapHex start="X'" end="'"
|
syn region abapHex matchgroup=abapHex start="X'" end="'"
|
||||||
|
|
||||||
if version >= 600
|
setlocal iskeyword=48-57,_,A-Z,a-z,/
|
||||||
setlocal iskeyword=48-57,_,A-Z,a-z,/
|
|
||||||
else
|
|
||||||
set iskeyword=48-57,_,A-Z,a-z,/
|
|
||||||
endif
|
|
||||||
|
|
||||||
syn match abapNamespace "\</\w\+/"
|
syn match abapNamespace "\</\w\+/"
|
||||||
|
|
||||||
@ -175,38 +168,28 @@ syn keyword abapTodo contained TODO NOTE
|
|||||||
syn match abapTodo "\#EC\W\+\w\+"
|
syn match abapTodo "\#EC\W\+\w\+"
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
if version >= 508 || !exists("did_abap_syntax_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_abap_syntax_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
HiLink abapError Error
|
hi def link abapError Error
|
||||||
HiLink abapComment Comment
|
hi def link abapComment Comment
|
||||||
HiLink abapInclude Include
|
hi def link abapInclude Include
|
||||||
HiLink abapStatement Statement
|
hi def link abapStatement Statement
|
||||||
HiLink abapComplexStatement Statement
|
hi def link abapComplexStatement Statement
|
||||||
HiLink abapSpecial Special
|
hi def link abapSpecial Special
|
||||||
HiLink abapNamespace Special
|
hi def link abapNamespace Special
|
||||||
HiLink abapSpecialTables Special
|
hi def link abapSpecialTables Special
|
||||||
HiLink abapSymbolOperator abapOperator
|
hi def link abapSymbolOperator abapOperator
|
||||||
HiLink abapOperator Operator
|
hi def link abapOperator Operator
|
||||||
HiLink abapCharString String
|
hi def link abapCharString String
|
||||||
HiLink abapString String
|
hi def link abapString String
|
||||||
HiLink abapFloat Float
|
hi def link abapFloat Float
|
||||||
HiLink abapTypes Type
|
hi def link abapTypes Type
|
||||||
HiLink abapSymbol Structure
|
hi def link abapSymbol Structure
|
||||||
HiLink abapStructure Structure
|
hi def link abapStructure Structure
|
||||||
HiLink abapField Variable
|
hi def link abapField Variable
|
||||||
HiLink abapNumber Number
|
hi def link abapNumber Number
|
||||||
HiLink abapHex Number
|
hi def link abapHex Number
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "abap"
|
let b:current_syntax = "abap"
|
||||||
|
|
||||||
|
@ -4,11 +4,8 @@
|
|||||||
" Last Change: 2002 Feb 24
|
" Last Change: 2002 Feb 24
|
||||||
" Remark: Huge improvement in folding performance--see filetype plugin
|
" Remark: Huge improvement in folding performance--see filetype plugin
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -25,24 +22,14 @@ syn match abaqusValue "=\s*[^,]*"lc=1 contained display
|
|||||||
syn match abaqusBadLine "^\s\+\*.*" display
|
syn match abaqusBadLine "^\s\+\*.*" display
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
if version >= 508 || !exists("did_abaqus_syn_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_abaqus_syn_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
" The default methods for highlighting. Can be overridden later
|
" The default methods for highlighting. Can be overridden later
|
||||||
HiLink abaqusComment Comment
|
hi def link abaqusComment Comment
|
||||||
HiLink abaqusKeyword Statement
|
hi def link abaqusKeyword Statement
|
||||||
HiLink abaqusParameter Identifier
|
hi def link abaqusParameter Identifier
|
||||||
HiLink abaqusValue Constant
|
hi def link abaqusValue Constant
|
||||||
HiLink abaqusBadLine Error
|
hi def link abaqusBadLine Error
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "abaqus"
|
let b:current_syntax = "abaqus"
|
||||||
|
@ -4,11 +4,8 @@
|
|||||||
" URL: http://perun.hscs.wmin.ac.uk/~jra/vim/syntax/abc.vim
|
" URL: http://perun.hscs.wmin.ac.uk/~jra/vim/syntax/abc.vim
|
||||||
" Last Change: 27th April 2001
|
" Last Change: 27th April 2001
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -36,28 +33,18 @@ syn match abcComment "%.*$"
|
|||||||
|
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
if version >= 508 || !exists("did_abc_syn_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_abc_syn_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
HiLink abcComment Comment
|
hi def link abcComment Comment
|
||||||
HiLink abcHeadField Type
|
hi def link abcHeadField Type
|
||||||
HiLink abcBodyField Special
|
hi def link abcBodyField Special
|
||||||
HiLink abcBar Statement
|
hi def link abcBar Statement
|
||||||
HiLink abcTuple Statement
|
hi def link abcTuple Statement
|
||||||
HiLink abcBroken Statement
|
hi def link abcBroken Statement
|
||||||
HiLink abcTie Statement
|
hi def link abcTie Statement
|
||||||
HiLink abcGuitarChord Identifier
|
hi def link abcGuitarChord Identifier
|
||||||
HiLink abcNote Constant
|
hi def link abcNote Constant
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "abc"
|
let b:current_syntax = "abc"
|
||||||
|
|
||||||
|
@ -3,11 +3,8 @@
|
|||||||
" Maintainer: John Cook <johncook3@gmail.com>
|
" Maintainer: John Cook <johncook3@gmail.com>
|
||||||
" Last Change: 2011 Dec 27
|
" Last Change: 2011 Dec 27
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -123,48 +120,38 @@ endif
|
|||||||
syn sync minlines=1
|
syn sync minlines=1
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
if version >= 508 || !exists("did_abel_syn_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_abel_syn_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
" The default highlighting.
|
" The default highlighting.
|
||||||
HiLink abelHeader abelStatement
|
hi def link abelHeader abelStatement
|
||||||
HiLink abelSection abelStatement
|
hi def link abelSection abelStatement
|
||||||
HiLink abelDeclaration abelStatement
|
hi def link abelDeclaration abelStatement
|
||||||
HiLink abelLogicalOperator abelOperator
|
hi def link abelLogicalOperator abelOperator
|
||||||
HiLink abelRangeOperator abelOperator
|
hi def link abelRangeOperator abelOperator
|
||||||
HiLink abelAlternateOperator abelOperator
|
hi def link abelAlternateOperator abelOperator
|
||||||
HiLink abelArithmeticOperator abelOperator
|
hi def link abelArithmeticOperator abelOperator
|
||||||
HiLink abelRelationalOperator abelOperator
|
hi def link abelRelationalOperator abelOperator
|
||||||
HiLink abelAssignmentOperator abelOperator
|
hi def link abelAssignmentOperator abelOperator
|
||||||
HiLink abelTruthTableOperator abelOperator
|
hi def link abelTruthTableOperator abelOperator
|
||||||
HiLink abelSpecifier abelStatement
|
hi def link abelSpecifier abelStatement
|
||||||
HiLink abelOperator abelStatement
|
hi def link abelOperator abelStatement
|
||||||
HiLink abelStatement Statement
|
hi def link abelStatement Statement
|
||||||
HiLink abelIdentifier Identifier
|
hi def link abelIdentifier Identifier
|
||||||
HiLink abelTypeId abelType
|
hi def link abelTypeId abelType
|
||||||
HiLink abelTypeIdChar abelType
|
hi def link abelTypeIdChar abelType
|
||||||
HiLink abelType Type
|
hi def link abelType Type
|
||||||
HiLink abelNumber abelString
|
hi def link abelNumber abelString
|
||||||
HiLink abelString String
|
hi def link abelString String
|
||||||
HiLink abelConstant Constant
|
hi def link abelConstant Constant
|
||||||
HiLink abelComment Comment
|
hi def link abelComment Comment
|
||||||
HiLink abelExtension abelSpecial
|
hi def link abelExtension abelSpecial
|
||||||
HiLink abelSpecialChar abelSpecial
|
hi def link abelSpecialChar abelSpecial
|
||||||
HiLink abelTypeIdEnd abelSpecial
|
hi def link abelTypeIdEnd abelSpecial
|
||||||
HiLink abelSpecial Special
|
hi def link abelSpecial Special
|
||||||
HiLink abelDirective PreProc
|
hi def link abelDirective PreProc
|
||||||
HiLink abelTodo Todo
|
hi def link abelTodo Todo
|
||||||
HiLink abelError Error
|
hi def link abelError Error
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "abel"
|
let b:current_syntax = "abel"
|
||||||
|
|
||||||
|
@ -7,11 +7,8 @@
|
|||||||
" Syntax file to handle all $ACEDB/wspec/*.wrm files, primarily models.wrm
|
" Syntax file to handle all $ACEDB/wspec/*.wrm files, primarily models.wrm
|
||||||
" AceDB software is available from http://www.acedb.org
|
" AceDB software is available from http://www.acedb.org
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -86,35 +83,25 @@ syn region acedbString start=/"/ end=/"/ skip=/\\"/ oneline
|
|||||||
" Rest of syntax highlighting rules start here
|
" Rest of syntax highlighting rules start here
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
if version >= 508 || !exists("did_acedb_syn_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_acedb_syn_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
HiLink acedbMagic Special
|
hi def link acedbMagic Special
|
||||||
HiLink acedbHyb Special
|
hi def link acedbHyb Special
|
||||||
HiLink acedbType Type
|
hi def link acedbType Type
|
||||||
HiLink acedbOption Type
|
hi def link acedbOption Type
|
||||||
HiLink acedbSubclass Type
|
hi def link acedbSubclass Type
|
||||||
HiLink acedbSubtag Include
|
hi def link acedbSubtag Include
|
||||||
HiLink acedbFlag Include
|
hi def link acedbFlag Include
|
||||||
HiLink acedbTag Include
|
hi def link acedbTag Include
|
||||||
HiLink acedbClass Todo
|
hi def link acedbClass Todo
|
||||||
HiLink acedbHelp Todo
|
hi def link acedbHelp Todo
|
||||||
HiLink acedbXref Identifier
|
hi def link acedbXref Identifier
|
||||||
HiLink acedbModifier Label
|
hi def link acedbModifier Label
|
||||||
HiLink acedbComment Comment
|
hi def link acedbComment Comment
|
||||||
HiLink acedbBlock ModeMsg
|
hi def link acedbBlock ModeMsg
|
||||||
HiLink acedbNumber Number
|
hi def link acedbNumber Number
|
||||||
HiLink acedbString String
|
hi def link acedbString String
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "acedb"
|
let b:current_syntax = "acedb"
|
||||||
|
|
||||||
|
@ -7,21 +7,14 @@
|
|||||||
" Comment: Replaced sourcing c.vim file by ada.vim and rename lex*
|
" Comment: Replaced sourcing c.vim file by ada.vim and rename lex*
|
||||||
" in aflex*
|
" in aflex*
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Read the Ada syntax to start with
|
" Read the Ada syntax to start with
|
||||||
if version < 600
|
runtime! syntax/ada.vim
|
||||||
so <sfile>:p:h/ada.vim
|
unlet b:current_syntax
|
||||||
else
|
|
||||||
runtime! syntax/ada.vim
|
|
||||||
unlet b:current_syntax
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
" --- AfLex stuff ---
|
" --- AfLex stuff ---
|
||||||
@ -69,31 +62,20 @@ syn sync match aflexSyncPat groupthere aflexPatBlock "^<$"
|
|||||||
syn sync match aflexSyncPat groupthere aflexPatBlock "^%%$"
|
syn sync match aflexSyncPat groupthere aflexPatBlock "^%%$"
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
hi def link aflexSlashQuote aflexPat
|
||||||
|
hi def link aflexBrace aflexPat
|
||||||
|
hi def link aflexAbbrvComment aflexPatComment
|
||||||
|
|
||||||
if version >= 508 || !exists("did_aflex_syntax_inits")
|
hi def link aflexAbbrv SpecialChar
|
||||||
if version < 508
|
hi def link aflexAbbrvRegExp Macro
|
||||||
let did_aflex_syntax_inits = 1
|
hi def link aflexCFunctions Function
|
||||||
command -nargs=+ HiLink hi link <args>
|
hi def link aflexMorePat SpecialChar
|
||||||
else
|
hi def link aflexPat Function
|
||||||
command -nargs=+ HiLink hi def link <args>
|
hi def link aflexPatComment Comment
|
||||||
endif
|
hi def link aflexPatString Function
|
||||||
HiLink aflexSlashQuote aflexPat
|
hi def link aflexPatTag Special
|
||||||
HiLink aflexBrace aflexPat
|
hi def link aflexSep Delimiter
|
||||||
HiLink aflexAbbrvComment aflexPatComment
|
|
||||||
|
|
||||||
HiLink aflexAbbrv SpecialChar
|
|
||||||
HiLink aflexAbbrvRegExp Macro
|
|
||||||
HiLink aflexCFunctions Function
|
|
||||||
HiLink aflexMorePat SpecialChar
|
|
||||||
HiLink aflexPat Function
|
|
||||||
HiLink aflexPatComment Comment
|
|
||||||
HiLink aflexPatString Function
|
|
||||||
HiLink aflexPatTag Special
|
|
||||||
HiLink aflexSep Delimiter
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "aflex"
|
let b:current_syntax = "aflex"
|
||||||
|
|
||||||
|
@ -3,11 +3,8 @@
|
|||||||
" Maintainer: John Cook <john.cook@kla-tencor.com>
|
" Maintainer: John Cook <john.cook@kla-tencor.com>
|
||||||
" Last Change: 2001 Apr 25
|
" Last Change: 2001 Apr 25
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -66,29 +63,19 @@ syn match ahdlSpecialChar "[\[\]().,;]"
|
|||||||
syn sync minlines=1
|
syn sync minlines=1
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
if version >= 508 || !exists("did_ahdl_syn_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_ahdl_syn_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
" The default highlighting.
|
" The default highlighting.
|
||||||
HiLink ahdlNumber ahdlString
|
hi def link ahdlNumber ahdlString
|
||||||
HiLink ahdlMegafunction ahdlIdentifier
|
hi def link ahdlMegafunction ahdlIdentifier
|
||||||
HiLink ahdlSpecialChar SpecialChar
|
hi def link ahdlSpecialChar SpecialChar
|
||||||
HiLink ahdlKeyword Statement
|
hi def link ahdlKeyword Statement
|
||||||
HiLink ahdlString String
|
hi def link ahdlString String
|
||||||
HiLink ahdlComment Comment
|
hi def link ahdlComment Comment
|
||||||
HiLink ahdlIdentifier Identifier
|
hi def link ahdlIdentifier Identifier
|
||||||
HiLink ahdlOperator Operator
|
hi def link ahdlOperator Operator
|
||||||
HiLink ahdlTodo Todo
|
hi def link ahdlTodo Todo
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "ahdl"
|
let b:current_syntax = "ahdl"
|
||||||
" vim:ts=8
|
" vim:ts=8
|
||||||
|
@ -1,15 +1,12 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: AmigaDos
|
" Language: AmigaDos
|
||||||
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
|
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
|
||||||
" Last Change: Oct 23, 2014
|
" Last Change: Aug 31, 2016
|
||||||
" Version: 7
|
" Version: 9
|
||||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_AMIGA
|
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_AMIGA
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -72,30 +69,20 @@ syn match amiComment ";.*$" contains=amiCommentGroup
|
|||||||
syn sync lines=50
|
syn sync lines=50
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
if !exists("skip_amiga_syntax_inits")
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
if version >= 508 || !exists("did_amiga_syn_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_amiga_syn_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
HiLink amiAlias Type
|
hi def link amiAlias Type
|
||||||
HiLink amiComment Comment
|
hi def link amiComment Comment
|
||||||
HiLink amiDev Type
|
hi def link amiDev Type
|
||||||
HiLink amiEcho String
|
hi def link amiEcho String
|
||||||
HiLink amiElse Statement
|
hi def link amiElse Statement
|
||||||
HiLink amiError Error
|
hi def link amiError Error
|
||||||
HiLink amiKey Statement
|
hi def link amiKey Statement
|
||||||
HiLink amiNumber Number
|
hi def link amiNumber Number
|
||||||
HiLink amiString String
|
hi def link amiString String
|
||||||
HiLink amiTest Special
|
hi def link amiTest Special
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let b:current_syntax = "amiga"
|
let b:current_syntax = "amiga"
|
||||||
|
|
||||||
" vim:ts=15
|
" vim:ts=15
|
||||||
|
@ -9,11 +9,8 @@
|
|||||||
" of [], in order to avoid -read highlighted,
|
" of [], in order to avoid -read highlighted,
|
||||||
" or [quote] strings highlighted
|
" or [quote] strings highlighted
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -123,35 +120,25 @@ syn region amlSkip matchgroup=amlOutput start="&typ" end="$" contains=amlVar
|
|||||||
syn region amlSkip matchgroup=amlOutput start="&type" end="$" contains=amlVar
|
syn region amlSkip matchgroup=amlOutput start="&type" end="$" contains=amlVar
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
if version >= 508 || !exists("did_aml_syntax_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_aml_syntax_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
HiLink amlComment Comment
|
hi def link amlComment Comment
|
||||||
HiLink amlNumber Number
|
hi def link amlNumber Number
|
||||||
HiLink amlQuote String
|
hi def link amlQuote String
|
||||||
HiLink amlVar Identifier
|
hi def link amlVar Identifier
|
||||||
HiLink amlVar2 Identifier
|
hi def link amlVar2 Identifier
|
||||||
HiLink amlFunction PreProc
|
hi def link amlFunction PreProc
|
||||||
HiLink amlDir Statement
|
hi def link amlDir Statement
|
||||||
HiLink amlDir2 Statement
|
hi def link amlDir2 Statement
|
||||||
HiLink amlDirSym Statement
|
hi def link amlDirSym Statement
|
||||||
HiLink amlOutput Statement
|
hi def link amlOutput Statement
|
||||||
HiLink amlArcCmd ModeMsg
|
hi def link amlArcCmd ModeMsg
|
||||||
HiLink amlFormedCmd amlArcCmd
|
hi def link amlFormedCmd amlArcCmd
|
||||||
HiLink amlTabCmd amlArcCmd
|
hi def link amlTabCmd amlArcCmd
|
||||||
HiLink amlInfoCmd amlArcCmd
|
hi def link amlInfoCmd amlArcCmd
|
||||||
HiLink amlVtrCmd amlArcCmd
|
hi def link amlVtrCmd amlArcCmd
|
||||||
HiLink amlFormed amlArcCmd
|
hi def link amlFormed amlArcCmd
|
||||||
HiLink amlTab amlArcCmd
|
hi def link amlTab amlArcCmd
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "aml"
|
let b:current_syntax = "aml"
|
||||||
|
@ -3,9 +3,8 @@
|
|||||||
" Last Change: 2003 May 11
|
" Last Change: 2003 May 11
|
||||||
|
|
||||||
|
|
||||||
if version < 600
|
" quit when a syntax file was already loaded
|
||||||
syntax clear
|
if exists("b:current_syntax")
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -115,33 +114,24 @@ syn keyword amplTodo contained TODO FIXME XXX
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if version >= 508 || !exists("did_ampl_syntax_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_ampl_syntax_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
" The default methods for highlighting. Can be overridden later.
|
" The default methods for highlighting. Can be overridden later.
|
||||||
HiLink amplEntityKeyword Keyword
|
hi def link amplEntityKeyword Keyword
|
||||||
HiLink amplType Type
|
hi def link amplType Type
|
||||||
HiLink amplStatement Statement
|
hi def link amplStatement Statement
|
||||||
HiLink amplOperators Operator
|
hi def link amplOperators Operator
|
||||||
HiLink amplBasicOperators Operator
|
hi def link amplBasicOperators Operator
|
||||||
HiLink amplConditional Conditional
|
hi def link amplConditional Conditional
|
||||||
HiLink amplRepeat Repeat
|
hi def link amplRepeat Repeat
|
||||||
HiLink amplStrings String
|
hi def link amplStrings String
|
||||||
HiLink amplNumerics Number
|
hi def link amplNumerics Number
|
||||||
HiLink amplSetFunction Function
|
hi def link amplSetFunction Function
|
||||||
HiLink amplBuiltInFunction Function
|
hi def link amplBuiltInFunction Function
|
||||||
HiLink amplRandomGenerator Function
|
hi def link amplRandomGenerator Function
|
||||||
HiLink amplComment Comment
|
hi def link amplComment Comment
|
||||||
HiLink amplDotSuffix Special
|
hi def link amplDotSuffix Special
|
||||||
HiLink amplPiecewise Special
|
hi def link amplPiecewise Special
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "ampl"
|
let b:current_syntax = "ampl"
|
||||||
|
|
||||||
|
@ -4,11 +4,8 @@
|
|||||||
" LastChange: 02 May 2001
|
" LastChange: 02 May 2001
|
||||||
" Original: Comes from JavaCC.vim
|
" Original: Comes from JavaCC.vim
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -18,12 +15,8 @@ endif
|
|||||||
" Those files usually have the extension *.jj
|
" Those files usually have the extension *.jj
|
||||||
|
|
||||||
" source the java.vim file
|
" source the java.vim file
|
||||||
if version < 600
|
runtime! syntax/java.vim
|
||||||
so <sfile>:p:h/java.vim
|
unlet b:current_syntax
|
||||||
else
|
|
||||||
runtime! syntax/java.vim
|
|
||||||
unlet b:current_syntax
|
|
||||||
endif
|
|
||||||
|
|
||||||
"remove catching errors caused by wrong parenthesis (does not work in antlr
|
"remove catching errors caused by wrong parenthesis (does not work in antlr
|
||||||
"files) (first define them in case they have not been defined in java)
|
"files) (first define them in case they have not been defined in java)
|
||||||
@ -53,17 +46,8 @@ syn match antlrSep "[|:]\|\.\."
|
|||||||
syn keyword antlrActionToken TOKEN SKIP MORE SPECIAL_TOKEN
|
syn keyword antlrActionToken TOKEN SKIP MORE SPECIAL_TOKEN
|
||||||
syn keyword antlrError DEBUG IGNORE_IN_BNF
|
syn keyword antlrError DEBUG IGNORE_IN_BNF
|
||||||
|
|
||||||
if version >= 508 || !exists("did_antlr_syntax_inits")
|
hi def link antlrSep Statement
|
||||||
if version < 508
|
hi def link antlrPackages Statement
|
||||||
let did_antlr_syntax_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
HiLink antlrSep Statement
|
|
||||||
HiLink antlrPackages Statement
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "antlr"
|
let b:current_syntax = "antlr"
|
||||||
|
|
||||||
|
@ -9,13 +9,9 @@
|
|||||||
" make it really linewise?
|
" make it really linewise?
|
||||||
" + add `display' where appropriate
|
" + add `display' where appropriate
|
||||||
|
|
||||||
" Setup
|
" quit when a syntax file was already loaded
|
||||||
if version >= 600
|
if exists("b:current_syntax")
|
||||||
if exists("b:current_syntax")
|
finish
|
||||||
finish
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
syntax clear
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syn case ignore
|
syn case ignore
|
||||||
@ -178,37 +174,28 @@ syn match apacheSection "<\/\=\(<IfVersion\)[^>]*>" contains=apacheAnything
|
|||||||
syn keyword apacheDeclaration VirtualDocumentRoot VirtualDocumentRootIP VirtualScriptAlias VirtualScriptAliasIP
|
syn keyword apacheDeclaration VirtualDocumentRoot VirtualDocumentRootIP VirtualScriptAlias VirtualScriptAliasIP
|
||||||
|
|
||||||
" Define the default highlighting
|
" Define the default highlighting
|
||||||
if version >= 508 || !exists("did_apache_syntax_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_apache_syntax_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
HiLink apacheAllowOverride apacheDeclaration
|
hi def link apacheAllowOverride apacheDeclaration
|
||||||
HiLink apacheAllowOverrideValue apacheOption
|
hi def link apacheAllowOverrideValue apacheOption
|
||||||
HiLink apacheAuthType apacheDeclaration
|
hi def link apacheAuthType apacheDeclaration
|
||||||
HiLink apacheAuthTypeValue apacheOption
|
hi def link apacheAuthTypeValue apacheOption
|
||||||
HiLink apacheOptionOption apacheOption
|
hi def link apacheOptionOption apacheOption
|
||||||
HiLink apacheDeclaration Function
|
hi def link apacheDeclaration Function
|
||||||
HiLink apacheAnything apacheOption
|
hi def link apacheAnything apacheOption
|
||||||
HiLink apacheOption Number
|
hi def link apacheOption Number
|
||||||
HiLink apacheComment Comment
|
hi def link apacheComment Comment
|
||||||
HiLink apacheFixme Todo
|
hi def link apacheFixme Todo
|
||||||
HiLink apacheLimitSectionKeyword apacheLimitSection
|
hi def link apacheLimitSectionKeyword apacheLimitSection
|
||||||
HiLink apacheLimitSection apacheSection
|
hi def link apacheLimitSection apacheSection
|
||||||
HiLink apacheSection Label
|
hi def link apacheSection Label
|
||||||
HiLink apacheMethodOption Type
|
hi def link apacheMethodOption Type
|
||||||
HiLink apacheAllowDeny Include
|
hi def link apacheAllowDeny Include
|
||||||
HiLink apacheAllowDenyValue Identifier
|
hi def link apacheAllowDenyValue Identifier
|
||||||
HiLink apacheOrder Special
|
hi def link apacheOrder Special
|
||||||
HiLink apacheOrderValue String
|
hi def link apacheOrderValue String
|
||||||
HiLink apacheString String
|
hi def link apacheString String
|
||||||
HiLink apacheError Error
|
hi def link apacheError Error
|
||||||
HiLink apacheUserID Number
|
hi def link apacheUserID Number
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "apache"
|
let b:current_syntax = "apache"
|
||||||
|
@ -20,11 +20,8 @@
|
|||||||
" </SubSection>
|
" </SubSection>
|
||||||
" </Section>
|
" </Section>
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -41,25 +38,15 @@ syn match apTagOption contained / [-\/_\.:*a-zA-Z0-9]\+/ms=s+1
|
|||||||
syn match apTagError contained /[^>]</ms=s+1
|
syn match apTagError contained /[^>]</ms=s+1
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
if version >= 508 || !exists("did_apachestyle_syn_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_apachestyle_syn_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
HiLink apComment Comment
|
hi def link apComment Comment
|
||||||
HiLink apOption Keyword
|
hi def link apOption Keyword
|
||||||
"HiLink apLastValue Identifier ugly?
|
"hi def link apLastValue Identifier ugly?
|
||||||
HiLink apTag Special
|
hi def link apTag Special
|
||||||
HiLink apTagOption Identifier
|
hi def link apTagOption Identifier
|
||||||
HiLink apTagError Error
|
hi def link apTagError Error
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "apachestyle"
|
let b:current_syntax = "apachestyle"
|
||||||
" vim: ts=8
|
" vim: ts=8
|
||||||
|
@ -3,12 +3,9 @@
|
|||||||
" Maintainer: Yann Amar <quidame@poivron.org>
|
" Maintainer: Yann Amar <quidame@poivron.org>
|
||||||
" Last Change: 2015 Dec 22
|
" Last Change: 2015 Dec 22
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x and 7.x: Quit when a syntax file was already loaded
|
|
||||||
if !exists("main_syntax")
|
if !exists("main_syntax")
|
||||||
if version < 600
|
if exists("b:current_syntax")
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let main_syntax = 'aptconf'
|
let main_syntax = 'aptconf'
|
||||||
|
@ -10,20 +10,13 @@
|
|||||||
|
|
||||||
" Thanks to Rik, Erik Nomitch, Adam Obeng and Graeme Cross for helpful feedback!
|
" Thanks to Rik, Erik Nomitch, Adam Obeng and Graeme Cross for helpful feedback!
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Read the C syntax to start with
|
" Read the C syntax to start with
|
||||||
if version < 600
|
runtime! syntax/cpp.vim
|
||||||
so <sfile>:p:h/cpp.vim
|
|
||||||
else
|
|
||||||
runtime! syntax/cpp.vim
|
|
||||||
endif
|
|
||||||
|
|
||||||
syn keyword arduinoConstant HIGH LOW INPUT OUTPUT
|
syn keyword arduinoConstant HIGH LOW INPUT OUTPUT
|
||||||
syn keyword arduinoConstant DEC BIN HEX OCT BYTE
|
syn keyword arduinoConstant DEC BIN HEX OCT BYTE
|
||||||
|
@ -7,11 +7,8 @@
|
|||||||
|
|
||||||
" Thanks to Ori Avtalion for feedback on the comment markers!
|
" Thanks to Ori Avtalion for feedback on the comment markers!
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.0 and later: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -103,37 +100,27 @@ syn match asmDirective "\.[A-Za-z][0-9A-Za-z-_]*"
|
|||||||
syn case match
|
syn case match
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
if version >= 508 || !exists("did_asm_syntax_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_asm_syntax_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
" The default methods for highlighting. Can be overridden later
|
" The default methods for highlighting. Can be overridden later
|
||||||
HiLink asmSection Special
|
hi def link asmSection Special
|
||||||
HiLink asmLabel Label
|
hi def link asmLabel Label
|
||||||
HiLink asmComment Comment
|
hi def link asmComment Comment
|
||||||
HiLink asmTodo Todo
|
hi def link asmTodo Todo
|
||||||
HiLink asmDirective Statement
|
hi def link asmDirective Statement
|
||||||
|
|
||||||
HiLink asmInclude Include
|
hi def link asmInclude Include
|
||||||
HiLink asmCond PreCondit
|
hi def link asmCond PreCondit
|
||||||
HiLink asmMacro Macro
|
hi def link asmMacro Macro
|
||||||
|
|
||||||
HiLink hexNumber Number
|
hi def link hexNumber Number
|
||||||
HiLink decNumber Number
|
hi def link decNumber Number
|
||||||
HiLink octNumber Number
|
hi def link octNumber Number
|
||||||
HiLink binNumber Number
|
hi def link binNumber Number
|
||||||
|
|
||||||
HiLink asmIdentifier Identifier
|
hi def link asmIdentifier Identifier
|
||||||
HiLink asmType Type
|
hi def link asmType Type
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "asm"
|
let b:current_syntax = "asm"
|
||||||
|
|
||||||
|
@ -8,11 +8,8 @@
|
|||||||
" Feel free to contribute...
|
" Feel free to contribute...
|
||||||
"
|
"
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -328,63 +325,53 @@ syn match asm68kDirective "\<XREF\(\.S\)\=\s"
|
|||||||
syn case match
|
syn case match
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
if version >= 508 || !exists("did_asm68k_syntax_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_asm68k_syntax_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
" The default methods for highlighting. Can be overridden later
|
" The default methods for highlighting. Can be overridden later
|
||||||
" Comment Constant Error Identifier PreProc Special Statement Todo Type
|
" Comment Constant Error Identifier PreProc Special Statement Todo Type
|
||||||
"
|
"
|
||||||
" Constant Boolean Character Number String
|
" Constant Boolean Character Number String
|
||||||
" Identifier Function
|
" Identifier Function
|
||||||
" PreProc Define Include Macro PreCondit
|
" PreProc Define Include Macro PreCondit
|
||||||
" Special Debug Delimiter SpecialChar SpecialComment Tag
|
" Special Debug Delimiter SpecialChar SpecialComment Tag
|
||||||
" Statement Conditional Exception Keyword Label Operator Repeat
|
" Statement Conditional Exception Keyword Label Operator Repeat
|
||||||
" Type StorageClass Structure Typedef
|
" Type StorageClass Structure Typedef
|
||||||
|
|
||||||
HiLink asm68kComment Comment
|
hi def link asm68kComment Comment
|
||||||
HiLink asm68kTodo Todo
|
hi def link asm68kTodo Todo
|
||||||
|
|
||||||
HiLink hexNumber Number " Constant
|
hi def link hexNumber Number " Constant
|
||||||
HiLink octNumber Number " Constant
|
hi def link octNumber Number " Constant
|
||||||
HiLink binNumber Number " Constant
|
hi def link binNumber Number " Constant
|
||||||
HiLink decNumber Number " Constant
|
hi def link decNumber Number " Constant
|
||||||
HiLink floatNumber Number " Constant
|
hi def link floatNumber Number " Constant
|
||||||
HiLink floatExponent Number " Constant
|
hi def link floatExponent Number " Constant
|
||||||
HiLink floatE SpecialChar " Statement
|
hi def link floatE SpecialChar " Statement
|
||||||
"HiLink floatE Number " Constant
|
"hi def link floatE Number " Constant
|
||||||
|
|
||||||
HiLink asm68kImmediate SpecialChar " Statement
|
hi def link asm68kImmediate SpecialChar " Statement
|
||||||
"HiLink asm68kSymbol Constant
|
"hi def link asm68kSymbol Constant
|
||||||
|
|
||||||
HiLink asm68kString String " Constant
|
hi def link asm68kString String " Constant
|
||||||
HiLink asm68kCharError Error
|
hi def link asm68kCharError Error
|
||||||
HiLink asm68kStringError Error
|
hi def link asm68kStringError Error
|
||||||
|
|
||||||
HiLink asm68kReg Identifier
|
hi def link asm68kReg Identifier
|
||||||
HiLink asm68kOperator Identifier
|
hi def link asm68kOperator Identifier
|
||||||
|
|
||||||
HiLink asm68kInclude Include " PreProc
|
hi def link asm68kInclude Include " PreProc
|
||||||
HiLink asm68kMacro Macro " PreProc
|
hi def link asm68kMacro Macro " PreProc
|
||||||
HiLink asm68kMacroParam Keyword " Statement
|
hi def link asm68kMacroParam Keyword " Statement
|
||||||
|
|
||||||
HiLink asm68kDirective Special
|
hi def link asm68kDirective Special
|
||||||
HiLink asm68kPreCond Special
|
hi def link asm68kPreCond Special
|
||||||
|
|
||||||
|
|
||||||
HiLink asm68kOpcode Statement
|
hi def link asm68kOpcode Statement
|
||||||
HiLink asm68kCond Conditional " Statement
|
hi def link asm68kCond Conditional " Statement
|
||||||
HiLink asm68kRepeat Repeat " Statement
|
hi def link asm68kRepeat Repeat " Statement
|
||||||
|
|
||||||
HiLink asm68kLabel Type
|
hi def link asm68kLabel Type
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "asm68k"
|
let b:current_syntax = "asm68k"
|
||||||
|
|
||||||
|
@ -3,11 +3,8 @@
|
|||||||
" Maintainer: Kevin Dahlhausen <kdahlhaus@yahoo.com>
|
" Maintainer: Kevin Dahlhausen <kdahlhaus@yahoo.com>
|
||||||
" Last Change: 2002 Sep 19
|
" Last Change: 2002 Sep 19
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -52,33 +49,19 @@ syn case match
|
|||||||
|
|
||||||
|
|
||||||
" Read the general asm syntax
|
" Read the general asm syntax
|
||||||
if version < 600
|
runtime! syntax/asm.vim
|
||||||
source <sfile>:p:h/asm.vim
|
|
||||||
else
|
|
||||||
runtime! syntax/asm.vim
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
if version >= 508 || !exists("did_hitachi_syntax_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_hitachi_syntax_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
HiLink asmOpcode Statement
|
hi def link asmOpcode Statement
|
||||||
HiLink asmRegister Identifier
|
hi def link asmRegister Identifier
|
||||||
|
|
||||||
" My default-color overrides:
|
" My default-color overrides:
|
||||||
"hi asmOpcode ctermfg=yellow
|
"hi asmOpcode ctermfg=yellow
|
||||||
"hi asmReg ctermfg=lightmagenta
|
"hi asmReg ctermfg=lightmagenta
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "asmh8300"
|
let b:current_syntax = "asmh8300"
|
||||||
|
|
||||||
|
@ -4,11 +4,8 @@
|
|||||||
" URL: http://www.fleiner.com/vim/syntax/asn.vim
|
" URL: http://www.fleiner.com/vim/syntax/asn.vim
|
||||||
" Last Change: 2012 Oct 05
|
" Last Change: 2012 Oct 05
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -50,34 +47,24 @@ syn match asnBraces "[{}]"
|
|||||||
syn sync ccomment asnComment
|
syn sync ccomment asnComment
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
hi def link asnDefinition Function
|
||||||
if version >= 508 || !exists("did_asn_syn_inits")
|
hi def link asnBraces Function
|
||||||
if version < 508
|
hi def link asnStructure Statement
|
||||||
let did_asn_syn_inits = 1
|
hi def link asnBoolValue Boolean
|
||||||
command -nargs=+ HiLink hi link <args>
|
hi def link asnSpecial Special
|
||||||
else
|
hi def link asnString String
|
||||||
command -nargs=+ HiLink hi def link <args>
|
hi def link asnCharacter Character
|
||||||
endif
|
hi def link asnSpecialCharacter asnSpecial
|
||||||
HiLink asnDefinition Function
|
hi def link asnNumber asnValue
|
||||||
HiLink asnBraces Function
|
hi def link asnComment Comment
|
||||||
HiLink asnStructure Statement
|
hi def link asnLineComment asnComment
|
||||||
HiLink asnBoolValue Boolean
|
hi def link asnType Type
|
||||||
HiLink asnSpecial Special
|
hi def link asnTypeInfo PreProc
|
||||||
HiLink asnString String
|
hi def link asnValue Number
|
||||||
HiLink asnCharacter Character
|
hi def link asnExternal Include
|
||||||
HiLink asnSpecialCharacter asnSpecial
|
hi def link asnTagModifier Function
|
||||||
HiLink asnNumber asnValue
|
hi def link asnFieldOption Type
|
||||||
HiLink asnComment Comment
|
|
||||||
HiLink asnLineComment asnComment
|
|
||||||
HiLink asnType Type
|
|
||||||
HiLink asnTypeInfo PreProc
|
|
||||||
HiLink asnValue Number
|
|
||||||
HiLink asnExternal Include
|
|
||||||
HiLink asnTagModifier Function
|
|
||||||
HiLink asnFieldOption Type
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
let &cpo = s:cpo_save
|
||||||
unlet s:cpo_save
|
unlet s:cpo_save
|
||||||
|
@ -4,11 +4,8 @@
|
|||||||
" URL: http://nim.dhs.org/~edh/aspperl.vim
|
" URL: http://nim.dhs.org/~edh/aspperl.vim
|
||||||
" Last Change: 2001 May 09
|
" Last Change: 2001 May 09
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -16,14 +13,9 @@ if !exists("main_syntax")
|
|||||||
let main_syntax = 'perlscript'
|
let main_syntax = 'perlscript'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if version < 600
|
runtime! syntax/html.vim
|
||||||
so <sfile>:p:h/html.vim
|
unlet b:current_syntax
|
||||||
syn include @AspPerlScript <sfile>:p:h/perl.vim
|
syn include @AspPerlScript syntax/perl.vim
|
||||||
else
|
|
||||||
runtime! syntax/html.vim
|
|
||||||
unlet b:current_syntax
|
|
||||||
syn include @AspPerlScript syntax/perl.vim
|
|
||||||
endif
|
|
||||||
|
|
||||||
syn cluster htmlPreproc add=AspPerlScriptInsideHtmlTags
|
syn cluster htmlPreproc add=AspPerlScriptInsideHtmlTags
|
||||||
|
|
||||||
|
@ -11,10 +11,8 @@
|
|||||||
" Thanks to Dean Hall <hall@apt7.com> for testing the use of classes in
|
" Thanks to Dean Hall <hall@apt7.com> for testing the use of classes in
|
||||||
" VBScripts which I've been too scared to do.
|
" VBScripts which I've been too scared to do.
|
||||||
|
|
||||||
" Quit when a syntax file was already loaded
|
" quit when a syntax file was already loaded
|
||||||
if version < 600
|
if exists("b:current_syntax")
|
||||||
syn clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -22,11 +20,7 @@ if !exists("main_syntax")
|
|||||||
let main_syntax = 'aspvbs'
|
let main_syntax = 'aspvbs'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if version < 600
|
runtime! syntax/html.vim
|
||||||
source <sfile>:p:h/html.vim
|
|
||||||
else
|
|
||||||
runtime! syntax/html.vim
|
|
||||||
endif
|
|
||||||
unlet b:current_syntax
|
unlet b:current_syntax
|
||||||
|
|
||||||
syn cluster htmlPreProc add=AspVBScriptInsideHtmlTags
|
syn cluster htmlPreProc add=AspVBScriptInsideHtmlTags
|
||||||
@ -163,31 +157,21 @@ syn sync match htmlHighlight grouphere htmlTag "%>"
|
|||||||
|
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
if version >= 508 || !exists("did_aspvbs_syn_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_aspvbs_syn_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
"HiLink AspVBScript Special
|
"hi def link AspVBScript Special
|
||||||
HiLink AspVBSLineNumber Comment
|
hi def link AspVBSLineNumber Comment
|
||||||
HiLink AspVBSNumber Number
|
hi def link AspVBSNumber Number
|
||||||
HiLink AspVBSError Error
|
hi def link AspVBSError Error
|
||||||
HiLink AspVBSStatement Statement
|
hi def link AspVBSStatement Statement
|
||||||
HiLink AspVBSString String
|
hi def link AspVBSString String
|
||||||
HiLink AspVBSComment Comment
|
hi def link AspVBSComment Comment
|
||||||
HiLink AspVBSTodo Todo
|
hi def link AspVBSTodo Todo
|
||||||
HiLink AspVBSFunction Identifier
|
hi def link AspVBSFunction Identifier
|
||||||
HiLink AspVBSMethods PreProc
|
hi def link AspVBSMethods PreProc
|
||||||
HiLink AspVBSEvents Special
|
hi def link AspVBSEvents Special
|
||||||
HiLink AspVBSTypeSpecifier Type
|
hi def link AspVBSTypeSpecifier Type
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "aspvbs"
|
let b:current_syntax = "aspvbs"
|
||||||
|
|
||||||
|
@ -5,10 +5,9 @@
|
|||||||
" Updated for 1.2 by Tilghman Lesher (Corydon76)
|
" Updated for 1.2 by Tilghman Lesher (Corydon76)
|
||||||
" Last Change: 2015 Feb 27
|
" Last Change: 2015 Feb 27
|
||||||
" version 0.4
|
" version 0.4
|
||||||
"
|
|
||||||
if version < 600
|
" quit when a syntax file was already loaded
|
||||||
syntax clear
|
if exists("b:current_syntax")
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -57,42 +56,33 @@ syn match asteriskSetting "^port\s*=\s*\d\{1,5}\s*$" contains=aste
|
|||||||
syn match asteriskSetting "^host\s*=\s*\(dynamic\|\(\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\)\|\([[:alnum:]][[:alnum:]\-\.]*\.[[:alpha:]]{2,10}\)\)" contains=asteriskIP,asteriskHostname
|
syn match asteriskSetting "^host\s*=\s*\(dynamic\|\(\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\)\|\([[:alnum:]][[:alnum:]\-\.]*\.[[:alpha:]]{2,10}\)\)" contains=asteriskIP,asteriskHostname
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
if version >= 508 || !exists("did_conf_syntax_inits")
|
hi def link asteriskComment Comment
|
||||||
if version < 508
|
hi def link asteriskExten String
|
||||||
let did_conf_syntax_inits = 1
|
hi def link asteriskContext Preproc
|
||||||
command -nargs=+ HiLink hi link <args>
|
hi def link asteriskPattern Type
|
||||||
else
|
hi def link asteriskApp Statement
|
||||||
command -nargs=+ HiLink hi def link <args>
|
hi def link asteriskInclude Preproc
|
||||||
endif
|
hi def link asteriskIncludeBad Error
|
||||||
|
hi def link asteriskPriority Preproc
|
||||||
|
hi def link asteriskLabel Type
|
||||||
|
hi def link asteriskVar String
|
||||||
|
hi def link asteriskVarLen Function
|
||||||
|
hi def link asteriskExp Type
|
||||||
|
hi def link asteriskCodecsPermit Preproc
|
||||||
|
hi def link asteriskCodecs String
|
||||||
|
hi def link asteriskType Statement
|
||||||
|
hi def link asteriskTypeType Type
|
||||||
|
hi def link asteriskAuth String
|
||||||
|
hi def link asteriskAuthType Type
|
||||||
|
hi def link asteriskIPRange Identifier
|
||||||
|
hi def link asteriskIP Identifier
|
||||||
|
hi def link asteriskPort Identifier
|
||||||
|
hi def link asteriskHostname Identifier
|
||||||
|
hi def link asteriskSetting Statement
|
||||||
|
hi def link asteriskError Error
|
||||||
|
|
||||||
HiLink asteriskComment Comment
|
|
||||||
HiLink asteriskExten String
|
|
||||||
HiLink asteriskContext Preproc
|
|
||||||
HiLink asteriskPattern Type
|
|
||||||
HiLink asteriskApp Statement
|
|
||||||
HiLink asteriskInclude Preproc
|
|
||||||
HiLink asteriskIncludeBad Error
|
|
||||||
HiLink asteriskPriority Preproc
|
|
||||||
HiLink asteriskLabel Type
|
|
||||||
HiLink asteriskVar String
|
|
||||||
HiLink asteriskVarLen Function
|
|
||||||
HiLink asteriskExp Type
|
|
||||||
HiLink asteriskCodecsPermit Preproc
|
|
||||||
HiLink asteriskCodecs String
|
|
||||||
HiLink asteriskType Statement
|
|
||||||
HiLink asteriskTypeType Type
|
|
||||||
HiLink asteriskAuth String
|
|
||||||
HiLink asteriskAuthType Type
|
|
||||||
HiLink asteriskIPRange Identifier
|
|
||||||
HiLink asteriskIP Identifier
|
|
||||||
HiLink asteriskPort Identifier
|
|
||||||
HiLink asteriskHostname Identifier
|
|
||||||
HiLink asteriskSetting Statement
|
|
||||||
HiLink asteriskError Error
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
let b:current_syntax = "asterisk"
|
let b:current_syntax = "asterisk"
|
||||||
" vim: ts=8 sw=2
|
" vim: ts=8 sw=2
|
||||||
|
|
||||||
|
@ -3,10 +3,9 @@
|
|||||||
" Maintainer: Tilghman Lesher (Corydon76)
|
" Maintainer: Tilghman Lesher (Corydon76)
|
||||||
" Last Change: 2006 Mar 21
|
" Last Change: 2006 Mar 21
|
||||||
" version 0.2
|
" version 0.2
|
||||||
"
|
|
||||||
if version < 600
|
" quit when a syntax file was already loaded
|
||||||
syntax clear
|
if exists("b:current_syntax")
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -33,28 +32,18 @@ syn match mailboxEmail ",\zs[^@=,]*@[[:alnum:]\-\.]\+\.[[:alpha
|
|||||||
syn match comma "[,|]" contained
|
syn match comma "[,|]" contained
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
:if version >= 508 || !exists("did_conf_syntax_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_conf_syntax_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
HiLink asteriskvmComment Comment
|
hi def link asteriskvmComment Comment
|
||||||
HiLink asteriskvmContext Identifier
|
hi def link asteriskvmContext Identifier
|
||||||
HiLink asteriskvmZone Type
|
hi def link asteriskvmZone Type
|
||||||
HiLink zoneName String
|
hi def link zoneName String
|
||||||
HiLink zoneDef String
|
hi def link zoneDef String
|
||||||
HiLink asteriskvmSetting Type
|
hi def link asteriskvmSetting Type
|
||||||
HiLink asteriskvmSettingBool Type
|
hi def link asteriskvmSettingBool Type
|
||||||
|
|
||||||
HiLink asteriskvmMailbox Statement
|
hi def link asteriskvmMailbox Statement
|
||||||
HiLink mailboxEmail String
|
hi def link mailboxEmail String
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "asteriskvm"
|
let b:current_syntax = "asteriskvm"
|
||||||
|
|
||||||
|
@ -3,11 +3,8 @@
|
|||||||
" Maintainer: Inaki Saez <jisaez@sfe.indra.es>
|
" Maintainer: Inaki Saez <jisaez@sfe.indra.es>
|
||||||
" Last Change: 2001 May 09
|
" Last Change: 2001 May 09
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -61,37 +58,27 @@ syn sync maxlines=100
|
|||||||
|
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
if version >= 508 || !exists("did_atlas_syntax_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_atlas_syntax_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
HiLink atlasConditional Conditional
|
hi def link atlasConditional Conditional
|
||||||
HiLink atlasRepeat Repeat
|
hi def link atlasRepeat Repeat
|
||||||
HiLink atlasStatement Statement
|
hi def link atlasStatement Statement
|
||||||
HiLink atlasNumber Number
|
hi def link atlasNumber Number
|
||||||
HiLink atlasHexNumber Number
|
hi def link atlasHexNumber Number
|
||||||
HiLink atlasOctalNumber Number
|
hi def link atlasOctalNumber Number
|
||||||
HiLink atlasBinNumber Number
|
hi def link atlasBinNumber Number
|
||||||
HiLink atlasDecimalNumber Float
|
hi def link atlasDecimalNumber Float
|
||||||
HiLink atlasFormatString String
|
hi def link atlasFormatString String
|
||||||
HiLink atlasString String
|
hi def link atlasString String
|
||||||
HiLink atlasComment Comment
|
hi def link atlasComment Comment
|
||||||
HiLink atlasComment2 Comment
|
hi def link atlasComment2 Comment
|
||||||
HiLink atlasInclude Include
|
hi def link atlasInclude Include
|
||||||
HiLink atlasDefine Macro
|
hi def link atlasDefine Macro
|
||||||
HiLink atlasReserved PreCondit
|
hi def link atlasReserved PreCondit
|
||||||
HiLink atlasStorageClass StorageClass
|
hi def link atlasStorageClass StorageClass
|
||||||
HiLink atlasIdentifier NONE
|
hi def link atlasIdentifier NONE
|
||||||
HiLink atlasSpecial Special
|
hi def link atlasSpecial Special
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "atlas"
|
let b:current_syntax = "atlas"
|
||||||
|
|
||||||
|
@ -18,18 +18,12 @@
|
|||||||
" EXTRA_SOURCES.
|
" EXTRA_SOURCES.
|
||||||
|
|
||||||
" Standard syntax initialization
|
" Standard syntax initialization
|
||||||
if version < 600
|
if exists("b:current_syntax")
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Read the Makefile syntax to start with
|
" Read the Makefile syntax to start with
|
||||||
if version < 600
|
runtime! syntax/make.vim
|
||||||
source <sfile>:p:h/make.vim
|
|
||||||
else
|
|
||||||
runtime! syntax/make.vim
|
|
||||||
endif
|
|
||||||
|
|
||||||
syn match automakePrimary "^\w\+\(_PROGRAMS\|_LIBRARIES\|_LISP\|_PYTHON\|_JAVA\|_SCRIPTS\|_DATA\|_HEADERS\|_MANS\|_TEXINFOS\|_LTLIBRARIES\)\s*\ze+\=="
|
syn match automakePrimary "^\w\+\(_PROGRAMS\|_LIBRARIES\|_LISP\|_PYTHON\|_JAVA\|_SCRIPTS\|_DATA\|_HEADERS\|_MANS\|_TEXINFOS\|_LTLIBRARIES\)\s*\ze+\=="
|
||||||
syn match automakePrimary "^TESTS\s*\ze+\=="me=e-1
|
syn match automakePrimary "^TESTS\s*\ze+\=="me=e-1
|
||||||
@ -59,34 +53,24 @@ syn region automakeMakeSString start=+'+ skip=+\\'+ end=+'+ contains=makeIde
|
|||||||
syn region automakeMakeBString start=+`+ skip=+\\`+ end=+`+ contains=makeIdent,makeSString,makeDString,makeNextLine,automakeSubstitution
|
syn region automakeMakeBString start=+`+ skip=+\\`+ end=+`+ contains=makeIdent,makeSString,makeDString,makeNextLine,automakeSubstitution
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
if version >= 508 || !exists("did_automake_syntax_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_automake_syntax_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
HiLink automakePrimary Statement
|
hi def link automakePrimary Statement
|
||||||
HiLink automakeSecondary Type
|
hi def link automakeSecondary Type
|
||||||
HiLink automakeExtra Special
|
hi def link automakeExtra Special
|
||||||
HiLink automakeOptions Special
|
hi def link automakeOptions Special
|
||||||
HiLink automakeClean Special
|
hi def link automakeClean Special
|
||||||
HiLink automakeSubdirs Statement
|
hi def link automakeSubdirs Statement
|
||||||
HiLink automakeConditional PreProc
|
hi def link automakeConditional PreProc
|
||||||
HiLink automakeSubst PreProc
|
hi def link automakeSubst PreProc
|
||||||
HiLink automakeComment1 makeComment
|
hi def link automakeComment1 makeComment
|
||||||
HiLink automakeComment2 makeComment
|
hi def link automakeComment2 makeComment
|
||||||
HiLink automakeMakeError makeError
|
hi def link automakeMakeError makeError
|
||||||
HiLink automakeBadSubst makeError
|
hi def link automakeBadSubst makeError
|
||||||
HiLink automakeMakeDString makeDString
|
hi def link automakeMakeDString makeDString
|
||||||
HiLink automakeMakeSString makeSString
|
hi def link automakeMakeSString makeSString
|
||||||
HiLink automakeMakeBString makeBString
|
hi def link automakeMakeBString makeBString
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "automake"
|
let b:current_syntax = "automake"
|
||||||
|
|
||||||
|
@ -11,11 +11,8 @@
|
|||||||
" I use some technologies to automatically load avenue scripts
|
" I use some technologies to automatically load avenue scripts
|
||||||
" into ArcView.
|
" into ArcView.
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -37,7 +34,7 @@ syn match aveNumber "[+-]\=\<[0-9]\+\>"
|
|||||||
" Operator
|
" Operator
|
||||||
|
|
||||||
syn keyword aveOperator or and max min xor mod by
|
syn keyword aveOperator or and max min xor mod by
|
||||||
" 'not' is a kind of a problem: Its an Operator as well as a method
|
" 'not' is a kind of a problem: It's an Operator as well as a method
|
||||||
" 'not' is only marked as an Operator if not applied as method
|
" 'not' is only marked as an Operator if not applied as method
|
||||||
syn match aveOperator "[^\.]not[^a-zA-Z]"
|
syn match aveOperator "[^\.]not[^a-zA-Z]"
|
||||||
|
|
||||||
@ -59,34 +56,24 @@ syn match aveTypos "=="
|
|||||||
syn match aveTypos "!="
|
syn match aveTypos "!="
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting+yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting+yet
|
|
||||||
if version >= 508 || !exists("did_ave_syn_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_ave_syn_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
HiLink aveStatement Statement
|
hi def link aveStatement Statement
|
||||||
|
|
||||||
HiLink aveString String
|
hi def link aveString String
|
||||||
HiLink aveNumber Number
|
hi def link aveNumber Number
|
||||||
|
|
||||||
HiLink aveFixVariables Special
|
hi def link aveFixVariables Special
|
||||||
HiLink aveVariables Identifier
|
hi def link aveVariables Identifier
|
||||||
HiLink globalVariables Special
|
hi def link globalVariables Special
|
||||||
HiLink aveConst Special
|
hi def link aveConst Special
|
||||||
|
|
||||||
HiLink aveClassMethods Function
|
hi def link aveClassMethods Function
|
||||||
|
|
||||||
HiLink aveOperator Operator
|
hi def link aveOperator Operator
|
||||||
HiLink aveComment Comment
|
hi def link aveComment Comment
|
||||||
|
|
||||||
HiLink aveTypos Error
|
hi def link aveTypos Error
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "ave"
|
let b:current_syntax = "ave"
|
||||||
|
@ -2,14 +2,12 @@
|
|||||||
" Language: AVR Assembler (AVRA)
|
" Language: AVR Assembler (AVRA)
|
||||||
" AVRA Home: http://avra.sourceforge.net/index.html
|
" AVRA Home: http://avra.sourceforge.net/index.html
|
||||||
" AVRA Version: 1.3.0
|
" AVRA Version: 1.3.0
|
||||||
|
" Last Update: 2016 Oct 7
|
||||||
" Maintainer: Marius Ghita <mhitza@gmail.com>
|
" Maintainer: Marius Ghita <mhitza@gmail.com>
|
||||||
|
|
||||||
let s:cpo_save = &cpo
|
let s:cpo_save = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
setlocal iskeyword=a-z,A-Z,48-57,.,_
|
|
||||||
" 'isident' is a global option, better not set it
|
|
||||||
" setlocal isident=a-z,A-Z,48-57,.,_
|
|
||||||
syn case ignore
|
syn case ignore
|
||||||
|
|
||||||
syn keyword avraRegister r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14
|
syn keyword avraRegister r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: awk, nawk, gawk, mawk
|
" Language: awk, nawk, gawk, mawk
|
||||||
" Maintainer: Antonio Colombo <azc100@gmail.com>
|
" Maintainer: Antonio Colombo <azc100@gmail.com>
|
||||||
" Last Change: 2016 Jul 15
|
" Last Change: 2016 Sep 05
|
||||||
|
|
||||||
" AWK ref. is: Alfred V. Aho, Brian W. Kernighan, Peter J. Weinberger
|
" AWK ref. is: Alfred V. Aho, Brian W. Kernighan, Peter J. Weinberger
|
||||||
" The AWK Programming Language, Addison-Wesley, 1988
|
" The AWK Programming Language, Addison-Wesley, 1988
|
||||||
@ -71,6 +71,10 @@ syn keyword awkVariables ARGC ARGV ARGIND ENVIRON ERRNO FILENAME
|
|||||||
syn keyword awkVariables FNR NF FUNCTAB NR PROCINFO RLENGTH RSTART
|
syn keyword awkVariables FNR NF FUNCTAB NR PROCINFO RLENGTH RSTART
|
||||||
syn keyword awkVariables RT SYMTAB
|
syn keyword awkVariables RT SYMTAB
|
||||||
|
|
||||||
|
" Arithmetic operators: +, and - take care of ++, and --
|
||||||
|
syn match awkOperator "+\|-\|\*\|/\|%\|="
|
||||||
|
syn match awkOperator "+=\|-=\|\*=\|/=\|%="
|
||||||
|
syn match awkOperator "\^\|\^="
|
||||||
|
|
||||||
" Octal format character.
|
" Octal format character.
|
||||||
syn match awkSpecialCharacter display contained "\\[0-7]\{1,3\}"
|
syn match awkSpecialCharacter display contained "\\[0-7]\{1,3\}"
|
||||||
@ -124,11 +128,6 @@ syn case match
|
|||||||
|
|
||||||
"syn match awkIdentifier "\<[a-zA-Z_][a-zA-Z0-9_]*\>"
|
"syn match awkIdentifier "\<[a-zA-Z_][a-zA-Z0-9_]*\>"
|
||||||
|
|
||||||
" Arithmetic operators: +, and - take care of ++, and --
|
|
||||||
syn match awkOperator "+\|-\|\*\|/\|%\|="
|
|
||||||
syn match awkOperator "+=\|-=\|\*=\|/=\|%="
|
|
||||||
syn match awkOperator "^\|^="
|
|
||||||
|
|
||||||
" Comparison expressions.
|
" Comparison expressions.
|
||||||
syn match awkExpression "==\|>=\|=>\|<=\|=<\|\!="
|
syn match awkExpression "==\|>=\|=>\|<=\|=<\|\!="
|
||||||
syn match awkExpression "\~\|\!\~"
|
syn match awkExpression "\~\|\!\~"
|
||||||
@ -167,7 +166,6 @@ syn region awkArray transparent start="\[" end="\]" contains=awkArray,awkArrayE
|
|||||||
syn sync ccomment awkArray maxlines=10
|
syn sync ccomment awkArray maxlines=10
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" Only used when an item doesn't have highlighting yet
|
|
||||||
hi def link awkConditional Conditional
|
hi def link awkConditional Conditional
|
||||||
hi def link awkFunction Function
|
hi def link awkFunction Function
|
||||||
hi def link awkRepeat Repeat
|
hi def link awkRepeat Repeat
|
||||||
|
@ -6,21 +6,14 @@
|
|||||||
" Comment: Replaced sourcing c.vim file by ada.vim and rename yacc*
|
" Comment: Replaced sourcing c.vim file by ada.vim and rename yacc*
|
||||||
" in ayacc*
|
" in ayacc*
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Read the Ada syntax to start with
|
" Read the Ada syntax to start with
|
||||||
if version < 600
|
runtime! syntax/ada.vim
|
||||||
so <sfile>:p:h/ada.vim
|
unlet b:current_syntax
|
||||||
else
|
|
||||||
runtime! syntax/ada.vim
|
|
||||||
unlet b:current_syntax
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:cpo_save = &cpo
|
let s:cpo_save = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
@ -54,35 +47,26 @@ syn match ayaccSep "^[ \t]*%}"
|
|||||||
syn match ayaccCurlyError "[{}]"
|
syn match ayaccCurlyError "[{}]"
|
||||||
syn region ayaccAction matchgroup=ayaccCurly start="{" end="}" contains=ALLBUT,@ayaccActionGroup
|
syn region ayaccAction matchgroup=ayaccCurly start="{" end="}" contains=ALLBUT,@ayaccActionGroup
|
||||||
|
|
||||||
if version >= 508 || !exists("did_ayacc_syntax_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_ayacc_syntax_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Internal ayacc highlighting links
|
" Internal ayacc highlighting links
|
||||||
HiLink ayaccBrkt ayaccStmt
|
hi def link ayaccBrkt ayaccStmt
|
||||||
HiLink ayaccKey ayaccStmt
|
hi def link ayaccKey ayaccStmt
|
||||||
HiLink ayaccOper ayaccStmt
|
hi def link ayaccOper ayaccStmt
|
||||||
HiLink ayaccUnionStart ayaccKey
|
hi def link ayaccUnionStart ayaccKey
|
||||||
|
|
||||||
" External ayacc highlighting links
|
" External ayacc highlighting links
|
||||||
HiLink ayaccCurly Delimiter
|
hi def link ayaccCurly Delimiter
|
||||||
HiLink ayaccCurlyError Error
|
hi def link ayaccCurlyError Error
|
||||||
HiLink ayaccDefinition Function
|
hi def link ayaccDefinition Function
|
||||||
HiLink ayaccDelim Function
|
hi def link ayaccDelim Function
|
||||||
HiLink ayaccKeyActn Special
|
hi def link ayaccKeyActn Special
|
||||||
HiLink ayaccSectionSep Todo
|
hi def link ayaccSectionSep Todo
|
||||||
HiLink ayaccSep Delimiter
|
hi def link ayaccSep Delimiter
|
||||||
HiLink ayaccStmt Statement
|
hi def link ayaccStmt Statement
|
||||||
HiLink ayaccType Type
|
hi def link ayaccType Type
|
||||||
|
|
||||||
" since Bram doesn't like my Delimiter :|
|
" since Bram doesn't like my Delimiter :|
|
||||||
HiLink Delimiter Type
|
hi def link Delimiter Type
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "ayacc"
|
let b:current_syntax = "ayacc"
|
||||||
|
|
||||||
|
@ -5,11 +5,8 @@
|
|||||||
" LastChange: 8 Dec 2007
|
" LastChange: 8 Dec 2007
|
||||||
|
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -69,58 +66,48 @@ syn region bPreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error
|
|||||||
syn sync ccomment bComment minlines=10
|
syn sync ccomment bComment minlines=10
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
|
|
||||||
if version >= 508 || !exists("did_b_syntax_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_b_syntax_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
" The default methods for highlighting. Can be overridden later
|
" The default methods for highlighting. Can be overridden later
|
||||||
HiLink bLabel Label
|
hi def link bLabel Label
|
||||||
HiLink bUserLabel Label
|
hi def link bUserLabel Label
|
||||||
HiLink bConditional Conditional
|
hi def link bConditional Conditional
|
||||||
HiLink bRepeat Repeat
|
hi def link bRepeat Repeat
|
||||||
HiLink bLogic Special
|
hi def link bLogic Special
|
||||||
HiLink bCharacter Character
|
hi def link bCharacter Character
|
||||||
HiLink bSpecialCharacter bSpecial
|
hi def link bSpecialCharacter bSpecial
|
||||||
HiLink bNumber Number
|
hi def link bNumber Number
|
||||||
HiLink bFloat Float
|
hi def link bFloat Float
|
||||||
HiLink bOctalError bError
|
hi def link bOctalError bError
|
||||||
HiLink bParenError bError
|
hi def link bParenError bError
|
||||||
" HiLink bInParen bError
|
" hi def link bInParen bError
|
||||||
HiLink bCommentError bError
|
hi def link bCommentError bError
|
||||||
HiLink bBoolean Identifier
|
hi def link bBoolean Identifier
|
||||||
HiLink bConstant Identifier
|
hi def link bConstant Identifier
|
||||||
HiLink bGuard Identifier
|
hi def link bGuard Identifier
|
||||||
HiLink bOperator Operator
|
hi def link bOperator Operator
|
||||||
HiLink bKeywords Operator
|
hi def link bKeywords Operator
|
||||||
HiLink bOps Identifier
|
hi def link bOps Identifier
|
||||||
HiLink bStructure Structure
|
hi def link bStructure Structure
|
||||||
HiLink bStorageClass StorageClass
|
hi def link bStorageClass StorageClass
|
||||||
HiLink bInclude Include
|
hi def link bInclude Include
|
||||||
HiLink bPreProc PreProc
|
hi def link bPreProc PreProc
|
||||||
HiLink bDefine Macro
|
hi def link bDefine Macro
|
||||||
HiLink bIncluded bString
|
hi def link bIncluded bString
|
||||||
HiLink bError Error
|
hi def link bError Error
|
||||||
HiLink bStatement Statement
|
hi def link bStatement Statement
|
||||||
HiLink bPreCondit PreCondit
|
hi def link bPreCondit PreCondit
|
||||||
HiLink bType Type
|
hi def link bType Type
|
||||||
HiLink bCommentError bError
|
hi def link bCommentError bError
|
||||||
HiLink bCommentString bString
|
hi def link bCommentString bString
|
||||||
HiLink bComment2String bString
|
hi def link bComment2String bString
|
||||||
HiLink bCommentSkip bComment
|
hi def link bCommentSkip bComment
|
||||||
HiLink bString String
|
hi def link bString String
|
||||||
HiLink bComment Comment
|
hi def link bComment Comment
|
||||||
HiLink bSpecial SpecialChar
|
hi def link bSpecial SpecialChar
|
||||||
HiLink bTodo Todo
|
hi def link bTodo Todo
|
||||||
"hi link bIdentifier Identifier
|
"hi link bIdentifier Identifier
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "b"
|
let b:current_syntax = "b"
|
||||||
|
|
||||||
|
@ -4,15 +4,8 @@
|
|||||||
" Originally owned by: Erwin Smit / Her van de Vliert
|
" Originally owned by: Erwin Smit / Her van de Vliert
|
||||||
" Last change: v1.17 2006/04/26 10:40:18
|
" Last change: v1.17 2006/04/26 10:40:18
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
"
|
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
if exists("baan_fold")
|
|
||||||
unlet baan_fold
|
|
||||||
endif
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -1894,40 +1887,30 @@ syn keyword baanBshell bclm.productidlicensed
|
|||||||
syn keyword baanBshell bclm.set.desktop
|
syn keyword baanBshell bclm.set.desktop
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
if version >= 508 || !exists("did_baan_syn_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_baan_syn_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
HiLink baanConditional Conditional
|
hi def link baanConditional Conditional
|
||||||
HiLink baan3gl Statement
|
hi def link baan3gl Statement
|
||||||
HiLink baan3glpre PreProc
|
hi def link baan3glpre PreProc
|
||||||
HiLink baan4gl Statement
|
hi def link baan4gl Statement
|
||||||
HiLink baan4glh Statement
|
hi def link baan4glh Statement
|
||||||
HiLink baansql Statement
|
hi def link baansql Statement
|
||||||
HiLink baansqlh Statement
|
hi def link baansqlh Statement
|
||||||
HiLink baanDalHook Statement
|
hi def link baanDalHook Statement
|
||||||
HiLink baanNumber Number
|
hi def link baanNumber Number
|
||||||
HiLink baanString String
|
hi def link baanString String
|
||||||
HiLink baanOpenStringError Error
|
hi def link baanOpenStringError Error
|
||||||
HiLink baanConstant Constant
|
hi def link baanConstant Constant
|
||||||
HiLink baanComment Comment
|
hi def link baanComment Comment
|
||||||
HiLink baanCommenth Comment
|
hi def link baanCommenth Comment
|
||||||
HiLink baanUncommented Comment
|
hi def link baanUncommented Comment
|
||||||
HiLink baanDLLUsage Comment
|
hi def link baanDLLUsage Comment
|
||||||
HiLink baanFunUsage Comment
|
hi def link baanFunUsage Comment
|
||||||
HiLink baanIdentifier Normal
|
hi def link baanIdentifier Normal
|
||||||
HiLink baanBshell Function
|
hi def link baanBshell Function
|
||||||
HiLink baanType Type
|
hi def link baanType Type
|
||||||
HiLink baanStorageClass StorageClass
|
hi def link baanStorageClass StorageClass
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "baan"
|
let b:current_syntax = "baan"
|
||||||
|
|
||||||
|
@ -8,11 +8,8 @@
|
|||||||
" This syntax file not a complete implementation yet. Send suggestions to the
|
" This syntax file not a complete implementation yet. Send suggestions to the
|
||||||
" maintainer.
|
" maintainer.
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -143,34 +140,24 @@ syn match basicFilenumber "#\d\+"
|
|||||||
syn match basicMathsOperator "-\|=\|[:<>+\*^/\\]\|AND\|OR"
|
syn match basicMathsOperator "-\|=\|[:<>+\*^/\\]\|AND\|OR"
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
if version >= 508 || !exists("did_basic_syntax_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_basic_syntax_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
HiLink basicLabel Label
|
hi def link basicLabel Label
|
||||||
HiLink basicConditional Conditional
|
hi def link basicConditional Conditional
|
||||||
HiLink basicRepeat Repeat
|
hi def link basicRepeat Repeat
|
||||||
HiLink basicLineNumber Comment
|
hi def link basicLineNumber Comment
|
||||||
HiLink basicNumber Number
|
hi def link basicNumber Number
|
||||||
HiLink basicError Error
|
hi def link basicError Error
|
||||||
HiLink basicStatement Statement
|
hi def link basicStatement Statement
|
||||||
HiLink basicString String
|
hi def link basicString String
|
||||||
HiLink basicComment Comment
|
hi def link basicComment Comment
|
||||||
HiLink basicSpecial Special
|
hi def link basicSpecial Special
|
||||||
HiLink basicTodo Todo
|
hi def link basicTodo Todo
|
||||||
HiLink basicFunction Identifier
|
hi def link basicFunction Identifier
|
||||||
HiLink basicTypeSpecifier Type
|
hi def link basicTypeSpecifier Type
|
||||||
HiLink basicFilenumber basicTypeSpecifier
|
hi def link basicFilenumber basicTypeSpecifier
|
||||||
"hi basicMathsOperator term=bold cterm=bold gui=bold
|
"hi basicMathsOperator term=bold cterm=bold gui=bold
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "basic"
|
let b:current_syntax = "basic"
|
||||||
|
|
||||||
|
@ -5,11 +5,8 @@
|
|||||||
" (Dominique Pelle added @Spell)
|
" (Dominique Pelle added @Spell)
|
||||||
" Available on: www.gjh.sk/~vlado/bc.vim
|
" Available on: www.gjh.sk/~vlado/bc.vim
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -53,27 +50,17 @@ syn match bcParenError ")"
|
|||||||
syn case match
|
syn case match
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
if version >= 508 || !exists("did_bc_syntax_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_bc_syntax_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
HiLink bcKeyword Statement
|
hi def link bcKeyword Statement
|
||||||
HiLink bcType Type
|
hi def link bcType Type
|
||||||
HiLink bcConstant Constant
|
hi def link bcConstant Constant
|
||||||
HiLink bcNumber Number
|
hi def link bcNumber Number
|
||||||
HiLink bcComment Comment
|
hi def link bcComment Comment
|
||||||
HiLink bcString String
|
hi def link bcString String
|
||||||
HiLink bcSpecialChar SpecialChar
|
hi def link bcSpecialChar SpecialChar
|
||||||
HiLink bcParenError Error
|
hi def link bcParenError Error
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "bc"
|
let b:current_syntax = "bc"
|
||||||
" vim: ts=8
|
" vim: ts=8
|
||||||
|
@ -2,17 +2,14 @@
|
|||||||
" Language: BibTeX (bibliographic database format for (La)TeX)
|
" Language: BibTeX (bibliographic database format for (La)TeX)
|
||||||
" Maintainer: Bernd Feige <Bernd.Feige@gmx.net>
|
" Maintainer: Bernd Feige <Bernd.Feige@gmx.net>
|
||||||
" Filenames: *.bib
|
" Filenames: *.bib
|
||||||
" Last Change: 2016 May 31
|
" Last Change: 2016 Sep 12
|
||||||
|
|
||||||
" Thanks to those who pointed out problems with this file or supplied fixes!
|
" Thanks to those who pointed out problems with this file or supplied fixes!
|
||||||
|
|
||||||
" Initialization
|
" Initialization
|
||||||
" ==============
|
" ==============
|
||||||
" For version 5.x: Clear all syntax items
|
" quit when a syntax file was already loaded
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
if exists("b:current_syntax")
|
||||||
if version < 600
|
|
||||||
syntax clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -74,7 +71,7 @@ syn keyword bibNSEntryKw contained mrclass mrnumber mrreviewer fjournal coden
|
|||||||
|
|
||||||
" Clusters
|
" Clusters
|
||||||
" ========
|
" ========
|
||||||
syn cluster bibVarContents contains=bibUnescapedSpecial,bibBrace,bibParen
|
syn cluster bibVarContents contains=bibUnescapedSpecial,bibBrace,bibParen,bibMath
|
||||||
" This cluster is empty but things can be added externally:
|
" This cluster is empty but things can be added externally:
|
||||||
"syn cluster bibCommentContents
|
"syn cluster bibCommentContents
|
||||||
|
|
||||||
@ -84,6 +81,7 @@ syn match bibUnescapedSpecial contained /[^\\][%&]/hs=s+1
|
|||||||
syn match bibKey contained /\s*[^ \t}="]\+,/hs=s,he=e-1 nextgroup=bibField
|
syn match bibKey contained /\s*[^ \t}="]\+,/hs=s,he=e-1 nextgroup=bibField
|
||||||
syn match bibVariable contained /[^{}," \t=]/
|
syn match bibVariable contained /[^{}," \t=]/
|
||||||
syn region bibComment start=/./ end=/^\s*@/me=e-1 contains=@bibCommentContents nextgroup=bibEntry
|
syn region bibComment start=/./ end=/^\s*@/me=e-1 contains=@bibCommentContents nextgroup=bibEntry
|
||||||
|
syn region bibMath contained start=/\$/ end=/\$/ skip=/\(\\\$\)/
|
||||||
syn region bibQuote contained start=/"/ end=/"/ skip=/\(\\"\)/ contains=@bibVarContents
|
syn region bibQuote contained start=/"/ end=/"/ skip=/\(\\"\)/ contains=@bibVarContents
|
||||||
syn region bibBrace contained start=/{/ end=/}/ skip=/\(\\[{}]\)/ contains=@bibVarContents
|
syn region bibBrace contained start=/{/ end=/}/ skip=/\(\\[{}]\)/ contains=@bibVarContents
|
||||||
syn region bibParen contained start=/(/ end=/)/ skip=/\(\\[()]\)/ contains=@bibVarContents
|
syn region bibParen contained start=/(/ end=/)/ skip=/\(\\[()]\)/ contains=@bibVarContents
|
||||||
@ -91,11 +89,7 @@ syn region bibField contained start="\S\+\s*=\s*" end=/[}),]/me=e-1 contains=bib
|
|||||||
syn region bibEntryData contained start=/[{(]/ms=e+1 end=/[})]/me=e-1 contains=bibKey,bibField
|
syn region bibEntryData contained start=/[{(]/ms=e+1 end=/[})]/me=e-1 contains=bibKey,bibField
|
||||||
" Actually, 5.8 <= Vim < 6.0 would ignore the `fold' keyword anyway, but Vim<5.8 would produce
|
" Actually, 5.8 <= Vim < 6.0 would ignore the `fold' keyword anyway, but Vim<5.8 would produce
|
||||||
" an error, so we explicitly distinguish versions with and without folding functionality:
|
" an error, so we explicitly distinguish versions with and without folding functionality:
|
||||||
if version < 600
|
syn region bibEntry start=/@\S\+\s*[{(]/ end=/^\s*[})]/ transparent fold contains=bibType,bibEntryData nextgroup=bibComment
|
||||||
syn region bibEntry start=/@\S\+\s*[{(]/ end=/^\s*[})]/ transparent contains=bibType,bibEntryData nextgroup=bibComment
|
|
||||||
else
|
|
||||||
syn region bibEntry start=/@\S\+\s*[{(]/ end=/^\s*[})]/ transparent fold contains=bibType,bibEntryData nextgroup=bibComment
|
|
||||||
endif
|
|
||||||
syn region bibComment2 start=/@Comment\s*[{(]/ end=/^\s*[})]/me=e-1 contains=@bibCommentContents nextgroup=bibEntry
|
syn region bibComment2 start=/@Comment\s*[{(]/ end=/^\s*[})]/me=e-1 contains=@bibCommentContents nextgroup=bibEntry
|
||||||
|
|
||||||
" Synchronization
|
" Synchronization
|
||||||
@ -107,25 +101,16 @@ syn sync minlines=50
|
|||||||
" Highlighting defaults
|
" Highlighting defaults
|
||||||
" =====================
|
" =====================
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" Only when an item doesn't have highlighting yet
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
if version >= 508 || !exists("did_bib_syn_inits")
|
hi def link bibType Identifier
|
||||||
if version < 508
|
hi def link bibEntryKw Statement
|
||||||
let did_bib_syn_inits = 1
|
hi def link bibNSEntryKw PreProc
|
||||||
command -nargs=+ HiLink hi link <args>
|
hi def link bibKey Special
|
||||||
else
|
hi def link bibVariable Constant
|
||||||
command -nargs=+ HiLink hi def link <args>
|
hi def link bibUnescapedSpecial Error
|
||||||
endif
|
hi def link bibComment Comment
|
||||||
HiLink bibType Identifier
|
hi def link bibComment2 Comment
|
||||||
HiLink bibEntryKw Statement
|
|
||||||
HiLink bibNSEntryKw PreProc
|
|
||||||
HiLink bibKey Special
|
|
||||||
HiLink bibVariable Constant
|
|
||||||
HiLink bibUnescapedSpecial Error
|
|
||||||
HiLink bibComment Comment
|
|
||||||
HiLink bibComment2 Comment
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "bib"
|
let b:current_syntax = "bib"
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user