Merge #6613 from justinmk/vim-patches

This commit is contained in:
Justin M. Keyes 2017-04-29 01:41:29 +02:00 committed by GitHub
commit 9f6d693e26
473 changed files with 21755 additions and 26746 deletions

View File

@ -1,6 +1,6 @@
" Vim autoload file for editing compressed files.
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2014 Nov 05
" Last Change: 2016 Sep 28
" These functions are used by the gzip plugin.
@ -63,6 +63,9 @@ fun gzip#read(cmd)
" set 'modifiable'
let ma_save = &ma
setlocal ma
" set 'write'
let write_save = &write
set write
" Reset 'foldenable', otherwise line numbers get adjusted.
if has("folding")
let fen_save = &fen
@ -127,6 +130,7 @@ fun gzip#read(cmd)
let &pm = pm_save
let &cpo = cpo_save
let &l:ma = ma_save
let &write = write_save
if has("folding")
let &l:fen = fen_save
endif

View File

@ -22,8 +22,8 @@
if &cp || exists("g:loaded_netrw")
finish
endif
" netrw requires vim having patch 213; netrw will benefit from vim's having patch#656, too
if v:version < 704 || !has("patch213")
" netrw requires vim having patch 7.4.213; netrw will benefit from vim's having patch#656, too
if v:version < 704 || (v:version == 704 && !has("patch213"))
if !exists("s:needpatch213")
unsilent echomsg "***sorry*** this version of netrw requires vim v7.4 with patch 213"
endif

View File

@ -3,7 +3,7 @@
" Maintainer: Dávid Szabó ( complex857 AT gmail DOT com )
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" URL: https://github.com/shawncplus/phpcomplete.vim
" Last Change: 2015 Jul 13
" Last Change: 2016 Oct 10
"
" OPTIONS:
"
@ -195,6 +195,8 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
" }}}
elseif context =~? 'implements'
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 == ''
return ['implements']
elseif context =~? 'extends'
@ -787,6 +789,8 @@ function! phpcomplete#CompleteClassName(base, kinds, current_namespace, imports)
if kinds == ['c', 'i']
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']
let filterstr = 'v:val =~? "class\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"'
elseif kinds == ['i']
@ -931,7 +935,7 @@ function! phpcomplete#EvaluateModifiers(modifiers, required_modifiers, prohibite
endfor
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
return 0
endif
@ -996,7 +1000,7 @@ function! phpcomplete#CompleteUserClass(context, base, sccontent, visibility) "
let required_modifiers += ['static']
endif
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 = []
for i in all_variable
@ -1160,6 +1164,14 @@ function! phpcomplete#GetTaglist(pattern) " {{{
endif
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 has_key = has_key(s:cache_tags, a:pattern)
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
" try to find the method's return type in docblock comment
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)
if doc_str != ''
break
@ -1387,8 +1399,17 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat
endfor
if doc_str != ''
let docblock = phpcomplete#ParseDocBlock(doc_str)
if has_key(docblock.return, 'type') || has_key(docblock.var, 'type')
let type = has_key(docblock.return, 'type') ? docblock.return.type : 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 : 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
if type =~ '\\'
@ -1554,6 +1575,9 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
elseif get(methodstack, 0) =~# function_invocation_pattern
let function_name = matchstr(methodstack[0], '^\s*\zs'.function_name_pattern)
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'
" 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)
" 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
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 [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(
\ classname,
\ a:current_namespace,
\ namespace_for_class,
\ a:imports,
\ sub_methodstack)
return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate
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_file = phpcomplete#GetFunctionLocation(function_name, function_namespace)
if function_file == ''
let function_file = phpcomplete#GetFunctionLocation(function_name, '\')
endif
if function_file == 'VIMPHP_BUILTINFUNCTION'
" 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 [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
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
endif
endif
@ -1861,6 +1889,8 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
for tag in tags
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')
" unescape the classname, it would have "\" doubled since it is an ex command
let classname = substitute(classname, '\\\(\_.\)', '\1', 'g')
return classname
endif
endfor
@ -2077,6 +2107,19 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
endif
call searchpair('{', '', '}', 'W')
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 used_traits = []
@ -2241,8 +2284,19 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{
let line = a:sccontent[i]
" search for a function declaration
if line =~? a:search
if line =~? '@property'
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
" start backward serch for the comment block
endif
" start backward search for the comment block
while l != 0
let line = a:sccontent[l]
" 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 ''
end
while l != 0
while l >= 0
let line = a:sccontent[l]
if line =~? '^\s*/\*\*'
let comment_start = l
@ -2297,9 +2351,10 @@ function! phpcomplete#ParseDocBlock(docblock) " {{{
\ 'return': {},
\ 'throws': [],
\ '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 param_lines = filter(copy(docblock_lines), 'v:val =~? "^@param"')
@ -2334,15 +2389,26 @@ function! phpcomplete#ParseDocBlock(docblock) " {{{
endif
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
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'] = {
\ 'line': var_parts[0],
\ 'type': phpcomplete#GetTypeFromDocBlockParam(get(var_parts, 1, '')),
\ 'description': get(var_parts, 2, '')}
\ 'type': phpcomplete#GetTypeFromDocBlockParam(get(var_parts, 2, '')),
\ 'description': get(var_parts, 3, '')}
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
endfunction
" }}}
@ -2498,6 +2564,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
let name = matchstr(name, '\\\zs[^\\]\+\ze$')
endif
endif
" leading slash is not required use imports are always absolute
let imports[name] = {'name': object, 'kind': ''}
endfor
@ -2533,6 +2600,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
elseif !exists('no_namespace_candidate')
" save the first namespacless match to be used if no better
" candidate found later on
let tag.namespace = namespace_for_classes
let no_namespace_candidate = tag
endif
endif

View File

@ -93,7 +93,7 @@ function! s:GetBufferRubyEntity( name, type, ... )
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] = searchpairpos( crex . '\zs', '', '\(end\|}\)', 'w' )
@ -149,7 +149,7 @@ function! s:GetRubyVarType(v)
let ctors = ctors.'\)'
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)
if lnum != 0 && lcol != 0
let str = matchstr(getline(lnum),fstr,lcol)
@ -196,7 +196,7 @@ function! rubycomplete#Complete(findstart, base)
if c =~ '\w'
continue
elseif ! c =~ '\.'
idx = -1
let idx = -1
break
else
break
@ -266,6 +266,28 @@ class VimRubyCompletion
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)
dprint "load_buffer_class(%s) START" % name
classdef = get_buffer_entity(name, 's:GetBufferRubyClass("%s")')
@ -588,6 +610,10 @@ class VimRubyCompletion
load_rails
end
want_gems = VIM::evaluate("get(g:, 'rubycomplete_load_gemfile')")
load_gems unless want_gems.to_i.zero?
input = VIM::Buffer.current.line
cpos = VIM::Window.current.cursor[1] - 1
input = input[0..cpos]
@ -678,7 +704,9 @@ class VimRubyCompletion
cv = eval("self.class.constants")
vartype = get_var_type( receiver )
dprint "vartype: %s" % vartype
if vartype != ''
invalid_vartype = ['', "gets"]
if !invalid_vartype.include?(vartype)
load_buffer_class( vartype )
begin
@ -706,7 +734,7 @@ class VimRubyCompletion
methods.concat m.instance_methods(false)
}
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*\)?\.([^.]*)/
message = $1

View File

@ -117,7 +117,7 @@ fun! tar#Browse(tarfile)
if !filereadable(a:tarfile)
" call Decho('a:tarfile<'.a:tarfile.'> not filereadable')
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!
echohl Error | echo "***error*** (tar#Browse) File not readable<".a:tarfile.">" | echohl None
endif

View File

@ -1,7 +1,7 @@
" zip.vim: Handles browsing zipfiles
" AUTOLOAD PORTION
" Date: Jul 02, 2013
" Version: 27
" Date: Sep 13, 2016
" Version: 28
" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
" License: Vim License (see vim's :help license)
" Copyright: Copyright (C) 2005-2013 Charles E. Campbell {{{1
@ -20,10 +20,10 @@
if &cp || exists("g:loaded_zip")
finish
endif
let g:loaded_zip= "v27"
let g:loaded_zip= "v28"
if v:version < 702
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
finish
endif
@ -53,6 +53,9 @@ endif
if !exists("g:zip_unzipcmd")
let g:zip_unzipcmd= "unzip"
endif
if !exists("g:zip_extractcmd")
let g:zip_extractcmd= g:zip_unzipcmd
endif
" ----------------
" Functions: {{{1
@ -62,14 +65,14 @@ endif
" zip#Browse: {{{2
fun! zip#Browse(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")
if !filereadable(a:zipfile) || readfile(a:zipfile, "", 1)[0] !~ '^PK'
exe "noautocmd e ".fnameescape(a:zipfile)
" call Dret("zip#Browse : not a zipfile<".a:zipfile.">")
return
" 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
let repkeep= &report
@ -92,7 +95,7 @@ fun! zip#Browse(zipfile)
endif
if !filereadable(a:zipfile)
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!
echohl Error | echo "***error*** (zip#Browse) File not readable<".a:zipfile.">" | echohl None
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
@ -136,8 +139,10 @@ fun! zip#Browse(zipfile)
return
endif
" Maps associated with zip plugin
setlocal noma nomod ro
noremap <silent> <buffer> <cr> :call <SID>ZipBrowseSelect()<cr>
noremap <silent> <buffer> x :call zip#Extract()<cr>
let &report= repkeep
" call Dret("zip#Browse")
@ -204,6 +209,15 @@ fun! zip#Read(fname,mode)
endif
" call Decho("zipfile<".zipfile.">")
" 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
" 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
" sanity checks
if !executable(g:zip_zipcmd)
if !executable(substitute(g:zip_zipcmd,'\s\+.*$','',''))
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()
let &report= repkeep
" call Dret("zip#Write")
@ -344,6 +358,48 @@ fun! zip#Write(fname)
" call Dret("zip#Write")
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
fun! s:Escape(fname,isfilt)

View File

@ -1,6 +1,6 @@
" Vim color file
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2006 Apr 14
" Last Change: 2016 Oct 10
" 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
" Groups for syntax highlighting
hi Constant term=underline ctermfg=Magenta guifg=#ffa0a0 guibg=grey5
hi Special term=bold ctermfg=LightRed guifg=Orange guibg=grey5
hi Constant term=underline ctermfg=Magenta guifg=#ffa0a0
hi Special term=bold ctermfg=LightRed guifg=Orange
if &t_Co > 8
hi Statement term=bold cterm=bold ctermfg=Yellow guifg=#ffff60 gui=bold
endif

View File

@ -2,7 +2,7 @@
" vim: tw=0 ts=4 sw=4
" Vim color file
" Maintainer: Ron Aaron <ron@ronware.org>
" Last Change: 2013 May 23
" Last Change: 2016 Sep 04
hi clear
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 Underlined term=underline cterm=bold,underline ctermfg=lightblue guifg=lightblue gui=bold,underline
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 String Constant
hi link Character Constant

View File

@ -1,7 +1,7 @@
" Vim compiler file
" Compiler: Cucumber
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2010 Aug 09
" Last Change: 2016 Aug 29
if exists("current_compiler")
finish
@ -19,7 +19,7 @@ CompilerSet makeprg=cucumber
CompilerSet errorformat=
\%W%m\ (Cucumber::Undefined),
\%E%m\ (%.%#),
\%E%m\ (%\\S%#),
\%Z%f:%l,
\%Z%f:%l:%.%#

View File

@ -1,7 +1,7 @@
" Vim compiler file
" Compiler: Haml
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2013 May 30
" Last Change: 2016 Aug 29
if exists("current_compiler")
finish
@ -15,7 +15,7 @@ endif
let s:cpo_save = &cpo
set cpo-=C
CompilerSet makeprg=haml\ -c
CompilerSet makeprg=haml
CompilerSet errorformat=
\Haml\ %trror\ on\ line\ %l:\ %m,

View File

@ -27,7 +27,11 @@ CompilerSet errorformat=
\%\\s%#[%f:%l:\ %#%m,
\%\\s%#%f:%l:\ %#%m,
\%\\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
unlet s:cpo_save

View File

@ -22,9 +22,10 @@ CompilerSet errorformat=
\%f:%l:\ %tarning:\ %m,
\%E%.%#:in\ `load':\ %f:%l:%m,
\%E%f:%l:in\ `%*[^']':\ %m,
\%-Z\ \ \ \ \ \#\ %f:%l:%.%#,
\%-Z\ \ \ \ \ %\\+\#\ %f:%l:%.%#,
\%E\ \ %\\d%\\+)%.%#,
\%C\ \ \ \ \ %m,
\%C%\\s%#,
\%-G%.%#
let &cpo = s:cpo_save

View File

@ -17,6 +17,8 @@ let s:cpo_save = &cpo
set cpo-=C
CompilerSet makeprg=testrb
" CompilerSet makeprg=ruby\ -Itest
" CompilerSet makeprg=m
CompilerSet errorformat=\%W\ %\\+%\\d%\\+)\ Failure:,
\%C%m\ [%f:%l]:,

View File

@ -1,7 +1,7 @@
" Vim compiler file
" Compiler: Sass
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2013 May 30
" Last Change: 2016 Aug 29
if exists("current_compiler")
finish
@ -15,7 +15,7 @@ endif
let s:cpo_save = &cpo
set cpo-=C
CompilerSet makeprg=sass\ -c
CompilerSet makeprg=sass
CompilerSet errorformat=
\%f:%l:%m\ (Sass::Syntax%trror),

View File

@ -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.
When your vimrc file is sourced twice, the autocommands will appear twice.
To avoid this, put this command in your vimrc file, before defining
autocommands: >
`:autocmd` adds to the list of autocommands regardless of whether they are
already present. When your .vimrc file is sourced twice, the 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
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}
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.
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
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
current buffer "%" may be different from the
buffer being unloaded "<afile>".
Don't change to another buffer, it will cause
problems.
Don't change to another buffer or window, it
will cause problems!
When exiting and v:dying is 2 or more this
event is not triggered.
*BufWinEnter*
@ -794,7 +803,9 @@ QuickFixCmdPre Before a quickfix command is run (|:make|,
|:vimgrepadd|, |:lvimgrepadd|, |:cscope|,
|:cfile|, |:cgetfile|, |:caddfile|, |:lfile|,
|:lgetfile|, |:laddfile|, |:helpgrep|,
|:lhelpgrep|).
|:lhelpgrep|, |:cexpr|, |:cgetexpr|,
|:caddexpr|, |:cbuffer|, |:cgetbuffer|,
|:caddbuffer|).
The pattern is matched against the command
being run. When |:grep| is used but 'grepprg'
is set to "internal" it still matches "grep".
@ -1002,7 +1013,7 @@ WinLeave Before leaving a window. If the window to be
*WinNew*
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.
==============================================================================
@ -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
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*
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
@ -1184,11 +1198,12 @@ name!
different from existing {event} names, as this
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
this if there is still an autocommand using
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:
1. Select the group with ":augroup {name}".

View File

@ -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
times, the last one will be used for "\1", "\2", etc. Example: >
: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]\),
either the first or second pattern in parentheses did not match, so either

View File

@ -219,9 +219,10 @@ CTRL-Y When there is a modeless selection, copy the selection into
the clipboard. |modeless-selection|
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
*c_<Esc>* *c_Esc*
CTRL-[ *c_CTRL-[* *c_<Esc>* *c_Esc*
<Esc> When typed and 'x' not present in 'cpoptions', quit
Command-line mode without executing. In macros or when 'x'
present in 'cpoptions', start entered command.

View File

@ -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
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
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
'autowriteall' option. 'autowrite' is the associated Vi-compatible option

View File

@ -107,7 +107,7 @@ To test for a non-empty string, use empty(): >
*non-zero-arg*
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
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
cleared. A List, Dictionary or Float is not a Number or String, thus
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:
|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 greater than
expr5 >= expr5 greater than or equal
@ -654,19 +658,23 @@ Expression syntax summary, from least to most significant:
expr5 is expr5 same |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 .. string concatenation
|expr6| expr7 * expr7 .. number multiplication
|expr6| expr7
expr7 * expr7 .. number multiplication
expr7 / expr7 .. number division
expr7 % expr7 .. number modulo
|expr7| ! expr7 logical NOT
|expr7| expr8
! expr7 logical NOT
- expr7 unary minus
+ 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.name entry in a |Dictionary|
expr8(expr1, ...) function call with |Funcref| variable
@ -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
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.
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
*closure*
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
function returns: >
: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})
< [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,
\ {-> execute("echo 'Handler called'", "")},
\ {'repeat': 3})
@ -2023,8 +2031,8 @@ expand({expr} [, {nosuf} [, {list}]])
feedkeys({string} [, {mode}]) Number add key sequence to typeahead buffer
filereadable({file}) Number |TRUE| if {file} is a readable file
filewritable({file}) Number |TRUE| if {file} is a writable file
filter({expr}, {string}) List/Dict remove items from {expr} where
{string} is 0
filter({expr1}, {expr2}) List/Dict remove items from {expr1} where
{expr2} is 0
finddir({name}[, {path}[, {count}]])
String find directory {name} in {path}
findfile({name}[, {path}[, {count}]])
@ -2147,7 +2155,7 @@ lispindent({lnum}) Number Lisp indent for line {lnum}
localtime() Number current time
log({expr}) Float natural logarithm (base e) of {expr}
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}]]])
String or Dict
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
{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
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|.
{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.
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.
Examples: >
call filter(mylist, 'v:val !~ "OLD"')
@ -3503,6 +3514,10 @@ filter({expr1}, {expr2}) *filter()*
return a:idx % 2 == 1
endfunc
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
|Dictionary| to remain unmodified make a copy first: >
@ -4538,6 +4553,7 @@ histadd({history}, {item}) *histadd()*
"expr" or "=" typed expression history
"input" or "@" input line 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
character is sufficient.
If {item} does already exist in the history, it will be
@ -5140,6 +5156,10 @@ map({expr1}, {expr2}) *map()*
return a:key . '-' . a:val
endfunc
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
|Dictionary| to remain unmodified make a copy first: >
@ -6167,7 +6187,7 @@ rpcstop({channel}) {Nvim} *rpcstop()*
connecting to |v:servername|.
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
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.
{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
waiting for input.
{options} is a dictionary. Supported entries:
"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: >
func MyHandler(timer)

View File

@ -565,6 +565,17 @@ These maps can be disabled with >
: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*
Since the text for this plugin is rather long it has been put in a separate

View File

@ -48,7 +48,11 @@ Example: >
print 'EAT ME'
EOF
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
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
if the `:py3` command is working: >
:py3 print("Hello")
To see what version of Python you have: >
:py3 import sys
:py3 print(sys.version)
< *:py3file*
The `:py3file` command works similar to `:pyfile`.
*:py3do*

View File

@ -54,6 +54,9 @@ Example Vim script: >
EOF
endfunction
<
To see what version of Ruby you have: >
:ruby print RUBY_VERSION
<
*:rubydo* *:rubyd* *E265*
:[range]rubyd[o] {cmd} Evaluate Ruby command {cmd} for each line in the

View File

@ -982,7 +982,7 @@ tag command action in Command-line editing mode ~
|c_CTRL-E| CTRL-E cursor to end of command-line
|'cedit'| CTRL-F default value for 'cedit': opens the
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_digraph| {char1} <BS> {char2}
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
cursor and insert the longest common part
|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:
go to next match, otherwise: same as <Down>
CTRL-O not used
@ -1015,7 +1015,7 @@ tag command action in Command-line editing mode ~
insert the contents of a register or object
under the cursor literally
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-V| CTRL-V insert next non-digit literally, insert three
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-Z not used (reserved for suspend)
|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-G| CTRL-\ CTRL-G go to mode specified with 'insertmode',
abandon command-line

View File

@ -126,10 +126,7 @@ http://www.vim.org/maillist.php
Bug reports: *bugs* *bug-reports* *bugreport.vim*
Send bug reports to: Vim Developers <vim-dev@vim.org>
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).
Report bugs on GitHub: https://github.com/neovim/neovim/issues
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

View File

@ -437,6 +437,9 @@ with a space.
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 |'<|.
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*
When 'verbose' is non-zero, listing a key map will also display where it was
last defined. Example: >
@ -1136,6 +1139,10 @@ scripts.
" Command has the -register attribute
b Command is local to current buffer
(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}

View File

@ -39,6 +39,7 @@ back.
Note: If the output has been stopped with "q" at the more prompt, it will only
be displayed up to this point.
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
start of the message. For example, to get help on the message: >

View File

@ -10,7 +10,7 @@ Options *options*
2. Automatically setting options |auto-setting|
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
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>
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.
*'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' boolean (default off)
global
Enables the reading of .nvimrc and .exrc in the current directory.
If you switch this option on you should also consider setting the
'secure' option (see |initialization|). Using this option comes
with a potential security risk, use with care!
Enables the reading of .vimrc and .exrc in the current directory.
Setting this option is a potential security leak. E.g., consider
unpacking a package or fetching files from github, a .vimrc in there
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
security reasons.
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
still need to finish the search command with <Enter> to move the
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
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.
@ -3915,10 +3922,11 @@ A jump table for the options with a short description can be found at |Q_op|.
global
Changes the special characters that can be used in search patterns.
See |pattern|.
NOTE: To avoid portability problems with using patterns, always keep
this option at the default "on". Only switch it off when working with
old Vi scripts. In any other situation write patterns that work when
'magic' is on. Include "\M" when you want to |/\M|.
WARNING: Switching this option off most likely breaks plugins! That
is because many patterns assume it's on and will fail when it's off.
Only switch it off when working with old Vi scripts. In any other
situation write patterns that work when 'magic' is on. Include "\M"
when you want to |/\M|.
*'makeef'* *'mef'*
'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
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
wildcards are allowed, but can significantly slow down searching for

View File

@ -354,8 +354,8 @@ For starters, read chapter 27 of the user manual |usr_27.txt|.
*/\%#=* *two-engines* *NFA*
Vim includes two regexp engines:
1. An old, backtracking engine that supports everything.
2. A new, NFA engine that works much faster on some patterns, but does not
support everything.
2. A new, NFA engine that works much faster on some patterns, possibly slower
on some patterns.
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

View File

@ -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"'
<
(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.
@ -1204,7 +1204,7 @@ The :NetrwMB command is available outside of netrw buffers (once netrw has been
invoked in the session).
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:
|netrw-gb| how to return (go) to a bookmark
@ -1429,7 +1429,7 @@ be used in that count.
*.netrwhist*
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
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'|.
Related Topics:
@ -3269,7 +3269,7 @@ The user function is passed one argument; it resembles >
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.
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*
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.
(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
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
"systemencoding" may address this issue in the future; for
now, just have netrw use the proper encoding. For example: >

View File

@ -6,7 +6,7 @@
Author: Charles E. Campbell <NdrOchip@ScampbellPfamily.AbizM>
(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
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
@ -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
zip archives via the plugin.
*zip-x*
x : may extract a listed file when the cursor is atop it
OPTIONS
*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
file; by default: >
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~
@ -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
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
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
are synonyms for .zip
v25 Jun 27, 2011 * using keepj with unzip -Z

View File

@ -152,7 +152,7 @@ q Stops recording.
:[addr]@: Repeat last command-line. First set cursor at line
[addr] (default is current line).
*:@@*
:[addr]@ *:@@*
:[addr]@@ Repeat the previous :@{0-9a-z"}. First set cursor at
line [addr] (default is current line).

View File

@ -425,7 +425,7 @@ accordingly. Vim proceeds in this order:
- The environment variable EXINIT.
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,
the others are ignored.
- The file ".nvimrc" (for Unix)
@ -1184,6 +1184,9 @@ running) you have additional options:
file. This list is read on startup and only changes
afterwards with ":rshada!". Also see |v:oldfiles|.
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][!]
List file names as with |:oldfiles|, and then prompt

View File

@ -2656,7 +2656,75 @@ your vimrc: *g:filetype_r*
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
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.
*ruby_minlines*
If you do want this feature enabled, but notice highlighting errors while
scrolling backwards, which are fixed when redrawing with CTRL-L, try setting
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
largest class or module.
Highlighting of special identifiers can be disabled by removing the
rubyIdentifier highlighting: >
*ruby_spellcheck_strings*
Ruby: Spellchecking strings ~
:hi link rubyIdentifier NONE
<
This will prevent highlighting of special identifiers like "ConstantName",
"$global_var", "@@class_var", "@instance_var", "| block_param |", and
":symbol".
Ruby syntax will perform spellchecking of strings if you define
"ruby_spellcheck_strings": >
Significant methods of Kernel, Module and Object are highlighted by default.
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
:let ruby_spellcheck_strings = 1
<
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>)
*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
various filenames are of specific types: >
@ -2826,28 +2863,31 @@ various filenames are of specific types: >
bash: .bashrc* bashrc bash.bashrc .bash_profile* *.bash
<
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,
then that shelltype is used. However some files (ex. .profile) are known to
be shell files but the type is not apparent. Furthermore, on many systems
sh is symbolically linked to "bash" (Linux, Windows+cygwin) or "ksh" (Posix).
(ex. looking for /bin/sh /bin/ksh /bin/bash). If the first line specifies a
shelltype, then that shelltype is used. However some files (ex. .profile) are
known to be shell files but the type is not apparent. Furthermore, on many
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:
ksh: >
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
< bash: >
let g:is_bash = 1
< sh: (default) Bourne shell >
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
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
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: >
@ -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= 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
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
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: EMBEDDING LANGUAGES~
@ -3461,8 +3494,8 @@ SYNTAX ISKEYWORD SETTING *:syn-iskeyword*
and also determines where |:syn-keyword| will be checked for a new
match.
It is recommended when writing syntax files, to use this command
to the correct value for the specific syntax language and not change
It is recommended when writing syntax files, to use this command to
set the correct value for the specific syntax language and not change
the 'iskeyword' option.
DEFINING KEYWORDS *:syn-keyword*
@ -3520,7 +3553,11 @@ DEFINING KEYWORDS *:syn-keyword*
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.
@ -3529,6 +3566,9 @@ DEFINING MATCHES *:syn-match*
[excludenl] Don't make a pattern with the end-of-line "$"
extend a containing match or region. Must be
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.
See |:syn-pattern| below.
Note that the pattern may match more than one

View File

@ -195,6 +195,12 @@ Other commands:
:tabs List the tab pages and the windows they contain.
Shows a ">" for the current window.
Shows a "+" for modified buffers.
For example:
Tab page 1 ~
+ tabpage.txt ~
ex_docmd.c ~
Tab page 2 ~
> main.c ~
REORDERING TAB PAGES:

View File

@ -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
File.Print menu entry.
See |ex-flags| for [flags].
The |:filter| command can be used to only show lines
matching a pattern.
:[range]p[rint] {count} [flags]
Print {count} lines, starting with [range] (default
@ -367,7 +369,7 @@ N *+statusline* Options 'statusline', 'rulerformat' and special
formats of 'titlestring' and 'iconstring'
N *+syntax* Syntax highlighting |syntax|
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|
m *+tag_any_white* any white space allowed in tags file |tag-any-white|
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.
*: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[ent][!] {command} Execute {command} silently. Normal messages will not
be given or added to the message history.

View File

@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" 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
if exists("did_load_filetypes")
@ -672,6 +672,9 @@ au BufNewFile,BufRead *.dts,*.dtsi setf dts
" EDIF (*.edf,*.edif,*.edn,*.edo)
au BufNewFile,BufRead *.ed\(f\|if\|n\|o\) setf edif
" EditorConfig (close enough to dosini)
au BufNewFile,BufRead .editorconfig setf dosini
" Embedix Component Description
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/gpg.conf 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
au BufNewFile,BufRead gnashrc,.gnashrc,gnashpluginrc,.gnashpluginrc setf gnash

View File

@ -1,7 +1,7 @@
" Vim filetype plugin
" Language: Cucumber
" 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
if (exists("b:did_ftplugin"))
@ -19,27 +19,23 @@ setlocal omnifunc=CucumberComplete
let b:undo_ftplugin = "setl fo< com< cms< ofu<"
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")
nnoremap <silent><buffer> <C-]> :<C-U>exe <SID>jump('edit',v:count)<CR>
nnoremap <silent><buffer> [<C-D> :<C-U>exe <SID>jump('edit',v:count)<CR>
nnoremap <silent><buffer> ]<C-D> :<C-U>exe <SID>jump('edit',v:count)<CR>
nnoremap <silent><buffer> <C-W>] :<C-U>exe <SID>jump('split',v:count)<CR>
nnoremap <silent><buffer> <C-W><C-]> :<C-U>exe <SID>jump('split',v:count)<CR>
nnoremap <silent><buffer> <C-W>d :<C-U>exe <SID>jump('split',v:count)<CR>
nnoremap <silent><buffer> <C-W><C-D> :<C-U>exe <SID>jump('split',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>
cnoremap <SID>foldopen <Bar>if &foldopen =~# 'tag'<Bar>exe 'norm! zv'<Bar>endif
nnoremap <silent> <script> <buffer> [<C-D> :<C-U>exe <SID>jump('edit',v:count)<SID>foldopen<CR>
nnoremap <silent> <script> <buffer> ]<C-D> :<C-U>exe <SID>jump('edit',v:count)<SID>foldopen<CR>
nnoremap <silent> <script> <buffer> <C-W>d :<C-U>exe <SID>jump('split',v:count)<SID>foldopen<CR>
nnoremap <silent> <script> <buffer> <C-W><C-D> :<C-U>exe <SID>jump('split',v:count)<SID>foldopen<CR>
nnoremap <silent> <script> <buffer> [d :<C-U>exe <SID>jump('pedit',v:count)<CR>
nnoremap <silent> <script> <buffer> ]d :<C-U>exe <SID>jump('pedit',v:count)<CR>
let b:undo_ftplugin .=
\ "|sil! nunmap <buffer> <C-]>" .
\ "|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><C-D>" .
\ "|sil! nunmap <buffer> <C-W>}" .
\ "|sil! nunmap <buffer> [d" .
\ "|sil! nunmap <buffer> ]d"
endif
@ -59,7 +55,7 @@ endfunction
function! s:allsteps()
let step_pattern = '\C^\s*\K\k*\>\s*(\=\s*\zs\S.\{-\}\ze\s*)\=\s*\%(do\|{\)\s*\%(|[^|]*|\s*\)\=\%($\|#\)'
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 num = 0
for line in lines

View File

@ -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 b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+')
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
if b:eruby_subtype == 'rhtml'
let b:eruby_subtype = 'html'

View File

@ -1,7 +1,7 @@
" Vim filetype plugin
" Language: generic git output
" 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
if (exists("b:did_ftplugin"))
@ -12,6 +12,8 @@ let b:did_ftplugin = 1
if !exists('b:git_dir')
if expand('%:p') =~# '[\/]\.git[\/]modules[\/]'
" Stay out of the way
elseif expand('%:p') =~# '[\/]\.git[\/]worktrees'
let b:git_dir = matchstr(expand('%:p'),'.*\.git[\/]worktrees[\/][^\/]\+\>')
elseif expand('%:p') =~# '\.git\>'
let b:git_dir = matchstr(expand('%:p'),'.*\.git\>')
elseif $GIT_DIR != ''

View File

@ -1,7 +1,7 @@
" Vim filetype plugin
" Language: git commit file
" 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
if (exists("b:did_ftplugin"))
@ -11,15 +11,10 @@ endif
runtime! ftplugin/git.vim
let b:did_ftplugin = 1
setlocal nomodeline tabstop=8 formatoptions-=croq formatoptions+=tl
let b:undo_ftplugin = 'setl modeline< tabstop< formatoptions<'
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
setlocal comments=:# commentstring=#\ %s
setlocal nomodeline tabstop=8 formatoptions+=tl textwidth=72
setlocal formatoptions-=c formatoptions-=r formatoptions-=o formatoptions-=q
let b:undo_ftplugin = 'setl modeline< tabstop< formatoptions< tw< com< cms<'
if exists("g:no_gitcommit_commands") || v:version < 700
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>)
let b:undo_ftplugin = b:undo_ftplugin . "|delc DiffGitCached"
function! s:diffcomplete(A,L,P)
let args = ""
if a:P <= match(a:L." -- "," -- ")+3

View File

@ -1,7 +1,7 @@
" Vim filetype plugin
" Language: git rebase --interactive
" 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
if (exists("b:did_ftplugin"))
@ -12,10 +12,11 @@ runtime! ftplugin/git.vim
let b:did_ftplugin = 1
setlocal comments=:# commentstring=#\ %s formatoptions-=t
setlocal nomodeline
if !exists("b:undo_ftplugin")
let b:undo_ftplugin = ""
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)
s/^\(\w\+\>\)\=\(\s*\)\ze\x\{4,40\}\>/\=(strlen(submatch(1)) == 1 ? a:word[0] : a:word) . substitute(submatch(2),'^$',' ','')/e

View File

@ -1,7 +1,7 @@
" Vim filetype plugin
" Language: Haml
" 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
if exists("b:did_ftplugin")

View File

@ -1,7 +1,7 @@
" Vim filetype plugin
" Language: Markdown
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2013 May 30
" Last Change: 2016 Aug 29
if exists("b:did_ftplugin")
finish
@ -11,7 +11,7 @@ runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s
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')
let b:undo_ftplugin .= "|setl cms< com< fo< flp<"
@ -19,4 +19,32 @@ else
let b:undo_ftplugin = "setl cms< com< fo< flp<"
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:

View File

@ -1,7 +1,8 @@
" Vim filetype plugin file
" Language: MetaFont
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
" Language: METAFONT
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
" Former Maintainers: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2016 Oct 2
if exists("b:did_ftplugin")
finish
@ -11,9 +12,59 @@ let b:did_ftplugin = 1
let s:cpo_save = &cpo
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
unlet s:cpo_save

View File

@ -1,7 +1,8 @@
" Vim filetype plugin file
" Language: MetaPost
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
" Former Maintainers: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2016 Oct 2
if exists("b:did_ftplugin")
finish
@ -11,9 +12,16 @@ let b:did_ftplugin = 1
let s:cpo_save = &cpo
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
command -nargs=0 FixBeginfigs call s:fix_beginfigs()
@ -24,5 +32,51 @@ if exists(":FixBeginfigs") != 2
endfunction
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
unlet s:cpo_save

View File

@ -2,7 +2,7 @@
" Language: python
" Maintainer: James Sully <sullyj3@gmail.com>
" 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
if exists("b:did_ftplugin") | finish | endif
@ -22,15 +22,25 @@ setlocal omnifunc=pythoncomplete#Complete
set wildignore+=*.pyc
nnoremap <silent> <buffer> ]] :call <SID>Python_jump('n', '\v%$\|^(class\|def)>', 'W')<cr>
nnoremap <silent> <buffer> [[ :call <SID>Python_jump('n', '\v^(class\|def)>', 'Wb')<cr>
nnoremap <silent> <buffer> ]m :call <SID>Python_jump('n', '\v%$\|^\s*(class\|def)>', 'W')<cr>
nnoremap <silent> <buffer> [m :call <SID>Python_jump('n', '\v^\s*(class\|def)>', 'Wb')<cr>
let b:next_toplevel='\v%$\|^(class\|def\|async def)>'
let b:prev_toplevel='\v^(class\|def\|async def)>'
let b:next='\v%$\|^\s*(class\|def\|async def)>'
let b:prev='\v^\s*(class\|def\|async def)>'
xnoremap <silent> <buffer> ]] :call <SID>Python_jump('x', '\v%$\|^(class\|def)>', 'W')<cr>
xnoremap <silent> <buffer> [[ :call <SID>Python_jump('x', '\v^(class\|def)>', 'Wb')<cr>
xnoremap <silent> <buffer> ]m :call <SID>Python_jump('x', '\v%$\|^\s*(class\|def)>', 'W')<cr>
xnoremap <silent> <buffer> [m :call <SID>Python_jump('x', '\v^\s*(class\|def)>', 'Wb')<cr>
execute "nnoremap <silent> <buffer> ]] :call <SID>Python_jump('n', '". b:next_toplevel."', 'W')<cr>"
execute "nnoremap <silent> <buffer> [[ :call <SID>Python_jump('n', '". b:prev_toplevel."', 'Wb')<cr>"
execute "nnoremap <silent> <buffer> ]m :call <SID>Python_jump('n', '". b:next."', 'W')<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')
fun! <SID>Python_jump(mode, motion, flags) range
@ -56,8 +66,10 @@ if has("browsefilter") && !exists("b:browsefilter")
\ "All Files (*.*)\t*.*\n"
endif
if !exists("g:python_recommended_style") || g:python_recommended_style != 0
" As suggested by PEP8.
setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8
endif
" First time: try finding "pydoc".
if !exists('g:pydoc_executable')

View File

@ -28,12 +28,13 @@ if exists("loaded_matchit") && !exists("b:match_words")
\ ':' .
\ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' .
\ ':' .
\ '\<end\>' .
\ '\%(^\|[^.\:@$]\)\@<=\<end\:\@!\>' .
\ ',{:},\[:\],(:)'
let b:match_skip =
\ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" .
\ "\\<ruby\\%(String\\|StringDelimiter\\|ASCIICode\\|Escape\\|" .
\ "Regexp\\|RegexpDelimiter\\|" .
\ "Interpolation\\|NoInterpolation\\|Comment\\|Documentation\\|" .
\ "ConditionalModifier\\|RepeatModifier\\|OptionalDo\\|" .
\ "Function\\|BlockArgument\\|KeywordAsMethod\\|ClassVariable\\|" .
@ -43,7 +44,7 @@ endif
setlocal formatoptions-=t formatoptions+=croql
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
if exists("&ofu") && has("ruby")
@ -66,32 +67,32 @@ if !exists('g:ruby_version_paths')
let g:ruby_version_paths = {}
endif
function! s:query_path(root)
function! s:query_path(root) abort
let code = "print $:.join %q{,}"
if &shell =~# 'sh' && $PATH !~# '\s'
let prefix = 'env PATH='.$PATH.' '
if &shell =~# 'sh'
let prefix = 'env PATH='.shellescape($PATH).' '
else
let prefix = ''
endif
if &shellxquote == "'"
let path_check = prefix.'ruby -e "' . code . '"'
let path_check = prefix.'ruby --disable-gems -e "' . code . '"'
else
let path_check = prefix."ruby -e '" . code . "'"
let path_check = prefix."ruby --disable-gems -e '" . code . "'"
endif
let cd = haslocaldir() ? 'lcd' : 'cd'
let cwd = getcwd()
let cwd = fnameescape(getcwd())
try
exe cd fnameescape(a:root)
let path = split(system(path_check),',')
exe cd fnameescape(cwd)
exe cd cwd
return path
finally
exe cd fnameescape(cwd)
exe cd cwd
endtry
endfunction
function! s:build_path(path)
function! s:build_path(path) abort
let path = join(map(copy(a:path), 'v:val ==# "." ? "" : v:val'), ',')
if &g:path !~# '\v^\.%(,/%(usr|emx)/include)=,,$'
let path = substitute(&g:path,',,$',',','') . ',' . path
@ -101,7 +102,7 @@ endfunction
if !exists('b:ruby_version') && !exists('g:ruby_path') && isdirectory(expand('%:p:h'))
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), '')
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'))
@ -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"'),',')
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" .
\ "All Files (*.*)\t*.*\n"
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 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")
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','','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> [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> am :<C-U>call <SID>wrap_a('[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'"
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> aM :<C-U>call <SID>wrap_a('[[','][')<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'"
endif
if maparg("\<C-]>",'n') == ''
nnoremap <silent> <buffer> <C-]> :<C-U>exe v:count1."tag <C-R>=RubyCursorIdentifier()<CR>"<CR>
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
call s:map('c', '', '<C-R><C-W> <Plug><cword>')
call s:map('c', '', '<C-R><C-F> <Plug><cfile>')
if maparg("gf",'n') == ''
" By using findfile() rather than gf's normal behavior, we prevent
" erroneously editing a directory.
nnoremap <silent> <buffer> gf :<C-U>exe <SID>gf(v:count1,"gf",'edit')<CR>
nnoremap <silent> <buffer> <C-W>f :<C-U>exe <SID>gf(v:count1,"\<Lt>C-W>f",'split')<CR>
nnoremap <silent> <buffer> <C-W><C-F> :<C-U>exe <SID>gf(v:count1,"\<Lt>C-W>\<Lt>C-F>",'split')<CR>
nnoremap <silent> <buffer> <C-W>gf :<C-U>exe <SID>gf(v:count1,"\<Lt>C-W>gf",'tabedit')<CR>
let b:undo_ftplugin = b:undo_ftplugin
\."| 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'"
endif
cmap <buffer><script><expr> <SID>tagzv &foldopen =~# 'tag' ? '<Bar>norm! zv' : ''
call s:map('n', '<silent>', '<C-]> <SID>:exe v:count1."tag <Plug><cword>"<SID>tagzv<CR>')
call s:map('n', '<silent>', 'g<C-]> <SID>:exe "tjump <Plug><cword>"<SID>tagzv<CR>')
call s:map('n', '<silent>', 'g] <SID>:exe "tselect <Plug><cword>"<SID>tagzv<CR>')
call s:map('n', '<silent>', '<C-W>] <SID>:exe v:count1."stag <Plug><cword>"<SID>tagzv<CR>')
call s:map('n', '<silent>', '<C-W><C-]> <SID>:exe v:count1."stag <Plug><cword>"<SID>tagzv<CR>')
call s:map('n', '<silent>', '<C-W>g<C-]> <SID>:exe "stjump <Plug><cword>"<SID>tagzv<CR>')
call s:map('n', '<silent>', '<C-W>g] <SID>:exe "stselect <Plug><cword>"<SID>tagzv<CR>')
call s:map('n', '<silent>', '<C-W>} <SID>:exe v:count1."ptag <Plug><cword>"<CR>')
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
let &cpo = s:cpo_save
@ -225,7 +232,7 @@ if exists("g:did_ruby_ftplugin_functions")
endif
let g:did_ruby_ftplugin_functions = 1
function! RubyBalloonexpr()
function! RubyBalloonexpr() abort
if !exists('s:ri_found')
let s:ri_found = executable('ri')
endif
@ -274,13 +281,13 @@ function! RubyBalloonexpr()
endif
endfunction
function! s:searchsyn(pattern,syn,flags,mode)
function! s:searchsyn(pattern, syn, flags, mode) abort
let cnt = v:count1
norm! m'
if a:mode ==# 'v'
norm! gv
endif
let i = 0
let cnt = v:count ? v:count : 1
while i < cnt
let i = i + 1
let line = line('.')
@ -296,11 +303,11 @@ function! s:searchsyn(pattern,syn,flags,mode)
endwhile
endfunction
function! s:synname()
function! s:synname() abort
return synIDattr(synID(line('.'),col('.'),0),'name')
endfunction
function! s:wrap_i(back,forward)
function! s:wrap_i(back,forward) abort
execute 'norm k'.a:forward
let line = line('.')
execute 'norm '.a:back
@ -310,7 +317,7 @@ function! s:wrap_i(back,forward)
execute 'norm jV'.a:forward.'k'
endfunction
function! s:wrap_a(back,forward)
function! s:wrap_a(back,forward) abort
execute 'norm '.a:forward
if line('.') < line('$') && getline(line('.')+1) ==# ''
let after = 1
@ -328,37 +335,55 @@ function! s:wrap_a(back,forward)
endif
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 number = '\%(\%(\w\|[]})\"'."'".']\s*\)\@<!-\)\=\%(\<[[:digit:]_]\+\%(\.[[:digit:]_]\+\)\=\%([Ee][[:digit:]_]\+\)\=\>\|\<0[xXbBoOdD][[:xdigit:]_]\+\>\)\|'.asciicode
let operator = '\%(\[\]\|<<\|<=>\|[!<>]=\=\|===\=\|[!=]\~\|>>\|\*\*\|\.\.\.\=\|=>\|[~^&|*/%+-]\)'
let method = '\%(\<[_a-zA-Z]\w*\>\%([?!]\|\s*=>\@!\)\=\)'
let method = '\%(\.[_a-zA-Z]\w*\s*=>\@!\|\<[_a-zA-Z]\w*\>[?!]\=\)'
let global = '$\%([!$&"'."'".'*+,./:;<=>?@\`~]\|-\=\w\+\>\)'
let symbolizable = '\%(\%(@@\=\)\w\+\>\|'.global.'\|'.method.'\|'.operator.'\)'
let pattern = '\C\s*\%('.number.'\|\%(:\@<!:\)\='.symbolizable.'\)'
let [lnum, col] = searchpos(pattern,'bcn',line('.'))
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
endfunction
function! s:gf(count,map,edit) abort
if getline('.') =~# '^\s*require_relative\s*\(["'']\).*\1\s*$'
let target = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1')
return a:edit.' %:h/'.target.'.rb'
elseif getline('.') =~# '^\s*\%(require[( ]\|load[( ]\|autoload[( ]:\w\+,\)\s*\s*\%(::\)\=File\.expand_path(\(["'']\)\.\./.*\1,\s*__FILE__)\s*$'
let target = matchstr(getline('.'),'\(["'']\)\.\./\zs.\{-\}\ze\1')
return a:edit.' %:h/'.target.'.rb'
function! RubyCursorFile() abort
let isfname = &isfname
try
set isfname+=:
let cfile = expand('<cfile>')
finally
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*$'
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
let target = expand('<cfile>')
return substitute(cfile, '\C\v^(.*):(\d+)%(:in)=$', '+\2 \1', '')
endif
let found = findfile(target, &path, a:count)
if found ==# ''
return 'norm! '.a:count.a:map
let cwdpat = '^\M' . substitute(getcwd(), '[\/]', '\\[\\/]', 'g').'\ze\[\/]'
let cfile = substitute(cfile, cwdpat, '.', '')
if fnameescape(cfile) !=# cfile
return '+ '.fnameescape(cfile)
else
return a:edit.' '.fnameescape(found)
return cfile
endif
endfunction

View File

@ -1,7 +1,7 @@
" Vim filetype plugin
" Language: Sass
" 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
if exists("b:did_ftplugin")
@ -9,8 +9,9 @@ if exists("b:did_ftplugin")
endif
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 define=^\\s*\\%(@mixin\\\|=\\)
setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','')

View File

@ -32,6 +32,4 @@ setlocal includeexpr='substitute(v:fname,"\\.","/","g")'
setlocal path+=src/main/scala,src/test/scala
setlocal suffixesadd=.scala
compiler sbt
" vim:set sw=2 sts=2 ts=8 et:

View File

@ -1,12 +1,13 @@
" Vim filetype plugin
" Language: SCSS
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2010 Jul 26
" Last Change: 2016 Aug 29
if exists("b:did_ftplugin")
finish
endif
runtime! ftplugin/sass.vim
setlocal comments=s1:/*,mb:*,ex:*/,://
" vim:set sw=2:

View File

@ -16,7 +16,7 @@ if exists("*CdlGetIndent")
"finish
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
fun! CdlAsignment(lnum, line)
let f = -1

View File

@ -1,7 +1,7 @@
" Vim indent file
" Language: Cucumber
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2013 May 30
" Last Change: 2016 Aug 29
if exists("b:did_indent")
finish
@ -27,6 +27,7 @@ function! GetCucumberIndent()
let line = getline(prevnonblank(v:lnum-1))
let cline = getline(v:lnum)
let nline = getline(nextnonblank(v:lnum+1))
let sw = exists('*shiftwidth') ? shiftwidth() : &sw
let syn = s:syn(prevnonblank(v:lnum-1))
let csyn = s:syn(v:lnum)
let nsyn = s:syn(nextnonblank(v:lnum+1))
@ -35,38 +36,38 @@ function! GetCucumberIndent()
return 0
elseif csyn ==# 'cucumberExamples' || cline =~# '^\s*\%(Examples\|Scenarios\):'
" examples heading
return 2 * &sw
return 2 * sw
elseif csyn =~# '^cucumber\%(Background\|Scenario\|ScenarioOutline\)$' || cline =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):'
" background, scenario or outline heading
return &sw
return sw
elseif syn ==# 'cucumberFeature' || line =~# '^\s*Feature:'
" line after feature heading
return &sw
return sw
elseif syn ==# 'cucumberExamples' || line =~# '^\s*\%(Examples\|Scenarios\):'
" line after examples heading
return 3 * &sw
return 3 * sw
elseif syn =~# '^cucumber\%(Background\|Scenario\|ScenarioOutline\)$' || line =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):'
" 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)
" tag or comment before a feature heading
return 0
elseif cline =~# '^\s*@'
" other tags
return &sw
return sw
elseif cline =~# '^\s*[#|]' && line =~# '^\s*|'
" mid-table
" preserve indent
return indent(prevnonblank(v:lnum-1))
elseif cline =~# '^\s*|' && line =~# '^\s*[^|]'
" 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*|'
" 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\):')
" comments on scenarios
return &sw
return sw
endif
return indent(prevnonblank(v:lnum-1))
endfunction

View File

@ -19,6 +19,9 @@ else
endif
unlet! b:did_indent
" Force HTML indent to not keep state.
let b:html_indent_usestate = 0
if &l:indentexpr == ''
if &l:cindent
let &l:indentexpr = 'cindent(v:lnum)'
@ -38,7 +41,18 @@ if exists("*GetErubyIndent")
finish
endif
" this file uses line continuations
let s:cpo_sav = &cpo
set cpo&vim
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 == '.'
let v:lnum = line('.')
elseif a:0 && a:1 =~ '^\d'
@ -52,31 +66,44 @@ function! GetErubyIndent(...)
let ind = GetRubyIndent(v:lnum)
else
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
let lnum = prevnonblank(v:lnum-1)
let line = getline(lnum)
let cline = getline(v:lnum)
if cline =~# '^\s*<%[-=]\=\s*\%(}\|end\|else\|\%(ensure\|rescue\|elsif\|when\).\{-\}\)\s*\%([-=]\=%>\|$\)'
let ind = ind - &sw
let ind = ind - sw
endif
if line =~# '\S\s*<%[-=]\=\s*\%(}\|end\).\{-\}\s*\%([-=]\=%>\|$\)'
let ind = ind - &sw
let ind = ind - sw
endif
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\)\>.*%>'
let ind = ind + &sw
let ind = ind + sw
endif
if line =~# '^\s*<%[=#-]\=\s*$' && cline !~# '^\s*end\>'
let ind = ind + &sw
let ind = ind + sw
endif
if line !~# '^\s*<%' && line =~# '%>\s*$'
let ind = ind - &sw
if line !~# '^\s*<%' && line =~# '%>\s*$' && line !~# '^\s*end\>'
let ind = ind - sw
endif
if cline =~# '^\s*[-=]\=%>\s*$'
let ind = ind - &sw
let ind = ind - sw
endif
return ind
endfunction
let &cpo = s:cpo_sav
unlet! s:cpo_sav
" vim:set sw=2 sts=2 ts=8 noet:

View File

@ -1,11 +1,12 @@
" Vim indent file
" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77)
" Version: 0.45
" Last Change: 2016 Aug. 18
" Version: 0.46
" Last Change: 2016 Sep. 27
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
" Usage: For instructions, do :help fortran-indent from Vim
" 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.
if exists("b:did_indent")
@ -121,7 +122,8 @@ function FortranGetIndent(lnum)
let prefix='\(\(pure\|impure\|elemental\|recursive\)\s\+\)\{,2}'
let type='\(\(integer\|real\|double\s\+precision\|complex\|logical'
\.'\|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.type.'function\>'
\ ||prevstat =~? '^\s*'.type.prefix.'function\>'
@ -129,7 +131,7 @@ function FortranGetIndent(lnum)
endif
if getline(v:lnum) =~? '^\s*contains\>'
\ ||getline(v:lnum)=~? '^\s*end\s*'
\ .'\(function\|subroutine\|module\/submodule\|program\)\>'
\ .'\(function\|subroutine\|module\|submodule\|program\)\>'
let ind = ind - shiftwidth()
endif
endif
@ -152,9 +154,6 @@ function FortranGetIndent(lnum)
if prevstat =~ '&\s*$' && prev2stat !~ '&\s*$'
let ind = ind + shiftwidth()
endif
if prevstat =~ '&\s*$' && prevstat =~ '\<else\s*if\>'
let ind = ind - shiftwidth()
endif
"Line after last continuation line
if prevstat !~ '&\s*$' && prev2stat =~ '&\s*$' && prevstat !~? '\<then\>'
let ind = ind - shiftwidth()

View File

@ -1,7 +1,7 @@
" Vim indent file
" Language: git config file
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2013 May 30
" Last Change: 2016 Aug 29
if exists("b:did_indent")
finish
@ -20,17 +20,18 @@ if exists("*GetGitconfigIndent")
endif
function! GetGitconfigIndent()
let sw = exists('*shiftwidth') ? shiftwidth() : &sw
let line = getline(prevnonblank(v:lnum-1))
let cline = getline(v:lnum)
if line =~ '\\\@<!\%(\\\\\)*\\$'
" odd number of slashes, in a line continuation
return 2 * &sw
return 2 * sw
elseif cline =~ '^\s*\['
return 0
elseif cline =~ '^\s*\a'
return &sw
return sw
elseif cline == '' && line =~ '^\['
return &sw
return sw
else
return -1
endif

View File

@ -1,7 +1,7 @@
" Vim indent file
" Language: Haml
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2013 May 30
" Last Change: 2016 Aug 29
if exists("b:did_indent")
finish
@ -37,10 +37,11 @@ function! GetHamlIndent()
let line = substitute(line,'^\s\+','','')
let indent = indent(lnum)
let cindent = indent(v:lnum)
let sw = exists('*shiftwidth') ? shiftwidth() : &sw
if cline =~# '\v^-\s*%(elsif|else|when)>'
let indent = cindent < indent ? cindent : indent - &sw
let indent = cindent < indent ? cindent : indent - sw
endif
let increase = indent + &sw
let increase = indent + sw
if indent == indent(lnum)
let indent = cindent <= indent ? -1 : increase
endif

View File

@ -749,7 +749,7 @@ func! s:CssPrevNonComment(lnum, stopline)
while 1
let ccol = match(getline(lnum), '\*/')
if ccol < 0
" No comment end thus its something else.
" No comment end thus it's something else.
return lnum
endif
call cursor(lnum, ccol + 1)

View File

@ -1,7 +1,7 @@
" Vim indent file
" Language: Liquid
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2013 May 30
" Last Change: 2016 Aug 29
if exists('b:did_indent')
finish
@ -54,9 +54,10 @@ function! GetLiquidIndent(...)
let line = substitute(line,'\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 ind += &sw * s:count(line,'{%\s*\%(if\|elsif\|else\|unless\|ifchanged\|case\|when\|for\|empty\|tablerow\|capture\)\>')
let ind -= &sw * s:count(line,'{%\s*end\%(if\|unless\|ifchanged\|case\|for\|tablerow\|capture\)\>')
let ind -= &sw * s:count(cline,'{%\s*\%(elsif\|else\|when\|empty\)\>')
let ind -= &sw * s:count(cline,'{%\s*end\w*$')
let sw = exists('*shiftwidth') ? shiftwidth() : &sw
let ind += sw * s:count(line,'{%\s*\%(if\|elsif\|else\|unless\|ifchanged\|case\|when\|for\|empty\|tablerow\|capture\)\>')
let ind -= sw * s:count(line,'{%\s*end\%(if\|unless\|ifchanged\|case\|for\|tablerow\|capture\)\>')
let ind -= sw * s:count(cline,'{%\s*\%(elsif\|else\|when\|empty\)\>')
let ind -= sw * s:count(cline,'{%\s*end\w*$')
return ind
endfunction

6
runtime/indent/mf.vim Normal file
View 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

View File

@ -1,56 +1,19 @@
" MetaPost indent file
" Language: MetaPost
" Maintainer: Eugene Minkovskii <emin@mccme.ru>
" Last Change: 2012 May 18
" Version: 0.1
" ==========================================================================
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
" Former Maintainers: Eugene Minkovskii <emin@mccme.ru>
" 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")
finish
endif
let b:did_indent = 1
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.
if exists("*GetMetaPostIndent")
@ -59,151 +22,337 @@ endif
let s:keepcpo= &cpo
set cpo&vim
" Auxiliary Definitions: {{{1
function! MetaNextNonblankNoncomment(pos)
" Like nextnonblank() but ignore comment lines
let tmp = nextnonblank(a:pos)
while tmp && getline(tmp) =~ '^\s*%'
let tmp = nextnonblank(tmp+1)
function GetMetaPostIndent()
let ignorecase_save = &ignorecase
try
let &ignorecase = 0
return GetMetaPostIndentIntern()
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
return tmp
return in_string || (c >= 0 && c <= a:pos)
endfunction
function! MetaPrevNonblankNoncomment(pos)
" Like prevnonblank() but ignore comment lines
let tmp = prevnonblank(a:pos)
while tmp && getline(tmp) =~ '^\s*%'
let tmp = prevnonblank(tmp-1)
" Find the first non-comment non-blank line before the current line.
function! s:PrevNonBlankNonComment(lnum)
let l:lnum = prevnonblank(a:lnum - 1)
while getline(l:lnum) =~# '^\s*%'
let l:lnum = prevnonblank(l:lnum - 1)
endwhile
return tmp
return l:lnum
endfunction
function! MetaSearchNoncomment(pattern, ...)
" Like search() but ignore commented areas
if a:0
let flags = a:1
elseif &wrapscan
let flags = "w"
else
let flags = "W"
endif
let cl = line(".")
let cc = col(".")
let tmp = search(a:pattern, flags)
while tmp && synIDattr(synID(line("."), col("."), 1), "name") =~
\ 'm[fp]\(Comment\|TeXinsert\|String\)'
let tmp = search(a:pattern, flags)
" Returns true if the last tag appearing in the line is an open tag; returns
" false otherwise.
function! s:LastTagIsOpen(line)
let o = s:LastValidMatchEnd(a:line, g:mp_open_tag, 0)
if o == - 1 | return v:false | endif
return s:LastValidMatchEnd(a:line, g:mp_close_tag, o) < 0
endfunction
" A simple, efficient and quite effective heuristics is used to test whether
" a line should cause the next line to be indented: count the "opening tags"
" (if, for, def, ...) in the line, count the "closing tags" (endif, endfor,
" ...) in the line, and compute the difference. We call the result the
" "weight" of the line. If the weight is positive, then the next line should
" most likely be indented. Note that `else` and `elseif` are both opening and
" 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
if !tmp
call cursor(cl,cc)
let [c, i] = [0, matchend(a:line, '^\s*\<else\%[if]\>')] " Skip a leading else[if]
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
return tmp
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
return a:curr_indent
endfunction
" }}}
function! GetMetaPostIndent()
" not indent in comment ???
if synIDattr(synID(line("."), col("."), 1), "name") =~
\ 'm[fp]\(Comment\|TeXinsert\|String\)'
" Main function {{{
"
" Note: Every rule of indentation in MetaPost is very subjective. We might get
" 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
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
endfunction
" 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
" }}}
let &cpo = s:keepcpo
unlet s:keepcpo

View File

@ -13,12 +13,23 @@ if exists("b:did_indent")
endif
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
" Now, set up our indentation expression and keys that trigger it.
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+==private,=protected,=public
" Only define the function once.
if exists("*GetRubyIndent")
@ -34,7 +45,7 @@ set cpo&vim
" Regex of syntax group names that are or delimit strings/symbols or are comments.
let s:syng_strcom = '\<ruby\%(Regexp\|RegexpDelimiter\|RegexpEscape' .
\ '\|Symbol\|String\|StringDelimiter\|StringEscape\|ASCIICode' .
\ '\|Interpolation\|NoInterpolation\|Comment\|Documentation\)\>'
\ '\|Interpolation\|InterpolationDelimiter\|NoInterpolation\|Comment\|Documentation\)\>'
" Regex of syntax group names that are strings.
let s:syng_string =
@ -49,9 +60,10 @@ let s:skip_expr =
\ "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.
let s:ruby_indent_keywords = '^\s*\zs\<\%(module\|class\|def\|if\|for' .
\ '\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure' .
\ '\|rescue\):\@!\>' .
let s:ruby_indent_keywords =
\ '^\s*\zs\<\%(module\|class\|if\|for' .
\ '\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue' .
\ '\|\%(public\|protected\|private\)\=\s*def\):\@!\>' .
\ '\|\%([=,*/%+-]\|<<\|>>\|:\s\)\s*\zs' .
\ '\<\%(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)?
let s:end_start_regex =
\ '\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:\@!\>'
" 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\\):\\@!\\>")'
" 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.
" TODO: this needs to deal with if ...: and so on
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
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
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.
"
" 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.
"
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
" Regex that describes a leading operator (only a method call's dot for now)
let s:leading_operator_regex = '^\s*[.]'
" 2. Auxiliary Functions {{{1
" ======================
@ -165,7 +201,21 @@ function s:GetMSL(lnum)
" Otherwise, terminate search as we have found our MSL already.
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
" indentation.
"
@ -175,7 +225,7 @@ function s:GetMSL(lnum)
" something
"
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)
" If the current line is a non-bracket continuation and so is the
" previous one, keep its indent and continue looking for an MSL.
@ -186,6 +236,18 @@ function s:GetMSL(lnum)
" three
"
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) &&
\ (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
@ -299,18 +361,39 @@ function s:ExtraBrackets(lnum)
endfunction
function s:Match(lnum, regex)
let col = match(getline(a:lnum), '\C'.a:regex) + 1
return col > 0 && !s:IsInStringOrComment(a:lnum, col) ? col : 0
let line = getline(a:lnum)
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
function s:MatchLast(lnum, regex)
let line = getline(a:lnum)
let col = match(line, '.*\zs' . a:regex)
while col != -1 && s:IsInStringOrComment(a:lnum, col)
let line = strpart(line, 0, col)
let col = match(line, '.*' . a:regex)
" Locates the containing class/module's definition line, ignoring nested classes
" along the way.
"
function! s:FindContainingClass()
let saved_position = getpos('.')
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
return col + 1
call setpos('.', saved_position)
return 0
endfunction
" 3. GetRubyIndent Function {{{1
@ -320,6 +403,13 @@ function GetRubyIndent(...)
" 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
let clnum = a:0 ? a:1 : v:lnum
@ -333,6 +423,24 @@ function GetRubyIndent(...)
let line = getline(clnum)
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
" 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.
@ -343,7 +451,9 @@ function GetRubyIndent(...)
if searchpair(escape(bs[0], '\['), '', bs[1], 'bW', s:skip_expr) > 0
if line[col-1]==')' && col('.') != col('$') - 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('.')))
endif
endif
@ -366,10 +476,17 @@ function GetRubyIndent(...)
if strpart(line, 0, col('.') - 1) =~ '=\s*$' &&
\ strpart(line, col('.') - 1, 2) !~ 'do'
" assignment to case/begin/etc, on the same line, hanging indent
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*\(#.*\)\=$'
" in the case of assignment to the MSL, align to the starting line,
" not to the MSL
let ind = indent(line('.'))
else
" align to the MSL
let ind = indent(msl)
endif
endif
@ -389,6 +506,11 @@ function GetRubyIndent(...)
return 0
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
" -------------------------------
@ -409,14 +531,50 @@ function GetRubyIndent(...)
let line = getline(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 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
" If the previous line ended with the "*" of a splat, add a level of indent
if line =~ s:splat_regex
return indent(lnum) + &sw
return indent(lnum) + sw
endif
" If the previous line contained unclosed opening brackets and we are still
@ -431,22 +589,22 @@ function GetRubyIndent(...)
if opening.pos != -1
if opening.type == '(' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
if col('.') + 1 == col('$')
return ind + &sw
return ind + sw
else
return virtcol('.')
endif
else
let nonspace = matchend(line, '\S', opening.pos + 1) - 1
return nonspace > 0 ? nonspace : ind + &sw
return nonspace > 0 ? nonspace : ind + sw
endif
elseif closing.pos != -1
call cursor(lnum, closing.pos + 1)
normal! %
if s:Match(line('.'), s:ruby_indent_keywords)
return indent('.') + &sw
return indent('.') + sw
else
return indent('.')
return indent(s:GetMSL(line('.')))
endif
else
call cursor(clnum, vcol)
@ -473,7 +631,7 @@ function GetRubyIndent(...)
let col = s:Match(lnum, s:ruby_indent_keywords)
if col > 0
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
" fails, we know that something is lacking an end and thus we indent a
" level
@ -490,10 +648,14 @@ function GetRubyIndent(...)
let p_lnum = lnum
let lnum = s:GetMSL(lnum)
" If the previous line wasn't a MSL and is continuation return its indent.
" TODO: the || s:IsInString() thing worries me a bit.
" If the previous line wasn't a MSL.
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
endif
endif
@ -506,9 +668,9 @@ function GetRubyIndent(...)
" TODO: this does not take into account contrived things such as
" module Foo; class Bar; end
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)
let ind = ind - &sw
let ind = ind - sw
endif
return ind
endif
@ -517,7 +679,7 @@ function GetRubyIndent(...)
" closing bracket, indent one extra level.
if s:Match(lnum, s:non_bracket_continuation_regex) && !s:Match(lnum, '^\s*\([\])}]\|end\)')
if lnum == p_lnum
let ind = msl_ind + &sw
let ind = msl_ind + sw
else
let ind = msl_ind
endif

View File

@ -1,7 +1,7 @@
" Vim indent file
" Language: Sass
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2013 May 30
" Last Change: 2016 Aug 29
if exists("b:did_indent")
finish
@ -29,9 +29,7 @@ function! GetSassIndent()
let indent = indent(lnum)
let cindent = indent(v:lnum)
if line !~ s:property && line !~ s:extend && cline =~ s:property
return indent + &sw
"elseif line =~ s:property && cline !~ s:property
"return indent - &sw
return indent + (exists('*shiftwidth') ? shiftwidth() : &sw)
else
return -1
endif

View File

@ -347,7 +347,7 @@ fun! vimball#Vimball(really,...)
" call Decho("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.">")
if a:really && didhelp == "" && fname =~ 'doc/[^/]\+\.\(txt\|..x\)$'
let didhelp= substitute(fname,'^\(.*\<doc\)[/\\][^.]*\.\(txt\|..x\)$','\1','')

View File

@ -1,9 +1,9 @@
" zipPlugin.vim: Handles browsing zipfiles
" PLUGIN PORTION
" Date: Jun 07, 2013
" Date: Sep 13, 2016
" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
" 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,
" with or without modifications, provided that this copyright
" notice is copied with it. Like anything else that's free,
@ -20,14 +20,14 @@
if &cp || exists("g:loaded_zipPlugin")
finish
endif
let g:loaded_zipPlugin = "v27"
let g:loaded_zipPlugin = "v28"
let s:keepcpo = &cpo
set cpo&vim
" ---------------------------------------------------------------------
" Options: {{{1
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
" ---------------------------------------------------------------------

View File

@ -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.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.355 &Syntax.AB.Assembly.AVR :cal SetSyn("avra")<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.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.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.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.DSSSL :cal SetSyn("dsl")<CR>
an 50.30.350 &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.DTrace :cal SetSyn("dtrace")<CR>
an 50.30.380 &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\ interface :cal SetSyn("dylanintr")<CR>
an 50.30.410 &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.Eiffel :cal SetSyn("eiffel")<CR>
an 50.30.450 &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.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.ESMTP\ rc :cal SetSyn("esmtprc")<CR>
an 50.30.500 &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.Esterel :cal SetSyn("esterel")<CR>
an 50.30.530 &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.Exim\ conf :cal SetSyn("exim")<CR>
an 50.30.560 &Syntax.DE.Expect :cal SetSyn("expect")<CR>
an 50.30.570 &Syntax.DE.Exports :cal SetSyn("exports")<CR>
an 50.30.330 &Syntax.DE.Doxygen.DataScript\ with\ doxygen :cal SetSyn("datascript.doxygen")<CR>
an 50.30.340 &Syntax.DE.Dracula :cal SetSyn("dracula")<CR>
an 50.30.350 &Syntax.DE.DSSSL :cal SetSyn("dsl")<CR>
an 50.30.360 &Syntax.DE.DTD :cal SetSyn("dtd")<CR>
an 50.30.370 &Syntax.DE.DTML\ (Zope) :cal SetSyn("dtml")<CR>
an 50.30.380 &Syntax.DE.DTrace :cal SetSyn("dtrace")<CR>
an 50.30.390 &Syntax.DE.Dts/dtsi :cal SetSyn("dts")<CR>
an 50.30.400 &Syntax.DE.Dylan.Dylan :cal SetSyn("dylan")<CR>
an 50.30.410 &Syntax.DE.Dylan.Dylan\ interface :cal SetSyn("dylanintr")<CR>
an 50.30.420 &Syntax.DE.Dylan.Dylan\ lid :cal SetSyn("dylanlid")<CR>
an 50.30.440 &Syntax.DE.EDIF :cal SetSyn("edif")<CR>
an 50.30.450 &Syntax.DE.Eiffel :cal SetSyn("eiffel")<CR>
an 50.30.460 &Syntax.DE.Elinks\ config :cal SetSyn("elinks")<CR>
an 50.30.470 &Syntax.DE.Elm\ filter\ rules :cal SetSyn("elmfilt")<CR>
an 50.30.480 &Syntax.DE.Embedix\ Component\ Description :cal SetSyn("ecd")<CR>
an 50.30.490 &Syntax.DE.ERicsson\ LANGuage :cal SetSyn("erlang")<CR>
an 50.30.500 &Syntax.DE.ESMTP\ rc :cal SetSyn("esmtprc")<CR>
an 50.30.510 &Syntax.DE.ESQL-C :cal SetSyn("esqlc")<CR>
an 50.30.520 &Syntax.DE.Essbase\ script :cal SetSyn("csc")<CR>
an 50.30.530 &Syntax.DE.Esterel :cal SetSyn("esterel")<CR>
an 50.30.540 &Syntax.DE.Eterm\ config :cal SetSyn("eterm")<CR>
an 50.30.550 &Syntax.DE.Eviews :cal SetSyn("eviews")<CR>
an 50.30.560 &Syntax.DE.Exim\ conf :cal SetSyn("exim")<CR>
an 50.30.570 &Syntax.DE.Expect :cal SetSyn("expect")<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.110 &Syntax.FG.Fantom :cal SetSyn("fan")<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.290 &Syntax.M.MetaPost :cal SetSyn("mp")<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.320 &Syntax.M.Modconf :cal SetSyn("modconf")<CR>
an 50.70.330 &Syntax.M.Model :cal SetSyn("model")<CR>

View File

@ -1,13 +1,10 @@
" Vim syntax file
" Language: xa 6502 cross assembler
" Maintainer: Clemens Kirchgatterer <clemens@1541.org>
" Last Change: 2014 Jan 05
" Last Change: 2016 Aug 31
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -138,29 +135,19 @@ syn match a65End excludenl /end$/ contained
syn match a65Continue "\\$" contained
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_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
" Only when an item doesn't have highlighting yet
HiLink a65Section Special
HiLink a65Address Special
HiLink a65Comment Comment
HiLink a65PreProc PreProc
HiLink a65Number Number
HiLink a65String String
HiLink a65Type Statement
HiLink a65Opcode Type
HiLink a65PC Error
HiLink a65Todo Todo
HiLink a65HiLo Number
hi def link a65Section Special
hi def link a65Address Special
hi def link a65Comment Comment
hi def link a65PreProc PreProc
hi def link a65Number Number
hi def link a65String String
hi def link a65Type Statement
hi def link a65Opcode Type
hi def link a65PC Error
hi def link a65Todo Todo
hi def link a65HiLo Number
delcommand HiLink
endif
let b:current_syntax = "a65"

View File

@ -5,11 +5,8 @@
" Last Change: 2013 Jun 13
" Comment: Thanks to EPI-USE Labs for all your assistance. :)
" For version < 6.0: Clear all syntax items
" For version >= 6.0: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -43,11 +40,7 @@ syn match abapStringEscape contained "``"
syn match abapNumber "\-\=\<\d\+\>"
syn region abapHex matchgroup=abapHex start="X'" end="'"
if version >= 600
setlocal iskeyword=48-57,_,A-Z,a-z,/
else
set iskeyword=48-57,_,A-Z,a-z,/
endif
syn match abapNamespace "\</\w\+/"
@ -175,38 +168,28 @@ syn keyword abapTodo contained TODO NOTE
syn match abapTodo "\#EC\W\+\w\+"
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_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
" Only when an item doesn't have highlighting yet
HiLink abapError Error
HiLink abapComment Comment
HiLink abapInclude Include
HiLink abapStatement Statement
HiLink abapComplexStatement Statement
HiLink abapSpecial Special
HiLink abapNamespace Special
HiLink abapSpecialTables Special
HiLink abapSymbolOperator abapOperator
HiLink abapOperator Operator
HiLink abapCharString String
HiLink abapString String
HiLink abapFloat Float
HiLink abapTypes Type
HiLink abapSymbol Structure
HiLink abapStructure Structure
HiLink abapField Variable
HiLink abapNumber Number
HiLink abapHex Number
hi def link abapError Error
hi def link abapComment Comment
hi def link abapInclude Include
hi def link abapStatement Statement
hi def link abapComplexStatement Statement
hi def link abapSpecial Special
hi def link abapNamespace Special
hi def link abapSpecialTables Special
hi def link abapSymbolOperator abapOperator
hi def link abapOperator Operator
hi def link abapCharString String
hi def link abapString String
hi def link abapFloat Float
hi def link abapTypes Type
hi def link abapSymbol Structure
hi def link abapStructure Structure
hi def link abapField Variable
hi def link abapNumber Number
hi def link abapHex Number
delcommand HiLink
endif
let b:current_syntax = "abap"

View File

@ -4,11 +4,8 @@
" Last Change: 2002 Feb 24
" Remark: Huge improvement in folding performance--see filetype plugin
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -25,24 +22,14 @@ syn match abaqusValue "=\s*[^,]*"lc=1 contained display
syn match abaqusBadLine "^\s\+\*.*" display
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_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
" Only when an item doesn't have highlighting yet
" The default methods for highlighting. Can be overridden later
HiLink abaqusComment Comment
HiLink abaqusKeyword Statement
HiLink abaqusParameter Identifier
HiLink abaqusValue Constant
HiLink abaqusBadLine Error
hi def link abaqusComment Comment
hi def link abaqusKeyword Statement
hi def link abaqusParameter Identifier
hi def link abaqusValue Constant
hi def link abaqusBadLine Error
delcommand HiLink
endif
let b:current_syntax = "abaqus"

View File

@ -4,11 +4,8 @@
" URL: http://perun.hscs.wmin.ac.uk/~jra/vim/syntax/abc.vim
" Last Change: 27th April 2001
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -36,28 +33,18 @@ syn match abcComment "%.*$"
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_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
" Only when an item doesn't have highlighting yet
HiLink abcComment Comment
HiLink abcHeadField Type
HiLink abcBodyField Special
HiLink abcBar Statement
HiLink abcTuple Statement
HiLink abcBroken Statement
HiLink abcTie Statement
HiLink abcGuitarChord Identifier
HiLink abcNote Constant
hi def link abcComment Comment
hi def link abcHeadField Type
hi def link abcBodyField Special
hi def link abcBar Statement
hi def link abcTuple Statement
hi def link abcBroken Statement
hi def link abcTie Statement
hi def link abcGuitarChord Identifier
hi def link abcNote Constant
delcommand HiLink
endif
let b:current_syntax = "abc"

View File

@ -3,11 +3,8 @@
" Maintainer: John Cook <johncook3@gmail.com>
" Last Change: 2011 Dec 27
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -123,48 +120,38 @@ endif
syn sync minlines=1
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_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
" Only when an item doesn't have highlighting yet
" The default highlighting.
HiLink abelHeader abelStatement
HiLink abelSection abelStatement
HiLink abelDeclaration abelStatement
HiLink abelLogicalOperator abelOperator
HiLink abelRangeOperator abelOperator
HiLink abelAlternateOperator abelOperator
HiLink abelArithmeticOperator abelOperator
HiLink abelRelationalOperator abelOperator
HiLink abelAssignmentOperator abelOperator
HiLink abelTruthTableOperator abelOperator
HiLink abelSpecifier abelStatement
HiLink abelOperator abelStatement
HiLink abelStatement Statement
HiLink abelIdentifier Identifier
HiLink abelTypeId abelType
HiLink abelTypeIdChar abelType
HiLink abelType Type
HiLink abelNumber abelString
HiLink abelString String
HiLink abelConstant Constant
HiLink abelComment Comment
HiLink abelExtension abelSpecial
HiLink abelSpecialChar abelSpecial
HiLink abelTypeIdEnd abelSpecial
HiLink abelSpecial Special
HiLink abelDirective PreProc
HiLink abelTodo Todo
HiLink abelError Error
hi def link abelHeader abelStatement
hi def link abelSection abelStatement
hi def link abelDeclaration abelStatement
hi def link abelLogicalOperator abelOperator
hi def link abelRangeOperator abelOperator
hi def link abelAlternateOperator abelOperator
hi def link abelArithmeticOperator abelOperator
hi def link abelRelationalOperator abelOperator
hi def link abelAssignmentOperator abelOperator
hi def link abelTruthTableOperator abelOperator
hi def link abelSpecifier abelStatement
hi def link abelOperator abelStatement
hi def link abelStatement Statement
hi def link abelIdentifier Identifier
hi def link abelTypeId abelType
hi def link abelTypeIdChar abelType
hi def link abelType Type
hi def link abelNumber abelString
hi def link abelString String
hi def link abelConstant Constant
hi def link abelComment Comment
hi def link abelExtension abelSpecial
hi def link abelSpecialChar abelSpecial
hi def link abelTypeIdEnd abelSpecial
hi def link abelSpecial Special
hi def link abelDirective PreProc
hi def link abelTodo Todo
hi def link abelError Error
delcommand HiLink
endif
let b:current_syntax = "abel"

View File

@ -7,11 +7,8 @@
" Syntax file to handle all $ACEDB/wspec/*.wrm files, primarily models.wrm
" AceDB software is available from http://www.acedb.org
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -86,35 +83,25 @@ syn region acedbString start=/"/ end=/"/ skip=/\\"/ oneline
" Rest of syntax highlighting rules start here
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_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
" Only when an item doesn't have highlighting yet
HiLink acedbMagic Special
HiLink acedbHyb Special
HiLink acedbType Type
HiLink acedbOption Type
HiLink acedbSubclass Type
HiLink acedbSubtag Include
HiLink acedbFlag Include
HiLink acedbTag Include
HiLink acedbClass Todo
HiLink acedbHelp Todo
HiLink acedbXref Identifier
HiLink acedbModifier Label
HiLink acedbComment Comment
HiLink acedbBlock ModeMsg
HiLink acedbNumber Number
HiLink acedbString String
hi def link acedbMagic Special
hi def link acedbHyb Special
hi def link acedbType Type
hi def link acedbOption Type
hi def link acedbSubclass Type
hi def link acedbSubtag Include
hi def link acedbFlag Include
hi def link acedbTag Include
hi def link acedbClass Todo
hi def link acedbHelp Todo
hi def link acedbXref Identifier
hi def link acedbModifier Label
hi def link acedbComment Comment
hi def link acedbBlock ModeMsg
hi def link acedbNumber Number
hi def link acedbString String
delcommand HiLink
endif
let b:current_syntax = "acedb"

View File

@ -7,21 +7,14 @@
" Comment: Replaced sourcing c.vim file by ada.vim and rename lex*
" in aflex*
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
" Read the Ada syntax to start with
if version < 600
so <sfile>:p:h/ada.vim
else
runtime! syntax/ada.vim
unlet b:current_syntax
endif
" --- AfLex stuff ---
@ -69,31 +62,20 @@ syn sync match aflexSyncPat groupthere aflexPatBlock "^<$"
syn sync match aflexSyncPat groupthere aflexPatBlock "^%%$"
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
" 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")
if version < 508
let did_aflex_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink aflexSlashQuote aflexPat
HiLink aflexBrace aflexPat
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
hi def link aflexAbbrv SpecialChar
hi def link aflexAbbrvRegExp Macro
hi def link aflexCFunctions Function
hi def link aflexMorePat SpecialChar
hi def link aflexPat Function
hi def link aflexPatComment Comment
hi def link aflexPatString Function
hi def link aflexPatTag Special
hi def link aflexSep Delimiter
let b:current_syntax = "aflex"

View File

@ -3,11 +3,8 @@
" Maintainer: John Cook <john.cook@kla-tencor.com>
" Last Change: 2001 Apr 25
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -66,29 +63,19 @@ syn match ahdlSpecialChar "[\[\]().,;]"
syn sync minlines=1
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_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
" Only when an item doesn't have highlighting yet
" The default highlighting.
HiLink ahdlNumber ahdlString
HiLink ahdlMegafunction ahdlIdentifier
HiLink ahdlSpecialChar SpecialChar
HiLink ahdlKeyword Statement
HiLink ahdlString String
HiLink ahdlComment Comment
HiLink ahdlIdentifier Identifier
HiLink ahdlOperator Operator
HiLink ahdlTodo Todo
hi def link ahdlNumber ahdlString
hi def link ahdlMegafunction ahdlIdentifier
hi def link ahdlSpecialChar SpecialChar
hi def link ahdlKeyword Statement
hi def link ahdlString String
hi def link ahdlComment Comment
hi def link ahdlIdentifier Identifier
hi def link ahdlOperator Operator
hi def link ahdlTodo Todo
delcommand HiLink
endif
let b:current_syntax = "ahdl"
" vim:ts=8

View File

@ -1,15 +1,12 @@
" Vim syntax file
" Language: AmigaDos
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
" Last Change: Oct 23, 2014
" Version: 7
" Last Change: Aug 31, 2016
" Version: 9
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_AMIGA
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -72,30 +69,20 @@ syn match amiComment ";.*$" contains=amiCommentGroup
syn sync lines=50
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_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>
if !exists("skip_amiga_syntax_inits")
hi def link amiAlias Type
hi def link amiComment Comment
hi def link amiDev Type
hi def link amiEcho String
hi def link amiElse Statement
hi def link amiError Error
hi def link amiKey Statement
hi def link amiNumber Number
hi def link amiString String
hi def link amiTest Special
endif
HiLink amiAlias Type
HiLink amiComment Comment
HiLink amiDev Type
HiLink amiEcho String
HiLink amiElse Statement
HiLink amiError Error
HiLink amiKey Statement
HiLink amiNumber Number
HiLink amiString String
HiLink amiTest Special
delcommand HiLink
endif
let b:current_syntax = "amiga"
" vim:ts=15

View File

@ -9,11 +9,8 @@
" of [], in order to avoid -read highlighted,
" or [quote] strings highlighted
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
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
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_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
" Only when an item doesn't have highlighting yet
HiLink amlComment Comment
HiLink amlNumber Number
HiLink amlQuote String
HiLink amlVar Identifier
HiLink amlVar2 Identifier
HiLink amlFunction PreProc
HiLink amlDir Statement
HiLink amlDir2 Statement
HiLink amlDirSym Statement
HiLink amlOutput Statement
HiLink amlArcCmd ModeMsg
HiLink amlFormedCmd amlArcCmd
HiLink amlTabCmd amlArcCmd
HiLink amlInfoCmd amlArcCmd
HiLink amlVtrCmd amlArcCmd
HiLink amlFormed amlArcCmd
HiLink amlTab amlArcCmd
hi def link amlComment Comment
hi def link amlNumber Number
hi def link amlQuote String
hi def link amlVar Identifier
hi def link amlVar2 Identifier
hi def link amlFunction PreProc
hi def link amlDir Statement
hi def link amlDir2 Statement
hi def link amlDirSym Statement
hi def link amlOutput Statement
hi def link amlArcCmd ModeMsg
hi def link amlFormedCmd amlArcCmd
hi def link amlTabCmd amlArcCmd
hi def link amlInfoCmd amlArcCmd
hi def link amlVtrCmd amlArcCmd
hi def link amlFormed amlArcCmd
hi def link amlTab amlArcCmd
delcommand HiLink
endif
let b:current_syntax = "aml"

View File

@ -3,9 +3,8 @@
" Last Change: 2003 May 11
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
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.
HiLink amplEntityKeyword Keyword
HiLink amplType Type
HiLink amplStatement Statement
HiLink amplOperators Operator
HiLink amplBasicOperators Operator
HiLink amplConditional Conditional
HiLink amplRepeat Repeat
HiLink amplStrings String
HiLink amplNumerics Number
HiLink amplSetFunction Function
HiLink amplBuiltInFunction Function
HiLink amplRandomGenerator Function
HiLink amplComment Comment
HiLink amplDotSuffix Special
HiLink amplPiecewise Special
hi def link amplEntityKeyword Keyword
hi def link amplType Type
hi def link amplStatement Statement
hi def link amplOperators Operator
hi def link amplBasicOperators Operator
hi def link amplConditional Conditional
hi def link amplRepeat Repeat
hi def link amplStrings String
hi def link amplNumerics Number
hi def link amplSetFunction Function
hi def link amplBuiltInFunction Function
hi def link amplRandomGenerator Function
hi def link amplComment Comment
hi def link amplDotSuffix Special
hi def link amplPiecewise Special
delcommand HiLink
endif
let b:current_syntax = "ampl"

View File

@ -4,11 +4,8 @@
" LastChange: 02 May 2001
" Original: Comes from JavaCC.vim
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -18,12 +15,8 @@ endif
" Those files usually have the extension *.jj
" source the java.vim file
if version < 600
so <sfile>:p:h/java.vim
else
runtime! syntax/java.vim
unlet b:current_syntax
endif
"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)
@ -53,17 +46,8 @@ syn match antlrSep "[|:]\|\.\."
syn keyword antlrActionToken TOKEN SKIP MORE SPECIAL_TOKEN
syn keyword antlrError DEBUG IGNORE_IN_BNF
if version >= 508 || !exists("did_antlr_syntax_inits")
if version < 508
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
hi def link antlrSep Statement
hi def link antlrPackages Statement
let b:current_syntax = "antlr"

View File

@ -9,14 +9,10 @@
" make it really linewise?
" + add `display' where appropriate
" Setup
if version >= 600
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
else
syntax clear
endif
syn case ignore
@ -178,37 +174,28 @@ syn match apacheSection "<\/\=\(<IfVersion\)[^>]*>" contains=apacheAnything
syn keyword apacheDeclaration VirtualDocumentRoot VirtualDocumentRootIP VirtualScriptAlias VirtualScriptAliasIP
" 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
HiLink apacheAllowOverrideValue apacheOption
HiLink apacheAuthType apacheDeclaration
HiLink apacheAuthTypeValue apacheOption
HiLink apacheOptionOption apacheOption
HiLink apacheDeclaration Function
HiLink apacheAnything apacheOption
HiLink apacheOption Number
HiLink apacheComment Comment
HiLink apacheFixme Todo
HiLink apacheLimitSectionKeyword apacheLimitSection
HiLink apacheLimitSection apacheSection
HiLink apacheSection Label
HiLink apacheMethodOption Type
HiLink apacheAllowDeny Include
HiLink apacheAllowDenyValue Identifier
HiLink apacheOrder Special
HiLink apacheOrderValue String
HiLink apacheString String
HiLink apacheError Error
HiLink apacheUserID Number
hi def link apacheAllowOverride apacheDeclaration
hi def link apacheAllowOverrideValue apacheOption
hi def link apacheAuthType apacheDeclaration
hi def link apacheAuthTypeValue apacheOption
hi def link apacheOptionOption apacheOption
hi def link apacheDeclaration Function
hi def link apacheAnything apacheOption
hi def link apacheOption Number
hi def link apacheComment Comment
hi def link apacheFixme Todo
hi def link apacheLimitSectionKeyword apacheLimitSection
hi def link apacheLimitSection apacheSection
hi def link apacheSection Label
hi def link apacheMethodOption Type
hi def link apacheAllowDeny Include
hi def link apacheAllowDenyValue Identifier
hi def link apacheOrder Special
hi def link apacheOrderValue String
hi def link apacheString String
hi def link apacheError Error
hi def link apacheUserID Number
delcommand HiLink
endif
let b:current_syntax = "apache"

View File

@ -20,11 +20,8 @@
" </SubSection>
" </Section>
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -41,25 +38,15 @@ syn match apTagOption contained / [-\/_\.:*a-zA-Z0-9]\+/ms=s+1
syn match apTagError contained /[^>]</ms=s+1
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_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
" Only when an item doesn't have highlighting yet
HiLink apComment Comment
HiLink apOption Keyword
"HiLink apLastValue Identifier ugly?
HiLink apTag Special
HiLink apTagOption Identifier
HiLink apTagError Error
hi def link apComment Comment
hi def link apOption Keyword
"hi def link apLastValue Identifier ugly?
hi def link apTag Special
hi def link apTagOption Identifier
hi def link apTagError Error
delcommand HiLink
endif
let b:current_syntax = "apachestyle"
" vim: ts=8

View File

@ -3,12 +3,9 @@
" Maintainer: Yann Amar <quidame@poivron.org>
" Last Change: 2015 Dec 22
" For version 5.x: Clear all syntax items
" For version 6.x and 7.x: Quit when a syntax file was already loaded
" quit when a syntax file was already loaded
if !exists("main_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
if exists("b:current_syntax")
finish
endif
let main_syntax = 'aptconf'

View File

@ -10,20 +10,13 @@
" Thanks to Rik, Erik Nomitch, Adam Obeng and Graeme Cross for helpful feedback!
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
" Read the C syntax to start with
if version < 600
so <sfile>:p:h/cpp.vim
else
runtime! syntax/cpp.vim
endif
syn keyword arduinoConstant HIGH LOW INPUT OUTPUT
syn keyword arduinoConstant DEC BIN HEX OCT BYTE

View File

@ -7,11 +7,8 @@
" Thanks to Ori Avtalion for feedback on the comment markers!
" For version 5.x: Clear all syntax items
" For version 6.0 and later: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -103,37 +100,27 @@ syn match asmDirective "\.[A-Za-z][0-9A-Za-z-_]*"
syn case match
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_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
" Only when an item doesn't have highlighting yet
" The default methods for highlighting. Can be overridden later
HiLink asmSection Special
HiLink asmLabel Label
HiLink asmComment Comment
HiLink asmTodo Todo
HiLink asmDirective Statement
hi def link asmSection Special
hi def link asmLabel Label
hi def link asmComment Comment
hi def link asmTodo Todo
hi def link asmDirective Statement
HiLink asmInclude Include
HiLink asmCond PreCondit
HiLink asmMacro Macro
hi def link asmInclude Include
hi def link asmCond PreCondit
hi def link asmMacro Macro
HiLink hexNumber Number
HiLink decNumber Number
HiLink octNumber Number
HiLink binNumber Number
hi def link hexNumber Number
hi def link decNumber Number
hi def link octNumber Number
hi def link binNumber Number
HiLink asmIdentifier Identifier
HiLink asmType Type
hi def link asmIdentifier Identifier
hi def link asmType Type
delcommand HiLink
endif
let b:current_syntax = "asm"

View File

@ -8,11 +8,8 @@
" Feel free to contribute...
"
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -328,15 +325,7 @@ syn match asm68kDirective "\<XREF\(\.S\)\=\s"
syn case match
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_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
" Only when an item doesn't have highlighting yet
" The default methods for highlighting. Can be overridden later
" Comment Constant Error Identifier PreProc Special Statement Todo Type
@ -348,43 +337,41 @@ if version >= 508 || !exists("did_asm68k_syntax_inits")
" Statement Conditional Exception Keyword Label Operator Repeat
" Type StorageClass Structure Typedef
HiLink asm68kComment Comment
HiLink asm68kTodo Todo
hi def link asm68kComment Comment
hi def link asm68kTodo Todo
HiLink hexNumber Number " Constant
HiLink octNumber Number " Constant
HiLink binNumber Number " Constant
HiLink decNumber Number " Constant
HiLink floatNumber Number " Constant
HiLink floatExponent Number " Constant
HiLink floatE SpecialChar " Statement
"HiLink floatE Number " Constant
hi def link hexNumber Number " Constant
hi def link octNumber Number " Constant
hi def link binNumber Number " Constant
hi def link decNumber Number " Constant
hi def link floatNumber Number " Constant
hi def link floatExponent Number " Constant
hi def link floatE SpecialChar " Statement
"hi def link floatE Number " Constant
HiLink asm68kImmediate SpecialChar " Statement
"HiLink asm68kSymbol Constant
hi def link asm68kImmediate SpecialChar " Statement
"hi def link asm68kSymbol Constant
HiLink asm68kString String " Constant
HiLink asm68kCharError Error
HiLink asm68kStringError Error
hi def link asm68kString String " Constant
hi def link asm68kCharError Error
hi def link asm68kStringError Error
HiLink asm68kReg Identifier
HiLink asm68kOperator Identifier
hi def link asm68kReg Identifier
hi def link asm68kOperator Identifier
HiLink asm68kInclude Include " PreProc
HiLink asm68kMacro Macro " PreProc
HiLink asm68kMacroParam Keyword " Statement
hi def link asm68kInclude Include " PreProc
hi def link asm68kMacro Macro " PreProc
hi def link asm68kMacroParam Keyword " Statement
HiLink asm68kDirective Special
HiLink asm68kPreCond Special
hi def link asm68kDirective Special
hi def link asm68kPreCond Special
HiLink asm68kOpcode Statement
HiLink asm68kCond Conditional " Statement
HiLink asm68kRepeat Repeat " Statement
hi def link asm68kOpcode Statement
hi def link asm68kCond Conditional " Statement
hi def link asm68kRepeat Repeat " Statement
HiLink asm68kLabel Type
delcommand HiLink
endif
hi def link asm68kLabel Type
let b:current_syntax = "asm68k"

View File

@ -3,11 +3,8 @@
" Maintainer: Kevin Dahlhausen <kdahlhaus@yahoo.com>
" Last Change: 2002 Sep 19
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -52,33 +49,19 @@ syn case match
" Read the general asm syntax
if version < 600
source <sfile>:p:h/asm.vim
else
runtime! syntax/asm.vim
endif
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_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
" Only when an item doesn't have highlighting yet
HiLink asmOpcode Statement
HiLink asmRegister Identifier
hi def link asmOpcode Statement
hi def link asmRegister Identifier
" My default-color overrides:
"hi asmOpcode ctermfg=yellow
"hi asmReg ctermfg=lightmagenta
delcommand HiLink
endif
let b:current_syntax = "asmh8300"

View File

@ -4,11 +4,8 @@
" URL: http://www.fleiner.com/vim/syntax/asn.vim
" Last Change: 2012 Oct 05
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -50,34 +47,24 @@ syn match asnBraces "[{}]"
syn sync ccomment asnComment
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_asn_syn_inits")
if version < 508
let did_asn_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink asnDefinition Function
HiLink asnBraces Function
HiLink asnStructure Statement
HiLink asnBoolValue Boolean
HiLink asnSpecial Special
HiLink asnString String
HiLink asnCharacter Character
HiLink asnSpecialCharacter asnSpecial
HiLink asnNumber asnValue
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
" Only when an item doesn't have highlighting yet
hi def link asnDefinition Function
hi def link asnBraces Function
hi def link asnStructure Statement
hi def link asnBoolValue Boolean
hi def link asnSpecial Special
hi def link asnString String
hi def link asnCharacter Character
hi def link asnSpecialCharacter asnSpecial
hi def link asnNumber asnValue
hi def link asnComment Comment
hi def link asnLineComment asnComment
hi def link asnType Type
hi def link asnTypeInfo PreProc
hi def link asnValue Number
hi def link asnExternal Include
hi def link asnTagModifier Function
hi def link asnFieldOption Type
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -4,11 +4,8 @@
" URL: http://nim.dhs.org/~edh/aspperl.vim
" Last Change: 2001 May 09
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -16,14 +13,9 @@ if !exists("main_syntax")
let main_syntax = 'perlscript'
endif
if version < 600
so <sfile>:p:h/html.vim
syn include @AspPerlScript <sfile>:p:h/perl.vim
else
runtime! syntax/html.vim
unlet b:current_syntax
syn include @AspPerlScript syntax/perl.vim
endif
syn cluster htmlPreproc add=AspPerlScriptInsideHtmlTags

View File

@ -11,10 +11,8 @@
" Thanks to Dean Hall <hall@apt7.com> for testing the use of classes in
" VBScripts which I've been too scared to do.
" Quit when a syntax file was already loaded
if version < 600
syn clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -22,11 +20,7 @@ if !exists("main_syntax")
let main_syntax = 'aspvbs'
endif
if version < 600
source <sfile>:p:h/html.vim
else
runtime! syntax/html.vim
endif
unlet b:current_syntax
syn cluster htmlPreProc add=AspVBScriptInsideHtmlTags
@ -163,31 +157,21 @@ syn sync match htmlHighlight grouphere htmlTag "%>"
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_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
" Only when an item doesn't have highlighting yet
"HiLink AspVBScript Special
HiLink AspVBSLineNumber Comment
HiLink AspVBSNumber Number
HiLink AspVBSError Error
HiLink AspVBSStatement Statement
HiLink AspVBSString String
HiLink AspVBSComment Comment
HiLink AspVBSTodo Todo
HiLink AspVBSFunction Identifier
HiLink AspVBSMethods PreProc
HiLink AspVBSEvents Special
HiLink AspVBSTypeSpecifier Type
"hi def link AspVBScript Special
hi def link AspVBSLineNumber Comment
hi def link AspVBSNumber Number
hi def link AspVBSError Error
hi def link AspVBSStatement Statement
hi def link AspVBSString String
hi def link AspVBSComment Comment
hi def link AspVBSTodo Todo
hi def link AspVBSFunction Identifier
hi def link AspVBSMethods PreProc
hi def link AspVBSEvents Special
hi def link AspVBSTypeSpecifier Type
delcommand HiLink
endif
let b:current_syntax = "aspvbs"

View File

@ -5,10 +5,9 @@
" Updated for 1.2 by Tilghman Lesher (Corydon76)
" Last Change: 2015 Feb 27
" version 0.4
"
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
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
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_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
" Only when an item doesn't have highlighting yet
hi def link asteriskComment Comment
hi def link asteriskExten String
hi def link asteriskContext Preproc
hi def link asteriskPattern Type
hi def link asteriskApp Statement
hi def link asteriskInclude Preproc
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"
" vim: ts=8 sw=2

View File

@ -3,10 +3,9 @@
" Maintainer: Tilghman Lesher (Corydon76)
" Last Change: 2006 Mar 21
" version 0.2
"
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -33,28 +32,18 @@ syn match mailboxEmail ",\zs[^@=,]*@[[:alnum:]\-\.]\+\.[[:alpha
syn match comma "[,|]" contained
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
:if version >= 508 || !exists("did_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
" Only when an item doesn't have highlighting yet
HiLink asteriskvmComment Comment
HiLink asteriskvmContext Identifier
HiLink asteriskvmZone Type
HiLink zoneName String
HiLink zoneDef String
HiLink asteriskvmSetting Type
HiLink asteriskvmSettingBool Type
hi def link asteriskvmComment Comment
hi def link asteriskvmContext Identifier
hi def link asteriskvmZone Type
hi def link zoneName String
hi def link zoneDef String
hi def link asteriskvmSetting Type
hi def link asteriskvmSettingBool Type
HiLink asteriskvmMailbox Statement
HiLink mailboxEmail String
delcommand HiLink
endif
hi def link asteriskvmMailbox Statement
hi def link mailboxEmail String
let b:current_syntax = "asteriskvm"

View File

@ -3,11 +3,8 @@
" Maintainer: Inaki Saez <jisaez@sfe.indra.es>
" Last Change: 2001 May 09
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -61,37 +58,27 @@ syn sync maxlines=100
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_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
" Only when an item doesn't have highlighting yet
HiLink atlasConditional Conditional
HiLink atlasRepeat Repeat
HiLink atlasStatement Statement
HiLink atlasNumber Number
HiLink atlasHexNumber Number
HiLink atlasOctalNumber Number
HiLink atlasBinNumber Number
HiLink atlasDecimalNumber Float
HiLink atlasFormatString String
HiLink atlasString String
HiLink atlasComment Comment
HiLink atlasComment2 Comment
HiLink atlasInclude Include
HiLink atlasDefine Macro
HiLink atlasReserved PreCondit
HiLink atlasStorageClass StorageClass
HiLink atlasIdentifier NONE
HiLink atlasSpecial Special
hi def link atlasConditional Conditional
hi def link atlasRepeat Repeat
hi def link atlasStatement Statement
hi def link atlasNumber Number
hi def link atlasHexNumber Number
hi def link atlasOctalNumber Number
hi def link atlasBinNumber Number
hi def link atlasDecimalNumber Float
hi def link atlasFormatString String
hi def link atlasString String
hi def link atlasComment Comment
hi def link atlasComment2 Comment
hi def link atlasInclude Include
hi def link atlasDefine Macro
hi def link atlasReserved PreCondit
hi def link atlasStorageClass StorageClass
hi def link atlasIdentifier NONE
hi def link atlasSpecial Special
delcommand HiLink
endif
let b:current_syntax = "atlas"

View File

@ -18,18 +18,12 @@
" EXTRA_SOURCES.
" Standard syntax initialization
if version < 600
syntax clear
elseif exists("b:current_syntax")
if exists("b:current_syntax")
finish
endif
" Read the Makefile syntax to start with
if version < 600
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 "^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
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_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
" Only when an item doesn't have highlighting yet
HiLink automakePrimary Statement
HiLink automakeSecondary Type
HiLink automakeExtra Special
HiLink automakeOptions Special
HiLink automakeClean Special
HiLink automakeSubdirs Statement
HiLink automakeConditional PreProc
HiLink automakeSubst PreProc
HiLink automakeComment1 makeComment
HiLink automakeComment2 makeComment
HiLink automakeMakeError makeError
HiLink automakeBadSubst makeError
HiLink automakeMakeDString makeDString
HiLink automakeMakeSString makeSString
HiLink automakeMakeBString makeBString
hi def link automakePrimary Statement
hi def link automakeSecondary Type
hi def link automakeExtra Special
hi def link automakeOptions Special
hi def link automakeClean Special
hi def link automakeSubdirs Statement
hi def link automakeConditional PreProc
hi def link automakeSubst PreProc
hi def link automakeComment1 makeComment
hi def link automakeComment2 makeComment
hi def link automakeMakeError makeError
hi def link automakeBadSubst makeError
hi def link automakeMakeDString makeDString
hi def link automakeMakeSString makeSString
hi def link automakeMakeBString makeBString
delcommand HiLink
endif
let b:current_syntax = "automake"

View File

@ -11,11 +11,8 @@
" I use some technologies to automatically load avenue scripts
" into ArcView.
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -37,7 +34,7 @@ syn match aveNumber "[+-]\=\<[0-9]\+\>"
" Operator
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
syn match aveOperator "[^\.]not[^a-zA-Z]"
@ -59,34 +56,24 @@ syn match aveTypos "=="
syn match aveTypos "!="
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting+yet
if version >= 508 || !exists("did_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
" Only when an item doesn't have highlighting+yet
HiLink aveStatement Statement
hi def link aveStatement Statement
HiLink aveString String
HiLink aveNumber Number
hi def link aveString String
hi def link aveNumber Number
HiLink aveFixVariables Special
HiLink aveVariables Identifier
HiLink globalVariables Special
HiLink aveConst Special
hi def link aveFixVariables Special
hi def link aveVariables Identifier
hi def link globalVariables Special
hi def link aveConst Special
HiLink aveClassMethods Function
hi def link aveClassMethods Function
HiLink aveOperator Operator
HiLink aveComment Comment
hi def link aveOperator Operator
hi def link aveComment Comment
HiLink aveTypos Error
hi def link aveTypos Error
delcommand HiLink
endif
let b:current_syntax = "ave"

View File

@ -2,14 +2,12 @@
" Language: AVR Assembler (AVRA)
" AVRA Home: http://avra.sourceforge.net/index.html
" AVRA Version: 1.3.0
" Last Update: 2016 Oct 7
" Maintainer: Marius Ghita <mhitza@gmail.com>
let s:cpo_save = &cpo
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 keyword avraRegister r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14

View File

@ -1,7 +1,7 @@
" Vim syntax file
" Language: awk, nawk, gawk, mawk
" 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
" 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 RT SYMTAB
" Arithmetic operators: +, and - take care of ++, and --
syn match awkOperator "+\|-\|\*\|/\|%\|="
syn match awkOperator "+=\|-=\|\*=\|/=\|%="
syn match awkOperator "\^\|\^="
" Octal format character.
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_]*\>"
" Arithmetic operators: +, and - take care of ++, and --
syn match awkOperator "+\|-\|\*\|/\|%\|="
syn match awkOperator "+=\|-=\|\*=\|/=\|%="
syn match awkOperator "^\|^="
" Comparison expressions.
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
" Define the default highlighting.
" Only used when an item doesn't have highlighting yet
hi def link awkConditional Conditional
hi def link awkFunction Function
hi def link awkRepeat Repeat

View File

@ -6,21 +6,14 @@
" Comment: Replaced sourcing c.vim file by ada.vim and rename yacc*
" in ayacc*
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
" Read the Ada syntax to start with
if version < 600
so <sfile>:p:h/ada.vim
else
runtime! syntax/ada.vim
unlet b:current_syntax
endif
let s:cpo_save = &cpo
set cpo&vim
@ -54,35 +47,26 @@ syn match ayaccSep "^[ \t]*%}"
syn match ayaccCurlyError "[{}]"
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
HiLink ayaccBrkt ayaccStmt
HiLink ayaccKey ayaccStmt
HiLink ayaccOper ayaccStmt
HiLink ayaccUnionStart ayaccKey
hi def link ayaccBrkt ayaccStmt
hi def link ayaccKey ayaccStmt
hi def link ayaccOper ayaccStmt
hi def link ayaccUnionStart ayaccKey
" External ayacc highlighting links
HiLink ayaccCurly Delimiter
HiLink ayaccCurlyError Error
HiLink ayaccDefinition Function
HiLink ayaccDelim Function
HiLink ayaccKeyActn Special
HiLink ayaccSectionSep Todo
HiLink ayaccSep Delimiter
HiLink ayaccStmt Statement
HiLink ayaccType Type
hi def link ayaccCurly Delimiter
hi def link ayaccCurlyError Error
hi def link ayaccDefinition Function
hi def link ayaccDelim Function
hi def link ayaccKeyActn Special
hi def link ayaccSectionSep Todo
hi def link ayaccSep Delimiter
hi def link ayaccStmt Statement
hi def link ayaccType Type
" since Bram doesn't like my Delimiter :|
HiLink Delimiter Type
delcommand HiLink
endif
hi def link Delimiter Type
let b:current_syntax = "ayacc"

View File

@ -5,11 +5,8 @@
" LastChange: 8 Dec 2007
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -69,58 +66,48 @@ syn region bPreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error
syn sync ccomment bComment minlines=10
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
" 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
HiLink bLabel Label
HiLink bUserLabel Label
HiLink bConditional Conditional
HiLink bRepeat Repeat
HiLink bLogic Special
HiLink bCharacter Character
HiLink bSpecialCharacter bSpecial
HiLink bNumber Number
HiLink bFloat Float
HiLink bOctalError bError
HiLink bParenError bError
" HiLink bInParen bError
HiLink bCommentError bError
HiLink bBoolean Identifier
HiLink bConstant Identifier
HiLink bGuard Identifier
HiLink bOperator Operator
HiLink bKeywords Operator
HiLink bOps Identifier
HiLink bStructure Structure
HiLink bStorageClass StorageClass
HiLink bInclude Include
HiLink bPreProc PreProc
HiLink bDefine Macro
HiLink bIncluded bString
HiLink bError Error
HiLink bStatement Statement
HiLink bPreCondit PreCondit
HiLink bType Type
HiLink bCommentError bError
HiLink bCommentString bString
HiLink bComment2String bString
HiLink bCommentSkip bComment
HiLink bString String
HiLink bComment Comment
HiLink bSpecial SpecialChar
HiLink bTodo Todo
hi def link bLabel Label
hi def link bUserLabel Label
hi def link bConditional Conditional
hi def link bRepeat Repeat
hi def link bLogic Special
hi def link bCharacter Character
hi def link bSpecialCharacter bSpecial
hi def link bNumber Number
hi def link bFloat Float
hi def link bOctalError bError
hi def link bParenError bError
" hi def link bInParen bError
hi def link bCommentError bError
hi def link bBoolean Identifier
hi def link bConstant Identifier
hi def link bGuard Identifier
hi def link bOperator Operator
hi def link bKeywords Operator
hi def link bOps Identifier
hi def link bStructure Structure
hi def link bStorageClass StorageClass
hi def link bInclude Include
hi def link bPreProc PreProc
hi def link bDefine Macro
hi def link bIncluded bString
hi def link bError Error
hi def link bStatement Statement
hi def link bPreCondit PreCondit
hi def link bType Type
hi def link bCommentError bError
hi def link bCommentString bString
hi def link bComment2String bString
hi def link bCommentSkip bComment
hi def link bString String
hi def link bComment Comment
hi def link bSpecial SpecialChar
hi def link bTodo Todo
"hi link bIdentifier Identifier
delcommand HiLink
endif
let b:current_syntax = "b"

View File

@ -4,15 +4,8 @@
" Originally owned by: Erwin Smit / Her van de Vliert
" Last change: v1.17 2006/04/26 10:40:18
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
"
if version < 600
syntax clear
if exists("baan_fold")
unlet baan_fold
endif
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -1894,40 +1887,30 @@ syn keyword baanBshell bclm.productidlicensed
syn keyword baanBshell bclm.set.desktop
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_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
" Only when an item doesn't have highlighting yet
HiLink baanConditional Conditional
HiLink baan3gl Statement
HiLink baan3glpre PreProc
HiLink baan4gl Statement
HiLink baan4glh Statement
HiLink baansql Statement
HiLink baansqlh Statement
HiLink baanDalHook Statement
HiLink baanNumber Number
HiLink baanString String
HiLink baanOpenStringError Error
HiLink baanConstant Constant
HiLink baanComment Comment
HiLink baanCommenth Comment
HiLink baanUncommented Comment
HiLink baanDLLUsage Comment
HiLink baanFunUsage Comment
HiLink baanIdentifier Normal
HiLink baanBshell Function
HiLink baanType Type
HiLink baanStorageClass StorageClass
hi def link baanConditional Conditional
hi def link baan3gl Statement
hi def link baan3glpre PreProc
hi def link baan4gl Statement
hi def link baan4glh Statement
hi def link baansql Statement
hi def link baansqlh Statement
hi def link baanDalHook Statement
hi def link baanNumber Number
hi def link baanString String
hi def link baanOpenStringError Error
hi def link baanConstant Constant
hi def link baanComment Comment
hi def link baanCommenth Comment
hi def link baanUncommented Comment
hi def link baanDLLUsage Comment
hi def link baanFunUsage Comment
hi def link baanIdentifier Normal
hi def link baanBshell Function
hi def link baanType Type
hi def link baanStorageClass StorageClass
delcommand HiLink
endif
let b:current_syntax = "baan"

View File

@ -8,11 +8,8 @@
" This syntax file not a complete implementation yet. Send suggestions to the
" maintainer.
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -143,34 +140,24 @@ syn match basicFilenumber "#\d\+"
syn match basicMathsOperator "-\|=\|[:<>+\*^/\\]\|AND\|OR"
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_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
" Only when an item doesn't have highlighting yet
HiLink basicLabel Label
HiLink basicConditional Conditional
HiLink basicRepeat Repeat
HiLink basicLineNumber Comment
HiLink basicNumber Number
HiLink basicError Error
HiLink basicStatement Statement
HiLink basicString String
HiLink basicComment Comment
HiLink basicSpecial Special
HiLink basicTodo Todo
HiLink basicFunction Identifier
HiLink basicTypeSpecifier Type
HiLink basicFilenumber basicTypeSpecifier
hi def link basicLabel Label
hi def link basicConditional Conditional
hi def link basicRepeat Repeat
hi def link basicLineNumber Comment
hi def link basicNumber Number
hi def link basicError Error
hi def link basicStatement Statement
hi def link basicString String
hi def link basicComment Comment
hi def link basicSpecial Special
hi def link basicTodo Todo
hi def link basicFunction Identifier
hi def link basicTypeSpecifier Type
hi def link basicFilenumber basicTypeSpecifier
"hi basicMathsOperator term=bold cterm=bold gui=bold
delcommand HiLink
endif
let b:current_syntax = "basic"

View File

@ -5,11 +5,8 @@
" (Dominique Pelle added @Spell)
" Available on: www.gjh.sk/~vlado/bc.vim
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -53,27 +50,17 @@ syn match bcParenError ")"
syn case match
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_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
" Only when an item doesn't have highlighting yet
HiLink bcKeyword Statement
HiLink bcType Type
HiLink bcConstant Constant
HiLink bcNumber Number
HiLink bcComment Comment
HiLink bcString String
HiLink bcSpecialChar SpecialChar
HiLink bcParenError Error
hi def link bcKeyword Statement
hi def link bcType Type
hi def link bcConstant Constant
hi def link bcNumber Number
hi def link bcComment Comment
hi def link bcString String
hi def link bcSpecialChar SpecialChar
hi def link bcParenError Error
delcommand HiLink
endif
let b:current_syntax = "bc"
" vim: ts=8

View File

@ -2,17 +2,14 @@
" Language: BibTeX (bibliographic database format for (La)TeX)
" Maintainer: Bernd Feige <Bernd.Feige@gmx.net>
" 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!
" Initialization
" ==============
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@ -74,7 +71,7 @@ syn keyword bibNSEntryKw contained mrclass mrnumber mrreviewer fjournal coden
" 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:
"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 bibVariable contained /[^{}," \t=]/
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 bibBrace 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
" 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:
if version < 600
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
" Synchronization
@ -107,25 +101,16 @@ syn sync minlines=50
" Highlighting defaults
" =====================
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_bib_syn_inits")
if version < 508
let did_bib_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink bibType Identifier
HiLink bibEntryKw Statement
HiLink bibNSEntryKw PreProc
HiLink bibKey Special
HiLink bibVariable Constant
HiLink bibUnescapedSpecial Error
HiLink bibComment Comment
HiLink bibComment2 Comment
delcommand HiLink
endif
" Only when an item doesn't have highlighting yet
hi def link bibType Identifier
hi def link bibEntryKw Statement
hi def link bibNSEntryKw PreProc
hi def link bibKey Special
hi def link bibVariable Constant
hi def link bibUnescapedSpecial Error
hi def link bibComment Comment
hi def link bibComment2 Comment
let b:current_syntax = "bib"

Some files were not shown because too many files have changed in this diff Show More