mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a97304cf6 | ||
|
|
d8eaa50aed | ||
|
|
8e26e6e963 | ||
|
|
676e9dd82e | ||
|
|
23af3f70da | ||
|
|
b79385fecc | ||
|
|
03dd22587a | ||
|
|
bbc6be1099 | ||
|
|
7f2e366334 | ||
|
|
04f868b94a | ||
|
|
4071c094c6 |
12
README.md
12
README.md
@@ -26,7 +26,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
||||
## Language packs
|
||||
|
||||
- [arduino](https://github.com/sudar/vim-arduino-syntax) (syntax, indent, ftdetect)
|
||||
- [blade](https://github.com/xsbeats/vim-blade) (syntax, indent, ftdetect)
|
||||
- [blade](https://github.com/xsbeats/vim-blade) (syntax, ftdetect)
|
||||
- [c++11](https://github.com/octol/vim-cpp-enhanced-highlight) (syntax)
|
||||
- [c/c++](https://github.com/vim-jp/cpp-vim) (syntax)
|
||||
- [c-extensions](https://github.com/kergoth/aftersyntaxc.vim) (syntax)
|
||||
@@ -39,7 +39,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
||||
- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||
- [emberscript](https://github.com/heartsentwined/vim-ember-script) (syntax, indent, ftplugin, ftdetect)
|
||||
- [emblem](https://github.com/heartsentwined/vim-emblem) (syntax, indent, ftplugin, ftdetect)
|
||||
- [erlang](https://github.com/oscarh/vimerl) (syntax, indent, compiler, autoload, ftplugin)
|
||||
- [erlang](https://github.com/hcs42/vim-erlang-runtime) (syntax, indent)
|
||||
- [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin, ftdetect)
|
||||
- [go](https://github.com/fatih/vim-go) (syntax, indent, ftdetect)
|
||||
- [haml](https://github.com/tpope/vim-haml) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||
@@ -63,6 +63,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
||||
- [perl](https://github.com/vim-perl/vim-perl) (syntax, indent, ftplugin, ftdetect)
|
||||
- [php](https://github.com/StanAngeloff/php.vim) (syntax)
|
||||
- [puppet](https://github.com/rodjek/vim-puppet) (syntax, indent, ftplugin, ftdetect)
|
||||
- [powershell](https://github.com/Persistent13/vim-ps1) (syntax, indent, ftplugin, ftdetect)
|
||||
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, ftdetect)
|
||||
- [python](https://github.com/mitsuhiko/vim-python-combined) (syntax, indent)
|
||||
- [r-lang](https://github.com/vim-scripts/R.vim) (syntax, ftplugin)
|
||||
@@ -76,14 +77,17 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
||||
- [systemd](https://github.com/kurayama/systemd-vim-syntax) (syntax, ftdetect)
|
||||
- [swift](https://github.com/toyamarinyon/vim-swift) (syntax, indent, ftdetect)
|
||||
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, ftdetect)
|
||||
- [tmux](https://github.com/acustodioo/vim-tmux) (syntax, ftdetect)
|
||||
- [tmux](https://github.com/tejr/vim-tmux) (syntax, ftdetect)
|
||||
- [tomdoc](https://github.com/duwanis/tomdoc.vim) (syntax)
|
||||
- [typescript](https://github.com/leafgarland/typescript-vim) (syntax, compiler, ftplugin, ftdetect)
|
||||
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
|
||||
- [toml](https://github.com/cespare/vim-toml) (syntax, ftdetect)
|
||||
- [thrift](https://github.com/solarnz/thrift.vim) (syntax, ftdetect)
|
||||
- [toml](https://github.com/cespare/vim-toml) (syntax, ftplugin, ftdetect)
|
||||
- [twig](https://github.com/beyondwords/vim-twig) (syntax, ftplugin, ftdetect)
|
||||
- [xls](https://github.com/vim-scripts/XSLT-syntax) (syntax)
|
||||
- [yard](https://github.com/sheerun/vim-yardoc) (syntax)
|
||||
- [vala](https://github.com/tkztmk/vim-vala) (syntax, indent, ftdetect)
|
||||
- [vm](https://github.com/lepture/vim-velocity) (syntax, indent, ftdetect)
|
||||
- [css-color](https://github.com/ap/vim-css-color) (autoload, syntax)
|
||||
|
||||
## Contributing
|
||||
|
||||
@@ -1312,6 +1312,8 @@ if !exists("cpp_no_cpp11")
|
||||
|
||||
"raw string literals
|
||||
syntax region cppRawString matchgroup=cppRawDelimiter start=@\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(@ end=/)\z1"/ contains=@Spell
|
||||
|
||||
syn match cNumber "0b[01]\+"
|
||||
endif " C++11
|
||||
|
||||
if !exists("cpp_no_cpp14")
|
||||
|
||||
@@ -3,4 +3,11 @@
|
||||
|
||||
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
||||
|
||||
call css_color#init('css', 'lessVariableValue,lessDefinition,lessComment')
|
||||
" variable | property | multiline | end-of-line | plugin
|
||||
" -----------------------+----------------+----------------+-------------+---------
|
||||
" lessCssAttribute | lessCssComment | lessComment | https://github.com/genoma/vim-less
|
||||
" lessAttribute | lessCssComment | lessComment | https://github.com/KohPoll/vim-less
|
||||
" lessVariableValue | lessDefinition | cssComment | lessComment | https://github.com/groenewege/vim-less
|
||||
" lessVariableDefinition | cssDefinition | cssComment | lessComment | https://github.com/lunaru/vim-less
|
||||
|
||||
call css_color#init('css', 'lessVariableValue,lessVariableDefinition,lessDefinition,lessCssAttribute,lessAttribute,cssDefinition,cssComment,lessCssComment,lessComment')
|
||||
|
||||
6
after/syntax/scss.vim
Normal file
6
after/syntax/scss.vim
Normal file
@@ -0,0 +1,6 @@
|
||||
" Language: Colorful CSS Color Preview
|
||||
" Author: Aristotle Pagaltzis <pagaltzis@gmx.de>
|
||||
|
||||
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
||||
|
||||
call css_color#init('css', 'scssAttribute,scssComment,scssVariableValue,sassCssAttribute,cssComment')
|
||||
@@ -1,8 +1,7 @@
|
||||
" Language: Colorful CSS Color Preview
|
||||
" Author: Aristotle Pagaltzis <pagaltzis@gmx.de>
|
||||
" Last Change: 2014-01-14
|
||||
" Licence: No Warranties. WTFPL. But please tell me!
|
||||
" Version: 1.0
|
||||
" Commit: $Format:%H$
|
||||
" Licence: The MIT License (MIT)
|
||||
|
||||
if v:version < 700
|
||||
echoerr printf('Vim 7 is required for css-color (this is only %d.%d)',v:version/100,v:version%100)
|
||||
@@ -206,28 +205,34 @@ function! s:create_syn_match()
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! s:update_matches()
|
||||
call filter(b:color_match_id, 'matchdelete(v:val)')
|
||||
if &l:cursorline
|
||||
" adds matches based that duplicate the highlighted colors on the current line
|
||||
let lnr = line('.')
|
||||
let group = ''
|
||||
let groupstart = 0
|
||||
let endcol = col('$')
|
||||
for col in range( 1, endcol )
|
||||
let nextgroup = col < endcol ? synIDattr( synID( lnr, col, 1 ), 'name' ) : ''
|
||||
if group == nextgroup | continue | endif
|
||||
if group =~ '^BG\x\{6}$'
|
||||
let regex = '\%'.lnr.'l\%'.groupstart.'c'.repeat( '.', col - groupstart )
|
||||
let match = matchadd( group, regex, -1 )
|
||||
let b:color_match_id += [ match ]
|
||||
endif
|
||||
let group = nextgroup
|
||||
let groupstart = col
|
||||
endfor
|
||||
function! s:clear_matches()
|
||||
if exists('w:color_match_id')
|
||||
call filter(w:color_match_id, 'matchdelete(v:val)')
|
||||
unlet w:color_match_id
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:create_matches()
|
||||
if ! &l:cursorline | return | endif
|
||||
" adds matches based that duplicate the highlighted colors on the current line
|
||||
let lnr = line('.')
|
||||
let group = ''
|
||||
let groupstart = 0
|
||||
let endcol = col('$')
|
||||
let w:color_match_id = []
|
||||
for col in range( 1, endcol )
|
||||
let nextgroup = col < endcol ? synIDattr( synID( lnr, col, 1 ), 'name' ) : ''
|
||||
if group == nextgroup | continue | endif
|
||||
if group =~ '^BG\x\{6}$'
|
||||
let regex = '\%'.lnr.'l\%'.groupstart.'c'.repeat( '.', col - groupstart )
|
||||
let match = matchadd( group, regex, -1 )
|
||||
let w:color_match_id += [ match ]
|
||||
endif
|
||||
let group = nextgroup
|
||||
let groupstart = col
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
let s:_hexcolor = '#\(\x\{3}\|\x\{6}\)\>' " submatch 1
|
||||
let s:_funcname = '\(rgb\|hsl\)a\?' " submatch 2
|
||||
let s:_numval = '\(\d\{1,3}%\?\)' " submatch 3,4,5
|
||||
@@ -242,11 +247,13 @@ let s:_csscolor = s:_hexcolor . '\|' . s:_funcexpr
|
||||
" scan without examining the start of the string over and over
|
||||
function! s:parse_css_screen()
|
||||
call substitute( join( getline('w0','w$'), "\n" ), s:_csscolor, '\=s:create_syn_match()', 'g' )
|
||||
call s:update_matches()
|
||||
call s:clear_matches()
|
||||
call s:create_matches()
|
||||
endfunction
|
||||
function! s:parse_any_screen()
|
||||
call substitute( join( getline('w0','w$'), "\n" ), s:_hexcolor, '\=s:create_syn_match()', 'g' )
|
||||
call s:update_matches()
|
||||
call s:clear_matches()
|
||||
call s:create_matches()
|
||||
endfunction
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
@@ -256,14 +263,15 @@ function! css_color#init(type, groups)
|
||||
|
||||
let b:has_color_hi = {}
|
||||
let b:has_pattern_syn = {}
|
||||
let b:color_match_id = []
|
||||
|
||||
augroup CSSColor
|
||||
autocmd! * <buffer>
|
||||
exe 'autocmd CursorMoved,CursorMovedI <buffer> call s:parse_'.a:type.'_screen()'
|
||||
autocmd BufWinEnter <buffer> call s:create_matches()
|
||||
autocmd BufWinLeave <buffer> call s:clear_matches()
|
||||
augroup END
|
||||
|
||||
do CSSColor CursorMoved <buffer>
|
||||
exe 'call s:parse_'.a:type.'_screen()'
|
||||
|
||||
if a:type != 'css' | return | endif
|
||||
|
||||
|
||||
@@ -1,161 +0,0 @@
|
||||
" ------------------------------------------------------------------------------
|
||||
" Vim omni-completion script
|
||||
" Author: Oscar Hellström
|
||||
" Email: oscar@oscarh.net
|
||||
" Version: 2010-08-10
|
||||
" Contributors: kTT (http://github.com/kTT)
|
||||
" Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
||||
" ------------------------------------------------------------------------------
|
||||
|
||||
" Patterns for completions {{{1
|
||||
let s:erlangLocalFuncBeg = '\(\<[0-9A-Za-z_-]*\|\s*\)$'
|
||||
let s:erlangExternalFuncBeg = '\<[0-9A-Za-z_-]\+:[0-9A-Za-z_-]*$'
|
||||
let s:ErlangBlankLine = '^\s*\(%.*\)\?$'
|
||||
let s:erlangCompletionPath = expand('<sfile>:p:h') . '/erlang_completion.erl'
|
||||
|
||||
if !exists('g:erlangCompletionGrep')
|
||||
let g:erlangCompletionGrep = 'grep'
|
||||
endif
|
||||
|
||||
if !exists('g:erlangManSuffix')
|
||||
let g:erlangManSuffix = ''
|
||||
endif
|
||||
|
||||
if !exists('g:erlangManPath')
|
||||
let g:erlangManPath = '/usr/lib/erlang/man'
|
||||
endif
|
||||
|
||||
if !exists('g:erlangCompletionDisplayDoc')
|
||||
let g:erlangCompletionDisplayDoc = 1
|
||||
endif
|
||||
|
||||
" Main function for completion {{{1
|
||||
function! erlangcomplete#Complete(findstart, base)
|
||||
" 0) Init {{{2
|
||||
let lnum = line('.')
|
||||
let column = col('.')
|
||||
let line = strpart(getline('.'), 0, column - 1)
|
||||
|
||||
" 1) First, check if completion is impossible {{{2
|
||||
if line =~ '[^~\\]%'
|
||||
return -1
|
||||
endif
|
||||
|
||||
"echo "line[col - 1]:" . line[column - 1] . " line[col - 2]:" . line[column - 2] . "\n" . line . "\n"
|
||||
|
||||
" 2) Check if the char to the left of us are part of a function call {{{2
|
||||
"
|
||||
" Nothing interesting is written at the char just before the cursor
|
||||
" This means _anything_ could be started here
|
||||
" In this case, keyword completion should probably be used,
|
||||
" for now we'll only try and complete local functions.
|
||||
" TODO: Examine if we can stare Identifiers end complete on them
|
||||
" Is this worth it? Is /completion/ of a "blank" wanted? Can we consider (
|
||||
" interesting and check if we are in a function call etc.?
|
||||
if line[column - 2] !~ '[0-9A-Za-z:_-]'
|
||||
if a:findstart
|
||||
return column
|
||||
else
|
||||
return s:erlangFindLocalFunc(a:base)
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
" 3) Function in external module {{{2
|
||||
if line =~ s:erlangExternalFuncBeg
|
||||
let delimiter = match(line, ':[0-9A-Za-z_-]*$') + 1
|
||||
if a:findstart
|
||||
return delimiter
|
||||
else
|
||||
let module = matchstr(line[:-2], '\<\k*\>$')
|
||||
return s:erlangFindExternalFunc(module, a:base)
|
||||
endif
|
||||
endif
|
||||
|
||||
" 4) Local function {{{2
|
||||
if line =~ s:erlangLocalFuncBeg
|
||||
let funcstart = match(line, ':\@<![0-9A-Za-z_-]*$')
|
||||
if a:findstart
|
||||
return funcstart
|
||||
else
|
||||
return s:erlangFindLocalFunc(a:base)
|
||||
endif
|
||||
endif
|
||||
|
||||
" 5) Unhandled situation {{{2
|
||||
if a:findstart
|
||||
return -1
|
||||
else
|
||||
return []
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Auxiliary functions for completion {{{1
|
||||
" Find the next non-blank line {{{2
|
||||
function s:erlangFindNextNonBlank(lnum)
|
||||
let lnum = nextnonblank(a:lnum + 1)
|
||||
let line = getline(lnum)
|
||||
while line =~ s:ErlangBlankLine && 0 != lnum
|
||||
let lnum = nextnonblank(lnum + 1)
|
||||
let line = getline(lnum)
|
||||
endwhile
|
||||
return lnum
|
||||
endfunction
|
||||
|
||||
" vim: foldmethod=marker:
|
||||
" Find external function names {{{2
|
||||
function s:erlangFindExternalFunc(module, base)
|
||||
" If it's a local module, try to compile it
|
||||
if filereadable(a:module . '.erl') && !filereadable(a:module . '.beam')
|
||||
silent execute '!erlc' a:module . '.erl' '>/dev/null' '2>/dev/null'
|
||||
redraw!
|
||||
endif
|
||||
let functions = system(s:erlangCompletionPath . ' ' . a:module)
|
||||
for element in sort(split(functions, '\n'))
|
||||
if match(element, a:base) == 0
|
||||
let function_name = matchstr(element, a:base . '\w\+')
|
||||
let number_of_args = matchstr(element, '\d\+', len(function_name))
|
||||
let number_of_comma = max([number_of_args - 1, 0])
|
||||
let file_path = g:erlangManPath . '/man?/' . a:module . '\.?' . g:erlangManSuffix
|
||||
" [:-2] cutting some weird characters at the end
|
||||
" becouse grep doesn't support multilines, we have to filter
|
||||
" first by .B and next by looking via function name
|
||||
" if someone have better idea, please change it
|
||||
let description = ''
|
||||
" Don't look man pages if the module is present in the current directory
|
||||
if g:erlangCompletionDisplayDoc != 0 && !filereadable(a:module . '.erl')
|
||||
let system_command = g:erlangCompletionGrep . ' -A 1 "\.B" ' . file_path . ' | grep -EZo "\<' .
|
||||
\ function_name . '\>\((\w+, ){' . number_of_comma . '}[^),]*\) -> .*"'
|
||||
let description = system(system_command)
|
||||
let description = description[:-2]
|
||||
endif
|
||||
if description == ''
|
||||
let description = element " if function doesn't have description e.g. lists:rmerge, put rmerge/2 instead
|
||||
endif
|
||||
let field = {'word': function_name . '(', 'abbr': description, 'kind': 'f', 'dup': 1} " always duplicate functions
|
||||
call complete_add(field)
|
||||
endif
|
||||
endfor
|
||||
return []
|
||||
endfunction
|
||||
|
||||
" Find local function names {{{2
|
||||
function s:erlangFindLocalFunc(base)
|
||||
" begin at line 1
|
||||
let lnum = s:erlangFindNextNonBlank(1)
|
||||
if "" == a:base
|
||||
let base = '\w' " used to match against word symbol
|
||||
else
|
||||
let base = a:base
|
||||
endif
|
||||
while 0 != lnum && !complete_check()
|
||||
let line = getline(lnum)
|
||||
let function_name = matchstr(line, '^' . base . '[0-9A-Za-z_-]\+(\@=')
|
||||
if function_name != ""
|
||||
call complete_add(function_name)
|
||||
endif
|
||||
let lnum = s:erlangFindNextNonBlank(lnum)
|
||||
endwhile
|
||||
return []
|
||||
endfunction
|
||||
|
||||
@@ -324,7 +324,7 @@ endif
|
||||
|
||||
" Ref: http://dev.w3.org/html5/markup/
|
||||
" Version: Draft 05 April 2011
|
||||
let phrasing_elements = ['a', 'em', 'strong', 'small', 'mark', 'abbr', 'dfn', 'i', 'b', 'u', 'code', 'var', 'samp', 'kbd', 'sup', 'sub', 'q', 'cite', 'span', 'bdo', 'bdi', 'br', 'wbr', 'ins', 'del', 'img', 'embed', 'object', 'iframe', 'map', 'area', 'script', 'noscript', 'ruby', 'video', 'audio', 'input', 'textarea', 'select', 'button', 'label', 'output', 'datalist', 'keygen', 'progress', 'command', 'canvas', 'time', 'meter', 'data', 'content', 'shadow']
|
||||
let phrasing_elements = ['a', 'em', 'strong', 'small', 'mark', 'abbr', 'dfn', 'i', 'b', 'u', 'code', 'var', 'samp', 'kbd', 'sup', 'sub', 'q', 'cite', 'span', 'bdo', 'bdi', 'br', 'wbr', 'ins', 'del', 'img', 'picture', 'embed', 'object', 'iframe', 'map', 'area', 'script', 'noscript', 'ruby', 'video', 'audio', 'input', 'textarea', 'select', 'button', 'label', 'output', 'datalist', 'keygen', 'progress', 'command', 'canvas', 'time', 'meter', 'data', 'content', 'shadow']
|
||||
|
||||
let metadata_elements = ['link', 'style', 'meta', 'script', 'noscript', 'command']
|
||||
|
||||
@@ -643,6 +643,10 @@ let g:xmldata_html5 = {
|
||||
\ [],
|
||||
\ extend(copy(global_attributes), {'name': [], 'value': []})
|
||||
\ ],
|
||||
\ 'picture': [
|
||||
\ flow_elements + ['source'],
|
||||
\ global_attributes
|
||||
\ ],
|
||||
\ 'pre': [
|
||||
\ phrasing_elements,
|
||||
\ global_attributes
|
||||
@@ -693,7 +697,7 @@ let g:xmldata_html5 = {
|
||||
\ ],
|
||||
\ 'source': [
|
||||
\ [],
|
||||
\ extend(copy(global_attributes), {'src': [], 'type': [], 'media': []})
|
||||
\ extend(copy(global_attributes), {'src': [], 'type': [], 'media': [], 'srcset': [], 'sizes': []})
|
||||
\ ],
|
||||
\ 'span': [
|
||||
\ phrasing_elements,
|
||||
|
||||
16
build
16
build
@@ -23,17 +23,18 @@ extract() {
|
||||
path="$(printf "$pack" | cut -d ':' -f 2)"
|
||||
dir="tmp/$(printf "$path" | cut -d '/' -f 2)"
|
||||
directories="DIRS$(printf "$pack" | cut -d ':' -f 3)"
|
||||
subtree="$(printf "$pack" | cut -d ':' -f 4)"
|
||||
printf -- "- [$name](https://github.com/$path) ("
|
||||
|
||||
subdirs=""
|
||||
for subdir in ${!directories}; do
|
||||
if [ -d "$dir/$subdir" ]; then
|
||||
if [ -d "${dir}${subtree:-/}${subdir}" ]; then
|
||||
base="$(basename "$subdir")"
|
||||
if [[ "$subdirs" != *"$base"* ]]; then
|
||||
subdirs="$subdirs, $base"
|
||||
fi
|
||||
|
||||
copy_dir "$dir" "$subdir"
|
||||
copy_dir "${dir}${subtree}" "$subdir"
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -45,8 +46,9 @@ extract() {
|
||||
name="$(printf "$pack" | cut -d ':' -f 1)"
|
||||
path="$(printf "$pack" | cut -d ':' -f 2)"
|
||||
dir="tmp/$(printf "$path" | cut -d '/' -f 2)"
|
||||
subtree="$(printf "$pack" | cut -d ':' -f 4)"
|
||||
|
||||
if [ -d "$dir/plugin" ]; then
|
||||
if [ -d "$dir${subtree:-/}plugin" ]; then
|
||||
printf "Possible error (plugin directory exists): $path\n"
|
||||
fi
|
||||
done
|
||||
@@ -82,7 +84,7 @@ PACKS="
|
||||
elixir:elixir-lang/vim-elixir
|
||||
emberscript:heartsentwined/vim-ember-script
|
||||
emblem:heartsentwined/vim-emblem
|
||||
erlang:oscarh/vimerl
|
||||
erlang:hcs42/vim-erlang-runtime
|
||||
git:tpope/vim-git
|
||||
go:fatih/vim-go:_BASIC
|
||||
haml:tpope/vim-haml
|
||||
@@ -106,6 +108,7 @@ PACKS="
|
||||
perl:vim-perl/vim-perl
|
||||
php:StanAngeloff/php.vim
|
||||
puppet:rodjek/vim-puppet
|
||||
powershell:Persistent13/vim-ps1
|
||||
protobuf:uarun/vim-protobuf
|
||||
python:mitsuhiko/vim-python-combined
|
||||
r-lang:vim-scripts/R.vim
|
||||
@@ -119,14 +122,17 @@ PACKS="
|
||||
systemd:kurayama/systemd-vim-syntax
|
||||
swift:toyamarinyon/vim-swift
|
||||
textile:timcharper/textile.vim
|
||||
tmux:acustodioo/vim-tmux
|
||||
tmux:tejr/vim-tmux
|
||||
tomdoc:duwanis/tomdoc.vim
|
||||
typescript:leafgarland/typescript-vim
|
||||
vbnet:vim-scripts/vbnet.vim
|
||||
thrift:solarnz/thrift.vim
|
||||
toml:cespare/vim-toml
|
||||
twig:beyondwords/vim-twig
|
||||
xls:vim-scripts/XSLT-syntax
|
||||
yard:sheerun/vim-yardoc
|
||||
vala:tkztmk/vim-vala
|
||||
vm:lepture/vim-velocity
|
||||
css-color:ap/vim-css-color
|
||||
"
|
||||
|
||||
|
||||
@@ -1,29 +1,35 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Cargo Compiler
|
||||
" Maintainer: Damien Radtke <damienradtke@gmail.com>
|
||||
" Latest Revision: 2014 Sep 18
|
||||
" Latest Revision: 2014 Sep 24
|
||||
|
||||
if exists("current_compiler")
|
||||
if exists('current_compiler')
|
||||
finish
|
||||
endif
|
||||
runtime compiler/rustc.vim
|
||||
let current_compiler = "cargo"
|
||||
|
||||
if exists(":CompilerSet") != 2
|
||||
if exists(':CompilerSet') != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
CompilerSet errorformat&
|
||||
CompilerSet makeprg=cargo\ $*
|
||||
if exists('g:cargo_makeprg_params')
|
||||
execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*'
|
||||
else
|
||||
CompilerSet makeprg=cargo\ $*
|
||||
endif
|
||||
|
||||
" Allow a configurable global Cargo.toml name. This makes it easy to
|
||||
" support variations like 'cargo.toml'.
|
||||
if !exists('g:cargo_toml_name')
|
||||
let g:cargo_toml_name = 'Cargo.toml'
|
||||
endif
|
||||
let s:cargo_manifest_name = get(g:, 'cargo_manifest_name', 'Cargo.toml')
|
||||
|
||||
let s:toml_dir = fnamemodify(findfile(g:cargo_toml_name, '.;'), ':p:h').'/'
|
||||
function! s:is_absolute(path)
|
||||
return a:path[0] == '/' || a:path =~ '[A-Z]\+:'
|
||||
endfunction
|
||||
|
||||
if s:toml_dir != ''
|
||||
let s:local_manifest = findfile(s:cargo_manifest_name, '.;')
|
||||
if s:local_manifest != ''
|
||||
let s:local_manifest = fnamemodify(s:local_manifest, ':p:h').'/'
|
||||
augroup cargo
|
||||
au!
|
||||
au QuickfixCmdPost make call s:FixPaths()
|
||||
@@ -33,15 +39,25 @@ if s:toml_dir != ''
|
||||
" to be relative to the current directory instead of Cargo.toml.
|
||||
function! s:FixPaths()
|
||||
let qflist = getqflist()
|
||||
let manifest = s:local_manifest
|
||||
for qf in qflist
|
||||
if !qf['valid']
|
||||
if !qf.valid
|
||||
let m = matchlist(qf.text, '(file://\(.*\))$')
|
||||
if !empty(m)
|
||||
let manifest = m[1].'/'
|
||||
" Manually strip another slash if needed; usually just an
|
||||
" issue on Windows.
|
||||
if manifest =~ '^/[A-Z]\+:/'
|
||||
let manifest = manifest[1:]
|
||||
endif
|
||||
endif
|
||||
continue
|
||||
endif
|
||||
let filename = bufname(qf['bufnr'])
|
||||
if stridx(filename, s:toml_dir) == -1
|
||||
let filename = s:toml_dir.filename
|
||||
let filename = bufname(qf.bufnr)
|
||||
if s:is_absolute(filename)
|
||||
continue
|
||||
endif
|
||||
let qf['filename'] = simplify(s:toml_dir.bufname(qf['bufnr']))
|
||||
let qf.filename = simplify(manifest.filename)
|
||||
call remove(qf, 'bufnr')
|
||||
endfor
|
||||
call setqflist(qflist, 'r')
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
" Erlang compiler file
|
||||
" Language: Erlang
|
||||
" Maintainer: Pawel 'kTT' Salata <rockplayer.pl@gmail.com>
|
||||
" URL: http://ktototaki.info
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "erlang"
|
||||
|
||||
if exists(":CompilerSet") != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
if !exists('g:erlangCheckFile')
|
||||
let g:erlangCheckFile = "~/.vim/compiler/erlang_check_file.erl"
|
||||
endif
|
||||
|
||||
if !exists('g:erlangHighlightErrors')
|
||||
let g:erlangHighlightErrors = 0
|
||||
endif
|
||||
|
||||
let b:error_list = {}
|
||||
let b:is_showing_msg = 0
|
||||
|
||||
function! HighlightErlangErrors()
|
||||
if match(getline(1), "#!.*escript") != -1
|
||||
setlocal makeprg=escript\ -s\ %
|
||||
else
|
||||
execute "setlocal makeprg=" . g:erlangCheckFile . "\\ \%"
|
||||
endif
|
||||
silent make!
|
||||
call s:clear_matches()
|
||||
for error in getqflist()
|
||||
let item = {}
|
||||
let item['lnum'] = error.lnum
|
||||
let item['msg'] = error.text
|
||||
let b:error_list[error.lnum] = item
|
||||
call matchadd('SpellBad', "\\%" . error.lnum . "l")
|
||||
endfor
|
||||
if len(getqflist())
|
||||
redraw!
|
||||
endif
|
||||
call s:show_msg()
|
||||
setlocal makeprg=erlc\ %
|
||||
endfunction
|
||||
|
||||
function! s:show_msg()
|
||||
let pos = getpos(".")
|
||||
if has_key(b:error_list, pos[1])
|
||||
let item = get(b:error_list, pos[1])
|
||||
echo item.msg
|
||||
let b:is_showing_msg = 1
|
||||
else
|
||||
if exists("b:is_showing_msg") && b:is_showing_msg == 1
|
||||
echo
|
||||
let b:is_showing_msg = 0
|
||||
endif
|
||||
endif
|
||||
endf
|
||||
|
||||
function! s:clear_matches()
|
||||
call clearmatches()
|
||||
let b:error_list = {}
|
||||
if exists("b:is_showing_msg") && b:is_showing_msg == 1
|
||||
echo
|
||||
let b:is_showing_msg = 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
CompilerSet makeprg=erlc\ %
|
||||
CompilerSet errorformat=%f:%l:\ %tarning:\ %m,%E%f:%l:\ %m
|
||||
|
||||
if g:erlangHighlightErrors
|
||||
autocmd BufLeave *.erl call s:clear_matches()
|
||||
autocmd BufEnter *.erl call s:clear_matches()
|
||||
autocmd BufWritePost *.erl call HighlightErlangErrors()
|
||||
autocmd CursorHold *.erl call s:show_msg()
|
||||
autocmd CursorMoved *.erl call s:show_msg()
|
||||
endif
|
||||
@@ -3,6 +3,11 @@ if exists("current_compiler")
|
||||
endif
|
||||
let current_compiler = "typescript"
|
||||
|
||||
CompilerSet makeprg=tsc\ $*\ %
|
||||
if !exists("g:typescript_compiler_options")
|
||||
let g:typescript_compiler_options = ""
|
||||
endif
|
||||
|
||||
|
||||
let &l:makeprg='tsc' . g:typescript_compiler_options . ' $* %'
|
||||
|
||||
CompilerSet errorformat=%+A\ %#%f\ %#(%l\\\,%c):\ %m,%C%m
|
||||
|
||||
@@ -144,6 +144,10 @@ endfunction
|
||||
autocmd BufReadPost *.pl,*.pm,*.t call s:DetectPerl6()
|
||||
autocmd BufNew,BufRead *.nqp setf perl6
|
||||
autocmd BufNewFile,BufRead *.proto setfiletype proto
|
||||
au BufNewFile,BufRead *.ps1 set ft=ps1
|
||||
au BufNewFile,BufRead *.psd1 set ft=ps1
|
||||
au BufNewFile,BufRead *.psm1 set ft=ps1
|
||||
au BufNewFile,BufRead *.ps1xml set ft=ps1xml
|
||||
au! BufRead,BufNewFile *.pp setfiletype puppet
|
||||
au! BufRead,BufNewFile Puppetfile setfiletype ruby
|
||||
function! s:setf(filetype) abort
|
||||
@@ -195,8 +199,12 @@ au BufNewFile,BufRead *.swap set filetype=systemd
|
||||
au BufNewFile,BufRead *.target set filetype=systemd
|
||||
au BufNewFile,BufRead *.timer set filetype=systemd
|
||||
au BufRead,BufNewFile *.textile set filetype=textile
|
||||
autocmd BufNewFile,BufRead .tmux.conf*,tmux.conf* setf tmux
|
||||
au BufNewFile,BufRead *.thrift setlocal filetype=thrift
|
||||
autocmd BufNewFile,BufRead {.,}tmux.conf{.*,} setlocal filetype=tmux
|
||||
autocmd BufNewFile,BufRead *.toml set filetype=toml
|
||||
autocmd BufNewFile,BufRead *.twig set filetype=twig
|
||||
autocmd BufNewFile,BufRead *.html.twig set filetype=html.twig
|
||||
autocmd BufNewFile,BufRead *.ts setlocal filetype=typescript
|
||||
autocmd BufRead *.vala,*.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
|
||||
au BufRead,BufNewFile *.vala,*.vapi setfiletype vala
|
||||
au BufRead,BufNewFile *.vm set ft=velocity syntax=velocity
|
||||
|
||||
@@ -11,6 +11,20 @@
|
||||
" though, implementation differs.
|
||||
|
||||
" Plugin folklore "{{{2
|
||||
fu! <sid>DetermineSID()
|
||||
let s:SID = matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_DetermineSID$')
|
||||
endfu
|
||||
call s:DetermineSID()
|
||||
delf s:DetermineSID
|
||||
|
||||
fu! CSVArrangeCol(first, last, bang, limit) range "{{{2
|
||||
if &ft =~? 'csv'
|
||||
call <sid>ArrangeCol(a:first, a:last, a:bang, a:limit)
|
||||
else
|
||||
finish
|
||||
endif
|
||||
endfu
|
||||
|
||||
if v:version < 700 || exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
@@ -20,7 +34,6 @@ let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Function definitions: "{{{2
|
||||
"
|
||||
" Script specific functions "{{{2
|
||||
fu! <sid>Warn(mess) "{{{3
|
||||
echohl WarningMsg
|
||||
@@ -239,35 +252,6 @@ fu! <sid>DoAutoCommands() "{{{3
|
||||
let b:undo_ftplugin .= '| exe "sil! au! CSV_HI CursorMoved <buffer> "'
|
||||
let b:undo_ftplugin .= '| exe "sil! aug! CSV_HI" |exe "sil! HiColumn!"'
|
||||
|
||||
" Visually arrange columns when opening a csv file
|
||||
if exists("g:csv_autocmd_arrange") &&
|
||||
\ !exists("#CSV_Edit#BufReadPost")
|
||||
aug CSV_Edit
|
||||
au!
|
||||
au BufReadPost,BufWritePost *.csv,*.dat :sil %ArrangeColumn
|
||||
au BufWritePre *.csv,*.dat :sil %UnArrangeColumn
|
||||
aug end
|
||||
elseif exists("#CSV_Edit#BufReadPost")
|
||||
aug CSV_Edit
|
||||
au!
|
||||
aug end
|
||||
aug! CSV_Edit
|
||||
endif
|
||||
" undo autocommand:
|
||||
let b:undo_ftplugin .= '| exe "sil! au! CSV_Edit "'
|
||||
let b:undo_ftplugin .= '| exe "sil! aug! CSV_Edit"'
|
||||
|
||||
" if !exists("#CSV_ColorScheme#ColorScheme")
|
||||
" " Make sure, syntax highlighting is applied
|
||||
" " after changing the colorscheme
|
||||
" augroup CSV_ColorScheme
|
||||
" au!
|
||||
" au ColorScheme *.csv,*.dat,*.tsv,*.tab do Syntax
|
||||
" augroup end
|
||||
" endif
|
||||
" let b:undo_ftplugin .= '| exe "sil! au! CSV_ColorScheme "'
|
||||
" let b:undo_ftplugin .= '| exe "sil! aug! CSV_ColorScheme"'
|
||||
|
||||
if has("gui_running") && !exists("#CSV_Menu#FileType")
|
||||
augroup CSV_Menu
|
||||
au!
|
||||
@@ -276,10 +260,6 @@ fu! <sid>DoAutoCommands() "{{{3
|
||||
au BufLeave <buffer> call <sid>Menu(0) " disable
|
||||
au BufNewFile,BufNew * call <sid>Menu(0)
|
||||
augroup END
|
||||
"let b:undo_ftplugin .= '| sil! amenu disable CSV'
|
||||
"
|
||||
" b:undo_ftplugin does not support calling <sid> Functions
|
||||
"let b:undo_ftplugin .= '| sil! call <sid>Menu(0)'
|
||||
endif
|
||||
endfu
|
||||
|
||||
@@ -348,11 +328,6 @@ fu! <sid>SearchColumn(arg) "{{{3
|
||||
throw "E684"
|
||||
endif
|
||||
endif
|
||||
" let colnr=arglist[0]
|
||||
" let pat=substitute(arglist[1], '^\(.\)\(.*\)\1$', '\2', '')
|
||||
" if pat == arglist[1]
|
||||
" throw "E684"
|
||||
" endif
|
||||
endif
|
||||
"catch /^Vim\%((\a\+)\)\=:E684/
|
||||
catch /E684/ " catch error index out of bounds
|
||||
@@ -364,7 +339,7 @@ fu! <sid>SearchColumn(arg) "{{{3
|
||||
call <SID>Warn("There exists no column " . colnr)
|
||||
return 1
|
||||
endif
|
||||
let @/ = <sid>GetPat(colnr, maxcolnr, pat)
|
||||
let @/ = <sid>GetPat(colnr, maxcolnr, '\%('.pat. '\)')
|
||||
try
|
||||
norm! n
|
||||
catch /^Vim\%((\a\+)\)\=:E486/
|
||||
@@ -643,7 +618,7 @@ fu! <sid>ColWidth(colnr) "{{{3
|
||||
endif
|
||||
endfu
|
||||
|
||||
fu! <sid>ArrangeCol(first, last, bang) range "{{{3
|
||||
fu! <sid>ArrangeCol(first, last, bang, limit) range "{{{3
|
||||
"TODO: Why doesn't that work?
|
||||
" is this because of the range flag?
|
||||
" It's because of the way, Vim works with
|
||||
@@ -655,11 +630,16 @@ fu! <sid>ArrangeCol(first, last, bang) range "{{{3
|
||||
return
|
||||
endif
|
||||
let cur=winsaveview()
|
||||
if a:bang || !exists("b:col_width")
|
||||
if a:bang
|
||||
if a:bang
|
||||
" Force recalculating the Column width
|
||||
unlet! b:csv_list
|
||||
unlet! b:csv_list b:col_width
|
||||
endif
|
||||
elseif a:limit > -1 && a:limit < getfsize(fnamemodify(bufname(''), ':p'))
|
||||
return
|
||||
endif
|
||||
|
||||
if !exists("b:col_width")
|
||||
" Force recalculation of Column width
|
||||
call <sid>CalculateColumnWidth()
|
||||
endif
|
||||
@@ -895,7 +875,7 @@ fu! <sid>SplitHeaderLine(lines, bang, hor) "{{{3
|
||||
syn clear
|
||||
noa 0
|
||||
let b:csv_SplitWindow = winnr()
|
||||
sil :call <sid>ArrangeCol(1,line('$'), 1)
|
||||
sil :call <sid>ArrangeCol(1,line('$'), 1, -1)
|
||||
exe "vert res" . len(split(getline(1), '\zs'))
|
||||
call matchadd("CSVHeaderLine", b:col)
|
||||
setl scrollopt=ver winfixwidth
|
||||
@@ -1592,12 +1572,6 @@ fu! <sid>DisableFolding() "{{{3
|
||||
endif
|
||||
endfu
|
||||
|
||||
fu! <sid>DetermineSID()
|
||||
let s:SID = matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_DetermineSID$')
|
||||
endfu
|
||||
call s:DetermineSID()
|
||||
delf s:DetermineSID
|
||||
|
||||
fu! <sid>NumberFormat() "{{{3
|
||||
let s:nr_format = [',', '.']
|
||||
if exists("b:csv_thousands_sep")
|
||||
@@ -1635,7 +1609,7 @@ fu! <sid>AnalyzeColumn(...) "{{{3
|
||||
let qty = len(data)
|
||||
let res = {}
|
||||
for item in data
|
||||
if empty(item)
|
||||
if empty(item) || item ==# b:delimiter
|
||||
let item = 'NULL'
|
||||
endif
|
||||
if !get(res, item)
|
||||
@@ -1892,7 +1866,7 @@ fu! <sid>CommandDefinitions() "{{{3
|
||||
call <sid>LocalCmd("DeleteColumn", ':call <sid>DeleteColumn(<q-args>)',
|
||||
\ '-nargs=? -complete=custom,<sid>SortComplete')
|
||||
call <sid>LocalCmd("ArrangeColumn",
|
||||
\ ':call <sid>ArrangeCol(<line1>, <line2>, <bang>0)',
|
||||
\ ':call <sid>ArrangeCol(<line1>, <line2>, <bang>0, -1)',
|
||||
\ '-range -bang')
|
||||
call <sid>LocalCmd("UnArrangeColumn",
|
||||
\':call <sid>PrepUnArrangeCol(<line1>, <line2>)',
|
||||
@@ -2248,7 +2222,7 @@ fu! <sid>Tabularize(bang, first, last) "{{{3
|
||||
else
|
||||
" don't clear column width variable, might have been set in the
|
||||
" plugin!
|
||||
sil call <sid>ArrangeCol(a:first, a:last, 0)
|
||||
sil call <sid>ArrangeCol(a:first, a:last, 0, -1)
|
||||
endif
|
||||
|
||||
if empty(b:col_width)
|
||||
|
||||
@@ -1,154 +0,0 @@
|
||||
" Vim ftplugin file
|
||||
" Language: Erlang
|
||||
" Maintainer: Oscar Hellström <oscar@oscarh.net>
|
||||
" URL: http://personal.oscarh.net
|
||||
" Contributor: Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
||||
" Version: 2010-09-03
|
||||
" ------------------------------------------------------------------------------
|
||||
" Usage:
|
||||
"
|
||||
" To enable folding put in your vimrc:
|
||||
" set foldenable
|
||||
"
|
||||
" Folding will make only one fold for a complete function, even though it has
|
||||
" more than one function head and body.
|
||||
"
|
||||
" To change this behaviour put in your vimrc file:
|
||||
" let g:erlangFoldSplitFunction=1
|
||||
"
|
||||
" ------------------------------------------------------------------------------
|
||||
" Plugin init
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Don't load any other
|
||||
let b:did_ftplugin=1
|
||||
|
||||
if exists('s:doneFunctionDefinitions')
|
||||
call s:SetErlangOptions()
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:doneFunctionDefinitions=1
|
||||
|
||||
" Local settings
|
||||
function s:SetErlangOptions()
|
||||
compiler erlang
|
||||
if version >= 700
|
||||
setlocal omnifunc=erlangcomplete#Complete
|
||||
endif
|
||||
|
||||
setlocal comments=:%%%,:%%,:%
|
||||
setlocal commentstring=%%s
|
||||
|
||||
setlocal foldmethod=expr
|
||||
setlocal foldexpr=GetErlangFold(v:lnum)
|
||||
setlocal foldtext=ErlangFoldText()
|
||||
endfunction
|
||||
|
||||
" Define folding functions
|
||||
if !exists("*GetErlangFold")
|
||||
" Folding params
|
||||
let s:ErlangFunBegin = '^\a\w*(.*$'
|
||||
let s:ErlangFunEnd = '^[^%]*\.\s*\(%.*\)\?$'
|
||||
let s:ErlangBlankLine = '^\s*\(%.*\)\?$'
|
||||
|
||||
" Auxiliary fold functions
|
||||
function s:GetNextNonBlank(lnum)
|
||||
let lnum = nextnonblank(a:lnum + 1)
|
||||
let line = getline(lnum)
|
||||
while line =~ s:ErlangBlankLine && 0 != lnum
|
||||
let lnum = nextnonblank(lnum + 1)
|
||||
let line = getline(lnum)
|
||||
endwhile
|
||||
return lnum
|
||||
endfunction
|
||||
|
||||
function s:GetFunName(str)
|
||||
return matchstr(a:str, '^\a\w*(\@=')
|
||||
endfunction
|
||||
|
||||
function s:GetFunArgs(str, lnum)
|
||||
let str = a:str
|
||||
let lnum = a:lnum
|
||||
while str !~ '->\s*\(%.*\)\?$'
|
||||
let lnum = s:GetNextNonBlank(lnum)
|
||||
if 0 == lnum " EOF
|
||||
return ""
|
||||
endif
|
||||
let str .= getline(lnum)
|
||||
endwhile
|
||||
return matchstr(str,
|
||||
\ '\(^(\s*\)\@<=.*\(\s*)\(\s\+when\s\+.*\)\?\s\+->\s*\(%.*\)\?$\)\@=')
|
||||
endfunction
|
||||
|
||||
function s:CountFunArgs(arguments)
|
||||
let pos = 0
|
||||
let ac = 0 " arg count
|
||||
let arguments = a:arguments
|
||||
|
||||
" Change list / tuples into just one A(rgument)
|
||||
let erlangTuple = '{\([A-Za-z_,|=\-\[\]]\|\s\)*}'
|
||||
let erlangList = '\[\([A-Za-z_,|=\-{}]\|\s\)*\]'
|
||||
|
||||
" FIXME: Use searchpair?
|
||||
while arguments =~ erlangTuple
|
||||
let arguments = substitute(arguments, erlangTuple, "A", "g")
|
||||
endwhile
|
||||
" FIXME: Use searchpair?
|
||||
while arguments =~ erlangList
|
||||
let arguments = substitute(arguments, erlangList, "A", "g")
|
||||
endwhile
|
||||
|
||||
let len = strlen(arguments)
|
||||
while pos < len && pos > -1
|
||||
let ac += 1
|
||||
let pos = matchend(arguments, ',\s*', pos)
|
||||
endwhile
|
||||
return ac
|
||||
endfunction
|
||||
|
||||
" Main fold function
|
||||
function GetErlangFold(lnum)
|
||||
let lnum = a:lnum
|
||||
let line = getline(lnum)
|
||||
|
||||
if line =~ s:ErlangFunEnd
|
||||
return '<1'
|
||||
endif
|
||||
|
||||
if line =~ s:ErlangFunBegin && foldlevel(lnum - 1) == 1
|
||||
if exists("g:erlangFoldSplitFunction") && g:erlangFoldSplitFunction
|
||||
return '>1'
|
||||
else
|
||||
return '1'
|
||||
endif
|
||||
endif
|
||||
|
||||
if line =~ s:ErlangFunBegin
|
||||
return '>1'
|
||||
endif
|
||||
|
||||
return '='
|
||||
endfunction
|
||||
|
||||
" Erlang fold description (foldtext function)
|
||||
function ErlangFoldText()
|
||||
let foldlen = v:foldend - v:foldstart
|
||||
if 1 < foldlen
|
||||
let lines = "lines"
|
||||
else
|
||||
let lines = "line"
|
||||
endif
|
||||
let line = getline(v:foldstart)
|
||||
let name = s:GetFunName(line)
|
||||
let arguments = s:GetFunArgs(strpart(line, strlen(name)), v:foldstart)
|
||||
let argcount = s:CountFunArgs(arguments)
|
||||
let retval = "+" . v:folddashes . " " . name . "/" . argcount
|
||||
let retval .= " (" . foldlen . " " . lines . ")"
|
||||
return retval
|
||||
endfunction
|
||||
endif
|
||||
|
||||
call s:SetErlangOptions()
|
||||
@@ -1,295 +0,0 @@
|
||||
" Erlang refactor file
|
||||
" Language: Erlang
|
||||
" Maintainer: Pawel 'kTT' Salata <rockplayer.pl@gmail.com>
|
||||
" URL: http://ktototaki.info
|
||||
|
||||
if exists("b:did_ftplugin_erlang")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Don't load any other
|
||||
let b:did_ftplugin_erlang=1
|
||||
|
||||
if !exists('g:erlangRefactoring') || g:erlangRefactoring == 0
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists('g:erlangWranglerPath')
|
||||
let g:erlangWranglerPath = '/usr/share/wrangler/'
|
||||
endif
|
||||
|
||||
if glob(g:erlangWranglerPath) == ""
|
||||
call confirm("Wrong path to wrangler dir")
|
||||
finish
|
||||
endif
|
||||
|
||||
autocmd VimLeavePre * call StopWranglerServer()
|
||||
|
||||
let s:erlangServerName = "wrangler_vim"
|
||||
|
||||
" Starting background erlang session with wrangler on
|
||||
function! StartWranglerServer()
|
||||
let wranglerEbinDir = g:erlangWranglerPath . "/ebin"
|
||||
let command = "erl_call -s -sname " . s:erlangServerName . " -x 'erl -pa " . wranglerEbinDir . "'"
|
||||
call system(command)
|
||||
call s:send_rpc('application', 'start', '[wrangler_app]')
|
||||
endfunction
|
||||
|
||||
" Stopping erlang session
|
||||
function! StopWranglerServer()
|
||||
echo s:send_rpc('erlang', 'halt', '')
|
||||
endfunction
|
||||
|
||||
" Sending rpc call to erlang session
|
||||
function! s:send_rpc(module, fun, args)
|
||||
let command = "erl_call -sname " . s:erlangServerName . " -a '" . a:module . " " . a:fun . " " . a:args . "'"
|
||||
let result = system(command)
|
||||
if match(result, 'erl_call: failed to connect to node .*') != -1
|
||||
call StartWranglerServer()
|
||||
return system(command)
|
||||
endif
|
||||
return result
|
||||
endfunction
|
||||
|
||||
function! ErlangUndo()
|
||||
echo s:send_rpc("wrangler_undo_server", "undo", "[]")
|
||||
:e!
|
||||
endfunction
|
||||
|
||||
function! s:trim(text)
|
||||
return substitute(a:text, "^\\s\\+\\|\\s\\+$", "", "g")
|
||||
endfunction
|
||||
|
||||
function! s:get_msg(result, tuple_start)
|
||||
let msg_begin = '{' . a:tuple_start . ','
|
||||
let matching_start = match(a:result, msg_begin)
|
||||
if matching_start != -1
|
||||
return s:trim(matchstr(a:result, '[^}]*', matching_start + strlen(msg_begin)))
|
||||
endif
|
||||
return ""
|
||||
endfunction
|
||||
|
||||
" Check if there is an error in result
|
||||
function! s:check_for_error(result)
|
||||
let msg = s:get_msg(a:result, 'ok')
|
||||
if msg != ""
|
||||
return [0, msg]
|
||||
endif
|
||||
let msg = s:get_msg(a:result, 'warning')
|
||||
if msg != ""
|
||||
return [1, msg]
|
||||
endif
|
||||
let msg = s:get_msg(a:result, 'error')
|
||||
if msg != ""
|
||||
return [2, msg]
|
||||
endif
|
||||
return [-1, ""]
|
||||
endfunction
|
||||
|
||||
" Sending apply changes to file
|
||||
function! s:send_confirm()
|
||||
let choice = confirm("What do you want?", "&Preview\n&Confirm\nCa&ncel", 0)
|
||||
if choice == 1
|
||||
echo "TODO: Display preview :)"
|
||||
elseif choice == 2
|
||||
let module = 'wrangler_preview_server'
|
||||
let fun = 'commit'
|
||||
let args = '[]'
|
||||
return s:send_rpc(module, fun, args)
|
||||
else
|
||||
let module = 'wrangler_preview_server'
|
||||
let fun = 'abort'
|
||||
let args = '[]'
|
||||
return s:send_rpc(module, fun, args)
|
||||
echo "Canceled"
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Manually send confirm, for testing purpose only
|
||||
function! SendConfirm()
|
||||
echo s:send_confirm()
|
||||
endfunction
|
||||
|
||||
" Format and send function extracton call
|
||||
function! s:call_extract(start_line, start_col, end_line, end_col, name)
|
||||
let file = expand("%:p")
|
||||
let module = 'wrangler'
|
||||
let fun = 'fun_extraction'
|
||||
let args = '["' . file . '", {' . a:start_line . ', ' . a:start_col . '}, {' . a:end_line . ', ' . a:end_col . '}, "' . a:name . '", ' . &sw . ']'
|
||||
let result = s:send_rpc(module, fun, args)
|
||||
let [error_code, msg] = s:check_for_error(result)
|
||||
if error_code != 0
|
||||
call confirm(msg)
|
||||
return 0
|
||||
endif
|
||||
echo "This files will be changed: " . matchstr(msg, "[^]]*", 1)
|
||||
echo s:send_confirm()
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
function! ErlangExtractFunction(mode) range
|
||||
silent w!
|
||||
let name = inputdialog("New function name: ")
|
||||
if name != ""
|
||||
if a:mode == "v"
|
||||
let start_pos = getpos("'<")
|
||||
let start_line = start_pos[1]
|
||||
let start_col = start_pos[2]
|
||||
|
||||
let end_pos = getpos("'>")
|
||||
let end_line = end_pos[1]
|
||||
let end_col = end_pos[2]
|
||||
elseif a:mode == "n"
|
||||
let pos = getpos(".")
|
||||
let start_line = pos[1]
|
||||
let start_col = pos[2]
|
||||
let end_line = pos[1]
|
||||
let end_col = pos[2]
|
||||
else
|
||||
echo "Mode not supported."
|
||||
return
|
||||
endif
|
||||
if s:call_extract(start_line, start_col, end_line, end_col, name)
|
||||
let temp = &autoread
|
||||
set autoread
|
||||
:e
|
||||
if temp == 0
|
||||
set noautoread
|
||||
endif
|
||||
endif
|
||||
else
|
||||
echo "Empty function name. Ignoring."
|
||||
endif
|
||||
endfunction
|
||||
nmap <A-r>e :call ErlangExtractFunction("n")<ENTER>
|
||||
vmap <A-r>e :call ErlangExtractFunction("v")<ENTER>
|
||||
|
||||
function! s:call_rename(mode, line, col, name, search_path)
|
||||
let file = expand("%:p")
|
||||
let module = 'wrangler'
|
||||
let fun = 'rename_' . a:mode
|
||||
let args = '["' . file .'", '
|
||||
if a:mode != "mod"
|
||||
let args = args . a:line . ', ' . a:col . ', '
|
||||
endif
|
||||
let args = args . '"' . a:name . '", ["' . a:search_path . '"], ' . &sw . ']'
|
||||
let result = s:send_rpc(module, fun, args)
|
||||
let [error_code, msg] = s:check_for_error(result)
|
||||
if error_code != 0
|
||||
call confirm(msg)
|
||||
return 0
|
||||
endif
|
||||
echo "This files will be changed: " . matchstr(msg, "[^]]*", 1)
|
||||
echo s:send_confirm()
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
function! ErlangRename(mode)
|
||||
silent w!
|
||||
if a:mode == "mod"
|
||||
let name = inputdialog('Rename module to: ')
|
||||
else
|
||||
let name = inputdialog('Rename "' . expand("<cword>") . '" to: ')
|
||||
endif
|
||||
if name != ""
|
||||
let search_path = expand("%:p:h")
|
||||
"let search_path = inputdialog('Search path: ', expand("%:p:h"))
|
||||
let pos = getpos(".")
|
||||
let line = pos[1]
|
||||
let col = pos[2]
|
||||
let current_filename = expand("%")
|
||||
let current_filepath = expand("%:p")
|
||||
let new_filename = name . '.erl'
|
||||
if s:call_rename(a:mode, line, col, name, search_path)
|
||||
if a:mode == "mod"
|
||||
execute ':bd ' . current_filename
|
||||
execute ':e ' . new_filename
|
||||
silent execute '!mv ' . current_filepath . ' ' . current_filepath . '.bak'
|
||||
redraw!
|
||||
else
|
||||
let temp = &autoread
|
||||
set autoread
|
||||
:e
|
||||
if temp == 0
|
||||
set noautoread
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
else
|
||||
echo "Empty name. Ignoring."
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ErlangRenameFunction()
|
||||
call ErlangRename("fun")
|
||||
endfunction
|
||||
map <A-r>f :call ErlangRenameFunction()<ENTER>
|
||||
|
||||
function! ErlangRenameVariable()
|
||||
call ErlangRename("var")
|
||||
endfunction
|
||||
map <A-r>v :call ErlangRenameVariable()<ENTER>
|
||||
|
||||
function! ErlangRenameModule()
|
||||
call ErlangRename("mod")
|
||||
endfunction
|
||||
map <A-r>m :call ErlangRenameModule()<ENTER>
|
||||
|
||||
function! ErlangRenameProcess()
|
||||
call ErlangRename("process")
|
||||
endfunction
|
||||
map <A-r>p :call ErlangRenameProcess()<ENTER>
|
||||
|
||||
function! s:call_tuple_fun_args(start_line, start_col, end_line, end_col, search_path)
|
||||
let file = expand("%:p")
|
||||
let module = 'wrangler'
|
||||
let fun = 'tuple_funpar'
|
||||
let args = '["' . file . '", {' . a:start_line . ', ' . a:start_col . '}, {' . a:end_line . ', ' . a:end_col . '}, ["' . a:search_path . '"], ' . &sw . ']'
|
||||
let result = s:send_rpc(module, fun, args)
|
||||
if s:check_for_error(result)
|
||||
return 0
|
||||
endif
|
||||
call s:send_confirm()
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
function! ErlangTupleFunArgs(mode)
|
||||
silent w!
|
||||
let search_path = expand("%:p:h")
|
||||
"let search_path = inputdialog('Search path: ', expand("%:p:h"))
|
||||
if a:mode == "v"
|
||||
let start_pos = getpos("'<")
|
||||
let start_line = start_pos[1]
|
||||
let start_col = start_pos[2]
|
||||
|
||||
let end_pos = getpos("'>")
|
||||
let end_line = end_pos[1]
|
||||
let end_col = end_pos[2]
|
||||
if s:call_tuple_fun_args(start_line, start_col, end_line, end_col, search_path)
|
||||
let temp = &autoread
|
||||
set autoread
|
||||
:e
|
||||
if temp == 0
|
||||
set noautoread
|
||||
endif
|
||||
endif
|
||||
elseif a:mode == "n"
|
||||
let pos = getpos(".")
|
||||
let line = pos[1]
|
||||
let col = pos[2]
|
||||
if s:call_tuple_fun_args(line, col, line, col, search_path)
|
||||
let temp = &autoread
|
||||
set autoread
|
||||
:e
|
||||
if temp == 0
|
||||
set noautoread
|
||||
endif
|
||||
endif
|
||||
else
|
||||
echo "Mode not supported."
|
||||
endif
|
||||
endfunction
|
||||
nmap <A-r>t :call ErlangTupleFunArgs("n")<ENTER>
|
||||
vmap <A-r>t :call ErlangTupleFunArgs("v")<ENTER>
|
||||
|
||||
" vim: set foldmethod=marker:
|
||||
@@ -27,7 +27,7 @@ elseif !exists("b:eruby_subtype")
|
||||
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
|
||||
let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+')
|
||||
if b:eruby_subtype == ''
|
||||
let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+$')
|
||||
let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+\%(\ze+\w\+\)\=$')
|
||||
endif
|
||||
if b:eruby_subtype == 'rhtml'
|
||||
let b:eruby_subtype = 'html'
|
||||
|
||||
34
ftplugin/ps1.vim
Normal file
34
ftplugin/ps1.vim
Normal file
@@ -0,0 +1,34 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Windows PowerShell
|
||||
" Maintainer: Peter Provost <peter@provost.org>
|
||||
" Version: 2.10
|
||||
" Project Repository: https://github.com/PProvost/vim-ps1
|
||||
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
" Don't load another plug-in for this buffer
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal tw=0
|
||||
setlocal commentstring=#%s
|
||||
setlocal formatoptions=tcqro
|
||||
" Enable autocompletion of hyphenated PowerShell commands,
|
||||
" e.g. Get-Content or Get-ADUser
|
||||
setlocal iskeyword+=-
|
||||
|
||||
" Change the browse dialog on Win32 to show mainly PowerShell-related files
|
||||
if has("gui_win32")
|
||||
let b:browsefilter =
|
||||
\ "All PowerShell Files (*.ps1, *.psd1, *.psm1, *.ps1xml)\t*.ps1;*.psd1;*.psm1;*.ps1xml\n" .
|
||||
\ "PowerShell Script Files (*.ps1)\t*.ps1\n" .
|
||||
\ "PowerShell Module Files (*.psd1, *.psm1)\t*.psd1;*.psm1\n" .
|
||||
\ "PowerShell XML Files (*.ps1xml)\t*.ps1xml\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
" Undo the stuff we changed
|
||||
let b:undo_ftplugin = "setlocal tw< cms< fo<" .
|
||||
\ " | unlet! b:browsefilter"
|
||||
|
||||
31
ftplugin/ps1xml.vim
Normal file
31
ftplugin/ps1xml.vim
Normal file
@@ -0,0 +1,31 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Windows PowerShell
|
||||
" Maintainer: Peter Provost <peter@provost.org>
|
||||
" Version: 2.10
|
||||
" Project Repository: https://github.com/PProvost/vim-ps1
|
||||
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
" Don't load another plug-in for this buffer
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal tw=0
|
||||
setlocal commentstring=#%s
|
||||
setlocal formatoptions=tcqro
|
||||
|
||||
" Change the browse dialog on Win32 to show mainly PowerShell-related files
|
||||
if has("gui_win32")
|
||||
let b:browsefilter =
|
||||
\ "All PowerShell Files (*.ps1, *.psd1, *.psm1, *.ps1xml)\t*.ps1;*.psd1;*.psm1;*.ps1xml\n" .
|
||||
\ "PowerShell Script Files (*.ps1)\t*.ps1\n" .
|
||||
\ "PowerShell Module Files (*.psd1, *.psm1)\t*.psd1;*.psm1\n" .
|
||||
\ "PowerShell XML Files (*.ps1xml)\t*.ps1xml\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
" Undo the stuff we changed
|
||||
let b:undo_ftplugin = "setlocal tw< cms< fo<" .
|
||||
\ " | unlet! b:browsefilter"
|
||||
|
||||
@@ -35,9 +35,10 @@ silent! setlocal formatoptions+=j
|
||||
" otherwise it's better than nothing.
|
||||
setlocal smartindent nocindent
|
||||
|
||||
setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
|
||||
|
||||
setlocal textwidth=99
|
||||
if !exists("g:rust_recommended_style") || g:rust_recommended_style == 1
|
||||
setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
|
||||
setlocal textwidth=99
|
||||
endif
|
||||
|
||||
" This includeexpr isn't perfect, but it's a good start
|
||||
setlocal includeexpr=substitute(v:fname,'::','/','g')
|
||||
|
||||
35
ftplugin/toml.vim
Normal file
35
ftplugin/toml.vim
Normal file
@@ -0,0 +1,35 @@
|
||||
" File: ftplugin/toml.vim
|
||||
" Author: Kevin Ballard <kevin@sb.org>
|
||||
" Description: FileType Plugin for Toml
|
||||
" Last Change: Dec 09, 2014
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Add NERDCommenter delimiters
|
||||
|
||||
let s:delims = { 'left': '#' }
|
||||
if exists('g:NERDDelimiterMap')
|
||||
if !has_key(g:NERDDelimiterMap, 'toml')
|
||||
let g:NERDDelimiterMap.toml = s:delims
|
||||
endif
|
||||
elseif exists('g:NERDCustomDelimiters')
|
||||
if !has_key(g:NERDCustomDelimiters, 'toml')
|
||||
let g:NERDCustomDelimiters.toml = s:delims
|
||||
endif
|
||||
else
|
||||
let g:NERDCustomDelimiters = { 'toml': s:delims }
|
||||
endif
|
||||
unlet s:delims
|
||||
|
||||
let b:undo_ftplugin = ""
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sw=4 ts=4:
|
||||
@@ -1,10 +1,2 @@
|
||||
compiler typescript
|
||||
|
||||
setlocal autoindent
|
||||
setlocal smartindent
|
||||
setlocal indentexpr&
|
||||
|
||||
setlocal cindent
|
||||
setlocal cino=j1J1
|
||||
|
||||
setlocal commentstring=//\ %s
|
||||
|
||||
@@ -12,7 +12,6 @@ setlocal nosmartindent
|
||||
|
||||
setlocal indentexpr=GetElixirIndent()
|
||||
setlocal indentkeys+=0=end,0=else,0=match,0=elsif,0=catch,0=after,0=rescue
|
||||
setlocal indentkeys+==->
|
||||
|
||||
if exists("*GetElixirIndent")
|
||||
finish
|
||||
@@ -68,10 +67,17 @@ function! GetElixirIndent()
|
||||
let ind += &sw
|
||||
endif
|
||||
|
||||
" if line starts with pipeline
|
||||
" and last line contains pipeline(s)
|
||||
" align them
|
||||
if last_line =~ '|>.*$' &&
|
||||
\ current_line =~ s:pipeline
|
||||
let ind = float2nr(match(last_line, '|>') / &sw) * &sw
|
||||
|
||||
" if line starts with pipeline
|
||||
" and last line is an attribution
|
||||
" indents pipeline in same level as attribution
|
||||
if current_line =~ s:pipeline &&
|
||||
elseif current_line =~ s:pipeline &&
|
||||
\ last_line =~ '^[^=]\+=.\+$'
|
||||
let b:old_ind = ind
|
||||
let ind = float2nr(matchend(last_line, '=\s*[^ ]') / &sw) * &sw
|
||||
|
||||
1616
indent/erlang.vim
1616
indent/erlang.vim
File diff suppressed because it is too large
Load Diff
@@ -42,6 +42,13 @@ if exists("*GetErubyIndent")
|
||||
endif
|
||||
|
||||
function! GetErubyIndent(...)
|
||||
" The value of a single shift-width
|
||||
if exists('*shiftwidth')
|
||||
let sw = shiftwidth()
|
||||
else
|
||||
let sw = &sw
|
||||
endif
|
||||
|
||||
if a:0 && a:1 == '.'
|
||||
let v:lnum = line('.')
|
||||
elseif a:0 && a:1 =~ '^\d'
|
||||
@@ -70,24 +77,24 @@ function! GetErubyIndent(...)
|
||||
let line = getline(lnum)
|
||||
let cline = getline(v:lnum)
|
||||
if cline =~# '^\s*<%[-=]\=\s*\%(}\|end\|else\|\%(ensure\|rescue\|elsif\|when\).\{-\}\)\s*\%([-=]\=%>\|$\)'
|
||||
let ind = ind - &sw
|
||||
let ind = ind - sw
|
||||
endif
|
||||
if line =~# '\S\s*<%[-=]\=\s*\%(}\|end\).\{-\}\s*\%([-=]\=%>\|$\)'
|
||||
let ind = ind - &sw
|
||||
let ind = ind - sw
|
||||
endif
|
||||
if line =~# '\%({\|\<do\)\%(\s*|[^|]*|\)\=\s*[-=]\=%>'
|
||||
let ind = ind + &sw
|
||||
let ind = ind + sw
|
||||
elseif line =~# '<%[-=]\=\s*\%(module\|class\|def\|if\|for\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\)\>.*%>'
|
||||
let ind = ind + &sw
|
||||
let ind = ind + sw
|
||||
endif
|
||||
if line =~# '^\s*<%[=#-]\=\s*$' && cline !~# '^\s*end\>'
|
||||
let ind = ind + &sw
|
||||
let ind = ind + sw
|
||||
endif
|
||||
if line !~# '^\s*<%' && line =~# '%>\s*$'
|
||||
let ind = ind - &sw
|
||||
let ind = ind - sw
|
||||
endif
|
||||
if cline =~# '^\s*[-=]\=%>\s*$'
|
||||
let ind = ind - &sw
|
||||
let ind = ind - sw
|
||||
endif
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
@@ -127,10 +127,12 @@ call add(s:tags, 'meter')
|
||||
call add(s:tags, 'nav')
|
||||
call add(s:tags, 'output')
|
||||
call add(s:tags, 'progress')
|
||||
call add(s:tags, 'picture')
|
||||
call add(s:tags, 'rp')
|
||||
call add(s:tags, 'rt')
|
||||
call add(s:tags, 'ruby')
|
||||
call add(s:tags, 'section')
|
||||
call add(s:tags, 'source')
|
||||
call add(s:tags, 'summary')
|
||||
call add(s:tags, 'time')
|
||||
call add(s:tags, 'video')
|
||||
|
||||
@@ -15,6 +15,7 @@ setlocal nosmartindent
|
||||
|
||||
" Now, set up our indentation expression and keys that trigger it.
|
||||
setlocal indentexpr=GetJavascriptIndent()
|
||||
setlocal formatexpr=Fixedgq(v:lnum,v:count)
|
||||
setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e
|
||||
|
||||
" Only define the function once.
|
||||
@@ -437,3 +438,58 @@ endfunction
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
function! Fixedgq(lnum, count)
|
||||
let l:tw = &tw ? &tw : 80;
|
||||
|
||||
let l:count = a:count
|
||||
|
||||
if mode() == 'i' " gq was not pressed, but tw was set
|
||||
return 1
|
||||
endif
|
||||
|
||||
if len(getline(a:lnum)) < l:tw && l:count == 1 " No need for gq
|
||||
return 1
|
||||
endif
|
||||
|
||||
" Put all the lines on one line and do normal spliting after that
|
||||
if l:count > 1
|
||||
while l:count > 1
|
||||
let l:count -= 1
|
||||
normal J
|
||||
endwhile
|
||||
endif
|
||||
|
||||
let l:winview = winsaveview()
|
||||
|
||||
call cursor(a:lnum, l:tw + 1)
|
||||
let orig_breakpoint = searchpairpos(' ', '', '\.', 'bcW', '', a:lnum)
|
||||
call cursor(a:lnum, l:tw + 1)
|
||||
let breakpoint = searchpairpos(' ', '', '\.', 'bcW', s:skip_expr, a:lnum)
|
||||
|
||||
" No need for special treatment, normal gq handles edgecases better
|
||||
if breakpoint[1] == orig_breakpoint[1]
|
||||
call winrestview(l:winview)
|
||||
return 1
|
||||
endif
|
||||
|
||||
" Try breaking after string
|
||||
if breakpoint[1] <= indent(a:lnum)
|
||||
call cursor(a:lnum, l:tw + 1)
|
||||
let breakpoint = searchpairpos('\.', '', ' ', 'cW', s:skip_expr, a:lnum)
|
||||
endif
|
||||
|
||||
|
||||
if breakpoint[1] != 0
|
||||
call feedkeys("r\<CR>")
|
||||
else
|
||||
let l:count = l:count - 1
|
||||
endif
|
||||
|
||||
" run gq on new lines
|
||||
if l:count == 1
|
||||
call feedkeys("gqq")
|
||||
endif
|
||||
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
20
indent/ps1.vim
Normal file
20
indent/ps1.vim
Normal file
@@ -0,0 +1,20 @@
|
||||
" Vim indent file
|
||||
" Language: Windows PowerShell
|
||||
" Maintainer: Peter Provost <peter@provost.org>
|
||||
" Version: 2.10
|
||||
" Project Repository: https://github.com/PProvost/vim-ps1
|
||||
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327"
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
" smartindent is good enough for powershell
|
||||
setlocal smartindent
|
||||
" disable the indent removal for # marks
|
||||
inoremap # X#
|
||||
|
||||
let b:undo_indent = "setl si<"
|
||||
|
||||
@@ -369,6 +369,13 @@ function GetRubyIndent(...)
|
||||
" 3.1. Setup {{{2
|
||||
" ----------
|
||||
|
||||
" The value of a single shift-width
|
||||
if exists('*shiftwidth')
|
||||
let sw = shiftwidth()
|
||||
else
|
||||
let sw = &sw
|
||||
endif
|
||||
|
||||
" For the current line, use the first argument if given, else v:lnum
|
||||
let clnum = a:0 ? a:1 : v:lnum
|
||||
|
||||
@@ -388,7 +395,7 @@ function GetRubyIndent(...)
|
||||
if s:Match(clnum, s:access_modifier_regex)
|
||||
let class_line = s:FindContainingClass()
|
||||
if class_line > 0
|
||||
return indent(class_line) + &sw
|
||||
return indent(class_line) + sw
|
||||
endif
|
||||
endif
|
||||
elseif g:ruby_indent_access_modifier_style == 'outdent'
|
||||
@@ -458,7 +465,7 @@ function GetRubyIndent(...)
|
||||
|
||||
" 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
|
||||
return indent(s:GetMSL(clnum)) + sw
|
||||
endif
|
||||
|
||||
" 3.3. Work on the previous line. {{{2
|
||||
@@ -485,23 +492,23 @@ function GetRubyIndent(...)
|
||||
" 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
|
||||
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
|
||||
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
|
||||
return indent(s:GetMSL(lnum)) + sw + sw
|
||||
endif
|
||||
|
||||
" If the previous line ended with a block opening, add a level of indent.
|
||||
if s:Match(lnum, s:block_regex)
|
||||
return indent(s:GetMSL(lnum)) + &sw
|
||||
return indent(s:GetMSL(lnum)) + sw
|
||||
endif
|
||||
|
||||
" If the previous line started with a leading operator, use its MSL's level
|
||||
@@ -512,7 +519,7 @@ function GetRubyIndent(...)
|
||||
|
||||
" If the previous line ended with the "*" of a splat, add a level of indent
|
||||
if line =~ s:splat_regex
|
||||
return indent(lnum) + &sw
|
||||
return indent(lnum) + sw
|
||||
endif
|
||||
|
||||
" If the previous line contained unclosed opening brackets and we are still
|
||||
@@ -527,20 +534,20 @@ function GetRubyIndent(...)
|
||||
if opening.pos != -1
|
||||
if opening.type == '(' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
|
||||
if col('.') + 1 == col('$')
|
||||
return ind + &sw
|
||||
return ind + sw
|
||||
else
|
||||
return virtcol('.')
|
||||
endif
|
||||
else
|
||||
let nonspace = matchend(line, '\S', opening.pos + 1) - 1
|
||||
return nonspace > 0 ? nonspace : ind + &sw
|
||||
return nonspace > 0 ? nonspace : ind + sw
|
||||
endif
|
||||
elseif closing.pos != -1
|
||||
call cursor(lnum, closing.pos + 1)
|
||||
normal! %
|
||||
|
||||
if s:Match(line('.'), s:ruby_indent_keywords)
|
||||
return indent('.') + &sw
|
||||
return indent('.') + sw
|
||||
else
|
||||
return indent('.')
|
||||
endif
|
||||
@@ -569,7 +576,7 @@ function GetRubyIndent(...)
|
||||
let col = s:Match(lnum, s:ruby_indent_keywords)
|
||||
if col > 0
|
||||
call cursor(lnum, col)
|
||||
let ind = virtcol('.') - 1 + &sw
|
||||
let ind = virtcol('.') - 1 + sw
|
||||
" TODO: make this better (we need to count them) (or, if a searchpair
|
||||
" fails, we know that something is lacking an end and thus we indent a
|
||||
" level
|
||||
@@ -606,9 +613,9 @@ function GetRubyIndent(...)
|
||||
" TODO: this does not take into account contrived things such as
|
||||
" module Foo; class Bar; end
|
||||
if s:Match(lnum, s:ruby_indent_keywords)
|
||||
let ind = msl_ind + &sw
|
||||
let ind = msl_ind + sw
|
||||
if s:Match(lnum, s:end_end_regex)
|
||||
let ind = ind - &sw
|
||||
let ind = ind - sw
|
||||
endif
|
||||
return ind
|
||||
endif
|
||||
@@ -617,7 +624,7 @@ function GetRubyIndent(...)
|
||||
" closing bracket, indent one extra level.
|
||||
if s:Match(lnum, s:non_bracket_continuation_regex) && !s:Match(lnum, '^\s*\([\])}]\|end\)')
|
||||
if lnum == p_lnum
|
||||
let ind = msl_ind + &sw
|
||||
let ind = msl_ind + sw
|
||||
else
|
||||
let ind = msl_ind
|
||||
endif
|
||||
|
||||
32
indent/vala.vim
Normal file
32
indent/vala.vim
Normal file
@@ -0,0 +1,32 @@
|
||||
" Copyright (c) 2012 Takezoe Tomoaki <tkztmk@outlook.com>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of
|
||||
" this software and associated documentation files (the "Software"), to deal in
|
||||
" the Software without restriction, including without limitation the rights to
|
||||
" use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
" of
|
||||
" the Software, and to permit persons to whom the Software is furnished to do
|
||||
" so,
|
||||
" subject to the following conditions:
|
||||
"
|
||||
" The above copyright notice and this permission notice shall be included in all
|
||||
" copies or substantial portions of the Software.
|
||||
"
|
||||
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
" FITNESS
|
||||
" FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
" COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
" IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
" Vim indent file for Vala.
|
||||
" It just sets cindent for Vala files...
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
setl cin
|
||||
let b:undo_indent = "setl cin<"
|
||||
|
||||
5
indent/velocity.vim
Normal file
5
indent/velocity.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
|
||||
runtime! indent/html.vim
|
||||
@@ -139,35 +139,6 @@ fu! <sid>DoSyntaxDefinitions() "{{{3
|
||||
hi def link CSVColumnHeaderEven WarningMsg
|
||||
hi def link CSVColumnOdd DiffAdd
|
||||
hi def link CSVColumnEven DiffChange
|
||||
" Old Version
|
||||
if 0
|
||||
if &t_Co < 88
|
||||
if !exists("b:csv_fixed_width_cols")
|
||||
hi default CSVColumnHeaderOdd ctermfg=DarkRed ctermbg=15
|
||||
\ guibg=grey80 guifg=black term=underline cterm=standout,bold
|
||||
\ gui=bold,underline
|
||||
endif
|
||||
hi default CSVColumnOdd ctermfg=DarkRed ctermbg=15 guibg=grey80
|
||||
\ guifg=black term=underline cterm=bold gui=underline
|
||||
else
|
||||
if !exists("b:csv_fixed_width_cols")
|
||||
hi default CSVColumnHeaderOdd ctermfg=darkblue ctermbg=white
|
||||
\ guibg=grey80 guifg=black cterm=standout,underline
|
||||
\ gui=bold,underline
|
||||
endif
|
||||
hi default CSVColumnOdd ctermfg=darkblue ctermbg=white guibg=grey80
|
||||
\ guifg=black cterm=reverse,underline gui=underline
|
||||
endif
|
||||
|
||||
" ctermbg=8 should be safe, even in 8 color terms
|
||||
if !exists("b:csv_fixed_width_cols")
|
||||
hi default CSVColumnHeaderEven ctermfg=white ctermbg=darkgrey
|
||||
\ guibg=grey50 guifg=black term=bold cterm=standout,underline
|
||||
\ gui=bold,underline
|
||||
endif
|
||||
hi default CSVColumnEven ctermfg=white ctermbg=darkgrey guibg=grey50
|
||||
\ guifg=black term=bold cterm=underline gui=bold,underline
|
||||
endif
|
||||
endfun
|
||||
|
||||
" Main: {{{2
|
||||
|
||||
@@ -10,7 +10,7 @@ endif
|
||||
syntax case ignore
|
||||
|
||||
syntax match dockerfileKeyword /\v^\s*(FROM|MAINTAINER|RUN|CMD|EXPOSE|ENV|ADD)\s/
|
||||
syntax match dockerfileKeyword /\v^\s*(ENTRYPOINT|VOLUME|USER|WORKDIR)\s/
|
||||
syntax match dockerfileKeyword /\v^\s*(ENTRYPOINT|VOLUME|USER|WORKDIR|COPY)\s/
|
||||
highlight link dockerfileKeyword Keyword
|
||||
|
||||
syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/
|
||||
|
||||
@@ -22,6 +22,8 @@ syn keyword elixirKeyword quote unquote super
|
||||
|
||||
syn keyword elixirInclude import require alias use
|
||||
|
||||
syn keyword elixirSelf self
|
||||
|
||||
syn match elixirId '\<[_a-zA-Z]\w*[!?]\?\>'
|
||||
|
||||
" This unfortunately also matches function names in function calls
|
||||
@@ -68,7 +70,7 @@ syn region elixirRegex matchgroup=elixirRegexDelimiter start="%r/" end="/[uiomxf
|
||||
syn cluster elixirRegexSpecial contains=elixirRegexEscape,elixirRegexCharClass,elixirRegexQuantifier,elixirRegexEscapePunctuation
|
||||
syn cluster elixirStringContained contains=elixirInterpolation,elixirRegexEscape,elixirRegexCharClass
|
||||
|
||||
syn region elixirString matchgroup=elixirStringDelimiter start="'" end="'" skip="\\'"
|
||||
syn region elixirString matchgroup=elixirStringDelimiter start="'" end="'" skip="\\'|\\\\"
|
||||
syn region elixirString matchgroup=elixirStringDelimiter start='"' end='"' skip='\\"' contains=@elixirStringContained
|
||||
syn region elixirInterpolation matchgroup=elixirInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,elixirComment,@elixirNotTop
|
||||
|
||||
@@ -160,6 +162,7 @@ hi def link elixirPseudoVariable Constant
|
||||
hi def link elixirAlias Type
|
||||
hi def link elixirBoolean Boolean
|
||||
hi def link elixirVariable Identifier
|
||||
hi def link elixirSelf Identifier
|
||||
hi def link elixirUnusedVariable Comment
|
||||
hi def link elixirNumber Number
|
||||
hi def link elixirDocString String
|
||||
|
||||
@@ -1,137 +1,271 @@
|
||||
" Vim syntax file
|
||||
" Language: Erlang
|
||||
" Maintainer: Oscar Hellstr<74>m <oscar@oscarh.net>
|
||||
" URL: http://oscar.hellstrom.st
|
||||
" Version: 2010-08-09
|
||||
" ------------------------------------------------------------------------------
|
||||
" {{{1
|
||||
" Options:
|
||||
"
|
||||
" Erlang BIFs
|
||||
" g:erlangHighlightBif - highlight erlang built in functions (default: off)
|
||||
"
|
||||
" }}}
|
||||
" -----------------------------------------------------------------------------
|
||||
" Language: Erlang (http://www.erlang.org)
|
||||
" Maintainer: Csaba Hoch <csaba.hoch@gmail.com>
|
||||
" Contributor: Adam Rutkowski <hq@mtod.org>
|
||||
" Last Update: 2013-Nov-23
|
||||
" License: Vim license
|
||||
" URL: https://github.com/hcs42/vim-erlang
|
||||
|
||||
" Acknowledgements: This script was originally created by Kresimir Marzic [1].
|
||||
" The script was then revamped by Csaba Hoch [2]. During the revamp, the new
|
||||
" highlighting style and some code was taken from the Erlang syntax script
|
||||
" that is part of vimerl [3], created by Oscar Hellström [4] and improved by
|
||||
" Ricardo Catalinas Jiménez [5].
|
||||
|
||||
" [1]: Kreąimir Marľić (Kresimir Marzic) <kmarzic@fly.srk.fer.hr>
|
||||
" [2]: Csaba Hoch <csaba.hoch@gmail.com>
|
||||
" [3]: https://github.com/jimenezrick/vimerl
|
||||
" [4]: Oscar Hellström <oscar@oscarh.net> (http://oscar.hellstrom.st)
|
||||
" [5]: Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
||||
|
||||
" Customization:
|
||||
"
|
||||
" To use the old highlighting style, add this to your .vimrc:
|
||||
"
|
||||
" let g:erlang_old_style_highlight = 1
|
||||
"
|
||||
" To highlight further module attributes, add them to
|
||||
" ~/.vim/after/syntax/erlang.vim:
|
||||
"
|
||||
" syn keyword erlangAttribute myattr1 myattr2 contained
|
||||
|
||||
" Setup {{{1
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
if version < 600
|
||||
syntax clear
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
finish
|
||||
endif
|
||||
|
||||
" Erlang is case sensitive
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Case sensitive
|
||||
syn case match
|
||||
|
||||
" Match groups {{{1
|
||||
syn match erlangStringModifier /\\./ contained
|
||||
syn match erlangStringModifier /\~\%(-\?[0-9*]\+\)\?\%(\.[0-9*]\+\..\?\)\?\%(c\|f\|e\|g\|s\|w\|p\|W\|P\|B\|X\|#\|b\|+\|n\|i\)/ contained
|
||||
syn match erlangModifier /\$\\\?./
|
||||
|
||||
syn match erlangInteger /\<\%([0-9]\+#[0-9a-fA-F]\+\|[0-9]\+\)\>/
|
||||
syn match erlangFloat /\<[0-9]\+\.[0-9]\+\%(e-\?[0-9]\+\)\?\>/
|
||||
|
||||
syn keyword erlangTodo TODO FIXME XXX contained
|
||||
syn match erlangComment /%.*$/ contains=@Spell,erlangTodo
|
||||
|
||||
syn keyword erlangKeyword band bor bnot bsl bsr bxor div rem xor
|
||||
syn keyword erlangKeyword try catch begin receive after cond fun let query
|
||||
|
||||
syn keyword erlangConditional case if of end
|
||||
syn keyword erlangConditional not and or andalso orelse
|
||||
syn keyword erlangConditional when
|
||||
|
||||
syn keyword erlangBoolean true false
|
||||
|
||||
syn keyword erlangGuard is_list is_alive is_atom is_binary is_bitstring is_boolean is_tuple is_number is_integer is_float is_function is_constant is_pid is_port is_reference is_record is_process_alive
|
||||
|
||||
syn match erlangOperator /\/\|*\|+\|-\|++\|--/
|
||||
syn match erlangOperator /->\|<-\|||\||\|!\|=/
|
||||
syn match erlangOperator /=:=\|==\|\/=\|=\/=\|<\|>\|=<\|>=/
|
||||
syn keyword erlangOperator div rem
|
||||
|
||||
syn region erlangString start=/"/ end=/"/ skip=/\\/ contains=@Spell,erlangStringModifier
|
||||
|
||||
syn match erlangVariable /\<[A-Z_]\w*\>/
|
||||
syn match erlangAtom /\%(\%(^-\)\|#\)\@<!\<[a-z][A-Za-z0-9_]*\>\%(\s*[(:]\)\@!/
|
||||
syn match erlangAtom /\\\@<!'[^']*\\\@<!'/
|
||||
|
||||
syn match erlangRecord /#\w\+/
|
||||
|
||||
syn match erlangTuple /{\|}/
|
||||
syn match erlangList /\[\|\]/
|
||||
|
||||
syn match erlangAttribute /^-\%(vsn\|author\|copyright\|compile\|deprecated\|module\|export\|import\|behaviour\|export_type\|ignore_xref\) *(\@=/
|
||||
syn match erlangInclude /^-include\%(_lib\)\?\s*(\@=/
|
||||
syn match erlangRecordDef /^-record\s*(\@=/
|
||||
syn match erlangDefine /^-\%(define\|undef\)\s*(\@=/
|
||||
syn match erlangPreCondit /^-\%(ifdef\|ifndef\|else\|endif\)\%(\s*(\@=\)\?/
|
||||
|
||||
syn match erlangType /^-\%(spec\|type\)[( ]\@=/
|
||||
|
||||
syn match erlangMacro /\%(-define(\)\@<=\w\+/
|
||||
syn match erlangMacro /?\w\+/
|
||||
|
||||
syn match erlangBitType /\%(\/\|-\)\@<=\%(bits\|bitstring\|binary\|integer\|float\|unit\)\>/
|
||||
syn match erlangBitSize /:\@<=[0-9]\+/
|
||||
|
||||
syn match erlangBinary /<<\|>>/
|
||||
|
||||
" BIFS
|
||||
syn match erlangBIF /\%([^:0-9A-Za-z_]\|\<erlang:\)\@<=\%(abs\|apply\|atom_to_list\|binary_part\|binary_to_list\|binary_to_term\|binary_to_atom\|binary_to_existing_atom\|bitstring_to_list\|check_process_code\|concat_binary\|date\|delete_module\|disconnect_node\|element\|erase\|error\|exit\|float\|float_to_list\|garbage_collect\|get\|get_keys\|group_leader\|halt\|hd\|integer_to_list\|iolist_to_binary\|iolist_size\|length\|link\|list_to_atom\|list_to_binary\|list_to_bitstring\|list_to_existing_atom\|list_to_float\|list_to_integer\|list_to_pid\|list_to_tuple\|load_module\|make_ref\|monitor_node\|node\|nodes\|now\|open_port\|pid_to_list\|port_close\|port_command\|port_connect\|port_control\|pre_loaded\|process_flag\|process_info\|processes\|purge_module\|put\|register\|registered\|round\|self\|setelement\|size\|bit_size\|byte_size\|spawn\|spawn_link\|spawn_opt\|split_binary\|statistics\|term_to_binary\|throw\|time\|tl\|trunc\|tuple_to_list\|unlink\|unregister\|whereis\)\((\|\/[0-9]\)\@=/
|
||||
syn match erlangBIF /\<\%(erlang:\)\@<=\%(append_element\|bump_reductions\|cancel_timer\|decode_packet\|demonitor\|display\|fault\|fun_info\|fun_to_list\|function_exported\|get_cookie\|get_stacktrace\|hash\|hibernate\|info\|is_builtin\|loaded\|localtime\|localtime_to_universaltime\|localtime_to_universaltime\|make_tuple\|md5\|md5_init\|md5_update\|memory\|monitor\|monitor_node\|phash\|phash2\|port_call\|port_info\|port_to_list\|ports\|process_display\|raise\|read_timer\|ref_to_list\|resume_process\|send\|send_after\|send_nosuspend\|set_cookie\|spawn_monitor\|start_timer\|suspend_process\|system_flag\|system_info\|system_monitor\|trace\|trace_delivered\|trace_info\|trace_pattern\|universaltime\|universaltime_to_localtime\|yield\)(\@=/
|
||||
syn match erlangGBIF /erlang\(:\w\)\@=/
|
||||
" }}}
|
||||
|
||||
" Link Erlang stuff to Vim groups {{{1
|
||||
hi link erlangTodo Todo
|
||||
hi link erlangString String
|
||||
hi link erlangNoSpellString String
|
||||
hi link erlangModifier SpecialChar
|
||||
hi link erlangStringModifier SpecialChar
|
||||
hi link erlangComment Comment
|
||||
hi link erlangVariable Identifier
|
||||
hi link erlangInclude Include
|
||||
hi link erlangRecordDef Keyword
|
||||
hi link erlangAttribute Keyword
|
||||
hi link erlangKeyword Keyword
|
||||
hi link erlangMacro Macro
|
||||
hi link erlangDefine Define
|
||||
hi link erlangPreCondit PreCondit
|
||||
hi link erlangPreProc PreProc
|
||||
hi link erlangDelimiter Delimiter
|
||||
hi link erlangBitDelimiter Normal
|
||||
hi link erlangOperator Operator
|
||||
hi link erlangConditional Conditional
|
||||
hi link erlangGuard Conditional
|
||||
hi link erlangBoolean Boolean
|
||||
hi link erlangAtom Constant
|
||||
hi link erlangRecord Structure
|
||||
hi link erlangInteger Number
|
||||
hi link erlangFloat Number
|
||||
hi link erlangFloat Number
|
||||
hi link erlangFloat Number
|
||||
hi link erlangFloat Number
|
||||
hi link erlangHex Number
|
||||
hi link erlangBIF Keyword
|
||||
hi link erlangFun Keyword
|
||||
hi link erlangList Delimiter
|
||||
hi link erlangTuple Delimiter
|
||||
hi link erlangBinary Keyword
|
||||
hi link erlangBitVariable Identifier
|
||||
hi link erlangBitType Type
|
||||
hi link erlangType Type
|
||||
hi link erlangBitSize Number
|
||||
" }}}
|
||||
|
||||
" Optional linkings {{{1
|
||||
if exists("g:erlangHighlightBif") && g:erlangHighlightBif
|
||||
hi link erlangGBIF Keyword
|
||||
if version >= 600
|
||||
setlocal iskeyword+=$,@-@
|
||||
endif
|
||||
|
||||
" Comments
|
||||
syn match erlangComment '%.*$' contains=erlangCommentAnnotation,erlangTodo
|
||||
syn match erlangCommentAnnotation ' \@<=@\%(clear\|docfile\|end\|headerfile\|todo\|TODO\|type\|author\|copyright\|doc\|reference\|see\|since\|title\|version\|deprecated\|hidden\|private\|equiv\|spec\|throws\)' contained
|
||||
syn match erlangCommentAnnotation /`[^']*'/ contained
|
||||
syn keyword erlangTodo TODO FIXME XXX contained
|
||||
|
||||
" Numbers (minimum base is 2, maximum is 36.)
|
||||
syn match erlangNumberInteger '\<\d\+\>'
|
||||
syn match erlangNumberInteger '\<\%([2-9]\|[12]\d\|3[0-6]\)\+#[[:alnum:]]\+\>'
|
||||
syn match erlangNumberFloat '\<\d\+\.\d\+\%([eE][+-]\=\d\+\)\=\>'
|
||||
|
||||
" Strings, atoms, characters
|
||||
syn region erlangString start=/"/ end=/"/ contains=erlangStringModifier
|
||||
syn region erlangQuotedAtom start=/'/ end=/'/ contains=erlangQuotedAtomModifier
|
||||
syn match erlangStringModifier '\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)\|\~\%([ni~]\|\%(-\=\d\+\|\*\)\=\.\=\%(\*\|\d\+\)\=\%(\..\)\=[tl]*[cfegswpWPBX#bx+]\)' contained
|
||||
syn match erlangQuotedAtomModifier '\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)' contained
|
||||
syn match erlangModifier '\$\%([^\\]\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)\)'
|
||||
|
||||
" Operators, separators
|
||||
syn match erlangOperator '==\|=:=\|/=\|=/=\|<\|=<\|>\|>=\|=>\|:=\|++\|--\|=\|!\|<-\|+\|-\|\*\|\/'
|
||||
syn keyword erlangOperator div rem or xor bor bxor bsl bsr and band not bnot andalso orelse
|
||||
syn match erlangBracket '{\|}\|\[\|]\||\|||'
|
||||
syn match erlangPipe '|'
|
||||
syn match erlangRightArrow '->'
|
||||
|
||||
" Atoms, function calls (order is important)
|
||||
syn match erlangAtom '\<\l[[:alnum:]_@]*' contains=erlangBoolean
|
||||
syn keyword erlangBoolean true false contained
|
||||
syn match erlangLocalFuncCall '\<\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*(\)\@=' contains=erlangBIF
|
||||
syn match erlangLocalFuncRef '\<\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*/\)\@='
|
||||
syn match erlangGlobalFuncCall '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\|\n\|%.*\n\)*\)*\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*:\%(\s\|\n\|%.*\n\)*\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*(\)\@=' contains=erlangComment
|
||||
syn match erlangGlobalFuncRef '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\|\n\|%.*\n\)*\)*\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*:\%(\s\|\n\|%.*\n\)*\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*/\)\@=' contains=erlangComment
|
||||
|
||||
" Variables, macros, records, maps
|
||||
syn match erlangVariable '\<[A-Z_][[:alnum:]_@]*'
|
||||
syn match erlangMacro '??\=[[:alnum:]_@]\+'
|
||||
syn match erlangMacro '\%(-define(\)\@<=[[:alnum:]_@]\+'
|
||||
syn match erlangMap '#'
|
||||
syn match erlangRecord '#\s*\l[[:alnum:]_@]*'
|
||||
|
||||
" Shebang (this line has to be after the ErlangMap)
|
||||
syn match erlangShebang '^#!.*'
|
||||
|
||||
" Bitstrings
|
||||
syn match erlangBitType '\%(\/\%(\s\|\n\|%.*\n\)*\)\@<=\%(integer\|float\|binary\|bytes\|bitstring\|bits\|binary\|utf8\|utf16\|utf32\|signed\|unsigned\|big\|little\|native\|unit\)\%(\%(\s\|\n\|%.*\n\)*-\%(\s\|\n\|%.*\n\)*\%(integer\|float\|binary\|bytes\|bitstring\|bits\|binary\|utf8\|utf16\|utf32\|signed\|unsigned\|big\|little\|native\|unit\)\)*' contains=erlangComment
|
||||
|
||||
" Constants and Directives
|
||||
syn match erlangUnknownAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\l[[:alnum:]_@]*' contains=erlangComment
|
||||
syn match erlangAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\%(behaviou\=r\|compile\|export\(_type\)\=\|file\|import\|module\|author\|copyright\|doc\|vsn\|on_load\)\>' contains=erlangComment
|
||||
syn match erlangInclude '^\s*-\%(\s\|\n\|%.*\n\)*\%(include\|include_lib\)\>' contains=erlangComment
|
||||
syn match erlangRecordDef '^\s*-\%(\s\|\n\|%.*\n\)*record\>' contains=erlangComment
|
||||
syn match erlangDefine '^\s*-\%(\s\|\n\|%.*\n\)*\%(define\|undef\)\>' contains=erlangComment
|
||||
syn match erlangPreCondit '^\s*-\%(\s\|\n\|%.*\n\)*\%(ifdef\|ifndef\|else\|endif\)\>' contains=erlangComment
|
||||
syn match erlangType '^\s*-\%(\s\|\n\|%.*\n\)*\%(spec\|type\|opaque\|callback\)\>' contains=erlangComment
|
||||
|
||||
" Keywords
|
||||
syn keyword erlangKeyword after begin case catch cond end fun if let of
|
||||
syn keyword erlangKeyword receive when try
|
||||
|
||||
" Build-in-functions (BIFs)
|
||||
syn keyword erlangBIF abs alive apply atom_to_binary atom_to_list contained
|
||||
syn keyword erlangBIF binary_part binary_to_atom contained
|
||||
syn keyword erlangBIF binary_to_existing_atom binary_to_float contained
|
||||
syn keyword erlangBIF binary_to_integer bitstring_to_list contained
|
||||
syn keyword erlangBIF binary_to_list binary_to_term bit_size contained
|
||||
syn keyword erlangBIF byte_size check_old_code check_process_code contained
|
||||
syn keyword erlangBIF concat_binary date delete_module demonitor contained
|
||||
syn keyword erlangBIF disconnect_node element erase error exit contained
|
||||
syn keyword erlangBIF float float_to_binary float_to_list contained
|
||||
syn keyword erlangBIF garbage_collect get get_keys group_leader contained
|
||||
syn keyword erlangBIF halt hd integer_to_binary integer_to_list contained
|
||||
syn keyword erlangBIF iolist_to_binary iolist_size is_alive contained
|
||||
syn keyword erlangBIF is_atom is_binary is_bitstring is_boolean contained
|
||||
syn keyword erlangBIF is_float is_function is_integer is_list contained
|
||||
syn keyword erlangBIF is_number is_pid is_port is_process_alive contained
|
||||
syn keyword erlangBIF is_record is_reference is_tuple length link contained
|
||||
syn keyword erlangBIF list_to_atom list_to_binary contained
|
||||
syn keyword erlangBIF list_to_bitstring list_to_existing_atom contained
|
||||
syn keyword erlangBIF list_to_float list_to_integer list_to_pid contained
|
||||
syn keyword erlangBIF list_to_tuple load_module make_ref max min contained
|
||||
syn keyword erlangBIF module_loaded monitor monitor_node node contained
|
||||
syn keyword erlangBIF nodes now open_port pid_to_list port_close contained
|
||||
syn keyword erlangBIF port_command port_connect pre_loaded contained
|
||||
syn keyword erlangBIF process_flag process_flag process_info contained
|
||||
syn keyword erlangBIF process purge_module put register registered contained
|
||||
syn keyword erlangBIF round self setelement size spawn spawn_link contained
|
||||
syn keyword erlangBIF spawn_monitor spawn_opt split_binary contained
|
||||
syn keyword erlangBIF statistics term_to_binary throw time tl contained
|
||||
syn keyword erlangBIF trunc tuple_size tuple_to_list unlink contained
|
||||
syn keyword erlangBIF unregister whereis contained
|
||||
|
||||
" Sync at the beginning of functions: if this is not used, multiline string
|
||||
" are not always recognized, and the indentation script cannot use the
|
||||
" "searchpair" (because it would not always skip strings and comments when
|
||||
" looking for keywords and opening parens/brackets).
|
||||
syn sync match erlangSync grouphere NONE "^[a-z]\s*("
|
||||
let b:erlang_syntax_synced = 1
|
||||
|
||||
" Define the default highlighting. See ":help group-name" for the groups and
|
||||
" their colors.
|
||||
|
||||
let s:old_style = (exists("g:erlang_old_style_highlight") &&
|
||||
\g:erlang_old_style_highlight == 1)
|
||||
|
||||
" For version 5.7 and earlier: only when not done already
|
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
||||
if version >= 508 || !exists("did_erlang_inits")
|
||||
if version < 508
|
||||
let did_erlang_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
" Comments
|
||||
HiLink erlangComment Comment
|
||||
HiLink erlangCommentAnnotation Special
|
||||
HiLink erlangTodo Todo
|
||||
HiLink erlangShebang Comment
|
||||
|
||||
" Numbers
|
||||
HiLink erlangNumberInteger Number
|
||||
HiLink erlangNumberFloat Float
|
||||
|
||||
" Strings, atoms, characters
|
||||
HiLink erlangString String
|
||||
|
||||
if s:old_style
|
||||
HiLink erlangQuotedAtom Type
|
||||
else
|
||||
HiLink erlangQuotedAtom String
|
||||
endif
|
||||
|
||||
HiLink erlangStringModifier Special
|
||||
HiLink erlangQuotedAtomModifier Special
|
||||
HiLink erlangModifier Special
|
||||
|
||||
" Operators, separators
|
||||
HiLink erlangOperator Operator
|
||||
HiLink erlangRightArrow Operator
|
||||
if s:old_style
|
||||
HiLink erlangBracket Normal
|
||||
HiLink erlangPipe Normal
|
||||
else
|
||||
HiLink erlangBracket Delimiter
|
||||
HiLink erlangPipe Delimiter
|
||||
endif
|
||||
|
||||
" Atoms, functions, variables, macros
|
||||
if s:old_style
|
||||
HiLink erlangAtom Normal
|
||||
HiLink erlangLocalFuncCall Normal
|
||||
HiLink erlangLocalFuncRef Normal
|
||||
HiLink erlangGlobalFuncCall Function
|
||||
HiLink erlangGlobalFuncRef Function
|
||||
HiLink erlangVariable Normal
|
||||
HiLink erlangMacro Normal
|
||||
HiLink erlangRecord Normal
|
||||
HiLink erlangMap Normal
|
||||
else
|
||||
HiLink erlangAtom String
|
||||
HiLink erlangLocalFuncCall Normal
|
||||
HiLink erlangLocalFuncRef Normal
|
||||
HiLink erlangGlobalFuncCall Normal
|
||||
HiLink erlangGlobalFuncRef Normal
|
||||
HiLink erlangVariable Identifier
|
||||
HiLink erlangMacro Macro
|
||||
HiLink erlangRecord Structure
|
||||
HiLink erlangMap Structure
|
||||
endif
|
||||
|
||||
" Bitstrings
|
||||
if !s:old_style
|
||||
HiLink erlangBitType Type
|
||||
endif
|
||||
|
||||
" Constants and Directives
|
||||
if s:old_style
|
||||
HiLink erlangAttribute Type
|
||||
HiLink erlangMacroDef Type
|
||||
HiLink erlangUnknownAttribute Normal
|
||||
HiLink erlangInclude Type
|
||||
HiLink erlangRecordDef Type
|
||||
HiLink erlangDefine Type
|
||||
HiLink erlangPreCondit Type
|
||||
HiLink erlangType Type
|
||||
else
|
||||
HiLink erlangAttribute Keyword
|
||||
HiLink erlangMacroDef Macro
|
||||
HiLink erlangUnknownAttribute Normal
|
||||
HiLink erlangInclude Include
|
||||
HiLink erlangRecordDef Keyword
|
||||
HiLink erlangDefine Define
|
||||
HiLink erlangPreCondit PreCondit
|
||||
HiLink erlangType Type
|
||||
endif
|
||||
|
||||
" Keywords
|
||||
HiLink erlangKeyword Keyword
|
||||
|
||||
" Build-in-functions (BIFs)
|
||||
HiLink erlangBIF Function
|
||||
|
||||
if s:old_style
|
||||
HiLink erlangBoolean Statement
|
||||
HiLink erlangExtra Statement
|
||||
HiLink erlangSignal Statement
|
||||
else
|
||||
HiLink erlangBoolean Boolean
|
||||
HiLink erlangExtra Statement
|
||||
HiLink erlangSignal Statement
|
||||
endif
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
" }}}
|
||||
|
||||
let b:current_syntax = "erlang"
|
||||
|
||||
" vim: set foldmethod=marker:
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: sw=2 et
|
||||
|
||||
@@ -22,7 +22,7 @@ elseif !exists("b:eruby_subtype") && main_syntax == 'eruby'
|
||||
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
|
||||
let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+')
|
||||
if b:eruby_subtype == ''
|
||||
let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+$')
|
||||
let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+\%(\ze+\w\+\)\=$')
|
||||
endif
|
||||
if b:eruby_subtype == 'rhtml'
|
||||
let b:eruby_subtype = 'html'
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
" let OPTION_NAME = 0
|
||||
" in your ~/.vimrc file to disable particular options. You can also write:
|
||||
" let OPTION_NAME = 1
|
||||
" to enable particular options. At present, all options default to on.
|
||||
" to enable particular options.
|
||||
" At present, all options default to on, except highlight of:
|
||||
" functions, methods and structs.
|
||||
"
|
||||
" - go_highlight_array_whitespace_error
|
||||
" Highlights white space after "[]".
|
||||
@@ -107,10 +109,10 @@ syn match goDeclaration /\<func\>/
|
||||
" Predefined functions and values
|
||||
syn keyword goBuiltins append cap close complex copy delete imag len
|
||||
syn keyword goBuiltins make new panic print println real recover
|
||||
syn keyword goConstants iota true false nil
|
||||
syn keyword goBoolean iota true false nil
|
||||
|
||||
hi def link goBuiltins Keyword
|
||||
hi def link goConstants Keyword
|
||||
hi def link goBoolean Boolean
|
||||
|
||||
" Comments; their contents
|
||||
syn keyword goTodo contained TODO FIXME XXX BUG
|
||||
@@ -141,9 +143,11 @@ hi def link goEscapeError Error
|
||||
syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError
|
||||
syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup
|
||||
syn region goRawString start=+`+ end=+`+
|
||||
syn match goFormatSpecifier /%[#0\-\ \+\*]*[vTtbcdoqxXUeEfgGsp]/ contained containedin=goString
|
||||
|
||||
hi def link goString String
|
||||
hi def link goRawString String
|
||||
hi def link goFormatSpecifier goSpecialString
|
||||
|
||||
" Characters; their contents
|
||||
syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU
|
||||
@@ -199,7 +203,7 @@ endif
|
||||
" Extra types commonly seen
|
||||
if g:go_highlight_extra_types != 0
|
||||
syn match goExtraType /\<bytes\.\(Buffer\)\>/
|
||||
syn match goExtraType /\<io\.\(Reader\|Writer\|ReadWriter\|ReadWriteCloser\)\>/
|
||||
syn match goExtraType /\<io\.\(Reader\|ReadSeeker\|ReadWriter\|ReadCloser\|ReadWriteCloser\|Writer\|WriteCloser\|Seeker\)\>/
|
||||
syn match goExtraType /\<reflect\.\(Kind\|Type\|Value\)\>/
|
||||
syn match goExtraType /\<unsafe\.Pointer\>/
|
||||
endif
|
||||
|
||||
@@ -24,6 +24,7 @@ syn keyword htmlTagName contained header hgroup keygen main mark meter menu nav
|
||||
syn keyword htmlTagName contained progress ruby rt rp section source summary time track video data
|
||||
syn keyword htmlTagName contained template content shadow
|
||||
syn keyword htmlTagName contained wbr bdi
|
||||
syn keyword htmlTagName contained picture
|
||||
|
||||
" SVG tags
|
||||
" http://www.w3.org/TR/SVG/
|
||||
@@ -75,6 +76,8 @@ syn keyword htmlArg contained label icon open datetime pubdate
|
||||
syn keyword htmlArg contained async
|
||||
" <content>
|
||||
syn keyword htmlArg contained select
|
||||
" <picture>
|
||||
syn keyword htmlArg contained srcset sizes
|
||||
|
||||
" Custom Data Attributes
|
||||
" http://dev.w3.org/html5/spec/elements.html#embedding-custom-non-visible-data
|
||||
|
||||
@@ -35,6 +35,7 @@ syntax keyword jsOperator delete instanceof typeof void new in
|
||||
syntax match jsOperator /\(!\||\|&\|+\|-\|<\|>\|=\|%\|\/\|*\|\~\|\^\)/
|
||||
syntax keyword jsBooleanTrue true
|
||||
syntax keyword jsBooleanFalse false
|
||||
syntax keyword jsCommonJS require module exports
|
||||
|
||||
"" JavaScript comments
|
||||
syntax keyword jsCommentTodo TODO FIXME XXX TBD contained
|
||||
@@ -55,15 +56,15 @@ if !exists("javascript_ignore_javaScriptdoc")
|
||||
syntax region jsDocComment matchgroup=jsComment start="/\*\*\s*" end="\*/" contains=jsDocTags,jsCommentTodo,jsCvsTag,@jsHtml,@Spell fold
|
||||
|
||||
" tags containing a param
|
||||
syntax match jsDocTags contained "@\(alias\|augments\|borrows\|class\|constructs\|default\|defaultvalue\|emits\|exception\|exports\|extends\|file\|fires\|kind\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|throws\|var\|variation\|version\)\>" nextgroup=jsDocParam skipwhite
|
||||
syntax match jsDocTags contained "@\(alias\|augments\|borrows\|class\|constructs\|default\|defaultvalue\|emits\|exception\|exports\|extends\|file\|fires\|kind\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|template\|throws\|var\|variation\|version\)\>" nextgroup=jsDocParam skipwhite
|
||||
" tags containing type and param
|
||||
syntax match jsDocTags contained "@\(arg\|argument\|param\|property\)\>" nextgroup=jsDocType skipwhite
|
||||
" tags containing type but no param
|
||||
syntax match jsDocTags contained "@\(callback\|enum\|external\|this\|type\|typedef\|return\|returns\)\>" nextgroup=jsDocTypeNoParam skipwhite
|
||||
syntax match jsDocTags contained "@\(callback\|define\|enum\|external\|implements\|this\|type\|typedef\|return\|returns\)\>" nextgroup=jsDocTypeNoParam skipwhite
|
||||
" tags containing references
|
||||
syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" nextgroup=jsDocSeeTag skipwhite
|
||||
" other tags (no extra syntax)
|
||||
syntax match jsDocTags contained "@\(abstract\|access\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|event\|example\|file[oO]verview\|function\|global\|ignore\|inner\|instance\|license\|method\|mixin\|overview\|private\|protected\|public\|readonly\|since\|static\|todo\|summary\|undocumented\|virtual\)\>"
|
||||
syntax match jsDocTags contained "@\(abstract\|access\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|dict\|event\|example\|file[oO]verview\|final\|function\|global\|ignore\|inheritDoc\|inner\|instance\|interface\|license\|method\|mixin\|nosideeffects\|override\|overview\|preserve\|private\|protected\|public\|readonly\|since\|static\|struct\|todo\|summary\|undocumented\|virtual\)\>"
|
||||
|
||||
syntax region jsDocType start="{" end="}" oneline contained nextgroup=jsDocParam skipwhite
|
||||
syntax match jsDocType contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" nextgroup=jsDocParam skipwhite
|
||||
@@ -81,9 +82,9 @@ syntax case match
|
||||
syntax match jsFuncCall /\k\+\%(\s*(\)\@=/
|
||||
syntax match jsSpecial "\v\\%(0|\\x\x\{2\}\|\\u\x\{4\}\|\c[A-Z]|.)" contained
|
||||
syntax match jsTemplateVar "\${.\{-}}" contained
|
||||
syntax region jsStringD start=+"+ skip=+\\\\\|\\$"+ end=+"+ contains=jsSpecial,@htmlPreproc,@Spell
|
||||
syntax region jsStringS start=+'+ skip=+\\\\\|\\$'+ end=+'+ contains=jsSpecial,@htmlPreproc,@Spell
|
||||
syntax region jsTemplateString start=+`+ skip=+\\\\\|\\$`+ end=+`+ contains=jsTemplateVar,jsSpecial,@htmlPreproc
|
||||
syntax region jsStringD start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@htmlPreproc,@Spell
|
||||
syntax region jsStringS start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@htmlPreproc,@Spell
|
||||
syntax region jsTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`\|$+ contains=jsTemplateVar,jsSpecial,@htmlPreproc
|
||||
syntax region jsRegexpCharClass start=+\[+ skip=+\\.+ end=+\]+ contained
|
||||
syntax match jsRegexpBoundary "\v%(\<@![\^$]|\\[bB])" contained
|
||||
syntax match jsRegexpBackRef "\v\\[1-9][0-9]*" contained
|
||||
@@ -91,7 +92,7 @@ syntax match jsRegexpQuantifier "\v\\@<!%([?*+]|\{\d+%(,|,\d+)?})\??" containe
|
||||
syntax match jsRegexpOr "\v\<@!\|" contained
|
||||
syntax match jsRegexpMod "\v\(@<=\?[:=!>]" contained
|
||||
syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod
|
||||
syntax region jsRegexpGroup start="\\\@<!(" end="\\\@<!)" contained contains=jsRegexpCharClass,@jsRegexpSpecial keepend
|
||||
syntax region jsRegexpGroup start="\\\@<!(" skip="\\.\|\[\(\\.\|[^]]\)*\]" end="\\\@<!)" contained contains=jsRegexpCharClass,@jsRegexpSpecial keepend
|
||||
syntax region jsRegexpString start=+\(\(\(return\|case\)\s\+\)\@<=\|\(\([)\]"']\|\d\|\w\)\s*\)\@<!\)/\(\*\|/\)\@!+ skip=+\\.\|\[\(\\.\|[^]]\)*\]+ end=+/[gimy]\{,4}+ contains=jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial,@htmlPreproc oneline keepend
|
||||
syntax match jsNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/
|
||||
syntax keyword jsNumber Infinity
|
||||
@@ -99,28 +100,19 @@ syntax match jsFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-
|
||||
syntax match jsObjectKey /\<[a-zA-Z_$][0-9a-zA-Z_$]*\(\s*:\)\@=/ contains=jsFunctionKey contained
|
||||
syntax match jsFunctionKey /\<[a-zA-Z_$][0-9a-zA-Z_$]*\(\s*:\s*function\s*\)\@=/ contained
|
||||
|
||||
if g:javascript_conceal == 1
|
||||
syntax keyword jsNull null conceal cchar=ø
|
||||
syntax keyword jsThis this conceal cchar=@
|
||||
syntax keyword jsReturn return conceal cchar=⇚
|
||||
syntax keyword jsUndefined undefined conceal cchar=¿
|
||||
syntax keyword jsNan NaN conceal cchar=ℕ
|
||||
syntax keyword jsPrototype prototype conceal cchar=¶
|
||||
else
|
||||
syntax keyword jsNull null
|
||||
syntax keyword jsThis this
|
||||
syntax keyword jsReturn return
|
||||
syntax keyword jsUndefined undefined
|
||||
syntax keyword jsNan NaN
|
||||
syntax keyword jsPrototype prototype
|
||||
endif
|
||||
exe 'syntax keyword jsNull null '.(exists('g:javascript_conceal_null') ? 'conceal cchar='.g:javascript_conceal_null : '')
|
||||
exe 'syntax keyword jsReturn return '.(exists('g:javascript_conceal_return') ? 'conceal cchar='.g:javascript_conceal_return : '')
|
||||
exe 'syntax keyword jsUndefined undefined '.(exists('g:javascript_conceal_undefined') ? 'conceal cchar='.g:javascript_conceal_undefined : '')
|
||||
exe 'syntax keyword jsNan NaN '.(exists('g:javascript_conceal_NaN') ? 'conceal cchar='.g:javascript_conceal_NaN : '')
|
||||
exe 'syntax keyword jsPrototype prototype '.(exists('g:javascript_conceal_prototype') ? 'conceal cchar='.g:javascript_conceal_prototype : '')
|
||||
exe 'syntax keyword jsThis this '.(exists('g:javascript_conceal_this') ? 'conceal cchar='.g:javascript_conceal_this : '')
|
||||
|
||||
"" Statement Keywords
|
||||
syntax keyword jsStatement break continue with
|
||||
syntax keyword jsConditional if else switch
|
||||
syntax keyword jsRepeat do while for
|
||||
syntax keyword jsLabel case default
|
||||
syntax keyword jsKeyword yield
|
||||
syntax keyword jsKeyword yield import export default extends class
|
||||
syntax keyword jsException try catch throw finally
|
||||
|
||||
syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object RegExp String Proxy ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray Intl JSON Math console document window
|
||||
@@ -130,7 +122,7 @@ syntax keyword jsExceptions Error EvalError InternalError RangeError Referen
|
||||
|
||||
syntax keyword jsBuiltins decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt uneval
|
||||
|
||||
syntax keyword jsFutureKeys abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws goto private transient debugger implements protected volatile double import public
|
||||
syntax keyword jsFutureKeys abstract enum int short boolean interface static byte long super char final native synchronized float package throws goto private transient debugger implements protected volatile double public
|
||||
|
||||
"" DOM/HTML/CSS specified things
|
||||
|
||||
@@ -182,7 +174,7 @@ endif "DOM/HTML/CSS
|
||||
|
||||
|
||||
"" Code blocks
|
||||
syntax cluster jsExpression contains=jsComment,jsLineComment,jsDocComment,jsTemplateString,jsStringD,jsStringS,jsRegexpString,jsNumber,jsFloat,jsThis,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsDotNotation,jsBracket,jsParen,jsBlock,jsFuncCall,jsUndefined,jsNan,jsKeyword,jsStorageClass,jsPrototype,jsBuiltins,jsNoise
|
||||
syntax cluster jsExpression contains=jsComment,jsLineComment,jsDocComment,jsTemplateString,jsStringD,jsStringS,jsRegexpString,jsNumber,jsFloat,jsThis,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsDotNotation,jsBracket,jsParen,jsBlock,jsFuncCall,jsUndefined,jsNan,jsKeyword,jsStorageClass,jsPrototype,jsBuiltins,jsNoise,jsCommonJS
|
||||
syntax cluster jsAll contains=@jsExpression,jsLabel,jsConditional,jsRepeat,jsReturn,jsStatement,jsTernaryIf,jsException
|
||||
syntax region jsBracket matchgroup=jsBrackets start="\[" end="\]" contains=@jsAll,jsParensErrB,jsParensErrC,jsBracket,jsParen,jsBlock,@htmlPreproc fold
|
||||
syntax region jsParen matchgroup=jsParens start="(" end=")" contains=@jsAll,jsParensErrA,jsParensErrC,jsParen,jsBracket,jsBlock,@htmlPreproc fold
|
||||
@@ -202,11 +194,7 @@ if main_syntax == "javascript"
|
||||
syntax sync match jsHighlight grouphere jsBlock /{/
|
||||
endif
|
||||
|
||||
if g:javascript_conceal == 1
|
||||
syntax match jsFunction /\<function\>/ nextgroup=jsFuncName,jsFuncArgs skipwhite conceal cchar=ƒ
|
||||
else
|
||||
syntax match jsFunction /\<function\>/ nextgroup=jsFuncName,jsFuncArgs skipwhite
|
||||
endif
|
||||
exe 'syntax match jsFunction /\<function\>/ nextgroup=jsFuncName,jsFuncArgs skipwhite '.(exists('g:javascript_conceal_function') ? 'conceal cchar='.g:javascript_conceal_function : '')
|
||||
|
||||
syntax match jsFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*/ nextgroup=jsFuncArgs skipwhite
|
||||
syntax region jsFuncArgs contained matchgroup=jsFuncParens start='(' end=')' contains=jsFuncArgCommas,jsFuncArgRest nextgroup=jsFuncBlock keepend skipwhite skipempty
|
||||
@@ -291,6 +279,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
||||
HiLink jsExceptions Special
|
||||
HiLink jsFutureKeys Special
|
||||
HiLink jsBuiltins Special
|
||||
HiLink jsCommonJS Include
|
||||
|
||||
HiLink jsDomErrNo Constant
|
||||
HiLink jsDomNodeConsts Constant
|
||||
|
||||
@@ -50,8 +50,8 @@ syntax match mustacheHandlebars '{{\|}}' contained containedin=mustacheInside,@h
|
||||
syntax match mustacheUnescape '{{{\|}}}' contained containedin=mustacheInside,@htmlMustacheContainer
|
||||
syntax match mustacheConditionals '\([/#]\(if\|unless\)\|else\)' contained containedin=mustacheInside
|
||||
syntax match mustacheHelpers '[/#]\(with\|each\)' contained containedin=mustacheSection
|
||||
syntax region mustacheComment start=/{{!/rs=s+2 end=/}}/re=e-2 contains=Todo contained containedin=mustacheInside,@htmlMustacheContainer
|
||||
syntax region mustacheBlockComment start=/{{!--/rs=s+2 end=/--}}/re=e-2 contains=Todo contained containedin=mustacheInside,@htmlMustacheContainer
|
||||
syntax region mustacheComment start=/{{!/rs=s+2 skip=/{{.\{-}}}/ end=/}}/re=e-2 contains=Todo contained containedin=mustacheInside,@htmlMustacheContainer
|
||||
syntax region mustacheBlockComment start=/{{!--/rs=s+2 skip=/{{.\{-}}}/ end=/--}}/re=e-2 contains=Todo contained extend containedin=mustacheInside,@htmlMustacheContainer
|
||||
syntax region mustacheQString start=/'/ skip=/\\'/ end=/'/ contained containedin=mustacheInside
|
||||
syntax region mustacheDQString start=/"/ skip=/\\"/ end=/"/ contained containedin=mustacheInside
|
||||
|
||||
|
||||
@@ -39,11 +39,6 @@ endif
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if exists('®expengine')
|
||||
let s:regexpengine=®expengine
|
||||
set regexpengine=1
|
||||
endif
|
||||
|
||||
" POD starts with ^=<word> and ends with ^=cut
|
||||
|
||||
if !exists("perl_include_pod") || perl_include_pod == 1
|
||||
@@ -360,15 +355,11 @@ syn keyword perlStatementPackage package contained
|
||||
" sub [name] [(prototype)] {
|
||||
"
|
||||
syn match perlSubError "[^[:space:];{#]" contained
|
||||
if v:version == 701 && !has('patch221') " XXX I hope that's the right one
|
||||
syn match perlSubAttributes ":" contained
|
||||
else
|
||||
syn match perlSubAttributesCont "\h\w*\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained
|
||||
syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*(" end=")\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained contains=@perlInterpSQ,perlParensSQ
|
||||
syn cluster perlSubAttrMaybe contains=perlSubAttributesCont,perlSubError,perlFakeGroup
|
||||
syn match perlSubAttributes "" contained nextgroup=perlSubError
|
||||
syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe
|
||||
endif
|
||||
syn match perlSubAttributesCont "\h\w*\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained
|
||||
syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*(" end=")\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained contains=@perlInterpSQ,perlParensSQ
|
||||
syn cluster perlSubAttrMaybe contains=perlSubAttributesCont,perlSubError,perlFakeGroup
|
||||
syn match perlSubAttributes "" contained nextgroup=perlSubError
|
||||
syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe
|
||||
if !exists("perl_no_subprototype_error") " Set 1 if using signatures feature in perl5.19.9
|
||||
syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained
|
||||
syn match perlSubPrototype +(\_[^)]*)\_s*+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError
|
||||
@@ -583,11 +574,6 @@ syn sync match perlSyncPOD grouphere NONE "^=cut"
|
||||
|
||||
let b:current_syntax = "perl"
|
||||
|
||||
if exists('®expengine')
|
||||
let ®expengine=s:regexpengine
|
||||
unlet s:regexpengine
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
|
||||
@@ -2245,8 +2245,6 @@ endif
|
||||
" know how to use them reliably)
|
||||
syn sync fromstart
|
||||
|
||||
setlocal foldmethod=syntax
|
||||
|
||||
let b:current_syntax = "perl6"
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
|
||||
File diff suppressed because one or more lines are too long
162
syntax/ps1.vim
Normal file
162
syntax/ps1.vim
Normal file
@@ -0,0 +1,162 @@
|
||||
" Vim syntax file
|
||||
" Language: Windows PowerShell
|
||||
" Maintainer: Peter Provost <peter@provost.org>
|
||||
" Version: 2.10
|
||||
" Project Repository: https://github.com/PProvost/vim-ps1
|
||||
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327"
|
||||
"
|
||||
" The following settings are available for tuning syntax highlighting:
|
||||
" let ps1_nofold_blocks = 1
|
||||
" let ps1_nofold_sig = 1
|
||||
|
||||
" Compatible VIM syntax file start
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" PowerShell doesn't care about case
|
||||
syn case ignore
|
||||
|
||||
" Sync-ing method
|
||||
syn sync minlines=100
|
||||
|
||||
" Certain tokens can't appear at the top level of the document
|
||||
syn cluster ps1NotTop contains=@ps1Comment,ps1CDocParam,ps1Function
|
||||
|
||||
" Comments and special comment words
|
||||
syn keyword ps1CommentTodo TODO FIXME XXX TBD HACK NOTE contained
|
||||
syn match ps1CDocParam /.*/ contained
|
||||
syn match ps1CommentDoc /^\s*\zs\.\w\+\>/ nextgroup=ps1CDocParam contained
|
||||
syn match ps1CommentDoc /#\s*\zs\.\w\+\>/ nextgroup=ps1CDocParam contained
|
||||
syn match ps1Comment /#.*/ contains=ps1CommentTodo,ps1CommentDoc,@Spell
|
||||
syn region ps1Comment start="<#" end="#>" contains=ps1CommentTodo,ps1CommentDoc,@Spell
|
||||
|
||||
" Language keywords and elements
|
||||
syn keyword ps1Conditional if else elseif switch default
|
||||
syn keyword ps1Repeat while for do until break continue foreach in
|
||||
syn match ps1Repeat /\<foreach\>/ nextgroup=ps1Block skipwhite
|
||||
syn match ps1Keyword /\<while\>/ nextgroup=ps1Block skipwhite
|
||||
syn match ps1Keyword /\<where\>/ nextgroup=ps1Block skipwhite
|
||||
|
||||
syn keyword ps1Exception begin process end exit
|
||||
syn keyword ps1Keyword try catch finally throw
|
||||
syn keyword ps1Keyword return filter in trap param data dynamicparam
|
||||
syn match ps1Keyword /&/
|
||||
syn keyword ps1Constant $true $false $null
|
||||
syn match ps1Constant +\$?+
|
||||
syn match ps1Constant +\$_+
|
||||
syn match ps1Constant +\$\$+
|
||||
syn match ps1Constant +\$^+
|
||||
|
||||
" Keywords reserved for future use
|
||||
syn keyword ps1Keyword class define from using var
|
||||
|
||||
" Functions and Cmdlets
|
||||
syn match ps1Cmdlet /\w\+-\w\+/
|
||||
syn keyword ps1Keyword function nextgroup=ps1Function skipwhite
|
||||
syn keyword ps1Keyword filter nextgroup=ps1Function skipwhite
|
||||
syn match ps1Function /\w\+-*\w*/ contained
|
||||
|
||||
" Type declarations
|
||||
syn match ps1Type /\[[a-z0-9_:.]\+\(\[\]\)\?\]/
|
||||
syn match ps1StandaloneType /[a-z0-9_.]\+/ contained
|
||||
syn keyword ps1Scope global local private script contained
|
||||
|
||||
" Variables and other user defined items
|
||||
syn match ps1Variable /\$\w\+/
|
||||
syn match ps1Variable /\${\w\+:\\\w\+}/
|
||||
syn match ps1ScopedVariable /\$\w\+:\w\+/ contains=ps1Scope
|
||||
syn match ps1VariableName /\w\+/ contained
|
||||
|
||||
" Operators all start w/ dash
|
||||
syn match ps1OperatorStart /-c\?/ nextgroup=ps1Operator
|
||||
syn keyword ps1Operator eq ne ge gt lt le like notlike match notmatch replace split /contains/ notcontains contained
|
||||
syn keyword ps1Operator ieq ine ige igt ile ilt ilike inotlike imatch inotmatch ireplace isplit icontains inotcontains contained
|
||||
syn keyword ps1Operator ceq cne cge cgt clt cle clike cnotlike cmatch cnotmatch creplace csplit ccontains cnotcontains contained
|
||||
syn keyword ps1Operator is isnot as join contained
|
||||
syn keyword ps1Operator and or not xor band bor bnot bxor contained
|
||||
syn keyword ps1Operator f contained
|
||||
|
||||
" Regular Strings
|
||||
" These aren't precisely correct and could use some work
|
||||
syn region ps1String start=/"/ skip=/`"/ end=/"/ contains=@ps1StringSpecial
|
||||
syn region ps1String start=/'/ skip=/''/ end=/'/
|
||||
|
||||
" Here-Strings
|
||||
syn region ps1String start=/@"$/ end=/^"@/ contains=@ps1StringSpecial
|
||||
syn region ps1String start=/@'$/ end=/^'@/
|
||||
|
||||
" Interpolation
|
||||
syn match ps1Escape /`./ contained
|
||||
syn region ps1Interpolation matchgroup=ps1InterpolationDelimiter start="$(" end=")" contained contains=ALLBUT,@ps1NotTop
|
||||
syn region ps1NestedParentheses start="(" skip="\\\\\|\\)" matchgroup=ps1Interpolation end=")" transparent contained
|
||||
syn cluster ps1StringSpecial contains=ps1Escape,ps1Interpolation,ps1Variable,ps1Boolean,ps1Constant,ps1BuiltIn
|
||||
|
||||
" Numbers
|
||||
syn match ps1Number "\<\(0[xX]\x\+\|\d\+\)\([KMGTP][B]\)\=\>"
|
||||
syn match ps1Number "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[dD]\="
|
||||
syn match ps1Number "\<\d\+[eE][-+]\=\d\+[dD]\=\>"
|
||||
syn match ps1Number "\<\d\+\([eE][-+]\=\d\+\)\=[dD]\>"
|
||||
|
||||
" Constants
|
||||
syn match ps1Boolean "$\%(true\|false\)\>"
|
||||
syn match ps1Constant /\$null\>/
|
||||
syn match ps1BuiltIn "$^\|$?\|$_\|$\$"
|
||||
syn match ps1BuiltIn "$\%(args\|error\|foreach\|home\|input\)\>"
|
||||
syn match ps1BuiltIn "$\%(match\(es\)\?\|myinvocation\|host\|lastexitcode\)\>"
|
||||
syn match ps1BuiltIn "$\%(ofs\|shellid\|stacktrace\)\>"
|
||||
|
||||
" Folding blocks
|
||||
if !exists('g:ps1_nofold_blocks')
|
||||
syn region ps1Block start=/{/ end=/}/ transparent fold
|
||||
endif
|
||||
|
||||
if !exists('g:ps1_nofold_sig')
|
||||
syn region ps1Signature start=/# SIG # Begin signature block/ end=/# SIG # End signature block/ transparent fold
|
||||
endif
|
||||
|
||||
" Setup default color highlighting
|
||||
if version >= 508 || !exists("did_ps1_syn_inits")
|
||||
if version < 508
|
||||
let did_ps1_syn_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
HiLink ps1Number Number
|
||||
HiLink ps1Block Block
|
||||
HiLink ps1Exception Exception
|
||||
HiLink ps1Constant Constant
|
||||
HiLink ps1String String
|
||||
HiLink ps1Escape SpecialChar
|
||||
HiLink ps1InterpolationDelimiter Delimiter
|
||||
HiLink ps1Conditional Conditional
|
||||
HiLink ps1Function Function
|
||||
HiLink ps1Variable Identifier
|
||||
HiLink ps1ScopedVariable Identifier
|
||||
HiLink ps1VariableName Identifier
|
||||
HiLink ps1Boolean Boolean
|
||||
HiLink ps1Constant Constant
|
||||
HiLink ps1BuiltIn StorageClass
|
||||
HiLink ps1Type Type
|
||||
HiLink ps1Scope Type
|
||||
HiLink ps1StandaloneType Type
|
||||
HiLink ps1Number Number
|
||||
HiLink ps1Comment Comment
|
||||
HiLink ps1CommentTodo Todo
|
||||
HiLink ps1CommentDoc Tag
|
||||
HiLink ps1CDocParam Todo
|
||||
HiLink ps1Operator Operator
|
||||
HiLink ps1Repeat Repeat
|
||||
HiLink ps1RepeatAndCmdlet Repeat
|
||||
HiLink ps1Keyword Keyword
|
||||
HiLink ps1KeywordAndCmdlet Keyword
|
||||
HiLink ps1Cmdlet Statement
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "ps1"
|
||||
|
||||
56
syntax/ps1xml.vim
Normal file
56
syntax/ps1xml.vim
Normal file
@@ -0,0 +1,56 @@
|
||||
" Vim syntax file
|
||||
" Language: Windows PowerShell XML
|
||||
" Maintainer: Peter Provost <peter@provost.org>
|
||||
" Version: 2.10
|
||||
" Project Repository: https://github.com/PProvost/vim-ps1
|
||||
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327"
|
||||
|
||||
" Compatible VIM syntax file start
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:ps1xml_cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
doau syntax xml
|
||||
unlet b:current_syntax
|
||||
|
||||
syn case ignore
|
||||
syn include @ps1xmlScriptBlock <sfile>:p:h/ps1.vim
|
||||
unlet b:current_syntax
|
||||
|
||||
syn region ps1xmlScriptBlock
|
||||
\ matchgroup=xmlTag start="<Script>"
|
||||
\ matchgroup=xmlEndTag end="</Script>"
|
||||
\ fold
|
||||
\ contains=@ps1xmlScriptBlock
|
||||
\ keepend
|
||||
syn region ps1xmlScriptBlock
|
||||
\ matchgroup=xmlTag start="<ScriptBlock>"
|
||||
\ matchgroup=xmlEndTag end="</ScriptBlock>"
|
||||
\ fold
|
||||
\ contains=@ps1xmlScriptBlock
|
||||
\ keepend
|
||||
syn region ps1xmlScriptBlock
|
||||
\ matchgroup=xmlTag start="<GetScriptBlock>"
|
||||
\ matchgroup=xmlEndTag end="</GetScriptBlock>"
|
||||
\ fold
|
||||
\ contains=@ps1xmlScriptBlock
|
||||
\ keepend
|
||||
syn region ps1xmlScriptBlock
|
||||
\ matchgroup=xmlTag start="<SetScriptBlock>"
|
||||
\ matchgroup=xmlEndTag end="</SetScriptBlock>"
|
||||
\ fold
|
||||
\ contains=@ps1xmlScriptBlock
|
||||
\ keepend
|
||||
|
||||
syn cluster xmlRegionHook add=ps1xmlScriptBlock
|
||||
|
||||
let b:current_syntax = "ps1xml"
|
||||
|
||||
let &cpo = s:ps1xml_cpo_save
|
||||
unlet s:ps1xml_cpo_save
|
||||
|
||||
@@ -130,8 +130,8 @@ syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][io
|
||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold
|
||||
|
||||
" Normal String and Shell Command Output
|
||||
syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial,@Spell fold
|
||||
syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape,@Spell fold
|
||||
syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold
|
||||
syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape fold
|
||||
syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold
|
||||
|
||||
" Generalized Single Quoted String, Symbol and Array of Strings
|
||||
|
||||
@@ -17,20 +17,20 @@ syn keyword rustConditional match if else
|
||||
syn keyword rustOperator as
|
||||
|
||||
syn match rustAssert "\<assert\(\w\)*!" contained
|
||||
syn match rustFail "\<fail\(\w\)*!" contained
|
||||
syn match rustPanic "\<panic\(\w\)*!" contained
|
||||
syn keyword rustKeyword break
|
||||
syn keyword rustKeyword box nextgroup=rustBoxPlacement skipwhite skipempty
|
||||
syn keyword rustKeyword continue
|
||||
syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty
|
||||
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
|
||||
syn keyword rustKeyword for in if impl let
|
||||
syn keyword rustKeyword loop once proc pub
|
||||
syn keyword rustKeyword loop once pub
|
||||
syn keyword rustKeyword return super
|
||||
syn keyword rustKeyword unsafe virtual where while
|
||||
syn keyword rustKeyword use nextgroup=rustModPath skipwhite skipempty
|
||||
" FIXME: Scoped impl's name is also fallen in this category
|
||||
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite skipempty
|
||||
syn keyword rustStorage mut ref static const
|
||||
syn keyword rustStorage move mut ref static const
|
||||
|
||||
syn keyword rustInvalidBareKeyword crate
|
||||
|
||||
@@ -66,70 +66,64 @@ syn keyword rustType f64 i8 i16 i32 i64 str Self
|
||||
" This section is just straight transformation of the contents of the prelude,
|
||||
" to make it easy to update.
|
||||
|
||||
" Core operators {{{3
|
||||
" Reexported core operators {{{3
|
||||
syn keyword rustTrait Copy Send Sized Sync
|
||||
syn keyword rustTrait Add Sub Mul Div Rem Neg Not
|
||||
syn keyword rustTrait BitAnd BitOr BitXor
|
||||
syn keyword rustTrait Drop Deref DerefMut
|
||||
syn keyword rustTrait Shl Shr Index IndexMut
|
||||
syn keyword rustEnum Option
|
||||
syn keyword rustEnumVariant Some None
|
||||
syn keyword rustEnum Result
|
||||
syn keyword rustEnumVariant Ok Err
|
||||
syn keyword rustTrait Shl Shr
|
||||
syn keyword rustTrait Index IndexMut
|
||||
syn keyword rustTrait Slice SliceMut
|
||||
syn keyword rustTrait Fn FnMut FnOnce
|
||||
|
||||
" Functions {{{3
|
||||
"syn keyword rustFunction from_str
|
||||
"syn keyword rustFunction range
|
||||
" Reexported functions {{{3
|
||||
"syn keyword rustFunction range repeat
|
||||
"syn keyword rustFunction drop
|
||||
"syn keyword rustFunction from_str
|
||||
|
||||
" Types and traits {{{3
|
||||
" Reexported types and traits {{{3
|
||||
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr
|
||||
syn keyword rustTrait IntoBytes
|
||||
syn keyword rustTrait ToCStr
|
||||
syn keyword rustTrait Char UnicodeChar
|
||||
syn keyword rustTrait Clone
|
||||
syn keyword rustTrait PartialEq PartialOrd Eq Ord Equiv
|
||||
syn keyword rustEnum Ordering
|
||||
syn keyword rustTrait PartialEq PartialOrd Eq Ord
|
||||
syn keyword rustEnum Ordering Equiv
|
||||
syn keyword rustEnumVariant Less Equal Greater
|
||||
syn keyword rustTrait Collection Mutable Map MutableMap MutableSeq
|
||||
syn keyword rustTrait Set MutableSet
|
||||
syn keyword rustTrait FromIterator IntoIterator Extend ExactSize
|
||||
syn keyword rustTrait FromIterator Extend ExactSizeIterator
|
||||
syn keyword rustTrait Iterator DoubleEndedIterator
|
||||
syn keyword rustTrait RandomAccessIterator CloneableIterator
|
||||
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator
|
||||
syn keyword rustTrait Num NumCast CheckedAdd CheckedSub CheckedMul CheckedDiv
|
||||
syn keyword rustTrait Signed Unsigned Primitive Int Float
|
||||
syn keyword rustTrait FloatMath ToPrimitive FromPrimitive
|
||||
syn keyword rustTrait ToPrimitive FromPrimitive
|
||||
syn keyword rustTrait Box
|
||||
syn keyword rustEnum Option
|
||||
syn keyword rustEnumVariant Some None
|
||||
syn keyword rustTrait GenericPath Path PosixPath WindowsPath
|
||||
syn keyword rustTrait RawPtr
|
||||
syn keyword rustTrait Buffer Writer Reader Seek
|
||||
syn keyword rustTrait Str StrVector StrSlice
|
||||
syn keyword rustTrait IntoMaybeOwned StrAllocating UnicodeStrSlice
|
||||
syn keyword rustTrait ToString IntoStr
|
||||
syn keyword rustTrait RawPtr RawMutPtr
|
||||
syn keyword rustEnum Result
|
||||
syn keyword rustEnumVariant Ok Err
|
||||
syn keyword rustTrait Buffer Writer Reader Seek BufferPrelude
|
||||
syn keyword rustTrait Str StrVector StrPrelude
|
||||
syn keyword rustTrait IntoMaybeOwned StrAllocating UnicodeStrPrelude
|
||||
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
|
||||
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
|
||||
syn keyword rustTrait Tuple9 Tuple10 Tuple11 Tuple12
|
||||
syn keyword rustTrait CloneableVector ImmutableCloneableVector
|
||||
syn keyword rustTrait MutableCloneableSlice MutableOrdSlice
|
||||
syn keyword rustTrait ImmutableSlice MutableSlice
|
||||
syn keyword rustTrait ImmutablePartialEqSlice ImmutableOrdSlice
|
||||
syn keyword rustTrait Slice VectorVector
|
||||
syn keyword rustTrait MutableSliceAllocating
|
||||
syn keyword rustTrait String
|
||||
syn keyword rustTrait SlicePrelude AsSlice CloneSlicePrelude
|
||||
syn keyword rustTrait VectorVector PartialEqSlicePrelude OrdSlicePrelude
|
||||
syn keyword rustTrait CloneSliceAllocPrelude OrdSliceAllocPrelude SliceAllocPrelude
|
||||
syn keyword rustTrait IntoString String ToString
|
||||
syn keyword rustTrait Vec
|
||||
|
||||
" Reexported runtime types {{{3
|
||||
"syn keyword rustFunction sync_channel channel
|
||||
syn keyword rustTrait SyncSender Sender Receiver
|
||||
"syn keyword rustFunction spawn
|
||||
|
||||
"syn keyword rustConstant GC
|
||||
" Other syntax {{{2
|
||||
|
||||
syn keyword rustSelf self
|
||||
syn keyword rustBoolean true false
|
||||
|
||||
" Other syntax {{{2
|
||||
|
||||
" If foo::bar changes to foo.bar, change this ("::" to "\.").
|
||||
" If foo::bar changes to Foo::bar, change this (first "\w" to "\u").
|
||||
syn match rustModPath "\w\(\w\)*::[^<]"he=e-3,me=e-3
|
||||
@@ -151,12 +145,13 @@ syn match rustSigil display /[&~@*][^)= \t\r\n]/he=e-1,me=e-1
|
||||
" Last, because the & in && isn't a sigil
|
||||
syn match rustOperator display "&&\|||"
|
||||
|
||||
syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustFail
|
||||
syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustFail
|
||||
syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustPanic
|
||||
syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustPanic
|
||||
|
||||
syn match rustEscapeError display contained /\\./
|
||||
syn match rustEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/
|
||||
syn match rustEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{8}\)/
|
||||
syn match rustEscapeUnicode display contained /\\u{\x\{1,6}}/
|
||||
syn match rustStringContinuation display contained /\\\n\s*/
|
||||
syn region rustString start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeError,rustStringContinuation
|
||||
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell
|
||||
@@ -193,7 +188,7 @@ syn match rustCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/
|
||||
" The groups negated here add up to 0-255 but nothing else (they do not seem to go beyond ASCII).
|
||||
syn match rustCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/
|
||||
syn match rustCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=rustEscape,rustEscapeError,rustCharacterInvalid,rustCharacterInvalidUnicode
|
||||
syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid
|
||||
syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\|u{\x\{1,6}}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid
|
||||
|
||||
syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell
|
||||
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell
|
||||
@@ -263,7 +258,7 @@ hi def link rustCommentLineDoc SpecialComment
|
||||
hi def link rustCommentBlock rustCommentLine
|
||||
hi def link rustCommentBlockDoc rustCommentLineDoc
|
||||
hi def link rustAssert PreCondit
|
||||
hi def link rustFail PreCondit
|
||||
hi def link rustPanic PreCondit
|
||||
hi def link rustMacro Macro
|
||||
hi def link rustType Type
|
||||
hi def link rustTodo Todo
|
||||
@@ -282,7 +277,7 @@ hi def link rustBoxPlacementExpr rustKeyword
|
||||
" hi rustAttribute ctermfg=cyan
|
||||
" hi rustDeriving ctermfg=cyan
|
||||
" hi rustAssert ctermfg=yellow
|
||||
" hi rustFail ctermfg=red
|
||||
" hi rustPanic ctermfg=red
|
||||
" hi rustMacro ctermfg=magenta
|
||||
|
||||
syn sync minlines=200
|
||||
|
||||
97
syntax/tap.vim
Normal file
97
syntax/tap.vim
Normal file
@@ -0,0 +1,97 @@
|
||||
" Vim syntax file
|
||||
" Language: Verbose TAP Output
|
||||
" Maintainer: Rufus Cable <rufus@threebytesfull.com>
|
||||
" Remark: Simple syntax highlighting for TAP output
|
||||
" License:
|
||||
" Copyright: (c) 2008-2013 Rufus Cable
|
||||
" Last Change: {{LAST_CHANGE}}
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn match tapTestDiag /^ *#.*/ contains=tapTestTodo
|
||||
syn match tapTestTime /^ *\[\d\d:\d\d:\d\d\].*/ contains=tapTestFile
|
||||
syn match tapTestFile /\w\+\/[^. ]*/ contained
|
||||
syn match tapTestFileWithDot /\w\+\/[^ ]*/ contained
|
||||
|
||||
syn match tapTestPlan /^ *\d\+\.\.\d\+$/
|
||||
|
||||
" tapTest is a line like 'ok 1', 'not ok 2', 'ok 3 - xxxx'
|
||||
syn match tapTest /^ *\(not \)\?ok \d\+.*/ contains=tapTestStatusOK,tapTestStatusNotOK,tapTestLine
|
||||
|
||||
" tapTestLine is the line without the ok/not ok status - i.e. number and
|
||||
" optional message
|
||||
syn match tapTestLine /\d\+\( .*\|$\)/ contains=tapTestNumber,tapTestLoadMessage,tapTestTodo,tapTestSkip contained
|
||||
|
||||
" turn ok/not ok messages green/red respectively
|
||||
syn match tapTestStatusOK /ok/ contained
|
||||
syn match tapTestStatusNotOK /not ok/ contained
|
||||
|
||||
" highlight todo tests
|
||||
syn match tapTestTodo /\(# TODO\|Failed (TODO)\) .*$/ contained contains=tapTestTodoRev
|
||||
syn match tapTestTodoRev /\<TODO\>/ contained
|
||||
|
||||
" highlight skipped tests
|
||||
syn match tapTestSkip /# skip .*$/ contained contains=tapTestSkipTag
|
||||
syn match tapTestSkipTag /\(# \)\@<=skip\>/ contained
|
||||
|
||||
" look behind so "ok 123" and "not ok 124" match test number
|
||||
syn match tapTestNumber /\(ok \)\@<=\d\d*/ contained
|
||||
syn match tapTestLoadMessage /\*\*\*.*\*\*\*/ contained contains=tapTestThreeStars,tapTestFileWithDot
|
||||
syn match tapTestThreeStars /\*\*\*/ contained
|
||||
|
||||
syn region tapTestRegion start=/^ *\(not \)\?ok.*$/me=e+1 end=/^\(\(not \)\?ok\|# Looks like you planned \|All tests successful\|Bailout called\)/me=s-1 fold transparent excludenl
|
||||
syn region tapTestResultsOKRegion start=/^\(All tests successful\|Result: PASS\)/ end=/$/
|
||||
syn region tapTestResultsNotOKRegion start=/^\(# Looks like you planned \|Bailout called\|# Looks like you failed \|Result: FAIL\)/ end=/$/
|
||||
syn region tapTestResultsSummaryRegion start=/^Test Summary Report/ end=/^Files=.*$/ contains=tapTestResultsSummaryHeading,tapTestResultsSummaryNotOK
|
||||
|
||||
syn region tapTestResultsSummaryHeading start=/^Test Summary Report/ end=/^-\+$/ contained
|
||||
syn region tapTestResultsSummaryNotOK start=/TODO passed:/ end=/$/ contained
|
||||
|
||||
syn region tapTestInstructionsRegion start=/\%1l/ end=/^$/
|
||||
|
||||
set foldtext=TAPTestLine_foldtext()
|
||||
function! TAPTestLine_foldtext()
|
||||
let line = getline(v:foldstart)
|
||||
let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g')
|
||||
return sub
|
||||
endfunction
|
||||
|
||||
set foldminlines=5
|
||||
set foldcolumn=2
|
||||
set foldenable
|
||||
set foldmethod=syntax
|
||||
syn sync fromstart
|
||||
|
||||
if !exists("did_tapverboseoutput_syntax_inits")
|
||||
let did_tapverboseoutput_syntax_inits = 1
|
||||
|
||||
hi tapTestStatusOK term=bold ctermfg=green guifg=Green
|
||||
hi tapTestStatusNotOK term=reverse ctermfg=black ctermbg=red guifg=Black guibg=Red
|
||||
hi tapTestTodo term=bold ctermfg=yellow ctermbg=black guifg=Yellow guibg=Black
|
||||
hi tapTestTodoRev term=reverse ctermfg=black ctermbg=yellow guifg=Black guibg=Yellow
|
||||
hi tapTestSkip term=bold ctermfg=lightblue guifg=LightBlue
|
||||
hi tapTestSkipTag term=reverse ctermfg=black ctermbg=lightblue guifg=Black guibg=LightBlue
|
||||
hi tapTestTime term=bold ctermfg=blue guifg=Blue
|
||||
hi tapTestFile term=reverse ctermfg=black ctermbg=yellow guibg=Black guifg=Yellow
|
||||
hi tapTestLoadedFile term=bold ctermfg=black ctermbg=cyan guibg=Cyan guifg=Black
|
||||
hi tapTestThreeStars term=reverse ctermfg=blue guifg=Blue
|
||||
hi tapTestPlan term=bold ctermfg=yellow guifg=Yellow
|
||||
|
||||
hi link tapTestFileWithDot tapTestLoadedFile
|
||||
hi link tapTestNumber Number
|
||||
hi link tapTestDiag Comment
|
||||
|
||||
hi tapTestRegion ctermbg=green
|
||||
|
||||
hi tapTestResultsOKRegion ctermbg=green ctermfg=black
|
||||
hi tapTestResultsNotOKRegion ctermbg=red ctermfg=black
|
||||
|
||||
hi tapTestResultsSummaryHeading ctermbg=blue ctermfg=white
|
||||
hi tapTestResultsSummaryNotOK ctermbg=red ctermfg=black
|
||||
|
||||
hi tapTestInstructionsRegion ctermbg=lightmagenta ctermfg=black
|
||||
endif
|
||||
|
||||
let b:current_syntax="tapVerboseOutput"
|
||||
98
syntax/thrift.vim
Normal file
98
syntax/thrift.vim
Normal file
@@ -0,0 +1,98 @@
|
||||
" Vim syntax file
|
||||
" Language: Thrift
|
||||
" Maintainer: Martin Smith <martin@facebook.com>
|
||||
" Last Change: $Date: $
|
||||
"
|
||||
" $Id: $
|
||||
"
|
||||
" Licensed to the Apache Software Foundation (ASF) under one
|
||||
" or more contributor license agreements. See the NOTICE file
|
||||
" distributed with this work for additional information
|
||||
" regarding copyright ownership. The ASF licenses this file
|
||||
" to you under the Apache License, Version 2.0 (the
|
||||
" "License"); you may not use this file except in compliance
|
||||
" with the License. You may obtain a copy of the License at
|
||||
"
|
||||
" http://www.apache.org/licenses/LICENSE-2.0
|
||||
"
|
||||
" Unless required by applicable law or agreed to in writing,
|
||||
" software distributed under the License is distributed on an
|
||||
" "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
" KIND, either express or implied. See the License for the
|
||||
" specific language governing permissions and limitations
|
||||
" under the License.
|
||||
"
|
||||
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Todo
|
||||
syn keyword thriftTodo TODO todo FIXME fixme XXX xxx contained
|
||||
|
||||
" Comments
|
||||
syn match thriftComment "#.*" contains=thriftTodo,@Spell
|
||||
syn region thriftComment start="/\*" end="\*/" contains=thriftTodo,@Spell
|
||||
syn match thriftComment "//.\{-}\(?>\|$\)\@="
|
||||
|
||||
" String
|
||||
syn region thriftStringDouble matchgroup=None start=+"+ end=+"+
|
||||
|
||||
" Number
|
||||
syn match thriftNumber "-\=\<\d\+\>" contained
|
||||
|
||||
" Keywords
|
||||
syn keyword thriftStatement namespace
|
||||
syn keyword thriftInclude include
|
||||
syn keyword thriftKeyword xsd_all xsd_optional xsd_nillable xsd_attrs
|
||||
syn keyword thriftKeyword cpp_include cpp_type const optional required
|
||||
syn keyword thriftStatement throws typedef
|
||||
syn keyword thriftBasicTypes void bool byte string binary
|
||||
syn keyword thriftBasicTypes i16 i32 i64 double
|
||||
syn keyword thriftType map list set
|
||||
syn keyword thriftClass struct exception enum
|
||||
syn region thriftString start=+"+ end=+"+
|
||||
|
||||
" Special
|
||||
syn match thriftNumber "\d\+:"
|
||||
|
||||
" Structure
|
||||
syn keyword thriftStructure service oneway extends
|
||||
"async" { return tok_async; }
|
||||
"exception" { return tok_xception; }
|
||||
"extends" { return tok_extends; }
|
||||
"throws" { return tok_throws; }
|
||||
"service" { return tok_service; }
|
||||
"enum" { return tok_enum; }
|
||||
"const" { return tok_const; }
|
||||
|
||||
if version >= 508 || !exists("did_thrift_syn_inits")
|
||||
if version < 508
|
||||
let did_thrift_syn_inits = 1
|
||||
command! -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command! -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
HiLink thriftComment Comment
|
||||
HiLink thriftKeyword Special
|
||||
HiLink thriftBasicTypes Type
|
||||
HiLink thriftType Type
|
||||
HiLink thriftStructure StorageClass
|
||||
HiLink thriftTodo Todo
|
||||
HiLink thriftString String
|
||||
HiLink thriftNumber Number
|
||||
HiLink thriftSpecial Special
|
||||
HiLink thriftStructure Structure
|
||||
HiLink thriftStatement Statement
|
||||
HiLink thriftInclude Include
|
||||
HiLink thriftClass Type
|
||||
HiLink thriftString String
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "thrift"
|
||||
|
||||
111
syntax/tmux.vim
111
syntax/tmux.vim
@@ -1,6 +1,6 @@
|
||||
" Vim syntax file
|
||||
" Language: tmux(1) configuration file
|
||||
" Maintainer: Tiago Cunha <me@tiagocunha.org>
|
||||
" Maintainer: Tiago Cunha <tcunha@users.sourceforge.net>
|
||||
" Last Change: $Date: 2010-07-27 18:29:07 $
|
||||
" License: This file is placed in the public domain.
|
||||
|
||||
@@ -16,64 +16,61 @@ syntax case match
|
||||
syn keyword tmuxAction any current none
|
||||
syn keyword tmuxBoolean off on
|
||||
|
||||
syn keyword tmuxCmds detach[-client] ls list-sessions neww new-window
|
||||
syn keyword tmuxCmds bind[-key] unbind[-key] prev[ious-window] last[-window]
|
||||
syn keyword tmuxCmds lsk list-keys set[-option] renamew rename-window selectw
|
||||
syn keyword tmuxCmds select-window lsw list-windows attach[-session]
|
||||
syn keyword tmuxCmds send-prefix refresh[-client] killw kill-window lsc
|
||||
syn keyword tmuxCmds list-clients linkw link-window unlinkw unlink-window
|
||||
syn keyword tmuxCmds next[-window] send[-keys] swapw swap-window
|
||||
syn keyword tmuxCmds rename[-session] kill-session switchc switch-client
|
||||
syn keyword tmuxCmds has[-session] copy-mode pasteb paste-buffer
|
||||
syn keyword tmuxCmds new[-session] start[-server] kill-server setw
|
||||
syn keyword tmuxCmds set-window-option show[-options] showw show-window-options
|
||||
syn keyword tmuxCmds command-prompt setb set-buffer showb show-buffer lsb
|
||||
syn keyword tmuxCmds list-buffers deleteb delete-buffer lscm list-commands
|
||||
syn keyword tmuxCmds movew move-window respawnw respawn-window
|
||||
syn keyword tmuxCmds source[-file] info server-info clock-mode lock[-server]
|
||||
syn keyword tmuxCmds saveb save-buffer killp
|
||||
syn keyword tmuxCmds kill-pane resizep resize-pane selectp select-pane swapp
|
||||
syn keyword tmuxCmds swap-pane splitw split-window choose-session
|
||||
syn keyword tmuxCmds choose-window loadb load-buffer copyb copy-buffer suspendc
|
||||
syn keyword tmuxCmds suspend-client findw find-window breakp break-pane nextl
|
||||
syn keyword tmuxCmds next-layout rotatew rotate-window confirm[-before]
|
||||
syn keyword tmuxCmds clearhist clear-history selectl select-layout if[-shell]
|
||||
syn keyword tmuxCmds display[-message] setenv set-environment showenv
|
||||
syn keyword tmuxCmds show-environment choose-client displayp display-panes
|
||||
syn keyword tmuxCmds run[-shell] lockc lock-client locks lock-session lsp
|
||||
syn keyword tmuxCmds list-panes pipep pipe-pane showmsgs show-messages capturep
|
||||
syn keyword tmuxCmds capture-pane joinp join-pane choose-buffer
|
||||
syn keyword tmuxCmds
|
||||
\ attach[-session] detach[-client] has[-session] kill-server
|
||||
\ kill-session lsc list-clients lscm list-commands ls list-sessions
|
||||
\ lockc lock-client locks lock-session new[-session] refresh[-client]
|
||||
\ rename[-session] showmsgs show-messages source[-file] start[-server]
|
||||
\ suspendc suspend-client switchc switch-client copy-mode
|
||||
\ breakp break-pane capturep capture-pane choose-client choose-session
|
||||
\ choose-tree choose-window displayp display-panes findw find-window
|
||||
\ joinp join-pane killp kill-pane killw kill-window lastp last-pane
|
||||
\ last[-window] linkw link-window lsp list-panes lsw list-windows movep
|
||||
\ move-pane movew move-window neww new-window nextl next-layout
|
||||
\ next[-window] pipep pipe-pane prevl previous-layout prev[ious-window]
|
||||
\ renamew rename-window resizep resize-pane respawnp respawn-pane
|
||||
\ respawnw respawn-window rotatew rotate-window selectl select-layout
|
||||
\ selectp select-pane selectw select-window splitw split-window swapp
|
||||
\ swap-pane swapw swap-window unlinkw unlink-window
|
||||
\ bind[-key] lsk list-keys send[-keys] send-prefix unbind[-key]
|
||||
\ set[-option] setw set-window-option show[-options] showw
|
||||
\ show-window-options setenv set-environment showenv show-environment
|
||||
\ command-prompt confirm[-before] display[-message]
|
||||
\ choose-buffer clearhist clear-history deleteb delete-buffer lsb
|
||||
\ list-buffers loadb load-buffer pasteb paste-buffer saveb save-buffer
|
||||
\ setb set-buffer showb show-buffer
|
||||
\ clock-mode if[-shell] lock[-server] run[-shell] [server-]info
|
||||
|
||||
syn keyword tmuxOptsSet prefix status status-fg status-bg bell-action
|
||||
syn keyword tmuxOptsSet default-command history-limit status-left status-right
|
||||
syn keyword tmuxOptsSet status-interval set-titles display-time buffer-limit
|
||||
syn keyword tmuxOptsSet status-left-length status-right-length
|
||||
syn keyword tmuxOptsSet message-[command-]bg lock-after-time default-path
|
||||
syn keyword tmuxOptsSet message-[command-]attr status-attr set-remain-on-exit
|
||||
syn keyword tmuxOptsSet status-utf8 default-terminal visual-activity repeat-time
|
||||
syn keyword tmuxOptsSet visual-bell visual-content status-justify status-keys
|
||||
syn keyword tmuxOptsSet terminal-overrides status-left-attr status-left-bg
|
||||
syn keyword tmuxOptsSet status-left-fg status-right-attr status-right-bg
|
||||
syn keyword tmuxOptsSet status-right-fg update-environment base-index
|
||||
syn keyword tmuxOptsSet display-panes-colour display-panes-time default-shell
|
||||
syn keyword tmuxOptsSet set-titles-string lock-command lock-server
|
||||
syn keyword tmuxOptsSet mouse-select-pane message-limit quiet escape-time
|
||||
syn keyword tmuxOptsSet pane-active-border-bg pane-active-border-fg
|
||||
syn keyword tmuxOptsSet pane-border-bg pane-border-fg message-[command-]fg
|
||||
syn keyword tmuxOptsSet display-panes-active-colour alternate-screen
|
||||
syn keyword tmuxOptsSet detach-on-destroy
|
||||
syn keyword tmuxOptsSet
|
||||
\ buffer-limit escape-time exit-unattached exit-unattached quiet
|
||||
\ set-clipboard
|
||||
\ base-index bell-action bell-on-alert default-command default-path
|
||||
\ default-shell default-terminal destroy-unattached detach-on-destroy
|
||||
\ display-panes-[active-]colour display-[panes-]time history-limit
|
||||
\ lock-after-time lock-command lock-server message-[command-]attr
|
||||
\ message-[command-]bg message-[command-]fg message-limit
|
||||
\ mouse-resize-pane mouse-select-pane mouse-select-window mouse-utf8
|
||||
\ pane-[active-]border-style prefix prefix2
|
||||
\ renumber-windows repeat-time set-remain-on-exit set-titles
|
||||
\ set-titles-string status status-style
|
||||
\ status-interval status-justify status-keys status-left
|
||||
\ status-left-style status-left-length status-position status-right
|
||||
\ status-right-style status-right-length status-utf8 terminal-overrides
|
||||
\ update-environment visual-activity visual-bell visual-content
|
||||
\ visual-silence word-separators
|
||||
|
||||
syn keyword tmuxOptsSetw monitor-activity aggressive-resize force-width
|
||||
syn keyword tmuxOptsSetw force-height remain-on-exit uft8 mode-fg mode-bg
|
||||
syn keyword tmuxOptsSetw mode-keys clock-mode-colour clock-mode-style
|
||||
syn keyword tmuxOptsSetw xterm-keys mode-attr window-status-attr
|
||||
syn keyword tmuxOptsSetw window-status-bg window-status-fg automatic-rename
|
||||
syn keyword tmuxOptsSetw main-pane-width main-pane-height monitor-content
|
||||
syn keyword tmuxOptsSetw window-status-current-attr window-status-current-bg
|
||||
syn keyword tmuxOptsSetw window-status-current-fg mode-mouse synchronize-panes
|
||||
syn keyword tmuxOptsSetw window-status-format window-status-current-format
|
||||
syn keyword tmuxOptsSetw word-separators window-status-alert-attr
|
||||
syn keyword tmuxOptsSetw window-status-alert-bg window-status-alert-fg
|
||||
syn keyword tmuxOptsSetw
|
||||
\ aggressive-resize alternate-screen automatic-rename
|
||||
\ c0-change-interval c0-change-trigger clock-mode-colour
|
||||
\ clock-mode-style force-height force-width layout-history-limit
|
||||
\ main-pane-height main-pane-width mode-style move-keys
|
||||
\ mode-mouse monitor-activity monitor-content monitor-silence
|
||||
\ other-pane-height other-pane-width pane-base-index remain-on-exit
|
||||
\ synchronize-panes utf8 window-status-bell-style
|
||||
\ window-status-content-style window-status-activity-style
|
||||
\ window-status-[current-]attr window-status-[current-]bg
|
||||
\ window-status-[current-]fg window-status-[current-]format
|
||||
\ window-status-separator xterm-keys wrap-search
|
||||
|
||||
syn keyword tmuxTodo FIXME NOTE TODO XXX contained
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ syntax keyword typeScriptGlobalObjects Array Boolean Date Function Infinity Math
|
||||
|
||||
syntax keyword typeScriptExceptions try catch throw finally Error EvalError RangeError ReferenceError SyntaxError TypeError URIError
|
||||
|
||||
syntax keyword typeScriptReserved constructor declare as interface module abstract enum int short export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public
|
||||
syntax keyword typeScriptReserved constructor declare as interface module abstract enum int short export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public type
|
||||
"}}}
|
||||
"" TypeScript/DOM/HTML/CSS specified things"{{{
|
||||
|
||||
@@ -250,7 +250,7 @@ if version >= 508 || !exists("did_typeScript_syn_inits")
|
||||
HiLink typeScriptIdentifier Identifier
|
||||
HiLink typeScriptRepeat Repeat
|
||||
HiLink typeScriptStatement Statement
|
||||
HiLink typeScriptFuncKeyword Function
|
||||
HiLink typeScriptFuncKeyword Type
|
||||
HiLink typeScriptMessage Keyword
|
||||
HiLink typeScriptDeprecated Exception
|
||||
HiLink typeScriptError Error
|
||||
|
||||
200
syntax/vala.vim
Normal file
200
syntax/vala.vim
Normal file
@@ -0,0 +1,200 @@
|
||||
" Vim syntax file
|
||||
" Language: Vala
|
||||
" Maintainers: Emmanuele Bassi <ebassi@gnome.org>
|
||||
" Hans Vercammen <hveso3@gmail.com>
|
||||
" pancake <pancake@nopcode.org>
|
||||
" Sebastian Reichel <sre@ring0.de>
|
||||
" Last Change: 2012-02-19
|
||||
" Filenames: *.vala *.vapi
|
||||
"
|
||||
" REFERENCES:
|
||||
" [1] http://live.gnome.org/Vala
|
||||
"
|
||||
" TODO: Possibly when reaching vala 1.0 release
|
||||
" - validate code attributes
|
||||
" - better error checking for known errors
|
||||
" - full support for valadoc
|
||||
"
|
||||
" add vala in /usr/share/vim/vim73/scripts.vim below ruby
|
||||
" to have shebang support
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:vala_cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Types
|
||||
syn keyword valaType bool char double float size_t ssize_t string unichar void
|
||||
syn keyword valaType int int8 int16 int32 int64 long short
|
||||
syn keyword valaType uint uint8 uint16 uint32 uint64 ulong ushort
|
||||
" Storage keywords
|
||||
syn keyword valaStorage class delegate enum errordomain interface namespace struct
|
||||
" repeat / condition / label
|
||||
syn keyword valaRepeat break continue do for foreach return while
|
||||
syn keyword valaConditional else if switch assert
|
||||
" User Labels
|
||||
syn keyword valaLabel case default
|
||||
|
||||
" Modifiers
|
||||
syn keyword valaModifier abstract const dynamic ensures extern inline internal override
|
||||
syn keyword valaModifier private protected public requires signal static virtual volatile weak
|
||||
syn keyword valaModifier async owned unowned
|
||||
" Constants
|
||||
syn keyword valaConstant false null true
|
||||
" Exceptions
|
||||
syn keyword valaException try catch finally throw
|
||||
" Unspecified Statements
|
||||
syn keyword valaUnspecifiedStatement as base construct delete get in is lock new out params ref sizeof set this throws typeof using value var yield
|
||||
|
||||
" Comments
|
||||
syn cluster valaCommentGroup contains=valaTodo
|
||||
syn keyword valaTodo contained TODO FIXME XXX NOTE
|
||||
|
||||
" valadoc Comments (ported from javadoc comments in java.vim)
|
||||
" TODO: need to verify valadoc syntax
|
||||
if !exists("vala_ignore_valadoc")
|
||||
syn cluster valaDocCommentGroup contains=valaDocTags,valaDocSeeTag
|
||||
syn region valaDocTags contained start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}"
|
||||
syn match valaDocTags contained "@\(param\|exception\|throws\|since\)\s\+\S\+" contains=valaDocParam
|
||||
syn match valaDocParam contained "\s\S\+"
|
||||
syn match valaDocTags contained "@\(author\|brief\|version\|return\|deprecated\)\>"
|
||||
syn region valaDocSeeTag contained matchgroup=valaDocTags start="@see\s\+" matchgroup=NONE end="\_."re=e-1 contains=valaDocSeeTagParam
|
||||
syn match valaDocSeeTagParam contained @"\_[^"]\+"\|<a\s\+\_.\{-}</a>\|\(\k\|\.\)*\(#\k\+\((\_[^)]\+)\)\=\)\=@ extend
|
||||
endif
|
||||
|
||||
" Comment Strings (ported from c.vim)
|
||||
if exists("vala_comment_strings")
|
||||
syn match valaCommentSkip contained "^\s*\*\($\|\s\+\)"
|
||||
syn region valaCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=valaSpecialChar,valaCommentSkip
|
||||
syn region valaComment2String contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=valaSpecialChar
|
||||
syn cluster valaCommentStringGroup contains=valaCommentString,valaCharacter,valaNumber
|
||||
|
||||
syn region valaCommentL start="//" end="$" keepend contains=@valaCommentGroup,valaComment2String,valaCharacter,valaNumber,valaSpaceError,@Spell
|
||||
syn region valaComment matchgroup=valaCommentStart start="/\*" end="\*/" contains=@valaCommentGroup,@valaCommentStringGroup,valaCommentStartError,valaSpaceError,@Spell extend fold
|
||||
if !exists("vala_ignore_valadoc")
|
||||
syn region valaDocComment matchgroup=valaCommentStart start="/\*\*" end="\*/" keepend contains=@valaCommentGroup,@valaDocCommentGroup,@valaCommentStringGroup,valaCommentStartError,valaSpaceError,@Spell
|
||||
endif
|
||||
else
|
||||
syn region valaCommentL start="//" end="$" keepend contains=@valaCommentGroup,valaSpaceError,@Spell
|
||||
syn region valaComment matchgroup=valaCommentStart start="/\*" end="\*/" contains=@valaCommentGroup,valaCommentStartError,valaSpaceError,@Spell
|
||||
if !exists("vala_ignore_valadoc")
|
||||
syn region valaDocComment matchgroup=valaCommentStart start="/\*\*" end="\*/" keepend contains=@valaCommentGroup,@valaDocCommentGroup,valaCommentStartError,valaSpaceError,@Spell
|
||||
endif
|
||||
endif
|
||||
|
||||
syn region valaPreCondit start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1
|
||||
syn match valaPreCondit display "^\s*\(%:\|#\)\s*\(else\|endif\)\>"
|
||||
|
||||
" Comment if 0 blocks (ported from c.vim)
|
||||
if !exists("vala_no_if0")
|
||||
syn region valaCppOut start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end=".\@=\|$" contains=valaCppOut2 fold
|
||||
syn region valaCppOut2 contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=valaSpaceError,valaCppSkip
|
||||
syn region valaCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=valaSpaceError,valaCppSkip
|
||||
endif
|
||||
|
||||
" match comment errors
|
||||
syntax match valaCommentError display "\*/"
|
||||
syntax match valaCommentStartError display "/\*"me=e-1 contained
|
||||
" match the special comment /**/
|
||||
syn match valaComment "/\*\*/"
|
||||
|
||||
" Vala Code Attributes
|
||||
syn region valaAttribute start="^\s*\[" end="\]$" contains=valaComment,valaString keepend
|
||||
syn region valaAttribute start="\[CCode" end="\]" contains=valaComment,valaString
|
||||
|
||||
" Avoid escaped keyword matching
|
||||
syn match valaUserContent display "@\I*"
|
||||
|
||||
" Strings and constants
|
||||
syn match valaSpecialError contained "\\."
|
||||
syn match valaSpecialCharError contained "[^']"
|
||||
syn match valaSpecialChar contained +\\["\\'0abfnrtvx]+
|
||||
syn region valaString start=+"+ end=+"+ end=+$+ contains=valaSpecialChar,valaSpecialError,valaUnicodeNumber,@Spell
|
||||
syn region valaVerbatimString start=+"""+ end=+"""+ contains=@Spell
|
||||
syn match valaUnicodeNumber +\\\(u\x\{4}\|U\x\{8}\)+ contained contains=valaUnicodeSpecifier
|
||||
syn match valaUnicodeSpecifier +\\[uU]+ contained
|
||||
syn match valaCharacter "'[^']*'" contains=valaSpecialChar,valaSpecialCharError
|
||||
syn match valaCharacter "'\\''" contains=valaSpecialChar
|
||||
syn match valaCharacter "'[^\\]'"
|
||||
syn match valaNumber display "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
|
||||
syn match valaNumber display "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
|
||||
syn match valaNumber display "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
|
||||
syn match valaNumber display "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
|
||||
|
||||
" when wanted, highlight trailing white space
|
||||
if exists("vala_space_errors")
|
||||
if !exists("vala_no_trail_space_error")
|
||||
syn match valaSpaceError display excludenl "\s\+$"
|
||||
endif
|
||||
if !exists("vala_no_tab_space_error")
|
||||
syn match valaSpaceError display " \+\t"me=e-1
|
||||
endif
|
||||
endif
|
||||
|
||||
" when wanted, set minimum lines for comment syntax syncing
|
||||
if exists("vala_minlines")
|
||||
let b:vala_minlines = vala_minlines
|
||||
else
|
||||
let b:vala_minlines = 50
|
||||
endif
|
||||
exec "syn sync ccomment valaComment minlines=" . b:vala_minlines
|
||||
|
||||
" code folding
|
||||
syn region valaBlock start="{" end="}" transparent fold
|
||||
|
||||
" The default highlighting.
|
||||
hi def link valaType Type
|
||||
hi def link valaStorage StorageClass
|
||||
hi def link valaRepeat Repeat
|
||||
hi def link valaConditional Conditional
|
||||
hi def link valaLabel Label
|
||||
hi def link valaModifier StorageClass
|
||||
hi def link valaConstant Constant
|
||||
hi def link valaException Exception
|
||||
hi def link valaUnspecifiedStatement Statement
|
||||
hi def link valaUnspecifiedKeyword Keyword
|
||||
hi def link valaContextualStatement Statement
|
||||
|
||||
hi def link valaCommentError Error
|
||||
hi def link valaCommentStartError Error
|
||||
hi def link valaSpecialError Error
|
||||
hi def link valaSpecialCharError Error
|
||||
hi def link valaSpaceError Error
|
||||
|
||||
hi def link valaTodo Todo
|
||||
hi def link valaCommentL valaComment
|
||||
hi def link valaCommentStart valaComment
|
||||
hi def link valaCommentSkip valaComment
|
||||
hi def link valaComment Comment
|
||||
hi def link valaDocComment Comment
|
||||
hi def link valaDocTags Special
|
||||
hi def link valaDocParam Function
|
||||
hi def link valaDocSeeTagParam Function
|
||||
hi def link valaAttribute PreCondit
|
||||
|
||||
hi def link valaCommentString valaString
|
||||
hi def link valaComment2String valaString
|
||||
hi def link valaString String
|
||||
hi def link valaVerbatimString String
|
||||
hi def link valaCharacter Character
|
||||
hi def link valaSpecialChar SpecialChar
|
||||
hi def link valaNumber Number
|
||||
hi def link valaUnicodeNumber SpecialChar
|
||||
hi def link valaUnicodeSpecifier SpecialChar
|
||||
|
||||
hi def link valaPreCondit PreCondit
|
||||
|
||||
if !exists("vala_no_if0")
|
||||
hi def link valaCppSkip valaCppOut
|
||||
hi def link valaCppOut2 valaCppOut
|
||||
hi def link valaCppOut Comment
|
||||
endif
|
||||
|
||||
let b:current_syntax = "vala"
|
||||
|
||||
let &cpo = s:vala_cpo_save
|
||||
unlet s:vala_cpo_save
|
||||
|
||||
" vim: ts=8
|
||||
67
syntax/velocity.vim
Normal file
67
syntax/velocity.vim
Normal file
@@ -0,0 +1,67 @@
|
||||
" Vim syntax file
|
||||
" Language: Velocity HTML template
|
||||
" Maintainer: Hsiaoming Young <http://lepture.com>
|
||||
" Last Change: 2012 Jan 09
|
||||
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists("main_syntax")
|
||||
let main_syntax = 'html'
|
||||
endif
|
||||
|
||||
if version < 600
|
||||
so <sfile>:p:h/html.vim
|
||||
else
|
||||
runtime! syntax/html.vim
|
||||
unlet b:current_syntax
|
||||
endif
|
||||
|
||||
syn keyword velocityTodo FIXME TODO contained
|
||||
syn region velocitySpec start="@" end=" " oneline contained
|
||||
syn region velocityComment start="#\*" end="\*#" contains=velocityTodo,velocitySpec
|
||||
syn match velocityComment /##.*/ contains=velocityTodo,velocitySpec
|
||||
syn region velocityString start='"' end='"' oneline display
|
||||
syn region velocityString start="'" end="'" oneline display
|
||||
syn match velocityNumber "[-+]\=\d\+\(\.\d*\)\=" display
|
||||
syn region velocityList start='\[' end='\]' oneline contained contains=velocityString,velocityNumber
|
||||
syn match velocityMath /=\|-\|+\|\/\|\*\|%/ contained
|
||||
syn match velocityBlock /#[a-z]\{2,\}/ contains=velocityStatement
|
||||
syn match velocityBlock /#[a-z]\{2,\}(.\+)/ contains=velocityStatement,velocityVar,velocityString,velocityNumber,velocityMath,velocityList
|
||||
syn keyword velocityStatement in set if else elseif end foreach include parse macro cmsparse stop break evaluate define contained
|
||||
|
||||
syn match velocityVar /$!\?[a-zA-Z][a-zA-Z0-9_-]\+\(\.\?[a-zA-Z0-9]*\)\+/ contains=velocityFunction display containedin=ALL
|
||||
syn match velocityVar /$!\?{[a-zA-Z][a-zA-Z0-9_-]\+}/ display containedin=ALL
|
||||
syn match velocityFunction /[a-zA-Z][a-zA-Z0-9_-]\+\(\.[a-zA-Z][a-zA-Z0-9_-]\+\)\+([^)]*)/ contains=velocityString,velocityNumber,velocityList,velocityMath,velocityVar,velocityFunction display containedin=velocityBlock
|
||||
|
||||
" Define the default highlighting.
|
||||
" For version 5.7 and earlier: only when not done already
|
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
||||
if version >= 508 || !exists("did_velocity_syn_inits")
|
||||
if version < 508
|
||||
let did_velocity_syn_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
HiLink velocityString String
|
||||
HiLink velocityNumber Number
|
||||
HiLink velocityList Constant
|
||||
HiLink velocityBlock PreProc
|
||||
HiLink velocitySpec Special
|
||||
HiLink velocityVar Identifier
|
||||
HiLink velocityFunction Function
|
||||
HiLink velocityStatement Statement
|
||||
HiLink velocityComment Comment
|
||||
HiLink velocityTodo Todo
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "velocity"
|
||||
Reference in New Issue
Block a user