Updated runtime files. Remove version checks for Vim older than 6.0.

This commit is contained in:
Bram Moolenaar
2016-08-30 23:26:57 +02:00
parent 4792255eff
commit 89bcfda683
427 changed files with 9298 additions and 12948 deletions

View File

@ -93,7 +93,7 @@ function! s:GetBufferRubyEntity( name, type, ... )
let stopline = 1 let stopline = 1
let crex = '^\s*\<' . a:type . '\>\s*\<' . a:name . '\>\s*\(<\s*.*\s*\)\?' let crex = '^\s*\<' . a:type . '\>\s*\<' . escape(a:name, '*') . '\>\s*\(<\s*.*\s*\)\?'
let [lnum,lcol] = searchpos( crex, 'w' ) let [lnum,lcol] = searchpos( crex, 'w' )
"let [lnum,lcol] = searchpairpos( crex . '\zs', '', '\(end\|}\)', 'w' ) "let [lnum,lcol] = searchpairpos( crex . '\zs', '', '\(end\|}\)', 'w' )
@ -149,7 +149,7 @@ function! s:GetRubyVarType(v)
let ctors = ctors.'\)' let ctors = ctors.'\)'
let fstr = '=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%[xwQqr][(\[{@]\|[A-Za-z0-9@:\-()\.]\+...\?\|lambda\|&\)' let fstr = '=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%[xwQqr][(\[{@]\|[A-Za-z0-9@:\-()\.]\+...\?\|lambda\|&\)'
let sstr = ''.a:v.'\>\s*[+\-*/]*'.fstr let sstr = ''.escape(a:v, '*').'\>\s*[+\-*/]*'.fstr
let [lnum,lcol] = searchpos(sstr,'nb',stopline) let [lnum,lcol] = searchpos(sstr,'nb',stopline)
if lnum != 0 && lcol != 0 if lnum != 0 && lcol != 0
let str = matchstr(getline(lnum),fstr,lcol) let str = matchstr(getline(lnum),fstr,lcol)
@ -266,6 +266,28 @@ class VimRubyCompletion
end end
end end
def load_gems
fpath = VIM::evaluate("get(g:, 'rubycomplete_gemfile_path', 'Gemfile')")
return unless File.file?(fpath) && File.readable?(fpath)
want_bundler = VIM::evaluate("get(g:, 'rubycomplete_use_bundler')")
parse_file = !want_bundler
begin
require 'bundler'
Bundler.setup
Bundler.require
rescue Exception
parse_file = true
end
if parse_file
File.new(fpath).each_line do |line|
begin
require $1 if /\s*gem\s*['"]([^'"]+)/.match(line)
rescue Exception
end
end
end
end
def load_buffer_class(name) def load_buffer_class(name)
dprint "load_buffer_class(%s) START" % name dprint "load_buffer_class(%s) START" % name
classdef = get_buffer_entity(name, 's:GetBufferRubyClass("%s")') classdef = get_buffer_entity(name, 's:GetBufferRubyClass("%s")')
@ -588,6 +610,10 @@ class VimRubyCompletion
load_rails load_rails
end end
want_gems = VIM::evaluate("get(g:, 'rubycomplete_load_gemfile')")
load_gems unless want_gems.to_i.zero?
input = VIM::Buffer.current.line input = VIM::Buffer.current.line
cpos = VIM::Window.current.cursor[1] - 1 cpos = VIM::Window.current.cursor[1] - 1
input = input[0..cpos] input = input[0..cpos]
@ -678,7 +704,9 @@ class VimRubyCompletion
cv = eval("self.class.constants") cv = eval("self.class.constants")
vartype = get_var_type( receiver ) vartype = get_var_type( receiver )
dprint "vartype: %s" % vartype dprint "vartype: %s" % vartype
if vartype != ''
invalid_vartype = ['', "gets"]
if !invalid_vartype.include?(vartype)
load_buffer_class( vartype ) load_buffer_class( vartype )
begin begin
@ -706,7 +734,7 @@ class VimRubyCompletion
methods.concat m.instance_methods(false) methods.concat m.instance_methods(false)
} }
end end
variables += add_rails_columns( "#{vartype}" ) if vartype && vartype.length > 0 variables += add_rails_columns( "#{vartype}" ) if vartype && !invalid_vartype.include?(vartype)
when /^\(?\s*[A-Za-z0-9:^@.%\/+*\(\)]+\.\.\.?[A-Za-z0-9:^@.%\/+*\(\)]+\s*\)?\.([^.]*)/ when /^\(?\s*[A-Za-z0-9:^@.%\/+*\(\)]+\.\.\.?[A-Za-z0-9:^@.%\/+*\(\)]+\s*\)?\.([^.]*)/
message = $1 message = $1

View File

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

View File

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

View File

@ -27,7 +27,11 @@ CompilerSet errorformat=
\%\\s%#[%f:%l:\ %#%m, \%\\s%#[%f:%l:\ %#%m,
\%\\s%#%f:%l:\ %#%m, \%\\s%#%f:%l:\ %#%m,
\%\\s%#%f:%l:, \%\\s%#%f:%l:,
\%m\ [%f:%l]: \%m\ [%f:%l]:,
\%+Erake\ aborted!,
\%+EDon't\ know\ how\ to\ build\ task\ %.%#,
\%+Einvalid\ option:%.%#,
\%+Irake\ %\\S%\\+%\\s%\\+#\ %.%#
let &cpo = s:cpo_save let &cpo = s:cpo_save
unlet s:cpo_save unlet s:cpo_save

View File

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

View File

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

View File

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

View File

@ -31,7 +31,8 @@ set ttimeoutlen=100 " wait up to 100ms after Esc for special key
" Show @@@ in the last line if it is truncated. " Show @@@ in the last line if it is truncated.
set display=truncate set display=truncate
" Show a few lines of context around the cursor. " Show a few lines of context around the cursor. Note that this makes the
" text scroll if you mouse-click near the start or end of the window.
set scrolloff=5 set scrolloff=5
" Do incremental searching when it's possible to timeout. " Do incremental searching when it's possible to timeout.

View File

@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.4. Last change: 2016 Aug 29 *eval.txt* For Vim version 7.4. Last change: 2016 Aug 30
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -643,13 +643,17 @@ It's possible to form a variable name with curly braces, see
Expression syntax summary, from least to most significant: Expression syntax summary, from least to most significant:
|expr1| expr2 ? expr1 : expr1 if-then-else |expr1| expr2
expr2 ? expr1 : expr1 if-then-else
|expr2| expr3 || expr3 .. logical OR |expr2| expr3
expr3 || expr3 .. logical OR
|expr3| expr4 && expr4 .. logical AND |expr3| expr4
expr4 && expr4 .. logical AND
|expr4| expr5 == expr5 equal |expr4| expr5
expr5 == expr5 equal
expr5 != expr5 not equal expr5 != expr5 not equal
expr5 > expr5 greater than expr5 > expr5 greater than
expr5 >= expr5 greater than or equal expr5 >= expr5 greater than or equal
@ -666,19 +670,23 @@ Expression syntax summary, from least to most significant:
expr5 is expr5 same |List| instance expr5 is expr5 same |List| instance
expr5 isnot expr5 different |List| instance expr5 isnot expr5 different |List| instance
|expr5| expr6 + expr6 .. number addition or list concatenation |expr5| expr6
expr6 + expr6 .. number addition or list concatenation
expr6 - expr6 .. number subtraction expr6 - expr6 .. number subtraction
expr6 . expr6 .. string concatenation expr6 . expr6 .. string concatenation
|expr6| expr7 * expr7 .. number multiplication |expr6| expr7
expr7 * expr7 .. number multiplication
expr7 / expr7 .. number division expr7 / expr7 .. number division
expr7 % expr7 .. number modulo expr7 % expr7 .. number modulo
|expr7| ! expr7 logical NOT |expr7| expr8
! expr7 logical NOT
- expr7 unary minus - expr7 unary minus
+ expr7 unary plus + expr7 unary plus
|expr8| expr8[expr1] byte of a String or item of a |List| |expr8| expr9
expr8[expr1] byte of a String or item of a |List|
expr8[expr1 : expr1] substring of a String or sublist of a |List| expr8[expr1 : expr1] substring of a String or sublist of a |List|
expr8.name entry in a |Dictionary| expr8.name entry in a |Dictionary|
expr8(expr1, ...) function call with |Funcref| variable expr8(expr1, ...) function call with |Funcref| variable

View File

@ -1,4 +1,4 @@
*os_win32.txt* For Vim version 7.4. Last change: 2016 Mar 05 *os_win32.txt* For Vim version 7.4. Last change: 2016 Aug 28
VIM REFERENCE MANUAL by George Reilly VIM REFERENCE MANUAL by George Reilly
@ -144,29 +144,8 @@ the console.
5. Running under Windows 3.1 *win32-win3.1* 5. Running under Windows 3.1 *win32-win3.1*
*win32s* *windows-3.1* *win32s* *windows-3.1*
There is a special version of Gvim that runs under Windows 3.1 and 3.11. You There was a special version of Gvim that runs under Windows 3.1 and 3.11.
need the gvim.exe that was compiled with Visual C++ 4.1. Support was removed in patch 7.4.1363.
To run the Win32 version under Windows 3.1, you need to install Win32s. You
might have it already from another Win32 application which you have installed.
If Vim doesn't seem to be running properly, get the latest version: 1.30c.
You can find it at:
http://support.microsoft.com/download/support/mslfiles/pw1118.exe
(Microsoft moved it again, we don't know where it is now :-( ).
The reason for having two versions of gvim.exe is that the Win32s version was
compiled with VC++ 4.1. This is the last version of VC++ that supports Win32s
programs. VC++ 5.0 is better, so that one was used for the Win32 version.
Apart from that, there is no difference between the programs. If you are in a
mixed environment, you can use the gvim.exe for Win32s on both.
The Win32s version works the same way as the Win32 version under 95/NT. When
running under Win32s the following differences apply:
- You cannot use long file names, because Windows 3.1 doesn't support them!
- When executing an external command, it doesn't return an exit code. After
doing ":make" you have to do ":cn" yourself.
============================================================================== ==============================================================================
6. Win32 mini FAQ *win32-faq* 6. Win32 mini FAQ *win32-faq*

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.4. Last change: 2016 Aug 27 *todo.txt* For Vim version 7.4. Last change: 2016 Aug 30
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -37,6 +37,25 @@ not be repeated below, unless there is extra information.
Make ":filter" work with more commands. Make ":filter" work with more commands.
Search for: msg_putchar('\n') Search for: msg_putchar('\n')
Try building with $SHADOWDIR
Test_sign_completion() fails on MS-Windows (console and GUI) Completion
doesn't have both tb_paste.xpm and tb_print.xpm but "tb_p". Different default
options?
Test_nb_basic() fails on MS-Windows GUI. line 12: Expected 2 but got 1.
line 13: Expected 20 but got 1.
Figure out building with Ruby on MS-Windows.
:cexpr doesn't trigger QuickFixCmdPost. (Mathias Stearn, 2016 Aug 29, #1021)
Needs documentation. (Yegappan)
Patch to convert test_marks to new style. (Yegappan, 2016 Aug 28, 2 msg)
Patch to make it possible to define a test but skip it, by throwing an
exception. (Christian Brabandt, 2016 Aug 30)
+channel: +channel:
- Implement |job-term| ? - Implement |job-term| ?
- Channel test fails with Motif. Sometimes kills the X11 server. - Channel test fails with Motif. Sometimes kills the X11 server.
@ -186,6 +205,9 @@ Ramel Eshed: system() is much slower than job_start(), why? (Aug 26)
Patch for Python: #622. (Roland Puntaier, 2016 Feb 2) Patch for Python: #622. (Roland Puntaier, 2016 Feb 2)
What does it change? What does it change?
Patch to make gd and gD work better for non-K&R code and with comments.
(Anton Lindqvist, 2016 Aug 29)
When generating the Unicode tables with runtime/tools/unicode.vim the When generating the Unicode tables with runtime/tools/unicode.vim the
emoji_width table has only one entry. emoji_width table has only one entry.

View File

@ -211,7 +211,7 @@ Ex commands: ~
|:cfdo| execute command in each file in error list |:cfdo| execute command in each file in error list
|:chistory| display quickfix list stack |:chistory| display quickfix list stack
|:clearjumps| clear the jump list |:clearjumps| clear the jump list
:filter only output lines that (do not) match a pattern |:filter| only output lines that (do not) match a pattern
|:helpclose| close one help window |:helpclose| close one help window
|:lbottom| scroll to the bottom of the location window |:lbottom| scroll to the bottom of the location window
|:ldo| execute command in valid location list entries |:ldo| execute command in valid location list entries
@ -12742,8 +12742,8 @@ Files: src/fileio.c, src/window.c, src/vim.h,
src/testdir/test_autocmd.vim, runtime/doc/autocmd.txt src/testdir/test_autocmd.vim, runtime/doc/autocmd.txt
Patch 7.4.2078 Patch 7.4.2078
Problem: Running checks in po diretory fails. Problem: Running checks in po directory fails.
Solution: Add colors used in syntax.c to the builtiin color table. Solution: Add colors used in syntax.c to the builtin color table.
Files: src/term.c Files: src/term.c
Patch 7.4.2079 Patch 7.4.2079

View File

@ -1,7 +1,7 @@
" Vim filetype plugin " Vim filetype plugin
" Language: Cucumber " Language: Cucumber
" Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2013 Jun 01 " Last Change: 2016 Aug 29
" Only do this when not done yet for this buffer " Only do this when not done yet for this buffer
if (exists("b:did_ftplugin")) if (exists("b:did_ftplugin"))
@ -19,27 +19,23 @@ setlocal omnifunc=CucumberComplete
let b:undo_ftplugin = "setl fo< com< cms< ofu<" let b:undo_ftplugin = "setl fo< com< cms< ofu<"
let b:cucumber_root = expand('%:p:h:s?.*[\/]\%(features\|stories\)\zs[\/].*??') let b:cucumber_root = expand('%:p:h:s?.*[\/]\%(features\|stories\)\zs[\/].*??')
if !exists("b:cucumber_steps_glob")
let b:cucumber_steps_glob = b:cucumber_root.'/**/*.rb'
endif
if !exists("g:no_plugin_maps") && !exists("g:no_cucumber_maps") if !exists("g:no_plugin_maps") && !exists("g:no_cucumber_maps")
nnoremap <silent><buffer> <C-]> :<C-U>exe <SID>jump('edit',v:count)<CR> cnoremap <SID>foldopen <Bar>if &foldopen =~# 'tag'<Bar>exe 'norm! zv'<Bar>endif
nnoremap <silent><buffer> [<C-D> :<C-U>exe <SID>jump('edit',v:count)<CR> nnoremap <silent> <script> <buffer> [<C-D> :<C-U>exe <SID>jump('edit',v:count)<SID>foldopen<CR>
nnoremap <silent><buffer> ]<C-D> :<C-U>exe <SID>jump('edit',v:count)<CR> nnoremap <silent> <script> <buffer> ]<C-D> :<C-U>exe <SID>jump('edit',v:count)<SID>foldopen<CR>
nnoremap <silent><buffer> <C-W>] :<C-U>exe <SID>jump('split',v:count)<CR> nnoremap <silent> <script> <buffer> <C-W>d :<C-U>exe <SID>jump('split',v:count)<SID>foldopen<CR>
nnoremap <silent><buffer> <C-W><C-]> :<C-U>exe <SID>jump('split',v:count)<CR> nnoremap <silent> <script> <buffer> <C-W><C-D> :<C-U>exe <SID>jump('split',v:count)<SID>foldopen<CR>
nnoremap <silent><buffer> <C-W>d :<C-U>exe <SID>jump('split',v:count)<CR> nnoremap <silent> <script> <buffer> [d :<C-U>exe <SID>jump('pedit',v:count)<CR>
nnoremap <silent><buffer> <C-W><C-D> :<C-U>exe <SID>jump('split',v:count)<CR> nnoremap <silent> <script> <buffer> ]d :<C-U>exe <SID>jump('pedit',v:count)<CR>
nnoremap <silent><buffer> <C-W>} :<C-U>exe <SID>jump('pedit',v:count)<CR>
nnoremap <silent><buffer> [d :<C-U>exe <SID>jump('pedit',v:count)<CR>
nnoremap <silent><buffer> ]d :<C-U>exe <SID>jump('pedit',v:count)<CR>
let b:undo_ftplugin .= let b:undo_ftplugin .=
\ "|sil! nunmap <buffer> <C-]>" .
\ "|sil! nunmap <buffer> [<C-D>" . \ "|sil! nunmap <buffer> [<C-D>" .
\ "|sil! nunmap <buffer> ]<C-D>" . \ "|sil! nunmap <buffer> ]<C-D>" .
\ "|sil! nunmap <buffer> <C-W>]" .
\ "|sil! nunmap <buffer> <C-W><C-]>" .
\ "|sil! nunmap <buffer> <C-W>d" . \ "|sil! nunmap <buffer> <C-W>d" .
\ "|sil! nunmap <buffer> <C-W><C-D>" . \ "|sil! nunmap <buffer> <C-W><C-D>" .
\ "|sil! nunmap <buffer> <C-W>}" .
\ "|sil! nunmap <buffer> [d" . \ "|sil! nunmap <buffer> [d" .
\ "|sil! nunmap <buffer> ]d" \ "|sil! nunmap <buffer> ]d"
endif endif
@ -59,7 +55,7 @@ endfunction
function! s:allsteps() function! s:allsteps()
let step_pattern = '\C^\s*\K\k*\>\s*(\=\s*\zs\S.\{-\}\ze\s*)\=\s*\%(do\|{\)\s*\%(|[^|]*|\s*\)\=\%($\|#\)' let step_pattern = '\C^\s*\K\k*\>\s*(\=\s*\zs\S.\{-\}\ze\s*)\=\s*\%(do\|{\)\s*\%(|[^|]*|\s*\)\=\%($\|#\)'
let steps = [] let steps = []
for file in split(glob(b:cucumber_root.'/**/*.rb'),"\n") for file in split(glob(b:cucumber_steps_glob),"\n")
let lines = readfile(file) let lines = readfile(file)
let num = 0 let num = 0
for line in lines for line in lines

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 s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+') let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+')
if b:eruby_subtype == '' if b:eruby_subtype == ''
let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+$') let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+\%(\ze+\w\+\)\=$')
endif endif
if b:eruby_subtype == 'rhtml' if b:eruby_subtype == 'rhtml'
let b:eruby_subtype = 'html' let b:eruby_subtype = 'html'

View File

@ -1,7 +1,7 @@
" Vim filetype plugin " Vim filetype plugin
" Language: generic git output " Language: generic git output
" Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2013 May 30 " Last Change: 2016 Aug 29
" Only do this when not done yet for this buffer " Only do this when not done yet for this buffer
if (exists("b:did_ftplugin")) if (exists("b:did_ftplugin"))
@ -12,6 +12,8 @@ let b:did_ftplugin = 1
if !exists('b:git_dir') if !exists('b:git_dir')
if expand('%:p') =~# '[\/]\.git[\/]modules[\/]' if expand('%:p') =~# '[\/]\.git[\/]modules[\/]'
" Stay out of the way " Stay out of the way
elseif expand('%:p') =~# '[\/]\.git[\/]worktrees'
let b:git_dir = matchstr(expand('%:p'),'.*\.git[\/]worktrees[\/][^\/]\+\>')
elseif expand('%:p') =~# '\.git\>' elseif expand('%:p') =~# '\.git\>'
let b:git_dir = matchstr(expand('%:p'),'.*\.git\>') let b:git_dir = matchstr(expand('%:p'),'.*\.git\>')
elseif $GIT_DIR != '' elseif $GIT_DIR != ''

View File

@ -1,7 +1,7 @@
" Vim filetype plugin " Vim filetype plugin
" Language: git commit file " Language: git commit file
" Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2013 May 30 " Last Change: 2016 Aug 29
" Only do this when not done yet for this buffer " Only do this when not done yet for this buffer
if (exists("b:did_ftplugin")) if (exists("b:did_ftplugin"))
@ -11,15 +11,10 @@ endif
runtime! ftplugin/git.vim runtime! ftplugin/git.vim
let b:did_ftplugin = 1 let b:did_ftplugin = 1
setlocal nomodeline tabstop=8 formatoptions-=croq formatoptions+=tl setlocal comments=:# commentstring=#\ %s
setlocal nomodeline tabstop=8 formatoptions+=tl textwidth=72
let b:undo_ftplugin = 'setl modeline< tabstop< formatoptions<' setlocal formatoptions-=c formatoptions-=r formatoptions-=o formatoptions-=q
let b:undo_ftplugin = 'setl modeline< tabstop< formatoptions< tw< com< cms<'
if &textwidth == 0
" make sure that log messages play nice with git-log on standard terminals
setlocal textwidth=72
let b:undo_ftplugin .= "|setl tw<"
endif
if exists("g:no_gitcommit_commands") || v:version < 700 if exists("g:no_gitcommit_commands") || v:version < 700
finish finish
@ -31,6 +26,8 @@ endif
command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(<bang>0,b:git_dir,<f-args>) command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(<bang>0,b:git_dir,<f-args>)
let b:undo_ftplugin = b:undo_ftplugin . "|delc DiffGitCached"
function! s:diffcomplete(A,L,P) function! s:diffcomplete(A,L,P)
let args = "" let args = ""
if a:P <= match(a:L." -- "," -- ")+3 if a:P <= match(a:L." -- "," -- ")+3

View File

@ -1,7 +1,7 @@
" Vim filetype plugin " Vim filetype plugin
" Language: git rebase --interactive " Language: git rebase --interactive
" Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2010 May 21 " Last Change: 2016 Aug 29
" Only do this when not done yet for this buffer " Only do this when not done yet for this buffer
if (exists("b:did_ftplugin")) if (exists("b:did_ftplugin"))
@ -12,10 +12,11 @@ runtime! ftplugin/git.vim
let b:did_ftplugin = 1 let b:did_ftplugin = 1
setlocal comments=:# commentstring=#\ %s formatoptions-=t setlocal comments=:# commentstring=#\ %s formatoptions-=t
setlocal nomodeline
if !exists("b:undo_ftplugin") if !exists("b:undo_ftplugin")
let b:undo_ftplugin = "" let b:undo_ftplugin = ""
endif endif
let b:undo_ftplugin = b:undo_ftplugin."|setl com< cms< fo<" let b:undo_ftplugin = b:undo_ftplugin."|setl com< cms< fo< ml<"
function! s:choose(word) function! s:choose(word)
s/^\(\w\+\>\)\=\(\s*\)\ze\x\{4,40\}\>/\=(strlen(submatch(1)) == 1 ? a:word[0] : a:word) . substitute(submatch(2),'^$',' ','')/e s/^\(\w\+\>\)\=\(\s*\)\ze\x\{4,40\}\>/\=(strlen(submatch(1)) == 1 ? a:word[0] : a:word) . substitute(submatch(2),'^$',' ','')/e

View File

@ -1,7 +1,7 @@
" Vim filetype plugin " Vim filetype plugin
" Language: Haml " Language: Haml
" Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2013 Jun 01 " Last Change: 2016 Aug 29
" Only do this when not done yet for this buffer " Only do this when not done yet for this buffer
if exists("b:did_ftplugin") if exists("b:did_ftplugin")

View File

@ -1,7 +1,7 @@
" Vim filetype plugin " Vim filetype plugin
" Language: Markdown " Language: Markdown
" Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2013 May 30 " Last Change: 2016 Aug 29
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
finish finish
@ -11,7 +11,7 @@ runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s
setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+ setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:
if exists('b:undo_ftplugin') if exists('b:undo_ftplugin')
let b:undo_ftplugin .= "|setl cms< com< fo< flp<" let b:undo_ftplugin .= "|setl cms< com< fo< flp<"
@ -19,4 +19,32 @@ else
let b:undo_ftplugin = "setl cms< com< fo< flp<" let b:undo_ftplugin = "setl cms< com< fo< flp<"
endif endif
function! MarkdownFold()
let line = getline(v:lnum)
" Regular headers
let depth = match(line, '\(^#\+\)\@<=\( .*$\)\@=')
if depth > 0
return ">" . depth
endif
" Setext style headings
let nextline = getline(v:lnum + 1)
if (line =~ '^.\+$') && (nextline =~ '^=\+$')
return ">1"
endif
if (line =~ '^.\+$') && (nextline =~ '^-\+$')
return ">2"
endif
return "="
endfunction
if has("folding") && exists("g:markdown_folding")
setlocal foldexpr=MarkdownFold()
setlocal foldmethod=expr
let b:undo_ftplugin .= " foldexpr< foldmethod<"
endif
" vim:set sw=2: " vim:set sw=2:

View File

@ -28,12 +28,13 @@ if exists("loaded_matchit") && !exists("b:match_words")
\ ':' . \ ':' .
\ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' . \ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' .
\ ':' . \ ':' .
\ '\<end\>' . \ '\%(^\|[^.\:@$]\)\@<=\<end\:\@!\>' .
\ ',{:},\[:\],(:)' \ ',{:},\[:\],(:)'
let b:match_skip = let b:match_skip =
\ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" . \ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" .
\ "\\<ruby\\%(String\\|StringDelimiter\\|ASCIICode\\|Escape\\|" . \ "\\<ruby\\%(String\\|StringDelimiter\\|ASCIICode\\|Escape\\|" .
\ "Regexp\\|RegexpDelimiter\\|" .
\ "Interpolation\\|NoInterpolation\\|Comment\\|Documentation\\|" . \ "Interpolation\\|NoInterpolation\\|Comment\\|Documentation\\|" .
\ "ConditionalModifier\\|RepeatModifier\\|OptionalDo\\|" . \ "ConditionalModifier\\|RepeatModifier\\|OptionalDo\\|" .
\ "Function\\|BlockArgument\\|KeywordAsMethod\\|ClassVariable\\|" . \ "Function\\|BlockArgument\\|KeywordAsMethod\\|ClassVariable\\|" .
@ -43,7 +44,7 @@ endif
setlocal formatoptions-=t formatoptions+=croql setlocal formatoptions-=t formatoptions+=croql
setlocal include=^\\s*\\<\\(load\\>\\\|require\\>\\\|autoload\\s*:\\=[\"']\\=\\h\\w*[\"']\\=,\\) setlocal include=^\\s*\\<\\(load\\>\\\|require\\>\\\|autoload\\s*:\\=[\"']\\=\\h\\w*[\"']\\=,\\)
setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.rb','') setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'\%(\.rb\)\=$','.rb','')
setlocal suffixesadd=.rb setlocal suffixesadd=.rb
if exists("&ofu") && has("ruby") if exists("&ofu") && has("ruby")
@ -66,32 +67,32 @@ if !exists('g:ruby_version_paths')
let g:ruby_version_paths = {} let g:ruby_version_paths = {}
endif endif
function! s:query_path(root) function! s:query_path(root) abort
let code = "print $:.join %q{,}" let code = "print $:.join %q{,}"
if &shell =~# 'sh' && $PATH !~# '\s' if &shell =~# 'sh'
let prefix = 'env PATH='.$PATH.' ' let prefix = 'env PATH='.shellescape($PATH).' '
else else
let prefix = '' let prefix = ''
endif endif
if &shellxquote == "'" if &shellxquote == "'"
let path_check = prefix.'ruby -e "' . code . '"' let path_check = prefix.'ruby --disable-gems -e "' . code . '"'
else else
let path_check = prefix."ruby -e '" . code . "'" let path_check = prefix."ruby --disable-gems -e '" . code . "'"
endif endif
let cd = haslocaldir() ? 'lcd' : 'cd' let cd = haslocaldir() ? 'lcd' : 'cd'
let cwd = getcwd() let cwd = fnameescape(getcwd())
try try
exe cd fnameescape(a:root) exe cd fnameescape(a:root)
let path = split(system(path_check),',') let path = split(system(path_check),',')
exe cd fnameescape(cwd) exe cd cwd
return path return path
finally finally
exe cd fnameescape(cwd) exe cd cwd
endtry endtry
endfunction endfunction
function! s:build_path(path) function! s:build_path(path) abort
let path = join(map(copy(a:path), 'v:val ==# "." ? "" : v:val'), ',') let path = join(map(copy(a:path), 'v:val ==# "." ? "" : v:val'), ',')
if &g:path !~# '\v^\.%(,/%(usr|emx)/include)=,,$' if &g:path !~# '\v^\.%(,/%(usr|emx)/include)=,,$'
let path = substitute(&g:path,',,$',',','') . ',' . path let path = substitute(&g:path,',,$',',','') . ',' . path
@ -101,7 +102,7 @@ endfunction
if !exists('b:ruby_version') && !exists('g:ruby_path') && isdirectory(expand('%:p:h')) if !exists('b:ruby_version') && !exists('g:ruby_path') && isdirectory(expand('%:p:h'))
let s:version_file = findfile('.ruby-version', '.;') let s:version_file = findfile('.ruby-version', '.;')
if !empty(s:version_file) if !empty(s:version_file) && filereadable(s:version_file)
let b:ruby_version = get(readfile(s:version_file, '', 1), '') let b:ruby_version = get(readfile(s:version_file, '', 1), '')
if !has_key(g:ruby_version_paths, b:ruby_version) if !has_key(g:ruby_version_paths, b:ruby_version)
let g:ruby_version_paths[b:ruby_version] = s:query_path(fnamemodify(s:version_file, ':p:h')) let g:ruby_version_paths[b:ruby_version] = s:query_path(fnamemodify(s:version_file, ':p:h'))
@ -135,7 +136,7 @@ if exists('s:ruby_paths') && stridx(&l:tags, join(map(copy(s:ruby_paths),'v:val.
let &l:tags = &tags . ',' . join(map(copy(s:ruby_paths),'v:val."/tags"'),',') let &l:tags = &tags . ',' . join(map(copy(s:ruby_paths),'v:val."/tags"'),',')
endif endif
if has("gui_win32") && !exists("b:browsefilter") if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "Ruby Source Files (*.rb)\t*.rb\n" . let b:browsefilter = "Ruby Source Files (*.rb)\t*.rb\n" .
\ "All Files (*.*)\t*.*\n" \ "All Files (*.*)\t*.*\n"
endif endif
@ -145,7 +146,22 @@ let b:undo_ftplugin = "setl fo< inc< inex< sua< def< com< cms< path< tags< kp<"
\."| if exists('&ofu') && has('ruby') | setl ofu< | endif" \."| if exists('&ofu') && has('ruby') | setl ofu< | endif"
\."| if has('balloon_eval') && exists('+bexpr') | setl bexpr< | endif" \."| if has('balloon_eval') && exists('+bexpr') | setl bexpr< | endif"
function! s:map(mode, flags, map) abort
let from = matchstr(a:map, '\S\+')
if empty(mapcheck(from, a:mode))
exe a:mode.'map' '<buffer>'.(a:0 ? a:1 : '') a:map
let b:undo_ftplugin .= '|sil! '.a:mode.'unmap <buffer> '.from
endif
endfunction
cmap <buffer><script><expr> <Plug><cword> substitute(RubyCursorIdentifier(),'^$',"\022\027",'')
cmap <buffer><script><expr> <Plug><cfile> substitute(RubyCursorFile(),'^$',"\022\006",'')
let b:undo_ftplugin .= "| sil! cunmap <buffer> <Plug><cword>| sil! cunmap <buffer> <Plug><cfile>"
if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps") if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
nmap <buffer><script> <SID>: :<C-U>
nmap <buffer><script> <SID>c: :<C-U><C-R>=v:count ? v:count : ''<CR>
nnoremap <silent> <buffer> [m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','b','n')<CR> nnoremap <silent> <buffer> [m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','b','n')<CR>
nnoremap <silent> <buffer> ]m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','','n')<CR> nnoremap <silent> <buffer> ]m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','','n')<CR>
nnoremap <silent> <buffer> [M :<C-U>call <SID>searchsyn('\<end\>','rubyDefine','b','n')<CR> nnoremap <silent> <buffer> [M :<C-U>call <SID>searchsyn('\<end\>','rubyDefine','b','n')<CR>
@ -168,7 +184,7 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
\."| sil! exe 'unmap <buffer> [[' | sil! exe 'unmap <buffer> ]]' | sil! exe 'unmap <buffer> []' | sil! exe 'unmap <buffer> ]['" \."| sil! exe 'unmap <buffer> [[' | sil! exe 'unmap <buffer> ]]' | sil! exe 'unmap <buffer> []' | sil! exe 'unmap <buffer> ]['"
\."| sil! exe 'unmap <buffer> [m' | sil! exe 'unmap <buffer> ]m' | sil! exe 'unmap <buffer> [M' | sil! exe 'unmap <buffer> ]M'" \."| sil! exe 'unmap <buffer> [m' | sil! exe 'unmap <buffer> ]m' | sil! exe 'unmap <buffer> [M' | sil! exe 'unmap <buffer> ]M'"
if maparg('im','n') == '' if maparg('im','x') == '' && maparg('im','o') == '' && maparg('am','x') == '' && maparg('am','o') == ''
onoremap <silent> <buffer> im :<C-U>call <SID>wrap_i('[m',']M')<CR> onoremap <silent> <buffer> im :<C-U>call <SID>wrap_i('[m',']M')<CR>
onoremap <silent> <buffer> am :<C-U>call <SID>wrap_a('[m',']M')<CR> onoremap <silent> <buffer> am :<C-U>call <SID>wrap_a('[m',']M')<CR>
xnoremap <silent> <buffer> im :<C-U>call <SID>wrap_i('[m',']M')<CR> xnoremap <silent> <buffer> im :<C-U>call <SID>wrap_i('[m',']M')<CR>
@ -178,7 +194,7 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
\."| sil! exe 'xunmap <buffer> im' | sil! exe 'xunmap <buffer> am'" \."| sil! exe 'xunmap <buffer> im' | sil! exe 'xunmap <buffer> am'"
endif endif
if maparg('iM','n') == '' if maparg('iM','x') == '' && maparg('iM','o') == '' && maparg('aM','x') == '' && maparg('aM','o') == ''
onoremap <silent> <buffer> iM :<C-U>call <SID>wrap_i('[[','][')<CR> onoremap <silent> <buffer> iM :<C-U>call <SID>wrap_i('[[','][')<CR>
onoremap <silent> <buffer> aM :<C-U>call <SID>wrap_a('[[','][')<CR> onoremap <silent> <buffer> aM :<C-U>call <SID>wrap_a('[[','][')<CR>
xnoremap <silent> <buffer> iM :<C-U>call <SID>wrap_i('[[','][')<CR> xnoremap <silent> <buffer> iM :<C-U>call <SID>wrap_i('[[','][')<CR>
@ -188,33 +204,24 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
\."| sil! exe 'xunmap <buffer> iM' | sil! exe 'xunmap <buffer> aM'" \."| sil! exe 'xunmap <buffer> iM' | sil! exe 'xunmap <buffer> aM'"
endif endif
if maparg("\<C-]>",'n') == '' call s:map('c', '', '<C-R><C-W> <Plug><cword>')
nnoremap <silent> <buffer> <C-]> :<C-U>exe v:count1."tag <C-R>=RubyCursorIdentifier()<CR>"<CR> call s:map('c', '', '<C-R><C-F> <Plug><cfile>')
nnoremap <silent> <buffer> g<C-]> :<C-U>exe "tjump <C-R>=RubyCursorIdentifier()<CR>"<CR>
nnoremap <silent> <buffer> g] :<C-U>exe "tselect <C-R>=RubyCursorIdentifier()<CR>"<CR>
nnoremap <silent> <buffer> <C-W>] :<C-U>exe v:count1."stag <C-R>=RubyCursorIdentifier()<CR>"<CR>
nnoremap <silent> <buffer> <C-W><C-]> :<C-U>exe v:count1."stag <C-R>=RubyCursorIdentifier()<CR>"<CR>
nnoremap <silent> <buffer> <C-W>g<C-]> :<C-U>exe "stjump <C-R>=RubyCursorIdentifier()<CR>"<CR>
nnoremap <silent> <buffer> <C-W>g] :<C-U>exe "stselect <C-R>=RubyCursorIdentifier()<CR>"<CR>
nnoremap <silent> <buffer> <C-W>} :<C-U>exe "ptag <C-R>=RubyCursorIdentifier()<CR>"<CR>
nnoremap <silent> <buffer> <C-W>g} :<C-U>exe "ptjump <C-R>=RubyCursorIdentifier()<CR>"<CR>
let b:undo_ftplugin = b:undo_ftplugin
\."| sil! exe 'nunmap <buffer> <C-]>'| sil! exe 'nunmap <buffer> g<C-]>'| sil! exe 'nunmap <buffer> g]'"
\."| sil! exe 'nunmap <buffer> <C-W>]'| sil! exe 'nunmap <buffer> <C-W><C-]>'"
\."| sil! exe 'nunmap <buffer> <C-W>g<C-]>'| sil! exe 'nunmap <buffer> <C-W>g]'"
\."| sil! exe 'nunmap <buffer> <C-W>}'| sil! exe 'nunmap <buffer> <C-W>g}'"
endif
if maparg("gf",'n') == '' cmap <buffer><script><expr> <SID>tagzv &foldopen =~# 'tag' ? '<Bar>norm! zv' : ''
" By using findfile() rather than gf's normal behavior, we prevent call s:map('n', '<silent>', '<C-]> <SID>:exe v:count1."tag <Plug><cword>"<SID>tagzv<CR>')
" erroneously editing a directory. call s:map('n', '<silent>', 'g<C-]> <SID>:exe "tjump <Plug><cword>"<SID>tagzv<CR>')
nnoremap <silent> <buffer> gf :<C-U>exe <SID>gf(v:count1,"gf",'edit')<CR> call s:map('n', '<silent>', 'g] <SID>:exe "tselect <Plug><cword>"<SID>tagzv<CR>')
nnoremap <silent> <buffer> <C-W>f :<C-U>exe <SID>gf(v:count1,"\<Lt>C-W>f",'split')<CR> call s:map('n', '<silent>', '<C-W>] <SID>:exe v:count1."stag <Plug><cword>"<SID>tagzv<CR>')
nnoremap <silent> <buffer> <C-W><C-F> :<C-U>exe <SID>gf(v:count1,"\<Lt>C-W>\<Lt>C-F>",'split')<CR> call s:map('n', '<silent>', '<C-W><C-]> <SID>:exe v:count1."stag <Plug><cword>"<SID>tagzv<CR>')
nnoremap <silent> <buffer> <C-W>gf :<C-U>exe <SID>gf(v:count1,"\<Lt>C-W>gf",'tabedit')<CR> call s:map('n', '<silent>', '<C-W>g<C-]> <SID>:exe "stjump <Plug><cword>"<SID>tagzv<CR>')
let b:undo_ftplugin = b:undo_ftplugin call s:map('n', '<silent>', '<C-W>g] <SID>:exe "stselect <Plug><cword>"<SID>tagzv<CR>')
\."| sil! exe 'nunmap <buffer> gf' | sil! exe 'nunmap <buffer> <C-W>f' | sil! exe 'nunmap <buffer> <C-W><C-F>' | sil! exe 'nunmap <buffer> <C-W>gf'" call s:map('n', '<silent>', '<C-W>} <SID>:exe v:count1."ptag <Plug><cword>"<CR>')
endif call s:map('n', '<silent>', '<C-W>g} <SID>:exe "ptjump <Plug><cword>"<CR>')
call s:map('n', '<silent>', 'gf <SID>c:find <Plug><cfile><CR>')
call s:map('n', '<silent>', '<C-W>f <SID>c:sfind <Plug><cfile><CR>')
call s:map('n', '<silent>', '<C-W><C-F> <SID>c:sfind <Plug><cfile><CR>')
call s:map('n', '<silent>', '<C-W>gf <SID>c:tabfind <Plug><cfile><CR>')
endif endif
let &cpo = s:cpo_save let &cpo = s:cpo_save
@ -225,7 +232,7 @@ if exists("g:did_ruby_ftplugin_functions")
endif endif
let g:did_ruby_ftplugin_functions = 1 let g:did_ruby_ftplugin_functions = 1
function! RubyBalloonexpr() function! RubyBalloonexpr() abort
if !exists('s:ri_found') if !exists('s:ri_found')
let s:ri_found = executable('ri') let s:ri_found = executable('ri')
endif endif
@ -274,13 +281,13 @@ function! RubyBalloonexpr()
endif endif
endfunction endfunction
function! s:searchsyn(pattern,syn,flags,mode) function! s:searchsyn(pattern, syn, flags, mode) abort
let cnt = v:count1
norm! m' norm! m'
if a:mode ==# 'v' if a:mode ==# 'v'
norm! gv norm! gv
endif endif
let i = 0 let i = 0
let cnt = v:count ? v:count : 1
while i < cnt while i < cnt
let i = i + 1 let i = i + 1
let line = line('.') let line = line('.')
@ -296,11 +303,11 @@ function! s:searchsyn(pattern,syn,flags,mode)
endwhile endwhile
endfunction endfunction
function! s:synname() function! s:synname() abort
return synIDattr(synID(line('.'),col('.'),0),'name') return synIDattr(synID(line('.'),col('.'),0),'name')
endfunction endfunction
function! s:wrap_i(back,forward) function! s:wrap_i(back,forward) abort
execute 'norm k'.a:forward execute 'norm k'.a:forward
let line = line('.') let line = line('.')
execute 'norm '.a:back execute 'norm '.a:back
@ -310,7 +317,7 @@ function! s:wrap_i(back,forward)
execute 'norm jV'.a:forward.'k' execute 'norm jV'.a:forward.'k'
endfunction endfunction
function! s:wrap_a(back,forward) function! s:wrap_a(back,forward) abort
execute 'norm '.a:forward execute 'norm '.a:forward
if line('.') < line('$') && getline(line('.')+1) ==# '' if line('.') < line('$') && getline(line('.')+1) ==# ''
let after = 1 let after = 1
@ -328,37 +335,55 @@ function! s:wrap_a(back,forward)
endif endif
endfunction endfunction
function! RubyCursorIdentifier() function! RubyCursorIdentifier() abort
let asciicode = '\%(\w\|[]})\"'."'".']\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)' let asciicode = '\%(\w\|[]})\"'."'".']\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)'
let number = '\%(\%(\w\|[]})\"'."'".']\s*\)\@<!-\)\=\%(\<[[:digit:]_]\+\%(\.[[:digit:]_]\+\)\=\%([Ee][[:digit:]_]\+\)\=\>\|\<0[xXbBoOdD][[:xdigit:]_]\+\>\)\|'.asciicode let number = '\%(\%(\w\|[]})\"'."'".']\s*\)\@<!-\)\=\%(\<[[:digit:]_]\+\%(\.[[:digit:]_]\+\)\=\%([Ee][[:digit:]_]\+\)\=\>\|\<0[xXbBoOdD][[:xdigit:]_]\+\>\)\|'.asciicode
let operator = '\%(\[\]\|<<\|<=>\|[!<>]=\=\|===\=\|[!=]\~\|>>\|\*\*\|\.\.\.\=\|=>\|[~^&|*/%+-]\)' let operator = '\%(\[\]\|<<\|<=>\|[!<>]=\=\|===\=\|[!=]\~\|>>\|\*\*\|\.\.\.\=\|=>\|[~^&|*/%+-]\)'
let method = '\%(\<[_a-zA-Z]\w*\>\%([?!]\|\s*=>\@!\)\=\)' let method = '\%(\.[_a-zA-Z]\w*\s*=>\@!\|\<[_a-zA-Z]\w*\>[?!]\=\)'
let global = '$\%([!$&"'."'".'*+,./:;<=>?@\`~]\|-\=\w\+\>\)' let global = '$\%([!$&"'."'".'*+,./:;<=>?@\`~]\|-\=\w\+\>\)'
let symbolizable = '\%(\%(@@\=\)\w\+\>\|'.global.'\|'.method.'\|'.operator.'\)' let symbolizable = '\%(\%(@@\=\)\w\+\>\|'.global.'\|'.method.'\|'.operator.'\)'
let pattern = '\C\s*\%('.number.'\|\%(:\@<!:\)\='.symbolizable.'\)' let pattern = '\C\s*\%('.number.'\|\%(:\@<!:\)\='.symbolizable.'\)'
let [lnum, col] = searchpos(pattern,'bcn',line('.')) let [lnum, col] = searchpos(pattern,'bcn',line('.'))
let raw = matchstr(getline('.')[col-1 : ],pattern) let raw = matchstr(getline('.')[col-1 : ],pattern)
let stripped = substitute(substitute(raw,'\s\+=$','=',''),'^\s*:\=','','') let stripped = substitute(substitute(raw,'\s\+=$','=',''),'^\s*[:.]\=','','')
return stripped == '' ? expand("<cword>") : stripped return stripped == '' ? expand("<cword>") : stripped
endfunction endfunction
function! s:gf(count,map,edit) abort function! RubyCursorFile() abort
if getline('.') =~# '^\s*require_relative\s*\(["'']\).*\1\s*$' let isfname = &isfname
let target = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1') try
return a:edit.' %:h/'.target.'.rb' set isfname+=:
elseif getline('.') =~# '^\s*\%(require[( ]\|load[( ]\|autoload[( ]:\w\+,\)\s*\s*\%(::\)\=File\.expand_path(\(["'']\)\.\./.*\1,\s*__FILE__)\s*$' let cfile = expand('<cfile>')
let target = matchstr(getline('.'),'\(["'']\)\.\./\zs.\{-\}\ze\1') finally
return a:edit.' %:h/'.target.'.rb' let isfname = &isfname
endtry
let pre = matchstr(strpart(getline('.'), 0, col('.')-1), '.*\f\@<!')
let post = matchstr(strpart(getline('.'), col('.')), '\f\@!.*')
let ext = getline('.') =~# '^\s*\%(require\%(_relative\)\=\|autoload\)\>' && cfile !~# '\.rb$' ? '.rb' : ''
if s:synname() ==# 'rubyConstant'
let cfile = substitute(cfile,'\.\w\+[?!=]\=$','','')
let cfile = substitute(cfile,'::','/','g')
let cfile = substitute(cfile,'\(\u\+\)\(\u\l\)','\1_\2', 'g')
let cfile = substitute(cfile,'\(\l\|\d\)\(\u\)','\1_\2', 'g')
return tolower(cfile) . '.rb'
elseif getline('.') =~# '^\s*require_relative\s*\(["'']\).*\1\s*$'
let cfile = expand('%:p:h') . '/' . matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1') . ext
elseif getline('.') =~# '^\s*\%(require[( ]\|load[( ]\|autoload[( ]:\w\+,\)\s*\%(::\)\=File\.expand_path(\(["'']\)\.\./.*\1,\s*__FILE__)\s*$'
let target = matchstr(getline('.'),'\(["'']\)\.\.\zs/.\{-\}\ze\1')
let cfile = expand('%:p:h') . target . ext
elseif getline('.') =~# '^\s*\%(require \|load \|autoload :\w\+,\)\s*\(["'']\).*\1\s*$' elseif getline('.') =~# '^\s*\%(require \|load \|autoload :\w\+,\)\s*\(["'']\).*\1\s*$'
let target = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1') let cfile = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1') . ext
elseif pre.post =~# '\<File.expand_path[( ].*[''"]\{2\}, *__FILE__\>' && cfile =~# '^\.\.'
let cfile = expand('%:p:h') . strpart(cfile, 2)
else else
let target = expand('<cfile>') return substitute(cfile, '\C\v^(.*):(\d+)%(:in)=$', '+\2 \1', '')
endif endif
let found = findfile(target, &path, a:count) let cwdpat = '^\M' . substitute(getcwd(), '[\/]', '\\[\\/]', 'g').'\ze\[\/]'
if found ==# '' let cfile = substitute(cfile, cwdpat, '.', '')
return 'norm! '.a:count.a:map if fnameescape(cfile) !=# cfile
return '+ '.fnameescape(cfile)
else else
return a:edit.' '.fnameescape(found) return cfile
endif endif
endfunction endfunction

View File

@ -1,7 +1,7 @@
" Vim filetype plugin " Vim filetype plugin
" Language: Sass " Language: Sass
" Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2010 Jul 26 " Last Change: 2016 Aug 29
" Only do this when not done yet for this buffer " Only do this when not done yet for this buffer
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
@ -9,8 +9,9 @@ if exists("b:did_ftplugin")
endif endif
let b:did_ftplugin = 1 let b:did_ftplugin = 1
let b:undo_ftplugin = "setl cms< def< inc< inex< ofu< sua<" let b:undo_ftplugin = "setl com< cms< def< inc< inex< ofu< sua<"
setlocal comments=://
setlocal commentstring=//\ %s setlocal commentstring=//\ %s
setlocal define=^\\s*\\%(@mixin\\\|=\\) setlocal define=^\\s*\\%(@mixin\\\|=\\)
setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','') setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','')

View File

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

View File

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

View File

@ -19,6 +19,9 @@ else
endif endif
unlet! b:did_indent unlet! b:did_indent
" Force HTML indent to not keep state.
let b:html_indent_usestate = 0
if &l:indentexpr == '' if &l:indentexpr == ''
if &l:cindent if &l:cindent
let &l:indentexpr = 'cindent(v:lnum)' let &l:indentexpr = 'cindent(v:lnum)'
@ -38,7 +41,18 @@ if exists("*GetErubyIndent")
finish finish
endif endif
" this file uses line continuations
let s:cpo_sav = &cpo
set cpo&vim
function! GetErubyIndent(...) function! GetErubyIndent(...)
" The value of a single shift-width
if exists('*shiftwidth')
let sw = shiftwidth()
else
let sw = &sw
endif
if a:0 && a:1 == '.' if a:0 && a:1 == '.'
let v:lnum = line('.') let v:lnum = line('.')
elseif a:0 && a:1 =~ '^\d' elseif a:0 && a:1 =~ '^\d'
@ -52,31 +66,44 @@ function! GetErubyIndent(...)
let ind = GetRubyIndent(v:lnum) let ind = GetRubyIndent(v:lnum)
else else
exe "let ind = ".b:eruby_subtype_indentexpr exe "let ind = ".b:eruby_subtype_indentexpr
" Workaround for Andy Wokula's HTML indent. This should be removed after
" some time, since the newest version is fixed in a different way.
if b:eruby_subtype_indentexpr =~# '^HtmlIndent('
\ && exists('b:indent')
\ && type(b:indent) == type({})
\ && has_key(b:indent, 'lnum')
" Force HTML indent to not keep state
let b:indent.lnum = -1
endif
endif endif
let lnum = prevnonblank(v:lnum-1) let lnum = prevnonblank(v:lnum-1)
let line = getline(lnum) let line = getline(lnum)
let cline = getline(v:lnum) let cline = getline(v:lnum)
if cline =~# '^\s*<%[-=]\=\s*\%(}\|end\|else\|\%(ensure\|rescue\|elsif\|when\).\{-\}\)\s*\%([-=]\=%>\|$\)' if cline =~# '^\s*<%[-=]\=\s*\%(}\|end\|else\|\%(ensure\|rescue\|elsif\|when\).\{-\}\)\s*\%([-=]\=%>\|$\)'
let ind = ind - &sw let ind = ind - sw
endif endif
if line =~# '\S\s*<%[-=]\=\s*\%(}\|end\).\{-\}\s*\%([-=]\=%>\|$\)' if line =~# '\S\s*<%[-=]\=\s*\%(}\|end\).\{-\}\s*\%([-=]\=%>\|$\)'
let ind = ind - &sw let ind = ind - sw
endif endif
if line =~# '\%({\|\<do\)\%(\s*|[^|]*|\)\=\s*[-=]\=%>' if line =~# '\%({\|\<do\)\%(\s*|[^|]*|\)\=\s*[-=]\=%>'
let ind = ind + &sw let ind = ind + sw
elseif line =~# '<%[-=]\=\s*\%(module\|class\|def\|if\|for\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\)\>.*%>' elseif line =~# '<%[-=]\=\s*\%(module\|class\|def\|if\|for\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\)\>.*%>'
let ind = ind + &sw let ind = ind + sw
endif endif
if line =~# '^\s*<%[=#-]\=\s*$' && cline !~# '^\s*end\>' if line =~# '^\s*<%[=#-]\=\s*$' && cline !~# '^\s*end\>'
let ind = ind + &sw let ind = ind + sw
endif endif
if line !~# '^\s*<%' && line =~# '%>\s*$' if line !~# '^\s*<%' && line =~# '%>\s*$' && line !~# '^\s*end\>'
let ind = ind - &sw let ind = ind - sw
endif endif
if cline =~# '^\s*[-=]\=%>\s*$' if cline =~# '^\s*[-=]\=%>\s*$'
let ind = ind - &sw let ind = ind - sw
endif endif
return ind return ind
endfunction endfunction
let &cpo = s:cpo_sav
unlet! s:cpo_sav
" vim:set sw=2 sts=2 ts=8 noet: " vim:set sw=2 sts=2 ts=8 noet:

View File

@ -1,7 +1,7 @@
" Vim indent file " Vim indent file
" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77) " Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77)
" Version: 0.45 " Version: 0.45
" Last Change: 2016 Aug. 18 " Last Change: 2016 Aug. 29
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/> " Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
" Usage: For instructions, do :help fortran-indent from Vim " Usage: For instructions, do :help fortran-indent from Vim
" Credits: " Credits:
@ -152,9 +152,6 @@ function FortranGetIndent(lnum)
if prevstat =~ '&\s*$' && prev2stat !~ '&\s*$' if prevstat =~ '&\s*$' && prev2stat !~ '&\s*$'
let ind = ind + shiftwidth() let ind = ind + shiftwidth()
endif endif
if prevstat =~ '&\s*$' && prevstat =~ '\<else\s*if\>'
let ind = ind - shiftwidth()
endif
"Line after last continuation line "Line after last continuation line
if prevstat !~ '&\s*$' && prev2stat =~ '&\s*$' && prevstat !~? '\<then\>' if prevstat !~ '&\s*$' && prev2stat =~ '&\s*$' && prevstat !~? '\<then\>'
let ind = ind - shiftwidth() let ind = ind - shiftwidth()

View File

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

View File

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

View File

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

View File

@ -13,12 +13,23 @@ if exists("b:did_indent")
endif endif
let b:did_indent = 1 let b:did_indent = 1
if !exists('g:ruby_indent_access_modifier_style')
" Possible values: "normal", "indent", "outdent"
let g:ruby_indent_access_modifier_style = 'normal'
endif
if !exists('g:ruby_indent_block_style')
" Possible values: "expression", "do"
let g:ruby_indent_block_style = 'expression'
endif
setlocal nosmartindent setlocal nosmartindent
" Now, set up our indentation expression and keys that trigger it. " Now, set up our indentation expression and keys that trigger it.
setlocal indentexpr=GetRubyIndent(v:lnum) setlocal indentexpr=GetRubyIndent(v:lnum)
setlocal indentkeys=0{,0},0),0],!^F,o,O,e setlocal indentkeys=0{,0},0),0],!^F,o,O,e,:,.
setlocal indentkeys+==end,=else,=elsif,=when,=ensure,=rescue,==begin,==end setlocal indentkeys+==end,=else,=elsif,=when,=ensure,=rescue,==begin,==end
setlocal indentkeys+==private,=protected,=public
" Only define the function once. " Only define the function once.
if exists("*GetRubyIndent") if exists("*GetRubyIndent")
@ -34,7 +45,7 @@ set cpo&vim
" Regex of syntax group names that are or delimit strings/symbols or are comments. " Regex of syntax group names that are or delimit strings/symbols or are comments.
let s:syng_strcom = '\<ruby\%(Regexp\|RegexpDelimiter\|RegexpEscape' . let s:syng_strcom = '\<ruby\%(Regexp\|RegexpDelimiter\|RegexpEscape' .
\ '\|Symbol\|String\|StringDelimiter\|StringEscape\|ASCIICode' . \ '\|Symbol\|String\|StringDelimiter\|StringEscape\|ASCIICode' .
\ '\|Interpolation\|NoInterpolation\|Comment\|Documentation\)\>' \ '\|Interpolation\|InterpolationDelimiter\|NoInterpolation\|Comment\|Documentation\)\>'
" Regex of syntax group names that are strings. " Regex of syntax group names that are strings.
let s:syng_string = let s:syng_string =
@ -49,9 +60,10 @@ let s:skip_expr =
\ "synIDattr(synID(line('.'),col('.'),1),'name') =~ '".s:syng_strcom."'" \ "synIDattr(synID(line('.'),col('.'),1),'name') =~ '".s:syng_strcom."'"
" Regex used for words that, at the start of a line, add a level of indent. " Regex used for words that, at the start of a line, add a level of indent.
let s:ruby_indent_keywords = '^\s*\zs\<\%(module\|class\|def\|if\|for' . let s:ruby_indent_keywords =
\ '\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure' . \ '^\s*\zs\<\%(module\|class\|if\|for' .
\ '\|rescue\):\@!\>' . \ '\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue' .
\ '\|\%(public\|protected\|private\)\=\s*def\):\@!\>' .
\ '\|\%([=,*/%+-]\|<<\|>>\|:\s\)\s*\zs' . \ '\|\%([=,*/%+-]\|<<\|>>\|:\s\)\s*\zs' .
\ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>' \ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>'
@ -64,7 +76,8 @@ let s:ruby_deindent_keywords =
" TODO: the do here should be restricted somewhat (only at end of line)? " TODO: the do here should be restricted somewhat (only at end of line)?
let s:end_start_regex = let s:end_start_regex =
\ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' . \ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' .
\ '\<\%(module\|class\|def\|if\|for\|while\|until\|case\|unless\|begin\):\@!\>' . \ '\<\%(module\|class\|if\|for\|while\|until\|case\|unless\|begin' .
\ '\|\%(public\|protected\|private\)\=\s*def\):\@!\>' .
\ '\|\%(^\|[^.:@$]\)\@<=\<do:\@!\>' \ '\|\%(^\|[^.:@$]\)\@<=\<do:\@!\>'
" Regex that defines the middle-match for the 'end' keyword. " Regex that defines the middle-match for the 'end' keyword.
@ -82,16 +95,35 @@ let s:end_skip_expr = s:skip_expr .
let s:non_bracket_continuation_regex = '\%([\\.,:*/%+]\|\<and\|\<or\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$' let s:non_bracket_continuation_regex = '\%([\\.,:*/%+]\|\<and\|\<or\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$'
" Regex that defines continuation lines. " Regex that defines continuation lines.
" TODO: this needs to deal with if ...: and so on
let s:continuation_regex = let s:continuation_regex =
\ '\%(%\@<![({[\\.,:*/%+]\|\<and\|\<or\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$' \ '\%(%\@<![({[\\.,:*/%+]\|\<and\|\<or\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$'
" Regex that defines continuable keywords
let s:continuable_regex =
\ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' .
\ '\<\%(if\|for\|while\|until\|unless\):\@!\>'
" Regex that defines bracket continuations " Regex that defines bracket continuations
let s:bracket_continuation_regex = '%\@<!\%([({[]\)\s*\%(#.*\)\=$' let s:bracket_continuation_regex = '%\@<!\%([({[]\)\s*\%(#.*\)\=$'
" Regex that defines dot continuations
let s:dot_continuation_regex = '%\@<!\.\s*\%(#.*\)\=$'
" Regex that defines backslash continuations
let s:backslash_continuation_regex = '%\@<!\\\s*$'
" Regex that defines end of bracket continuation followed by another continuation
let s:bracket_switch_continuation_regex = '^\([^(]\+\zs).\+\)\+'.s:continuation_regex
" Regex that defines the first part of a splat pattern " Regex that defines the first part of a splat pattern
let s:splat_regex = '[[,(]\s*\*\s*\%(#.*\)\=$' let s:splat_regex = '[[,(]\s*\*\s*\%(#.*\)\=$'
" Regex that describes all indent access modifiers
let s:access_modifier_regex = '\C^\s*\%(public\|protected\|private\)\s*\%(#.*\)\=$'
" Regex that describes the indent access modifiers (excludes public)
let s:indent_access_modifier_regex = '\C^\s*\%(protected\|private\)\s*\%(#.*\)\=$'
" Regex that defines blocks. " Regex that defines blocks.
" "
" Note that there's a slight problem with this regex and s:continuation_regex. " Note that there's a slight problem with this regex and s:continuation_regex.
@ -102,10 +134,13 @@ let s:splat_regex = '[[,(]\s*\*\s*\%(#.*\)\=$'
" The reason is that the pipe matches a hanging "|" operator. " The reason is that the pipe matches a hanging "|" operator.
" "
let s:block_regex = let s:block_regex =
\ '\%(\<do:\@!\>\|%\@<!{\)\s*\%(|\s*(*\s*\%([*@&]\=\h\w*,\=\s*\)\%(,\s*(*\s*[*@&]\=\h\w*\s*)*\s*\)*|\)\=\s*\%(#.*\)\=$' \ '\%(\<do:\@!\>\|%\@<!{\)\s*\%(|[^|]*|\)\=\s*\%(#.*\)\=$'
let s:block_continuation_regex = '^\s*[^])}\t ].*'.s:block_regex let s:block_continuation_regex = '^\s*[^])}\t ].*'.s:block_regex
" Regex that describes a leading operator (only a method call's dot for now)
let s:leading_operator_regex = '^\s*[.]'
" 2. Auxiliary Functions {{{1 " 2. Auxiliary Functions {{{1
" ====================== " ======================
@ -165,7 +200,21 @@ function s:GetMSL(lnum)
" Otherwise, terminate search as we have found our MSL already. " Otherwise, terminate search as we have found our MSL already.
let line = getline(lnum) let line = getline(lnum)
if s:Match(lnum, s:splat_regex) if !s:Match(msl, s:backslash_continuation_regex) &&
\ s:Match(lnum, s:backslash_continuation_regex)
" If the current line doesn't end in a backslash, but the previous one
" does, look for that line's msl
"
" Example:
" foo = "bar" \
" "baz"
"
let msl = lnum
elseif s:Match(msl, s:leading_operator_regex)
" If the current line starts with a leading operator, keep its indent
" and keep looking for an MSL.
let msl = lnum
elseif s:Match(lnum, s:splat_regex)
" If the above line looks like the "*" of a splat, use the current one's " If the above line looks like the "*" of a splat, use the current one's
" indentation. " indentation.
" "
@ -175,7 +224,7 @@ function s:GetMSL(lnum)
" something " something
" "
return msl return msl
elseif s:Match(line, s:non_bracket_continuation_regex) && elseif s:Match(lnum, s:non_bracket_continuation_regex) &&
\ s:Match(msl, s:non_bracket_continuation_regex) \ s:Match(msl, s:non_bracket_continuation_regex)
" If the current line is a non-bracket continuation and so is the " If the current line is a non-bracket continuation and so is the
" previous one, keep its indent and continue looking for an MSL. " previous one, keep its indent and continue looking for an MSL.
@ -186,6 +235,18 @@ function s:GetMSL(lnum)
" three " three
" "
let msl = lnum let msl = lnum
elseif s:Match(lnum, s:dot_continuation_regex) &&
\ (s:Match(msl, s:bracket_continuation_regex) || s:Match(msl, s:block_continuation_regex))
" If the current line is a bracket continuation or a block-starter, but
" the previous is a dot, keep going to see if the previous line is the
" start of another continuation.
"
" Example:
" parent.
" method_call {
" three
"
let msl = lnum
elseif s:Match(lnum, s:non_bracket_continuation_regex) && elseif s:Match(lnum, s:non_bracket_continuation_regex) &&
\ (s:Match(msl, s:bracket_continuation_regex) || s:Match(msl, s:block_continuation_regex)) \ (s:Match(msl, s:bracket_continuation_regex) || s:Match(msl, s:block_continuation_regex))
" If the current line is a bracket continuation or a block-starter, but " If the current line is a bracket continuation or a block-starter, but
@ -299,18 +360,39 @@ function s:ExtraBrackets(lnum)
endfunction endfunction
function s:Match(lnum, regex) function s:Match(lnum, regex)
let col = match(getline(a:lnum), '\C'.a:regex) + 1 let line = getline(a:lnum)
return col > 0 && !s:IsInStringOrComment(a:lnum, col) ? col : 0 let offset = match(line, '\C'.a:regex)
let col = offset + 1
while offset > -1 && s:IsInStringOrComment(a:lnum, col)
let offset = match(line, '\C'.a:regex, offset + 1)
let col = offset + 1
endwhile
if offset > -1
return col
else
return 0
endif
endfunction endfunction
function s:MatchLast(lnum, regex) " Locates the containing class/module's definition line, ignoring nested classes
let line = getline(a:lnum) " along the way.
let col = match(line, '.*\zs' . a:regex) "
while col != -1 && s:IsInStringOrComment(a:lnum, col) function! s:FindContainingClass()
let line = strpart(line, 0, col) let saved_position = getpos('.')
let col = match(line, '.*' . a:regex)
endwhile while searchpair(s:end_start_regex, s:end_middle_regex, s:end_end_regex, 'bW',
return col + 1 \ s:end_skip_expr) > 0
if expand('<cword>') =~# '\<class\|module\>'
let found_lnum = line('.')
call setpos('.', saved_position)
return found_lnum
endif
endif
call setpos('.', saved_position)
return 0
endfunction endfunction
" 3. GetRubyIndent Function {{{1 " 3. GetRubyIndent Function {{{1
@ -320,6 +402,13 @@ function GetRubyIndent(...)
" 3.1. Setup {{{2 " 3.1. Setup {{{2
" ---------- " ----------
" The value of a single shift-width
if exists('*shiftwidth')
let sw = shiftwidth()
else
let sw = &sw
endif
" For the current line, use the first argument if given, else v:lnum " For the current line, use the first argument if given, else v:lnum
let clnum = a:0 ? a:1 : v:lnum let clnum = a:0 ? a:1 : v:lnum
@ -333,6 +422,24 @@ function GetRubyIndent(...)
let line = getline(clnum) let line = getline(clnum)
let ind = -1 let ind = -1
" If this line is an access modifier keyword, align according to the closest
" class declaration.
if g:ruby_indent_access_modifier_style == 'indent'
if s:Match(clnum, s:access_modifier_regex)
let class_line = s:FindContainingClass()
if class_line > 0
return indent(class_line) + sw
endif
endif
elseif g:ruby_indent_access_modifier_style == 'outdent'
if s:Match(clnum, s:access_modifier_regex)
let class_line = s:FindContainingClass()
if class_line > 0
return indent(class_line)
endif
endif
endif
" If we got a closing bracket on an empty line, find its match and indent " If we got a closing bracket on an empty line, find its match and indent
" according to it. For parentheses we indent to its column - 1, for the " according to it. For parentheses we indent to its column - 1, for the
" others we indent to the containing line's MSL's level. Return -1 if fail. " others we indent to the containing line's MSL's level. Return -1 if fail.
@ -343,7 +450,9 @@ function GetRubyIndent(...)
if searchpair(escape(bs[0], '\['), '', bs[1], 'bW', s:skip_expr) > 0 if searchpair(escape(bs[0], '\['), '', bs[1], 'bW', s:skip_expr) > 0
if line[col-1]==')' && col('.') != col('$') - 1 if line[col-1]==')' && col('.') != col('$') - 1
let ind = virtcol('.') - 1 let ind = virtcol('.') - 1
else elseif g:ruby_indent_block_style == 'do'
let ind = indent(line('.'))
else " g:ruby_indent_block_style == 'expression'
let ind = indent(s:GetMSL(line('.'))) let ind = indent(s:GetMSL(line('.')))
endif endif
endif endif
@ -366,10 +475,17 @@ function GetRubyIndent(...)
if strpart(line, 0, col('.') - 1) =~ '=\s*$' && if strpart(line, 0, col('.') - 1) =~ '=\s*$' &&
\ strpart(line, col('.') - 1, 2) !~ 'do' \ strpart(line, col('.') - 1, 2) !~ 'do'
" assignment to case/begin/etc, on the same line, hanging indent
let ind = virtcol('.') - 1 let ind = virtcol('.') - 1
elseif g:ruby_indent_block_style == 'do'
" align to line of the "do", not to the MSL
let ind = indent(line('.'))
elseif getline(msl) =~ '=\s*\(#.*\)\=$' elseif getline(msl) =~ '=\s*\(#.*\)\=$'
" in the case of assignment to the MSL, align to the starting line,
" not to the MSL
let ind = indent(line('.')) let ind = indent(line('.'))
else else
" align to the MSL
let ind = indent(msl) let ind = indent(msl)
endif endif
endif endif
@ -389,6 +505,11 @@ function GetRubyIndent(...)
return 0 return 0
endif endif
" If the current line starts with a leading operator, add a level of indent.
if s:Match(clnum, s:leading_operator_regex)
return indent(s:GetMSL(clnum)) + sw
endif
" 3.3. Work on the previous line. {{{2 " 3.3. Work on the previous line. {{{2
" ------------------------------- " -------------------------------
@ -409,14 +530,50 @@ function GetRubyIndent(...)
let line = getline(lnum) let line = getline(lnum)
let ind = indent(lnum) let ind = indent(lnum)
if g:ruby_indent_access_modifier_style == 'indent'
" If the previous line was a private/protected keyword, add a
" level of indent.
if s:Match(lnum, s:indent_access_modifier_regex)
return indent(lnum) + sw
endif
elseif g:ruby_indent_access_modifier_style == 'outdent'
" If the previous line was a private/protected/public keyword, add
" a level of indent, since the keyword has been out-dented.
if s:Match(lnum, s:access_modifier_regex)
return indent(lnum) + sw
endif
endif
if s:Match(lnum, s:continuable_regex) && s:Match(lnum, s:continuation_regex)
return indent(s:GetMSL(lnum)) + sw + sw
endif
" If the previous line ended with a block opening, add a level of indent. " If the previous line ended with a block opening, add a level of indent.
if s:Match(lnum, s:block_regex) if s:Match(lnum, s:block_regex)
return indent(s:GetMSL(lnum)) + &sw let msl = s:GetMSL(lnum)
if g:ruby_indent_block_style == 'do'
" don't align to the msl, align to the "do"
let ind = indent(lnum) + sw
elseif getline(msl) =~ '=\s*\(#.*\)\=$'
" in the case of assignment to the msl, align to the starting line,
" not to the msl
let ind = indent(lnum) + sw
else
let ind = indent(msl) + sw
endif
return ind
endif
" If the previous line started with a leading operator, use its MSL's level
" of indent
if s:Match(lnum, s:leading_operator_regex)
return indent(s:GetMSL(lnum))
endif endif
" If the previous line ended with the "*" of a splat, add a level of indent " If the previous line ended with the "*" of a splat, add a level of indent
if line =~ s:splat_regex if line =~ s:splat_regex
return indent(lnum) + &sw return indent(lnum) + sw
endif endif
" If the previous line contained unclosed opening brackets and we are still " If the previous line contained unclosed opening brackets and we are still
@ -431,22 +588,22 @@ function GetRubyIndent(...)
if opening.pos != -1 if opening.pos != -1
if opening.type == '(' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0 if opening.type == '(' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
if col('.') + 1 == col('$') if col('.') + 1 == col('$')
return ind + &sw return ind + sw
else else
return virtcol('.') return virtcol('.')
endif endif
else else
let nonspace = matchend(line, '\S', opening.pos + 1) - 1 let nonspace = matchend(line, '\S', opening.pos + 1) - 1
return nonspace > 0 ? nonspace : ind + &sw return nonspace > 0 ? nonspace : ind + sw
endif endif
elseif closing.pos != -1 elseif closing.pos != -1
call cursor(lnum, closing.pos + 1) call cursor(lnum, closing.pos + 1)
normal! % normal! %
if s:Match(line('.'), s:ruby_indent_keywords) if s:Match(line('.'), s:ruby_indent_keywords)
return indent('.') + &sw return indent('.') + sw
else else
return indent('.') return indent(s:GetMSL(line('.')))
endif endif
else else
call cursor(clnum, vcol) call cursor(clnum, vcol)
@ -473,7 +630,7 @@ function GetRubyIndent(...)
let col = s:Match(lnum, s:ruby_indent_keywords) let col = s:Match(lnum, s:ruby_indent_keywords)
if col > 0 if col > 0
call cursor(lnum, col) call cursor(lnum, col)
let ind = virtcol('.') - 1 + &sw let ind = virtcol('.') - 1 + sw
" TODO: make this better (we need to count them) (or, if a searchpair " TODO: make this better (we need to count them) (or, if a searchpair
" fails, we know that something is lacking an end and thus we indent a " fails, we know that something is lacking an end and thus we indent a
" level " level
@ -490,10 +647,14 @@ function GetRubyIndent(...)
let p_lnum = lnum let p_lnum = lnum
let lnum = s:GetMSL(lnum) let lnum = s:GetMSL(lnum)
" If the previous line wasn't a MSL and is continuation return its indent. " If the previous line wasn't a MSL.
" TODO: the || s:IsInString() thing worries me a bit.
if p_lnum != lnum if p_lnum != lnum
if s:Match(p_lnum, s:non_bracket_continuation_regex) || s:IsInString(p_lnum,strlen(line)) " If previous line ends bracket and begins non-bracket continuation decrease indent by 1.
if s:Match(p_lnum, s:bracket_switch_continuation_regex)
return ind - 1
" If previous line is a continuation return its indent.
" TODO: the || s:IsInString() thing worries me a bit.
elseif s:Match(p_lnum, s:non_bracket_continuation_regex) || s:IsInString(p_lnum,strlen(line))
return ind return ind
endif endif
endif endif
@ -506,9 +667,9 @@ function GetRubyIndent(...)
" TODO: this does not take into account contrived things such as " TODO: this does not take into account contrived things such as
" module Foo; class Bar; end " module Foo; class Bar; end
if s:Match(lnum, s:ruby_indent_keywords) if s:Match(lnum, s:ruby_indent_keywords)
let ind = msl_ind + &sw let ind = msl_ind + sw
if s:Match(lnum, s:end_end_regex) if s:Match(lnum, s:end_end_regex)
let ind = ind - &sw let ind = ind - sw
endif endif
return ind return ind
endif endif
@ -517,7 +678,7 @@ function GetRubyIndent(...)
" closing bracket, indent one extra level. " closing bracket, indent one extra level.
if s:Match(lnum, s:non_bracket_continuation_regex) && !s:Match(lnum, '^\s*\([\])}]\|end\)') if s:Match(lnum, s:non_bracket_continuation_regex) && !s:Match(lnum, '^\s*\([\])}]\|end\)')
if lnum == p_lnum if lnum == p_lnum
let ind = msl_ind + &sw let ind = msl_ind + sw
else else
let ind = msl_ind let ind = msl_ind
endif endif

View File

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

View File

@ -3,11 +3,8 @@
" Maintainer: Clemens Kirchgatterer <clemens@1541.org> " Maintainer: Clemens Kirchgatterer <clemens@1541.org>
" Last Change: 2014 Jan 05 " Last Change: 2014 Jan 05
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -138,15 +135,8 @@ syn match a65End excludenl /end$/ contained
syn match a65Continue "\\$" contained syn match a65Continue "\\$" contained
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_a65_syntax_inits")
if version < 508
let did_a65_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink a65Section Special HiLink a65Section Special
HiLink a65Address Special HiLink a65Address Special
@ -161,6 +151,5 @@ if version >= 508 || !exists("did_a65_syntax_inits")
HiLink a65HiLo Number HiLink a65HiLo Number
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "a65" let b:current_syntax = "a65"

View File

@ -5,11 +5,8 @@
" Last Change: 2013 Jun 13 " Last Change: 2013 Jun 13
" Comment: Thanks to EPI-USE Labs for all your assistance. :) " Comment: Thanks to EPI-USE Labs for all your assistance. :)
" For version < 6.0: Clear all syntax items " quit when a syntax file was already loaded
" For version >= 6.0: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -43,11 +40,7 @@ syn match abapStringEscape contained "``"
syn match abapNumber "\-\=\<\d\+\>" syn match abapNumber "\-\=\<\d\+\>"
syn region abapHex matchgroup=abapHex start="X'" end="'" syn region abapHex matchgroup=abapHex start="X'" end="'"
if version >= 600
setlocal iskeyword=48-57,_,A-Z,a-z,/ setlocal iskeyword=48-57,_,A-Z,a-z,/
else
set iskeyword=48-57,_,A-Z,a-z,/
endif
syn match abapNamespace "\</\w\+/" syn match abapNamespace "\</\w\+/"
@ -175,15 +168,8 @@ syn keyword abapTodo contained TODO NOTE
syn match abapTodo "\#EC\W\+\w\+" syn match abapTodo "\#EC\W\+\w\+"
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_abap_syntax_inits")
if version < 508
let did_abap_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink abapError Error HiLink abapError Error
HiLink abapComment Comment HiLink abapComment Comment
@ -206,7 +192,6 @@ if version >= 508 || !exists("did_abap_syntax_inits")
HiLink abapHex Number HiLink abapHex Number
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "abap" let b:current_syntax = "abap"

View File

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

View File

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

View File

@ -3,11 +3,8 @@
" Maintainer: John Cook <johncook3@gmail.com> " Maintainer: John Cook <johncook3@gmail.com>
" Last Change: 2011 Dec 27 " Last Change: 2011 Dec 27
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -123,15 +120,8 @@ endif
syn sync minlines=1 syn sync minlines=1
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_abel_syn_inits")
if version < 508
let did_abel_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
" The default highlighting. " The default highlighting.
HiLink abelHeader abelStatement HiLink abelHeader abelStatement
@ -164,7 +154,6 @@ if version >= 508 || !exists("did_abel_syn_inits")
HiLink abelError Error HiLink abelError Error
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "abel" let b:current_syntax = "abel"

View File

@ -7,11 +7,8 @@
" Syntax file to handle all $ACEDB/wspec/*.wrm files, primarily models.wrm " Syntax file to handle all $ACEDB/wspec/*.wrm files, primarily models.wrm
" AceDB software is available from http://www.acedb.org " AceDB software is available from http://www.acedb.org
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -86,15 +83,8 @@ syn region acedbString start=/"/ end=/"/ skip=/\\"/ oneline
" Rest of syntax highlighting rules start here " Rest of syntax highlighting rules start here
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_acedb_syn_inits")
if version < 508
let did_acedb_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink acedbMagic Special HiLink acedbMagic Special
HiLink acedbHyb Special HiLink acedbHyb Special
@ -114,7 +104,6 @@ if version >= 508 || !exists("did_acedb_syn_inits")
HiLink acedbString String HiLink acedbString String
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "acedb" let b:current_syntax = "acedb"

View File

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

View File

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

View File

@ -5,11 +5,8 @@
" Version: 7 " Version: 7
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_AMIGA " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_AMIGA
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -72,15 +69,8 @@ syn match amiComment ";.*$" contains=amiCommentGroup
syn sync lines=50 syn sync lines=50
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_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> command -nargs=+ HiLink hi def link <args>
endif
HiLink amiAlias Type HiLink amiAlias Type
HiLink amiComment Comment HiLink amiComment Comment
@ -94,7 +84,6 @@ if version >= 508 || !exists("did_amiga_syn_inits")
HiLink amiTest Special HiLink amiTest Special
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "amiga" let b:current_syntax = "amiga"

View File

@ -9,11 +9,8 @@
" of [], in order to avoid -read highlighted, " of [], in order to avoid -read highlighted,
" or [quote] strings highlighted " or [quote] strings highlighted
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -123,15 +120,8 @@ syn region amlSkip matchgroup=amlOutput start="&typ" end="$" contains=amlVar
syn region amlSkip matchgroup=amlOutput start="&type" end="$" contains=amlVar syn region amlSkip matchgroup=amlOutput start="&type" end="$" contains=amlVar
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_aml_syntax_inits")
if version < 508
let did_aml_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink amlComment Comment HiLink amlComment Comment
HiLink amlNumber Number HiLink amlNumber Number
@ -152,6 +142,5 @@ if version >= 508 || !exists("did_aml_syntax_inits")
HiLink amlTab amlArcCmd HiLink amlTab amlArcCmd
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "aml" let b:current_syntax = "aml"

View File

@ -3,9 +3,8 @@
" Last Change: 2003 May 11 " Last Change: 2003 May 11
if version < 600 " quit when a syntax file was already loaded
syntax clear if exists("b:current_syntax")
elseif exists("b:current_syntax")
finish finish
endif endif
@ -115,13 +114,7 @@ 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> command -nargs=+ HiLink hi def link <args>
endif
" The default methods for highlighting. Can be overridden later. " The default methods for highlighting. Can be overridden later.
HiLink amplEntityKeyword Keyword HiLink amplEntityKeyword Keyword
@ -141,7 +134,6 @@ if version >= 508 || !exists("did_ampl_syntax_inits")
HiLink amplPiecewise Special HiLink amplPiecewise Special
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "ampl" let b:current_syntax = "ampl"

View File

@ -4,11 +4,8 @@
" LastChange: 02 May 2001 " LastChange: 02 May 2001
" Original: Comes from JavaCC.vim " Original: Comes from JavaCC.vim
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -18,12 +15,8 @@ endif
" Those files usually have the extension *.jj " Those files usually have the extension *.jj
" source the java.vim file " source the java.vim file
if version < 600
so <sfile>:p:h/java.vim
else
runtime! syntax/java.vim runtime! syntax/java.vim
unlet b:current_syntax unlet b:current_syntax
endif
"remove catching errors caused by wrong parenthesis (does not work in antlr "remove catching errors caused by wrong parenthesis (does not work in antlr
"files) (first define them in case they have not been defined in java) "files) (first define them in case they have not been defined in java)
@ -53,17 +46,10 @@ syn match antlrSep "[|:]\|\.\."
syn keyword antlrActionToken TOKEN SKIP MORE SPECIAL_TOKEN syn keyword antlrActionToken TOKEN SKIP MORE SPECIAL_TOKEN
syn keyword antlrError DEBUG IGNORE_IN_BNF syn keyword antlrError DEBUG IGNORE_IN_BNF
if version >= 508 || !exists("did_antlr_syntax_inits")
if version < 508
let did_antlr_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink antlrSep Statement HiLink antlrSep Statement
HiLink antlrPackages Statement HiLink antlrPackages Statement
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "antlr" let b:current_syntax = "antlr"

View File

@ -9,14 +9,10 @@
" make it really linewise? " make it really linewise?
" + add `display' where appropriate " + add `display' where appropriate
" Setup " quit when a syntax file was already loaded
if version >= 600
if exists("b:current_syntax") if exists("b:current_syntax")
finish finish
endif endif
else
syntax clear
endif
syn case ignore syn case ignore
@ -178,13 +174,7 @@ syn match apacheSection "<\/\=\(<IfVersion\)[^>]*>" contains=apacheAnything
syn keyword apacheDeclaration VirtualDocumentRoot VirtualDocumentRootIP VirtualScriptAlias VirtualScriptAliasIP syn keyword apacheDeclaration VirtualDocumentRoot VirtualDocumentRootIP VirtualScriptAlias VirtualScriptAliasIP
" Define the default highlighting " Define the default highlighting
if version >= 508 || !exists("did_apache_syntax_inits")
if version < 508
let did_apache_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink apacheAllowOverride apacheDeclaration HiLink apacheAllowOverride apacheDeclaration
HiLink apacheAllowOverrideValue apacheOption HiLink apacheAllowOverrideValue apacheOption
@ -209,6 +199,5 @@ if version >= 508 || !exists("did_apache_syntax_inits")
HiLink apacheUserID Number HiLink apacheUserID Number
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "apache" let b:current_syntax = "apache"

View File

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

View File

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

View File

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

View File

@ -7,11 +7,8 @@
" Thanks to Ori Avtalion for feedback on the comment markers! " Thanks to Ori Avtalion for feedback on the comment markers!
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.0 and later: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -103,15 +100,8 @@ syn match asmDirective "\.[A-Za-z][0-9A-Za-z-_]*"
syn case match syn case match
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_asm_syntax_inits")
if version < 508
let did_asm_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
" The default methods for highlighting. Can be overridden later " The default methods for highlighting. Can be overridden later
HiLink asmSection Special HiLink asmSection Special
@ -133,7 +123,6 @@ if version >= 508 || !exists("did_asm_syntax_inits")
HiLink asmType Type HiLink asmType Type
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "asm" let b:current_syntax = "asm"

View File

@ -8,11 +8,8 @@
" Feel free to contribute... " Feel free to contribute...
" "
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -328,15 +325,8 @@ syn match asm68kDirective "\<XREF\(\.S\)\=\s"
syn case match syn case match
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_asm68k_syntax_inits")
if version < 508
let did_asm68k_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
" The default methods for highlighting. Can be overridden later " The default methods for highlighting. Can be overridden later
" Comment Constant Error Identifier PreProc Special Statement Todo Type " Comment Constant Error Identifier PreProc Special Statement Todo Type
@ -384,7 +374,6 @@ if version >= 508 || !exists("did_asm68k_syntax_inits")
HiLink asm68kLabel Type HiLink asm68kLabel Type
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "asm68k" let b:current_syntax = "asm68k"

View File

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

View File

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

View File

@ -4,11 +4,8 @@
" URL: http://nim.dhs.org/~edh/aspperl.vim " URL: http://nim.dhs.org/~edh/aspperl.vim
" Last Change: 2001 May 09 " Last Change: 2001 May 09
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -16,14 +13,9 @@ if !exists("main_syntax")
let main_syntax = 'perlscript' let main_syntax = 'perlscript'
endif endif
if version < 600
so <sfile>:p:h/html.vim
syn include @AspPerlScript <sfile>:p:h/perl.vim
else
runtime! syntax/html.vim runtime! syntax/html.vim
unlet b:current_syntax unlet b:current_syntax
syn include @AspPerlScript syntax/perl.vim syn include @AspPerlScript syntax/perl.vim
endif
syn cluster htmlPreproc add=AspPerlScriptInsideHtmlTags 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 " Thanks to Dean Hall <hall@apt7.com> for testing the use of classes in
" VBScripts which I've been too scared to do. " VBScripts which I've been too scared to do.
" Quit when a syntax file was already loaded " quit when a syntax file was already loaded
if version < 600 if exists("b:current_syntax")
syn clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -22,11 +20,7 @@ if !exists("main_syntax")
let main_syntax = 'aspvbs' let main_syntax = 'aspvbs'
endif endif
if version < 600
source <sfile>:p:h/html.vim
else
runtime! syntax/html.vim runtime! syntax/html.vim
endif
unlet b:current_syntax unlet b:current_syntax
syn cluster htmlPreProc add=AspVBScriptInsideHtmlTags syn cluster htmlPreProc add=AspVBScriptInsideHtmlTags
@ -163,15 +157,8 @@ syn sync match htmlHighlight grouphere htmlTag "%>"
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_aspvbs_syn_inits")
if version < 508
let did_aspvbs_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
"HiLink AspVBScript Special "HiLink AspVBScript Special
HiLink AspVBSLineNumber Comment HiLink AspVBSLineNumber Comment
@ -187,7 +174,6 @@ if version >= 508 || !exists("did_aspvbs_syn_inits")
HiLink AspVBSTypeSpecifier Type HiLink AspVBSTypeSpecifier Type
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "aspvbs" let b:current_syntax = "aspvbs"

View File

@ -5,10 +5,9 @@
" Updated for 1.2 by Tilghman Lesher (Corydon76) " Updated for 1.2 by Tilghman Lesher (Corydon76)
" Last Change: 2015 Feb 27 " Last Change: 2015 Feb 27
" version 0.4 " version 0.4
"
if version < 600 " quit when a syntax file was already loaded
syntax clear if exists("b:current_syntax")
elseif exists("b:current_syntax")
finish finish
endif endif
@ -57,15 +56,8 @@ syn match asteriskSetting "^port\s*=\s*\d\{1,5}\s*$" contains=aste
syn match asteriskSetting "^host\s*=\s*\(dynamic\|\(\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\)\|\([[:alnum:]][[:alnum:]\-\.]*\.[[:alpha:]]{2,10}\)\)" contains=asteriskIP,asteriskHostname syn match asteriskSetting "^host\s*=\s*\(dynamic\|\(\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\)\|\([[:alnum:]][[:alnum:]\-\.]*\.[[:alpha:]]{2,10}\)\)" contains=asteriskIP,asteriskHostname
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_conf_syntax_inits")
if version < 508
let did_conf_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink asteriskComment Comment HiLink asteriskComment Comment
HiLink asteriskExten String HiLink asteriskExten String
@ -92,7 +84,7 @@ if version >= 508 || !exists("did_conf_syntax_inits")
HiLink asteriskSetting Statement HiLink asteriskSetting Statement
HiLink asteriskError Error HiLink asteriskError Error
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "asterisk" let b:current_syntax = "asterisk"
" vim: ts=8 sw=2 " vim: ts=8 sw=2

View File

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

View File

@ -3,11 +3,8 @@
" Maintainer: Inaki Saez <jisaez@sfe.indra.es> " Maintainer: Inaki Saez <jisaez@sfe.indra.es>
" Last Change: 2001 May 09 " Last Change: 2001 May 09
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -61,15 +58,8 @@ syn sync maxlines=100
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_atlas_syntax_inits")
if version < 508
let did_atlas_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink atlasConditional Conditional HiLink atlasConditional Conditional
HiLink atlasRepeat Repeat HiLink atlasRepeat Repeat
@ -91,7 +81,6 @@ if version >= 508 || !exists("did_atlas_syntax_inits")
HiLink atlasSpecial Special HiLink atlasSpecial Special
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "atlas" let b:current_syntax = "atlas"

View File

@ -18,18 +18,12 @@
" EXTRA_SOURCES. " EXTRA_SOURCES.
" Standard syntax initialization " Standard syntax initialization
if version < 600 if exists("b:current_syntax")
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
" Read the Makefile syntax to start with " Read the Makefile syntax to start with
if version < 600
source <sfile>:p:h/make.vim
else
runtime! syntax/make.vim runtime! syntax/make.vim
endif
syn match automakePrimary "^\w\+\(_PROGRAMS\|_LIBRARIES\|_LISP\|_PYTHON\|_JAVA\|_SCRIPTS\|_DATA\|_HEADERS\|_MANS\|_TEXINFOS\|_LTLIBRARIES\)\s*\ze+\==" syn match automakePrimary "^\w\+\(_PROGRAMS\|_LIBRARIES\|_LISP\|_PYTHON\|_JAVA\|_SCRIPTS\|_DATA\|_HEADERS\|_MANS\|_TEXINFOS\|_LTLIBRARIES\)\s*\ze+\=="
syn match automakePrimary "^TESTS\s*\ze+\=="me=e-1 syn match automakePrimary "^TESTS\s*\ze+\=="me=e-1
@ -59,15 +53,8 @@ syn region automakeMakeSString start=+'+ skip=+\\'+ end=+'+ contains=makeIde
syn region automakeMakeBString start=+`+ skip=+\\`+ end=+`+ contains=makeIdent,makeSString,makeDString,makeNextLine,automakeSubstitution syn region automakeMakeBString start=+`+ skip=+\\`+ end=+`+ contains=makeIdent,makeSString,makeDString,makeNextLine,automakeSubstitution
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_automake_syntax_inits")
if version < 508
let did_automake_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink automakePrimary Statement HiLink automakePrimary Statement
HiLink automakeSecondary Type HiLink automakeSecondary Type
@ -86,7 +73,6 @@ if version >= 508 || !exists("did_automake_syntax_inits")
HiLink automakeMakeBString makeBString HiLink automakeMakeBString makeBString
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "automake" let b:current_syntax = "automake"

View File

@ -11,11 +11,8 @@
" I use some technologies to automatically load avenue scripts " I use some technologies to automatically load avenue scripts
" into ArcView. " into ArcView.
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -59,15 +56,8 @@ syn match aveTypos "=="
syn match aveTypos "!=" syn match aveTypos "!="
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting+yet
" For version 5.8 and later: only when an item doesn't have highlighting+yet
if version >= 508 || !exists("did_ave_syn_inits")
if version < 508
let did_ave_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink aveStatement Statement HiLink aveStatement Statement
@ -87,6 +77,5 @@ if version >= 508 || !exists("did_ave_syn_inits")
HiLink aveTypos Error HiLink aveTypos Error
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "ave" let b:current_syntax = "ave"

View File

@ -6,21 +6,14 @@
" Comment: Replaced sourcing c.vim file by ada.vim and rename yacc* " Comment: Replaced sourcing c.vim file by ada.vim and rename yacc*
" in ayacc* " in ayacc*
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
" Read the Ada syntax to start with " Read the Ada syntax to start with
if version < 600
so <sfile>:p:h/ada.vim
else
runtime! syntax/ada.vim runtime! syntax/ada.vim
unlet b:current_syntax unlet b:current_syntax
endif
let s:cpo_save = &cpo let s:cpo_save = &cpo
set cpo&vim set cpo&vim
@ -54,13 +47,7 @@ syn match ayaccSep "^[ \t]*%}"
syn match ayaccCurlyError "[{}]" syn match ayaccCurlyError "[{}]"
syn region ayaccAction matchgroup=ayaccCurly start="{" end="}" contains=ALLBUT,@ayaccActionGroup syn region ayaccAction matchgroup=ayaccCurly start="{" end="}" contains=ALLBUT,@ayaccActionGroup
if version >= 508 || !exists("did_ayacc_syntax_inits")
if version < 508
let did_ayacc_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
" Internal ayacc highlighting links " Internal ayacc highlighting links
HiLink ayaccBrkt ayaccStmt HiLink ayaccBrkt ayaccStmt
@ -82,7 +69,6 @@ if version >= 508 || !exists("did_ayacc_syntax_inits")
" since Bram doesn't like my Delimiter :| " since Bram doesn't like my Delimiter :|
HiLink Delimiter Type HiLink Delimiter Type
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "ayacc" let b:current_syntax = "ayacc"

View File

@ -5,11 +5,8 @@
" LastChange: 8 Dec 2007 " LastChange: 8 Dec 2007
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -69,16 +66,9 @@ syn region bPreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error
syn sync ccomment bComment minlines=10 syn sync ccomment bComment minlines=10
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_b_syntax_inits")
if version < 508
let did_b_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
" The default methods for highlighting. Can be overridden later " The default methods for highlighting. Can be overridden later
HiLink bLabel Label HiLink bLabel Label
@ -120,7 +110,6 @@ if version >= 508 || !exists("did_b_syntax_inits")
HiLink bTodo Todo HiLink bTodo Todo
"hi link bIdentifier Identifier "hi link bIdentifier Identifier
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "b" let b:current_syntax = "b"

View File

@ -4,15 +4,8 @@
" Originally owned by: Erwin Smit / Her van de Vliert " Originally owned by: Erwin Smit / Her van de Vliert
" Last change: v1.17 2006/04/26 10:40:18 " Last change: v1.17 2006/04/26 10:40:18
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
"
if version < 600
syntax clear
if exists("baan_fold")
unlet baan_fold
endif
elseif exists("b:current_syntax")
finish finish
endif endif
@ -1894,15 +1887,8 @@ syn keyword baanBshell bclm.productidlicensed
syn keyword baanBshell bclm.set.desktop syn keyword baanBshell bclm.set.desktop
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_baan_syn_inits")
if version < 508
let did_baan_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink baanConditional Conditional HiLink baanConditional Conditional
HiLink baan3gl Statement HiLink baan3gl Statement
@ -1927,7 +1913,6 @@ if version >= 508 || !exists("did_baan_syn_inits")
HiLink baanStorageClass StorageClass HiLink baanStorageClass StorageClass
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "baan" let b:current_syntax = "baan"

View File

@ -8,11 +8,8 @@
" This syntax file not a complete implementation yet. Send suggestions to the " This syntax file not a complete implementation yet. Send suggestions to the
" maintainer. " maintainer.
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -143,15 +140,8 @@ syn match basicFilenumber "#\d\+"
syn match basicMathsOperator "-\|=\|[:<>+\*^/\\]\|AND\|OR" syn match basicMathsOperator "-\|=\|[:<>+\*^/\\]\|AND\|OR"
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_basic_syntax_inits")
if version < 508
let did_basic_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink basicLabel Label HiLink basicLabel Label
HiLink basicConditional Conditional HiLink basicConditional Conditional
@ -170,7 +160,6 @@ if version >= 508 || !exists("did_basic_syntax_inits")
"hi basicMathsOperator term=bold cterm=bold gui=bold "hi basicMathsOperator term=bold cterm=bold gui=bold
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "basic" let b:current_syntax = "basic"

View File

@ -5,11 +5,8 @@
" (Dominique Pelle added @Spell) " (Dominique Pelle added @Spell)
" Available on: www.gjh.sk/~vlado/bc.vim " Available on: www.gjh.sk/~vlado/bc.vim
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -53,15 +50,8 @@ syn match bcParenError ")"
syn case match syn case match
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_bc_syntax_inits")
if version < 508
let did_bc_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink bcKeyword Statement HiLink bcKeyword Statement
HiLink bcType Type HiLink bcType Type
@ -73,7 +63,6 @@ if version >= 508 || !exists("did_bc_syntax_inits")
HiLink bcParenError Error HiLink bcParenError Error
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "bc" let b:current_syntax = "bc"
" vim: ts=8 " vim: ts=8

View File

@ -8,11 +8,8 @@
" Initialization " Initialization
" ============== " ==============
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -91,11 +88,7 @@ syn region bibField contained start="\S\+\s*=\s*" end=/[}),]/me=e-1 contains=bib
syn region bibEntryData contained start=/[{(]/ms=e+1 end=/[})]/me=e-1 contains=bibKey,bibField syn region bibEntryData contained start=/[{(]/ms=e+1 end=/[})]/me=e-1 contains=bibKey,bibField
" Actually, 5.8 <= Vim < 6.0 would ignore the `fold' keyword anyway, but Vim<5.8 would produce " Actually, 5.8 <= Vim < 6.0 would ignore the `fold' keyword anyway, but Vim<5.8 would produce
" an error, so we explicitly distinguish versions with and without folding functionality: " an error, so we explicitly distinguish versions with and without folding functionality:
if version < 600
syn region bibEntry start=/@\S\+\s*[{(]/ end=/^\s*[})]/ transparent contains=bibType,bibEntryData nextgroup=bibComment
else
syn region bibEntry start=/@\S\+\s*[{(]/ end=/^\s*[})]/ transparent fold contains=bibType,bibEntryData nextgroup=bibComment syn region bibEntry start=/@\S\+\s*[{(]/ end=/^\s*[})]/ transparent fold contains=bibType,bibEntryData nextgroup=bibComment
endif
syn region bibComment2 start=/@Comment\s*[{(]/ end=/^\s*[})]/me=e-1 contains=@bibCommentContents nextgroup=bibEntry syn region bibComment2 start=/@Comment\s*[{(]/ end=/^\s*[})]/me=e-1 contains=@bibCommentContents nextgroup=bibEntry
" Synchronization " Synchronization
@ -107,15 +100,9 @@ syn sync minlines=50
" Highlighting defaults " Highlighting defaults
" ===================== " =====================
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_bib_syn_inits")
if version < 508
let did_bib_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink bibType Identifier HiLink bibType Identifier
HiLink bibEntryKw Statement HiLink bibEntryKw Statement
HiLink bibNSEntryKw PreProc HiLink bibNSEntryKw PreProc
@ -125,7 +112,6 @@ if version >= 508 || !exists("did_bib_syn_inits")
HiLink bibComment Comment HiLink bibComment Comment
HiLink bibComment2 Comment HiLink bibComment2 Comment
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "bib" let b:current_syntax = "bib"

View File

@ -9,11 +9,8 @@
" "
" $Id: bindzone.vim 12 2011-07-16 21:09:57Z julian $ " $Id: bindzone.vim 12 2011-07-16 21:09:57Z julian $
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -70,15 +67,8 @@ syn region zoneParen contained start="(" end=")" contains=zoneSerial,
syn match zoneComment /;.*/ syn match zoneComment /;.*/
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_bind_zone_syn_inits")
if version < 508
let did_bind_zone_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink zoneDirective Macro HiLink zoneDirective Macro
@ -103,7 +93,6 @@ if version >= 508 || !exists("did_bind_zone_syn_inits")
HiLink zoneComment Comment HiLink zoneComment Comment
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "bindzone" let b:current_syntax = "bindzone"

View File

@ -3,11 +3,8 @@
" Maintainer: Rafal M. Sulejman <unefunge@friko2.onet.pl> " Maintainer: Rafal M. Sulejman <unefunge@friko2.onet.pl>
" Last change: 2011 Dec 28 by Thilo Six " Last change: 2011 Dec 28 by Thilo Six
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -28,22 +25,14 @@ syn match blankNumber "\[[0-9]\+\]"
syn case match syn case match
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_blank_syntax_inits")
if version < 508
let did_blank_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink blankInstruction Statement HiLink blankInstruction Statement
HiLink blankNumber Number HiLink blankNumber Number
HiLink blankString String HiLink blankString String
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "blank" let b:current_syntax = "blank"

View File

@ -4,21 +4,12 @@
" Filenames: *.bst " Filenames: *.bst
" $Id: bst.vim,v 1.2 2007/05/05 18:24:42 vimboss Exp $ " $Id: bst.vim,v 1.2 2007/05/05 18:24:42 vimboss Exp $
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
if version < 600 setlocal iskeyword=48-57,#,$,',.,A-Z,a-z
command -nargs=1 SetIsk set iskeyword=<args>
else
command -nargs=1 SetIsk setlocal iskeyword=<args>
endif
SetIsk 48-57,#,$,',.,A-Z,a-z
delcommand SetIsk
syn case ignore syn case ignore
@ -62,15 +53,8 @@ syn keyword bstField title type
syn keyword bstField volume year syn keyword bstField volume year
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_bst_syn_inits")
if version < 508
let did_bst_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink bstComment Comment HiLink bstComment Comment
HiLink bstString String HiLink bstString String
@ -82,7 +66,6 @@ if version >= 508 || !exists("did_bst_syn_inits")
HiLink bstIdentifier Identifier HiLink bstIdentifier Identifier
HiLink bstError Error HiLink bstError Error
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "bst" let b:current_syntax = "bst"

View File

@ -11,11 +11,8 @@
"//- After unary operators like "defined" can assume token type. "//- After unary operators like "defined" can assume token type.
"// Should there be more of these? "// Should there be more of these?
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -184,15 +181,8 @@ syn keyword btmCommand unlock unset ver verify vol
syn keyword btmCommand vscrput y syn keyword btmCommand vscrput y
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_btm_syntax_inits")
if version < 508
let did_btm_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink btmLabel Special HiLink btmLabel Special
HiLink btmLabelMark Special HiLink btmLabelMark Special
@ -222,7 +212,6 @@ if version >= 508 || !exists("did_btm_syntax_inits")
"hiLink btmIdentifier Identifier "hiLink btmIdentifier Identifier
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "btm" let b:current_syntax = "btm"

View File

@ -11,11 +11,8 @@
" Gioele Barabucci " Gioele Barabucci
" for idea of diff highlighting " for idea of diff highlighting
" For version 5.x: Clear all syntax items. " quit when a syntax file was already loaded.
" For version 6.x: Quit when a syntax file was already loaded. if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -40,15 +37,8 @@ syn sync clear
syn sync match bzrSync grouphere bzrRegion "^-\{14} This line and the following will be ignored -\{14}$"me=s-1 syn sync match bzrSync grouphere bzrRegion "^-\{14} This line and the following will be ignored -\{14}$"me=s-1
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already. " Only when an item doesn't have highlighting yet.
" For version 5.8 and later: only when an item doesn't have highlighting yet.
if version >= 508 || !exists("did_bzr_syn_inits")
if version <= 508
let did_bzr_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink bzrRemoved Constant HiLink bzrRemoved Constant
HiLink bzrAdded Identifier HiLink bzrAdded Identifier
@ -58,6 +48,5 @@ if version >= 508 || !exists("did_bzr_syn_inits")
HiLink bzrUnknown Special HiLink bzrUnknown Special
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "bzr" let b:current_syntax = "bzr"

View File

@ -18,11 +18,8 @@
" v1.0: Cabal syntax in vimball format " v1.0: Cabal syntax in vimball format
" (thanks to Magnus Therning) " (thanks to Magnus Therning)
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -105,15 +102,8 @@ syn match cabalStatement "\ctype"
syn match cabalStatement "\cversion" syn match cabalStatement "\cversion"
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_cabal_syn_inits")
if version < 508
let did_cabal_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink cabalVersion Number HiLink cabalVersion Number
HiLink cabalTruth Boolean HiLink cabalTruth Boolean
@ -125,7 +115,6 @@ if version >= 508 || !exists("did_cabal_syn_inits")
HiLink cabalOperator Operator HiLink cabalOperator Operator
HiLink cabalCompiler Constant HiLink cabalCompiler Constant
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "cabal" let b:current_syntax = "cabal"

Binary file not shown.

View File

@ -3,11 +3,8 @@
" Maintainer: Igor N. Prischepoff (igor@tyumbit.ru, pri_igor@mail.ru) " Maintainer: Igor N. Prischepoff (igor@tyumbit.ru, pri_igor@mail.ru)
" Last change: 2012 Aug 11 " Last change: 2012 Aug 11
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists ("b:current_syntax")
if version < 600
syntax clear
elseif exists ("b:current_syntax")
finish finish
endif endif
@ -36,15 +33,8 @@ syn match CfgComment ";.*"
syn match CfgComment "\/\/.*" syn match CfgComment "\/\/.*"
" Define the default hightlighting. " Define the default hightlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_cfg_syn_inits")
if version < 508
let did_cfg_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink CfgOnOff Label HiLink CfgOnOff Label
HiLink CfgComment Comment HiLink CfgComment Comment
HiLink CfgSection Type HiLink CfgSection Type
@ -55,6 +45,6 @@ if version >= 508 || !exists("did_cfg_syn_inits")
HiLink UncPath Directory HiLink UncPath Directory
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "cfg" let b:current_syntax = "cfg"
" vim:ts=8 " vim:ts=8

View File

@ -8,21 +8,14 @@
" Ch is a C/C++ interpreter with many high level extensions " Ch is a C/C++ interpreter with many high level extensions
" "
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
" Read the C syntax to start with " Read the C syntax to start with
if version < 600
so <sfile>:p:h/c.vim
else
runtime! syntax/c.vim runtime! syntax/c.vim
unlet b:current_syntax unlet b:current_syntax
endif
" Ch extentions " Ch extentions
@ -33,20 +26,14 @@ syn keyword chStructure class
syn keyword chType string_t array syn keyword chType string_t array
" Default highlighting " Default highlighting
if version >= 508 || !exists("did_ch_syntax_inits")
if version < 508
let did_ch_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink chAccess chStatement HiLink chAccess chStatement
HiLink chExceptions Exception HiLink chExceptions Exception
HiLink chStatement Statement HiLink chStatement Statement
HiLink chType Type HiLink chType Type
HiLink chStructure Structure HiLink chStructure Structure
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "ch" let b:current_syntax = "ch"

View File

@ -7,11 +7,8 @@
" in the articles by Donald E. Knuth and Silvio Levy cited in "web.vim" and " in the articles by Donald E. Knuth and Silvio Levy cited in "web.vim" and
" "cweb.vim" respectively. " "cweb.vim" respectively.
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syn clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -21,21 +18,13 @@ syn region changeFromMaterial start="^@x.*$"ms=e+1 end="^@y.*$"me=s-1
syn region changeToMaterial start="^@y.*$"ms=e+1 end="^@z.*$"me=s-1 syn region changeToMaterial start="^@y.*$"ms=e+1 end="^@z.*$"me=s-1
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_change_syntax_inits")
if version < 508
let did_change_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink changeFromMaterial String HiLink changeFromMaterial String
HiLink changeToMaterial Statement HiLink changeToMaterial Statement
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "change" let b:current_syntax = "change"

View File

@ -4,11 +4,8 @@
" Maintainer: Corinna Vinschen <vinschen@redhat.com> " Maintainer: Corinna Vinschen <vinschen@redhat.com>
" Last Change: June 1, 2003 " Last Change: June 1, 2003
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -28,17 +25,12 @@ endif
syn match changelogText "^\s.*$" contains=changelogMail,changelogNumber,changelogMonth,changelogDay,changelogError syn match changelogText "^\s.*$" contains=changelogMail,changelogNumber,changelogMonth,changelogDay,changelogError
syn match changelogHeader "^\S.*$" contains=changelogNumber,changelogMonth,changelogDay,changelogMail syn match changelogHeader "^\S.*$" contains=changelogNumber,changelogMonth,changelogDay,changelogMail
if version < 600
syn region changelogFiles start="^\s\+[+*]\s" end=":\s" end="^$" contains=changelogBullet,changelogColon,changelogError keepend
syn region changelogFiles start="^\s\+[([]" end=":\s" end="^$" contains=changelogBullet,changelogColon,changelogError keepend
syn match changelogColon contained ":\s"
else
syn region changelogFiles start="^\s\+[+*]\s" end=":" end="^$" contains=changelogBullet,changelogColon,changelogFuncs,changelogError keepend syn region changelogFiles start="^\s\+[+*]\s" end=":" end="^$" contains=changelogBullet,changelogColon,changelogFuncs,changelogError keepend
syn region changelogFiles start="^\s\+[([]" end=":" end="^$" contains=changelogBullet,changelogColon,changelogFuncs,changelogError keepend syn region changelogFiles start="^\s\+[([]" end=":" end="^$" contains=changelogBullet,changelogColon,changelogFuncs,changelogError keepend
syn match changelogFuncs contained "(.\{-})" extend syn match changelogFuncs contained "(.\{-})" extend
syn match changelogFuncs contained "\[.\{-}]" extend syn match changelogFuncs contained "\[.\{-}]" extend
syn match changelogColon contained ":" syn match changelogColon contained ":"
endif
syn match changelogBullet contained "^\s\+[+*]\s" contains=changelogError syn match changelogBullet contained "^\s\+[+*]\s" contains=changelogError
syn match changelogMail contained "<[A-Za-z0-9\._:+-]\+@[A-Za-z0-9\._-]\+>" syn match changelogMail contained "<[A-Za-z0-9\._:+-]\+@[A-Za-z0-9\._-]\+>"
syn keyword changelogMonth contained jan feb mar apr may jun jul aug sep oct nov dec syn keyword changelogMonth contained jan feb mar apr may jun jul aug sep oct nov dec
@ -46,23 +38,14 @@ syn keyword changelogDay contained mon tue wed thu fri sat sun
syn match changelogNumber contained "[.-]*[0-9]\+" syn match changelogNumber contained "[.-]*[0-9]\+"
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_changelog_syntax_inits")
if version < 508
let did_changelog_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink changelogText Normal HiLink changelogText Normal
HiLink changelogBullet Type HiLink changelogBullet Type
HiLink changelogColon Type HiLink changelogColon Type
HiLink changelogFiles Comment HiLink changelogFiles Comment
if version >= 600
HiLink changelogFuncs Comment HiLink changelogFuncs Comment
endif
HiLink changelogHeader Statement HiLink changelogHeader Statement
HiLink changelogMail Special HiLink changelogMail Special
HiLink changelogNumber Number HiLink changelogNumber Number
@ -71,7 +54,6 @@ if version >= 508 || !exists("did_changelog_syntax_inits")
HiLink changelogError Folded HiLink changelogError Folded
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "changelog" let b:current_syntax = "changelog"

View File

@ -9,10 +9,6 @@
let b:hs_chs=1 let b:hs_chs=1
" Include standard Haskell highlighting " Include standard Haskell highlighting
if version < 600
source <sfile>:p:h/haskell.vim
else
runtime! syntax/haskell.vim runtime! syntax/haskell.vim
endif
" vim: ts=8 " vim: ts=8

View File

@ -8,11 +8,8 @@
" PSP-style tags: <% .. %> (obsoleted feature) " PSP-style tags: <% .. %> (obsoleted feature)
" doc-strings and header comments (rarely used feature) " doc-strings and header comments (rarely used feature)
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -36,15 +33,8 @@ syn match cheetahComment "##.*$" display
syn region cheetahMultiLineComment start="#\*" end="\*#" syn region cheetahMultiLineComment start="#\*" end="\*#"
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_cheetah_syn_inits")
if version < 508
let did_cheetah_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink cheetahPlaceHolder Identifier HiLink cheetahPlaceHolder Identifier
HiLink cheetahDirective PreCondit HiLink cheetahDirective PreCondit
@ -54,7 +44,6 @@ if version >= 508 || !exists("did_cheetah_syn_inits")
HiLink cheetahMultiLineComment Comment HiLink cheetahMultiLineComment Comment
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "cheetah" let b:current_syntax = "cheetah"

View File

@ -11,11 +11,8 @@
" & Communications LTd.) " & Communications LTd.)
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -124,15 +121,8 @@ endif
exec "syn sync ccomment chillComment minlines=" . chill_minlines exec "syn sync ccomment chillComment minlines=" . chill_minlines
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_ch_syntax_inits")
if version < 508
let did_ch_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink chillLabel Label HiLink chillLabel Label
HiLink chillUserLabel Label HiLink chillUserLabel Label
@ -184,7 +174,6 @@ if version >= 508 || !exists("did_ch_syntax_inits")
HiLink chillBracket Delimiter HiLink chillBracket Delimiter
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "chill" let b:current_syntax = "chill"

View File

@ -10,19 +10,12 @@
" Version: 6 " Version: 6
" Last Change: Mar 06 2013 " Last Change: Mar 06 2013
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
if version >= 600
setlocal iskeyword=@,48-57,_,- setlocal iskeyword=@,48-57,_,-
else
set iskeyword=@,48-57,_,-
endif
syn case ignore syn case ignore
@ -75,15 +68,8 @@ syn keyword clFunction asc asize chr name random slen srandom day getarg getcgi
syn keyword clStatement clear clear_eol clear_eos close copy create unique with where empty define define ldefine delay_form delete escape exit_block exit_do exit_process field fork format get getfile getnext getprev goto head join maintain message no_join on_eop on_key on_exit on_delete openin openout openapp pause popenin popenout popenio print put range read redisplay refresh restart_block screen select sleep text unlock write and not or do syn keyword clStatement clear clear_eol clear_eos close copy create unique with where empty define define ldefine delay_form delete escape exit_block exit_do exit_process field fork format get getfile getnext getprev goto head join maintain message no_join on_eop on_key on_exit on_delete openin openout openapp pause popenin popenout popenio print put range read redisplay refresh restart_block screen select sleep text unlock write and not or do
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_cl_syntax_inits")
if version < 508
let did_cl_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink clifError Error HiLink clifError Error
HiLink clSpaceError Error HiLink clSpaceError Error
@ -108,7 +94,6 @@ if version >= 508 || !exists("did_cl_syntax_inits")
HiLink clStatement Statement HiLink clStatement Statement
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "cl" let b:current_syntax = "cl"

View File

@ -4,11 +4,8 @@
" Co-Author: Arthur van Leeuwen <arthurvl@sci.kun.nl> " Co-Author: Arthur van Leeuwen <arthurvl@sci.kun.nl>
" Last Change: 2013 Oct 15 by Jurriën Stutterheim " Last Change: 2013 Oct 15 by Jurriën Stutterheim
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -52,15 +49,8 @@ syn match cleanFuncTypeDef "\([a-zA-Z].*\|(\=[-~@#$%^?!+*<>\/|&=:]\+)\=\)\s*\(in
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_clean_syntax_init")
if version < 508
let did_clean_syntax_init = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
" Comments " Comments
HiLink cleanComment Comment HiLink cleanComment Comment
@ -94,7 +84,6 @@ if version >= 508 || !exists("did_clean_syntax_init")
HiLink cleanTodo Todo HiLink cleanTodo Todo
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "clean" let b:current_syntax = "clean"

View File

@ -4,11 +4,8 @@
" Some things based on c.vim by Bram Moolenaar and pascal.vim by Mario Eusebio " Some things based on c.vim by Bram Moolenaar and pascal.vim by Mario Eusebio
" Last Change: 2011 Dec 29 by Thilo Six " Last Change: 2011 Dec 29 by Thilo Six
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -114,15 +111,8 @@ syntax match clipperComment "^\*.*"
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_clipper_syntax_inits")
if version < 508
let did_clipper_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink clipperConditional Conditional HiLink clipperConditional Conditional
HiLink clipperRepeat Repeat HiLink clipperRepeat Repeat
@ -139,7 +129,6 @@ if version >= 508 || !exists("did_clipper_syntax_inits")
HiLink clipperUserVariable Identifier HiLink clipperUserVariable Identifier
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "clipper" let b:current_syntax = "clipper"

View File

@ -12,11 +12,8 @@
" http://www.cmake.org/HTML/Copyright.html " http://www.cmake.org/HTML/Copyright.html
" This implies that distribution with Vim is allowed " This implies that distribution with Vim is allowed
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
let s:keepcpo= &cpo let s:keepcpo= &cpo
@ -52,15 +49,8 @@ syn keyword cmakeTodo
\ contained \ contained
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_cmake_syntax_inits")
if version < 508
let did_cmake_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink cmakeStatement Statement HiLink cmakeStatement Statement
HiLink cmakeComment Comment HiLink cmakeComment Comment
@ -77,7 +67,6 @@ if version >= 508 || !exists("did_cmake_syntax_inits")
HiLink cmakeEscaped Special HiLink cmakeEscaped Special
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "cmake" let b:current_syntax = "cmake"

View File

@ -6,20 +6,13 @@
" James Mitchell <james_mitchell@acm.org>) " James Mitchell <james_mitchell@acm.org>)
" Last Change: 2015 Feb 13 " Last Change: 2015 Feb 13
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
" MOST important - else most of the keywords wont work! " MOST important - else most of the keywords wont work!
if version < 600
set isk=@,48-57,-
else
setlocal isk=@,48-57,- setlocal isk=@,48-57,-
endif
syn case ignore syn case ignore
@ -157,15 +150,8 @@ else
endif endif
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_cobol_syntax_inits")
if version < 508
let did_cobol_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink cobolBAD Error HiLink cobolBAD Error
HiLink cobolBadID Error HiLink cobolBadID Error
@ -202,7 +188,6 @@ if version >= 508 || !exists("did_cobol_syntax_inits")
HiLink cobolIndicator Special HiLink cobolIndicator Special
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "cobol" let b:current_syntax = "cobol"

View File

@ -5,9 +5,8 @@
" Remark: Coco/R syntax partially implemented. " Remark: Coco/R syntax partially implemented.
" License: Vim license " License: Vim license
if version < 600 " quit when a syntax file was already loaded
syntax clear if exists("b:current_syntax")
elseif exists("b:current_syntax")
finish finish
endif endif

View File

@ -11,11 +11,8 @@
" script, so I wrote this quick and dirty patch. " script, so I wrote this quick and dirty patch.
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -37,15 +34,8 @@ syn region configstring matchgroup=configfunction start="AC_MSG_[A-Z]*\ze(\[" m
syn region configstring matchgroup=configfunction start="AC_MSG_[A-Z]*\ze([^[]" matchgroup=configdelimiter end=")" contains=configdelimiter,@Spell syn region configstring matchgroup=configfunction start="AC_MSG_[A-Z]*\ze([^[]" matchgroup=configdelimiter end=")" contains=configdelimiter,@Spell
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_config_syntax_inits")
if version < 508
let did_config_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink configdelimiter Delimiter HiLink configdelimiter Delimiter
HiLink configoperator Operator HiLink configoperator Operator
@ -58,7 +48,6 @@ if version >= 508 || !exists("did_config_syntax_inits")
HiLink configstring String HiLink configstring String
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "config" let b:current_syntax = "config"

View File

@ -4,21 +4,14 @@
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu> " Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
" Last Change: 2016 Jul 07 " Last Change: 2016 Jul 07
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
" Read the C syntax to start with " Read the C syntax to start with
if version < 600
so <sfile>:p:h/c.vim
else
runtime! syntax/c.vim runtime! syntax/c.vim
unlet b:current_syntax unlet b:current_syntax
endif
" C++ extensions " C++ extensions
syn keyword cppStatement new delete this friend using syn keyword cppStatement new delete this friend using
@ -60,13 +53,7 @@ endif
syn match cppMinMax "[<>]?" syn match cppMinMax "[<>]?"
" Default highlighting " Default highlighting
if version >= 508 || !exists("did_cpp_syntax_inits")
if version < 508
let did_cpp_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink cppAccess cppStatement HiLink cppAccess cppStatement
HiLink cppCast cppStatement HiLink cppCast cppStatement
HiLink cppExceptions Exception HiLink cppExceptions Exception
@ -82,7 +69,6 @@ if version >= 508 || !exists("did_cpp_syntax_inits")
HiLink cppRawString String HiLink cppRawString String
HiLink cppNumber Number HiLink cppNumber Number
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "cpp" let b:current_syntax = "cpp"

View File

@ -10,11 +10,8 @@
" crontab line format: " crontab line format:
" Minutes Hours Days Months Days_of_Week Commands # comments " Minutes Hours Days Months Days_of_Week Commands # comments
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -39,15 +36,8 @@ syntax match crontabCmnt "^\s*#.*" contains=@Spell
syntax match crontabPercent "[^\\]%.*"lc=1 contained syntax match crontabPercent "[^\\]%.*"lc=1 contained
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_crontab_syn_inits")
if version < 508
let did_crontab_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink crontabMin Number HiLink crontabMin Number
HiLink crontabHr PreProc HiLink crontabHr PreProc
@ -73,7 +63,6 @@ if version >= 508 || !exists("did_crontab_syn_inits")
HiLink crontabCmnt Comment HiLink crontabCmnt Comment
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "crontab" let b:current_syntax = "crontab"

View File

@ -3,11 +3,8 @@
" Maintainer: Raul Segura Acevedo <raulseguraaceved@netscape.net> " Maintainer: Raul Segura Acevedo <raulseguraaceved@netscape.net>
" Last change: 2011 Dec 25 by Thilo Six " Last change: 2011 Dec 25 by Thilo Six
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -145,7 +142,7 @@ sy match cscBPMacro contained "!"
sy match cscBPW "!\s*\a*" contains=cscBPmacro sy match cscBPW "!\s*\a*" contains=cscBPmacro
" when wanted, highlighting lhs members or erros in asignments (may lag the editing) " when wanted, highlighting lhs members or erros in asignments (may lag the editing)
if version >= 600 && exists("csc_asignment") if exists("csc_asignment")
sy match cscEqError '\("[^"]*"\s*\|[^][\t !%()*+,--/:;<=>{}~]\+\s*\|->\s*\)*=\([^=]\@=\|$\)' sy match cscEqError '\("[^"]*"\s*\|[^][\t !%()*+,--/:;<=>{}~]\+\s*\|->\s*\)*=\([^=]\@=\|$\)'
sy region cscFormula transparent matchgroup=cscVarName start='\("[^"]*"\|[^][\t !%()*+,--/:;<=>{}~]\+\)\s*=\([^=]\@=\|\n\)' skip='"[^"]*"' end=';' contains=ALLBUT,cscFormula,cscFormulaIn,cscBPMacro,cscCondition sy region cscFormula transparent matchgroup=cscVarName start='\("[^"]*"\|[^][\t !%()*+,--/:;<=>{}~]\+\)\s*=\([^=]\@=\|\n\)' skip='"[^"]*"' end=';' contains=ALLBUT,cscFormula,cscFormulaIn,cscBPMacro,cscCondition
sy region cscFormulaIn matchgroup=cscVarName transparent start='\("[^"]*"\|[^][\t !%()*+,--/:;<=>{}~]\+\)\(->\("[^"]*"\|[^][\t !%()*+,--/:;<=>{}~]\+\)\)*\s*=\([^=]\@=\|$\)' skip='"[^"]*"' end=';' contains=ALLBUT,cscFormula,cscFormulaIn,cscBPMacro,cscCondition contained sy region cscFormulaIn matchgroup=cscVarName transparent start='\("[^"]*"\|[^][\t !%()*+,--/:;<=>{}~]\+\)\(->\("[^"]*"\|[^][\t !%()*+,--/:;<=>{}~]\+\)\)*\s*=\([^=]\@=\|$\)' skip='"[^"]*"' end=';' contains=ALLBUT,cscFormula,cscFormulaIn,cscBPMacro,cscCondition contained
@ -158,15 +155,8 @@ endif
exec "sy sync ccomment cscComment minlines=" . csc_minlines exec "sy sync ccomment cscComment minlines=" . csc_minlines
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_csc_syntax_inits")
if version < 508
let did_csc_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
hi cscVarName term=bold ctermfg=9 gui=bold guifg=blue hi cscVarName term=bold ctermfg=9 gui=bold guifg=blue
@ -195,7 +185,6 @@ if version >= 508 || !exists("did_csc_syntax_inits")
HiLink cscBPW WarningMsg HiLink cscBPW WarningMsg
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "csc" let b:current_syntax = "csc"

View File

@ -5,11 +5,8 @@
" Version: 11 " Version: 11
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_CSH " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_CSH
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -100,23 +97,11 @@ syn match cshNumber "-\=\<\d\+\>"
"syn match cshIdentifier "\<[a-zA-Z._][a-zA-Z0-9._]*\>" "syn match cshIdentifier "\<[a-zA-Z._][a-zA-Z0-9._]*\>"
" Shell Input Redirection (Here Documents) " Shell Input Redirection (Here Documents)
if version < 600
syn region cshHereDoc matchgroup=cshRedir start="<<-\=\s*\**END[a-zA-Z_0-9]*\**" matchgroup=cshRedir end="^END[a-zA-Z_0-9]*$"
syn region cshHereDoc matchgroup=cshRedir start="<<-\=\s*\**EOF\**" matchgroup=cshRedir end="^EOF$"
else
syn region cshHereDoc matchgroup=cshRedir start="<<-\=\s*\**\z(\h\w*\)\**" matchgroup=cshRedir end="^\z1$" syn region cshHereDoc matchgroup=cshRedir start="<<-\=\s*\**\z(\h\w*\)\**" matchgroup=cshRedir end="^\z1$"
endif
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_csh_syntax_inits")
if version < 508
let did_csh_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink cshArgv cshVariables HiLink cshArgv cshVariables
HiLink cshBckQuote cshCommand HiLink cshBckQuote cshCommand
@ -153,7 +138,6 @@ if version >= 508 || !exists("did_csh_syntax_inits")
HiLink cshVariables Type HiLink cshVariables Type
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "csh" let b:current_syntax = "csh"

View File

@ -15,11 +15,8 @@
" - The additional syntax for the RT-Tester (pseudo-comments) " - The additional syntax for the RT-Tester (pseudo-comments)
" should be optional. " should be optional.
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -149,15 +146,8 @@ syn match cspSdlRttComment "pragma\s\+SDL_MATCH\s\+" nextgroup=cspRttPragmaSdlAr
syn sync lines=250 syn sync lines=250
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_csp_syn_inits")
if version < 508
let did_csp_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
" The default methods for highlighting. Can be overridden later " The default methods for highlighting. Can be overridden later
" (For vim version <=5.7, the command groups are defined in " (For vim version <=5.7, the command groups are defined in
@ -188,7 +178,6 @@ if version >= 508 || !exists("did_csp_syn_inits")
" (Currently unused vim method: Debug) " (Currently unused vim method: Debug)
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "csp" let b:current_syntax = "csp"

View File

@ -8,12 +8,9 @@
" URL: https://github.com/JulesWang/css.vim " URL: https://github.com/JulesWang/css.vim
" Last Change: 2015 Apr.17 " Last Change: 2015 Apr.17
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded
if !exists("main_syntax") if !exists("main_syntax")
if version < 600 if exists("b:current_syntax")
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
let main_syntax = 'css' let main_syntax = 'css'
@ -516,15 +513,8 @@ if main_syntax == "css"
endif endif
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_css_syn_inits")
if version < 508
let did_css_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink cssComment Comment HiLink cssComment Comment
HiLink cssVendor Comment HiLink cssVendor Comment
@ -648,7 +638,6 @@ if version >= 508 || !exists("did_css_syn_inits")
HiLink cssNoise Noise HiLink cssNoise Noise
HiLink atKeyword PreProc HiLink atKeyword PreProc
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "css" let b:current_syntax = "css"

View File

@ -4,11 +4,8 @@
" Last Change: 2002 Apr 13 " Last Change: 2002 Apr 13
" Version Info: @(#)cterm.vim 1.7 97/12/15 09:23:14 " Version Info: @(#)cterm.vim 1.7 97/12/15 09:23:14
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -142,15 +139,8 @@ syn match ctermCharacter "'[^\\]'"
syn match ctermSpecialCharacter "'\\.'" syn match ctermSpecialCharacter "'\\.'"
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_cterm_syntax_inits")
if version < 508
let did_cterm_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink ctermStatement Statement HiLink ctermStatement Statement
HiLink ctermFunction Statement HiLink ctermFunction Statement
@ -183,7 +173,6 @@ if version >= 508 || !exists("did_cterm_syntax_inits")
"hi Special term=bold ctermfg=6 guifg=SlateBlue gui=underline "hi Special term=bold ctermfg=6 guifg=SlateBlue gui=underline
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "cterm" let b:current_syntax = "cterm"

View File

@ -3,20 +3,13 @@
" Maintainer: Timothy B. Terriberry <tterribe@users.sourceforge.net> " Maintainer: Timothy B. Terriberry <tterribe@users.sourceforge.net>
" Last Change: 2007 Oct 13 " Last Change: 2007 Oct 13
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
" Read the C syntax to start with " Read the C syntax to start with
if version < 600
source <sfile>:p:h/c.vim
else
runtime! syntax/c.vim runtime! syntax/c.vim
endif
" CUDA extentions " CUDA extentions
syn keyword cudaStorageClass __device__ __global__ __host__ syn keyword cudaStorageClass __device__ __global__ __host__

View File

@ -3,11 +3,8 @@
" Maintainer: John Cook <johncook3@gmail.com> " Maintainer: John Cook <johncook3@gmail.com>
" Last Change: 2011 Dec 27 " Last Change: 2011 Dec 27
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -95,15 +92,8 @@ syn region cuplComment start=+/\*+ end=+\*/+ contains=cuplNumber,cuplTodo
syn sync minlines=1 syn sync minlines=1
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_cupl_syn_inits")
if version < 508
let did_cupl_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
" The default highlighting. " The default highlighting.
HiLink cuplHeader cuplStatement HiLink cuplHeader cuplStatement
@ -127,7 +117,6 @@ if version >= 508 || !exists("did_cupl_syn_inits")
HiLink cuplTodo Todo HiLink cuplTodo Todo
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "cupl" let b:current_syntax = "cupl"

View File

@ -3,21 +3,14 @@
" Maintainer: John Cook <john.cook@kla-tencor.com> " Maintainer: John Cook <john.cook@kla-tencor.com>
" Last Change: 2001 Apr 25 " Last Change: 2001 Apr 25
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
" Read the CUPL syntax to start with " Read the CUPL syntax to start with
if version < 600
source <sfile>:p:h/cupl.vim
else
runtime! syntax/cupl.vim runtime! syntax/cupl.vim
unlet b:current_syntax unlet b:current_syntax
endif
" omit definition-specific stuff " omit definition-specific stuff
syn clear cuplStatement syn clear cuplStatement
@ -53,15 +46,8 @@ syn match cuplsimOutput +"\x\+"+
syn sync minlines=1 syn sync minlines=1
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_cuplsim_syn_inits")
if version < 508
let did_cuplsim_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
" append to the highlighting links in cupl.vim " append to the highlighting links in cupl.vim
" The default highlighting. " The default highlighting.
@ -74,7 +60,6 @@ if version >= 508 || !exists("did_cuplsim_syn_inits")
HiLink cuplsimOrderFormat cuplNumber HiLink cuplsimOrderFormat cuplNumber
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "cuplsim" let b:current_syntax = "cuplsim"
" vim:ts=8 " vim:ts=8

View File

@ -4,11 +4,8 @@
" URL: http://www.zotikos.com/downloads/cvs.vim " URL: http://www.zotikos.com/downloads/cvs.vim
" Last Change: Sat Nov 24 23:25:11 CET 2001 " Last Change: Sat Nov 24 23:25:11 CET 2001
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -20,15 +17,8 @@ syn region cvsCom start="Committing in" end="$" contains=cvsDir contained extend
syn match cvsDir contained "\S\+$" syn match cvsDir contained "\S\+$"
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_cvs_syn_inits")
if version < 508
let did_cvs_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink cvsLine Comment HiLink cvsLine Comment
HiLink cvsDir cvsFile HiLink cvsDir cvsFile
@ -38,6 +28,5 @@ if version >= 508 || !exists("did_cvs_syn_inits")
HiLink cvsCom Statement HiLink cvsCom Statement
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "cvs" let b:current_syntax = "cvs"

View File

@ -13,11 +13,8 @@
" TODO: names, and leaves C/C++ comments as such. (On the other hand, " TODO: names, and leaves C/C++ comments as such. (On the other hand,
" TODO: switching to TeX mode in C/C++ comments might be colour overkill.) " TODO: switching to TeX mode in C/C++ comments might be colour overkill.)
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -25,12 +22,8 @@ endif
" level in the CWEB syntax, e.g., in the preamble. In general, a CWEB source " level in the CWEB syntax, e.g., in the preamble. In general, a CWEB source
" code can be seen as a normal TeX document with some C/C++ material " code can be seen as a normal TeX document with some C/C++ material
" interspersed in certain defined regions. " interspersed in certain defined regions.
if version < 600
source <sfile>:p:h/tex.vim
else
runtime! syntax/tex.vim runtime! syntax/tex.vim
unlet b:current_syntax unlet b:current_syntax
endif
" Read the C/C++ syntax too; C/C++ syntax items are treated as such in the " Read the C/C++ syntax too; C/C++ syntax items are treated as such in the
" C/C++ section of a CWEB chunk or in inner C/C++ context in "|...|" groups. " C/C++ section of a CWEB chunk or in inner C/C++ context in "|...|" groups.
@ -63,20 +56,12 @@ syntax region webRestrictedTeX start="@[\^\.:t=q]" end="@>" oneline
syntax match webIgnoredStuff "@@" syntax match webIgnoredStuff "@@"
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_cweb_syntax_inits")
if version < 508
let did_cweb_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink webRestrictedTeX String HiLink webRestrictedTeX String
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "cweb" let b:current_syntax = "cweb"

View File

@ -15,22 +15,15 @@
" Remove any old syntax stuff hanging around " Remove any old syntax stuff hanging around
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
" Read the C++ syntax to start with - this includes the C syntax " Read the C++ syntax to start with - this includes the C syntax
if version < 600
source <sfile>:p:h/cpp.vim
else
runtime! syntax/cpp.vim runtime! syntax/cpp.vim
endif
unlet b:current_syntax unlet b:current_syntax
" Cynlib extensions " Cynlib extensions
@ -69,15 +62,8 @@ syn match cynlibOperator "<<="
syn keyword cynlibType In Out InST OutST Int Uint Const Cynclock syn keyword cynlibType In Out InST OutST Int Uint Const Cynclock
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_cynlib_syntax_inits")
if version < 508
let did_cynlib_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink cynlibOperator Operator HiLink cynlibOperator Operator
HiLink cynlibMacro Statement HiLink cynlibMacro Statement
@ -86,6 +72,5 @@ if version >= 508 || !exists("did_cynlib_syntax_inits")
HiLink cynlibType Type HiLink cynlibType Type
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "cynlib" let b:current_syntax = "cynlib"

View File

@ -19,21 +19,13 @@
" Remove any old syntax stuff hanging around " quit when a syntax file was already loaded
" For version 5.x: Clear all syntax items if exists("b:current_syntax")
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
" Read the Cynlib syntax to start with - this includes the C++ syntax " Read the Cynlib syntax to start with - this includes the C++ syntax
if version < 600
source <sfile>:p:h/cynlib.vim
else
runtime! syntax/cynlib.vim runtime! syntax/cynlib.vim
endif
unlet b:current_syntax unlet b:current_syntax
@ -49,20 +41,12 @@ syn keyword cynppMacro Thread EndThread
syn keyword cynppMacro Instantiate syn keyword cynppMacro Instantiate
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_cynpp_syntax_inits")
if version < 508
let did_cynpp_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink cLabel Label HiLink cLabel Label
HiLink cynppMacro Statement HiLink cynppMacro Statement
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "cynpp" let b:current_syntax = "cynpp"

View File

@ -8,9 +8,8 @@
" "
" http://dstools.sourceforge.net/DataScriptLanguageOverview.html " http://dstools.sourceforge.net/DataScriptLanguageOverview.html
if version < 600 " quit when a syntax file was already loaded
syntax clear if exists("b:current_syntax")
elseif exists("b:current_syntax")
finish finish
endif endif
let s:keepcpo= &cpo let s:keepcpo= &cpo

View File

@ -3,11 +3,8 @@
" Maintainer: Christopher Shinn <christopher@lucent.com> " Maintainer: Christopher Shinn <christopher@lucent.com>
" Last Change: 2003 Apr 25 " Last Change: 2003 Apr 25
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -40,15 +37,8 @@ syn keyword dcdSpecial PRV1 PRV2 PRV3 PRV4 PRV5 PRV6 PRV7 PRV8
syn region dcdComment start="\*" end="\;" syn region dcdComment start="\*" end="\;"
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_dcd_syntax_inits")
if version < 508
let did_dcd_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif
HiLink dcdFunction Identifier HiLink dcdFunction Identifier
HiLink dcdLabel Constant HiLink dcdLabel Constant
@ -59,6 +49,5 @@ if version >= 508 || !exists("did_dcd_syntax_inits")
HiLink dcdComment Comment HiLink dcdComment Comment
delcommand HiLink delcommand HiLink
endif
let b:current_syntax = "dcd" let b:current_syntax = "dcd"

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