mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
12db3dafc5 | ||
|
|
d1e95cbc98 | ||
|
|
7ffa793f19 | ||
|
|
4203435c48 |
12
README.md
12
README.md
@@ -7,7 +7,7 @@ A collection of language packs for Vim.
|
||||
|
||||
> One to rule them all, one to find them, one to bring them all and in the darkness bind them.
|
||||
|
||||
- It **won't affect your startup time**, as scripts are loaded only on demand\*.
|
||||
- It **won't affect your startup time**, as scripts are loaded only on demand\*.
|
||||
- It **installs 50+ times faster** than 50+ packages it consist of.
|
||||
- Solid syntax and indentation support. Only the best language packs.
|
||||
- All unnecessary files are ignored (like enormous documentation from php support).
|
||||
@@ -26,10 +26,9 @@ 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, ftdetect)
|
||||
- [blade](https://github.com/xsbeats/vim-blade) (syntax, indent, 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)
|
||||
- [clojure](https://github.com/guns/vim-clojure-static) (syntax, indent, autoload, ftplugin, ftdetect)
|
||||
- [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
|
||||
- [css](https://github.com/JulesWang/css.vim) (syntax)
|
||||
@@ -49,7 +48,8 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
||||
- [jade](https://github.com/digitaltoad/vim-jade) (syntax, indent, ftplugin, ftdetect)
|
||||
- [jasmine](https://github.com/glanotte/vim-jasmine) (syntax, ftdetect)
|
||||
- [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, ftdetect)
|
||||
- [json](https://github.com/leshill/vim-json) (syntax, ftdetect)
|
||||
- [julia](https://github.com/dcjones/julia-minimalist-vim) (syntax, indent, ftdetect)
|
||||
- [json](https://github.com/sheerun/vim-json) (syntax, indent, ftdetect)
|
||||
- [jst](https://github.com/briancollins/vim-jst) (syntax, indent, ftdetect)
|
||||
- [latex](https://github.com/LaTeX-Box-Team/LaTeX-Box) (syntax, indent, ftplugin)
|
||||
- [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin, ftdetect)
|
||||
@@ -70,7 +70,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
||||
- [ruby](https://github.com/vim-ruby/vim-ruby) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
|
||||
- [rust](https://github.com/wting/rust.vim) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
|
||||
- [sbt](https://github.com/derekwyatt/vim-sbt) (syntax, ftdetect)
|
||||
- [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, ftplugin, ftdetect)
|
||||
- [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||
- [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftdetect)
|
||||
- [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin, ftdetect)
|
||||
- [systemd](https://github.com/kurayama/systemd-vim-syntax) (syntax, ftdetect)
|
||||
@@ -78,7 +78,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
||||
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, 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)
|
||||
- [typescript](https://github.com/leafgarland/typescript-vim) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
|
||||
- [thrift](https://github.com/solarnz/thrift.vim) (syntax, ftdetect)
|
||||
- [toml](https://github.com/cespare/vim-toml) (syntax, ftplugin, ftdetect)
|
||||
|
||||
@@ -72,7 +72,8 @@ syn keyword cAnsiFunction wcstombs mbstowcs wctomb
|
||||
syn keyword cAnsiFunction mbtowc mblen lldiv
|
||||
syn keyword cAnsiFunction ldiv div llabs
|
||||
syn keyword cAnsiFunction labs abs qsort
|
||||
syn keyword cAnsiFunction bsearch system getenv
|
||||
"syn keyword cAnsiFunction bsearch system getenv
|
||||
syn keyword cAnsiFunction bsearch getenv
|
||||
syn keyword cAnsiFunction exit atexit abort
|
||||
syn keyword cAnsiFunction realloc malloc free
|
||||
syn keyword cAnsiFunction calloc srand rand
|
||||
|
||||
@@ -134,6 +134,7 @@ syntax keyword cppSTLfunctional binary_negate
|
||||
syntax keyword cppSTLfunctional bit_and
|
||||
syntax keyword cppSTLfunctional bit_not
|
||||
syntax keyword cppSTLfunctional bit_or
|
||||
syntax keyword cppSTLfunctional bit_xor
|
||||
syntax keyword cppSTLfunctional divides
|
||||
syntax keyword cppSTLfunctional equal_to
|
||||
syntax keyword cppSTLfunctional greater
|
||||
@@ -197,7 +198,7 @@ syntax keyword cppSTLfunction count
|
||||
syntax keyword cppSTLfunction count_if
|
||||
syntax keyword cppSTLfunction c_str
|
||||
syntax keyword cppSTLfunction ctime
|
||||
syntax keyword cppSTLfunction data
|
||||
"syntax keyword cppSTLfunction data
|
||||
syntax keyword cppSTLfunction denorm_min
|
||||
syntax keyword cppSTLfunction destroy
|
||||
syntax keyword cppSTLfunction difftime
|
||||
@@ -459,7 +460,7 @@ syntax keyword cppSTLfunction swap_ranges
|
||||
syntax keyword cppSTLfunction swprintf
|
||||
syntax keyword cppSTLfunction swscanf
|
||||
syntax keyword cppSTLfunction sync_with_stdio
|
||||
syntax keyword cppSTLfunction system
|
||||
"syntax keyword cppSTLfunction system
|
||||
syntax keyword cppSTLfunction tan
|
||||
syntax keyword cppSTLfunction tanh
|
||||
syntax keyword cppSTLfunction tellg
|
||||
@@ -760,6 +761,7 @@ syntax keyword cppSTLconstant WCHAR_MAX
|
||||
if !exists("cpp_no_cpp11")
|
||||
syntax keyword cppSTLtype nullptr_t max_align_t
|
||||
syntax keyword cppSTLtype type_index
|
||||
syntax keyword cppSTLconstant nullptr
|
||||
|
||||
" type_traits
|
||||
syntax keyword cppSTLtype is_void
|
||||
@@ -1052,7 +1054,7 @@ if !exists("cpp_no_cpp11")
|
||||
syntax keyword cppSTLconstant FLT_EVAL_METHOD
|
||||
|
||||
" complex
|
||||
syntax keyword cppSTLfunction proj
|
||||
"syntax keyword cppSTLfunction proj
|
||||
|
||||
" random
|
||||
syntax keyword cppSTLtype linear_congruential_engine
|
||||
|
||||
6
after/syntax/json.vim
Normal file
6
after/syntax/json.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', 'none', 'jsonString')
|
||||
6
after/syntax/yaml.vim
Normal file
6
after/syntax/yaml.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('hex', 'extended', 'yamlComment,yamlFlowString,yamlPlainScalar')
|
||||
@@ -704,7 +704,9 @@ class VimRubyCompletion
|
||||
cv = eval("self.class.constants")
|
||||
vartype = get_var_type( receiver )
|
||||
dprint "vartype: %s" % vartype
|
||||
if vartype != ''
|
||||
|
||||
invalid_vartype = ['', "gets"]
|
||||
if !invalid_vartype.include?(vartype)
|
||||
load_buffer_class( vartype )
|
||||
|
||||
begin
|
||||
@@ -732,7 +734,7 @@ class VimRubyCompletion
|
||||
methods.concat m.instance_methods(false)
|
||||
}
|
||||
end
|
||||
variables += add_rails_columns( "#{vartype}" ) if vartype && vartype.length > 0
|
||||
variables += add_rails_columns( "#{vartype}" ) if vartype && !invalid_vartype.include?(vartype)
|
||||
|
||||
when /^\(?\s*[A-Za-z0-9:^@.%\/+*\(\)]+\.\.\.?[A-Za-z0-9:^@.%\/+*\(\)]+\s*\)?\.([^.]*)/
|
||||
message = $1
|
||||
|
||||
2
build
2
build
@@ -93,6 +93,7 @@ PACKS="
|
||||
jade:digitaltoad/vim-jade
|
||||
jasmine:glanotte/vim-jasmine
|
||||
javascript:pangloss/vim-javascript
|
||||
julia:dcjones/julia-minimalist-vim
|
||||
json:sheerun/vim-json
|
||||
jst:briancollins/vim-jst
|
||||
latex:LaTeX-Box-Team/LaTeX-Box
|
||||
@@ -110,6 +111,7 @@ PACKS="
|
||||
protobuf:uarun/vim-protobuf
|
||||
python:mitsuhiko/vim-python-combined
|
||||
r-lang:vim-scripts/R.vim
|
||||
ragel:jneen/ragel.vim
|
||||
rspec:sheerun/rspec.vim
|
||||
ruby:vim-ruby/vim-ruby
|
||||
rust:wting/rust.vim
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
au BufRead,BufNewFile *.ino,*.pde set filetype=arduino
|
||||
au BufNewFile,BufRead *.blade.php set filetype=blade
|
||||
autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn setlocal filetype=clojure
|
||||
autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn,*.cljx,*.cljc setlocal filetype=clojure
|
||||
autocmd BufNewFile,BufRead *.coffee set filetype=coffee
|
||||
autocmd BufNewFile,BufRead *Cakefile set filetype=coffee
|
||||
autocmd BufNewFile,BufRead *.coffeekup,*.ck set filetype=coffee
|
||||
@@ -83,6 +83,8 @@ au BufNewFile,BufRead *.jst set filetype=jst
|
||||
au BufNewFile,BufRead *.djs set filetype=jst
|
||||
au BufNewFile,BufRead *.hamljs set filetype=jst
|
||||
au BufNewFile,BufRead *.ect set filetype=jst
|
||||
au BufRead,BufNewFile *.jl let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lisp<"
|
||||
au BufRead,BufNewFile *.jl set filetype=julia
|
||||
autocmd BufNewFile,BufRead *.less setf less
|
||||
au BufNewFile,BufRead *.liquid set ft=liquid
|
||||
au BufNewFile,BufRead */_layouts/*.html,*/_includes/*.html set ft=liquid
|
||||
@@ -130,7 +132,7 @@ function! s:DetectPerl6()
|
||||
endif
|
||||
if line =~ '^\s*\%(use\s\+\)\=v6\%(\.\d\%(\.\d\)\=\)\=;'
|
||||
set filetype=perl6 " we matched a 'use v6' declaration
|
||||
elseif line =~ '^\s*\%(\%(my\|our\)\s\+\)\=\(module\|class\|role\|enum\|grammar\)'
|
||||
elseif line =~ '^\s*\%(\%(my\|our\)\s\+\)\=\%(unit\s\+\)\=\(module\|class\|role\|enum\|grammar\)'
|
||||
set filetype=perl6 " we found a class, role, module, enum, or grammar declaration
|
||||
endif
|
||||
break " we either found what we needed, or we found a non-POD, non-comment,
|
||||
|
||||
@@ -179,7 +179,13 @@ function! LatexBox_GetTexRoot()
|
||||
return fnamemodify(LatexBox_GetMainTexFile(), ':h')
|
||||
endfunction
|
||||
|
||||
function! LatexBox_GetTexBasename(with_dir)
|
||||
function! LatexBox_GetBuildBasename(with_dir)
|
||||
" 1. Check for g:LatexBox_jobname
|
||||
if exists('g:LatexBox_jobname')
|
||||
return g:LatexBox_jobname
|
||||
endif
|
||||
|
||||
" 2. Get the basename from the main tex file
|
||||
if a:with_dir
|
||||
return fnamemodify(LatexBox_GetMainTexFile(), ':r')
|
||||
else
|
||||
@@ -190,48 +196,48 @@ endfunction
|
||||
function! LatexBox_GetAuxFile()
|
||||
" 1. check for b:build_dir variable
|
||||
if exists('b:build_dir') && isdirectory(b:build_dir)
|
||||
return b:build_dir . '/' . LatexBox_GetTexBasename(0) . '.aux'
|
||||
return b:build_dir . '/' . LatexBox_GetBuildBasename(0) . '.aux'
|
||||
endif
|
||||
|
||||
" 2. check for g:LatexBox_build_dir variable
|
||||
if exists('g:LatexBox_build_dir') && isdirectory(g:LatexBox_build_dir)
|
||||
return g:LatexBox_build_dir . '/' . LatexBox_GetTexBasename(0) . '.aux'
|
||||
return g:LatexBox_build_dir . '/' . LatexBox_GetBuildBasename(0) . '.aux'
|
||||
endif
|
||||
|
||||
" 3. use the base name of main tex file
|
||||
return LatexBox_GetTexBasename(1) . '.aux'
|
||||
return LatexBox_GetBuildBasename(1) . '.aux'
|
||||
endfunction
|
||||
|
||||
function! LatexBox_GetLogFile()
|
||||
" 1. check for b:build_dir variable
|
||||
if exists('b:build_dir') && isdirectory(b:build_dir)
|
||||
return b:build_dir . '/' . LatexBox_GetTexBasename(0) . '.log'
|
||||
return b:build_dir . '/' . LatexBox_GetBuildBasename(0) . '.log'
|
||||
endif
|
||||
|
||||
" 2. check for g:LatexBox_build_dir variable
|
||||
if exists('g:LatexBox_build_dir') && isdirectory(g:LatexBox_build_dir)
|
||||
return g:LatexBox_build_dir . '/' . LatexBox_GetTexBasename(0) . '.log'
|
||||
return g:LatexBox_build_dir . '/' . LatexBox_GetBuildBasename(0) . '.log'
|
||||
endif
|
||||
|
||||
" 3. use the base name of main tex file
|
||||
return LatexBox_GetTexBasename(1) . '.log'
|
||||
return LatexBox_GetBuildBasename(1) . '.log'
|
||||
endfunction
|
||||
|
||||
function! LatexBox_GetOutputFile()
|
||||
" 1. check for b:build_dir variable
|
||||
if exists('b:build_dir') && isdirectory(b:build_dir)
|
||||
return b:build_dir . '/' . LatexBox_GetTexBasename(0)
|
||||
return b:build_dir . '/' . LatexBox_GetBuildBasename(0)
|
||||
\ . '.' . g:LatexBox_output_type
|
||||
endif
|
||||
|
||||
" 2. check for g:LatexBox_build_dir variable
|
||||
if exists('g:LatexBox_build_dir') && isdirectory(g:LatexBox_build_dir)
|
||||
return g:LatexBox_build_dir . '/' . LatexBox_GetTexBasename(0)
|
||||
return g:LatexBox_build_dir . '/' . LatexBox_GetBuildBasename(0)
|
||||
\ . '.' . g:LatexBox_output_type
|
||||
endif
|
||||
|
||||
" 3. use the base name of main tex file
|
||||
return LatexBox_GetTexBasename(1) . '.' . g:LatexBox_output_type
|
||||
return LatexBox_GetBuildBasename(1) . '.' . g:LatexBox_output_type
|
||||
endfunction
|
||||
" }}}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ if !exists('g:LatexBox_cite_pattern')
|
||||
let g:LatexBox_cite_pattern = '\C\\\a*cite\a*\*\?\(\[[^\]]*\]\)*\_\s*{'
|
||||
endif
|
||||
if !exists('g:LatexBox_ref_pattern')
|
||||
let g:LatexBox_ref_pattern = '\C\\v\?\(eq\|page\|[cC]\|labelc\|name\)\?ref\*\?\_\s*{'
|
||||
let g:LatexBox_ref_pattern = '\C\\v\?\(eq\|page\|[cC]\|labelc\|name\|auto\)\?ref\*\?\_\s*{'
|
||||
endif
|
||||
|
||||
if !exists('g:LatexBox_completion_environments')
|
||||
|
||||
@@ -141,7 +141,7 @@ endfunction
|
||||
|
||||
function! LatexBox_Latexmk(force)
|
||||
" Define often used names
|
||||
let basepath = LatexBox_GetTexBasename(1)
|
||||
let basepath = LatexBox_GetBuildBasename(1)
|
||||
let basename = fnamemodify(basepath, ':t')
|
||||
let texroot = shellescape(LatexBox_GetTexRoot())
|
||||
let mainfile = fnameescape(fnamemodify(LatexBox_GetMainTexFile(), ':t'))
|
||||
@@ -369,7 +369,7 @@ function! LatexBox_LatexmkClean(cleanall)
|
||||
return
|
||||
endif
|
||||
|
||||
let basename = LatexBox_GetTexBasename(1)
|
||||
let basename = LatexBox_GetBuildBasename(1)
|
||||
|
||||
if has_key(g:latexmk_running_pids, basename)
|
||||
echomsg "don't clean when latexmk is running"
|
||||
@@ -502,7 +502,7 @@ function! LatexBox_LatexmkStatus(detailed)
|
||||
echo "latexmk is running (" . plist . ")"
|
||||
endif
|
||||
else
|
||||
let basename = LatexBox_GetTexBasename(1)
|
||||
let basename = LatexBox_GetBuildBasename(1)
|
||||
if has_key(g:latexmk_running_pids, basename)
|
||||
echo "latexmk is running"
|
||||
else
|
||||
@@ -516,12 +516,12 @@ endfunction
|
||||
function! LatexBox_LatexmkStop(silent)
|
||||
if empty(g:latexmk_running_pids)
|
||||
if !a:silent
|
||||
let basepath = LatexBox_GetTexBasename(1)
|
||||
let basepath = LatexBox_GetBuildBasename(1)
|
||||
let basename = fnamemodify(basepath, ':t')
|
||||
echoerr "latexmk is not running for `" . basename . "'"
|
||||
endif
|
||||
else
|
||||
let basepath = LatexBox_GetTexBasename(1)
|
||||
let basepath = LatexBox_GetBuildBasename(1)
|
||||
let basename = fnamemodify(basepath, ':t')
|
||||
if has_key(g:latexmk_running_pids, basepath)
|
||||
call s:kill_latexmk_process(g:latexmk_running_pids[basepath])
|
||||
|
||||
@@ -13,12 +13,13 @@ let b:did_ftplugin = 1
|
||||
let b:undo_ftplugin = "setl cms< def< inc< inex< ofu< sua<"
|
||||
|
||||
setlocal iskeyword+=-
|
||||
setlocal commentstring=//\ %s
|
||||
setlocal commentstring=//%s
|
||||
setlocal define=^\\s*\\%(@mixin\\\|=\\)
|
||||
setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','')
|
||||
setlocal omnifunc=csscomplete#CompleteCSS
|
||||
setlocal suffixesadd=.less
|
||||
setlocal comments=s1:/*,mb:*,ex:*/
|
||||
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,://
|
||||
setlocal fo=jcroql
|
||||
|
||||
let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ if !exists('g:ruby_version_paths')
|
||||
let g:ruby_version_paths = {}
|
||||
endif
|
||||
|
||||
function! s:query_path(root)
|
||||
function! s:query_path(root) abort
|
||||
let code = "print $:.join %q{,}"
|
||||
if &shell =~# 'sh'
|
||||
let prefix = 'env PATH='.shellescape($PATH).' '
|
||||
@@ -92,7 +92,7 @@ function! s:query_path(root)
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
function! s:build_path(path)
|
||||
function! s:build_path(path) abort
|
||||
let path = join(map(copy(a:path), 'v:val ==# "." ? "" : v:val'), ',')
|
||||
if &g:path !~# '\v^\.%(,/%(usr|emx)/include)=,,$'
|
||||
let path = substitute(&g:path,',,$',',','') . ',' . path
|
||||
@@ -146,7 +146,22 @@ let b:undo_ftplugin = "setl fo< inc< inex< sua< def< com< cms< path< tags< kp<"
|
||||
\."| if exists('&ofu') && has('ruby') | setl ofu< | endif"
|
||||
\."| if has('balloon_eval') && exists('+bexpr') | setl bexpr< | endif"
|
||||
|
||||
function! s:map(mode, flags, map) abort
|
||||
let from = matchstr(a:map, '\S\+')
|
||||
if empty(mapcheck(from, a:mode))
|
||||
exe a:mode.'map' '<buffer>'.(a:0 ? a:1 : '') a:map
|
||||
let b:undo_ftplugin .= '|sil! '.a:mode.'unmap <buffer> '.from
|
||||
endif
|
||||
endfunction
|
||||
|
||||
cmap <buffer><script><expr> <Plug><cword> substitute(RubyCursorIdentifier(),'^$',"\022\027",'')
|
||||
cmap <buffer><script><expr> <Plug><cfile> substitute(RubyCursorFile(),'^$',"\022\006",'')
|
||||
let b:undo_ftplugin .= "| sil! cunmap <buffer> <Plug><cword>| sil! cunmap <buffer> <Plug><cfile>"
|
||||
|
||||
if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
|
||||
nmap <buffer><script> <SID>: :<C-U>
|
||||
nmap <buffer><script> <SID>c: :<C-U><C-R>=v:count ? v:count : ''<CR>
|
||||
|
||||
nnoremap <silent> <buffer> [m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','b','n')<CR>
|
||||
nnoremap <silent> <buffer> ]m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','','n')<CR>
|
||||
nnoremap <silent> <buffer> [M :<C-U>call <SID>searchsyn('\<end\>','rubyDefine','b','n')<CR>
|
||||
@@ -189,34 +204,24 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
|
||||
\."| sil! exe 'xunmap <buffer> iM' | sil! exe 'xunmap <buffer> aM'"
|
||||
endif
|
||||
|
||||
if maparg("\<C-]>",'n') == ''
|
||||
cnoremap <buffer> <SID>foldopen <Bar>if &foldopen =~# 'tag'<Bar>exe 'norm! zv'<Bar>endif
|
||||
nnoremap <silent> <script> <buffer> <C-]> :<C-U>exe v:count1."tag <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
|
||||
nnoremap <silent> <script> <buffer> g<C-]> :<C-U>exe "tjump <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
|
||||
nnoremap <silent> <script> <buffer> g] :<C-U>exe "tselect <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
|
||||
nnoremap <silent> <script> <buffer> <C-W>] :<C-U>exe v:count1."stag <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
|
||||
nnoremap <silent> <script> <buffer> <C-W><C-]> :<C-U>exe v:count1."stag <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
|
||||
nnoremap <silent> <script> <buffer> <C-W>g<C-]> :<C-U>exe "stjump <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
|
||||
nnoremap <silent> <script> <buffer> <C-W>g] :<C-U>exe "stselect <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
|
||||
nnoremap <silent> <script> <buffer> <C-W>} :<C-U>exe "ptag <C-R>=RubyCursorIdentifier()<CR>"<CR>
|
||||
nnoremap <silent> <script> <buffer> <C-W>g} :<C-U>exe "ptjump <C-R>=RubyCursorIdentifier()<CR>"<CR>
|
||||
let b:undo_ftplugin = b:undo_ftplugin
|
||||
\."| sil! exe 'nunmap <buffer> <C-]>'| sil! exe 'nunmap <buffer> g<C-]>'| sil! exe 'nunmap <buffer> g]'"
|
||||
\."| sil! exe 'nunmap <buffer> <C-W>]'| sil! exe 'nunmap <buffer> <C-W><C-]>'"
|
||||
\."| sil! exe 'nunmap <buffer> <C-W>g<C-]>'| sil! exe 'nunmap <buffer> <C-W>g]'"
|
||||
\."| sil! exe 'nunmap <buffer> <C-W>}'| sil! exe 'nunmap <buffer> <C-W>g}'"
|
||||
endif
|
||||
call s:map('c', '', '<C-R><C-W> <Plug><cword>')
|
||||
call s:map('c', '', '<C-R><C-F> <Plug><cfile>')
|
||||
|
||||
if maparg("gf",'n') == ''
|
||||
" By using findfile() rather than gf's normal behavior, we prevent
|
||||
" erroneously editing a directory.
|
||||
nnoremap <silent> <buffer> gf :<C-U>exe <SID>gf(v:count1,"gf",'edit')<CR>
|
||||
nnoremap <silent> <buffer> <C-W>f :<C-U>exe <SID>gf(v:count1,"\<Lt>C-W>f",'split')<CR>
|
||||
nnoremap <silent> <buffer> <C-W><C-F> :<C-U>exe <SID>gf(v:count1,"\<Lt>C-W>\<Lt>C-F>",'split')<CR>
|
||||
nnoremap <silent> <buffer> <C-W>gf :<C-U>exe <SID>gf(v:count1,"\<Lt>C-W>gf",'tabedit')<CR>
|
||||
let b:undo_ftplugin = b:undo_ftplugin
|
||||
\."| sil! exe 'nunmap <buffer> gf' | sil! exe 'nunmap <buffer> <C-W>f' | sil! exe 'nunmap <buffer> <C-W><C-F>' | sil! exe 'nunmap <buffer> <C-W>gf'"
|
||||
endif
|
||||
nmap <buffer><script><expr> <SID>tagzv &foldopen =~# 'tag' ? 'zv' : ''
|
||||
call s:map('n', '<silent>', '<C-]> <SID>c:tag <Plug><cword><CR><SID>tagzv')
|
||||
call s:map('n', '<silent>', 'g<C-]> <SID>:tjump <Plug><cword><CR><SID>tagzv')
|
||||
call s:map('n', '<silent>', 'g] <SID>:tselect <Plug><cword><CR><SID>tagzv')
|
||||
call s:map('n', '<silent>', '<C-W>] <SID>c:stag <Plug><cword><CR><SID>tagzv')
|
||||
call s:map('n', '<silent>', '<C-W><C-]> <SID>c:stag <Plug><cword><CR><SID>tagzv')
|
||||
call s:map('n', '<silent>', '<C-W>g<C-]> <SID>:stjump <Plug><cword><CR><SID>tagzv')
|
||||
call s:map('n', '<silent>', '<C-W>g] <SID>:stselect <Plug><cword><CR><SID>tagzv')
|
||||
call s:map('n', '<silent>', '<C-W>} <SID>c:ptag <Plug><cword><CR>')
|
||||
call s:map('n', '<silent>', '<C-W>g} <SID>:ptjump <Plug><cword><CR>')
|
||||
|
||||
call s:map('n', '<silent>', 'gf <SID>c:find <Plug><cfile><CR>')
|
||||
call s:map('n', '<silent>', '<C-W>f <SID>c:sfind <Plug><cfile><CR>')
|
||||
call s:map('n', '<silent>', '<C-W><C-F> <SID>c:sfind <Plug><cfile><CR>')
|
||||
call s:map('n', '<silent>', '<C-W>gf <SID>c:tabfind <Plug><cfile><CR>')
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
@@ -227,7 +232,7 @@ if exists("g:did_ruby_ftplugin_functions")
|
||||
endif
|
||||
let g:did_ruby_ftplugin_functions = 1
|
||||
|
||||
function! RubyBalloonexpr()
|
||||
function! RubyBalloonexpr() abort
|
||||
if !exists('s:ri_found')
|
||||
let s:ri_found = executable('ri')
|
||||
endif
|
||||
@@ -276,7 +281,7 @@ function! RubyBalloonexpr()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:searchsyn(pattern,syn,flags,mode)
|
||||
function! s:searchsyn(pattern, syn, flags, mode) abort
|
||||
let cnt = v:count1
|
||||
norm! m'
|
||||
if a:mode ==# 'v'
|
||||
@@ -298,11 +303,11 @@ function! s:searchsyn(pattern,syn,flags,mode)
|
||||
endwhile
|
||||
endfunction
|
||||
|
||||
function! s:synname()
|
||||
function! s:synname() abort
|
||||
return synIDattr(synID(line('.'),col('.'),0),'name')
|
||||
endfunction
|
||||
|
||||
function! s:wrap_i(back,forward)
|
||||
function! s:wrap_i(back,forward) abort
|
||||
execute 'norm k'.a:forward
|
||||
let line = line('.')
|
||||
execute 'norm '.a:back
|
||||
@@ -312,7 +317,7 @@ function! s:wrap_i(back,forward)
|
||||
execute 'norm jV'.a:forward.'k'
|
||||
endfunction
|
||||
|
||||
function! s:wrap_a(back,forward)
|
||||
function! s:wrap_a(back,forward) abort
|
||||
execute 'norm '.a:forward
|
||||
if line('.') < line('$') && getline(line('.')+1) ==# ''
|
||||
let after = 1
|
||||
@@ -330,37 +335,55 @@ function! s:wrap_a(back,forward)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! RubyCursorIdentifier()
|
||||
function! RubyCursorIdentifier() abort
|
||||
let asciicode = '\%(\w\|[]})\"'."'".']\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)'
|
||||
let number = '\%(\%(\w\|[]})\"'."'".']\s*\)\@<!-\)\=\%(\<[[:digit:]_]\+\%(\.[[:digit:]_]\+\)\=\%([Ee][[:digit:]_]\+\)\=\>\|\<0[xXbBoOdD][[:xdigit:]_]\+\>\)\|'.asciicode
|
||||
let operator = '\%(\[\]\|<<\|<=>\|[!<>]=\=\|===\=\|[!=]\~\|>>\|\*\*\|\.\.\.\=\|=>\|[~^&|*/%+-]\)'
|
||||
let method = '\%(\<[_a-zA-Z]\w*\>\%([?!]\|\s*=>\@!\)\=\)'
|
||||
let method = '\%(\.[_a-zA-Z]\w*\s*=>\@!\|\<[_a-zA-Z]\w*\>[?!]\=\)'
|
||||
let global = '$\%([!$&"'."'".'*+,./:;<=>?@\`~]\|-\=\w\+\>\)'
|
||||
let symbolizable = '\%(\%(@@\=\)\w\+\>\|'.global.'\|'.method.'\|'.operator.'\)'
|
||||
let pattern = '\C\s*\%('.number.'\|\%(:\@<!:\)\='.symbolizable.'\)'
|
||||
let [lnum, col] = searchpos(pattern,'bcn',line('.'))
|
||||
let raw = matchstr(getline('.')[col-1 : ],pattern)
|
||||
let stripped = substitute(substitute(raw,'\s\+=$','=',''),'^\s*:\=','','')
|
||||
let stripped = substitute(substitute(raw,'\s\+=$','=',''),'^\s*[:.]\=','','')
|
||||
return stripped == '' ? expand("<cword>") : stripped
|
||||
endfunction
|
||||
|
||||
function! s:gf(count,map,edit) abort
|
||||
if getline('.') =~# '^\s*require_relative\s*\(["'']\).*\1\s*$'
|
||||
let target = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1')
|
||||
return a:edit.' %:h/'.target.'.rb'
|
||||
elseif getline('.') =~# '^\s*\%(require[( ]\|load[( ]\|autoload[( ]:\w\+,\)\s*\s*\%(::\)\=File\.expand_path(\(["'']\)\.\./.*\1,\s*__FILE__)\s*$'
|
||||
let target = matchstr(getline('.'),'\(["'']\)\.\./\zs.\{-\}\ze\1')
|
||||
return a:edit.' %:h/'.target.'.rb'
|
||||
function! RubyCursorFile() abort
|
||||
let isfname = &isfname
|
||||
try
|
||||
set isfname+=:
|
||||
let cfile = expand('<cfile>')
|
||||
finally
|
||||
let isfname = &isfname
|
||||
endtry
|
||||
let pre = matchstr(strpart(getline('.'), 0, col('.')-1), '.*\f\@<!')
|
||||
let post = matchstr(strpart(getline('.'), col('.')), '\f\@!.*')
|
||||
let ext = getline('.') =~# '^\s*\%(require\|autoload\)\>' ? '.rb' : ''
|
||||
if s:synname() ==# 'rubyConstant'
|
||||
let cfile = substitute(cfile,'\.\w\+[?!=]\=$','','')
|
||||
let cfile = substitute(cfile,'::','/','g')
|
||||
let cfile = substitute(cfile,'\(\u\+\)\(\u\l\)','\1_\2', 'g')
|
||||
let cfile = substitute(cfile,'\(\l\|\d\)\(\u\)','\1_\2', 'g')
|
||||
return tolower(cfile) . '.rb'
|
||||
elseif getline('.') =~# '^\s*require_relative\s*\(["'']\).*\1\s*$'
|
||||
let cfile = expand('%:p:h') . '/' . matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1') . '.rb'
|
||||
elseif getline('.') =~# '^\s*\%(require[( ]\|load[( ]\|autoload[( ]:\w\+,\)\s*\%(::\)\=File\.expand_path(\(["'']\)\.\./.*\1,\s*__FILE__)\s*$'
|
||||
let target = matchstr(getline('.'),'\(["'']\)\.\.\zs/.\{-\}\ze\1')
|
||||
let cfile = expand('%:p:h') . target . ext
|
||||
elseif getline('.') =~# '^\s*\%(require \|load \|autoload :\w\+,\)\s*\(["'']\).*\1\s*$'
|
||||
let target = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1')
|
||||
let cfile = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1') . ext
|
||||
elseif pre.post =~# '\<File.expand_path[( ].*[''"]\{2\}, *__FILE__\>' && cfile =~# '^\.\.'
|
||||
let cfile = expand('%:p:h') . strpart(cfile, 2)
|
||||
else
|
||||
let target = expand('<cfile>')
|
||||
return substitute(cfile, '\C\v^(.*):(\d+)%(:in)=$', '+\2 \1', '')
|
||||
endif
|
||||
let found = findfile(target, &path, a:count)
|
||||
if found ==# ''
|
||||
return 'norm! '.a:count.a:map
|
||||
let cwdpat = '^\M' . substitute(getcwd(), '[\/]', '\\[\\/]', 'g').'\ze\[\/]'
|
||||
let cfile = substitute(cfile, cwdpat, '.', '')
|
||||
if fnameescape(cfile) !=# cfile
|
||||
return '+ '.fnameescape(cfile)
|
||||
else
|
||||
return a:edit.' '.fnameescape(found)
|
||||
return cfile
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
198
indent/julia.vim
Normal file
198
indent/julia.vim
Normal file
@@ -0,0 +1,198 @@
|
||||
" Vim indent file
|
||||
" Language: Julia
|
||||
" Maintainer: Carlo Baldassi <carlobaldassi@gmail.com>
|
||||
" Last Change: 2011 dec 11
|
||||
" Notes: based on Bram Moneaar's indent file for vim
|
||||
|
||||
setlocal autoindent
|
||||
|
||||
setlocal indentexpr=GetJuliaIndent()
|
||||
setlocal indentkeys+==end,=else,=catch,=finally
|
||||
setlocal indentkeys-=0#
|
||||
setlocal indentkeys-=:
|
||||
setlocal indentkeys-=0{
|
||||
setlocal indentkeys-=0}
|
||||
setlocal nosmartindent
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetJuliaIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:skipPatterns = '\<julia\%(Comment\)\>'
|
||||
|
||||
function JuliaMatch(lnum, str, regex, st)
|
||||
let s = a:st
|
||||
while 1
|
||||
let f = match(a:str, a:regex, s)
|
||||
if f >= 0
|
||||
let attr = synIDattr(synID(a:lnum,f+1,1),"name")
|
||||
if attr =~ s:skipPatterns
|
||||
let s = f+1
|
||||
continue
|
||||
endif
|
||||
endif
|
||||
break
|
||||
endwhile
|
||||
return f
|
||||
endfunction
|
||||
|
||||
function GetJuliaNestingStruct(lnum)
|
||||
" Auxiliary function to inspect the block structure of a line
|
||||
let line = getline(a:lnum)
|
||||
let s = 0
|
||||
let blocks_stack = []
|
||||
let num_closed_blocks = 0
|
||||
while 1
|
||||
let fb = JuliaMatch(a:lnum, line, '@\@<!\<\%(if\|else\%(if\)\=\|while\|for\|try\|catch\|finally\|function\|macro\|begin\|type\|immutable\|let\|\%(bare\)\?module\|quote\|do\)\>', s)
|
||||
let fe = JuliaMatch(a:lnum, line, '@\@<!\<end\>', s)
|
||||
|
||||
if fb < 0 && fe < 0
|
||||
" No blocks found
|
||||
break
|
||||
end
|
||||
|
||||
if fb >= 0 && (fb < fe || fe < 0)
|
||||
" The first occurrence is an opening block keyword
|
||||
" Note: some keywords (elseif,else,catch,finally) are both
|
||||
" closing blocks and opening new ones
|
||||
|
||||
let i = JuliaMatch(a:lnum, line, '@\@<!\<if\>', s)
|
||||
if i >= 0 && i == fb
|
||||
let s = i+1
|
||||
call add(blocks_stack, 'if')
|
||||
continue
|
||||
endif
|
||||
let i = JuliaMatch(a:lnum, line, '@\@<!\<elseif\>', s)
|
||||
if i >= 0 && i == fb
|
||||
let s = i+1
|
||||
if len(blocks_stack) > 0 && blocks_stack[-1] == 'if'
|
||||
let blocks_stack[-1] = 'elseif'
|
||||
elseif (len(blocks_stack) > 0 && blocks_stack[-1] != 'elseif') || len(blocks_stack) == 0
|
||||
call add(blocks_stack, 'elseif')
|
||||
let num_closed_blocks += 1
|
||||
endif
|
||||
continue
|
||||
endif
|
||||
let i = JuliaMatch(a:lnum, line, '@\@<!\<else\>', s)
|
||||
if i >= 0 && i == fb
|
||||
let s = i+1
|
||||
if len(blocks_stack) > 0 && blocks_stack[-1] =~ '\<\%(else\)\=if\>'
|
||||
let blocks_stack[-1] = 'else'
|
||||
else
|
||||
call add(blocks_stack, 'else')
|
||||
let num_closed_blocks += 1
|
||||
endif
|
||||
continue
|
||||
endif
|
||||
|
||||
let i = JuliaMatch(a:lnum, line, '@\@<!\<try\>', s)
|
||||
if i >= 0 && i == fb
|
||||
let s = i+1
|
||||
call add(blocks_stack, 'try')
|
||||
continue
|
||||
endif
|
||||
let i = JuliaMatch(a:lnum, line, '@\@<!\<catch\>', s)
|
||||
if i >= 0 && i == fb
|
||||
let s = i+1
|
||||
if len(blocks_stack) > 0 && blocks_stack[-1] == 'try'
|
||||
let blocks_stack[-1] = 'catch'
|
||||
else
|
||||
call add(blocks_stack, 'catch')
|
||||
let num_closed_blocks += 1
|
||||
endif
|
||||
continue
|
||||
endif
|
||||
let i = JuliaMatch(a:lnum, line, '@\@<!\<finally\>', s)
|
||||
if i >= 0 && i == fb
|
||||
let s = i+1
|
||||
if len(blocks_stack) > 0 && (blocks_stack[-1] == 'try' || blocks_stack[-1] == 'catch')
|
||||
let blocks_stack[-1] = 'finally'
|
||||
else
|
||||
call add(blocks_stack, 'finally')
|
||||
let num_closed_blocks += 1
|
||||
endif
|
||||
continue
|
||||
endif
|
||||
|
||||
let i = JuliaMatch(a:lnum, line, '@\@<!\<\%(bare\)\?module\>', s)
|
||||
if i >= 0 && i == fb
|
||||
let s = i+1
|
||||
if i == 0
|
||||
call add(blocks_stack, 'col1module')
|
||||
else
|
||||
call add(blocks_stack, 'other')
|
||||
endif
|
||||
continue
|
||||
endif
|
||||
|
||||
let i = JuliaMatch(a:lnum, line, '@\@<!\<\%(while\|for\|function\|macro\|begin\|type\|immutable\|let\|quote\|do\)\>', s)
|
||||
if i >= 0 && i == fb
|
||||
let s = i+1
|
||||
call add(blocks_stack, 'other')
|
||||
continue
|
||||
endif
|
||||
|
||||
" Note: it should be impossible to get here
|
||||
break
|
||||
|
||||
else
|
||||
" The first occurrence is an 'end'
|
||||
|
||||
let s = fe+1
|
||||
if len(blocks_stack) == 0
|
||||
let num_closed_blocks += 1
|
||||
else
|
||||
call remove(blocks_stack, -1)
|
||||
endif
|
||||
continue
|
||||
|
||||
endif
|
||||
|
||||
" Note: it should be impossible to get here
|
||||
break
|
||||
endwhile
|
||||
let num_open_blocks = len(blocks_stack) - count(blocks_stack, 'col1module')
|
||||
return [num_open_blocks, num_closed_blocks]
|
||||
endfunction
|
||||
|
||||
function GetJuliaIndent()
|
||||
let s:save_ignorecase = &ignorecase
|
||||
set noignorecase
|
||||
|
||||
" Find a non-blank line above the current line.
|
||||
let lnum = prevnonblank(v:lnum - 1)
|
||||
|
||||
" At the start of the file use zero indent.
|
||||
if lnum == 0
|
||||
let &ignorecase = s:save_ignorecase
|
||||
unlet s:save_ignorecase
|
||||
return 0
|
||||
endif
|
||||
|
||||
let ind = indent(lnum)
|
||||
|
||||
" Analyse previous line
|
||||
let [num_open_blocks, num_closed_blocks] = GetJuliaNestingStruct(lnum)
|
||||
|
||||
" Increase indentation for each newly opened block
|
||||
" in the previous line
|
||||
while num_open_blocks > 0
|
||||
let ind += &sw
|
||||
let num_open_blocks -= 1
|
||||
endwhile
|
||||
|
||||
" Analyse current line
|
||||
let [num_open_blocks, num_closed_blocks] = GetJuliaNestingStruct(v:lnum)
|
||||
|
||||
" Decrease indentation for each closed block
|
||||
" in the current line
|
||||
while num_closed_blocks > 0
|
||||
let ind -= &sw
|
||||
let num_closed_blocks -= 1
|
||||
endwhile
|
||||
|
||||
let &ignorecase = s:save_ignorecase
|
||||
unlet s:save_ignorecase
|
||||
return ind
|
||||
endfunction
|
||||
@@ -226,7 +226,6 @@ syn keyword cssBackgroundAttr contained left center right top bottom
|
||||
" background-repeat attributes
|
||||
syn match cssBackgroundAttr contained "\<no-repeat\>"
|
||||
syn match cssBackgroundAttr contained "\<repeat\(-[xy]\)\=\>"
|
||||
syn keyword cssBackgroundAttr contained space round
|
||||
|
||||
" background-size attributes
|
||||
syn keyword cssBackgroundAttr contained cover contain
|
||||
@@ -238,7 +237,7 @@ syn match cssBorderProp contained "\<box-decoration-break\>"
|
||||
syn match cssBorderProp contained "\<box-shadow\>"
|
||||
|
||||
" border-image attributes
|
||||
syn keyword cssBorderAttr contained stretch round space fill
|
||||
syn keyword cssBorderAttr contained stretch round fill
|
||||
|
||||
" border-style attributes
|
||||
syn keyword cssBorderAttr contained dotted dashed solid double groove ridge inset outset
|
||||
@@ -266,14 +265,18 @@ syn match cssDimensionProp contained "\<\(min\|max\)-\(width\|height\)\>"
|
||||
syn keyword cssDimensionProp contained height
|
||||
syn keyword cssDimensionProp contained width
|
||||
|
||||
" shadow and sizing are in other property groups
|
||||
syn match cssFlexibleBoxProp contained "\<box-\(align\|direction\|flex\|ordinal-group\|orient\|pack\|shadow\|sizing\)\>"
|
||||
syn keyword cssFlexibleBoxAttr contained start end baseline
|
||||
syn keyword cssFlexibleBoxAttr contained reverse
|
||||
syn keyword cssFlexibleBoxAttr contained single multiple
|
||||
syn keyword cssFlexibleBoxAttr contained horizontal
|
||||
syn match cssFlexibleBoxAttr contained "\<vertical\(-align\)\@!\>" "escape vertical-align
|
||||
syn match cssFlexibleBoxAttr contained "\<\(inline\|block\)-axis\>"
|
||||
" CSS Flexible Box Layout Module Level 1
|
||||
" http://www.w3.org/TR/css3-flexbox/
|
||||
" CSS Box Alignment Module Level 3
|
||||
" http://www.w3.org/TR/css-align-3/
|
||||
syn match cssFlexibleBoxProp contained "\<flex\(-\(direction\|wrap\|flow\|grow\|shrink\|basis\)\)\=\>"
|
||||
syn match cssFlexibleBoxProp contained "\<\(align\|justify\)\(-\(items\|self\|content\)\)\=\>"
|
||||
syn keyword cssFlexibleBoxProp contained order
|
||||
|
||||
syn match cssFlexibleBoxAttr contained "\<\(row\|column\|wrap\)\(-reverse\)\=\>"
|
||||
syn keyword cssFlexibleBoxAttr contained nowrap stretch baseline center
|
||||
syn match cssFlexibleBoxAttr contained "\<flex-\(start\|end\)\>"
|
||||
syn match cssFlexibleBoxAttr contained "\<space\(-\(between\|around\)\)\=\>"
|
||||
|
||||
" CSS Fonts Module Level 3
|
||||
" http://www.w3.org/TR/css-fonts-3/
|
||||
@@ -320,6 +323,10 @@ syn match cssMultiColumnAttr contained "\<avoid-\(page\|column\)\>"
|
||||
" http://www.w3.org/TR/css3-break/#page-break
|
||||
syn match cssMultiColumnProp contained "\<page\(-break-\(before\|after\|inside\)\)\=\>"
|
||||
|
||||
" http://www.w3.org/TR/SVG11/interact.html
|
||||
syn match cssInteractProp contained "\<pointer-events\>"
|
||||
syn match cssInteractAttr contained "\<\(visible\)\=\(Painted\|Fill\|Stroke\)\=\>"
|
||||
|
||||
" TODO find following items in w3c docs.
|
||||
syn keyword cssGeneratedContentProp contained quotes crop
|
||||
syn match cssGeneratedContentProp contained "\<counter-\(reset\|increment\)\>"
|
||||
@@ -536,6 +543,7 @@ if version >= 508 || !exists("did_css_syn_inits")
|
||||
HiLink cssAttrComma Special
|
||||
|
||||
HiLink cssAnimationProp cssProp
|
||||
HiLink cssAuralProp cssProp
|
||||
HiLink cssBackgroundProp cssProp
|
||||
HiLink cssBorderProp cssProp
|
||||
HiLink cssBoxProp cssProp
|
||||
@@ -547,13 +555,17 @@ if version >= 508 || !exists("did_css_syn_inits")
|
||||
HiLink cssGeneratedContentProp cssProp
|
||||
HiLink cssGridProp cssProp
|
||||
HiLink cssHyerlinkProp cssProp
|
||||
HiLink cssIEUIProp cssProp
|
||||
HiLink cssInteractProp cssProp
|
||||
HiLink cssLineboxProp cssProp
|
||||
HiLink cssListProp cssProp
|
||||
HiLink cssMarqueeProp cssProp
|
||||
HiLink cssMobileTextProp cssProp
|
||||
HiLink cssMultiColumnProp cssProp
|
||||
HiLink cssPagedMediaProp cssProp
|
||||
HiLink cssPositioningProp cssProp
|
||||
HiLink cssPrintProp cssProp
|
||||
HiLink cssRenderProp cssProp
|
||||
HiLink cssRubyProp cssProp
|
||||
HiLink cssSpeechProp cssProp
|
||||
HiLink cssTableProp cssProp
|
||||
@@ -561,22 +573,22 @@ if version >= 508 || !exists("did_css_syn_inits")
|
||||
HiLink cssTransformProp cssProp
|
||||
HiLink cssTransitionProp cssProp
|
||||
HiLink cssUIProp cssProp
|
||||
HiLink cssIEUIProp cssProp
|
||||
HiLink cssAuralProp cssProp
|
||||
HiLink cssRenderProp cssProp
|
||||
HiLink cssMobileTextProp cssProp
|
||||
|
||||
HiLink cssAnimationAttr cssAttr
|
||||
HiLink cssAuralAttr cssAttr
|
||||
HiLink cssBackgroundAttr cssAttr
|
||||
HiLink cssBorderAttr cssAttr
|
||||
HiLink cssBoxAttr cssAttr
|
||||
HiLink cssContentForPagedMediaAttr cssAttr
|
||||
HiLink cssCommonAttr cssAttr
|
||||
HiLink cssDimensionAttr cssAttr
|
||||
HiLink cssFlexibleBoxAttr cssAttr
|
||||
HiLink cssFontAttr cssAttr
|
||||
HiLink cssGeneratedContentAttr cssAttr
|
||||
HiLink cssGridAttr cssAttr
|
||||
HiLink cssHyerlinkAttr cssAttr
|
||||
HiLink cssIEUIAttr cssAttr
|
||||
HiLink cssInteractAttr cssAttr
|
||||
HiLink cssLineboxAttr cssAttr
|
||||
HiLink cssListAttr cssAttr
|
||||
HiLink cssMarginAttr cssAttr
|
||||
@@ -587,6 +599,7 @@ if version >= 508 || !exists("did_css_syn_inits")
|
||||
HiLink cssPositioningAttr cssAttr
|
||||
HiLink cssGradientAttr cssAttr
|
||||
HiLink cssPrintAttr cssAttr
|
||||
HiLink cssRenderAttr cssAttr
|
||||
HiLink cssRubyAttr cssAttr
|
||||
HiLink cssSpeechAttr cssAttr
|
||||
HiLink cssTableAttr cssAttr
|
||||
@@ -594,10 +607,6 @@ if version >= 508 || !exists("did_css_syn_inits")
|
||||
HiLink cssTransformAttr cssAttr
|
||||
HiLink cssTransitionAttr cssAttr
|
||||
HiLink cssUIAttr cssAttr
|
||||
HiLink cssIEUIAttr cssAttr
|
||||
HiLink cssAuralAttr cssAttr
|
||||
HiLink cssRenderAttr cssAttr
|
||||
HiLink cssCommonAttr cssAttr
|
||||
|
||||
HiLink cssPseudoClassId PreProc
|
||||
HiLink cssPseudoClassLang Constant
|
||||
|
||||
@@ -15,11 +15,20 @@ syn cluster elixirNotTop contains=@elixirRegexSpecial,@elixirStringContained,@el
|
||||
syn match elixirComment '#.*' contains=elixirTodo
|
||||
syn keyword elixirTodo FIXME NOTE TODO OPTIMIZE XXX HACK contained
|
||||
|
||||
syn keyword elixirKeyword is_atom is_binary is_bitstring is_boolean is_float is_function is_integer is_list is_map is_number is_pid is_port is_record is_reference is_tuple is_exception
|
||||
syn keyword elixirKeyword case when cond for if unless try receive send
|
||||
syn keyword elixirKeyword exit raise throw after rescue catch else do end
|
||||
syn keyword elixirKeyword quote unquote super
|
||||
|
||||
" Functions used on guards
|
||||
syn keyword elixirKeyword contained is_atom is_binary is_bitstring is_boolean
|
||||
syn keyword elixirKeyword contained is_float is_function is_integer is_list
|
||||
syn keyword elixirKeyword contained is_map is_number is_pid is_port is_record
|
||||
syn keyword elixirKeyword contained is_reference is_tuple is_exception abs
|
||||
syn keyword elixirKeyword contained bit_size byte_size div elem hd length
|
||||
syn keyword elixirKeyword contained map_size node rem round tl trunc tuple_size
|
||||
|
||||
syn match elixirGuard '.*when.*' contains=ALLBUT,@elixirNotTop
|
||||
|
||||
syn keyword elixirInclude import require alias use
|
||||
|
||||
syn keyword elixirSelf self
|
||||
|
||||
@@ -147,7 +147,7 @@ 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
|
||||
syn match goFormatSpecifier /%[-#0 +]*\%(\*\|\d\+\)\=\%(\.\%(\*\|\d\+\)\)*[vTtbcdoqxXUeEfgGsp]/ contained containedin=goString
|
||||
|
||||
hi def link goString String
|
||||
hi def link goRawString String
|
||||
|
||||
@@ -43,7 +43,7 @@ syn keyword htmlTagName contained missing-glyph mpath
|
||||
syn keyword htmlTagName contained text textPath tref tspan vkern
|
||||
|
||||
" Custom Element
|
||||
syn match htmlTagName contained "\<[a-z_]\+\(\-[a-z_]\+\)\+\>"
|
||||
syn match htmlTagName contained "\<[a-z_]\([a-z0-9_.]\+\)\?\(\-[a-z0-9_.]\+\)\+\>"
|
||||
|
||||
" HTML 5 arguments
|
||||
" Core Attributes
|
||||
|
||||
@@ -53,11 +53,10 @@ syn region jadePipedText matchgroup=jadePipeChar start="|" end="$" contained co
|
||||
syn match jadeTagBlockChar "\.$" contained nextgroup=jadeTagBlockText,jadeTagBlockEnd skipnl
|
||||
syn region jadeTagBlockText start="\%(\s*\)\S" end="\ze\n" contained contains=jadeInterpolation,jadeTextInlineJade nextgroup=jadeTagBlockText,jadeTagBlockEnd skipnl
|
||||
syn region jadeTagBlockEnd start="\s*\S" end="$" contained contains=jadeInterpolation,jadeTextInlineJade nextgroup=jadeBegin skipnl
|
||||
syn region jadeTextInlineJade matchgroup=jadeInlineDelimiter start="#\[" end="]" contained contains=jadeTag keepend
|
||||
syn region jadeTextInlineJade matchgroup=jadeInlineDelimiter start="#\[" end="]" contains=jadeTag keepend
|
||||
|
||||
syn region jadeJavascriptFilter matchgroup=jadeFilter start="^\z(\s*\):javascript\s*$" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlJavascript
|
||||
syn region jadeCoffeescriptFilter matchgroup=jadeFilter start="^\z(\s*\):coffeescript\s*$" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlCoffeescript
|
||||
syn region jadeMarkdownFilter matchgroup=jadeFilter start=/^\z(\s*\):markdown\s*$/ end=/^\%(\z1\s\|\s*$\)\@!/ contains=@htmlMarkdown
|
||||
syn region jadeMarkdownFilter matchgroup=jadeFilter start=/^\z(\s*\):\%(markdown\|marked\)\s*$/ end=/^\%(\z1\s\|\s*$\)\@!/ contains=@htmlMarkdown
|
||||
syn region jadeStylusFilter matchgroup=jadeFilter start="^\z(\s*\):stylus\s*$" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlStylus
|
||||
syn region jadePlainFilter matchgroup=jadeFilter start="^\z(\s*\):\%(sass\|less\|cdata\)\s*$" end="^\%(\z1\s\|\s*$\)\@!"
|
||||
|
||||
@@ -66,7 +65,9 @@ syn match jadeScriptStatement "^\s*\<\%(each\|for\|block\|prepend\|append\|mixi
|
||||
syn region jadeScriptLoopRegion start="^\s*\(for \)" end="$" contains=jadeScriptLoopKeywords
|
||||
syn keyword jadeScriptLoopKeywords for in contained
|
||||
|
||||
syn region jadeJavascript start="^\z(\s*\)script\%(:\w\+\)\=" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlJavascript,jadeJavascriptTag keepend
|
||||
syn region jadeJavascript start="^\z(\s*\)script\%(:\w\+\)\=" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlJavascript,jadeJavascriptTag,jadeCoffeescriptFilter keepend
|
||||
|
||||
syn region jadeCoffeescriptFilter matchgroup=jadeFilter start="^\z(\s*\):coffeescript\s*$" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlCoffeescript contained
|
||||
syn region jadeJavascriptTag contained start="^\z(\s*\)script\%(:\w\+\)\=" end="$" contains=jadeBegin,jadeTag
|
||||
syn region jadeCssBlock start="^\z(\s*\)style" nextgroup=@jadeComponent,jadeError end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlCss keepend
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ if exists("javascript_enable_domhtmlcss")
|
||||
syntax keyword jsCssStyles contained border borderBottom borderLeft borderRight borderTop borderBottomColor borderLeftColor borderTopColor borderBottomStyle borderLeftStyle borderRightStyle borderTopStyle borderBottomWidth borderLeftWidth borderRightWidth borderTopWidth borderColor borderStyle borderWidth borderCollapse borderSpacing captionSide emptyCells tableLayout
|
||||
syntax keyword jsCssStyles contained margin marginBottom marginLeft marginRight marginTop outline outlineColor outlineStyle outlineWidth padding paddingBottom paddingLeft paddingRight paddingTop
|
||||
syntax keyword jsCssStyles contained listStyle listStyleImage listStylePosition listStyleType
|
||||
syntax keyword jsCssStyles contained background backgroundAttachment backgroundColor backgroundImage gackgroundPosition backgroundPositionX backgroundPositionY backgroundRepeat
|
||||
syntax keyword jsCssStyles contained background backgroundAttachment backgroundColor backgroundImage backgroundPosition backgroundPositionX backgroundPositionY backgroundRepeat
|
||||
syntax keyword jsCssStyles contained clear clip clipBottom clipLeft clipRight clipTop content counterIncrement counterReset cssFloat cursor direction display filter layoutGrid layoutGridChar layoutGridLine layoutGridMode layoutGridType
|
||||
syntax keyword jsCssStyles contained marks maxHeight maxWidth minHeight minWidth opacity MozOpacity overflow overflowX overflowY verticalAlign visibility zoom cssText
|
||||
syntax keyword jsCssStyles contained scrollbar3dLightColor scrollbarArrowColor scrollbarBaseColor scrollbarDarkShadowColor scrollbarFaceColor scrollbarHighlightColor scrollbarShadowColor scrollbarTrackColor
|
||||
|
||||
149
syntax/julia.vim
Normal file
149
syntax/julia.vim
Normal file
@@ -0,0 +1,149 @@
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn case match
|
||||
|
||||
|
||||
syn keyword juliaDirective import importall export using require include
|
||||
|
||||
hi def link juliaDirective Include
|
||||
|
||||
syn region juliaDeclTypeBlock transparent matchgroup=juliaDeclType start="\<\%(type\|immutable\)\>" end="\<end\>" contains=ALL
|
||||
syn keyword juliaTypeAlias typealias
|
||||
syn keyword juliaDeclAbstract abstract
|
||||
|
||||
hi def link juliaDeclType Structure
|
||||
hi def link juliaTypeAlias Typedef
|
||||
hi def link juliaDeclAbstract Structure
|
||||
|
||||
" Module
|
||||
syn region juliaModuleBlock transparent matchgroup=juliaModule start="\<module\>" end="\<end\>" contains=ALL
|
||||
|
||||
hi def link juliaModule Structure
|
||||
|
||||
|
||||
" Misc. blocks
|
||||
syn region juliaMiscBlockBlock transparent matchgroup=juliaMiscBlock start="\<\%(quote\|do\|begin\|let\)\>" end="\<end\>" contains=ALL
|
||||
|
||||
hi def link juliaMiscBlock Repeat
|
||||
|
||||
" Braces and Brackets
|
||||
syn region juliaBracketsBlock matchgroup=juliaBrackets start='\[' end='\]' contains=ALLBUT,juliaRepeatBlock contained
|
||||
syn region juliaBracesBlock matchgroup=juliaBraces start='{' end='}' contains=ALLBUT,juliaRepeatBlock contained
|
||||
|
||||
" Repeat
|
||||
syn region juliaRepeatBlock transparent matchgroup=juliaRepeat start="\<\%(while\|for\)\>" end="\<end\>" contains=@juliaTop
|
||||
|
||||
hi def link juliaRepeat Repeat
|
||||
|
||||
" Conditional
|
||||
syn keyword juliaElse else elseif
|
||||
syn region juliaIfBlock transparent matchgroup=juliaIf start="\<if\>" end="\<end\>" contains=@juliaTop
|
||||
|
||||
hi def link juliaElse Conditional
|
||||
hi def link juliaIf Conditional
|
||||
|
||||
|
||||
" try catch end
|
||||
syn keyword juliaCatch catch contained
|
||||
syn region juliaTryBlock transparent matchgroup=juliaTry start="\<try\>" end="\<end\>" contains=@juliaTop
|
||||
|
||||
hi def link juliaTry Exception
|
||||
hi def link juliaCatch Exception
|
||||
|
||||
|
||||
" one word statements
|
||||
syn keyword juliaStatement return continue break
|
||||
|
||||
hi def link juliaStatement Statement
|
||||
|
||||
" misc
|
||||
syn keyword juliaDeclaration const global local
|
||||
syn keyword juliaComprehensionFor for
|
||||
|
||||
hi def link juliaDeclaration Keyword
|
||||
hi def link juliaComprehensionFor Keyword
|
||||
|
||||
" Built in types
|
||||
syn keyword juliaType Uint Uint8 Uint16 Uint32 Uint64 Uint128
|
||||
syn keyword juliaType Int Int8 Int16 Int32 Int64 Int128
|
||||
syn keyword juliaType Float Float16 Float32 Float64
|
||||
syn keyword juliaType AbstractArray AbstractMatrix AbstractVector Array Vector Matrix
|
||||
syn keyword juliaType String ByteString UTF8String SubString
|
||||
syn keyword juliaType Bool Nothing Union Type
|
||||
|
||||
|
||||
hi def link juliaType Type
|
||||
|
||||
|
||||
" Comments
|
||||
syn keyword juliaTodo contained TODO FIXME XXX
|
||||
syn cluster juliaCommentGroup contains=juliaTodo
|
||||
syn region juliaComment start="#" end="$" contains=@juliaCommentGroup,@Spell
|
||||
|
||||
hi def link juliaComment Comment
|
||||
hi def link juliaTodo Todo
|
||||
|
||||
|
||||
" Strings
|
||||
syn region juliaString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@juliaStringGroup,@Spell
|
||||
syn region juliaTripleString start=+"""+ end=+"""+
|
||||
syn region juliaCharacter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@juliaCharacterGroup
|
||||
|
||||
hi def link juliaString String
|
||||
hi def link juliaTripleString String
|
||||
hi def link juliaCharacter Character
|
||||
|
||||
|
||||
" Functions
|
||||
syn region juliaFunctionBlock transparent matchgroup=juliaFunction start="\<\%\(function\|macro\)\>" end="\<end\>" contains=@juliaTop
|
||||
hi def link juliaFunction Function
|
||||
|
||||
|
||||
" Numbers
|
||||
syn match juliaNumber "\<\d\+\([Ee]\d\+\)\?\>"
|
||||
syn match juliaNumber "\<0x\x\+\>"
|
||||
syn match juliaNumber "\<0\o\+\>"
|
||||
|
||||
syn match juliaFloat "\<\d\+\.\d*\([Ee][-+]\d\+\)\?\>"
|
||||
syn match juliaFloat "\<\.\d\+\([Ee][-+]\d\+\)\?\>"
|
||||
syn match juliaFloat "\<\d\+[Ee][-+]\d\+\>"
|
||||
syn keyword juliaFloatSpecial NaN Inf
|
||||
|
||||
hi def link juliaNumber Number
|
||||
hi def link juliaFloat Float
|
||||
hi def link juliaFloatSpecial Float
|
||||
|
||||
|
||||
" Operators
|
||||
syn keyword juliaIn in
|
||||
hi def link juliaIn Operator
|
||||
|
||||
|
||||
" Constants
|
||||
syn keyword juliaBool true false nothing
|
||||
hi def link juliaBool Boolean
|
||||
|
||||
syn keyword juliaIdentifierSpecial STDOUT, STDIN, STDERR
|
||||
|
||||
hi def link juliaIdentifierSpecial Identifier
|
||||
|
||||
|
||||
" Macros
|
||||
syn match juliaMacro display "@[_[:alpha:]][_[:alnum:]!]*\%(\.[_[:alpha:]][_[:alnum:]!]*\)*"
|
||||
|
||||
hi def link juliaMacro Macro
|
||||
|
||||
|
||||
syn cluster juliaTop contains=ALLBUT,juliaComprehensionFor
|
||||
|
||||
" Ragel
|
||||
syn include @ragel syntax/ragel.vim
|
||||
syn region ragelLine start="%%" end="$" contains=@ragel
|
||||
|
||||
|
||||
let b:current_syntax = "julia"
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ if main_syntax ==# 'markdown'
|
||||
unlet! s:type
|
||||
endif
|
||||
|
||||
syn match markdownEscape "\\[][\\`*_{}()#+.!-]"
|
||||
syn match markdownEscape "\\[][\\`*_{}()<>#+.!-]"
|
||||
syn match markdownError "\w\@<=_\w\@="
|
||||
|
||||
hi def link markdownH1 htmlH1
|
||||
|
||||
@@ -52,7 +52,7 @@ set cpo&vim
|
||||
" @@IDENTIFIER@@ "\%(@@IDENT_NONDIGIT@@\%(@@IDENT_CHAR@@\|[-']@@IDENT_NONDIGIT@@\@=\)*\)"
|
||||
" @@IDENTIFIER_START@@ "@@IDENT_CHAR@@\@1<!\%(@@IDENT_NONDIGIT@@[-']\)\@2<!"
|
||||
" @@IDENTIFIER_END@@ "\%(@@IDENT_CHAR@@\|[-']@@IDENT_NONDIGIT@@\)\@!"
|
||||
" @@METAOP@@ #\%(\d\|[@%$][.?^=[:alpha:]]\)\@!\%(\.\|[^[{('".([:space:]]\)\+#
|
||||
" @@METAOP@@ #\%(\d\|[@%$][.?^=[:alpha:]]\)\@!\%(\.\|[^[{('".[:space:]]\)\+#
|
||||
" @@ADVERBS@@ "\%(\_s*:!\?@@IDENTIFIER@@\%(([^)]*)\)\?\)*"
|
||||
"
|
||||
" Same but escaped, for use in string eval
|
||||
@@ -67,7 +67,7 @@ syn match p6Identifier display "\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[
|
||||
|
||||
let s:keywords = {
|
||||
\ "p6DeclareRoutine": [
|
||||
\ "macro sub submethod method multi proto only category",
|
||||
\ "macro sub submethod method multi proto only category unit",
|
||||
\ ],
|
||||
\ "p6Module": [
|
||||
\ "module class role package enum grammar slang subset",
|
||||
@@ -182,7 +182,7 @@ syn match p6Operator display "\%(\s\|^\)\@1<=\%(xx=\|p5=>\)"
|
||||
syn match p6Operator display "\%(&\.(\@=\|@\.\[\@=\|%\.{\@=\)"
|
||||
|
||||
" Reduce metaoperators like [+]
|
||||
syn match p6ReduceOp display "\%(^\|\s\|(\)\@1<=!*\%([RSXZ\[]\)*[&RSXZ]\?\[\+(\?\%(\d\|[@%$][.?^=[:alpha:]]\)\@!\%(\.\|[^[{('".([:space:]]\)\+)\?]\+"
|
||||
syn match p6ReduceOp display "\%(^\|\s\|(\)\@1<=!*\%([RSXZ\[]\)*[&RSXZ]\?\[\+(\?\%(\d\|[@%$][.?^=[:alpha:]]\)\@!\%(\.\|[^[{('".[:space:]]\)\+)\?]\+"
|
||||
syn match p6SetOp display "R\?(\%([-^.+|&]\|[<>][=+]\?\|cont\|elem\))"
|
||||
|
||||
" Reverse, cross, and zip metaoperators
|
||||
@@ -422,10 +422,10 @@ syn region p6InnerFrench
|
||||
" them, but before other types of strings, to avoid matching those delimiters
|
||||
" as parts of hyperops.
|
||||
syn match p6HyperOp display #[^[:digit:][{('",:[:space:]][^[{('",:[:space:]]*\%(«\|<<\)#
|
||||
syn match p6HyperOp display "«\%(\d\|[@%$][.?^=[:alpha:]]\)\@!\%(\.\|[^[{('".([:space:]]\)\+[«»]"
|
||||
syn match p6HyperOp display "»\%(\d\|[@%$][.?^=[:alpha:]]\)\@!\%(\.\|[^[{('".([:space:]]\)\+\%(«\|»\?\)"
|
||||
syn match p6HyperOp display "<<\%(\d\|[@%$][.?^=[:alpha:]]\)\@!\%(\.\|[^[{('".([:space:]]\)\+\%(<<\|>>\)"
|
||||
syn match p6HyperOp display ">>\%(\d\|[@%$][.?^=[:alpha:]]\)\@!\%(\.\|[^[{('".([:space:]]\)\+\%(<<\|\%(>>\)\?\)"
|
||||
syn match p6HyperOp display "«\%(\d\|[@%$][.?^=[:alpha:]]\)\@!\%(\.\|[^[{('".[:space:]]\)\+[«»]"
|
||||
syn match p6HyperOp display "»\%(\d\|[@%$][.?^=[:alpha:]]\)\@!\%(\.\|[^[{('".[:space:]]\)\+\%(«\|»\?\)"
|
||||
syn match p6HyperOp display "<<\%(\d\|[@%$][.?^=[:alpha:]]\)\@!\%(\.\|[^[{('".[:space:]]\)\+\%(<<\|>>\)"
|
||||
syn match p6HyperOp display ">>\%(\d\|[@%$][.?^=[:alpha:]]\)\@!\%(\.\|[^[{('".[:space:]]\)\+\%(<<\|\%(>>\)\?\)"
|
||||
|
||||
" 'string'
|
||||
syn region p6StringSQ
|
||||
@@ -454,8 +454,8 @@ syn match p6QuoteQ_qww display "qww[A-Za-z(]\@!" nextgroup=p6PairsQ_qww skipwhi
|
||||
syn match p6QuoteQ_qq display "qq[pwx]\?[A-Za-z(]\@!" nextgroup=p6PairsQ_qq skipwhite skipempty contained
|
||||
syn match p6QuoteQ_qto display "qto[A-Za-z(]\@!" nextgroup=p6StringQ_qto skipwhite skipempty contained
|
||||
syn match p6QuoteQ_qqto display "qqto[A-Za-z(]\@!" nextgroup=p6StringQ_qqto skipwhite skipempty contained
|
||||
syn match p6QuoteQ_qto display "q\_s*\%(:\%(to\|heredoc\)[A-Za-z(]\@!\)\@=" nextgroup=p6PairsQ_qto skipwhite skipempty contained
|
||||
syn match p6QuoteQ_qqto display "qq\_s*\%(:\%(to\|heredoc\)[A-Za-z(]\@!\)\@=" nextgroup=p6PairsQ_qqto skipwhite skipempty contained
|
||||
syn match p6QuoteQ_qto display "q\_s*\%(\%(\_s*:!\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(([^)]*)\)\?\)*:\%(to\|heredoc\)\%(\_s*:!\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(([^)]*)\)\?\)*(\@!\)\@=" nextgroup=p6PairsQ_qto skipwhite skipempty contained
|
||||
syn match p6QuoteQ_qqto display "qq\_s*\%(\%(\_s*:!\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(([^)]*)\)\?\)*:\%(to\|heredoc\)\%(\_s*:!\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(([^)]*)\)\?\)*(\@!\)\@=" nextgroup=p6PairsQ_qqto skipwhite skipempty contained
|
||||
syn match p6PairsQ "\%(\_s*:!\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(([^)]*)\)\?\)*" contained transparent skipwhite skipempty nextgroup=p6StringQ
|
||||
syn match p6PairsQ_q "\%(\_s*:!\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(([^)]*)\)\?\)*" contained transparent skipwhite skipempty nextgroup=p6StringQ_q
|
||||
syn match p6PairsQ_qww "\%(\_s*:!\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(([^)]*)\)\?\)*" contained transparent skipwhite skipempty nextgroup=p6StringQ_qww
|
||||
@@ -998,7 +998,7 @@ endif
|
||||
syn match p6Attention display "\<\%(ACHTUNG\|ATTN\|ATTENTION\|FIXME\|NB\|TODO\|TBD\|WTF\|XXX\|NOTE\)" contained
|
||||
|
||||
" normal end-of-line comment
|
||||
syn match p6Comment display "#`\@!.*" contains=p6Attention
|
||||
syn match p6Comment display "#.*" contains=p6Attention
|
||||
|
||||
" Multiline comments. Arbitrary numbers of opening brackets are allowed,
|
||||
" but we only define regions for 1 to 3
|
||||
|
||||
164
syntax/ragel.vim
Normal file
164
syntax/ragel.vim
Normal file
@@ -0,0 +1,164 @@
|
||||
" Vim syntax file
|
||||
"
|
||||
" Language: Ragel
|
||||
" Author: Adrian Thurston
|
||||
|
||||
syntax clear
|
||||
|
||||
if !exists("g:ragel_default_subtype")
|
||||
let g:ragel_default_subtype = 'c'
|
||||
endif
|
||||
|
||||
function! <SID>Split(path) abort " {{{1
|
||||
if type(a:path) == type([]) | return a:path | endif
|
||||
let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,')
|
||||
return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")')
|
||||
endfunction " }}}1
|
||||
|
||||
fun! <SID>ReadOnPath(script)
|
||||
for dir in <SID>Split(&rtp)
|
||||
let filepath = dir.'/'.a:script
|
||||
if filereadable(filepath)
|
||||
return join(readfile(filepath), " | ")
|
||||
endif
|
||||
endfor
|
||||
endfun
|
||||
|
||||
" Try to detect the subtype. stolen from eruby.vim
|
||||
if !exists("b:ragel_subtype") || b:ragel_subtype == ''
|
||||
" first check for an annotation in the first 5 lines or on the last line
|
||||
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
|
||||
let b:ragel_subtype = matchstr(s:lines, 'ragel_subtype=\zs\w\+')
|
||||
|
||||
" failing that, check the filename for .*.rl
|
||||
if b:ragel_subtype == ''
|
||||
let b:ragel_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.rl\|\.ragel\)\+$','',''),'\.\zs\w\+$')
|
||||
|
||||
" ...and do a couple of transformations if necessary
|
||||
|
||||
" .rb -> ruby
|
||||
if b:ragel_subtype == 'rb'
|
||||
let b:ragel_subtype = 'ruby'
|
||||
|
||||
" .m -> objc
|
||||
elseif b:ragel_subtype == 'm'
|
||||
let b:ragel_subtype = 'objc'
|
||||
|
||||
" .cxx -> cpp
|
||||
elseif b:ragel_subtype == 'cxx'
|
||||
let b:ragel_subtype = 'cpp'
|
||||
endif
|
||||
endif
|
||||
|
||||
" default to g:ragel_default_subtype
|
||||
if b:ragel_subtype == ''
|
||||
let b:ragel_subtype = g:ragel_default_subtype
|
||||
endif
|
||||
endif
|
||||
|
||||
if exists('b:ragel_subtype') && b:ragel_subtype != ''
|
||||
exec 'runtime! syntax/'.b:ragel_subtype.'.vim'
|
||||
" source s:subtype_file
|
||||
unlet! b:current_syntax
|
||||
endif
|
||||
|
||||
" Identifiers
|
||||
syntax match anyId "[a-zA-Z_][a-zA-Z_0-9]*" contained
|
||||
|
||||
" Inline code only
|
||||
syntax keyword fsmType fpc fc fcurs fbuf fblen ftargs fstack contained
|
||||
syntax keyword fsmKeyword fhold fgoto fcall fret fentry fnext fexec fbreak contained
|
||||
|
||||
syntax cluster rlItems contains=rlComment,rlLiteral,rlAugmentOps,rlOtherOps,rlKeywords,rlWrite,rlCodeCurly,rlCodeSemi,rlNumber,anyId,rlLabelColon,rlExprKeywords
|
||||
|
||||
syntax region machineSpec1 matchgroup=beginRL start="%%{" end="}%%" contains=@rlItems
|
||||
syntax region machineSpec2 matchgroup=beginRL start="%%[^{]"rs=e-1 end="$" keepend contains=@rlItems
|
||||
syntax region machineSpec2 matchgroup=beginRL start="%%$" end="$" keepend contains=@rlItems
|
||||
|
||||
" Comments
|
||||
syntax match rlComment "#.*$" contained
|
||||
|
||||
" Literals
|
||||
" single quoted strings '...'
|
||||
syntax match rlLiteral "'\(\\.\|[^'\\]\)*'[i]*" contained
|
||||
" double quoted strings "..."
|
||||
syntax match rlLiteral "\"\(\\.\|[^\"\\]\)*\"[i]*" contained
|
||||
" simple regexes /.../
|
||||
syntax match rlLiteral /\/\(\\.\|[^\/\\]\)*\/[i]*/ contained
|
||||
" char unions [...]
|
||||
syntax match rlLiteral "\[\(\\.\|[^\]\\]\)*\]" contained
|
||||
|
||||
" Numbers
|
||||
syntax match rlNumber "[0-9][0-9]*" contained
|
||||
syntax match rlNumber "0x[0-9a-fA-F][0-9a-fA-F]*" contained
|
||||
|
||||
" Operators
|
||||
syntax match rlAugmentOps "[>$%@]" contained
|
||||
syntax match rlAugmentOps "<>\|<" contained
|
||||
syntax match rlAugmentOps "[>\<$%@][!\^/*~]" contained
|
||||
syntax match rlAugmentOps "[>$%]?" contained
|
||||
syntax match rlAugmentOps "<>[!\^/*~]" contained
|
||||
syntax match rlAugmentOps "=>" contained
|
||||
syntax match rlOtherOps "->" contained
|
||||
|
||||
syntax match rlOtherOps ":>" contained
|
||||
syntax match rlOtherOps ":>>" contained
|
||||
syntax match rlOtherOps "<:" contained
|
||||
|
||||
" Keywords
|
||||
" FIXME: Enable the range keyword post 5.17.
|
||||
" syntax keyword rlKeywords machine action context include range contained
|
||||
syntax keyword rlKeywords machine action context include import export prepush postpop contained
|
||||
syntax keyword rlExprKeywords when inwhen outwhen err lerr eof from to contained
|
||||
|
||||
" Case Labels
|
||||
syntax keyword caseLabelKeyword case contained
|
||||
syntax cluster caseLabelItems contains=caseLabelKeyword,anyId,fsmType,fsmKeyword
|
||||
syntax match caseLabelColon "case" contains=@caseLabelItems contained
|
||||
syntax match caseLabelColon "case[\t ]\+.*:$" contains=@caseLabelItems contained
|
||||
syntax match caseLabelColon "case[\t ]\+.*:[^=:]"me=e-1 contains=@caseLabelItems contained
|
||||
|
||||
syntax match rlLabelColon "[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:$" contained contains=anyLabel
|
||||
syntax match rlLabelColon "[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:[^=:>]"me=e-1 contained contains=anyLabel
|
||||
syntax match anyLabel "[a-zA-Z_][a-zA-Z_0-9]*" contained
|
||||
|
||||
" All items that can go in a code block.
|
||||
|
||||
syntax cluster inlineItems contains=TOP add=anyId,fsmType,fsmKeyword,caseLabelColon
|
||||
|
||||
" Blocks of code. rlCodeCurly is recursive.
|
||||
syntax region rlCodeCurly matchgroup=NONE start="{" end="}" keepend contained contains=TOP
|
||||
syntax region rlCodeSemi matchgroup=Type start="\<alphtype\>" start="\<getkey\>" start="\<access\>" start="\<variable\>" matchgroup=NONE end=";" contained contains=@inlineItems
|
||||
|
||||
syntax region rlWrite matchgroup=Type start="\<write\>" matchgroup=NONE end="[;)]" contained contains=rlWriteKeywords,rlWriteOptions
|
||||
|
||||
syntax keyword rlWriteKeywords init data exec exports start error first_final contained
|
||||
syntax keyword rlWriteOptions noerror nofinal noprefix noend nocs contained
|
||||
|
||||
"
|
||||
" Sync at the start of machine specs.
|
||||
"
|
||||
" Match The ragel delimiters only if there quotes no ahead on the same line.
|
||||
" On the open marker, use & to consume the leader.
|
||||
syntax sync match ragelSyncPat grouphere NONE "^[^\'\"%]*%%{&^[^\'\"%]*"
|
||||
syntax sync match ragelSyncPat grouphere NONE "^[^\'\"%]*%%[^{]&^[^\'\"%]*"
|
||||
syntax sync match ragelSyncPat grouphere NONE "^[^\'\"]*}%%"
|
||||
|
||||
"
|
||||
" Specifying Groups
|
||||
"
|
||||
hi link rlComment Comment
|
||||
hi link rlNumber Number
|
||||
hi link rlLiteral String
|
||||
hi link rlAugmentOps Keyword
|
||||
hi link rlExprKeywords Keyword
|
||||
hi link rlWriteKeywords Keyword
|
||||
hi link rlWriteOptions Keyword
|
||||
hi link rlKeywords Type
|
||||
hi link fsmType Type
|
||||
hi link fsmKeyword Keyword
|
||||
hi link anyLabel Label
|
||||
hi link caseLabelKeyword Keyword
|
||||
hi link beginRL Type
|
||||
|
||||
let b:current_syntax = "ragel"
|
||||
@@ -284,7 +284,7 @@ endif
|
||||
|
||||
" Comments and Documentation
|
||||
syn match rubySharpBang "\%^#!.*" display
|
||||
syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE XXX todo contained
|
||||
syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE HACK REVIEW XXX todo contained
|
||||
syn match rubyComment "#.*" contains=rubySharpBang,rubySpaceError,rubyTodo,@Spell
|
||||
if !exists("ruby_no_comment_fold")
|
||||
syn region rubyMultilineComment start="\%(\%(^\s*#.*\n\)\@<!\%(^\s*#.*\n\)\)\%(\(^\s*#.*\n\)\{1,}\)\@=" end="\%(^\s*#.*\n\)\@<=\%(^\s*#.*\n\)\%(^\s*#\)\@!" contains=rubyComment transparent fold keepend
|
||||
|
||||
@@ -222,7 +222,6 @@ syn keyword tmuxOptsSet
|
||||
\ update-environment
|
||||
\ visual-activity
|
||||
\ visual-bell
|
||||
\ visual-content
|
||||
\ visual-silence
|
||||
\ word-separators
|
||||
|
||||
@@ -243,7 +242,6 @@ syn keyword tmuxOptsSetw
|
||||
\ mode-mouse
|
||||
\ mode-style
|
||||
\ monitor-activity
|
||||
\ monitor-content
|
||||
\ monitor-silence
|
||||
\ other-pane-height
|
||||
\ other-pane-width
|
||||
@@ -253,7 +251,6 @@ syn keyword tmuxOptsSetw
|
||||
\ utf8
|
||||
\ window-status-activity-style
|
||||
\ window-status-bell-style
|
||||
\ window-status-content-style
|
||||
\ window-status-current-format
|
||||
\ window-status-current-style
|
||||
\ window-status-format
|
||||
|
||||
@@ -30,7 +30,7 @@ hi link shebang Comment
|
||||
"" typescript comments"{{{
|
||||
syn keyword typescriptCommentTodo TODO FIXME XXX TBD contained
|
||||
syn match typescriptLineComment "\/\/.*" contains=@Spell,typescriptCommentTodo,typescriptRef
|
||||
syn match typescriptRef /\/\/\/<reference\s\+.*\/>$/ contains=typescriptRefD,typescriptRefS
|
||||
syn match typescriptRefComment /\/\/\/<\(reference\|amd-\(dependency\|module\)\)\s\+.*\/>$/ contains=typescriptRefD,typescriptRefS
|
||||
syn region typescriptRefD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+
|
||||
syn region typescriptRefS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+
|
||||
|
||||
@@ -99,8 +99,8 @@ syntax keyword typescriptEventListenerKeywords contained blur click focus mouseo
|
||||
syntax keyword typescriptEventListenerMethods contained scrollIntoView addEventListener dispatchEvent removeEventListener preventDefault stopPropagation
|
||||
" }}}
|
||||
"" Programm Keywords"{{{
|
||||
syntax keyword typescriptSource import export
|
||||
syntax keyword typescriptIdentifier arguments this let var void yield
|
||||
syntax keyword typescriptSource import export from as
|
||||
syntax keyword typescriptIdentifier arguments this let var void const
|
||||
syntax keyword typescriptOperator delete new instanceof typeof
|
||||
syntax keyword typescriptBoolean true false
|
||||
syntax keyword typescriptNull null undefined
|
||||
@@ -110,16 +110,16 @@ syntax keyword typescriptDeprecated escape unescape all applets alinkColor bgCol
|
||||
"}}}
|
||||
"" Statement Keywords"{{{
|
||||
syntax keyword typescriptConditional if else switch
|
||||
syntax keyword typescriptRepeat do while for in
|
||||
syntax keyword typescriptBranch break continue
|
||||
syntax keyword typescriptLabel case default
|
||||
syntax keyword typescriptRepeat do while for in of
|
||||
syntax keyword typescriptBranch break continue yield await
|
||||
syntax keyword typescriptLabel case default async
|
||||
syntax keyword typescriptStatement return with
|
||||
|
||||
syntax keyword typescriptGlobalObjects Array Boolean Date Function Infinity Math Number NaN Object Packages RegExp String netscape
|
||||
|
||||
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 type
|
||||
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 namespace from
|
||||
"}}}
|
||||
"" typescript/DOM/HTML/CSS specified things"{{{
|
||||
|
||||
@@ -202,10 +202,11 @@ syn match typescriptLogicSymbols "\(&&\)\|\(||\)"
|
||||
" typescriptFold Function {{{
|
||||
|
||||
" function! typescriptFold()
|
||||
setl foldlevelstart=1
|
||||
syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend
|
||||
|
||||
setl foldtext=FoldText()
|
||||
" skip curly braces inside RegEx's and comments
|
||||
syn region foldBraces start=/{/ skip=/\(\/\/.*\)\|\(\/.*\/\)/ end=/}/ transparent fold keepend extend
|
||||
|
||||
" setl foldtext=FoldText()
|
||||
" endfunction
|
||||
|
||||
" au FileType typescript call typescriptFold()
|
||||
@@ -234,7 +235,7 @@ if version >= 508 || !exists("did_typescript_syn_inits")
|
||||
HiLink typescriptParens Operator
|
||||
HiLink typescriptComment Comment
|
||||
HiLink typescriptLineComment Comment
|
||||
HiLink typescriptRef Include
|
||||
HiLink typescriptRefComment Include
|
||||
HiLink typescriptRefS String
|
||||
HiLink typescriptRefD String
|
||||
HiLink typescriptDocComment Comment
|
||||
|
||||
Reference in New Issue
Block a user