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 | |
|---|---|---|---|
|
|
12db3dafc5 | ||
|
|
d1e95cbc98 | ||
|
|
7ffa793f19 | ||
|
|
4203435c48 | ||
|
|
271b63d717 | ||
|
|
acd7ce5950 | ||
|
|
f24fecc338 | ||
|
|
23913e0598 | ||
|
|
1c21231175 | ||
|
|
4541e98466 | ||
|
|
6cd2d5417d |
13
README.md
13
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.
|
> 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.
|
- It **installs 50+ times faster** than 50+ packages it consist of.
|
||||||
- Solid syntax and indentation support. Only the best language packs.
|
- Solid syntax and indentation support. Only the best language packs.
|
||||||
- All unnecessary files are ignored (like enormous documentation from php support).
|
- All unnecessary files are ignored (like enormous documentation from php support).
|
||||||
@@ -26,14 +26,12 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
|||||||
## Language packs
|
## Language packs
|
||||||
|
|
||||||
- [arduino](https://github.com/sudar/vim-arduino-syntax) (syntax, indent, ftdetect)
|
- [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++11](https://github.com/octol/vim-cpp-enhanced-highlight) (syntax)
|
||||||
- [c/c++](https://github.com/vim-jp/cpp-vim) (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)
|
- [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)
|
- [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
|
||||||
- [css](https://github.com/JulesWang/css.vim) (syntax)
|
- [css](https://github.com/JulesWang/css.vim) (syntax)
|
||||||
- [csv](https://github.com/chrisbra/csv.vim) (syntax, ftplugin, ftdetect)
|
|
||||||
- [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin, ftdetect)
|
- [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||||
- [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, ftdetect)
|
- [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, ftdetect)
|
||||||
- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, ftplugin, ftdetect)
|
- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||||
@@ -50,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)
|
- [jade](https://github.com/digitaltoad/vim-jade) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [jasmine](https://github.com/glanotte/vim-jasmine) (syntax, ftdetect)
|
- [jasmine](https://github.com/glanotte/vim-jasmine) (syntax, ftdetect)
|
||||||
- [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, 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)
|
- [jst](https://github.com/briancollins/vim-jst) (syntax, indent, ftdetect)
|
||||||
- [latex](https://github.com/LaTeX-Box-Team/LaTeX-Box) (syntax, indent, ftplugin)
|
- [latex](https://github.com/LaTeX-Box-Team/LaTeX-Box) (syntax, indent, ftplugin)
|
||||||
- [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin, ftdetect)
|
- [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin, ftdetect)
|
||||||
@@ -71,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)
|
- [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)
|
- [rust](https://github.com/wting/rust.vim) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
|
||||||
- [sbt](https://github.com/derekwyatt/vim-sbt) (syntax, 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)
|
- [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftdetect)
|
||||||
- [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin, ftdetect)
|
- [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [systemd](https://github.com/kurayama/systemd-vim-syntax) (syntax, ftdetect)
|
- [systemd](https://github.com/kurayama/systemd-vim-syntax) (syntax, ftdetect)
|
||||||
@@ -79,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)
|
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, ftdetect)
|
||||||
- [tmux](https://github.com/tejr/vim-tmux) (syntax, ftdetect)
|
- [tmux](https://github.com/tejr/vim-tmux) (syntax, ftdetect)
|
||||||
- [tomdoc](https://github.com/duwanis/tomdoc.vim) (syntax)
|
- [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)
|
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
|
||||||
- [thrift](https://github.com/solarnz/thrift.vim) (syntax, ftdetect)
|
- [thrift](https://github.com/solarnz/thrift.vim) (syntax, ftdetect)
|
||||||
- [toml](https://github.com/cespare/vim-toml) (syntax, ftplugin, 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 mbtowc mblen lldiv
|
||||||
syn keyword cAnsiFunction ldiv div llabs
|
syn keyword cAnsiFunction ldiv div llabs
|
||||||
syn keyword cAnsiFunction labs abs qsort
|
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 exit atexit abort
|
||||||
syn keyword cAnsiFunction realloc malloc free
|
syn keyword cAnsiFunction realloc malloc free
|
||||||
syn keyword cAnsiFunction calloc srand rand
|
syn keyword cAnsiFunction calloc srand rand
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ syntax keyword cppSTLfunctional binary_negate
|
|||||||
syntax keyword cppSTLfunctional bit_and
|
syntax keyword cppSTLfunctional bit_and
|
||||||
syntax keyword cppSTLfunctional bit_not
|
syntax keyword cppSTLfunctional bit_not
|
||||||
syntax keyword cppSTLfunctional bit_or
|
syntax keyword cppSTLfunctional bit_or
|
||||||
|
syntax keyword cppSTLfunctional bit_xor
|
||||||
syntax keyword cppSTLfunctional divides
|
syntax keyword cppSTLfunctional divides
|
||||||
syntax keyword cppSTLfunctional equal_to
|
syntax keyword cppSTLfunctional equal_to
|
||||||
syntax keyword cppSTLfunctional greater
|
syntax keyword cppSTLfunctional greater
|
||||||
@@ -170,7 +171,7 @@ syntax keyword cppSTLfunction back
|
|||||||
syntax keyword cppSTLfunction back_inserter
|
syntax keyword cppSTLfunction back_inserter
|
||||||
syntax keyword cppSTLfunction bad
|
syntax keyword cppSTLfunction bad
|
||||||
syntax keyword cppSTLfunction beg
|
syntax keyword cppSTLfunction beg
|
||||||
syntax keyword cppSTLfunction begin
|
"syntax keyword cppSTLfunction begin
|
||||||
syntax keyword cppSTLfunction binary_compose
|
syntax keyword cppSTLfunction binary_compose
|
||||||
syntax keyword cppSTLfunction binary_negate
|
syntax keyword cppSTLfunction binary_negate
|
||||||
syntax keyword cppSTLfunction binary_search
|
syntax keyword cppSTLfunction binary_search
|
||||||
@@ -197,14 +198,14 @@ syntax keyword cppSTLfunction count
|
|||||||
syntax keyword cppSTLfunction count_if
|
syntax keyword cppSTLfunction count_if
|
||||||
syntax keyword cppSTLfunction c_str
|
syntax keyword cppSTLfunction c_str
|
||||||
syntax keyword cppSTLfunction ctime
|
syntax keyword cppSTLfunction ctime
|
||||||
syntax keyword cppSTLfunction data
|
"syntax keyword cppSTLfunction data
|
||||||
syntax keyword cppSTLfunction denorm_min
|
syntax keyword cppSTLfunction denorm_min
|
||||||
syntax keyword cppSTLfunction destroy
|
syntax keyword cppSTLfunction destroy
|
||||||
syntax keyword cppSTLfunction difftime
|
syntax keyword cppSTLfunction difftime
|
||||||
syntax keyword cppSTLfunction distance
|
syntax keyword cppSTLfunction distance
|
||||||
syntax keyword cppSTLfunction div
|
syntax keyword cppSTLfunction div
|
||||||
syntax keyword cppSTLfunction empty
|
syntax keyword cppSTLfunction empty
|
||||||
syntax keyword cppSTLfunction end
|
"syntax keyword cppSTLfunction end
|
||||||
syntax keyword cppSTLfunction eof
|
syntax keyword cppSTLfunction eof
|
||||||
syntax keyword cppSTLfunction epsilon
|
syntax keyword cppSTLfunction epsilon
|
||||||
syntax keyword cppSTLfunction equal
|
syntax keyword cppSTLfunction equal
|
||||||
@@ -417,7 +418,7 @@ syntax keyword cppSTLfunction signal
|
|||||||
syntax keyword cppSTLfunction signaling_NaN
|
syntax keyword cppSTLfunction signaling_NaN
|
||||||
syntax keyword cppSTLfunction sin
|
syntax keyword cppSTLfunction sin
|
||||||
syntax keyword cppSTLfunction sinh
|
syntax keyword cppSTLfunction sinh
|
||||||
syntax keyword cppSTLfunction size
|
"syntax keyword cppSTLfunction size
|
||||||
syntax keyword cppSTLfunction sort
|
syntax keyword cppSTLfunction sort
|
||||||
syntax keyword cppSTLfunction sort_heap
|
syntax keyword cppSTLfunction sort_heap
|
||||||
syntax keyword cppSTLfunction splice
|
syntax keyword cppSTLfunction splice
|
||||||
@@ -459,13 +460,13 @@ syntax keyword cppSTLfunction swap_ranges
|
|||||||
syntax keyword cppSTLfunction swprintf
|
syntax keyword cppSTLfunction swprintf
|
||||||
syntax keyword cppSTLfunction swscanf
|
syntax keyword cppSTLfunction swscanf
|
||||||
syntax keyword cppSTLfunction sync_with_stdio
|
syntax keyword cppSTLfunction sync_with_stdio
|
||||||
syntax keyword cppSTLfunction system
|
"syntax keyword cppSTLfunction system
|
||||||
syntax keyword cppSTLfunction tan
|
syntax keyword cppSTLfunction tan
|
||||||
syntax keyword cppSTLfunction tanh
|
syntax keyword cppSTLfunction tanh
|
||||||
syntax keyword cppSTLfunction tellg
|
syntax keyword cppSTLfunction tellg
|
||||||
syntax keyword cppSTLfunction tellp
|
syntax keyword cppSTLfunction tellp
|
||||||
syntax keyword cppSTLfunction test
|
"syntax keyword cppSTLfunction test
|
||||||
syntax keyword cppSTLfunction time
|
"syntax keyword cppSTLfunction time
|
||||||
syntax keyword cppSTLfunction tmpfile
|
syntax keyword cppSTLfunction tmpfile
|
||||||
syntax keyword cppSTLfunction tmpnam
|
syntax keyword cppSTLfunction tmpnam
|
||||||
syntax keyword cppSTLfunction tolower
|
syntax keyword cppSTLfunction tolower
|
||||||
@@ -760,6 +761,7 @@ syntax keyword cppSTLconstant WCHAR_MAX
|
|||||||
if !exists("cpp_no_cpp11")
|
if !exists("cpp_no_cpp11")
|
||||||
syntax keyword cppSTLtype nullptr_t max_align_t
|
syntax keyword cppSTLtype nullptr_t max_align_t
|
||||||
syntax keyword cppSTLtype type_index
|
syntax keyword cppSTLtype type_index
|
||||||
|
syntax keyword cppSTLconstant nullptr
|
||||||
|
|
||||||
" type_traits
|
" type_traits
|
||||||
syntax keyword cppSTLtype is_void
|
syntax keyword cppSTLtype is_void
|
||||||
@@ -1052,7 +1054,7 @@ if !exists("cpp_no_cpp11")
|
|||||||
syntax keyword cppSTLconstant FLT_EVAL_METHOD
|
syntax keyword cppSTLconstant FLT_EVAL_METHOD
|
||||||
|
|
||||||
" complex
|
" complex
|
||||||
syntax keyword cppSTLfunction proj
|
"syntax keyword cppSTLfunction proj
|
||||||
|
|
||||||
" random
|
" random
|
||||||
syntax keyword cppSTLtype linear_congruential_engine
|
syntax keyword cppSTLtype linear_congruential_engine
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
||||||
|
|
||||||
call css_color#init('css', 'cssMediaBlock,cssFunction,cssDefinition,cssAttrRegion,cssComment')
|
call css_color#init('css', 'extended', 'cssMediaBlock,cssFunction,cssDefinition,cssAttrRegion,cssComment')
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
let b:current_syntax = ''
|
" Extends standard help syntax with highlighting of Scala code.
|
||||||
unlet b:current_syntax
|
"
|
||||||
|
" Place code between !sc! and !/sc! delimiters. These will be hidden if Vim is
|
||||||
|
" built with conceal support.
|
||||||
|
|
||||||
|
unlet! b:current_syntax
|
||||||
|
|
||||||
syntax include @ScalaCode syntax/scala.vim
|
syntax include @ScalaCode syntax/scala.vim
|
||||||
|
|
||||||
if has('conceal')
|
if has('conceal')
|
||||||
syntax region rgnScala matchgroup=Ignore concealends start='!sc!' end='!/sc!' contains=@ScalaCode
|
syntax region rgnScala matchgroup=Ignore concealends start='!sc!' end='!/sc!' contains=@ScalaCode
|
||||||
else
|
else
|
||||||
|
|||||||
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')
|
||||||
@@ -10,4 +10,4 @@ if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
|||||||
" lessVariableValue | lessDefinition | cssComment | lessComment | https://github.com/groenewege/vim-less
|
" lessVariableValue | lessDefinition | cssComment | lessComment | https://github.com/groenewege/vim-less
|
||||||
" lessVariableDefinition | cssDefinition | cssComment | lessComment | https://github.com/lunaru/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')
|
call css_color#init('css', 'extended', 'lessVariableValue,lessVariableDefinition,lessDefinition,lessCssAttribute,lessAttribute,cssDefinition,cssComment,lessCssComment,lessComment')
|
||||||
|
|||||||
6
after/syntax/lua.vim
Normal file
6
after/syntax/lua.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', 'luaComment,luaString')
|
||||||
6
after/syntax/moon.vim
Normal file
6
after/syntax/moon.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', 'moonComment,moonString')
|
||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
||||||
|
|
||||||
call css_color#init('css', 'sassCssAttribute,sassComment,sassCssComment')
|
call css_color#init('css', 'extended', 'sassCssAttribute,sassComment,sassCssComment')
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
||||||
|
|
||||||
call css_color#init('css', 'scssAttribute,scssComment,scssVariableValue,sassCssAttribute,cssComment')
|
call css_color#init('css', 'extended', 'scssAttribute,scssComment,scssVariableValue,sassCssAttribute,cssComment')
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
||||||
|
|
||||||
call css_color#init('css', 'stylusCssAttribute,stylusComment,cssComment')
|
call css_color#init('css', 'extended', 'stylusCssAttribute,stylusComment,cssComment')
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
||||||
|
|
||||||
call css_color#init('any', 'vimHiGuiRgb,vimComment,vimLineComment')
|
call css_color#init('hex', 'none', 'vimHiGuiRgb,vimComment,vimLineComment')
|
||||||
|
|||||||
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')
|
||||||
File diff suppressed because one or more lines are too long
@@ -173,6 +173,8 @@ function! s:create_syn_match()
|
|||||||
let s:pattern_color[pattern] = rgb_color
|
let s:pattern_color[pattern] = rgb_color
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let group = 'BG' . rgb_color
|
||||||
|
|
||||||
if ! has_key( b:has_color_hi, rgb_color )
|
if ! has_key( b:has_color_hi, rgb_color )
|
||||||
" check GUI flag early here to avoid pure-overhead caching
|
" check GUI flag early here to avoid pure-overhead caching
|
||||||
let syn_bg = s:is_gui ? rgb_color : get( s:color_bg, rgb_color, '' )
|
let syn_bg = s:is_gui ? rgb_color : get( s:color_bg, rgb_color, '' )
|
||||||
@@ -189,11 +191,7 @@ function! s:create_syn_match()
|
|||||||
let syn_fg = r*30 + g*59 + b*11 > 12000 ? s:black : s:white
|
let syn_fg = r*30 + g*59 + b*11 > 12000 ? s:black : s:white
|
||||||
let s:color_fg[rgb_color] = syn_fg
|
let s:color_fg[rgb_color] = syn_fg
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
let group = 'BG' . rgb_color
|
|
||||||
|
|
||||||
if ! has_key( b:has_color_hi, rgb_color )
|
|
||||||
exe printf( s:hi_cmd, group, syn_bg, syn_fg )
|
exe printf( s:hi_cmd, group, syn_bg, syn_fg )
|
||||||
let b:has_color_hi[rgb_color] = 1
|
let b:has_color_hi[rgb_color] = 1
|
||||||
endif
|
endif
|
||||||
@@ -250,7 +248,7 @@ function! s:parse_css_screen()
|
|||||||
call s:clear_matches()
|
call s:clear_matches()
|
||||||
call s:create_matches()
|
call s:create_matches()
|
||||||
endfunction
|
endfunction
|
||||||
function! s:parse_any_screen()
|
function! s:parse_hex_screen()
|
||||||
call substitute( join( getline('w0','w$'), "\n" ), s:_hexcolor, '\=s:create_syn_match()', 'g' )
|
call substitute( join( getline('w0','w$'), "\n" ), s:_hexcolor, '\=s:create_syn_match()', 'g' )
|
||||||
call s:clear_matches()
|
call s:clear_matches()
|
||||||
call s:create_matches()
|
call s:create_matches()
|
||||||
@@ -258,7 +256,7 @@ endfunction
|
|||||||
|
|
||||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
function! css_color#init(type, groups)
|
function! css_color#init(type, keywords, groups)
|
||||||
exe 'syn cluster colorableGroup contains=' . a:groups
|
exe 'syn cluster colorableGroup contains=' . a:groups
|
||||||
|
|
||||||
let b:has_color_hi = {}
|
let b:has_color_hi = {}
|
||||||
@@ -273,23 +271,58 @@ function! css_color#init(type, groups)
|
|||||||
|
|
||||||
exe 'call s:parse_'.a:type.'_screen()'
|
exe 'call s:parse_'.a:type.'_screen()'
|
||||||
|
|
||||||
if a:type != 'css' | return | endif
|
if a:keywords == 'none' | return | endif
|
||||||
|
|
||||||
|
syn case ignore
|
||||||
|
|
||||||
|
" W3C basic colors
|
||||||
|
|
||||||
hi BG000000 guibg=#000000 guifg=#FFFFFF ctermbg=16 ctermfg=231
|
hi BG000000 guibg=#000000 guifg=#FFFFFF ctermbg=16 ctermfg=231
|
||||||
|
hi BGc0c0c0 guibg=#C0C0C0 guifg=#000000 ctermbg=250 ctermfg=16
|
||||||
|
hi BG808080 guibg=#808080 guifg=#000000 ctermbg=244 ctermfg=16
|
||||||
|
hi BGffffff guibg=#FFFFFF guifg=#000000 ctermbg=231 ctermfg=16
|
||||||
|
hi BG800000 guibg=#800000 guifg=#FFFFFF ctermbg=88 ctermfg=231
|
||||||
|
hi BGff0000 guibg=#FF0000 guifg=#FFFFFF ctermbg=196 ctermfg=231
|
||||||
|
hi BG800080 guibg=#800080 guifg=#FFFFFF ctermbg=240 ctermfg=231
|
||||||
|
hi BGff00ff guibg=#FF00FF guifg=#FFFFFF ctermbg=13 ctermfg=231
|
||||||
|
hi BG008000 guibg=#008000 guifg=#FFFFFF ctermbg=2 ctermfg=231
|
||||||
|
hi BG00ff00 guibg=#00FF00 guifg=#000000 ctermbg=10 ctermfg=16
|
||||||
|
hi BG808000 guibg=#808000 guifg=#FFFFFF ctermbg=240 ctermfg=231
|
||||||
|
hi BGffff00 guibg=#FFFF00 guifg=#000000 ctermbg=11 ctermfg=16
|
||||||
hi BG000080 guibg=#000080 guifg=#FFFFFF ctermbg=235 ctermfg=231
|
hi BG000080 guibg=#000080 guifg=#FFFFFF ctermbg=235 ctermfg=231
|
||||||
|
hi BG0000ff guibg=#0000FF guifg=#FFFFFF ctermbg=4 ctermfg=231
|
||||||
|
hi BG008080 guibg=#008080 guifg=#FFFFFF ctermbg=30 ctermfg=231
|
||||||
|
hi BG00ffff guibg=#00FFFF guifg=#000000 ctermbg=51 ctermfg=16
|
||||||
|
|
||||||
|
syn keyword BG000000 black contained containedin=@colorableGroup
|
||||||
|
syn keyword BGc0c0c0 silver contained containedin=@colorableGroup
|
||||||
|
syn keyword BG808080 gray contained containedin=@colorableGroup
|
||||||
|
syn match BGffffff "\c\<white\(-\)\@!\>" contained containedin=@colorableGroup
|
||||||
|
syn keyword BG800000 maroon contained containedin=@colorableGroup
|
||||||
|
syn keyword BGff0000 red contained containedin=@colorableGroup
|
||||||
|
syn keyword BG800080 purple contained containedin=@colorableGroup
|
||||||
|
syn keyword BGff00ff fuchsia contained containedin=@colorableGroup
|
||||||
|
syn keyword BG008000 green contained containedin=@colorableGroup
|
||||||
|
syn keyword BG00ff00 lime contained containedin=@colorableGroup
|
||||||
|
syn keyword BG808000 olive contained containedin=@colorableGroup
|
||||||
|
syn keyword BGffff00 yellow contained containedin=@colorableGroup
|
||||||
|
syn keyword BG000080 navy contained containedin=@colorableGroup
|
||||||
|
syn keyword BG0000ff blue contained containedin=@colorableGroup
|
||||||
|
syn keyword BG008080 teal contained containedin=@colorableGroup
|
||||||
|
syn keyword BG00ffff aqua contained containedin=@colorableGroup
|
||||||
|
|
||||||
|
if a:keywords == 'basic' | return | endif
|
||||||
|
|
||||||
|
" W3C extended colors
|
||||||
|
|
||||||
hi BG00008b guibg=#00008B guifg=#FFFFFF ctermbg=4 ctermfg=231
|
hi BG00008b guibg=#00008B guifg=#FFFFFF ctermbg=4 ctermfg=231
|
||||||
hi BG0000cd guibg=#0000CD guifg=#FFFFFF ctermbg=4 ctermfg=231
|
hi BG0000cd guibg=#0000CD guifg=#FFFFFF ctermbg=4 ctermfg=231
|
||||||
hi BG0000ff guibg=#0000FF guifg=#FFFFFF ctermbg=4 ctermfg=231
|
|
||||||
hi BG006400 guibg=#006400 guifg=#FFFFFF ctermbg=235 ctermfg=231
|
hi BG006400 guibg=#006400 guifg=#FFFFFF ctermbg=235 ctermfg=231
|
||||||
hi BG008000 guibg=#008000 guifg=#FFFFFF ctermbg=2 ctermfg=231
|
|
||||||
hi BG008080 guibg=#008080 guifg=#FFFFFF ctermbg=30 ctermfg=231
|
|
||||||
hi BG008b8b guibg=#008B8B guifg=#FFFFFF ctermbg=30 ctermfg=231
|
hi BG008b8b guibg=#008B8B guifg=#FFFFFF ctermbg=30 ctermfg=231
|
||||||
hi BG00bfff guibg=#00BFFF guifg=#000000 ctermbg=6 ctermfg=16
|
hi BG00bfff guibg=#00BFFF guifg=#000000 ctermbg=6 ctermfg=16
|
||||||
hi BG00ced1 guibg=#00CED1 guifg=#000000 ctermbg=6 ctermfg=16
|
hi BG00ced1 guibg=#00CED1 guifg=#000000 ctermbg=6 ctermfg=16
|
||||||
hi BG00fa9a guibg=#00FA9A guifg=#000000 ctermbg=6 ctermfg=16
|
hi BG00fa9a guibg=#00FA9A guifg=#000000 ctermbg=6 ctermfg=16
|
||||||
hi BG00ff00 guibg=#00FF00 guifg=#000000 ctermbg=10 ctermfg=16
|
|
||||||
hi BG00ff7f guibg=#00FF7F guifg=#000000 ctermbg=6 ctermfg=16
|
hi BG00ff7f guibg=#00FF7F guifg=#000000 ctermbg=6 ctermfg=16
|
||||||
hi BG00ffff guibg=#00FFFF guifg=#000000 ctermbg=51 ctermfg=16
|
|
||||||
hi BG191970 guibg=#191970 guifg=#FFFFFF ctermbg=237 ctermfg=231
|
hi BG191970 guibg=#191970 guifg=#FFFFFF ctermbg=237 ctermfg=231
|
||||||
hi BG1e90ff guibg=#1E90FF guifg=#000000 ctermbg=12 ctermfg=16
|
hi BG1e90ff guibg=#1E90FF guifg=#000000 ctermbg=12 ctermfg=16
|
||||||
hi BG20b2aa guibg=#20B2AA guifg=#000000 ctermbg=37 ctermfg=16
|
hi BG20b2aa guibg=#20B2AA guifg=#000000 ctermbg=37 ctermfg=16
|
||||||
@@ -317,10 +350,6 @@ function! css_color#init(type, groups)
|
|||||||
hi BG7cfc00 guibg=#7CFC00 guifg=#000000 ctermbg=3 ctermfg=16
|
hi BG7cfc00 guibg=#7CFC00 guifg=#000000 ctermbg=3 ctermfg=16
|
||||||
hi BG7fff00 guibg=#7FFF00 guifg=#000000 ctermbg=3 ctermfg=16
|
hi BG7fff00 guibg=#7FFF00 guifg=#000000 ctermbg=3 ctermfg=16
|
||||||
hi BG7fffd4 guibg=#7FFFD4 guifg=#000000 ctermbg=122 ctermfg=16
|
hi BG7fffd4 guibg=#7FFFD4 guifg=#000000 ctermbg=122 ctermfg=16
|
||||||
hi BG800000 guibg=#800000 guifg=#FFFFFF ctermbg=88 ctermfg=231
|
|
||||||
hi BG800080 guibg=#800080 guifg=#FFFFFF ctermbg=240 ctermfg=231
|
|
||||||
hi BG808000 guibg=#808000 guifg=#FFFFFF ctermbg=240 ctermfg=231
|
|
||||||
hi BG808080 guibg=#808080 guifg=#000000 ctermbg=244 ctermfg=16
|
|
||||||
hi BG87ceeb guibg=#87CEEB guifg=#000000 ctermbg=117 ctermfg=16
|
hi BG87ceeb guibg=#87CEEB guifg=#000000 ctermbg=117 ctermfg=16
|
||||||
hi BG87cefa guibg=#87CEFA guifg=#000000 ctermbg=117 ctermfg=16
|
hi BG87cefa guibg=#87CEFA guifg=#000000 ctermbg=117 ctermfg=16
|
||||||
hi BG8a2be2 guibg=#8A2BE2 guifg=#FFFFFF ctermbg=12 ctermfg=231
|
hi BG8a2be2 guibg=#8A2BE2 guifg=#FFFFFF ctermbg=12 ctermfg=231
|
||||||
@@ -347,7 +376,6 @@ function! css_color#init(type, groups)
|
|||||||
hi BGba55d3 guibg=#BA55D3 guifg=#000000 ctermbg=5 ctermfg=16
|
hi BGba55d3 guibg=#BA55D3 guifg=#000000 ctermbg=5 ctermfg=16
|
||||||
hi BGbc8f8f guibg=#BC8F8F guifg=#000000 ctermbg=138 ctermfg=16
|
hi BGbc8f8f guibg=#BC8F8F guifg=#000000 ctermbg=138 ctermfg=16
|
||||||
hi BGbdb76b guibg=#BDB76B guifg=#000000 ctermbg=247 ctermfg=16
|
hi BGbdb76b guibg=#BDB76B guifg=#000000 ctermbg=247 ctermfg=16
|
||||||
hi BGc0c0c0 guibg=#C0C0C0 guifg=#000000 ctermbg=250 ctermfg=16
|
|
||||||
hi BGc71585 guibg=#C71585 guifg=#FFFFFF ctermbg=5 ctermfg=231
|
hi BGc71585 guibg=#C71585 guifg=#FFFFFF ctermbg=5 ctermfg=231
|
||||||
hi BGcd5c5c guibg=#CD5C5C guifg=#000000 ctermbg=167 ctermfg=16
|
hi BGcd5c5c guibg=#CD5C5C guifg=#000000 ctermbg=167 ctermfg=16
|
||||||
hi BGcd853f guibg=#CD853F guifg=#000000 ctermbg=173 ctermfg=16
|
hi BGcd853f guibg=#CD853F guifg=#000000 ctermbg=173 ctermfg=16
|
||||||
@@ -383,8 +411,6 @@ function! css_color#init(type, groups)
|
|||||||
hi BGfaf0e6 guibg=#FAF0E6 guifg=#000000 ctermbg=255 ctermfg=16
|
hi BGfaf0e6 guibg=#FAF0E6 guifg=#000000 ctermbg=255 ctermfg=16
|
||||||
hi BGfafad2 guibg=#FAFAD2 guifg=#000000 ctermbg=255 ctermfg=16
|
hi BGfafad2 guibg=#FAFAD2 guifg=#000000 ctermbg=255 ctermfg=16
|
||||||
hi BGfdf5e6 guibg=#FDF5E6 guifg=#000000 ctermbg=255 ctermfg=16
|
hi BGfdf5e6 guibg=#FDF5E6 guifg=#000000 ctermbg=255 ctermfg=16
|
||||||
hi BGff0000 guibg=#FF0000 guifg=#FFFFFF ctermbg=196 ctermfg=231
|
|
||||||
hi BGff00ff guibg=#FF00FF guifg=#FFFFFF ctermbg=13 ctermfg=231
|
|
||||||
hi BGff1493 guibg=#FF1493 guifg=#FFFFFF ctermbg=5 ctermfg=231
|
hi BGff1493 guibg=#FF1493 guifg=#FFFFFF ctermbg=5 ctermfg=231
|
||||||
hi BGff4500 guibg=#FF4500 guifg=#FFFFFF ctermbg=9 ctermfg=231
|
hi BGff4500 guibg=#FF4500 guifg=#FFFFFF ctermbg=9 ctermfg=231
|
||||||
hi BGff6347 guibg=#FF6347 guifg=#000000 ctermbg=203 ctermfg=16
|
hi BGff6347 guibg=#FF6347 guifg=#000000 ctermbg=203 ctermfg=16
|
||||||
@@ -409,30 +435,9 @@ function! css_color#init(type, groups)
|
|||||||
hi BGfffacd guibg=#FFFACD guifg=#000000 ctermbg=255 ctermfg=16
|
hi BGfffacd guibg=#FFFACD guifg=#000000 ctermbg=255 ctermfg=16
|
||||||
hi BGfffaf0 guibg=#FFFAF0 guifg=#000000 ctermbg=15 ctermfg=16
|
hi BGfffaf0 guibg=#FFFAF0 guifg=#000000 ctermbg=15 ctermfg=16
|
||||||
hi BGfffafa guibg=#FFFAFA guifg=#000000 ctermbg=15 ctermfg=16
|
hi BGfffafa guibg=#FFFAFA guifg=#000000 ctermbg=15 ctermfg=16
|
||||||
hi BGffff00 guibg=#FFFF00 guifg=#000000 ctermbg=11 ctermfg=16
|
|
||||||
hi BGffffe0 guibg=#FFFFE0 guifg=#000000 ctermbg=255 ctermfg=16
|
hi BGffffe0 guibg=#FFFFE0 guifg=#000000 ctermbg=255 ctermfg=16
|
||||||
hi BGfffff0 guibg=#FFFFF0 guifg=#000000 ctermbg=15 ctermfg=16
|
hi BGfffff0 guibg=#FFFFF0 guifg=#000000 ctermbg=15 ctermfg=16
|
||||||
hi BGffffff guibg=#FFFFFF guifg=#000000 ctermbg=231 ctermfg=16
|
|
||||||
|
|
||||||
" W3C Colors
|
|
||||||
syn keyword BG000000 black contained containedin=@colorableGroup
|
|
||||||
syn keyword BGc0c0c0 silver contained containedin=@colorableGroup
|
|
||||||
syn keyword BG808080 gray contained containedin=@colorableGroup
|
|
||||||
syn match BGffffff "\<white\(-\)\@!\>" contained containedin=@colorableGroup
|
|
||||||
syn keyword BG800000 maroon contained containedin=@colorableGroup
|
|
||||||
syn keyword BGff0000 red contained containedin=@colorableGroup
|
|
||||||
syn keyword BG800080 purple contained containedin=@colorableGroup
|
|
||||||
syn keyword BGff00ff fuchsia contained containedin=@colorableGroup
|
|
||||||
syn keyword BG008000 green contained containedin=@colorableGroup
|
|
||||||
syn keyword BG00ff00 lime contained containedin=@colorableGroup
|
|
||||||
syn keyword BG808000 olive contained containedin=@colorableGroup
|
|
||||||
syn keyword BGffff00 yellow contained containedin=@colorableGroup
|
|
||||||
syn keyword BG000080 navy contained containedin=@colorableGroup
|
|
||||||
syn keyword BG0000ff blue contained containedin=@colorableGroup
|
|
||||||
syn keyword BG008080 teal contained containedin=@colorableGroup
|
|
||||||
syn keyword BG00ffff aqua contained containedin=@colorableGroup
|
|
||||||
|
|
||||||
" extra colors
|
|
||||||
syn keyword BGf0f8ff AliceBlue contained containedin=@colorableGroup
|
syn keyword BGf0f8ff AliceBlue contained containedin=@colorableGroup
|
||||||
syn keyword BGfaebd7 AntiqueWhite contained containedin=@colorableGroup
|
syn keyword BGfaebd7 AntiqueWhite contained containedin=@colorableGroup
|
||||||
syn keyword BG7fffd4 Aquamarine contained containedin=@colorableGroup
|
syn keyword BG7fffd4 Aquamarine contained containedin=@colorableGroup
|
||||||
|
|||||||
@@ -704,7 +704,9 @@ class VimRubyCompletion
|
|||||||
cv = eval("self.class.constants")
|
cv = eval("self.class.constants")
|
||||||
vartype = get_var_type( receiver )
|
vartype = get_var_type( receiver )
|
||||||
dprint "vartype: %s" % vartype
|
dprint "vartype: %s" % vartype
|
||||||
if vartype != ''
|
|
||||||
|
invalid_vartype = ['', "gets"]
|
||||||
|
if !invalid_vartype.include?(vartype)
|
||||||
load_buffer_class( vartype )
|
load_buffer_class( vartype )
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@@ -732,7 +734,7 @@ class VimRubyCompletion
|
|||||||
methods.concat m.instance_methods(false)
|
methods.concat m.instance_methods(false)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
variables += add_rails_columns( "#{vartype}" ) if vartype && vartype.length > 0
|
variables += add_rails_columns( "#{vartype}" ) if vartype && !invalid_vartype.include?(vartype)
|
||||||
|
|
||||||
when /^\(?\s*[A-Za-z0-9:^@.%\/+*\(\)]+\.\.\.?[A-Za-z0-9:^@.%\/+*\(\)]+\s*\)?\.([^.]*)/
|
when /^\(?\s*[A-Za-z0-9:^@.%\/+*\(\)]+\.\.\.?[A-Za-z0-9:^@.%\/+*\(\)]+\s*\)?\.([^.]*)/
|
||||||
message = $1
|
message = $1
|
||||||
|
|||||||
@@ -545,7 +545,7 @@ let g:xmldata_html5 = {
|
|||||||
\ ],
|
\ ],
|
||||||
\ 'iframe': [
|
\ 'iframe': [
|
||||||
\ [],
|
\ [],
|
||||||
\ extend(copy(global_attributes), {'src': [], 'name': [], 'width': [], 'height': [], 'sandbox': ['allow-same-origin', 'allow-forms', 'allow-scripts'], 'seamless': ['seamless', '']})
|
\ extend(copy(global_attributes), {'src': [], 'srcdoc': [], 'name': [], 'width': [], 'height': [], 'sandbox': ['allow-same-origin', 'allow-forms', 'allow-scripts'], 'seamless': ['seamless', '']})
|
||||||
\ ],
|
\ ],
|
||||||
\ 'img': [
|
\ 'img': [
|
||||||
\ [],
|
\ [],
|
||||||
@@ -659,6 +659,10 @@ let g:xmldata_html5 = {
|
|||||||
\ phrasing_elements,
|
\ phrasing_elements,
|
||||||
\ extend(copy(global_attributes), {'cite': []})
|
\ extend(copy(global_attributes), {'cite': []})
|
||||||
\ ],
|
\ ],
|
||||||
|
\ 'rb': [
|
||||||
|
\ phrasing_elements,
|
||||||
|
\ global_attributes
|
||||||
|
\ ],
|
||||||
\ 'rp': [
|
\ 'rp': [
|
||||||
\ phrasing_elements,
|
\ phrasing_elements,
|
||||||
\ global_attributes
|
\ global_attributes
|
||||||
@@ -667,10 +671,14 @@ let g:xmldata_html5 = {
|
|||||||
\ phrasing_elements,
|
\ phrasing_elements,
|
||||||
\ global_attributes
|
\ global_attributes
|
||||||
\ ],
|
\ ],
|
||||||
\ 'ruby': [
|
\ 'rtc': [
|
||||||
\ phrasing_elements + ['rp', 'rt'],
|
\ phrasing_elements + ['rp', 'rt'],
|
||||||
\ global_attributes
|
\ global_attributes
|
||||||
\ ],
|
\ ],
|
||||||
|
\ 'ruby': [
|
||||||
|
\ phrasing_elements + ['rb', 'rp', 'rt', 'rtc'],
|
||||||
|
\ global_attributes
|
||||||
|
\ ],
|
||||||
\ 'samp': [
|
\ 'samp': [
|
||||||
\ phrasing_elements,
|
\ phrasing_elements,
|
||||||
\ global_attributes
|
\ global_attributes
|
||||||
|
|||||||
5
build
5
build
@@ -77,7 +77,6 @@ PACKS="
|
|||||||
clojure:guns/vim-clojure-static
|
clojure:guns/vim-clojure-static
|
||||||
coffee-script:kchmck/vim-coffee-script
|
coffee-script:kchmck/vim-coffee-script
|
||||||
css:JulesWang/css.vim
|
css:JulesWang/css.vim
|
||||||
csv:chrisbra/csv.vim
|
|
||||||
cucumber:tpope/vim-cucumber
|
cucumber:tpope/vim-cucumber
|
||||||
dockerfile:honza/dockerfile.vim
|
dockerfile:honza/dockerfile.vim
|
||||||
elixir:elixir-lang/vim-elixir
|
elixir:elixir-lang/vim-elixir
|
||||||
@@ -94,7 +93,8 @@ PACKS="
|
|||||||
jade:digitaltoad/vim-jade
|
jade:digitaltoad/vim-jade
|
||||||
jasmine:glanotte/vim-jasmine
|
jasmine:glanotte/vim-jasmine
|
||||||
javascript:pangloss/vim-javascript
|
javascript:pangloss/vim-javascript
|
||||||
json:leshill/vim-json
|
julia:dcjones/julia-minimalist-vim
|
||||||
|
json:sheerun/vim-json
|
||||||
jst:briancollins/vim-jst
|
jst:briancollins/vim-jst
|
||||||
latex:LaTeX-Box-Team/LaTeX-Box
|
latex:LaTeX-Box-Team/LaTeX-Box
|
||||||
less:groenewege/vim-less
|
less:groenewege/vim-less
|
||||||
@@ -111,6 +111,7 @@ PACKS="
|
|||||||
protobuf:uarun/vim-protobuf
|
protobuf:uarun/vim-protobuf
|
||||||
python:mitsuhiko/vim-python-combined
|
python:mitsuhiko/vim-python-combined
|
||||||
r-lang:vim-scripts/R.vim
|
r-lang:vim-scripts/R.vim
|
||||||
|
ragel:jneen/ragel.vim
|
||||||
rspec:sheerun/rspec.vim
|
rspec:sheerun/rspec.vim
|
||||||
ruby:vim-ruby/vim-ruby
|
ruby:vim-ruby/vim-ruby
|
||||||
rust:wting/rust.vim
|
rust:wting/rust.vim
|
||||||
|
|||||||
30
compiler/sbt.vim
Normal file
30
compiler/sbt.vim
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
" Vim compiler file
|
||||||
|
" Language: Scala SBT (http://www.scala-sbt.org/)
|
||||||
|
" Maintainer: Derek Wyatt
|
||||||
|
" URL: https://github.com/derekwyatt/vim-scala
|
||||||
|
" License: Apache 2
|
||||||
|
" ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if exists('current_compiler')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let current_compiler = 'sbt'
|
||||||
|
|
||||||
|
if exists(':CompilerSet') != 2 " older Vim always used :setlocal
|
||||||
|
command -nargs=* CompilerSet setlocal <args>
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:cpo_save = &cpo
|
||||||
|
set cpo-=C
|
||||||
|
|
||||||
|
CompilerSet makeprg=sbt\ -Dsbt.log.noformat=true\ compile
|
||||||
|
|
||||||
|
CompilerSet errorformat=
|
||||||
|
\%E\ %#[error]\ %f:%l:\ %m,%C\ %#[error]\ %p^,%-C%.%#,%Z,
|
||||||
|
\%W\ %#[warn]\ %f:%l:\ %m,%C\ %#[warn]\ %p^,%-C%.%#,%Z,
|
||||||
|
\%-G%.%#
|
||||||
|
|
||||||
|
let &cpo = s:cpo_save
|
||||||
|
unlet s:cpo_save
|
||||||
|
|
||||||
|
" vim:set sw=2 sts=2 ts=8 et:
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
au BufRead,BufNewFile *.ino,*.pde set filetype=arduino
|
au BufRead,BufNewFile *.ino,*.pde set filetype=arduino
|
||||||
au BufNewFile,BufRead *.blade.php set filetype=blade
|
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 *.coffee set filetype=coffee
|
||||||
autocmd BufNewFile,BufRead *Cakefile set filetype=coffee
|
autocmd BufNewFile,BufRead *Cakefile set filetype=coffee
|
||||||
autocmd BufNewFile,BufRead *.coffeekup,*.ck set filetype=coffee
|
autocmd BufNewFile,BufRead *.coffeekup,*.ck set filetype=coffee
|
||||||
@@ -11,7 +11,6 @@ function! s:DetectCoffee()
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
autocmd BufNewFile,BufRead * call s:DetectCoffee()
|
autocmd BufNewFile,BufRead * call s:DetectCoffee()
|
||||||
au BufRead,BufNewFile *.csv,*.dat,*.tsv,*.tab set filetype=csv
|
|
||||||
autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber
|
autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber
|
||||||
au BufNewFile,BufRead Dockerfile set filetype=dockerfile
|
au BufNewFile,BufRead Dockerfile set filetype=dockerfile
|
||||||
au BufRead,BufNewFile *.eex set filetype=eelixir
|
au BufRead,BufNewFile *.eex set filetype=eelixir
|
||||||
@@ -49,18 +48,19 @@ autocmd BufNewFile,BufRead *
|
|||||||
let s:current_fileformats = ''
|
let s:current_fileformats = ''
|
||||||
let s:current_fileencodings = ''
|
let s:current_fileencodings = ''
|
||||||
function! s:gofiletype_pre()
|
function! s:gofiletype_pre()
|
||||||
let s:current_fileformats = &g:fileformats
|
let s:current_fileformats = &g:fileformats
|
||||||
let s:current_fileencodings = &g:fileencodings
|
let s:current_fileencodings = &g:fileencodings
|
||||||
set fileencodings=utf-8 fileformats=unix
|
set fileencodings=utf-8 fileformats=unix
|
||||||
setlocal filetype=go
|
setlocal filetype=go
|
||||||
endfunction
|
endfunction
|
||||||
function! s:gofiletype_post()
|
function! s:gofiletype_post()
|
||||||
let &g:fileformats = s:current_fileformats
|
let &g:fileformats = s:current_fileformats
|
||||||
let &g:fileencodings = s:current_fileencodings
|
let &g:fileencodings = s:current_fileencodings
|
||||||
endfunction
|
endfunction
|
||||||
au BufNewFile *.go setlocal filetype=go fileencoding=utf-8 fileformat=unix
|
au BufNewFile *.go setlocal filetype=go fileencoding=utf-8 fileformat=unix
|
||||||
au BufRead *.go call s:gofiletype_pre()
|
au BufRead *.go call s:gofiletype_pre()
|
||||||
au BufReadPost *.go call s:gofiletype_post()
|
au BufReadPost *.go call s:gofiletype_post()
|
||||||
|
au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl
|
||||||
autocmd BufNewFile,BufRead *.haml,*.hamlbars,*.hamlc setf haml
|
autocmd BufNewFile,BufRead *.haml,*.hamlbars,*.hamlc setf haml
|
||||||
autocmd BufNewFile,BufRead *.sass setf sass
|
autocmd BufNewFile,BufRead *.sass setf sass
|
||||||
autocmd BufNewFile,BufRead *.scss setf scss
|
autocmd BufNewFile,BufRead *.scss setf scss
|
||||||
@@ -77,15 +77,14 @@ fun! s:SelectJavascript()
|
|||||||
endfun
|
endfun
|
||||||
au BufNewFile,BufRead * call s:SelectJavascript()
|
au BufNewFile,BufRead * call s:SelectJavascript()
|
||||||
autocmd BufNewFile,BufRead *.json set filetype=json
|
autocmd BufNewFile,BufRead *.json set filetype=json
|
||||||
augroup json_autocmd
|
autocmd BufNewFile,BufRead *.jsonp set filetype=json
|
||||||
autocmd!
|
au BufNewFile,BufRead *.ejs set filetype=jst
|
||||||
autocmd FileType json setlocal autoindent
|
au BufNewFile,BufRead *.jst set filetype=jst
|
||||||
autocmd FileType json setlocal formatoptions=tcq2l
|
au BufNewFile,BufRead *.djs set filetype=jst
|
||||||
autocmd FileType json setlocal foldmethod=syntax
|
|
||||||
augroup END
|
|
||||||
au BufNewFile,BufRead *.ejs set filetype=jst
|
|
||||||
au BufNewFile,BufRead *.jst set filetype=jst
|
|
||||||
au BufNewFile,BufRead *.hamljs 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
|
autocmd BufNewFile,BufRead *.less setf less
|
||||||
au BufNewFile,BufRead *.liquid set ft=liquid
|
au BufNewFile,BufRead *.liquid set ft=liquid
|
||||||
au BufNewFile,BufRead */_layouts/*.html,*/_includes/*.html set ft=liquid
|
au BufNewFile,BufRead */_layouts/*.html,*/_includes/*.html set ft=liquid
|
||||||
@@ -133,7 +132,7 @@ function! s:DetectPerl6()
|
|||||||
endif
|
endif
|
||||||
if line =~ '^\s*\%(use\s\+\)\=v6\%(\.\d\%(\.\d\)\=\)\=;'
|
if line =~ '^\s*\%(use\s\+\)\=v6\%(\.\d\%(\.\d\)\=\)\=;'
|
||||||
set filetype=perl6 " we matched a 'use v6' declaration
|
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
|
set filetype=perl6 " we found a class, role, module, enum, or grammar declaration
|
||||||
endif
|
endif
|
||||||
break " we either found what we needed, or we found a non-POD, non-comment,
|
break " we either found what we needed, or we found a non-POD, non-comment,
|
||||||
@@ -142,7 +141,7 @@ function! s:DetectPerl6()
|
|||||||
endwhile
|
endwhile
|
||||||
endfunction
|
endfunction
|
||||||
autocmd BufReadPost *.pl,*.pm,*.t call s:DetectPerl6()
|
autocmd BufReadPost *.pl,*.pm,*.t call s:DetectPerl6()
|
||||||
autocmd BufNew,BufRead *.nqp setf perl6
|
autocmd BufNew,BufNewFile,BufRead *.nqp setf perl6
|
||||||
autocmd BufNewFile,BufRead *.proto setfiletype proto
|
autocmd BufNewFile,BufRead *.proto setfiletype proto
|
||||||
au BufNewFile,BufRead *.ps1 set ft=ps1
|
au BufNewFile,BufRead *.ps1 set ft=ps1
|
||||||
au BufNewFile,BufRead *.psd1 set ft=ps1
|
au BufNewFile,BufRead *.psd1 set ft=ps1
|
||||||
@@ -178,14 +177,15 @@ au BufNewFile,BufRead [Bb]uildfile call s:setf('ruby')
|
|||||||
au BufNewFile,BufRead Appraisals call s:setf('ruby')
|
au BufNewFile,BufRead Appraisals call s:setf('ruby')
|
||||||
au BufNewFile,BufRead Podfile,*.podspec call s:setf('ruby')
|
au BufNewFile,BufRead Podfile,*.podspec call s:setf('ruby')
|
||||||
au BufRead,BufNewFile *.rs set filetype=rust
|
au BufRead,BufNewFile *.rs set filetype=rust
|
||||||
au BufRead,BufNewFile *.sbt set filetype=sbt
|
au BufRead,BufNewFile *.sbt set filetype=sbt.scala
|
||||||
fun! s:DetectScala()
|
fun! s:DetectScala()
|
||||||
if getline(1) == '#!/usr/bin/env scala'
|
if getline(1) =~# '^#!\(/usr\)\?/bin/env\s\+scalas\?'
|
||||||
set filetype=scala
|
set filetype=scala
|
||||||
endif
|
endif
|
||||||
endfun
|
endfun
|
||||||
au BufRead,BufNewFile *.scala,*.sbt set filetype=scala
|
au BufRead,BufNewFile *.scala set filetype=scala
|
||||||
au BufRead,BufNewFile * call s:DetectScala()
|
au BufRead,BufNewFile * call s:DetectScala()
|
||||||
|
au BufRead,BufNewFile *.sbt setfiletype sbt.scala
|
||||||
autocmd BufNewFile,BufRead *.slim set filetype=slim
|
autocmd BufNewFile,BufRead *.slim set filetype=slim
|
||||||
autocmd BufNewFile,BufReadPost *.styl set filetype=stylus
|
autocmd BufNewFile,BufReadPost *.styl set filetype=stylus
|
||||||
autocmd BufNewFile,BufReadPost *.stylus set filetype=stylus
|
autocmd BufNewFile,BufReadPost *.stylus set filetype=stylus
|
||||||
@@ -201,6 +201,7 @@ au BufNewFile,BufRead *.timer set filetype=systemd
|
|||||||
au BufRead,BufNewFile *.textile set filetype=textile
|
au BufRead,BufNewFile *.textile set filetype=textile
|
||||||
au BufNewFile,BufRead *.thrift setlocal filetype=thrift
|
au BufNewFile,BufRead *.thrift setlocal filetype=thrift
|
||||||
autocmd BufNewFile,BufRead {.,}tmux.conf{.*,} setlocal filetype=tmux
|
autocmd BufNewFile,BufRead {.,}tmux.conf{.*,} setlocal filetype=tmux
|
||||||
|
autocmd BufNewFile,BufRead {.,}tmux.conf{.*,} setlocal commentstring=#\ %s
|
||||||
autocmd BufNewFile,BufRead *.toml set filetype=toml
|
autocmd BufNewFile,BufRead *.toml set filetype=toml
|
||||||
autocmd BufNewFile,BufRead Cargo.lock set filetype=toml
|
autocmd BufNewFile,BufRead Cargo.lock set filetype=toml
|
||||||
autocmd BufNewFile,BufRead *.twig set filetype=twig
|
autocmd BufNewFile,BufRead *.twig set filetype=twig
|
||||||
|
|||||||
2627
ftplugin/csv.vim
2627
ftplugin/csv.vim
File diff suppressed because it is too large
Load Diff
@@ -19,6 +19,9 @@ setlocal omnifunc=CucumberComplete
|
|||||||
let b:undo_ftplugin = "setl fo< com< cms< ofu<"
|
let b:undo_ftplugin = "setl fo< com< cms< ofu<"
|
||||||
|
|
||||||
let b:cucumber_root = expand('%:p:h:s?.*[\/]\%(features\|stories\)\zs[\/].*??')
|
let b:cucumber_root = expand('%:p:h:s?.*[\/]\%(features\|stories\)\zs[\/].*??')
|
||||||
|
if !exists("b:cucumber_steps_glob")
|
||||||
|
let b:cucumber_steps_glob = b:cucumber_root.'/**/*.rb'
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists("g:no_plugin_maps") && !exists("g:no_cucumber_maps")
|
if !exists("g:no_plugin_maps") && !exists("g:no_cucumber_maps")
|
||||||
cnoremap <SID>foldopen <Bar>if &foldopen =~# 'tag'<Bar>exe 'norm! zv'<Bar>endif
|
cnoremap <SID>foldopen <Bar>if &foldopen =~# 'tag'<Bar>exe 'norm! zv'<Bar>endif
|
||||||
@@ -52,7 +55,7 @@ endfunction
|
|||||||
function! s:allsteps()
|
function! s:allsteps()
|
||||||
let step_pattern = '\C^\s*\K\k*\>\s*(\=\s*\zs\S.\{-\}\ze\s*)\=\s*\%(do\|{\)\s*\%(|[^|]*|\s*\)\=\%($\|#\)'
|
let step_pattern = '\C^\s*\K\k*\>\s*(\=\s*\zs\S.\{-\}\ze\s*)\=\s*\%(do\|{\)\s*\%(|[^|]*|\s*\)\=\%($\|#\)'
|
||||||
let steps = []
|
let steps = []
|
||||||
for file in split(glob(b:cucumber_root.'/**/*.rb'),"\n")
|
for file in split(glob(b:cucumber_steps_glob),"\n")
|
||||||
let lines = readfile(file)
|
let lines = readfile(file)
|
||||||
let num = 0
|
let num = 0
|
||||||
for line in lines
|
for line in lines
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ endif
|
|||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
set cpo-=C
|
set cpo-=C
|
||||||
|
|
||||||
|
setlocal iskeyword+=-
|
||||||
|
|
||||||
" Define some defaults in case the included ftplugins don't set them.
|
" Define some defaults in case the included ftplugins don't set them.
|
||||||
let s:undo_ftplugin = ""
|
let s:undo_ftplugin = ""
|
||||||
let s:browsefilter = "All Files (*.*)\t*.*\n"
|
let s:browsefilter = "All Files (*.*)\t*.*\n"
|
||||||
|
|||||||
@@ -64,14 +64,24 @@ setlocal efm+=%-G%.%#
|
|||||||
|
|
||||||
" Vim Windows {{{
|
" Vim Windows {{{
|
||||||
|
|
||||||
" Width of vertical splits
|
" Type of split, "new" for horiz. "vnew" for vert.
|
||||||
|
if !exists('g:LatexBox_split_type')
|
||||||
|
let g:LatexBox_split_type = "vnew"
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Length of vertical splits
|
||||||
|
if !exists('g:LatexBox_split_length')
|
||||||
|
let g:LatexBox_split_length = 15
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Width of horizontal splits
|
||||||
if !exists('g:LatexBox_split_width')
|
if !exists('g:LatexBox_split_width')
|
||||||
let g:LatexBox_split_width = 30
|
let g:LatexBox_split_width = 30
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Where vertical splits appear
|
" Where splits appear
|
||||||
if !exists('g:LatexBox_split_side')
|
if !exists('g:LatexBox_split_side')
|
||||||
let g:LatexBox_split_side = "leftabove"
|
let g:LatexBox_split_side = "aboveleft"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Resize when split?
|
" Resize when split?
|
||||||
@@ -169,7 +179,13 @@ function! LatexBox_GetTexRoot()
|
|||||||
return fnamemodify(LatexBox_GetMainTexFile(), ':h')
|
return fnamemodify(LatexBox_GetMainTexFile(), ':h')
|
||||||
endfunction
|
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
|
if a:with_dir
|
||||||
return fnamemodify(LatexBox_GetMainTexFile(), ':r')
|
return fnamemodify(LatexBox_GetMainTexFile(), ':r')
|
||||||
else
|
else
|
||||||
@@ -180,48 +196,48 @@ endfunction
|
|||||||
function! LatexBox_GetAuxFile()
|
function! LatexBox_GetAuxFile()
|
||||||
" 1. check for b:build_dir variable
|
" 1. check for b:build_dir variable
|
||||||
if exists('b:build_dir') && isdirectory(b:build_dir)
|
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
|
endif
|
||||||
|
|
||||||
" 2. check for g:LatexBox_build_dir variable
|
" 2. check for g:LatexBox_build_dir variable
|
||||||
if exists('g:LatexBox_build_dir') && isdirectory(g:LatexBox_build_dir)
|
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
|
endif
|
||||||
|
|
||||||
" 3. use the base name of main tex file
|
" 3. use the base name of main tex file
|
||||||
return LatexBox_GetTexBasename(1) . '.aux'
|
return LatexBox_GetBuildBasename(1) . '.aux'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! LatexBox_GetLogFile()
|
function! LatexBox_GetLogFile()
|
||||||
" 1. check for b:build_dir variable
|
" 1. check for b:build_dir variable
|
||||||
if exists('b:build_dir') && isdirectory(b:build_dir)
|
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
|
endif
|
||||||
|
|
||||||
" 2. check for g:LatexBox_build_dir variable
|
" 2. check for g:LatexBox_build_dir variable
|
||||||
if exists('g:LatexBox_build_dir') && isdirectory(g:LatexBox_build_dir)
|
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
|
endif
|
||||||
|
|
||||||
" 3. use the base name of main tex file
|
" 3. use the base name of main tex file
|
||||||
return LatexBox_GetTexBasename(1) . '.log'
|
return LatexBox_GetBuildBasename(1) . '.log'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! LatexBox_GetOutputFile()
|
function! LatexBox_GetOutputFile()
|
||||||
" 1. check for b:build_dir variable
|
" 1. check for b:build_dir variable
|
||||||
if exists('b:build_dir') && isdirectory(b:build_dir)
|
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
|
\ . '.' . g:LatexBox_output_type
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" 2. check for g:LatexBox_build_dir variable
|
" 2. check for g:LatexBox_build_dir variable
|
||||||
if exists('g:LatexBox_build_dir') && isdirectory(g:LatexBox_build_dir)
|
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
|
\ . '.' . g:LatexBox_output_type
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" 3. use the base name of main tex file
|
" 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
|
endfunction
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
@@ -229,12 +245,18 @@ endfunction
|
|||||||
|
|
||||||
" Default pdf viewer
|
" Default pdf viewer
|
||||||
if !exists('g:LatexBox_viewer')
|
if !exists('g:LatexBox_viewer')
|
||||||
if has('win32')
|
" On windows, 'running' a file will open it with the default program
|
||||||
" On windows, 'running' a file will open it with the default program
|
let s:viewer = ''
|
||||||
let g:LatexBox_viewer = ''
|
if has('unix')
|
||||||
else
|
" echo -n necessary as uname -s will append \n otherwise
|
||||||
let g:LatexBox_viewer = 'xdg-open'
|
let s:uname = system('echo -n $(uname -s)')
|
||||||
|
if s:uname == "Darwin"
|
||||||
|
let s:viewer = 'open'
|
||||||
|
else
|
||||||
|
let s:viewer = 'xdg-open'
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
let g:LatexBox_viewer = s:viewer
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! LatexBox_View(...)
|
function! LatexBox_View(...)
|
||||||
@@ -248,7 +270,12 @@ function! LatexBox_View(...)
|
|||||||
if has('win32')
|
if has('win32')
|
||||||
let cmd = '!start /b ' . cmd . ' >nul'
|
let cmd = '!start /b ' . cmd . ' >nul'
|
||||||
else
|
else
|
||||||
let cmd = '!' . cmd . ' &>/dev/null &'
|
let cmd = '!' . cmd . ' '
|
||||||
|
if fnamemodify(&shell, ':t') ==# 'fish'
|
||||||
|
let cmd .= ' >/dev/null ^/dev/null &'
|
||||||
|
else
|
||||||
|
let cmd .= ' &>/dev/null &'
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
silent execute cmd
|
silent execute cmd
|
||||||
if !has("gui_running")
|
if !has("gui_running")
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ if !exists('g:LatexBox_cite_pattern')
|
|||||||
let g:LatexBox_cite_pattern = '\C\\\a*cite\a*\*\?\(\[[^\]]*\]\)*\_\s*{'
|
let g:LatexBox_cite_pattern = '\C\\\a*cite\a*\*\?\(\[[^\]]*\]\)*\_\s*{'
|
||||||
endif
|
endif
|
||||||
if !exists('g:LatexBox_ref_pattern')
|
if !exists('g:LatexBox_ref_pattern')
|
||||||
let g:LatexBox_ref_pattern = '\C\\v\?\(eq\|page\|[cC]\|labelc\)\?ref\*\?\_\s*{'
|
let g:LatexBox_ref_pattern = '\C\\v\?\(eq\|page\|[cC]\|labelc\|name\|auto\)\?ref\*\?\_\s*{'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists('g:LatexBox_completion_environments')
|
if !exists('g:LatexBox_completion_environments')
|
||||||
@@ -255,14 +255,14 @@ function! LatexBox_BibSearch(regexp)
|
|||||||
if has('win32')
|
if has('win32')
|
||||||
let l:old_shellslash = &l:shellslash
|
let l:old_shellslash = &l:shellslash
|
||||||
setlocal noshellslash
|
setlocal noshellslash
|
||||||
silent execute '! cd ' shellescape(LatexBox_GetTexRoot()) .
|
call system('cd ' . shellescape(LatexBox_GetTexRoot()) .
|
||||||
\ ' & bibtex -terse '
|
\ ' & bibtex -terse '
|
||||||
\ . fnamemodify(auxfile, ':t') . ' >nul'
|
\ . fnamemodify(auxfile, ':t') . ' >nul')
|
||||||
let &l:shellslash = l:old_shellslash
|
let &l:shellslash = l:old_shellslash
|
||||||
else
|
else
|
||||||
silent execute '! cd ' shellescape(LatexBox_GetTexRoot()) .
|
call system('cd ' . shellescape(LatexBox_GetTexRoot()) .
|
||||||
\ ' ; bibtex -terse '
|
\ ' ; bibtex -terse '
|
||||||
\ . fnamemodify(auxfile, ':t') . ' >/dev/null'
|
\ . fnamemodify(auxfile, ':t') . ' >/dev/null')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let lines = split(substitute(join(readfile(bblfile), "\n"),
|
let lines = split(substitute(join(readfile(bblfile), "\n"),
|
||||||
@@ -459,7 +459,8 @@ function! s:GetLabelCache(file)
|
|||||||
|
|
||||||
if !has_key(s:LabelCache , a:file) || s:LabelCache[a:file][0] != getftime(a:file)
|
if !has_key(s:LabelCache , a:file) || s:LabelCache[a:file][0] != getftime(a:file)
|
||||||
" Open file in temporary split window for label extraction.
|
" Open file in temporary split window for label extraction.
|
||||||
silent execute '1sp +let\ labels=s:ExtractLabels()|let\ inputs=s:ExtractInputs()|quit! ' . fnameescape(a:file)
|
let main_tex_file = LatexBox_GetMainTexFile()
|
||||||
|
silent execute '1sp +let\ b:main_tex_file=main_tex_file|let\ labels=s:ExtractLabels()|let\ inputs=s:ExtractInputs()|quit! ' . fnameescape(a:file)
|
||||||
let s:LabelCache[a:file] = [ getftime(a:file), labels, inputs ]
|
let s:LabelCache[a:file] = [ getftime(a:file), labels, inputs ]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -75,8 +75,8 @@ if g:LatexBox_fold_automatic == 1
|
|||||||
"
|
"
|
||||||
augroup FastFold
|
augroup FastFold
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd InsertEnter *.tex setlocal foldmethod=manual
|
autocmd InsertEnter *.tex if !&diff | setlocal foldmethod=manual | endif
|
||||||
autocmd InsertLeave *.tex setlocal foldmethod=expr
|
autocmd InsertLeave *.tex if !&diff | setlocal foldmethod=expr | endif
|
||||||
augroup end
|
augroup end
|
||||||
else
|
else
|
||||||
setl foldmethod=manual
|
setl foldmethod=manual
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ endfunction
|
|||||||
|
|
||||||
function! LatexBox_Latexmk(force)
|
function! LatexBox_Latexmk(force)
|
||||||
" Define often used names
|
" Define often used names
|
||||||
let basepath = LatexBox_GetTexBasename(1)
|
let basepath = LatexBox_GetBuildBasename(1)
|
||||||
let basename = fnamemodify(basepath, ':t')
|
let basename = fnamemodify(basepath, ':t')
|
||||||
let texroot = shellescape(LatexBox_GetTexRoot())
|
let texroot = shellescape(LatexBox_GetTexRoot())
|
||||||
let mainfile = fnameescape(fnamemodify(LatexBox_GetMainTexFile(), ':t'))
|
let mainfile = fnameescape(fnamemodify(LatexBox_GetMainTexFile(), ':t'))
|
||||||
@@ -166,7 +166,11 @@ function! LatexBox_Latexmk(force)
|
|||||||
elseif match(&shell, '/tcsh$') >= 0
|
elseif match(&shell, '/tcsh$') >= 0
|
||||||
let env = 'setenv max_print_line ' . max_print_line . '; '
|
let env = 'setenv max_print_line ' . max_print_line . '; '
|
||||||
else
|
else
|
||||||
let env = 'max_print_line=' . max_print_line
|
if fnamemodify(&shell, ':t') ==# 'fish'
|
||||||
|
let env = 'set max_print_line ' . max_print_line . '; and '
|
||||||
|
else
|
||||||
|
let env = 'max_print_line=' . max_print_line
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Set environment options
|
" Set environment options
|
||||||
@@ -177,7 +181,11 @@ function! LatexBox_Latexmk(force)
|
|||||||
" Make sure to switch drive as well as directory
|
" Make sure to switch drive as well as directory
|
||||||
let cmd = 'cd /D ' . texroot . ' && '
|
let cmd = 'cd /D ' . texroot . ' && '
|
||||||
else
|
else
|
||||||
let cmd = 'cd ' . texroot . ' && '
|
if fnamemodify(&shell, ':t') ==# 'fish'
|
||||||
|
let cmd = 'cd ' . texroot . '; and '
|
||||||
|
else
|
||||||
|
let cmd = 'cd ' . texroot . ' && '
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
let cmd .= env . ' latexmk'
|
let cmd .= env . ' latexmk'
|
||||||
if ! g:LatexBox_personal_latexmkrc
|
if ! g:LatexBox_personal_latexmkrc
|
||||||
@@ -203,7 +211,11 @@ function! LatexBox_Latexmk(force)
|
|||||||
if has('win32')
|
if has('win32')
|
||||||
let cmd .= ' >nul'
|
let cmd .= ' >nul'
|
||||||
else
|
else
|
||||||
let cmd .= ' &>/dev/null'
|
if fnamemodify(&shell, ':t') ==# 'fish'
|
||||||
|
let cmd .= ' >/dev/null ^/dev/null'
|
||||||
|
else
|
||||||
|
let cmd .= ' &>/dev/null'
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if g:LatexBox_latexmk_async
|
if g:LatexBox_latexmk_async
|
||||||
@@ -357,7 +369,7 @@ function! LatexBox_LatexmkClean(cleanall)
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let basename = LatexBox_GetTexBasename(1)
|
let basename = LatexBox_GetBuildBasename(1)
|
||||||
|
|
||||||
if has_key(g:latexmk_running_pids, basename)
|
if has_key(g:latexmk_running_pids, basename)
|
||||||
echomsg "don't clean when latexmk is running"
|
echomsg "don't clean when latexmk is running"
|
||||||
@@ -490,7 +502,7 @@ function! LatexBox_LatexmkStatus(detailed)
|
|||||||
echo "latexmk is running (" . plist . ")"
|
echo "latexmk is running (" . plist . ")"
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
let basename = LatexBox_GetTexBasename(1)
|
let basename = LatexBox_GetBuildBasename(1)
|
||||||
if has_key(g:latexmk_running_pids, basename)
|
if has_key(g:latexmk_running_pids, basename)
|
||||||
echo "latexmk is running"
|
echo "latexmk is running"
|
||||||
else
|
else
|
||||||
@@ -504,12 +516,12 @@ endfunction
|
|||||||
function! LatexBox_LatexmkStop(silent)
|
function! LatexBox_LatexmkStop(silent)
|
||||||
if empty(g:latexmk_running_pids)
|
if empty(g:latexmk_running_pids)
|
||||||
if !a:silent
|
if !a:silent
|
||||||
let basepath = LatexBox_GetTexBasename(1)
|
let basepath = LatexBox_GetBuildBasename(1)
|
||||||
let basename = fnamemodify(basepath, ':t')
|
let basename = fnamemodify(basepath, ':t')
|
||||||
echoerr "latexmk is not running for `" . basename . "'"
|
echoerr "latexmk is not running for `" . basename . "'"
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
let basepath = LatexBox_GetTexBasename(1)
|
let basepath = LatexBox_GetBuildBasename(1)
|
||||||
let basename = fnamemodify(basepath, ':t')
|
let basename = fnamemodify(basepath, ':t')
|
||||||
if has_key(g:latexmk_running_pids, basepath)
|
if has_key(g:latexmk_running_pids, basepath)
|
||||||
call s:kill_latexmk_process(g:latexmk_running_pids[basepath])
|
call s:kill_latexmk_process(g:latexmk_running_pids[basepath])
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ function! s:ReadTOC(auxfile, texfile, ...)
|
|||||||
if len(tree) > 3 && empty(tree[1])
|
if len(tree) > 3 && empty(tree[1])
|
||||||
call remove(tree, 1)
|
call remove(tree, 1)
|
||||||
endif
|
endif
|
||||||
if len(tree) > 1 && tree[0] =~ '^\\\(numberline\|tocsection\)'
|
if len(tree) > 1 && type(tree[0]) == type("") && tree[0] =~ '^\\\(\(chapter\)\?numberline\|tocsection\)'
|
||||||
let secnum = LatexBox_TreeToTex(tree[1])
|
let secnum = LatexBox_TreeToTex(tree[1])
|
||||||
let secnum = substitute(secnum, '\\\S\+\s', '', 'g')
|
let secnum = substitute(secnum, '\\\S\+\s', '', 'g')
|
||||||
let secnum = substitute(secnum, '\\\S\+{\(.\{-}\)}', '\1', 'g')
|
let secnum = substitute(secnum, '\\\S\+{\(.\{-}\)}', '\1', 'g')
|
||||||
@@ -359,7 +359,7 @@ function! s:ReadTOC(auxfile, texfile, ...)
|
|||||||
" parse section title
|
" parse section title
|
||||||
let text = LatexBox_TreeToTex(tree)
|
let text = LatexBox_TreeToTex(tree)
|
||||||
let text = substitute(text, '^{\+\|}\+$', '', 'g')
|
let text = substitute(text, '^{\+\|}\+$', '', 'g')
|
||||||
let text = substitute(text, '\m^\\\(no\)\?numberline\s*', '', '')
|
let text = substitute(text, '\m^\\\(no\)\?\(chapter\)\?numberline\s*', '', '')
|
||||||
let text = substitute(text, '\*', '', 'g')
|
let text = substitute(text, '\*', '', 'g')
|
||||||
|
|
||||||
" add TOC entry
|
" add TOC entry
|
||||||
@@ -379,6 +379,21 @@ function! LatexBox_TOC(...)
|
|||||||
|
|
||||||
" Check if window already exists
|
" Check if window already exists
|
||||||
let winnr = bufwinnr(bufnr('LaTeX TOC'))
|
let winnr = bufwinnr(bufnr('LaTeX TOC'))
|
||||||
|
" Two types of splits, horizontal and vertical
|
||||||
|
let l:hori = "new"
|
||||||
|
let l:vert = "vnew"
|
||||||
|
|
||||||
|
" Set General Vars and initialize size
|
||||||
|
let l:type = g:LatexBox_split_type
|
||||||
|
let l:size = 10
|
||||||
|
|
||||||
|
" Size detection
|
||||||
|
if l:type == l:hori
|
||||||
|
let l:size = g:LatexBox_split_length
|
||||||
|
elseif l:type == l:vert
|
||||||
|
let l:size = g:LatexBox_split_width
|
||||||
|
endif
|
||||||
|
|
||||||
if winnr >= 0
|
if winnr >= 0
|
||||||
if a:0 == 0
|
if a:0 == 0
|
||||||
silent execute winnr . 'wincmd w'
|
silent execute winnr . 'wincmd w'
|
||||||
@@ -386,13 +401,12 @@ function! LatexBox_TOC(...)
|
|||||||
" Supplying an argument to this function causes toggling instead
|
" Supplying an argument to this function causes toggling instead
|
||||||
" of jumping to the TOC window
|
" of jumping to the TOC window
|
||||||
if g:LatexBox_split_resize
|
if g:LatexBox_split_resize
|
||||||
silent exe "set columns-=" . g:LatexBox_split_width
|
silent exe "set columns-=" . l:size
|
||||||
endif
|
endif
|
||||||
silent execute 'bwipeout' . bufnr('LaTeX TOC')
|
silent execute 'bwipeout' . bufnr('LaTeX TOC')
|
||||||
endif
|
endif
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Read TOC
|
" Read TOC
|
||||||
let [toc, fileindices] = s:ReadTOC(LatexBox_GetAuxFile(),
|
let [toc, fileindices] = s:ReadTOC(LatexBox_GetAuxFile(),
|
||||||
\ LatexBox_GetMainTexFile())
|
\ LatexBox_GetMainTexFile())
|
||||||
@@ -403,9 +417,10 @@ function! LatexBox_TOC(...)
|
|||||||
|
|
||||||
" Create TOC window and set local settings
|
" Create TOC window and set local settings
|
||||||
if g:LatexBox_split_resize
|
if g:LatexBox_split_resize
|
||||||
silent exe "set columns+=" . g:LatexBox_split_width
|
silent exe "set columns+=" . l:size
|
||||||
endif
|
endif
|
||||||
silent exe g:LatexBox_split_side g:LatexBox_split_width . 'vnew LaTeX\ TOC'
|
silent exe g:LatexBox_split_side l:size . l:type . ' LaTeX\ TOC'
|
||||||
|
|
||||||
let b:toc = toc
|
let b:toc = toc
|
||||||
let b:toc_numbers = 1
|
let b:toc_numbers = 1
|
||||||
let b:calling_win = bufwinnr(calling_buf)
|
let b:calling_win = bufwinnr(calling_buf)
|
||||||
|
|||||||
@@ -13,12 +13,13 @@ let b:did_ftplugin = 1
|
|||||||
let b:undo_ftplugin = "setl cms< def< inc< inex< ofu< sua<"
|
let b:undo_ftplugin = "setl cms< def< inc< inex< ofu< sua<"
|
||||||
|
|
||||||
setlocal iskeyword+=-
|
setlocal iskeyword+=-
|
||||||
setlocal commentstring=//\ %s
|
setlocal commentstring=//%s
|
||||||
setlocal define=^\\s*\\%(@mixin\\\|=\\)
|
setlocal define=^\\s*\\%(@mixin\\\|=\\)
|
||||||
setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','')
|
setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','')
|
||||||
setlocal omnifunc=csscomplete#CompleteCSS
|
setlocal omnifunc=csscomplete#CompleteCSS
|
||||||
setlocal suffixesadd=.less
|
setlocal suffixesadd=.less
|
||||||
setlocal comments=s1:/*,mb:*,ex:*/
|
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,://
|
||||||
|
setlocal fo=jcroql
|
||||||
|
|
||||||
let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
|
let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ endif
|
|||||||
"---------------------------------------------
|
"---------------------------------------------
|
||||||
|
|
||||||
" Undo the stuff we changed.
|
" Undo the stuff we changed.
|
||||||
let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf< kp< path<" .
|
let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isk< isf< kp< path<" .
|
||||||
\ " | unlet! b:browsefilter"
|
\ " | unlet! b:browsefilter"
|
||||||
|
|
||||||
" proper matching for matchit plugin
|
" proper matching for matchit plugin
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ setlocal formatoptions-=t
|
|||||||
setlocal formatoptions+=crqol
|
setlocal formatoptions+=crqol
|
||||||
setlocal keywordprg=p6doc
|
setlocal keywordprg=p6doc
|
||||||
|
|
||||||
setlocal comments=:#
|
setlocal comments=:#\|,:#=,:#
|
||||||
setlocal commentstring=#%s
|
setlocal commentstring=#%s
|
||||||
|
|
||||||
" Change the browse dialog on Win32 to show mainly Perl-related files
|
" Change the browse dialog on Win32 to show mainly Perl-related files
|
||||||
@@ -43,7 +43,7 @@ setlocal define=[^A-Za-z_]
|
|||||||
" after/ftplugin/perl6.vim file that contains
|
" after/ftplugin/perl6.vim file that contains
|
||||||
" set isfname-=:
|
" set isfname-=:
|
||||||
set isfname+=:
|
set isfname+=:
|
||||||
setlocal iskeyword=48-57,_,A-Z,a-z,:,-
|
setlocal iskeyword=@,48-57,_,192-255,:,-,'
|
||||||
|
|
||||||
" Set this once, globally.
|
" Set this once, globally.
|
||||||
if !exists("perlpath")
|
if !exists("perlpath")
|
||||||
@@ -65,11 +65,22 @@ if !exists("perlpath")
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let &l:path=perlpath
|
" Append perlpath to the existing path value, if it is set. Since we don't
|
||||||
|
" use += to do it because of the commas in perlpath, we have to handle the
|
||||||
|
" global / local settings, too.
|
||||||
|
if &l:path == ""
|
||||||
|
if &g:path == ""
|
||||||
|
let &l:path=perlpath
|
||||||
|
else
|
||||||
|
let &l:path=&g:path.",".perlpath
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let &l:path=&l:path.",".perlpath
|
||||||
|
endif
|
||||||
"---------------------------------------------
|
"---------------------------------------------
|
||||||
|
|
||||||
" Undo the stuff we changed.
|
" Undo the stuff we changed.
|
||||||
let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isk<" .
|
let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf< isk< kp< path<" .
|
||||||
\ " | unlet! b:browsefilter"
|
\ " | unlet! b:browsefilter"
|
||||||
|
|
||||||
" Restore the saved compatibility options.
|
" Restore the saved compatibility options.
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ if exists("loaded_matchit") && !exists("b:match_words")
|
|||||||
\ ':' .
|
\ ':' .
|
||||||
\ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' .
|
\ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' .
|
||||||
\ ':' .
|
\ ':' .
|
||||||
\ '\<end\>' .
|
\ '\%(^\|[^.\:@$]\)\@<=\<end\:\@!\>' .
|
||||||
\ ',{:},\[:\],(:)'
|
\ ',{:},\[:\],(:)'
|
||||||
|
|
||||||
let b:match_skip =
|
let b:match_skip =
|
||||||
@@ -67,7 +67,7 @@ if !exists('g:ruby_version_paths')
|
|||||||
let g:ruby_version_paths = {}
|
let g:ruby_version_paths = {}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! s:query_path(root)
|
function! s:query_path(root) abort
|
||||||
let code = "print $:.join %q{,}"
|
let code = "print $:.join %q{,}"
|
||||||
if &shell =~# 'sh'
|
if &shell =~# 'sh'
|
||||||
let prefix = 'env PATH='.shellescape($PATH).' '
|
let prefix = 'env PATH='.shellescape($PATH).' '
|
||||||
@@ -92,7 +92,7 @@ function! s:query_path(root)
|
|||||||
endtry
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:build_path(path)
|
function! s:build_path(path) abort
|
||||||
let path = join(map(copy(a:path), 'v:val ==# "." ? "" : v:val'), ',')
|
let path = join(map(copy(a:path), 'v:val ==# "." ? "" : v:val'), ',')
|
||||||
if &g:path !~# '\v^\.%(,/%(usr|emx)/include)=,,$'
|
if &g:path !~# '\v^\.%(,/%(usr|emx)/include)=,,$'
|
||||||
let path = substitute(&g:path,',,$',',','') . ',' . path
|
let path = substitute(&g:path,',,$',',','') . ',' . path
|
||||||
@@ -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 exists('&ofu') && has('ruby') | setl ofu< | endif"
|
||||||
\."| if has('balloon_eval') && exists('+bexpr') | setl bexpr< | endif"
|
\."| if has('balloon_eval') && exists('+bexpr') | setl bexpr< | endif"
|
||||||
|
|
||||||
|
function! s:map(mode, flags, map) abort
|
||||||
|
let from = matchstr(a:map, '\S\+')
|
||||||
|
if empty(mapcheck(from, a:mode))
|
||||||
|
exe a:mode.'map' '<buffer>'.(a:0 ? a:1 : '') a:map
|
||||||
|
let b:undo_ftplugin .= '|sil! '.a:mode.'unmap <buffer> '.from
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
cmap <buffer><script><expr> <Plug><cword> substitute(RubyCursorIdentifier(),'^$',"\022\027",'')
|
||||||
|
cmap <buffer><script><expr> <Plug><cfile> substitute(RubyCursorFile(),'^$',"\022\006",'')
|
||||||
|
let b:undo_ftplugin .= "| sil! cunmap <buffer> <Plug><cword>| sil! cunmap <buffer> <Plug><cfile>"
|
||||||
|
|
||||||
if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
|
if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
|
||||||
|
nmap <buffer><script> <SID>: :<C-U>
|
||||||
|
nmap <buffer><script> <SID>c: :<C-U><C-R>=v:count ? v:count : ''<CR>
|
||||||
|
|
||||||
nnoremap <silent> <buffer> [m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','b','n')<CR>
|
nnoremap <silent> <buffer> [m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','b','n')<CR>
|
||||||
nnoremap <silent> <buffer> ]m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','','n')<CR>
|
nnoremap <silent> <buffer> ]m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','','n')<CR>
|
||||||
nnoremap <silent> <buffer> [M :<C-U>call <SID>searchsyn('\<end\>','rubyDefine','b','n')<CR>
|
nnoremap <silent> <buffer> [M :<C-U>call <SID>searchsyn('\<end\>','rubyDefine','b','n')<CR>
|
||||||
@@ -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'"
|
\."| sil! exe 'xunmap <buffer> iM' | sil! exe 'xunmap <buffer> aM'"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if maparg("\<C-]>",'n') == ''
|
call s:map('c', '', '<C-R><C-W> <Plug><cword>')
|
||||||
cnoremap <buffer> <SID>foldopen <Bar>if &foldopen =~# 'tag'<Bar>exe 'norm! zv'<Bar>endif
|
call s:map('c', '', '<C-R><C-F> <Plug><cfile>')
|
||||||
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
|
|
||||||
|
|
||||||
if maparg("gf",'n') == ''
|
nmap <buffer><script><expr> <SID>tagzv &foldopen =~# 'tag' ? 'zv' : ''
|
||||||
" By using findfile() rather than gf's normal behavior, we prevent
|
call s:map('n', '<silent>', '<C-]> <SID>c:tag <Plug><cword><CR><SID>tagzv')
|
||||||
" erroneously editing a directory.
|
call s:map('n', '<silent>', 'g<C-]> <SID>:tjump <Plug><cword><CR><SID>tagzv')
|
||||||
nnoremap <silent> <buffer> gf :<C-U>exe <SID>gf(v:count1,"gf",'edit')<CR>
|
call s:map('n', '<silent>', 'g] <SID>:tselect <Plug><cword><CR><SID>tagzv')
|
||||||
nnoremap <silent> <buffer> <C-W>f :<C-U>exe <SID>gf(v:count1,"\<Lt>C-W>f",'split')<CR>
|
call s:map('n', '<silent>', '<C-W>] <SID>c:stag <Plug><cword><CR><SID>tagzv')
|
||||||
nnoremap <silent> <buffer> <C-W><C-F> :<C-U>exe <SID>gf(v:count1,"\<Lt>C-W>\<Lt>C-F>",'split')<CR>
|
call s:map('n', '<silent>', '<C-W><C-]> <SID>c:stag <Plug><cword><CR><SID>tagzv')
|
||||||
nnoremap <silent> <buffer> <C-W>gf :<C-U>exe <SID>gf(v:count1,"\<Lt>C-W>gf",'tabedit')<CR>
|
call s:map('n', '<silent>', '<C-W>g<C-]> <SID>:stjump <Plug><cword><CR><SID>tagzv')
|
||||||
let b:undo_ftplugin = b:undo_ftplugin
|
call s:map('n', '<silent>', '<C-W>g] <SID>:stselect <Plug><cword><CR><SID>tagzv')
|
||||||
\."| sil! exe 'nunmap <buffer> gf' | sil! exe 'nunmap <buffer> <C-W>f' | sil! exe 'nunmap <buffer> <C-W><C-F>' | sil! exe 'nunmap <buffer> <C-W>gf'"
|
call s:map('n', '<silent>', '<C-W>} <SID>c:ptag <Plug><cword><CR>')
|
||||||
endif
|
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
|
endif
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
let &cpo = s:cpo_save
|
||||||
@@ -227,7 +232,7 @@ if exists("g:did_ruby_ftplugin_functions")
|
|||||||
endif
|
endif
|
||||||
let g:did_ruby_ftplugin_functions = 1
|
let g:did_ruby_ftplugin_functions = 1
|
||||||
|
|
||||||
function! RubyBalloonexpr()
|
function! RubyBalloonexpr() abort
|
||||||
if !exists('s:ri_found')
|
if !exists('s:ri_found')
|
||||||
let s:ri_found = executable('ri')
|
let s:ri_found = executable('ri')
|
||||||
endif
|
endif
|
||||||
@@ -276,7 +281,7 @@ function! RubyBalloonexpr()
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:searchsyn(pattern,syn,flags,mode)
|
function! s:searchsyn(pattern, syn, flags, mode) abort
|
||||||
let cnt = v:count1
|
let cnt = v:count1
|
||||||
norm! m'
|
norm! m'
|
||||||
if a:mode ==# 'v'
|
if a:mode ==# 'v'
|
||||||
@@ -298,11 +303,11 @@ function! s:searchsyn(pattern,syn,flags,mode)
|
|||||||
endwhile
|
endwhile
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:synname()
|
function! s:synname() abort
|
||||||
return synIDattr(synID(line('.'),col('.'),0),'name')
|
return synIDattr(synID(line('.'),col('.'),0),'name')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:wrap_i(back,forward)
|
function! s:wrap_i(back,forward) abort
|
||||||
execute 'norm k'.a:forward
|
execute 'norm k'.a:forward
|
||||||
let line = line('.')
|
let line = line('.')
|
||||||
execute 'norm '.a:back
|
execute 'norm '.a:back
|
||||||
@@ -312,7 +317,7 @@ function! s:wrap_i(back,forward)
|
|||||||
execute 'norm jV'.a:forward.'k'
|
execute 'norm jV'.a:forward.'k'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:wrap_a(back,forward)
|
function! s:wrap_a(back,forward) abort
|
||||||
execute 'norm '.a:forward
|
execute 'norm '.a:forward
|
||||||
if line('.') < line('$') && getline(line('.')+1) ==# ''
|
if line('.') < line('$') && getline(line('.')+1) ==# ''
|
||||||
let after = 1
|
let after = 1
|
||||||
@@ -330,37 +335,55 @@ function! s:wrap_a(back,forward)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! RubyCursorIdentifier()
|
function! RubyCursorIdentifier() abort
|
||||||
let asciicode = '\%(\w\|[]})\"'."'".']\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)'
|
let asciicode = '\%(\w\|[]})\"'."'".']\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)'
|
||||||
let number = '\%(\%(\w\|[]})\"'."'".']\s*\)\@<!-\)\=\%(\<[[:digit:]_]\+\%(\.[[:digit:]_]\+\)\=\%([Ee][[:digit:]_]\+\)\=\>\|\<0[xXbBoOdD][[:xdigit:]_]\+\>\)\|'.asciicode
|
let number = '\%(\%(\w\|[]})\"'."'".']\s*\)\@<!-\)\=\%(\<[[:digit:]_]\+\%(\.[[:digit:]_]\+\)\=\%([Ee][[:digit:]_]\+\)\=\>\|\<0[xXbBoOdD][[:xdigit:]_]\+\>\)\|'.asciicode
|
||||||
let operator = '\%(\[\]\|<<\|<=>\|[!<>]=\=\|===\=\|[!=]\~\|>>\|\*\*\|\.\.\.\=\|=>\|[~^&|*/%+-]\)'
|
let operator = '\%(\[\]\|<<\|<=>\|[!<>]=\=\|===\=\|[!=]\~\|>>\|\*\*\|\.\.\.\=\|=>\|[~^&|*/%+-]\)'
|
||||||
let method = '\%(\<[_a-zA-Z]\w*\>\%([?!]\|\s*=>\@!\)\=\)'
|
let method = '\%(\.[_a-zA-Z]\w*\s*=>\@!\|\<[_a-zA-Z]\w*\>[?!]\=\)'
|
||||||
let global = '$\%([!$&"'."'".'*+,./:;<=>?@\`~]\|-\=\w\+\>\)'
|
let global = '$\%([!$&"'."'".'*+,./:;<=>?@\`~]\|-\=\w\+\>\)'
|
||||||
let symbolizable = '\%(\%(@@\=\)\w\+\>\|'.global.'\|'.method.'\|'.operator.'\)'
|
let symbolizable = '\%(\%(@@\=\)\w\+\>\|'.global.'\|'.method.'\|'.operator.'\)'
|
||||||
let pattern = '\C\s*\%('.number.'\|\%(:\@<!:\)\='.symbolizable.'\)'
|
let pattern = '\C\s*\%('.number.'\|\%(:\@<!:\)\='.symbolizable.'\)'
|
||||||
let [lnum, col] = searchpos(pattern,'bcn',line('.'))
|
let [lnum, col] = searchpos(pattern,'bcn',line('.'))
|
||||||
let raw = matchstr(getline('.')[col-1 : ],pattern)
|
let raw = matchstr(getline('.')[col-1 : ],pattern)
|
||||||
let stripped = substitute(substitute(raw,'\s\+=$','=',''),'^\s*:\=','','')
|
let stripped = substitute(substitute(raw,'\s\+=$','=',''),'^\s*[:.]\=','','')
|
||||||
return stripped == '' ? expand("<cword>") : stripped
|
return stripped == '' ? expand("<cword>") : stripped
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:gf(count,map,edit) abort
|
function! RubyCursorFile() abort
|
||||||
if getline('.') =~# '^\s*require_relative\s*\(["'']\).*\1\s*$'
|
let isfname = &isfname
|
||||||
let target = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1')
|
try
|
||||||
return a:edit.' %:h/'.target.'.rb'
|
set isfname+=:
|
||||||
elseif getline('.') =~# '^\s*\%(require[( ]\|load[( ]\|autoload[( ]:\w\+,\)\s*\s*\%(::\)\=File\.expand_path(\(["'']\)\.\./.*\1,\s*__FILE__)\s*$'
|
let cfile = expand('<cfile>')
|
||||||
let target = matchstr(getline('.'),'\(["'']\)\.\./\zs.\{-\}\ze\1')
|
finally
|
||||||
return a:edit.' %:h/'.target.'.rb'
|
let isfname = &isfname
|
||||||
|
endtry
|
||||||
|
let pre = matchstr(strpart(getline('.'), 0, col('.')-1), '.*\f\@<!')
|
||||||
|
let post = matchstr(strpart(getline('.'), col('.')), '\f\@!.*')
|
||||||
|
let ext = getline('.') =~# '^\s*\%(require\|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*$'
|
elseif getline('.') =~# '^\s*\%(require \|load \|autoload :\w\+,\)\s*\(["'']\).*\1\s*$'
|
||||||
let target = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1')
|
let cfile = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1') . ext
|
||||||
|
elseif pre.post =~# '\<File.expand_path[( ].*[''"]\{2\}, *__FILE__\>' && cfile =~# '^\.\.'
|
||||||
|
let cfile = expand('%:p:h') . strpart(cfile, 2)
|
||||||
else
|
else
|
||||||
let target = expand('<cfile>')
|
return substitute(cfile, '\C\v^(.*):(\d+)%(:in)=$', '+\2 \1', '')
|
||||||
endif
|
endif
|
||||||
let found = findfile(target, &path, a:count)
|
let cwdpat = '^\M' . substitute(getcwd(), '[\/]', '\\[\\/]', 'g').'\ze\[\/]'
|
||||||
if found ==# ''
|
let cfile = substitute(cfile, cwdpat, '.', '')
|
||||||
return 'norm! '.a:count.a:map
|
if fnameescape(cfile) !=# cfile
|
||||||
|
return '+ '.fnameescape(cfile)
|
||||||
else
|
else
|
||||||
return a:edit.' '.fnameescape(found)
|
return cfile
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,33 @@
|
|||||||
setlocal formatoptions+=ro
|
" Vim filetype plugin
|
||||||
setlocal commentstring=//%s
|
" Language: Scala
|
||||||
let &l:include = '^\s*import'
|
" Maintainer: Derek Wyatt
|
||||||
let &l:includeexpr = 'substitute(v:fname,"\\.","/","g")'
|
" URL: https://github.com/derekwyatt/vim-scala
|
||||||
|
" License: Apache 2
|
||||||
|
" ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if exists('b:did_ftplugin') || &cp
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
" j is fairly new in Vim, so don't complain if it's not there
|
||||||
|
setlocal formatoptions-=t formatoptions+=croqnl
|
||||||
|
silent! setlocal formatoptions+=j
|
||||||
|
|
||||||
|
" Just like c.vim, but additionally doesn't wrap text onto /** line when
|
||||||
|
" formatting. Doesn't bungle bulleted lists when formatting.
|
||||||
|
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/**,mb:*,ex:*/,s1:/*,mb:*,ex:*/,://
|
||||||
|
setlocal commentstring=//\ %s
|
||||||
|
|
||||||
|
setlocal shiftwidth=2 softtabstop=2 expandtab
|
||||||
|
|
||||||
|
setlocal include='^\s*import'
|
||||||
|
setlocal includeexpr='substitute(v:fname,"\\.","/","g")'
|
||||||
|
|
||||||
setlocal path+=src/main/scala,src/test/scala
|
setlocal path+=src/main/scala,src/test/scala
|
||||||
setlocal suffixesadd=.scala
|
setlocal suffixesadd=.scala
|
||||||
|
|
||||||
set makeprg=sbt\ -Dsbt.log.noformat=true\ compile
|
compiler sbt
|
||||||
set efm=%E\ %#[error]\ %f:%l:\ %m,%C\ %#[error]\ %p^,%-C%.%#,%Z,
|
|
||||||
\%W\ %#[warn]\ %f:%l:\ %m,%C\ %#[warn]\ %p^,%-C%.%#,%Z,
|
|
||||||
\%-G%.%#
|
|
||||||
|
|
||||||
if globpath(&rtp, 'plugin/fuf.vim') != ''
|
if globpath(&rtp, 'plugin/fuf.vim') != ''
|
||||||
"
|
"
|
||||||
@@ -127,49 +146,6 @@ if globpath(&rtp, 'plugin/fuf.vim') != ''
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" If you want to disable the default key mappings, write the following line in
|
|
||||||
" your ~/.vimrc
|
|
||||||
" let g:scala_use_default_keymappings = 0
|
|
||||||
if get(g:, 'scala_use_default_keymappings', 1)
|
|
||||||
nnoremap <buffer> <Leader>jt :call JustifyCurrentLine()<cr>
|
|
||||||
endif
|
|
||||||
|
|
||||||
"
|
|
||||||
" TagBar
|
|
||||||
"
|
|
||||||
let g:tagbar_type_scala = {
|
|
||||||
\ 'ctagstype' : 'scala',
|
|
||||||
\ 'kinds' : [
|
|
||||||
\ 'p:packages:1',
|
|
||||||
\ 'V:values',
|
|
||||||
\ 'v:variables',
|
|
||||||
\ 'T:types',
|
|
||||||
\ 't:traits',
|
|
||||||
\ 'o:objects',
|
|
||||||
\ 'a:aclasses',
|
|
||||||
\ 'c:classes',
|
|
||||||
\ 'r:cclasses',
|
|
||||||
\ 'm:methods'
|
|
||||||
\ ],
|
|
||||||
\ 'sro' : '.',
|
|
||||||
\ 'kind2scope' : {
|
|
||||||
\ 'T' : 'type',
|
|
||||||
\ 't' : 'trait',
|
|
||||||
\ 'o' : 'object',
|
|
||||||
\ 'a' : 'abstract class',
|
|
||||||
\ 'c' : 'class',
|
|
||||||
\ 'r' : 'case class'
|
|
||||||
\ },
|
|
||||||
\ 'scope2kind' : {
|
|
||||||
\ 'type' : 'T',
|
|
||||||
\ 'trait' : 't',
|
|
||||||
\ 'object' : 'o',
|
|
||||||
\ 'abstract class' : 'a',
|
|
||||||
\ 'class' : 'c',
|
|
||||||
\ 'case class' : 'r'
|
|
||||||
\ }
|
|
||||||
\ }
|
|
||||||
|
|
||||||
function! s:CreateOrExpression(keywords)
|
function! s:CreateOrExpression(keywords)
|
||||||
return '('.join(a:keywords, '|').')'
|
return '('.join(a:keywords, '|').')'
|
||||||
endfunction
|
endfunction
|
||||||
@@ -191,5 +167,6 @@ function! s:NextSection(backwards)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
noremap <script> <buffer> <silent> ]] :call <SID>NextSection(0)<cr>
|
noremap <script> <buffer> <silent> ]] :call <SID>NextSection(0)<cr>
|
||||||
|
|
||||||
noremap <script> <buffer> <silent> [[ :call <SID>NextSection(1)<cr>
|
noremap <script> <buffer> <silent> [[ :call <SID>NextSection(1)<cr>
|
||||||
|
|
||||||
|
" vim:set sw=2 sts=2 ts=8 et:
|
||||||
|
|||||||
31
ftplugin/scala/tagbar.vim
Normal file
31
ftplugin/scala/tagbar.vim
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
"
|
||||||
|
" Support for Tagbar -- https://github.com/majutsushi/tagbar
|
||||||
|
"
|
||||||
|
" Hat tip to Leonard Ehrenfried for the built-in ctags deffile:
|
||||||
|
" https://leonard.io/blog/2013/04/editing-scala-with-vim/
|
||||||
|
"
|
||||||
|
if !exists(':Tagbar')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let g:tagbar_type_scala = {
|
||||||
|
\ 'ctagstype' : 'scala',
|
||||||
|
\ 'sro' : '.',
|
||||||
|
\ 'kinds' : [
|
||||||
|
\ 'p:packages',
|
||||||
|
\ 'T:types:1',
|
||||||
|
\ 't:traits',
|
||||||
|
\ 'o:objects',
|
||||||
|
\ 'O:case objects',
|
||||||
|
\ 'c:classes',
|
||||||
|
\ 'C:case classes',
|
||||||
|
\ 'm:methods',
|
||||||
|
\ 'V:values:1',
|
||||||
|
\ 'v:variables:1'
|
||||||
|
\ ]
|
||||||
|
\ }
|
||||||
|
|
||||||
|
" In case you've updated/customized your ~/.ctags and prefer to use it.
|
||||||
|
if get(g:, 'scala_use_builtin_tagbar_defs', 1)
|
||||||
|
let g:tagbar_type_scala.deffile = expand('<sfile>:p:h:h:h') . '/ctags/scala.ctags'
|
||||||
|
endif
|
||||||
@@ -11,6 +11,8 @@ let b:did_ftplugin = 1
|
|||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
|
setlocal commentstring=#\ %s
|
||||||
|
|
||||||
" Add NERDCommenter delimiters
|
" Add NERDCommenter delimiters
|
||||||
|
|
||||||
let s:delims = { 'left': '#' }
|
let s:delims = { 'left': '#' }
|
||||||
|
|||||||
@@ -1,2 +1,19 @@
|
|||||||
|
if exists("b:did_ftplugin")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
let s:cpo_save = &cpo
|
||||||
|
set cpo-=C
|
||||||
|
|
||||||
compiler typescript
|
compiler typescript
|
||||||
setlocal commentstring=//\ %s
|
setlocal commentstring=//\ %s
|
||||||
|
|
||||||
|
" Set 'formatoptions' to break comment lines but not other lines,
|
||||||
|
" " and insert the comment leader when hitting <CR> or using "o".
|
||||||
|
setlocal formatoptions-=t formatoptions+=croql
|
||||||
|
|
||||||
|
let b:undo_ftplugin = "setl fo< ofu< com< cms<"
|
||||||
|
|
||||||
|
let &cpo = s:cpo_save
|
||||||
|
unlet s:cpo_save
|
||||||
|
|||||||
62
indent/blade.vim
Normal file
62
indent/blade.vim
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
" Language: Blade
|
||||||
|
" Author: Barry Deeney <sitemaster16@gmail.com>
|
||||||
|
" Version: 0.1
|
||||||
|
" Description: BLADE indent file based on HTML indentation...
|
||||||
|
|
||||||
|
" Check if this file has already been loaded
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Include HTML
|
||||||
|
runtime! indent/html.vim
|
||||||
|
runtime! indent/php.vim
|
||||||
|
silent! unlet b:did_indent
|
||||||
|
|
||||||
|
" What function do we need to use to detect indentation?
|
||||||
|
setlocal indentexpr=BladeIndent()
|
||||||
|
|
||||||
|
" What keys would trigger indentation?
|
||||||
|
setlocal indentkeys=o,O,<Return>,<>>,{,},!^F,0{,0},0),:,!^F,o,O,e,*<Return>,=?>,=<?,=*/
|
||||||
|
|
||||||
|
" THE MAIN INDENT FUNCTION. Return the amount of indent for v:lnum.
|
||||||
|
func! BladeIndent()
|
||||||
|
" What is the current line?
|
||||||
|
let current_line = v:lnum
|
||||||
|
|
||||||
|
" What is the current text?
|
||||||
|
let current_text = tolower(getline(current_line))
|
||||||
|
|
||||||
|
" What was the last non blank line?
|
||||||
|
let previous_line = prevnonblank(current_line)
|
||||||
|
|
||||||
|
" What was the last non blank text?
|
||||||
|
let previous_text = tolower(getline(previous_line))
|
||||||
|
|
||||||
|
" How large are indents??
|
||||||
|
let indent_size = &sw
|
||||||
|
|
||||||
|
" Check if we have a PHPIndent value...
|
||||||
|
let indent = GetPhpIndent()
|
||||||
|
|
||||||
|
" check if we have indent
|
||||||
|
if indent == -1
|
||||||
|
" Check if we have BLADE
|
||||||
|
if current_text =~ '^\s*@' || previous_text =~ '^\s*@'
|
||||||
|
" We need to add to the indent
|
||||||
|
return indent_size * indent(previous_text)
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Check if we have HTML
|
||||||
|
if current_text =~ '^\s*<' || previous_text =~ '^\s*<'
|
||||||
|
" We now give the honors to HtmlIndent()
|
||||||
|
let indent = HtmlIndent()
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Give the indent back!
|
||||||
|
return indent
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
" Make sure we store that flag!
|
||||||
|
let b:did_indent = 1
|
||||||
@@ -25,6 +25,7 @@ let s:block_skip = "synIDattr(synID(line('.'),col('.'),1),'name') =~? '" . s:s
|
|||||||
let s:block_start = 'do\|fn'
|
let s:block_start = 'do\|fn'
|
||||||
let s:block_middle = 'else\|match\|elsif\|catch\|after\|rescue'
|
let s:block_middle = 'else\|match\|elsif\|catch\|after\|rescue'
|
||||||
let s:block_end = 'end'
|
let s:block_end = 'end'
|
||||||
|
let s:symbols_end = '\]\|}'
|
||||||
let s:arrow = '^.*->$'
|
let s:arrow = '^.*->$'
|
||||||
let s:pipeline = '^\s*|>.*$'
|
let s:pipeline = '^\s*|>.*$'
|
||||||
|
|
||||||
@@ -59,7 +60,11 @@ function! GetElixirIndent()
|
|||||||
|
|
||||||
let ind += opened_symbol * &sw
|
let ind += opened_symbol * &sw
|
||||||
|
|
||||||
if current_line =~ '^\s*\(\]\|}\)'
|
if last_line =~ '^\s*\(' . s:symbols_end . '\)'
|
||||||
|
let ind += &sw
|
||||||
|
endif
|
||||||
|
|
||||||
|
if current_line =~ '^\s*\(' . s:symbols_end . '\)'
|
||||||
let ind -= &sw
|
let ind -= &sw
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
" - general line splits (line ends in an operator)
|
" - general line splits (line ends in an operator)
|
||||||
|
|
||||||
if exists("b:did_indent")
|
if exists("b:did_indent")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let b:did_indent = 1
|
let b:did_indent = 1
|
||||||
|
|
||||||
@@ -21,45 +21,58 @@ setlocal indentexpr=GoIndent(v:lnum)
|
|||||||
setlocal indentkeys+=<:>,0=},0=)
|
setlocal indentkeys+=<:>,0=},0=)
|
||||||
|
|
||||||
if exists("*GoIndent")
|
if exists("*GoIndent")
|
||||||
finish
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" use shiftwidth function only if it's available
|
||||||
|
if exists('*shiftwidth')
|
||||||
|
func s:sw()
|
||||||
|
return shiftwidth()
|
||||||
|
endfunc
|
||||||
|
else
|
||||||
|
func s:sw()
|
||||||
|
return &sw
|
||||||
|
endfunc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! GoIndent(lnum)
|
function! GoIndent(lnum)
|
||||||
let prevlnum = prevnonblank(a:lnum-1)
|
let prevlnum = prevnonblank(a:lnum-1)
|
||||||
if prevlnum == 0
|
if prevlnum == 0
|
||||||
" top of file
|
" top of file
|
||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" grab the previous and current line, stripping comments.
|
" grab the previous and current line, stripping comments.
|
||||||
let prevl = substitute(getline(prevlnum), '//.*$', '', '')
|
let prevl = substitute(getline(prevlnum), '//.*$', '', '')
|
||||||
let thisl = substitute(getline(a:lnum), '//.*$', '', '')
|
let thisl = substitute(getline(a:lnum), '//.*$', '', '')
|
||||||
let previ = indent(prevlnum)
|
let previ = indent(prevlnum)
|
||||||
|
|
||||||
let ind = previ
|
let ind = previ
|
||||||
|
|
||||||
if prevl =~ '[({]\s*$'
|
if prevl =~ '[({]\s*$'
|
||||||
" previous line opened a block
|
" previous line opened a block
|
||||||
let ind += &sw
|
let ind += s:sw()
|
||||||
endif
|
endif
|
||||||
if prevl =~# '^\s*\(case .*\|default\):$'
|
if prevl =~# '^\s*\(case .*\|default\):$'
|
||||||
" previous line is part of a switch statement
|
" previous line is part of a switch statement
|
||||||
let ind += &sw
|
let ind += s:sw()
|
||||||
endif
|
endif
|
||||||
" TODO: handle if the previous line is a label.
|
" TODO: handle if the previous line is a label.
|
||||||
|
|
||||||
if thisl =~ '^\s*[)}]'
|
if thisl =~ '^\s*[)}]'
|
||||||
" this line closed a block
|
" this line closed a block
|
||||||
let ind -= &sw
|
let ind -= s:sw()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Colons are tricky.
|
" Colons are tricky.
|
||||||
" We want to outdent if it's part of a switch ("case foo:" or "default:").
|
" We want to outdent if it's part of a switch ("case foo:" or "default:").
|
||||||
" We ignore trying to deal with jump labels because (a) they're rare, and
|
" We ignore trying to deal with jump labels because (a) they're rare, and
|
||||||
" (b) they're hard to disambiguate from a composite literal key.
|
" (b) they're hard to disambiguate from a composite literal key.
|
||||||
if thisl =~# '^\s*\(case .*\|default\):$'
|
if thisl =~# '^\s*\(case .*\|default\):$'
|
||||||
let ind -= &sw
|
let ind -= s:sw()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return ind
|
return ind
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" vim:ts=4:sw=4:et
|
||||||
|
|||||||
5
indent/gohtmltmpl.vim
Normal file
5
indent/gohtmltmpl.vim
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
runtime! indent/html.vim
|
||||||
@@ -128,8 +128,10 @@ call add(s:tags, 'nav')
|
|||||||
call add(s:tags, 'output')
|
call add(s:tags, 'output')
|
||||||
call add(s:tags, 'progress')
|
call add(s:tags, 'progress')
|
||||||
call add(s:tags, 'picture')
|
call add(s:tags, 'picture')
|
||||||
|
call add(s:tags, 'rb')
|
||||||
call add(s:tags, 'rp')
|
call add(s:tags, 'rp')
|
||||||
call add(s:tags, 'rt')
|
call add(s:tags, 'rt')
|
||||||
|
call add(s:tags, 'rtc')
|
||||||
call add(s:tags, 'ruby')
|
call add(s:tags, 'ruby')
|
||||||
call add(s:tags, 'section')
|
call add(s:tags, 'section')
|
||||||
call add(s:tags, 'source')
|
call add(s:tags, 'source')
|
||||||
|
|||||||
@@ -49,11 +49,11 @@ let s:skip_expr = "synIDattr(synID(line('.'),col('.'),1),'name') =~ '".s:syng_st
|
|||||||
let s:line_term = '\s*\%(\%(\/\/\).*\)\=$'
|
let s:line_term = '\s*\%(\%(\/\/\).*\)\=$'
|
||||||
|
|
||||||
" Regex that defines continuation lines, not including (, {, or [.
|
" Regex that defines continuation lines, not including (, {, or [.
|
||||||
let s:continuation_regex = '\%([\\*+/.:]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)' . s:line_term
|
let s:continuation_regex = '\%([\\*+/.:]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\|[^=]=[^=].*,\)' . s:line_term
|
||||||
|
|
||||||
" Regex that defines continuation lines.
|
" Regex that defines continuation lines.
|
||||||
" TODO: this needs to deal with if ...: and so on
|
" TODO: this needs to deal with if ...: and so on
|
||||||
let s:msl_regex = '\%([\\*+/.:([]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)' . s:line_term
|
let s:msl_regex = s:continuation_regex
|
||||||
|
|
||||||
let s:one_line_scope_regex = '\<\%(if\|else\|for\|while\)\>[^{;]*' . s:line_term
|
let s:one_line_scope_regex = '\<\%(if\|else\|for\|while\)\>[^{;]*' . s:line_term
|
||||||
|
|
||||||
|
|||||||
169
indent/json.vim
Normal file
169
indent/json.vim
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
" Vim indent file
|
||||||
|
" Language: JSON
|
||||||
|
" Mantainer: Eli Parra <eli@elzr.com> https://github.com/elzr/vim-json
|
||||||
|
" Last Change: 2014-05-13: merged Fix for square bracket matching by Jakar
|
||||||
|
" https://github.com/jakar/vim-json/commit/20b650e22aa750c4ab6a66aa646bdd95d7cd548a#diff-e81fc111b2052e306d126bd9989f7b7c
|
||||||
|
" Original Author: Rogerz Zhang <rogerz.zhang at gmail.com> http://github.com/rogerz/vim-json
|
||||||
|
" Acknowledgement: Based off of vim-javascript maintained by Darrick Wiebe
|
||||||
|
" http://www.vim.org/scripts/script.php?script_id=2765
|
||||||
|
|
||||||
|
" 0. Initialization {{{1
|
||||||
|
" =================
|
||||||
|
|
||||||
|
" Only load this indent file when no other was loaded.
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
setlocal nosmartindent
|
||||||
|
|
||||||
|
" Now, set up our indentation expression and keys that trigger it.
|
||||||
|
setlocal indentexpr=GetJSONIndent()
|
||||||
|
setlocal indentkeys=0{,0},0),0[,0],!^F,o,O,e
|
||||||
|
|
||||||
|
" Only define the function once.
|
||||||
|
if exists("*GetJSONIndent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:cpo_save = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
" 1. Variables {{{1
|
||||||
|
" ============
|
||||||
|
|
||||||
|
let s:line_term = '\s*\%(\%(\/\/\).*\)\=$'
|
||||||
|
" Regex that defines blocks.
|
||||||
|
let s:block_regex = '\%({\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=' . s:line_term
|
||||||
|
|
||||||
|
" 2. Auxiliary Functions {{{1
|
||||||
|
" ======================
|
||||||
|
|
||||||
|
" Check if the character at lnum:col is inside a string.
|
||||||
|
function s:IsInString(lnum, col)
|
||||||
|
return synIDattr(synID(a:lnum, a:col, 1), 'name') == jsonString
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Find line above 'lnum' that isn't empty, or in a string.
|
||||||
|
function s:PrevNonBlankNonString(lnum)
|
||||||
|
let lnum = prevnonblank(a:lnum)
|
||||||
|
while lnum > 0
|
||||||
|
" If the line isn't empty or in a string, end search.
|
||||||
|
let line = getline(lnum)
|
||||||
|
if !(s:IsInString(lnum, 1) && s:IsInString(lnum, strlen(line)))
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
let lnum = prevnonblank(lnum - 1)
|
||||||
|
endwhile
|
||||||
|
return lnum
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Check if line 'lnum' has more opening brackets than closing ones.
|
||||||
|
function s:LineHasOpeningBrackets(lnum)
|
||||||
|
let open_0 = 0
|
||||||
|
let open_2 = 0
|
||||||
|
let open_4 = 0
|
||||||
|
let line = getline(a:lnum)
|
||||||
|
let pos = match(line, '[][(){}]', 0)
|
||||||
|
while pos != -1
|
||||||
|
let idx = stridx('(){}[]', line[pos])
|
||||||
|
if idx % 2 == 0
|
||||||
|
let open_{idx} = open_{idx} + 1
|
||||||
|
else
|
||||||
|
let open_{idx - 1} = open_{idx - 1} - 1
|
||||||
|
endif
|
||||||
|
let pos = match(line, '[][(){}]', pos + 1)
|
||||||
|
endwhile
|
||||||
|
return (open_0 > 0) . (open_2 > 0) . (open_4 > 0)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function s:Match(lnum, regex)
|
||||||
|
let col = match(getline(a:lnum), a:regex) + 1
|
||||||
|
return col > 0 && !s:IsInString(a:lnum, col) ? col : 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" 3. GetJSONIndent Function {{{1
|
||||||
|
" =========================
|
||||||
|
|
||||||
|
function GetJSONIndent()
|
||||||
|
" 3.1. Setup {{{2
|
||||||
|
" ----------
|
||||||
|
|
||||||
|
" Set up variables for restoring position in file. Could use v:lnum here.
|
||||||
|
let vcol = col('.')
|
||||||
|
|
||||||
|
" 3.2. Work on the current line {{{2
|
||||||
|
" -----------------------------
|
||||||
|
|
||||||
|
" Get the current line.
|
||||||
|
let line = getline(v:lnum)
|
||||||
|
let ind = -1
|
||||||
|
|
||||||
|
" If we got a closing bracket on an empty line, find its match and indent
|
||||||
|
" according to it.
|
||||||
|
let col = matchend(line, '^\s*[]}]')
|
||||||
|
|
||||||
|
if col > 0 && !s:IsInString(v:lnum, col)
|
||||||
|
call cursor(v:lnum, col)
|
||||||
|
let bs = strpart('{}[]', stridx('}]', line[col - 1]) * 2, 2)
|
||||||
|
|
||||||
|
let pairstart = escape(bs[0], '[')
|
||||||
|
let pairend = escape(bs[1], ']')
|
||||||
|
let pairline = searchpair(pairstart, '', pairend, 'bW')
|
||||||
|
|
||||||
|
if pairline > 0
|
||||||
|
let ind = indent(pairline)
|
||||||
|
else
|
||||||
|
let ind = virtcol('.') - 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ind
|
||||||
|
endif
|
||||||
|
|
||||||
|
" If we are in a multi-line string, don't do anything to it.
|
||||||
|
if s:IsInString(v:lnum, matchend(line, '^\s*') + 1)
|
||||||
|
return indent('.')
|
||||||
|
endif
|
||||||
|
|
||||||
|
" 3.3. Work on the previous line. {{{2
|
||||||
|
" -------------------------------
|
||||||
|
|
||||||
|
let lnum = prevnonblank(v:lnum - 1)
|
||||||
|
|
||||||
|
if lnum == 0
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Set up variables for current line.
|
||||||
|
let line = getline(lnum)
|
||||||
|
let ind = indent(lnum)
|
||||||
|
|
||||||
|
" If the previous line ended with a block opening, add a level of indent.
|
||||||
|
" if s:Match(lnum, s:block_regex)
|
||||||
|
" return indent(lnum) + shiftwidth()
|
||||||
|
" endif
|
||||||
|
|
||||||
|
" If the previous line contained an opening bracket, and we are still in it,
|
||||||
|
" add indent depending on the bracket type.
|
||||||
|
if line =~ '[[({]'
|
||||||
|
let counts = s:LineHasOpeningBrackets(lnum)
|
||||||
|
if counts[0] == '1' || counts[1] == '1' || counts[2] == '1'
|
||||||
|
return ind + shiftwidth()
|
||||||
|
else
|
||||||
|
call cursor(v:lnum, vcol)
|
||||||
|
end
|
||||||
|
endif
|
||||||
|
|
||||||
|
" }}}2
|
||||||
|
|
||||||
|
return ind
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" }}}1
|
||||||
|
|
||||||
|
let &cpo = s:cpo_save
|
||||||
|
unlet s:cpo_save
|
||||||
|
|
||||||
|
" vim:set sw=2 sts=2 ts=8 noet:
|
||||||
|
|
||||||
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
|
||||||
@@ -48,11 +48,6 @@ function! GetPerlIndent()
|
|||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Don't reindent comments on first column
|
|
||||||
if cline =~ '^#.'
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Get current syntax item at the line's first char
|
" Get current syntax item at the line's first char
|
||||||
let csynid = ''
|
let csynid = ''
|
||||||
if b:indent_use_syntax
|
if b:indent_use_syntax
|
||||||
|
|||||||
@@ -60,11 +60,6 @@ function! GetPerl6Indent()
|
|||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Don't reindent coments on first column
|
|
||||||
if cline =~ '^#'
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Get current syntax item at the line's first char
|
" Get current syntax item at the line's first char
|
||||||
let csynid = ''
|
let csynid = ''
|
||||||
if b:indent_use_syntax
|
if b:indent_use_syntax
|
||||||
|
|||||||
@@ -440,10 +440,14 @@ function GetRubyIndent(...)
|
|||||||
|
|
||||||
if strpart(line, 0, col('.') - 1) =~ '=\s*$' &&
|
if strpart(line, 0, col('.') - 1) =~ '=\s*$' &&
|
||||||
\ strpart(line, col('.') - 1, 2) !~ 'do'
|
\ strpart(line, col('.') - 1, 2) !~ 'do'
|
||||||
|
" assignment to case/begin/etc, on the same line, hanging indent
|
||||||
let ind = virtcol('.') - 1
|
let ind = virtcol('.') - 1
|
||||||
elseif getline(msl) =~ '=\s*\(#.*\)\=$'
|
elseif getline(msl) =~ '=\s*\(#.*\)\=$'
|
||||||
|
" in the case of assignment to the msl, align to the starting line,
|
||||||
|
" not to the msl
|
||||||
let ind = indent(line('.'))
|
let ind = indent(line('.'))
|
||||||
else
|
else
|
||||||
|
" align to the msl
|
||||||
let ind = indent(msl)
|
let ind = indent(msl)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -508,7 +512,16 @@ function GetRubyIndent(...)
|
|||||||
|
|
||||||
" If the previous line ended with a block opening, add a level of indent.
|
" If the previous line ended with a block opening, add a level of indent.
|
||||||
if s:Match(lnum, s:block_regex)
|
if s:Match(lnum, s:block_regex)
|
||||||
return indent(s:GetMSL(lnum)) + sw
|
let msl = s:GetMSL(lnum)
|
||||||
|
|
||||||
|
if getline(msl) =~ '=\s*\(#.*\)\=$'
|
||||||
|
" in the case of assignment to the msl, align to the starting line,
|
||||||
|
" not to the msl
|
||||||
|
let ind = indent(lnum) + sw
|
||||||
|
else
|
||||||
|
let ind = indent(msl) + sw
|
||||||
|
endif
|
||||||
|
return ind
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" If the previous line started with a leading operator, use its MSL's level
|
" If the previous line started with a leading operator, use its MSL's level
|
||||||
|
|||||||
@@ -9,13 +9,9 @@ if exists("b:did_indent")
|
|||||||
endif
|
endif
|
||||||
let b:did_indent = 1
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
setlocal autoindent
|
||||||
setlocal indentexpr=GetScalaIndent()
|
setlocal indentexpr=GetScalaIndent()
|
||||||
setlocal indentkeys=0{,0},0),!^F,<>>,o,O,e,=case,<CR>
|
setlocal indentkeys=0{,0},0),!^F,<>>,o,O,e,=case,<CR>
|
||||||
setlocal autoindent
|
|
||||||
setlocal softtabstop=2
|
|
||||||
setlocal tabstop=2
|
|
||||||
setlocal shiftwidth=2
|
|
||||||
setlocal expandtab
|
|
||||||
|
|
||||||
if exists("*GetScalaIndent")
|
if exists("*GetScalaIndent")
|
||||||
finish
|
finish
|
||||||
@@ -543,7 +539,7 @@ function! GetScalaIndent()
|
|||||||
let ind = ind - 1
|
let ind = ind - 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if scala#LineEndsInIncomplete(curline)
|
if scala#LineEndsInIncomplete(prevline)
|
||||||
call scala#ConditionalConfirm("19")
|
call scala#ConditionalConfirm("19")
|
||||||
return ind
|
return ind
|
||||||
endif
|
endif
|
||||||
@@ -597,5 +593,6 @@ function! GetScalaIndent()
|
|||||||
|
|
||||||
return ind
|
return ind
|
||||||
endfunction
|
endfunction
|
||||||
" vim:set ts=2 sts=2 sw=2:
|
|
||||||
|
" vim:set sw=2 sts=2 ts=8 et:
|
||||||
" vim600:fdm=marker fdl=1 fdc=0:
|
" vim600:fdm=marker fdl=1 fdc=0:
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ let s:list_envs = ['itemize', 'enumerate', 'description']
|
|||||||
" indent on \left( and on \(, but not on (
|
" indent on \left( and on \(, but not on (
|
||||||
" indent on \left[ and on \[, but not on [
|
" indent on \left[ and on \[, but not on [
|
||||||
" indent on \left\{ and on {, but not on \{
|
" indent on \left\{ and on {, but not on \{
|
||||||
let s:open_pat = '\\\@<!\%(\\begin\|\\left\|\\(\|\\\[\|{\)'
|
let s:open_pat = '\\\@<!\%(\\begin\|\\left\a\@!\|\\(\|\\\[\|{\)'
|
||||||
let s:close_pat = '\\\@<!\%(\\end\|\\right\|\\)\|\\\]\|}\)'
|
let s:close_pat = '\\\@<!\%(\\end\|\\right\a\@!\|\\)\|\\\]\|}\)'
|
||||||
let s:list_open_pat = '\\\@<!\\begin{\%(' . join(s:list_envs, '\|') . '\)}'
|
let s:list_open_pat = '\\\@<!\\begin{\%(' . join(s:list_envs, '\|') . '\)}'
|
||||||
let s:list_close_pat = '\\\@<!\\end{\%(' . join(s:list_envs, '\|') . '\)}'
|
let s:list_close_pat = '\\\@<!\\end{\%(' . join(s:list_envs, '\|') . '\)}'
|
||||||
|
|
||||||
@@ -101,9 +101,21 @@ function! Latexbox_CallIndent()
|
|||||||
let window = getpos('.')
|
let window = getpos('.')
|
||||||
call setpos('.', cursor)
|
call setpos('.', cursor)
|
||||||
|
|
||||||
|
" Get first non-whitespace character of current line.
|
||||||
|
let line_start_char = matchstr(getline('.'), '\S')
|
||||||
|
|
||||||
|
" Get initial tab position.
|
||||||
|
let initial_tab = stridx(getline('.'), line_start_char)
|
||||||
|
|
||||||
" Execute the command.
|
" Execute the command.
|
||||||
execute 'normal! =='
|
execute 'normal! =='
|
||||||
|
|
||||||
|
" Get tab position difference.
|
||||||
|
let difference = stridx(getline('.'), line_start_char) - initial_tab
|
||||||
|
|
||||||
|
" Set new cursor Y position based on calculated difference.
|
||||||
|
let cursor[2] = cursor[2] + difference
|
||||||
|
|
||||||
" Restore the previous window position.
|
" Restore the previous window position.
|
||||||
call setpos('.', window)
|
call setpos('.', window)
|
||||||
normal! zt
|
normal! zt
|
||||||
|
|||||||
89
indent/typescript.vim
Normal file
89
indent/typescript.vim
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
" Vim indent file, taken from indent/java.vim
|
||||||
|
" Language: Typescript
|
||||||
|
" Maintainer: None! Wanna improve this?
|
||||||
|
" Last Change: 2015 Mar 07
|
||||||
|
|
||||||
|
if get(g:, 'typescript_indent_disable')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Only load this indent file when no other was loaded.
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
" Use javascript cindent options
|
||||||
|
setlocal cindent cinoptions& cinoptions+=j1,J1
|
||||||
|
setlocal indentkeys&
|
||||||
|
|
||||||
|
" Load typescript indent function
|
||||||
|
setlocal indentexpr=GetTypescriptIndent()
|
||||||
|
|
||||||
|
let b:undo_indent = "setl cin< cino< indentkeys< indentexpr<"
|
||||||
|
|
||||||
|
" Only define the function once
|
||||||
|
if exists("*GetTypescriptIndent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Make sure we have vim capabilities
|
||||||
|
let s:keepcpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
function! TypescriptPrevNonBlankOrComment(lnum)
|
||||||
|
let pnum = prevnonblank(a:lnum)
|
||||||
|
" skip any comments (either `//`, `/*` or `*`)
|
||||||
|
while getline(pnum) =~ '^\s*\(\/\/\|\/\*\|\*\)'
|
||||||
|
let pnum = prevnonblank(pnum-1)
|
||||||
|
endwhile
|
||||||
|
return pnum
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function GetTypescriptIndent()
|
||||||
|
|
||||||
|
" default value: trust cindent
|
||||||
|
let ind = cindent(v:lnum)
|
||||||
|
|
||||||
|
if getline(v:lnum) =~ '^\s*[{}\*]'
|
||||||
|
return ind
|
||||||
|
endif
|
||||||
|
|
||||||
|
" The last non-empty line
|
||||||
|
let prev = TypescriptPrevNonBlankOrComment(v:lnum-1)
|
||||||
|
|
||||||
|
" Check if the previous line consists of a single `<variable> : <type>;`
|
||||||
|
" declaration (e.g. in interface definitions)
|
||||||
|
if getline(prev) =~ '^\s*\w\+\s*:[^{]\+;\s*$'
|
||||||
|
return indent(prev)
|
||||||
|
endif
|
||||||
|
|
||||||
|
" If a variable was declared and the semicolon omitted, do not indent
|
||||||
|
" the next line
|
||||||
|
if getline(prev) =~ '^\s*var\s\+\w\+'
|
||||||
|
return indent(prev)
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Try to find out whether the last `}` ended a `<variable> : {` block
|
||||||
|
if getline(prev) =~ '};\s*$'
|
||||||
|
" jump to matching `{` bracket
|
||||||
|
call cursor(prev, 1)
|
||||||
|
silent normal %
|
||||||
|
|
||||||
|
" See if current line is type annotation without closing ';' but open
|
||||||
|
" `{` bracket
|
||||||
|
let lnum = line('.')
|
||||||
|
if getline(lnum) =~ '^\s*\w\+\s*:[^;]\+{'
|
||||||
|
let ind = indent(lnum)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ind
|
||||||
|
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Restore compatibility mode
|
||||||
|
let &cpo = s:keepcpo
|
||||||
|
unlet s:keepcpo
|
||||||
|
|
||||||
|
" vim: et
|
||||||
@@ -2,16 +2,13 @@
|
|||||||
" Language: Arduino
|
" Language: Arduino
|
||||||
" Maintainer: Sudar <sudar@sudarmuthu.com>
|
" Maintainer: Sudar <sudar@sudarmuthu.com>
|
||||||
" Original Author: Johannes Hoff <johannes@johanneshoff.com>
|
" Original Author: Johannes Hoff <johannes@johanneshoff.com>
|
||||||
" Last Change: 19 February 2013
|
" Last Change: 27 April 2015
|
||||||
" License: VIM license (:help license, replace vim by arduino.vim)
|
" License: VIM license (:help license, replace vim by arduino.vim)
|
||||||
|
|
||||||
" Syntax highlighting like in the Arduino IDE
|
" Syntax highlighting like in the Arduino IDE
|
||||||
" Automatically generated by the script available at
|
|
||||||
" https://bitbucket.org/johannes/arduino-vim-syntax
|
|
||||||
" Using keywords from <arduino>/lib/keywords.txt
|
|
||||||
" From version:
|
|
||||||
|
|
||||||
" Thanks to original author Johannes Hoff and Rik, Erik Nomitch, Adam Obeng and Graeme Cross for helpful feedback!
|
" Thanks to original author Johannes Hoff and Rik, Erik Nomitch, Adam Obeng and Graeme Cross for helpful feedback!
|
||||||
|
" Thanks to Rafi Khan for Arduino 1.5.x support
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" For version 5.x: Clear all syntax items
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
" For version 6.x: Quit when a syntax file was already loaded
|
||||||
@@ -28,33 +25,142 @@ else
|
|||||||
runtime! syntax/cpp.vim
|
runtime! syntax/cpp.vim
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syn keyword arduinoConstant BIN CHANGE DEC DEFAULT EXTERNAL FALLING HALF_PI HEX
|
"C:/Program Files (x86)/Arduino\hardware\arduino\avr\libraries\EEPROM\keywords.txt{{{
|
||||||
syn keyword arduinoConstant HIGH INPUT INPUT_PULLUP INTERNAL INTERNAL1V1
|
syn keyword arduinoConstant EEPROM
|
||||||
syn keyword arduinoConstant INTERNAL2V56 LOW LSBFIRST MSBFIRST OCT OUTPUT PI
|
"}}}
|
||||||
syn keyword arduinoConstant RISING TWO_PI
|
"C:/Program Files (x86)/Arduino\hardware\arduino\avr\libraries\SoftwareSerial\keywords.txt{{{
|
||||||
|
syn keyword arduinoFunc SoftwareSerial begin end read write available isListening overflow flush listen
|
||||||
syn keyword arduinoFunc analogRead analogReference analogWrite
|
syn keyword arduinoFunc peek
|
||||||
syn keyword arduinoFunc attachInterrupt bit bitClear bitRead bitSet
|
"}}}
|
||||||
syn keyword arduinoFunc bitWrite delay delayMicroseconds detachInterrupt
|
"C:/Program Files (x86)/Arduino\hardware\arduino\avr\libraries\SPI\keywords.txt{{{
|
||||||
syn keyword arduinoFunc digitalRead digitalWrite highByte interrupts
|
syn keyword arduinoConstant SPI SPI_CLOCK_DIV4 SPI_CLOCK_DIV16 SPI_CLOCK_DIV64 SPI_CLOCK_DIV128 SPI_CLOCK_DIV2 SPI_CLOCK_DIV8 SPI_CLOCK_DIV32 SPI_CLOCK_DIV64 SPI_MODE0
|
||||||
syn keyword arduinoFunc lowByte micros millis noInterrupts noTone pinMode
|
syn keyword arduinoConstant SPI_MODE1 SPI_MODE2 SPI_MODE3
|
||||||
syn keyword arduinoFunc pulseIn shiftIn shiftOut tone
|
syn keyword arduinoFunc begin end transfer setBitOrder setDataMode setClockDivider
|
||||||
|
"}}}
|
||||||
syn keyword arduinoMethod available begin end find findUntil flush loop
|
"C:/Program Files (x86)/Arduino\hardware\arduino\avr\libraries\Wire\keywords.txt{{{
|
||||||
syn keyword arduinoMethod parseFloat parseInt peek print println read
|
syn keyword arduinoFunc begin setClock beginTransmission endTransmission requestFrom send receive onReceive onRequest Wire
|
||||||
syn keyword arduinoMethod readBytes readBytesUntil setTimeout setup
|
"}}}
|
||||||
|
"C:/Program Files (x86)/Arduino\hardware\arduino\sam\libraries\SPI\keywords.txt{{{
|
||||||
syn keyword arduinoModule Serial Serial1 Serial2 Serial3
|
syn keyword arduinoConstant SPI SPI_MODE0 SPI_MODE1 SPI_MODE2 SPI_MODE3 SPI_CONTINUE SPI_LAST
|
||||||
|
syn keyword arduinoFunc begin end transfer setDataMode setClockDivider
|
||||||
syn keyword arduinoStdFunc abs acos asin atan atan2 ceil constrain cos degrees
|
"}}}
|
||||||
syn keyword arduinoStdFunc exp floor log map max min radians random randomSeed
|
"C:/Program Files (x86)/Arduino\hardware\arduino\sam\libraries\Wire\keywords.txt{{{
|
||||||
syn keyword arduinoStdFunc round sin sq sqrt tan
|
syn keyword arduinoFunc begin setClock beginTransmission endTransmission requestFrom send receive onReceive onRequest Wire
|
||||||
|
syn keyword arduinoFunc Wire1
|
||||||
syn keyword arduinoType boolean byte null String word
|
"}}}
|
||||||
|
"C:/Program Files (x86)/Arduino\lib\keywords.txt{{{
|
||||||
|
syn keyword arduinoConstant HIGH LOW INPUT INPUT_PULLUP OUTPUT DEC BIN HEX OCT PI
|
||||||
|
syn keyword arduinoConstant HALF_PI TWO_PI LSBFIRST MSBFIRST CHANGE FALLING RISING DEFAULT EXTERNAL INTERNAL
|
||||||
|
syn keyword arduinoConstant INTERNAL1V1 INTERNAL2V56
|
||||||
|
syn keyword arduinoType boolean break byte case char class const continue default do
|
||||||
|
syn keyword arduinoType double else false float for if int long new null
|
||||||
|
syn keyword arduinoType private protected public register return short signed static String switch
|
||||||
|
syn keyword arduinoType this throw try true unsigned void while word boolean byte
|
||||||
|
syn keyword arduinoType char float int long word
|
||||||
|
syn keyword arduinoFunc abs acos asin atan atan2 ceil constrain cos degrees exp
|
||||||
|
syn keyword arduinoFunc floor log map max min radians random randomSeed round sin
|
||||||
|
syn keyword arduinoFunc sq sqrt tan pow bitRead bitWrite bitSet bitClear bit highByte
|
||||||
|
syn keyword arduinoFunc lowByte analogReference analogRead analogWrite attachInterrupt detachInterrupt delay delayMicroseconds digitalWrite digitalRead
|
||||||
|
syn keyword arduinoFunc interrupts millis micros noInterrupts noTone pinMode pulseIn shiftIn shiftOut tone
|
||||||
|
syn keyword arduinoFunc yield
|
||||||
|
syn keyword arduinoIdentifier Serial Serial1 Serial2 Serial3
|
||||||
|
syn keyword arduinoFunc SerialUSB begin end peek read
|
||||||
|
syn keyword arduinoFunc print println available availableForWrite flush setTimeout find findUntil parseInt parseFloat
|
||||||
|
syn keyword arduinoFunc readBytes readBytesUntil readString readStringUntil trim toUpperCase toLowerCase charAt compareTo concat
|
||||||
|
syn keyword arduinoFunc endsWith startsWith equals equalsIgnoreCase getBytes indexOf lastIndexOf length replace setCharAt
|
||||||
|
syn keyword arduinoFunc substring toCharArray toInt Keyboard Mouse press release releaseAll accept click
|
||||||
|
syn keyword arduinoFunc move isPressed setup loop
|
||||||
|
"}}}
|
||||||
|
"C:/Program Files (x86)/Arduino\libraries\Audio\keywords.txt{{{
|
||||||
|
syn keyword arduinoFunc Audio prepare write
|
||||||
|
"}}}
|
||||||
|
"C:/Program Files (x86)/Arduino\libraries\Bridge\keywords.txt{{{
|
||||||
|
syn keyword arduinoConstant FILE_READ FILE_WRITE FILE_APPEND
|
||||||
|
syn keyword arduinoFunc Bridge FileIO FileSystem Console Process Mailbox HttpClient YunServer YunClient begin
|
||||||
|
syn keyword arduinoFunc end available read peek write flush bool transfer put get
|
||||||
|
syn keyword arduinoFunc buffer noBuffer connected File seek position size close name isDirectory
|
||||||
|
syn keyword arduinoFunc openNextFile rewindDirectory addParameter runAsynchronously run running exitValue runShellCommand runShellCommandAsynchronously readMessage
|
||||||
|
syn keyword arduinoFunc writeMessage writeJSON message Available getAsynchronously ready getResult accept stop connect connected
|
||||||
|
"}}}
|
||||||
|
"C:/Program Files (x86)/Arduino\libraries\Esplora\keywords.txt{{{
|
||||||
|
syn keyword arduinoConstant JOYSTICK_BASE MAX_CHANNELS CH_SWITCH_1 CH_SWITCH_2 CH_SWITCH_3 CH_SWITCH_4 CH_SLIDER CH_LIGHT CH_TEMPERATURE CH_MIC
|
||||||
|
syn keyword arduinoConstant CH_JOYSTICK_SW CH_JOYSTICK_X CH_JOYSTICK_Y SWITCH_1 SWITCH_2 SWITCH_3 SWITCH_4 SWITCH_DOWN SWITCH_LEFT SWITCH_UP
|
||||||
|
syn keyword arduinoConstant SWITCH_RIGHT JOYSTICK_DOWN JOYSTICK_LEFT JOYSTICK_UP PRESSED RELEASED DEGREES_C DEGREES_F X_AXIS Y_AXIS
|
||||||
|
syn keyword arduinoConstant Z_AXIS
|
||||||
|
syn keyword arduinoFunc Esplora begin readSlider readLightSensor readTemperature readMicrophone readJoystickSwitch readJoystickButton readJoystickX readJoystickY
|
||||||
|
syn keyword arduinoFunc readAccelerometer readButton writeRGB writeRed writeGreen writeBlue readRed readGreen readBlue readBlue
|
||||||
|
syn keyword arduinoFunc readBlue readBlue tone noTone
|
||||||
|
"}}}
|
||||||
|
"C:/Program Files (x86)/Arduino\libraries\Ethernet\keywords.txt{{{
|
||||||
|
syn keyword arduinoFunc Ethernet EthernetClient EthernetServer IPAddress status connect write available read peek
|
||||||
|
syn keyword arduinoFunc flush stop connected begin beginPacket endPacket parsePacket remoteIP remotePort
|
||||||
|
"}}}
|
||||||
|
"C:/Program Files (x86)/Arduino\libraries\Firmata\keywords.txt{{{
|
||||||
|
syn keyword arduinoConstant MAX_DATA_BYTES DIGITAL_MESSAGE ANALOG_MESSAGE REPORT_ANALOG REPORT_DIGITAL REPORT_VERSION SET_PIN_MODE SYSTEM_RESET START_SYSEX END_SYSEX
|
||||||
|
syn keyword arduinoConstant PWM TOTAL_ANALOG_PINS TOTAL_DIGITAL_PINS TOTAL_PORTS ANALOG_PORT
|
||||||
|
syn keyword arduinoFunc Firmata callbackFunction systemResetCallbackFunction stringCallbackFunction sysexCallbackFunction begin begin printVersion blinkVersion printFirmwareVersion
|
||||||
|
syn keyword arduinoFunc setFirmwareVersion setFirmwareNameAndVersion available processInput sendAnalog sendDigital sendDigitalPortPair sendDigitalPort sendString sendString
|
||||||
|
syn keyword arduinoFunc sendSysex attach detach flush
|
||||||
|
"}}}
|
||||||
|
"C:/Program Files (x86)/Arduino\libraries\GSM\keywords.txt{{{
|
||||||
|
syn keyword arduinoConstant GSM GSM_SMS GPRS GSMPIN GSMPIN ERROR IDLE CONNECTING GSM_READY GPRS_READY
|
||||||
|
syn keyword arduinoConstant TRANSPARENT_CONNECTED IDLE_CALL CALLING RECEIVINGCALL TALKING GSM_MODE_UNDEFINED GSM_MODE_EGSM GSM_MODE_DCS GSM_MODE_PCS GSM_MODE_EGSM_DCS
|
||||||
|
syn keyword arduinoConstant GSM_MODE_GSM850_PCS GSM_MODE_GSM850_EGSM_DCS_PCS
|
||||||
|
syn keyword arduinoFunc GSMVoiceCall GSMClient GSMServer GSMModem GSMScanner begin shutdown gatVoiceCallStatus ready voiceCall
|
||||||
|
syn keyword arduinoFunc answerCall hangCall retrieveCallingNumber beginSMS endSMS remoteNumber attachGPRS begnWrite endWrite getIMEI
|
||||||
|
syn keyword arduinoFunc getCurrentCarrier getSignalStrength readNetworks isPIN checkPIN checkPUK changePIN switchPIN checkReg getPINUsed
|
||||||
|
syn keyword arduinoFunc setPINUsed getBand setBand getvoiceCallStatus
|
||||||
|
"}}}
|
||||||
|
"C:/Program Files (x86)/Arduino\libraries\LiquidCrystal\keywords.txt{{{
|
||||||
|
syn keyword arduinoFunc LiquidCrystal begin clear home print setCursor cursor noCursor blink noBlink
|
||||||
|
syn keyword arduinoFunc display noDisplay autoscroll noAutoscroll leftToRight rightToLeft scrollDisplayLeft scrollDisplayRight createChar setRowOffsets
|
||||||
|
"}}}
|
||||||
|
"C:/Program Files (x86)/Arduino\libraries\Scheduler\keywords.txt{{{
|
||||||
|
syn keyword arduinoFunc Scheduler startLoop
|
||||||
|
"}}}
|
||||||
|
"C:/Program Files (x86)/Arduino\libraries\SD\keywords.txt{{{
|
||||||
|
syn keyword arduinoConstant SD FILE_READ FILE_WRITE
|
||||||
|
syn keyword arduinoFunc File begin exists mkdir remove rmdir open close seek position
|
||||||
|
syn keyword arduinoFunc size
|
||||||
|
"}}}
|
||||||
|
"C:/Program Files (x86)/Arduino\libraries\Servo\keywords.txt{{{
|
||||||
|
syn keyword arduinoFunc Servo attach detach write read attached writeMicroseconds readMicroseconds
|
||||||
|
"}}}
|
||||||
|
"C:/Program Files (x86)/Arduino\libraries\SpacebrewYun\keywords.txt{{{
|
||||||
|
syn keyword arduinoFunc SpacebrewYun addPublish addSubscribe connect verbose monitor onMessage send onRangeMessage onStringMessage
|
||||||
|
syn keyword arduinoFunc onBooleanMessage onCustomMessage onOpen onClose onError
|
||||||
|
"}}}
|
||||||
|
"C:/Program Files (x86)/Arduino\libraries\Stepper\keywords.txt{{{
|
||||||
|
syn keyword arduinoFunc Stepper step setSpeed version direction speed
|
||||||
|
"}}}
|
||||||
|
"C:/Program Files (x86)/Arduino\libraries\Temboo\keywords.txt{{{
|
||||||
|
syn keyword arduinoFunc Temboo TembooChoreo begin setAccountName setAppKeyName setAppKey setChoreo setCredential setSavedInputs addInput
|
||||||
|
syn keyword arduinoFunc addOutputFilter setSettingsFileToWrite setSettingsFileToRead
|
||||||
|
"}}}
|
||||||
|
"C:/Program Files (x86)/Arduino\libraries\TFT\keywords.txt{{{
|
||||||
|
syn keyword arduinoConstant TFT
|
||||||
|
syn keyword arduinoFunc EsploraTFT
|
||||||
|
"}}}
|
||||||
|
"C:/Program Files (x86)/Arduino\libraries\TFT\src\utility\keywords.txt{{{
|
||||||
|
syn keyword arduinoFunc Adafruit_GFX Adafruit_ST7735 PImage drawPixel invertDisplay drawLine drawFastVLine drawFastHLine drawRect fillRect
|
||||||
|
syn keyword arduinoFunc fillScreen drawCircle drawCircleHelper fillCircle fillCircleHelper drawTriangle fillTriangle drawRoundRect fillRoundRect drawBitmap
|
||||||
|
syn keyword arduinoFunc drawChar setCursor setTextColor setTextSize setTextWrap height width setRotation getRotation newColor
|
||||||
|
syn keyword arduinoFunc background fill noFill stroke noStroke text textWrap textSize circle point
|
||||||
|
syn keyword arduinoFunc quad rect triangle loadImage image draw isValid
|
||||||
|
"}}}
|
||||||
|
"C:/Program Files (x86)/Arduino\libraries\USBHost\keywords.txt{{{
|
||||||
|
syn keyword arduinoFunc MouseController USBHost KeyboardController Task mouseMoved mouseDragged mousePressed mouseReleased getXChange getYChange
|
||||||
|
syn keyword arduinoFunc getButton keyPressed keyReleased getModifiers getKey getOemKey
|
||||||
|
"}}}
|
||||||
|
"C:/Program Files (x86)/Arduino\libraries\WiFi\keywords.txt{{{
|
||||||
|
syn keyword arduinoConstant SSID BSSID RSSI
|
||||||
|
syn keyword arduinoFunc WiFi WiFiUdp Client Server firmwareVersion status connect write available config
|
||||||
|
syn keyword arduinoFunc setDNS read flush stop connected begin disconnect macAddress localIP subnetMask
|
||||||
|
syn keyword arduinoFunSec gatewayIP encryptionType getResult getSocket WiFiClient WiFiServer WiFiUDP beginPacket endPacket parsePacket
|
||||||
|
syn keyword arduinoFunc remoteIP remotePort
|
||||||
|
"}}}
|
||||||
|
|
||||||
hi def link arduinoType Type
|
hi def link arduinoType Type
|
||||||
hi def link arduinoConstant Constant
|
hi def link arduinoConstant Constant
|
||||||
hi def link arduinoStdFunc Function
|
|
||||||
hi def link arduinoFunc Function
|
hi def link arduinoFunc Function
|
||||||
hi def link arduinoMethod Function
|
hi def link arduinoIdentifier Identifier
|
||||||
hi def link arduinoModule Identifier
|
|
||||||
|
|||||||
70
syntax/c.vim
70
syntax/c.vim
@@ -1,7 +1,7 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: C
|
" Language: C
|
||||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||||
" Last Change: 2013 Jul 05
|
" Last Change: 2015 Mar 05
|
||||||
|
|
||||||
" Quit when a (custom) syntax file was already loaded
|
" Quit when a (custom) syntax file was already loaded
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
@@ -35,28 +35,37 @@ syn match cSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
|
|||||||
if !exists("c_no_utf")
|
if !exists("c_no_utf")
|
||||||
syn match cSpecial display contained "\\\(u\x\{4}\|U\x\{8}\)"
|
syn match cSpecial display contained "\\\(u\x\{4}\|U\x\{8}\)"
|
||||||
endif
|
endif
|
||||||
if exists("c_no_cformat")
|
|
||||||
syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell extend
|
if !exists("c_no_cformat")
|
||||||
" cCppString: same as cString, but ends at end of line
|
" Highlight % items in strings.
|
||||||
if !exists("cpp_no_cpp11") " ISO C++11
|
|
||||||
syn region cCppString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
|
|
||||||
else
|
|
||||||
syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
|
|
||||||
endif
|
|
||||||
syn region cCppOut2 contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=cSpaceError,cCppSkip
|
|
||||||
syn region cCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppSkip
|
|
||||||
else
|
|
||||||
if !exists("c_no_c99") " ISO C99
|
if !exists("c_no_c99") " ISO C99
|
||||||
syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
|
syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
|
||||||
else
|
else
|
||||||
syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
|
syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
|
||||||
endif
|
endif
|
||||||
syn match cFormat display "%%" contained
|
syn match cFormat display "%%" contained
|
||||||
|
endif
|
||||||
|
|
||||||
|
" cCppString: same as cString, but ends at end of line
|
||||||
|
if s:ft ==# "cpp" && !exists("cpp_no_cpp11") && !exists("c_no_cformat")
|
||||||
|
" ISO C++11
|
||||||
|
syn region cString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
|
||||||
|
syn region cCppString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
|
||||||
|
elseif s:ft ==# "c" && !exists("c_no_c11") && !exists("c_no_cformat")
|
||||||
|
" ISO C99
|
||||||
|
syn region cString start=+\%(L\|U\|u8\)\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
|
||||||
|
syn region cCppString start=+\%(L\|U\|u8\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
|
||||||
|
else
|
||||||
|
" older C or C++
|
||||||
|
syn match cFormat display "%%" contained
|
||||||
syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
|
syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
|
||||||
" cCppString: same as cString, but ends at end of line
|
|
||||||
syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
|
syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
syn region cCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppSkip
|
||||||
|
|
||||||
|
syn cluster cStringGroup contains=cCppString,cCppSkip
|
||||||
|
|
||||||
syn match cCharacter "L\='[^\\]'"
|
syn match cCharacter "L\='[^\\]'"
|
||||||
syn match cCharacter "L'[^']*'" contains=cSpecial
|
syn match cCharacter "L'[^']*'" contains=cSpecial
|
||||||
if exists("c_gnu")
|
if exists("c_gnu")
|
||||||
@@ -70,7 +79,8 @@ syn match cSpecialCharacter display "L\='\\\o\{1,3}'"
|
|||||||
syn match cSpecialCharacter display "'\\x\x\{1,2}'"
|
syn match cSpecialCharacter display "'\\x\x\{1,2}'"
|
||||||
syn match cSpecialCharacter display "L'\\x\x\+'"
|
syn match cSpecialCharacter display "L'\\x\x\+'"
|
||||||
|
|
||||||
if !exists("c_no_c11") " ISO C11
|
if (s:ft ==# "c" && !exists("c_no_c11")) || (s:ft ==# "cpp" && !exists("cpp_no_cpp11"))
|
||||||
|
" ISO C11 or ISO C++ 11
|
||||||
if exists("c_no_cformat")
|
if exists("c_no_cformat")
|
||||||
syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell extend
|
syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell extend
|
||||||
else
|
else
|
||||||
@@ -102,24 +112,24 @@ endif
|
|||||||
" This should be before cErrInParen to avoid problems with #define ({ xxx })
|
" This should be before cErrInParen to avoid problems with #define ({ xxx })
|
||||||
if exists("c_curly_error")
|
if exists("c_curly_error")
|
||||||
syn match cCurlyError "}"
|
syn match cCurlyError "}"
|
||||||
syn region cBlock start="{" end="}" contains=ALLBUT,cBadBlock,cCurlyError,@cParenGroup,cErrInParen,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell fold
|
syn region cBlock start="{" end="}" contains=ALLBUT,cBadBlock,cCurlyError,@cParenGroup,cErrInParen,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell fold
|
||||||
else
|
else
|
||||||
syn region cBlock start="{" end="}" transparent fold
|
syn region cBlock start="{" end="}" transparent fold
|
||||||
endif
|
endif
|
||||||
|
|
||||||
"catch errors caused by wrong parenthesis and brackets
|
" Catch errors caused by wrong parenthesis and brackets.
|
||||||
" also accept <% for {, %> for }, <: for [ and :> for ] (C99)
|
" Also accept <% for {, %> for }, <: for [ and :> for ] (C99)
|
||||||
" But avoid matching <::.
|
" But avoid matching <::.
|
||||||
syn cluster cParenGroup contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserLabel,cBitField,cOctalZero,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom
|
syn cluster cParenGroup contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserLabel,cBitField,cOctalZero,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom
|
||||||
if exists("c_no_curly_error")
|
if exists("c_no_curly_error")
|
||||||
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
||||||
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString,@Spell
|
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell
|
||||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
||||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
||||||
syn match cParenError display ")"
|
syn match cParenError display ")"
|
||||||
syn match cErrInParen display contained "^^<%\|^%>"
|
syn match cErrInParen display contained "^^<%\|^%>"
|
||||||
else
|
else
|
||||||
syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cCppString,@Spell
|
syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,@cStringGroup,@Spell
|
||||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
||||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
||||||
syn match cParenError display ")"
|
syn match cParenError display ")"
|
||||||
@@ -127,13 +137,13 @@ if exists("c_no_curly_error")
|
|||||||
endif
|
endif
|
||||||
elseif exists("c_no_bracket_error")
|
elseif exists("c_no_bracket_error")
|
||||||
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
||||||
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString,@Spell
|
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell
|
||||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
||||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
||||||
syn match cParenError display ")"
|
syn match cParenError display ")"
|
||||||
syn match cErrInParen display contained "<%\|%>"
|
syn match cErrInParen display contained "<%\|%>"
|
||||||
else
|
else
|
||||||
syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cCppString,@Spell
|
syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,@cStringGroup,@Spell
|
||||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
||||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
||||||
syn match cParenError display ")"
|
syn match cParenError display ")"
|
||||||
@@ -141,19 +151,19 @@ elseif exists("c_no_bracket_error")
|
|||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
||||||
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell
|
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell
|
||||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
||||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
|
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
|
||||||
syn match cParenError display "[\])]"
|
syn match cParenError display "[\])]"
|
||||||
syn match cErrInParen display contained "<%\|%>"
|
syn match cErrInParen display contained "<%\|%>"
|
||||||
syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' contains=ALLBUT,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppString,@Spell
|
syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' contains=ALLBUT,@cParenGroup,cErrInParen,cCppParen,cCppBracket,@cStringGroup,@Spell
|
||||||
else
|
else
|
||||||
syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell
|
syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell
|
||||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
||||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
|
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
|
||||||
syn match cParenError display "[\])]"
|
syn match cParenError display "[\])]"
|
||||||
syn match cErrInParen display contained "[\]{}]\|<%\|%>"
|
syn match cErrInParen display contained "[\]{}]\|<%\|%>"
|
||||||
syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppString,@Spell
|
syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cErrInParen,cCppParen,cCppBracket,@cStringGroup,@Spell
|
||||||
endif
|
endif
|
||||||
" cCppBracket: same as cParen but ends at end-of-line; used in cDefine
|
" cCppBracket: same as cParen but ends at end-of-line; used in cDefine
|
||||||
syn region cCppBracket transparent start='\[\|<::\@!' skip='\\$' excludenl end=']\|:>' end='$' contained contains=ALLBUT,@cParenGroup,cErrInParen,cParen,cBracket,cString,@Spell
|
syn region cCppBracket transparent start='\[\|<::\@!' skip='\\$' excludenl end=']\|:>' end='$' contained contains=ALLBUT,@cParenGroup,cErrInParen,cParen,cBracket,cString,@Spell
|
||||||
@@ -322,6 +332,11 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu")
|
|||||||
syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET
|
syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET
|
||||||
syn keyword cConstant TMP_MAX stderr stdin stdout
|
syn keyword cConstant TMP_MAX stderr stdin stdout
|
||||||
syn keyword cConstant EXIT_FAILURE EXIT_SUCCESS RAND_MAX
|
syn keyword cConstant EXIT_FAILURE EXIT_SUCCESS RAND_MAX
|
||||||
|
" POSIX 2001
|
||||||
|
syn keyword cConstant SIGBUS SIGPOLL SIGPROF SIGSYS SIGURG
|
||||||
|
syn keyword cConstant SIGVTALRM SIGXCPU SIGXFSZ
|
||||||
|
" non-POSIX signals
|
||||||
|
syn keyword cConstant SIGWINCH SIGINFO
|
||||||
" Add POSIX errors as well
|
" Add POSIX errors as well
|
||||||
syn keyword cConstant E2BIG EACCES EAGAIN EBADF EBADMSG EBUSY
|
syn keyword cConstant E2BIG EACCES EAGAIN EBADF EBADMSG EBUSY
|
||||||
syn keyword cConstant ECANCELED ECHILD EDEADLK EDOM EEXIST EFAULT
|
syn keyword cConstant ECANCELED ECHILD EDEADLK EDOM EEXIST EFAULT
|
||||||
@@ -373,7 +388,7 @@ syn region cPreProc start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>
|
|||||||
" Highlight User Labels
|
" Highlight User Labels
|
||||||
syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString
|
syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString
|
||||||
if s:ft ==# 'c' || exists("cpp_no_cpp11")
|
if s:ft ==# 'c' || exists("cpp_no_cpp11")
|
||||||
syn region cMulti transparent start='?' skip='::' end=':' contains=ALLBUT,@cMultiGroup,@Spell
|
syn region cMulti transparent start='?' skip='::' end=':' contains=ALLBUT,@cMultiGroup,@Spell,@cStringGroup
|
||||||
endif
|
endif
|
||||||
" Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
|
" Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
|
||||||
syn cluster cLabelGroup contains=cUserLabel
|
syn cluster cLabelGroup contains=cUserLabel
|
||||||
@@ -458,8 +473,7 @@ hi def link cTodo Todo
|
|||||||
hi def link cBadContinuation Error
|
hi def link cBadContinuation Error
|
||||||
hi def link cCppOutSkip cCppOutIf2
|
hi def link cCppOutSkip cCppOutIf2
|
||||||
hi def link cCppInElse2 cCppOutIf2
|
hi def link cCppInElse2 cCppOutIf2
|
||||||
hi def link cCppOutIf2 cCppOut2 " Old syntax group for #if 0 body
|
hi def link cCppOutIf2 cCppOut
|
||||||
hi def link cCppOut2 cCppOut " Old syntax group for #if of #if 0
|
|
||||||
hi def link cCppOut Comment
|
hi def link cCppOut Comment
|
||||||
|
|
||||||
let b:current_syntax = "c"
|
let b:current_syntax = "c"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -32,7 +32,7 @@ hi def link coffeeConditional Conditional
|
|||||||
syn match coffeeException /\<\%(try\|catch\|finally\)\>/ display
|
syn match coffeeException /\<\%(try\|catch\|finally\)\>/ display
|
||||||
hi def link coffeeException Exception
|
hi def link coffeeException Exception
|
||||||
|
|
||||||
syn match coffeeKeyword /\<\%(new\|in\|of\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|do\)\>/
|
syn match coffeeKeyword /\<\%(new\|in\|of\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|do\|yield\)\>/
|
||||||
\ display
|
\ display
|
||||||
" The `own` keyword is only a keyword after `for`.
|
" The `own` keyword is only a keyword after `for`.
|
||||||
syn match coffeeKeyword /\<for\s\+own\>/ contained containedin=coffeeRepeat
|
syn match coffeeKeyword /\<for\s\+own\>/ contained containedin=coffeeRepeat
|
||||||
@@ -92,7 +92,7 @@ syn region coffeeString start=/'/ skip=/\\\\\|\\'/ end=/'/
|
|||||||
hi def link coffeeString String
|
hi def link coffeeString String
|
||||||
|
|
||||||
" A integer, including a leading plus or minus
|
" A integer, including a leading plus or minus
|
||||||
syn match coffeeNumber /\%(\i\|\$\)\@<![-+]\?\d\+\%([eE][+-]\?\d\+\)\?/ display
|
syn match coffeeNumber /\%(\i\|\$\)\@<![-+]\?\d\+\%(e[+-]\?\d\+\)\?/ display
|
||||||
" A hex, binary, or octal number
|
" A hex, binary, or octal number
|
||||||
syn match coffeeNumber /\<0[xX]\x\+\>/ display
|
syn match coffeeNumber /\<0[xX]\x\+\>/ display
|
||||||
syn match coffeeNumber /\<0[bB][01]\+\>/ display
|
syn match coffeeNumber /\<0[bB][01]\+\>/ display
|
||||||
@@ -107,7 +107,7 @@ hi def link coffeeFloat Float
|
|||||||
|
|
||||||
" An error for reserved keywords, taken from the RESERVED array:
|
" An error for reserved keywords, taken from the RESERVED array:
|
||||||
" http://coffeescript.org/documentation/docs/lexer.html#section-67
|
" http://coffeescript.org/documentation/docs/lexer.html#section-67
|
||||||
syn match coffeeReservedError /\<\%(case\|default\|function\|var\|void\|with\|const\|let\|enum\|export\|import\|native\|__hasProp\|__extends\|__slice\|__bind\|__indexOf\|implements\|interface\|package\|private\|protected\|public\|static\|yield\)\>/
|
syn match coffeeReservedError /\<\%(case\|default\|function\|var\|void\|with\|const\|let\|enum\|export\|import\|native\|__hasProp\|__extends\|__slice\|__bind\|__indexOf\|implements\|interface\|package\|private\|protected\|public\|static\)\>/
|
||||||
\ display
|
\ display
|
||||||
hi def link coffeeReservedError Error
|
hi def link coffeeReservedError Error
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: C++
|
" Language: C++
|
||||||
" Current Maintainer: vim-jp (https://github.com/vim-jp/cpp-vim)
|
" Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp)
|
||||||
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
|
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
|
||||||
" Last Change: 2014 May 13
|
" Last Change: 2015 Mar 1
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" For version 5.x: Clear all syntax items
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
" For version 6.x: Quit when a syntax file was already loaded
|
||||||
@@ -32,14 +32,21 @@ syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*$"
|
|||||||
syn keyword cppStorageClass mutable
|
syn keyword cppStorageClass mutable
|
||||||
syn keyword cppStructure class typename template namespace
|
syn keyword cppStructure class typename template namespace
|
||||||
syn keyword cppBoolean true false
|
syn keyword cppBoolean true false
|
||||||
|
syn keyword cppConstant __cplusplus
|
||||||
|
|
||||||
" C++ 11 extensions
|
" C++ 11 extensions
|
||||||
if !exists("cpp_no_cpp11")
|
if !exists("cpp_no_cpp11")
|
||||||
syn keyword cppType override final
|
syn keyword cppType override final
|
||||||
syn keyword cppExceptions noexcept
|
syn keyword cppExceptions noexcept
|
||||||
syn keyword cppStorageClass constexpr decltype
|
syn keyword cppStorageClass constexpr decltype thread_local
|
||||||
syn keyword cppConstant nullptr
|
syn keyword cppConstant nullptr
|
||||||
syn region cppRawString matchgroup=cppRawDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"+ contains=@Spell
|
syn keyword cppConstant ATOMIC_FLAG_INIT ATOMIC_VAR_INIT
|
||||||
|
syn keyword cppConstant ATOMIC_BOOL_LOCK_FREE ATOMIC_CHAR_LOCK_FREE
|
||||||
|
syn keyword cppConstant ATOMIC_CHAR16_T_LOCK_FREE ATOMIC_CHAR32_T_LOCK_FREE
|
||||||
|
syn keyword cppConstant ATOMIC_WCHAR_T_LOCK_FREE ATOMIC_SHORT_LOCK_FREE
|
||||||
|
syn keyword cppConstant ATOMIC_INT_LOCK_FREE ATOMIC_LONG_LOCK_FREE
|
||||||
|
syn keyword cppConstant ATOMIC_LLONG_LOCK_FREE ATOMIC_POINTER_LOCK_FREE
|
||||||
|
syn region cppRawString matchgroup=cppRawStringDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"+ contains=@Spell
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" The minimum and maximum operators in GNU C++
|
" The minimum and maximum operators in GNU C++
|
||||||
@@ -63,7 +70,7 @@ if version >= 508 || !exists("did_cpp_syntax_inits")
|
|||||||
HiLink cppStructure Structure
|
HiLink cppStructure Structure
|
||||||
HiLink cppBoolean Boolean
|
HiLink cppBoolean Boolean
|
||||||
HiLink cppConstant Constant
|
HiLink cppConstant Constant
|
||||||
HiLink cppRawDelimiter Delimiter
|
HiLink cppRawStringDelimiter Delimiter
|
||||||
HiLink cppRawString String
|
HiLink cppRawString String
|
||||||
delcommand HiLink
|
delcommand HiLink
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
" Nikolai Weibull (Add CSS2 support)
|
" Nikolai Weibull (Add CSS2 support)
|
||||||
" Maintainer: Jules Wang <w.jq0722@gmail.com>
|
" Maintainer: Jules Wang <w.jq0722@gmail.com>
|
||||||
" URL: https://github.com/JulesWang/css.vim
|
" URL: https://github.com/JulesWang/css.vim
|
||||||
" Last Change: 2014 Oct.28
|
" Last Change: 2015 Apr.17
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" For version 5.x: Clear all syntax items
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
" For version 6.x: Quit when a syntax file was already loaded
|
||||||
@@ -226,7 +226,6 @@ syn keyword cssBackgroundAttr contained left center right top bottom
|
|||||||
" background-repeat attributes
|
" background-repeat attributes
|
||||||
syn match cssBackgroundAttr contained "\<no-repeat\>"
|
syn match cssBackgroundAttr contained "\<no-repeat\>"
|
||||||
syn match cssBackgroundAttr contained "\<repeat\(-[xy]\)\=\>"
|
syn match cssBackgroundAttr contained "\<repeat\(-[xy]\)\=\>"
|
||||||
syn keyword cssBackgroundAttr contained space round
|
|
||||||
|
|
||||||
" background-size attributes
|
" background-size attributes
|
||||||
syn keyword cssBackgroundAttr contained cover contain
|
syn keyword cssBackgroundAttr contained cover contain
|
||||||
@@ -238,7 +237,7 @@ syn match cssBorderProp contained "\<box-decoration-break\>"
|
|||||||
syn match cssBorderProp contained "\<box-shadow\>"
|
syn match cssBorderProp contained "\<box-shadow\>"
|
||||||
|
|
||||||
" border-image attributes
|
" border-image attributes
|
||||||
syn keyword cssBorderAttr contained stretch round space fill
|
syn keyword cssBorderAttr contained stretch round fill
|
||||||
|
|
||||||
" border-style attributes
|
" border-style attributes
|
||||||
syn keyword cssBorderAttr contained dotted dashed solid double groove ridge inset outset
|
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 height
|
||||||
syn keyword cssDimensionProp contained width
|
syn keyword cssDimensionProp contained width
|
||||||
|
|
||||||
" shadow and sizing are in other property groups
|
" CSS Flexible Box Layout Module Level 1
|
||||||
syn match cssFlexibleBoxProp contained "\<box-\(align\|direction\|flex\|ordinal-group\|orient\|pack\|shadow\|sizing\)\>"
|
" http://www.w3.org/TR/css3-flexbox/
|
||||||
syn keyword cssFlexibleBoxAttr contained start end baseline
|
" CSS Box Alignment Module Level 3
|
||||||
syn keyword cssFlexibleBoxAttr contained reverse
|
" http://www.w3.org/TR/css-align-3/
|
||||||
syn keyword cssFlexibleBoxAttr contained single multiple
|
syn match cssFlexibleBoxProp contained "\<flex\(-\(direction\|wrap\|flow\|grow\|shrink\|basis\)\)\=\>"
|
||||||
syn keyword cssFlexibleBoxAttr contained horizontal
|
syn match cssFlexibleBoxProp contained "\<\(align\|justify\)\(-\(items\|self\|content\)\)\=\>"
|
||||||
syn match cssFlexibleBoxAttr contained "\<vertical\(-align\)\@!\>" "escape vertical-align
|
syn keyword cssFlexibleBoxProp contained order
|
||||||
syn match cssFlexibleBoxAttr contained "\<\(inline\|block\)-axis\>"
|
|
||||||
|
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
|
" CSS Fonts Module Level 3
|
||||||
" http://www.w3.org/TR/css-fonts-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
|
" http://www.w3.org/TR/css3-break/#page-break
|
||||||
syn match cssMultiColumnProp contained "\<page\(-break-\(before\|after\|inside\)\)\=\>"
|
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.
|
" TODO find following items in w3c docs.
|
||||||
syn keyword cssGeneratedContentProp contained quotes crop
|
syn keyword cssGeneratedContentProp contained quotes crop
|
||||||
syn match cssGeneratedContentProp contained "\<counter-\(reset\|increment\)\>"
|
syn match cssGeneratedContentProp contained "\<counter-\(reset\|increment\)\>"
|
||||||
@@ -479,7 +486,7 @@ syn match cssPseudoClassId contained "\<focus\(-inner\)\=\>"
|
|||||||
syn match cssPseudoClassId contained "\<\(input-\)\=placeholder\>"
|
syn match cssPseudoClassId contained "\<\(input-\)\=placeholder\>"
|
||||||
|
|
||||||
" Misc highlight groups
|
" Misc highlight groups
|
||||||
syntax match cssUnitDecorators /\(#\|-\|%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|dpi\|dppx\|dpcm\|Hz\|kHz\|s\|ms\|deg\|grad\|rad\)/ contained
|
syntax match cssUnitDecorators /\(#\|-\|%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|ch\|rem\|vh\|vw\|vmin\|vmax\|dpi\|dppx\|dpcm\|Hz\|kHz\|s\|ms\|deg\|grad\|rad\)/ contained
|
||||||
syntax match cssNoise contained /\(:\|;\|\/\)/
|
syntax match cssNoise contained /\(:\|;\|\/\)/
|
||||||
|
|
||||||
" Comment
|
" Comment
|
||||||
@@ -536,6 +543,7 @@ if version >= 508 || !exists("did_css_syn_inits")
|
|||||||
HiLink cssAttrComma Special
|
HiLink cssAttrComma Special
|
||||||
|
|
||||||
HiLink cssAnimationProp cssProp
|
HiLink cssAnimationProp cssProp
|
||||||
|
HiLink cssAuralProp cssProp
|
||||||
HiLink cssBackgroundProp cssProp
|
HiLink cssBackgroundProp cssProp
|
||||||
HiLink cssBorderProp cssProp
|
HiLink cssBorderProp cssProp
|
||||||
HiLink cssBoxProp cssProp
|
HiLink cssBoxProp cssProp
|
||||||
@@ -547,13 +555,17 @@ if version >= 508 || !exists("did_css_syn_inits")
|
|||||||
HiLink cssGeneratedContentProp cssProp
|
HiLink cssGeneratedContentProp cssProp
|
||||||
HiLink cssGridProp cssProp
|
HiLink cssGridProp cssProp
|
||||||
HiLink cssHyerlinkProp cssProp
|
HiLink cssHyerlinkProp cssProp
|
||||||
|
HiLink cssIEUIProp cssProp
|
||||||
|
HiLink cssInteractProp cssProp
|
||||||
HiLink cssLineboxProp cssProp
|
HiLink cssLineboxProp cssProp
|
||||||
HiLink cssListProp cssProp
|
HiLink cssListProp cssProp
|
||||||
HiLink cssMarqueeProp cssProp
|
HiLink cssMarqueeProp cssProp
|
||||||
|
HiLink cssMobileTextProp cssProp
|
||||||
HiLink cssMultiColumnProp cssProp
|
HiLink cssMultiColumnProp cssProp
|
||||||
HiLink cssPagedMediaProp cssProp
|
HiLink cssPagedMediaProp cssProp
|
||||||
HiLink cssPositioningProp cssProp
|
HiLink cssPositioningProp cssProp
|
||||||
HiLink cssPrintProp cssProp
|
HiLink cssPrintProp cssProp
|
||||||
|
HiLink cssRenderProp cssProp
|
||||||
HiLink cssRubyProp cssProp
|
HiLink cssRubyProp cssProp
|
||||||
HiLink cssSpeechProp cssProp
|
HiLink cssSpeechProp cssProp
|
||||||
HiLink cssTableProp cssProp
|
HiLink cssTableProp cssProp
|
||||||
@@ -561,22 +573,22 @@ if version >= 508 || !exists("did_css_syn_inits")
|
|||||||
HiLink cssTransformProp cssProp
|
HiLink cssTransformProp cssProp
|
||||||
HiLink cssTransitionProp cssProp
|
HiLink cssTransitionProp cssProp
|
||||||
HiLink cssUIProp cssProp
|
HiLink cssUIProp cssProp
|
||||||
HiLink cssIEUIProp cssProp
|
|
||||||
HiLink cssAuralProp cssProp
|
|
||||||
HiLink cssRenderProp cssProp
|
|
||||||
HiLink cssMobileTextProp cssProp
|
|
||||||
|
|
||||||
HiLink cssAnimationAttr cssAttr
|
HiLink cssAnimationAttr cssAttr
|
||||||
|
HiLink cssAuralAttr cssAttr
|
||||||
HiLink cssBackgroundAttr cssAttr
|
HiLink cssBackgroundAttr cssAttr
|
||||||
HiLink cssBorderAttr cssAttr
|
HiLink cssBorderAttr cssAttr
|
||||||
HiLink cssBoxAttr cssAttr
|
HiLink cssBoxAttr cssAttr
|
||||||
HiLink cssContentForPagedMediaAttr cssAttr
|
HiLink cssContentForPagedMediaAttr cssAttr
|
||||||
|
HiLink cssCommonAttr cssAttr
|
||||||
HiLink cssDimensionAttr cssAttr
|
HiLink cssDimensionAttr cssAttr
|
||||||
HiLink cssFlexibleBoxAttr cssAttr
|
HiLink cssFlexibleBoxAttr cssAttr
|
||||||
HiLink cssFontAttr cssAttr
|
HiLink cssFontAttr cssAttr
|
||||||
HiLink cssGeneratedContentAttr cssAttr
|
HiLink cssGeneratedContentAttr cssAttr
|
||||||
HiLink cssGridAttr cssAttr
|
HiLink cssGridAttr cssAttr
|
||||||
HiLink cssHyerlinkAttr cssAttr
|
HiLink cssHyerlinkAttr cssAttr
|
||||||
|
HiLink cssIEUIAttr cssAttr
|
||||||
|
HiLink cssInteractAttr cssAttr
|
||||||
HiLink cssLineboxAttr cssAttr
|
HiLink cssLineboxAttr cssAttr
|
||||||
HiLink cssListAttr cssAttr
|
HiLink cssListAttr cssAttr
|
||||||
HiLink cssMarginAttr cssAttr
|
HiLink cssMarginAttr cssAttr
|
||||||
@@ -587,6 +599,7 @@ if version >= 508 || !exists("did_css_syn_inits")
|
|||||||
HiLink cssPositioningAttr cssAttr
|
HiLink cssPositioningAttr cssAttr
|
||||||
HiLink cssGradientAttr cssAttr
|
HiLink cssGradientAttr cssAttr
|
||||||
HiLink cssPrintAttr cssAttr
|
HiLink cssPrintAttr cssAttr
|
||||||
|
HiLink cssRenderAttr cssAttr
|
||||||
HiLink cssRubyAttr cssAttr
|
HiLink cssRubyAttr cssAttr
|
||||||
HiLink cssSpeechAttr cssAttr
|
HiLink cssSpeechAttr cssAttr
|
||||||
HiLink cssTableAttr cssAttr
|
HiLink cssTableAttr cssAttr
|
||||||
@@ -594,10 +607,6 @@ if version >= 508 || !exists("did_css_syn_inits")
|
|||||||
HiLink cssTransformAttr cssAttr
|
HiLink cssTransformAttr cssAttr
|
||||||
HiLink cssTransitionAttr cssAttr
|
HiLink cssTransitionAttr cssAttr
|
||||||
HiLink cssUIAttr cssAttr
|
HiLink cssUIAttr cssAttr
|
||||||
HiLink cssIEUIAttr cssAttr
|
|
||||||
HiLink cssAuralAttr cssAttr
|
|
||||||
HiLink cssRenderAttr cssAttr
|
|
||||||
HiLink cssCommonAttr cssAttr
|
|
||||||
|
|
||||||
HiLink cssPseudoClassId PreProc
|
HiLink cssPseudoClassId PreProc
|
||||||
HiLink cssPseudoClassLang Constant
|
HiLink cssPseudoClassLang Constant
|
||||||
|
|||||||
163
syntax/csv.vim
163
syntax/csv.vim
@@ -1,163 +0,0 @@
|
|||||||
" A simple syntax highlighting, simply alternate colors between two
|
|
||||||
" adjacent columns
|
|
||||||
" Init {{{2
|
|
||||||
let s:cpo_save = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
scriptencoding utf8
|
|
||||||
if version < 600
|
|
||||||
syn clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Helper functions "{{{2
|
|
||||||
fu! <sid>Warning(msg) "{{{3
|
|
||||||
" Don't redraw, so we are not overwriting messages from the ftplugin
|
|
||||||
" script
|
|
||||||
"redraw!
|
|
||||||
echohl WarningMsg
|
|
||||||
echomsg "CSV Syntax:" . a:msg
|
|
||||||
echohl Normal
|
|
||||||
endfu
|
|
||||||
|
|
||||||
fu! <sid>Esc(val, char) "{{2
|
|
||||||
return '\V'.escape(a:val, '\\'.a:char).'\m'
|
|
||||||
endfu
|
|
||||||
|
|
||||||
fu! <sid>CheckSaneSearchPattern() "{{{3
|
|
||||||
let s:del_def = ','
|
|
||||||
let s:col_def = '\%([^' . s:del_def . ']*' . s:del_def . '\|$\)'
|
|
||||||
let s:col_def_end = '\%([^' . s:del_def . ']*' . s:del_def . '\)'
|
|
||||||
|
|
||||||
" First:
|
|
||||||
" Check for filetype plugin. This syntax script relies on the filetype
|
|
||||||
" plugin, else, it won't work properly.
|
|
||||||
redir => s:a |sil filetype | redir end
|
|
||||||
let s:a=split(s:a, "\n")[0]
|
|
||||||
if match(s:a, '\cplugin:off') > 0
|
|
||||||
call <sid>Warning("No filetype support, only simple highlighting using"
|
|
||||||
\ . s:del_def . " as delimiter! See :h csv-installation")
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Check Comment setting
|
|
||||||
if !exists("g:csv_comment")
|
|
||||||
let b:csv_cmt = split(&cms, '%s')
|
|
||||||
else
|
|
||||||
let b:csv_cmt = split(g:csv_comment, '%s')
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
" Second: Check for sane defaults for the column pattern
|
|
||||||
" Not necessary to check for fixed width columns
|
|
||||||
if exists("b:csv_fixed_width_cols")
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
" Try a simple highlighting, if the defaults from the ftplugin
|
|
||||||
" don't exist
|
|
||||||
let s:col = exists("b:col") && !empty(b:col) ? b:col
|
|
||||||
\ : s:col_def
|
|
||||||
let s:col_end = exists("b:col_end") && !empty(b:col_end) ? b:col_end
|
|
||||||
\ : s:col_def_end
|
|
||||||
let s:del = exists("b:delimiter") && !empty(b:delimiter) ? b:delimiter
|
|
||||||
\ : s:del_def
|
|
||||||
let s:cmts = exists("b:csv_cmt") ? b:csv_cmt[0] : split(&cms, '&s')[0]
|
|
||||||
let s:cmte = exists("b:csv_cmt") && len(b:csv_cmt) == 2 ? b:csv_cmt[1]
|
|
||||||
\ : ''
|
|
||||||
|
|
||||||
if line('$') > 1 && (!exists("b:col") || empty(b:col))
|
|
||||||
" check for invalid pattern, ftplugin hasn't been loaded yet
|
|
||||||
call <sid>Warning("Invalid column pattern, using default pattern " . s:col_def)
|
|
||||||
endif
|
|
||||||
endfu
|
|
||||||
|
|
||||||
" Syntax rules {{{2
|
|
||||||
fu! <sid>DoHighlight() "{{{3
|
|
||||||
if has("conceal") && !exists("g:csv_no_conceal") &&
|
|
||||||
\ !exists("b:csv_fixed_width_cols")
|
|
||||||
" old val
|
|
||||||
"\ '\%(.\)\@=/ms=e,me=e contained conceal cchar=' .
|
|
||||||
" Has a problem with the last line!
|
|
||||||
exe "syn match CSVDelimiter /" . s:col_end .
|
|
||||||
\ '/ms=e,me=e contained conceal cchar=' .
|
|
||||||
\ (&enc == "utf-8" ? "│" : '|')
|
|
||||||
"exe "syn match CSVDelimiterEOL /" . s:del .
|
|
||||||
" \ '\?$/ contained conceal cchar=' .
|
|
||||||
" \ (&enc == "utf-8" ? "│" : '|')
|
|
||||||
hi def link CSVDelimiter Conceal
|
|
||||||
elseif !exists("b:csv_fixed_width_cols")
|
|
||||||
" The \%(.\)\@<= makes sure, the last char won't be concealed,
|
|
||||||
" if it isn't a delimiter
|
|
||||||
"exe "syn match CSVDelimiter /" . s:col . '\%(.\)\@<=/ms=e,me=e contained'
|
|
||||||
exe "syn match CSVDelimiter /" . s:col_end . '/ms=e,me=e contained'
|
|
||||||
"exe "syn match CSVDelimiterEOL /" . s:del . '\?$/ contained'
|
|
||||||
if has("conceal")
|
|
||||||
hi def link CSVDelimiter Conceal
|
|
||||||
else
|
|
||||||
hi def link CSVDelimiter Ignore
|
|
||||||
endif
|
|
||||||
endif " There is no delimiter for csv fixed width columns
|
|
||||||
|
|
||||||
|
|
||||||
if !exists("b:csv_fixed_width_cols")
|
|
||||||
exe 'syn match CSVColumnEven nextgroup=CSVColumnOdd /'
|
|
||||||
\ . s:col . '/ contains=CSVDelimiter'
|
|
||||||
exe 'syn match CSVColumnOdd nextgroup=CSVColumnEven /'
|
|
||||||
\ . s:col . '/ contains=CSVDelimiter'
|
|
||||||
exe 'syn match CSVColumnHeaderEven nextgroup=CSVColumnHeaderOdd /\%<'. (get(b:, 'csv_headerline', 1)+1).'l'
|
|
||||||
\. s:col . '/ contains=CSVDelimiter'
|
|
||||||
exe 'syn match CSVColumnHeaderOdd nextgroup=CSVColumnHeaderEven /\%<'. (get(b:, 'csv_headerline', 1)+1).'l'
|
|
||||||
\. s:col . '/ contains=CSVDelimiter'
|
|
||||||
else
|
|
||||||
for i in range(len(b:csv_fixed_width_cols))
|
|
||||||
let pat = '/\%' . b:csv_fixed_width_cols[i] . 'v.*' .
|
|
||||||
\ ((i == len(b:csv_fixed_width_cols)-1) ? '/' :
|
|
||||||
\ '\%' . b:csv_fixed_width_cols[i+1] . 'v/')
|
|
||||||
|
|
||||||
let group = "CSVColumn" . (i%2 ? "Odd" : "Even" )
|
|
||||||
let ngroup = "CSVColumn" . (i%2 ? "Even" : "Odd" )
|
|
||||||
exe "syn match " group pat " nextgroup=" . ngroup
|
|
||||||
endfor
|
|
||||||
endif
|
|
||||||
" Comment regions
|
|
||||||
exe 'syn match CSVComment /'. <sid>Esc(s:cmts, '/'). '.*'.
|
|
||||||
\ (!empty(s:cmte) ? '\%('. <sid>Esc(s:cmte, '/'). '\)\?'
|
|
||||||
\: ''). '/'
|
|
||||||
hi def link CSVComment Comment
|
|
||||||
endfun
|
|
||||||
|
|
||||||
fu! <sid>DoSyntaxDefinitions() "{{{3
|
|
||||||
syn spell toplevel
|
|
||||||
|
|
||||||
" Not really needed
|
|
||||||
syn case ignore
|
|
||||||
|
|
||||||
hi def link CSVColumnHeaderOdd WarningMsg
|
|
||||||
hi def link CSVColumnHeaderEven WarningMsg
|
|
||||||
if get(g:, 'csv_no_column_highlight', 0)
|
|
||||||
hi def link CSVColumnOdd Normal
|
|
||||||
hi def link CSVColumnEven Normal
|
|
||||||
else
|
|
||||||
hi def link CSVColumnOdd DiffAdd
|
|
||||||
hi def link CSVColumnEven DiffChange
|
|
||||||
endif
|
|
||||||
endfun
|
|
||||||
|
|
||||||
" Main: {{{2
|
|
||||||
" Make sure, we are using a sane, valid pattern for syntax
|
|
||||||
" highlighting
|
|
||||||
call <sid>CheckSaneSearchPattern()
|
|
||||||
|
|
||||||
" Define all necessary syntax groups
|
|
||||||
call <sid>DoSyntaxDefinitions()
|
|
||||||
|
|
||||||
" Highlight the file
|
|
||||||
call <sid>DoHighlight()
|
|
||||||
|
|
||||||
" Set the syntax variable {{{2
|
|
||||||
let b:current_syntax="csv"
|
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
|
||||||
unlet s:cpo_save
|
|
||||||
@@ -15,11 +15,20 @@ syn cluster elixirNotTop contains=@elixirRegexSpecial,@elixirStringContained,@el
|
|||||||
syn match elixirComment '#.*' contains=elixirTodo
|
syn match elixirComment '#.*' contains=elixirTodo
|
||||||
syn keyword elixirTodo FIXME NOTE TODO OPTIMIZE XXX HACK contained
|
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 case when cond for if unless try receive send
|
||||||
syn keyword elixirKeyword exit raise throw after rescue catch else do end
|
syn keyword elixirKeyword exit raise throw after rescue catch else do end
|
||||||
syn keyword elixirKeyword quote unquote super
|
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 elixirInclude import require alias use
|
||||||
|
|
||||||
syn keyword elixirSelf self
|
syn keyword elixirSelf self
|
||||||
@@ -70,7 +79,7 @@ syn region elixirRegex matchgroup=elixirRegexDelimiter start="%r/" end="/[uiomxf
|
|||||||
syn cluster elixirRegexSpecial contains=elixirRegexEscape,elixirRegexCharClass,elixirRegexQuantifier,elixirRegexEscapePunctuation
|
syn cluster elixirRegexSpecial contains=elixirRegexEscape,elixirRegexCharClass,elixirRegexQuantifier,elixirRegexEscapePunctuation
|
||||||
syn cluster elixirStringContained contains=elixirInterpolation,elixirRegexEscape,elixirRegexCharClass
|
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 elixirString matchgroup=elixirStringDelimiter start='"' end='"' skip='\\"' contains=@elixirStringContained
|
||||||
syn region elixirInterpolation matchgroup=elixirInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,elixirComment,@elixirNotTop
|
syn region elixirInterpolation matchgroup=elixirInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,elixirComment,@elixirNotTop
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ if !exists("g:go_highlight_trailing_whitespace_error")
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists("g:go_highlight_operators")
|
if !exists("g:go_highlight_operators")
|
||||||
let g:go_highlight_operators = 1
|
let g:go_highlight_operators = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists("g:go_highlight_functions")
|
if !exists("g:go_highlight_functions")
|
||||||
@@ -147,7 +147,7 @@ hi def link goEscapeError Error
|
|||||||
syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError
|
syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError
|
||||||
syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup
|
syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup
|
||||||
syn region goRawString start=+`+ end=+`+
|
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 goString String
|
||||||
hi def link goRawString String
|
hi def link goRawString String
|
||||||
@@ -236,20 +236,18 @@ hi def link goTodo Todo
|
|||||||
|
|
||||||
" Operators;
|
" Operators;
|
||||||
if g:go_highlight_operators != 0
|
if g:go_highlight_operators != 0
|
||||||
syn match goOperator /:=/
|
" match single-char operators: - + % < > ! & | ^ * =
|
||||||
syn match goOperator />=/
|
" and corresponding two-char operators: -= += %= <= >= != &= |= ^= *= ==
|
||||||
syn match goOperator /<=/
|
syn match goOperator /[-+%<>!&|^*=]=\?/
|
||||||
syn match goOperator /==/
|
" match / and /=
|
||||||
syn match goOperator /!=/
|
syn match goOperator /\/\%(=\|\ze[^/*]\)/
|
||||||
syn match goOperator /+=/
|
" match two-char operators: << >> &^
|
||||||
syn match goOperator /-=/
|
" and corresponding three-char operators: <<= >>= &^=
|
||||||
syn match goOperator /\s>\s/
|
syn match goOperator /\%(<<\|>>\|&^\)=\?/
|
||||||
syn match goOperator /\s<\s/
|
" match remaining two-char operators: := && || <- ++ --
|
||||||
syn match goOperator /\s+\s/
|
syn match goOperator /:=\|||\|<-\|++\|--/
|
||||||
syn match goOperator /\s-\s/
|
" match ...
|
||||||
syn match goOperator /\s\*\s/
|
syn match goOperator /\.\.\./
|
||||||
syn match goOperator /\s\/\s/
|
|
||||||
syn match goOperator /\s%\s/
|
|
||||||
endif
|
endif
|
||||||
hi def link goOperator Operator
|
hi def link goOperator Operator
|
||||||
|
|
||||||
|
|||||||
15
syntax/gohtmltmpl.vim
Normal file
15
syntax/gohtmltmpl.vim
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists("main_syntax")
|
||||||
|
let main_syntax = 'html'
|
||||||
|
endif
|
||||||
|
|
||||||
|
runtime! syntax/gotexttmpl.vim
|
||||||
|
runtime! syntax/html.vim
|
||||||
|
unlet b:current_syntax
|
||||||
|
|
||||||
|
let b:current_syntax = "gohtmltmpl"
|
||||||
|
|
||||||
|
" vim:ts=4:sw=4:et
|
||||||
85
syntax/gotexttmpl.vim
Normal file
85
syntax/gotexttmpl.vim
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
" Copyright 2011 The Go Authors. All rights reserved.
|
||||||
|
" Use of this source code is governed by a BSD-style
|
||||||
|
" license that can be found in the LICENSE file.
|
||||||
|
"
|
||||||
|
" gotexttmpl.vim: Vim syntax file for Go templates.
|
||||||
|
|
||||||
|
" Quit when a (custom) syntax file was already loaded
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn case match
|
||||||
|
|
||||||
|
" Go escapes
|
||||||
|
syn match goEscapeOctal display contained "\\[0-7]\{3}"
|
||||||
|
syn match goEscapeC display contained +\\[abfnrtv\\'"]+
|
||||||
|
syn match goEscapeX display contained "\\x\x\{2}"
|
||||||
|
syn match goEscapeU display contained "\\u\x\{4}"
|
||||||
|
syn match goEscapeBigU display contained "\\U\x\{8}"
|
||||||
|
syn match goEscapeError display contained +\\[^0-7xuUabfnrtv\\'"]+
|
||||||
|
|
||||||
|
hi def link goEscapeOctal goSpecialString
|
||||||
|
hi def link goEscapeC goSpecialString
|
||||||
|
hi def link goEscapeX goSpecialString
|
||||||
|
hi def link goEscapeU goSpecialString
|
||||||
|
hi def link goEscapeBigU goSpecialString
|
||||||
|
hi def link goSpecialString Special
|
||||||
|
hi def link goEscapeError Error
|
||||||
|
|
||||||
|
" Strings and their contents
|
||||||
|
syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError
|
||||||
|
syn region goString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup
|
||||||
|
syn region goRawString contained start=+`+ end=+`+
|
||||||
|
|
||||||
|
hi def link goString String
|
||||||
|
hi def link goRawString String
|
||||||
|
|
||||||
|
" Characters; their contents
|
||||||
|
syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU
|
||||||
|
syn region goCharacter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@goCharacterGroup
|
||||||
|
|
||||||
|
hi def link goCharacter Character
|
||||||
|
|
||||||
|
" Integers
|
||||||
|
syn match goDecimalInt contained "\<\d\+\([Ee]\d\+\)\?\>"
|
||||||
|
syn match goHexadecimalInt contained "\<0x\x\+\>"
|
||||||
|
syn match goOctalInt contained "\<0\o\+\>"
|
||||||
|
syn match goOctalError contained "\<0\o*[89]\d*\>"
|
||||||
|
syn cluster goInt contains=goDecimalInt,goHexadecimalInt,goOctalInt
|
||||||
|
" Floating point
|
||||||
|
syn match goFloat contained "\<\d\+\.\d*\([Ee][-+]\d\+\)\?\>"
|
||||||
|
syn match goFloat contained "\<\.\d\+\([Ee][-+]\d\+\)\?\>"
|
||||||
|
syn match goFloat contained "\<\d\+[Ee][-+]\d\+\>"
|
||||||
|
" Imaginary literals
|
||||||
|
syn match goImaginary contained "\<\d\+i\>"
|
||||||
|
syn match goImaginary contained "\<\d\+\.\d*\([Ee][-+]\d\+\)\?i\>"
|
||||||
|
syn match goImaginary contained "\<\.\d\+\([Ee][-+]\d\+\)\?i\>"
|
||||||
|
syn match goImaginary contained "\<\d\+[Ee][-+]\d\+i\>"
|
||||||
|
|
||||||
|
hi def link goInt Number
|
||||||
|
hi def link goFloat Number
|
||||||
|
hi def link goImaginary Number
|
||||||
|
|
||||||
|
" Token groups
|
||||||
|
syn cluster gotplLiteral contains=goString,goRawString,goCharacter,@goInt,goFloat,goImaginary
|
||||||
|
syn keyword gotplControl contained if else end range with template
|
||||||
|
syn keyword gotplFunctions contained and html index js len not or print printf println urlquery eq ne lt le gt ge
|
||||||
|
syn match gotplVariable contained /\$[^ ]*\>/
|
||||||
|
syn match goTplIdentifier contained /\.[^ ]*\>/
|
||||||
|
|
||||||
|
hi def link gotplControl Keyword
|
||||||
|
hi def link gotplFunctions Function
|
||||||
|
hi def link goTplVariable Special
|
||||||
|
|
||||||
|
syn region gotplAction start="{{" end="}}" contains=@gotplLiteral,gotplControl,gotplFunctions,gotplVariable,goTplIdentifier display
|
||||||
|
syn region gotplAction start="\[\[" end="\]\]" contains=@gotplLiteral,gotplControl,gotplFunctions,gotplVariable display
|
||||||
|
syn region goTplComment start="{{/\*" end="\*/}}" display
|
||||||
|
syn region goTplComment start="\[\[/\*" end="\*/\]\]" display
|
||||||
|
|
||||||
|
hi def link gotplAction PreProc
|
||||||
|
hi def link goTplComment Comment
|
||||||
|
|
||||||
|
let b:current_syntax = "gotexttmpl"
|
||||||
|
|
||||||
|
" vim:ts=4:sw=4:et
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
syn keyword htmlTagName contained article aside audio canvas command
|
syn keyword htmlTagName contained article aside audio canvas command
|
||||||
syn keyword htmlTagName contained datalist details dialog embed figcaption figure footer
|
syn keyword htmlTagName contained datalist details dialog embed figcaption figure footer
|
||||||
syn keyword htmlTagName contained header hgroup keygen main mark meter menu nav output
|
syn keyword htmlTagName contained header hgroup keygen main mark meter menu nav output
|
||||||
syn keyword htmlTagName contained progress ruby rt rp section source summary time track video data
|
syn keyword htmlTagName contained progress ruby rt rp rb rtc section source summary time track video data
|
||||||
syn keyword htmlTagName contained template content shadow
|
syn keyword htmlTagName contained template content shadow
|
||||||
syn keyword htmlTagName contained wbr bdi
|
syn keyword htmlTagName contained wbr bdi
|
||||||
syn keyword htmlTagName contained picture
|
syn keyword htmlTagName contained picture
|
||||||
@@ -43,7 +43,7 @@ syn keyword htmlTagName contained missing-glyph mpath
|
|||||||
syn keyword htmlTagName contained text textPath tref tspan vkern
|
syn keyword htmlTagName contained text textPath tref tspan vkern
|
||||||
|
|
||||||
" Custom Element
|
" 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
|
" HTML 5 arguments
|
||||||
" Core Attributes
|
" Core Attributes
|
||||||
@@ -76,12 +76,14 @@ syn keyword htmlArg contained label icon open datetime pubdate
|
|||||||
syn keyword htmlArg contained async
|
syn keyword htmlArg contained async
|
||||||
" <content>
|
" <content>
|
||||||
syn keyword htmlArg contained select
|
syn keyword htmlArg contained select
|
||||||
|
" <iframe>
|
||||||
|
syn keyword htmlArg contained seamless srcdoc sandbox
|
||||||
" <picture>
|
" <picture>
|
||||||
syn keyword htmlArg contained srcset sizes
|
syn keyword htmlArg contained srcset sizes
|
||||||
|
|
||||||
" Custom Data Attributes
|
" Custom Data Attributes
|
||||||
" http://dev.w3.org/html5/spec/elements.html#embedding-custom-non-visible-data
|
" http://dev.w3.org/html5/spec/elements.html#embedding-custom-non-visible-data
|
||||||
syn match htmlArg "\<\(data\(\-[a-z]\+\)\+\)\=\>" contained
|
syn match htmlArg "\<\(data\-\([a-z_][a-z0-9_.\-]*\)\+\)\=\>" contained
|
||||||
|
|
||||||
" Microdata
|
" Microdata
|
||||||
" http://dev.w3.org/html5/md/
|
" http://dev.w3.org/html5/md/
|
||||||
|
|||||||
@@ -53,11 +53,10 @@ syn region jadePipedText matchgroup=jadePipeChar start="|" end="$" contained co
|
|||||||
syn match jadeTagBlockChar "\.$" contained nextgroup=jadeTagBlockText,jadeTagBlockEnd skipnl
|
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 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 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 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\|marked\)\s*$/ end=/^\%(\z1\s\|\s*$\)\@!/ contains=@htmlMarkdown
|
||||||
syn region jadeMarkdownFilter matchgroup=jadeFilter start=/^\z(\s*\):markdown\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 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*$\)\@!"
|
syn region jadePlainFilter matchgroup=jadeFilter start="^\z(\s*\):\%(sass\|less\|cdata\)\s*$" end="^\%(\z1\s\|\s*$\)\@!"
|
||||||
|
|
||||||
@@ -66,9 +65,11 @@ syn match jadeScriptStatement "^\s*\<\%(each\|for\|block\|prepend\|append\|mixi
|
|||||||
syn region jadeScriptLoopRegion start="^\s*\(for \)" end="$" contains=jadeScriptLoopKeywords
|
syn region jadeScriptLoopRegion start="^\s*\(for \)" end="$" contains=jadeScriptLoopKeywords
|
||||||
syn keyword jadeScriptLoopKeywords for in contained
|
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 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=@jadeTop,@htmlCss keepend
|
syn region jadeCssBlock start="^\z(\s*\)style" nextgroup=@jadeComponent,jadeError end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlCss keepend
|
||||||
|
|
||||||
syn match jadeError "\$" contained
|
syn match jadeError "\$" contained
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,13 @@ syntax keyword jsOperator delete instanceof typeof void new in
|
|||||||
syntax match jsOperator /\(!\||\|&\|+\|-\|<\|>\|=\|%\|\/\|*\|\~\|\^\)/
|
syntax match jsOperator /\(!\||\|&\|+\|-\|<\|>\|=\|%\|\/\|*\|\~\|\^\)/
|
||||||
syntax keyword jsBooleanTrue true
|
syntax keyword jsBooleanTrue true
|
||||||
syntax keyword jsBooleanFalse false
|
syntax keyword jsBooleanFalse false
|
||||||
syntax keyword jsCommonJS require module exports
|
syntax keyword jsModules import export contained
|
||||||
|
syntax keyword jsModuleWords default from as contained
|
||||||
|
syntax keyword jsOf of contained
|
||||||
|
|
||||||
|
syntax region jsImportContainer start="^\s\?import \?" end="$" contains=jsModules,jsModuleWords,jsComment,jsStringS,jsStringD,jsTemplateString
|
||||||
|
|
||||||
|
syntax region jsExportContainer start="^\s\?export \?" end="$" contains=jsModules,jsModuleWords,jsComment,jsTemplateString,jsStringD,jsStringS,jsRegexpString,jsNumber,jsFloat,jsThis,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsDotNotation,jsBracket,jsParen,jsFuncCall,jsUndefined,jsNan,jsKeyword,jsClass,jsStorageClass,jsPrototype,jsBuiltins,jsNoise,jsAssignmentExpr
|
||||||
|
|
||||||
"" JavaScript comments
|
"" JavaScript comments
|
||||||
syntax keyword jsCommentTodo TODO FIXME XXX TBD contained
|
syntax keyword jsCommentTodo TODO FIXME XXX TBD contained
|
||||||
@@ -53,7 +59,7 @@ if !exists("javascript_ignore_javaScriptdoc")
|
|||||||
"syntax include @javaHtml <sfile>:p:h/html.vim
|
"syntax include @javaHtml <sfile>:p:h/html.vim
|
||||||
"unlet b:current_syntax
|
"unlet b:current_syntax
|
||||||
|
|
||||||
syntax region jsDocComment matchgroup=jsComment start="/\*\*\s*" end="\*/" contains=jsDocTags,jsCommentTodo,jsCvsTag,@jsHtml,@Spell fold
|
syntax region jsBlockComment matchgroup=jsComment start="/\*\s*" end="\*/" contains=jsDocTags,jsCommentTodo,jsCvsTag,@jsHtml,@Spell fold
|
||||||
|
|
||||||
" tags containing a param
|
" tags containing a param
|
||||||
syntax match jsDocTags contained "@\(alias\|api\|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
|
syntax match jsDocTags contained "@\(alias\|api\|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
|
||||||
@@ -79,26 +85,27 @@ endif "" JSDoc end
|
|||||||
syntax case match
|
syntax case match
|
||||||
|
|
||||||
"" Syntax in the JavaScript code
|
"" Syntax in the JavaScript code
|
||||||
syntax match jsFuncCall /\k\+\%(\s*(\)\@=/
|
syntax match jsFuncCall /\k\+\%(\s*(\)\@=/
|
||||||
syntax match jsSpecial "\v\\%(0|\\x\x\{2\}\|\\u\x\{4\}\|\c[A-Z]|.)" contained
|
syntax match jsSpecial "\v\\%(0|\\x\x\{2\}\|\\u\x\{4\}\|\c[A-Z]|.)" contained
|
||||||
syntax match jsTemplateVar "\${.\{-}}" contained
|
syntax match jsTemplateVar "\${.\{-}}" contained
|
||||||
syntax region jsStringD start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@htmlPreproc,@Spell
|
syntax region jsStringD start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@htmlPreproc,@Spell
|
||||||
syntax region jsStringS 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 jsTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`+ contains=jsTemplateVar,jsSpecial,@htmlPreproc
|
||||||
syntax region jsRegexpCharClass start=+\[+ skip=+\\.+ end=+\]+ contained
|
syntax region jsTaggedTemplate start=/\k\+\(\(\n\|\s\)\+\)\?`/ end=+`\|$+ contains=jsTemplateString
|
||||||
|
syntax region jsRegexpCharClass start=+\[+ skip=+\\.+ end=+\]+ contained
|
||||||
syntax match jsRegexpBoundary "\v%(\<@![\^$]|\\[bB])" contained
|
syntax match jsRegexpBoundary "\v%(\<@![\^$]|\\[bB])" contained
|
||||||
syntax match jsRegexpBackRef "\v\\[1-9][0-9]*" contained
|
syntax match jsRegexpBackRef "\v\\[1-9][0-9]*" contained
|
||||||
syntax match jsRegexpQuantifier "\v\\@<!%([?*+]|\{\d+%(,|,\d+)?})\??" contained
|
syntax match jsRegexpQuantifier "\v\\@<!%([?*+]|\{\d+%(,|,\d+)?})\??" contained
|
||||||
syntax match jsRegexpOr "\v\<@!\|" contained
|
syntax match jsRegexpOr "\v\<@!\|" contained
|
||||||
syntax match jsRegexpMod "\v\(@<=\?[:=!>]" contained
|
syntax match jsRegexpMod "\v\(@<=\?[:=!>]" contained
|
||||||
syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod
|
syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod
|
||||||
syntax region jsRegexpGroup start="\\\@<!(" skip="\\.\|\[\(\\.\|[^]]\)*\]" 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 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\|[eE][+-]\=\d\+\)\=\>\|\<0[xX]\x\+\>/
|
syntax match jsNumber /\<-\=\d\+\(L\|[eE][+-]\=\d\+\)\=\>\|\<0[xX]\x\+\>/
|
||||||
syntax keyword jsNumber Infinity
|
syntax keyword jsNumber Infinity
|
||||||
syntax match jsFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
|
syntax match jsFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
|
||||||
syntax match jsObjectKey /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s*:\)\@=/ contains=jsFunctionKey contained
|
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
|
syntax match jsFunctionKey /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s*:\s*function\s*\)\@=/ contained
|
||||||
|
|
||||||
syntax match jsAssignmentExpr /\v%([a-zA-Z_$]\k*\.)*[a-zA-Z_$]\k*\s*\=/ contains=jsFuncAssignExpr,jsAssignExpIdent,jsPrototype,jsOperator,jsThis,jsNoise
|
syntax match jsAssignmentExpr /\v%([a-zA-Z_$]\k*\.)*[a-zA-Z_$]\k*\s*\=/ contains=jsFuncAssignExpr,jsAssignExpIdent,jsPrototype,jsOperator,jsThis,jsNoise
|
||||||
syntax match jsAssignExpIdent /\v[a-zA-Z_$]\k*\ze%(\s*\=)/ contained
|
syntax match jsAssignExpIdent /\v[a-zA-Z_$]\k*\ze%(\s*\=)/ contained
|
||||||
@@ -112,23 +119,26 @@ exe 'syntax keyword jsUndefined undefined '.(exists('g:javascript_conceal_undefi
|
|||||||
exe 'syntax keyword jsNan NaN '.(exists('g:javascript_conceal_NaN') ? 'conceal cchar='.g:javascript_conceal_NaN : '')
|
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 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 : '')
|
exe 'syntax keyword jsThis this '.(exists('g:javascript_conceal_this') ? 'conceal cchar='.g:javascript_conceal_this : '')
|
||||||
|
exe 'syntax keyword jsStatic static '.(exists('g:javascript_conceal_static') ? 'conceal cchar='.g:javascript_conceal_static : '')
|
||||||
|
exe 'syntax keyword jsSuper super '.(exists('g:javascript_conceal_super') ? 'conceal cchar='.g:javascript_conceal_super : '')
|
||||||
|
|
||||||
"" Statement Keywords
|
"" Statement Keywords
|
||||||
syntax keyword jsStatement break continue with
|
syntax keyword jsStatement break continue with
|
||||||
syntax keyword jsConditional if else switch
|
syntax keyword jsConditional if else switch
|
||||||
syntax keyword jsRepeat do while for
|
syntax keyword jsRepeat do while for
|
||||||
syntax keyword jsLabel case default
|
syntax keyword jsLabel case default
|
||||||
syntax keyword jsKeyword yield import export default extends class
|
syntax keyword jsKeyword yield
|
||||||
|
syntax keyword jsClass extends class
|
||||||
syntax keyword jsException try catch throw finally
|
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
|
syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set RegExp String Proxy Promise ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray Intl JSON Math console document window
|
||||||
syntax match jsGlobalObjects /\%(Intl\.\)\@<=\(Collator\|DateTimeFormat\|NumberFormat\)/
|
syntax match jsGlobalObjects /\%(Intl\.\)\@<=\(Collator\|DateTimeFormat\|NumberFormat\)/
|
||||||
|
|
||||||
syntax keyword jsExceptions Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError
|
syntax keyword jsExceptions Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError
|
||||||
|
|
||||||
syntax keyword jsBuiltins decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt uneval
|
syntax keyword jsBuiltins decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt uneval
|
||||||
|
|
||||||
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
|
syntax keyword jsFutureKeys abstract enum int short boolean interface byte long char final native synchronized float package throws goto private transient debugger implements protected volatile double public
|
||||||
|
|
||||||
"" DOM/HTML/CSS specified things
|
"" DOM/HTML/CSS specified things
|
||||||
|
|
||||||
@@ -165,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 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 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 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 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 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
|
syntax keyword jsCssStyles contained scrollbar3dLightColor scrollbarArrowColor scrollbarBaseColor scrollbarDarkShadowColor scrollbarFaceColor scrollbarHighlightColor scrollbarShadowColor scrollbarTrackColor
|
||||||
@@ -178,12 +188,11 @@ endif "DOM/HTML/CSS
|
|||||||
|
|
||||||
"" end DOM/HTML/CSS specified things
|
"" end DOM/HTML/CSS specified things
|
||||||
|
|
||||||
|
|
||||||
"" Code blocks
|
"" 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,jsCommonJS,jsAssignmentExpr
|
syntax cluster jsExpression contains=jsComment,jsLineComment,jsBlockComment,jsTaggedTemplate,jsTemplateString,jsStringD,jsStringS,jsRegexpString,jsNumber,jsFloat,jsThis,jsStatic,jsSuper,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,jsAssignmentExpr,jsImportContainer,jsExportContainer,jsClass
|
||||||
syntax cluster jsAll contains=@jsExpression,jsLabel,jsConditional,jsRepeat,jsReturn,jsStatement,jsTernaryIf,jsException
|
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 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
|
syntax region jsParen matchgroup=jsParens start="(" end=")" contains=@jsAll,jsOf,jsParensErrA,jsParensErrC,jsParen,jsBracket,jsBlock,@htmlPreproc fold
|
||||||
syntax region jsBlock matchgroup=jsBraces start="{" end="}" contains=@jsAll,jsParensErrA,jsParensErrB,jsParen,jsBracket,jsBlock,jsObjectKey,@htmlPreproc fold
|
syntax region jsBlock matchgroup=jsBraces start="{" end="}" contains=@jsAll,jsParensErrA,jsParensErrB,jsParen,jsBracket,jsBlock,jsObjectKey,@htmlPreproc fold
|
||||||
syntax region jsFuncBlock matchgroup=jsFuncBraces start="{" end="}" contains=@jsAll,jsParensErrA,jsParensErrB,jsParen,jsBracket,jsBlock,@htmlPreproc contained fold
|
syntax region jsFuncBlock matchgroup=jsFuncBraces start="{" end="}" contains=@jsAll,jsParensErrA,jsParensErrB,jsParen,jsBracket,jsBlock,@htmlPreproc contained fold
|
||||||
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=+?+ end=+:+ contains=@jsExpression,jsTernaryIf
|
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=+?+ end=+:+ contains=@jsExpression,jsTernaryIf
|
||||||
@@ -204,7 +213,7 @@ exe 'syntax match jsFunction /\<function\>/ nextgroup=jsGenerator,jsFuncName,jsF
|
|||||||
|
|
||||||
syntax match jsGenerator contained '\*' nextgroup=jsFuncName skipwhite
|
syntax match jsGenerator contained '\*' nextgroup=jsFuncName skipwhite
|
||||||
syntax match jsFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*/ nextgroup=jsFuncArgs skipwhite
|
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
|
syntax region jsFuncArgs contained matchgroup=jsFuncParens start='(' end=')' contains=jsFuncArgCommas,jsFuncArgRest,jsAssignmentExpr nextgroup=jsFuncBlock keepend skipwhite skipempty
|
||||||
syntax match jsFuncArgCommas contained ','
|
syntax match jsFuncArgCommas contained ','
|
||||||
syntax match jsFuncArgRest contained /\%(\.\.\.[a-zA-Z_$][0-9a-zA-Z_$]*\))/
|
syntax match jsFuncArgRest contained /\%(\.\.\.[a-zA-Z_$][0-9a-zA-Z_$]*\))/
|
||||||
syntax keyword jsArgsObj arguments contained containedin=jsFuncBlock
|
syntax keyword jsArgsObj arguments contained containedin=jsFuncBlock
|
||||||
@@ -225,7 +234,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
|||||||
HiLink jsComment Comment
|
HiLink jsComment Comment
|
||||||
HiLink jsLineComment Comment
|
HiLink jsLineComment Comment
|
||||||
HiLink jsEnvComment PreProc
|
HiLink jsEnvComment PreProc
|
||||||
HiLink jsDocComment Comment
|
HiLink jsBlockComment Comment
|
||||||
HiLink jsCommentTodo Todo
|
HiLink jsCommentTodo Todo
|
||||||
HiLink jsCvsTag Function
|
HiLink jsCvsTag Function
|
||||||
HiLink jsDocTags Special
|
HiLink jsDocTags Special
|
||||||
@@ -236,6 +245,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
|||||||
HiLink jsStringS String
|
HiLink jsStringS String
|
||||||
HiLink jsStringD String
|
HiLink jsStringD String
|
||||||
HiLink jsTemplateString String
|
HiLink jsTemplateString String
|
||||||
|
HiLink jsTaggedTemplate StorageClass
|
||||||
HiLink jsTernaryIfOperator Conditional
|
HiLink jsTernaryIfOperator Conditional
|
||||||
HiLink jsRegexpString String
|
HiLink jsRegexpString String
|
||||||
HiLink jsRegexpBoundary SpecialChar
|
HiLink jsRegexpBoundary SpecialChar
|
||||||
@@ -266,8 +276,12 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
|||||||
HiLink jsParensErrB Error
|
HiLink jsParensErrB Error
|
||||||
HiLink jsParensErrC Error
|
HiLink jsParensErrC Error
|
||||||
HiLink jsOperator Operator
|
HiLink jsOperator Operator
|
||||||
|
HiLink jsOf Operator
|
||||||
HiLink jsStorageClass StorageClass
|
HiLink jsStorageClass StorageClass
|
||||||
|
HiLink jsClass Structure
|
||||||
HiLink jsThis Special
|
HiLink jsThis Special
|
||||||
|
HiLink jsStatic Special
|
||||||
|
HiLink jsSuper Special
|
||||||
HiLink jsNan Number
|
HiLink jsNan Number
|
||||||
HiLink jsNull Type
|
HiLink jsNull Type
|
||||||
HiLink jsUndefined Type
|
HiLink jsUndefined Type
|
||||||
@@ -287,7 +301,8 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
|||||||
HiLink jsExceptions Special
|
HiLink jsExceptions Special
|
||||||
HiLink jsFutureKeys Special
|
HiLink jsFutureKeys Special
|
||||||
HiLink jsBuiltins Special
|
HiLink jsBuiltins Special
|
||||||
HiLink jsCommonJS Include
|
HiLink jsModules Include
|
||||||
|
HiLink jsModuleWords Include
|
||||||
|
|
||||||
HiLink jsDomErrNo Constant
|
HiLink jsDomErrNo Constant
|
||||||
HiLink jsDomNodeConsts Constant
|
HiLink jsDomNodeConsts Constant
|
||||||
@@ -304,10 +319,9 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Define the htmlJavaScript for HTML syntax html.vim
|
" Define the htmlJavaScript for HTML syntax html.vim
|
||||||
"syntax clear htmlJavaScript
|
|
||||||
"syntax clear jsExpression
|
|
||||||
syntax cluster htmlJavaScript contains=@jsAll,jsBracket,jsParen,jsBlock
|
syntax cluster htmlJavaScript contains=@jsAll,jsBracket,jsParen,jsBlock
|
||||||
syntax cluster javaScriptExpression contains=@jsAll,jsBracket,jsParen,jsBlock,@htmlPreproc
|
syntax cluster javaScriptExpression contains=@jsAll,jsBracket,jsParen,jsBlock,@htmlPreproc
|
||||||
|
|
||||||
" Vim's default html.vim highlights all javascript as 'Special'
|
" Vim's default html.vim highlights all javascript as 'Special'
|
||||||
hi! def link javaScript NONE
|
hi! def link javaScript NONE
|
||||||
|
|
||||||
|
|||||||
128
syntax/json.vim
128
syntax/json.vim
@@ -1,13 +1,7 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: JSON
|
" Language: JSON
|
||||||
" Maintainer: Jeroen Ruigrok van der Werven <asmodai@in-nomine.org>
|
" Maintainer: Eli Parra <eli@elzr.com> https://github.com/elzr/vim-json
|
||||||
" Last Change: 2009-06-16
|
" Last Change: 2014-12-20 Load ftplugin/json.vim
|
||||||
" Version: 0.4
|
|
||||||
" {{{1
|
|
||||||
|
|
||||||
" Syntax setup {{{2
|
|
||||||
" For version 5.x: Clear all syntax items
|
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
|
||||||
|
|
||||||
if !exists("main_syntax")
|
if !exists("main_syntax")
|
||||||
if version < 600
|
if version < 600
|
||||||
@@ -18,54 +12,95 @@ if !exists("main_syntax")
|
|||||||
let main_syntax = 'json'
|
let main_syntax = 'json'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Syntax: Strings {{{2
|
syntax match jsonNoise /\%(:\|,\)/
|
||||||
syn region jsonString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=jsonEscape
|
|
||||||
" Syntax: JSON does not allow strings with single quotes, unlike JavaScript.
|
|
||||||
syn region jsonStringSQ start=+'+ skip=+\\\\\|\\"+ end=+'+
|
|
||||||
|
|
||||||
" Syntax: Escape sequences {{{3
|
" Syntax: Strings
|
||||||
|
" Separated into a match and region because a region by itself is always greedy
|
||||||
|
syn match jsonStringMatch /"\([^"]\|\\\"\)\+"\ze[[:blank:]\r\n]*[,}\]]/ contains=jsonString
|
||||||
|
syn region jsonString oneline matchgroup=jsonQuote start=/"/ skip=/\\\\\|\\"/ end=/"/ concealends contains=jsonEscape contained
|
||||||
|
|
||||||
|
" Syntax: JSON does not allow strings with single quotes, unlike JavaScript.
|
||||||
|
syn region jsonStringSQError oneline start=+'+ skip=+\\\\\|\\"+ end=+'+
|
||||||
|
|
||||||
|
" Syntax: JSON Keywords
|
||||||
|
" Separated into a match and region because a region by itself is always greedy
|
||||||
|
syn match jsonKeywordMatch /"\([^"]\|\\\"\)\+"[[:blank:]\r\n]*\:/ contains=jsonKeyword
|
||||||
|
syn region jsonKeyword matchgroup=jsonQuote start=/"/ end=/"\ze[[:blank:]\r\n]*\:/ contains=jsonEscape contained
|
||||||
|
|
||||||
|
" Syntax: Escape sequences
|
||||||
syn match jsonEscape "\\["\\/bfnrt]" contained
|
syn match jsonEscape "\\["\\/bfnrt]" contained
|
||||||
syn match jsonEscape "\\u\x\{4}" contained
|
syn match jsonEscape "\\u\x\{4}" contained
|
||||||
|
|
||||||
" Syntax: Strings should always be enclosed with quotes.
|
" Syntax: Numbers
|
||||||
syn match jsonNoQuotes "\<\a\+\>"
|
syn match jsonNumber "-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)\=\>\ze[[:blank:]\r\n]*[,}\]]"
|
||||||
|
|
||||||
" Syntax: Numbers {{{2
|
" ERROR WARNINGS **********************************************
|
||||||
syn match jsonNumber "-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)\=\>"
|
" Syntax: Strings should always be enclosed with quotes.
|
||||||
|
syn match jsonNoQuotesError "\<[[:alpha:]][[:alnum:]]*\>"
|
||||||
|
syn match jsonTripleQuotesError /"""/
|
||||||
|
|
||||||
" Syntax: An integer part of 0 followed by other digits is not allowed.
|
" Syntax: An integer part of 0 followed by other digits is not allowed.
|
||||||
syn match jsonNumError "-\=\<0\d\.\d*\>"
|
syn match jsonNumError "-\=\<0\d\.\d*\>"
|
||||||
|
|
||||||
" Syntax: Boolean {{{2
|
" Syntax: Decimals smaller than one should begin with 0 (so .1 should be 0.1).
|
||||||
syn keyword jsonBoolean true false
|
syn match jsonNumError "\:\@<=[[:blank:]\r\n]*\zs\.\d\+"
|
||||||
|
|
||||||
" Syntax: Null {{{2
|
" Syntax: No comments in JSON, see http://stackoverflow.com/questions/244777/can-i-comment-a-json-file
|
||||||
syn keyword jsonNull null
|
syn match jsonCommentError "//.*"
|
||||||
|
syn match jsonCommentError "\(/\*\)\|\(\*/\)"
|
||||||
|
|
||||||
" Syntax: Braces {{{2
|
" Syntax: No semicolons in JSON
|
||||||
syn match jsonBraces "[{}\[\]]"
|
syn match jsonSemicolonError ";"
|
||||||
|
|
||||||
" Define the default highlighting. {{{1
|
" Syntax: No trailing comma after the last element of arrays or objects
|
||||||
" For version 5.7 and earlier: only when not done already
|
syn match jsonTrailingCommaError ",\_s*[}\]]"
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
|
" Syntax: Watch out for missing commas between elements
|
||||||
|
syn match jsonMissingCommaError /\("\|\]\|\d\)\zs\_s\+\ze"/
|
||||||
|
syn match jsonMissingCommaError /\(\]\|\}\)\_s\+\ze"/ "arrays/objects as values
|
||||||
|
syn match jsonMissingCommaError /}\_s\+\ze{/ "objects as elements in an array
|
||||||
|
syn match jsonMissingCommaError /\(true\|false\)\_s\+\ze"/ "true/false as value
|
||||||
|
|
||||||
|
" ********************************************** END OF ERROR WARNINGS
|
||||||
|
" Allowances for JSONP: function call at the beginning of the file,
|
||||||
|
" parenthesis and semicolon at the end.
|
||||||
|
" Function name validation based on
|
||||||
|
" http://stackoverflow.com/questions/2008279/validate-a-javascript-function-name/2008444#2008444
|
||||||
|
syn match jsonPadding "\%^[[:blank:]\r\n]*[_$[:alpha:]][_$[:alnum:]]*[[:blank:]\r\n]*("
|
||||||
|
syn match jsonPadding ");[[:blank:]\r\n]*\%$"
|
||||||
|
|
||||||
|
" Syntax: Boolean
|
||||||
|
syn match jsonBoolean /\(true\|false\)\(\_s\+\ze"\)\@!/
|
||||||
|
|
||||||
|
" Syntax: Null
|
||||||
|
syn keyword jsonNull null
|
||||||
|
|
||||||
|
" Syntax: Braces
|
||||||
|
syn region jsonFold matchgroup=jsonBraces start="{" end=/}\(\_s\+\ze\("\|{\)\)\@!/ transparent fold
|
||||||
|
syn region jsonFold matchgroup=jsonBraces start="\[" end=/]\(\_s\+\ze"\)\@!/ transparent fold
|
||||||
|
|
||||||
|
" Define the default highlighting.
|
||||||
if version >= 508 || !exists("did_json_syn_inits")
|
if version >= 508 || !exists("did_json_syn_inits")
|
||||||
if version < 508
|
hi def link jsonPadding Operator
|
||||||
let did_json_syn_inits = 1
|
hi def link jsonString String
|
||||||
command -nargs=+ HiLink hi link <args>
|
hi def link jsonTest Label
|
||||||
else
|
hi def link jsonEscape Special
|
||||||
command -nargs=+ HiLink hi def link <args>
|
hi def link jsonNumber Number
|
||||||
endif
|
hi def link jsonBraces Delimiter
|
||||||
HiLink jsonString String
|
hi def link jsonNull Function
|
||||||
HiLink jsonEscape Special
|
hi def link jsonBoolean Boolean
|
||||||
HiLink jsonNumber Number
|
hi def link jsonKeyword Label
|
||||||
HiLink jsonBraces Operator
|
|
||||||
HiLink jsonNull Function
|
|
||||||
HiLink jsonBoolean Boolean
|
|
||||||
|
|
||||||
HiLink jsonNumError Error
|
hi def link jsonNumError Error
|
||||||
HiLink jsonStringSQ Error
|
hi def link jsonCommentError Error
|
||||||
HiLink jsonNoQuotes Error
|
hi def link jsonSemicolonError Error
|
||||||
delcommand HiLink
|
hi def link jsonTrailingCommaError Error
|
||||||
|
hi def link jsonMissingCommaError Error
|
||||||
|
hi def link jsonStringSQError Error
|
||||||
|
hi def link jsonNoQuotesError Error
|
||||||
|
hi def link jsonTripleQuotesError Error
|
||||||
|
hi def link jsonQuote Quote
|
||||||
|
hi def link jsonNoise Noise
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let b:current_syntax = "json"
|
let b:current_syntax = "json"
|
||||||
@@ -73,5 +108,12 @@ if main_syntax == 'json'
|
|||||||
unlet main_syntax
|
unlet main_syntax
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Vim settings {{{2
|
" Vim settings
|
||||||
" vim: ts=8 fdm=marker
|
" vim: ts=8 fdm=marker
|
||||||
|
|
||||||
|
" MIT License
|
||||||
|
" Copyright (c) 2013, Jeroen Ruigrok van der Werven, Eli Parra
|
||||||
|
"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.
|
||||||
|
"See https://twitter.com/elzr/status/294964017926119424
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ elseif !exists("b:jst_subtype") && main_syntax == 'jst'
|
|||||||
let b:jst_subtype = 'haml'
|
let b:jst_subtype = 'haml'
|
||||||
elseif b:jst_subtype == 'ejs'
|
elseif b:jst_subtype == 'ejs'
|
||||||
let b:jst_subtype = 'html'
|
let b:jst_subtype = 'html'
|
||||||
|
elseif b:jst_subtype == 'ect'
|
||||||
|
let b:jst_subtype = 'html'
|
||||||
|
elseif b:jst_subtype == 'djs'
|
||||||
|
let b:jst_subtype = 'html'
|
||||||
elseif b:jst_subtype == 'rb'
|
elseif b:jst_subtype == 'rb'
|
||||||
let b:jst_subtype = 'ruby'
|
let b:jst_subtype = 'ruby'
|
||||||
elseif b:jst_subtype == 'yml'
|
elseif b:jst_subtype == 'yml'
|
||||||
@@ -70,4 +74,14 @@ if main_syntax == 'jst'
|
|||||||
unlet main_syntax
|
unlet main_syntax
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
set commentstring=<!--%s-->
|
||||||
|
|
||||||
|
if exists("loaded_matchit")
|
||||||
|
let b:match_ignorecase = 1
|
||||||
|
let b:match_words = '<:>,' .
|
||||||
|
\ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' .
|
||||||
|
\ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' .
|
||||||
|
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
|
||||||
|
endif
|
||||||
|
|
||||||
" vim: nowrap sw=2 sts=2 ts=8:
|
" vim: nowrap sw=2 sts=2 ts=8:
|
||||||
|
|||||||
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
|
unlet! s:type
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syn match markdownEscape "\\[][\\`*_{}()#+.!-]"
|
syn match markdownEscape "\\[][\\`*_{}()<>#+.!-]"
|
||||||
syn match markdownError "\w\@<=_\w\@="
|
syn match markdownError "\w\@<=_\w\@="
|
||||||
|
|
||||||
hi def link markdownH1 htmlH1
|
hi def link markdownH1 htmlH1
|
||||||
|
|||||||
@@ -365,11 +365,11 @@ syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*("
|
|||||||
syn cluster perlSubAttrMaybe contains=perlSubAttributesCont,perlSubError,perlFakeGroup
|
syn cluster perlSubAttrMaybe contains=perlSubAttributesCont,perlSubError,perlFakeGroup
|
||||||
syn match perlSubAttributes "" contained nextgroup=perlSubError
|
syn match perlSubAttributes "" contained nextgroup=perlSubError
|
||||||
syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe
|
syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe
|
||||||
if !exists("perl_no_subprototype_error") " Set 1 if using signatures feature in perl5.19.9
|
if get(g:, "perl_sub_signatures", 0)
|
||||||
|
syn match perlSignature +(\_[^)]*)\_s*+ nextgroup=perlSubAttributes,perlComment contained
|
||||||
|
else
|
||||||
syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained
|
syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained
|
||||||
syn match perlSubPrototype +(\_[^)]*)\_s*+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError
|
syn match perlSubPrototype +(\_[^)]*)\_s*+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError
|
||||||
else
|
|
||||||
syntax match perlSignature "(.\{-})" nextgroup=perlSubAttributes,perlComment contained
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syn match perlSubName +\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\_s*\|+ contained nextgroup=perlSubPrototype,perlSignature,perlSubAttributes,perlComment
|
syn match perlSubName +\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\_s*\|+ contained nextgroup=perlSubPrototype,perlSignature,perlSubAttributes,perlComment
|
||||||
@@ -412,9 +412,9 @@ if exists("perl_fold")
|
|||||||
syn region perlPackageFold start="^package \S\+;\s*\%(#.*\)\=$" end="^1;\=\s*\%(#.*\)\=$" end="\n\+package"me=s-1 transparent fold keepend
|
syn region perlPackageFold start="^package \S\+;\s*\%(#.*\)\=$" end="^1;\=\s*\%(#.*\)\=$" end="\n\+package"me=s-1 transparent fold keepend
|
||||||
endif
|
endif
|
||||||
if !exists("perl_nofold_subs")
|
if !exists("perl_nofold_subs")
|
||||||
if exists("perl_fold_anonymous_subs") && perl_fold_anonymous_subs
|
if get(g:, "perl_fold_anonymous_subs", 0)
|
||||||
syn region perlSubFold start="\<sub\>[^;]*{" end="}" transparent fold keepend extend
|
syn region perlSubFold start="\<sub\>[^{]*{" end="}" transparent fold keepend extend
|
||||||
syn region perlSubFold start="\<\%(BEGIN\|END\|CHECK\|INIT\)\>\s*{" end="}" transparent fold keepend
|
syn region perlSubFold start="\<\%(BEGIN\|END\|CHECK\|INIT\)\>\s*{" end="}" transparent fold keepend
|
||||||
else
|
else
|
||||||
syn region perlSubFold start="^\z(\s*\)\<sub\>.*[^};]$" end="^\z1}\s*\%(#.*\)\=$" transparent fold keepend
|
syn region perlSubFold start="^\z(\s*\)\<sub\>.*[^};]$" end="^\z1}\s*\%(#.*\)\=$" transparent fold keepend
|
||||||
syn region perlSubFold start="^\z(\s*\)\<\%(BEGIN\|END\|CHECK\|INIT\|UNITCHECK\)\>.*[^};]$" end="^\z1}\s*$" transparent fold keepend
|
syn region perlSubFold start="^\z(\s*\)\<\%(BEGIN\|END\|CHECK\|INIT\|UNITCHECK\)\>.*[^};]$" end="^\z1}\s*$" transparent fold keepend
|
||||||
|
|||||||
1948
syntax/perl6.vim
1948
syntax/perl6.vim
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
" Protocol Buffers - Google's data interchange format
|
" Protocol Buffers - Google's data interchange format
|
||||||
" Copyright 2008 Google Inc. All rights reserved.
|
" Copyright 2008 Google Inc. All rights reserved.
|
||||||
" http://code.google.com/p/protobuf/
|
" https://developers.google.com/protocol-buffers/
|
||||||
"
|
"
|
||||||
" Redistribution and use in source and binary forms, with or without
|
" Redistribution and use in source and binary forms, with or without
|
||||||
" modification, are permitted provided that the following conditions are
|
" modification, are permitted provided that the following conditions are
|
||||||
@@ -54,7 +54,7 @@ syn keyword pbTodo contained TODO FIXME XXX
|
|||||||
syn cluster pbCommentGrp contains=pbTodo
|
syn cluster pbCommentGrp contains=pbTodo
|
||||||
|
|
||||||
syn keyword pbSyntax syntax import option
|
syn keyword pbSyntax syntax import option
|
||||||
syn keyword pbStructure package message group
|
syn keyword pbStructure package message group oneof
|
||||||
syn keyword pbRepeat optional required repeated
|
syn keyword pbRepeat optional required repeated
|
||||||
syn keyword pbDefault default
|
syn keyword pbDefault default
|
||||||
syn keyword pbExtend extend extensions to max
|
syn keyword pbExtend extend extensions to max
|
||||||
@@ -69,11 +69,10 @@ syn keyword pbBool true false
|
|||||||
syn match pbInt /-\?\<\d\+\>/
|
syn match pbInt /-\?\<\d\+\>/
|
||||||
syn match pbInt /\<0[xX]\x+\>/
|
syn match pbInt /\<0[xX]\x+\>/
|
||||||
syn match pbFloat /\<-\?\d*\(\.\d*\)\?/
|
syn match pbFloat /\<-\?\d*\(\.\d*\)\?/
|
||||||
" TODO: .proto also supports C-style block comments;
|
syn region pbComment start="\/\*" end="\*\/" contains=@pbCommentGrp
|
||||||
" see /usr/share/vim/vim70/syntax/c.vim for how it's done.
|
|
||||||
syn region pbComment start="//" skip="\\$" end="$" keepend contains=@pbCommentGrp
|
syn region pbComment start="//" skip="\\$" end="$" keepend contains=@pbCommentGrp
|
||||||
syn region pbString start=/"/ skip=/\\"/ end=/"/
|
syn region pbString start=/"/ skip=/\\./ end=/"/
|
||||||
syn region pbString start=/'/ skip=/\\'/ end=/'/
|
syn region pbString start=/'/ skip=/\\./ end=/'/
|
||||||
|
|
||||||
if version >= 508 || !exists("did_proto_syn_inits")
|
if version >= 508 || !exists("did_proto_syn_inits")
|
||||||
if version < 508
|
if version < 508
|
||||||
|
|||||||
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"
|
||||||
@@ -130,18 +130,22 @@ syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][io
|
|||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold
|
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold
|
||||||
|
|
||||||
" Normal String and Shell Command Output
|
" Normal String and Shell Command Output
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold
|
if exists('ruby_spellcheck_strings')
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial,@Spell fold
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape,@Spell fold
|
||||||
|
else
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape fold
|
||||||
|
endif
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold
|
||||||
|
|
||||||
" Generalized Single Quoted String, Symbol and Array of Strings
|
" Generalized Single Quoted String, Symbol and Array of Strings
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%q " end=" " skip="\\\\\|\\)" fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="%q " end=" " skip="\\\\\|\\)" fold
|
||||||
|
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\z([~`!@#$%^&*_\-+=|\:;"',.? /]\)" end="\z1" skip="\\\\\|\\\z1" fold
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\z([~`!@#$%^&*_\-+=|\:;"',.? /]\)" end="\z1" skip="\\\\\|\\\z1" fold
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape
|
||||||
@@ -151,13 +155,27 @@ syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s(" end=")"
|
|||||||
" Generalized Double Quoted String and Array of Strings and Shell Command Output
|
" Generalized Double Quoted String and Array of Strings and Shell Command Output
|
||||||
" Note: %= is not matched here as the beginning of a double quoted string
|
" Note: %= is not matched here as the beginning of a double quoted string
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\={" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimEscape fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\={" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimEscape fold
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape fold
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx] " end=" " skip="\\\\\|\\)" contains=@rubyStringSpecial fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx] " end=" " skip="\\\\\|\\)" contains=@rubyStringSpecial fold
|
||||||
|
|
||||||
|
" Array of Symbols
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i(" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape
|
||||||
|
|
||||||
|
" Array of interpolated Symbols
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\={" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimEscape fold
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape fold
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold
|
||||||
|
|
||||||
" Here Document
|
" Here Document
|
||||||
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
||||||
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs"\%([^"]*\)"+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs"\%([^"]*\)"+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
||||||
@@ -224,7 +242,7 @@ if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive")
|
|||||||
" statements without 'do'
|
" statements without 'do'
|
||||||
syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
||||||
syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
||||||
syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|unless\)\>" end="\%(\%(\%(\.\@<!\.\)\|::\)\s*\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop fold
|
syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|unless\)\>" end="\%(\%(\%(\.\@<!\.\)\|::\)\s*\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop fold
|
||||||
|
|
||||||
syn match rubyConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=rubyCaseExpression
|
syn match rubyConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=rubyCaseExpression
|
||||||
syn match rubyConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=rubyConditionalExpression
|
syn match rubyConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=rubyConditionalExpression
|
||||||
@@ -266,7 +284,7 @@ endif
|
|||||||
|
|
||||||
" Comments and Documentation
|
" Comments and Documentation
|
||||||
syn match rubySharpBang "\%^#!.*" display
|
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
|
syn match rubyComment "#.*" contains=rubySharpBang,rubySpaceError,rubyTodo,@Spell
|
||||||
if !exists("ruby_no_comment_fold")
|
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
|
syn region rubyMultilineComment start="\%(\%(^\s*#.*\n\)\@<!\%(^\s*#.*\n\)\)\%(\(^\s*#.*\n\)\{1,}\)\@=" end="\%(^\s*#.*\n\)\@<=\%(^\s*#.*\n\)\%(^\s*#\)\@!" contains=rubyComment transparent fold keepend
|
||||||
@@ -352,7 +370,7 @@ hi def link rubyInterpolationDelimiter Delimiter
|
|||||||
hi def link rubyNoInterpolation rubyString
|
hi def link rubyNoInterpolation rubyString
|
||||||
hi def link rubySharpBang PreProc
|
hi def link rubySharpBang PreProc
|
||||||
hi def link rubyRegexpDelimiter rubyStringDelimiter
|
hi def link rubyRegexpDelimiter rubyStringDelimiter
|
||||||
hi def link rubySymbolDelimiter rubyStringDelimiter
|
hi def link rubySymbolDelimiter rubySymbol
|
||||||
hi def link rubyStringDelimiter Delimiter
|
hi def link rubyStringDelimiter Delimiter
|
||||||
hi def link rubyHeredoc rubyString
|
hi def link rubyHeredoc rubyString
|
||||||
hi def link rubyString String
|
hi def link rubyString String
|
||||||
|
|||||||
@@ -1,22 +1,40 @@
|
|||||||
if version < 600
|
" Vim syntax file
|
||||||
syntax clear
|
" Language: Scala
|
||||||
elseif exists("b:current_syntax")
|
" Maintainer: Derek Wyatt
|
||||||
finish
|
" URL: https://github.com/derekwyatt/vim-scala
|
||||||
|
" License: Apache 2
|
||||||
|
" ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if !exists('main_syntax')
|
||||||
|
if version < 600
|
||||||
|
syntax clear
|
||||||
|
elseif exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let main_syntax = 'scala'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
scriptencoding utf-8
|
scriptencoding utf-8
|
||||||
|
|
||||||
let b:current_syntax = "scala"
|
let b:current_syntax = "scala"
|
||||||
|
|
||||||
|
" Allows for embedding, see #59; main_syntax convention instead? Refactor TOP
|
||||||
|
"
|
||||||
|
" The @Spell here is a weird hack, it means *exclude* if the first group is
|
||||||
|
" TOP. Otherwise we get spelling errors highlighted on code elements that
|
||||||
|
" match scalaBlock, even with `syn spell notoplevel`.
|
||||||
function! s:ContainedGroup()
|
function! s:ContainedGroup()
|
||||||
try
|
try
|
||||||
silent syn list @scala
|
silent syn list @scala
|
||||||
return '@scala'
|
return '@scala,@NoSpell'
|
||||||
catch /E392/
|
catch /E392/
|
||||||
return 'TOP'
|
return 'TOP,@Spell'
|
||||||
endtry
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
syn include @scalaHtml syntax/html.vim " Doc comment HTML
|
||||||
|
unlet! b:current_syntax
|
||||||
|
|
||||||
syn case match
|
syn case match
|
||||||
syn sync minlines=200 maxlines=1000
|
syn sync minlines=200 maxlines=1000
|
||||||
|
|
||||||
@@ -37,7 +55,9 @@ syn match scalaSymbol /'[_A-Za-z0-9$]\+/
|
|||||||
hi link scalaSymbol Number
|
hi link scalaSymbol Number
|
||||||
|
|
||||||
syn match scalaChar /'.'/
|
syn match scalaChar /'.'/
|
||||||
syn match scalaEscapedChar /\\[\\"ntbrf]/
|
syn match scalaChar /'\\[\\"'ntbrf]'/ contains=scalaEscapedChar
|
||||||
|
syn match scalaChar /'\\u[A-Fa-f0-9]\{4}'/ contains=scalaUnicodeChar
|
||||||
|
syn match scalaEscapedChar /\\[\\"'ntbrf]/
|
||||||
syn match scalaUnicodeChar /\\u[A-Fa-f0-9]\{4}/
|
syn match scalaUnicodeChar /\\u[A-Fa-f0-9]\{4}/
|
||||||
hi link scalaChar Character
|
hi link scalaChar Character
|
||||||
hi link scalaEscapedChar Function
|
hi link scalaEscapedChar Function
|
||||||
@@ -58,6 +78,9 @@ syn match scalaInstanceHash /#/ contained nextgroup=scalaInstanceDeclaration
|
|||||||
hi link scalaInstanceDeclaration Special
|
hi link scalaInstanceDeclaration Special
|
||||||
hi link scalaInstanceHash Type
|
hi link scalaInstanceHash Type
|
||||||
|
|
||||||
|
syn match scalaUnimplemented /???/
|
||||||
|
hi link scalaUnimplemented ERROR
|
||||||
|
|
||||||
syn match scalaCapitalWord /\<[A-Z][A-Za-z0-9$]*\>/
|
syn match scalaCapitalWord /\<[A-Z][A-Za-z0-9$]*\>/
|
||||||
hi link scalaCapitalWord Special
|
hi link scalaCapitalWord Special
|
||||||
|
|
||||||
@@ -97,39 +120,45 @@ hi link scalaCaseFollowing Special
|
|||||||
syn keyword scalaKeywordModifier abstract override final lazy implicit implicitly private protected sealed null require super
|
syn keyword scalaKeywordModifier abstract override final lazy implicit implicitly private protected sealed null require super
|
||||||
hi link scalaKeywordModifier Function
|
hi link scalaKeywordModifier Function
|
||||||
|
|
||||||
syn keyword scalaSpecial this true false package import ne eq
|
syn keyword scalaSpecial this true false ne eq
|
||||||
syn keyword scalaSpecial new nextgroup=scalaInstanceDeclaration skipwhite
|
syn keyword scalaSpecial new nextgroup=scalaInstanceDeclaration skipwhite
|
||||||
syn match scalaSpecial "\%(=>\|⇒\|<-\|←\|->\|→\)"
|
syn match scalaSpecial "\%(=>\|⇒\|<-\|←\|->\|→\)"
|
||||||
syn match scalaSpecial /`[^`]*`/ " Backtick literals
|
syn match scalaSpecial /`[^`]*`/ " Backtick literals
|
||||||
hi link scalaSpecial PreProc
|
hi link scalaSpecial PreProc
|
||||||
|
|
||||||
|
syn keyword scalaExternal package import
|
||||||
|
hi link scalaExternal Include
|
||||||
|
|
||||||
syn match scalaStringEmbeddedQuote /\\"/ contained
|
syn match scalaStringEmbeddedQuote /\\"/ contained
|
||||||
syn region scalaString start=/"/ end=/"/ contains=scalaStringEmbeddedQuote,scalaEscapedChar,scalaUnicodeChar
|
syn region scalaString start=/"/ end=/"/ contains=scalaStringEmbeddedQuote,scalaEscapedChar,scalaUnicodeChar
|
||||||
hi link scalaString String
|
hi link scalaString String
|
||||||
hi link scalaStringEmbeddedQuote String
|
hi link scalaStringEmbeddedQuote String
|
||||||
|
|
||||||
syn region scalaIString matchgroup=Special start=/\<[a-zA-Z][a-zA-Z0-9_]*"/ skip=/\\"/ end=/"/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
syn region scalaIString matchgroup=scalaInterpolationBrackets start=/\<[a-zA-Z][a-zA-Z0-9_]*"/ skip=/\\"/ end=/"/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
||||||
syn region scalaTripleIString matchgroup=Special start=/\<[a-zA-Z][a-zA-Z0-9_]*"""/ end=/"""\%([^"]\|$\)/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
syn region scalaTripleIString matchgroup=scalaInterpolationBrackets start=/\<[a-zA-Z][a-zA-Z0-9_]*"""/ end=/"""\%([^"]\|$\)/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
||||||
hi link scalaIString String
|
hi link scalaIString String
|
||||||
hi link scalaTripleIString String
|
hi link scalaTripleIString String
|
||||||
|
|
||||||
syn match scalaInterpolation /\$[a-zA-Z0-9_$]\+/ contained
|
syn match scalaInterpolation /\$[a-zA-Z0-9_$]\+/ contained
|
||||||
exe 'syn region scalaInterpolationB matchgroup=scalaInterpolation start=/\${/ end=/}/ contained contains=' . s:ContainedGroup()
|
exe 'syn region scalaInterpolationB matchgroup=scalaInterpolationBoundary start=/\${/ end=/}/ contained contains=' . s:ContainedGroup()
|
||||||
hi link scalaInterpolation Function
|
hi link scalaInterpolation Function
|
||||||
hi link scalaInterpolationB Normal
|
hi link scalaInterpolationB Normal
|
||||||
|
|
||||||
syn region scalaFString matchgroup=Special start=/f"/ skip=/\\"/ end=/"/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
syn region scalaFString matchgroup=scalaInterpolationBrackets start=/f"/ skip=/\\"/ end=/"/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
||||||
syn match scalaFInterpolation /\$[a-zA-Z0-9_$]\+\(%[-A-Za-z0-9\.]\+\)\?/ contained
|
syn match scalaFInterpolation /\$[a-zA-Z0-9_$]\+\(%[-A-Za-z0-9\.]\+\)\?/ contained
|
||||||
exe 'syn region scalaFInterpolationB matchgroup=scalaFInterpolation start=/${/ end=/}\(%[-A-Za-z0-9\.]\+\)\?/ contained contains=' . s:ContainedGroup()
|
exe 'syn region scalaFInterpolationB matchgroup=scalaInterpolationBoundary start=/${/ end=/}\(%[-A-Za-z0-9\.]\+\)\?/ contained contains=' . s:ContainedGroup()
|
||||||
hi link scalaFString String
|
hi link scalaFString String
|
||||||
hi link scalaFInterpolation Function
|
hi link scalaFInterpolation Function
|
||||||
hi link scalaFInterpolationB Normal
|
hi link scalaFInterpolationB Normal
|
||||||
|
|
||||||
syn region scalaTripleString start=/"""/ end=/"""\%([^"]\|$\)/ contains=scalaEscapedChar,scalaUnicodeChar
|
syn region scalaTripleString start=/"""/ end=/"""\%([^"]\|$\)/ contains=scalaEscapedChar,scalaUnicodeChar
|
||||||
syn region scalaTripleFString matchgroup=Special start=/f"""/ end=/"""\%([^"]\|$\)/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
syn region scalaTripleFString matchgroup=scalaInterpolationBrackets start=/f"""/ end=/"""\%([^"]\|$\)/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
||||||
hi link scalaTripleString String
|
hi link scalaTripleString String
|
||||||
hi link scalaTripleFString String
|
hi link scalaTripleFString String
|
||||||
|
|
||||||
|
hi link scalaInterpolationBrackets Special
|
||||||
|
hi link scalaInterpolationBoundary Function
|
||||||
|
|
||||||
syn match scalaNumber /\<0[dDfFlL]\?\>/ " Just a bare 0
|
syn match scalaNumber /\<0[dDfFlL]\?\>/ " Just a bare 0
|
||||||
syn match scalaNumber /\<[1-9]\d*[dDfFlL]\?\>/ " A multi-digit number - octal numbers with leading 0's are deprecated in Scala
|
syn match scalaNumber /\<[1-9]\d*[dDfFlL]\?\>/ " A multi-digit number - octal numbers with leading 0's are deprecated in Scala
|
||||||
syn match scalaNumber /\<0[xX][0-9a-fA-F]\+[dDfFlL]\?\>/ " Hex number
|
syn match scalaNumber /\<0[xX][0-9a-fA-F]\+[dDfFlL]\?\>/ " Hex number
|
||||||
@@ -140,29 +169,35 @@ hi link scalaNumber Number
|
|||||||
|
|
||||||
syn region scalaRoundBrackets start="(" end=")" skipwhite contained contains=scalaTypeDeclaration,scalaSquareBrackets,scalaRoundBrackets
|
syn region scalaRoundBrackets start="(" end=")" skipwhite contained contains=scalaTypeDeclaration,scalaSquareBrackets,scalaRoundBrackets
|
||||||
|
|
||||||
syn region scalaSquareBrackets matchgroup=Type start="\[" end="\]" skipwhite nextgroup=scalaTypeExtension contains=scalaTypeDeclaration,scalaSquareBrackets,scalaTypeOperator,scalaTypeAnnotationParameter
|
syn region scalaSquareBrackets matchgroup=scalaSquareBracketsBrackets start="\[" end="\]" skipwhite nextgroup=scalaTypeExtension contains=scalaTypeDeclaration,scalaSquareBrackets,scalaTypeOperator,scalaTypeAnnotationParameter
|
||||||
syn match scalaTypeOperator /[-+=:<>]\+/ contained
|
syn match scalaTypeOperator /[-+=:<>]\+/ contained
|
||||||
syn match scalaTypeAnnotationParameter /@\<[`_A-Za-z0-9$]\+\>/ contained
|
syn match scalaTypeAnnotationParameter /@\<[`_A-Za-z0-9$]\+\>/ contained
|
||||||
|
hi link scalaSquareBracketsBrackets Type
|
||||||
hi link scalaTypeOperator Keyword
|
hi link scalaTypeOperator Keyword
|
||||||
hi link scalaTypeAnnotationParameter Function
|
hi link scalaTypeAnnotationParameter Function
|
||||||
|
|
||||||
syn region scalaMultilineComment start="/\*" end="\*/" contains=scalaMultilineComment,scalaDocLinks,scalaParameterAnnotation,scalaCommentAnnotation,scalaCommentCodeBlock,@scalaHtml keepend
|
syn match scalaShebang "\%^#!.*" display
|
||||||
|
syn region scalaMultilineComment start="/\*" end="\*/" contains=scalaMultilineComment,scalaDocLinks,scalaParameterAnnotation,scalaCommentAnnotation,scalaTodo,scalaCommentCodeBlock,@scalaHtml,@Spell keepend
|
||||||
syn match scalaCommentAnnotation "@[_A-Za-z0-9$]\+" contained
|
syn match scalaCommentAnnotation "@[_A-Za-z0-9$]\+" contained
|
||||||
syn match scalaParameterAnnotation "@param" nextgroup=scalaParamAnnotationValue skipwhite contained
|
syn match scalaParameterAnnotation "@param" nextgroup=scalaParamAnnotationValue skipwhite contained
|
||||||
syn match scalaParamAnnotationValue /[`_A-Za-z0-9$]\+/ contained
|
syn match scalaParamAnnotationValue /[`_A-Za-z0-9$]\+/ contained
|
||||||
syn region scalaDocLinks start="\[\[" end="\]\]" contained
|
syn region scalaDocLinks start="\[\[" end="\]\]" contained
|
||||||
syn region scalaCommentCodeBlock matchgroup=Keyword start="{{{" end="}}}" contained
|
syn region scalaCommentCodeBlock matchgroup=Keyword start="{{{" end="}}}" contained
|
||||||
|
syn match scalaTodo "\vTODO|FIXME|XXX" contained
|
||||||
|
hi link scalaShebang Comment
|
||||||
hi link scalaMultilineComment Comment
|
hi link scalaMultilineComment Comment
|
||||||
hi link scalaDocLinks Function
|
hi link scalaDocLinks Function
|
||||||
hi link scalaParameterAnnotation Function
|
hi link scalaParameterAnnotation Function
|
||||||
hi link scalaParamAnnotationValue Keyword
|
hi link scalaParamAnnotationValue Keyword
|
||||||
hi link scalaCommentAnnotation Function
|
hi link scalaCommentAnnotation Function
|
||||||
|
hi link scalaCommentCodeBlockBrackets String
|
||||||
hi link scalaCommentCodeBlock String
|
hi link scalaCommentCodeBlock String
|
||||||
|
hi link scalaTodo Todo
|
||||||
|
|
||||||
syn match scalaAnnotation /@\<[`_A-Za-z0-9$]\+\>/
|
syn match scalaAnnotation /@\<[`_A-Za-z0-9$]\+\>/
|
||||||
hi link scalaAnnotation PreProc
|
hi link scalaAnnotation PreProc
|
||||||
|
|
||||||
syn match scalaTrailingComment "//.*$"
|
syn match scalaTrailingComment "//.*$" contains=scalaTodo,@Spell
|
||||||
hi link scalaTrailingComment Comment
|
hi link scalaTrailingComment Comment
|
||||||
|
|
||||||
syn match scalaAkkaFSM /goto([^)]*)\_s\+\<using\>/ contains=scalaAkkaFSMGotoUsing
|
syn match scalaAkkaFSM /goto([^)]*)\_s\+\<using\>/ contains=scalaAkkaFSMGotoUsing
|
||||||
@@ -178,3 +213,11 @@ syn match scalaAkkaFSMGotoUsing /\<using\>/
|
|||||||
syn match scalaAkkaFSMGotoUsing /\<goto\>/
|
syn match scalaAkkaFSMGotoUsing /\<goto\>/
|
||||||
hi link scalaAkkaFSM PreProc
|
hi link scalaAkkaFSM PreProc
|
||||||
hi link scalaAkkaFSMGotoUsing PreProc
|
hi link scalaAkkaFSMGotoUsing PreProc
|
||||||
|
|
||||||
|
let b:current_syntax = 'scala'
|
||||||
|
|
||||||
|
if main_syntax ==# 'scala'
|
||||||
|
unlet main_syntax
|
||||||
|
endif
|
||||||
|
|
||||||
|
" vim:set sw=2 sts=2 ts=8 et:
|
||||||
|
|||||||
286
syntax/tmux.vim
286
syntax/tmux.vim
@@ -3,6 +3,20 @@
|
|||||||
" Maintainer: Tiago Cunha <tcunha@users.sourceforge.net>
|
" Maintainer: Tiago Cunha <tcunha@users.sourceforge.net>
|
||||||
" Last Change: $Date: 2010-07-27 18:29:07 $
|
" Last Change: $Date: 2010-07-27 18:29:07 $
|
||||||
" License: This file is placed in the public domain.
|
" License: This file is placed in the public domain.
|
||||||
|
"
|
||||||
|
" To install this file:
|
||||||
|
"
|
||||||
|
" - Drop the file in the syntax directory into runtimepath (such as
|
||||||
|
" ~/.vim/syntax/tmux.vim).
|
||||||
|
" - Make the filetype recognisable by adding the following to filetype.vim
|
||||||
|
" (~/.vim/filetype.vim):
|
||||||
|
"
|
||||||
|
" augroup filetypedetect
|
||||||
|
" au BufNewFile,BufRead .tmux.conf*,tmux.conf* setf tmux
|
||||||
|
" augroup END
|
||||||
|
"
|
||||||
|
" - Switch on syntax highlighting by adding "syntax enable" to .vimrc.
|
||||||
|
"
|
||||||
|
|
||||||
if version < 600
|
if version < 600
|
||||||
syntax clear
|
syntax clear
|
||||||
@@ -17,60 +31,234 @@ syn keyword tmuxAction any current none
|
|||||||
syn keyword tmuxBoolean off on
|
syn keyword tmuxBoolean off on
|
||||||
|
|
||||||
syn keyword tmuxCmds
|
syn keyword tmuxCmds
|
||||||
\ attach[-session] detach[-client] has[-session] kill-server
|
\ attach[-session]
|
||||||
\ kill-session lsc list-clients lscm list-commands ls list-sessions
|
\ bind[-key]
|
||||||
\ lockc lock-client locks lock-session new[-session] refresh[-client]
|
\ break-pane
|
||||||
\ rename[-session] showmsgs show-messages source[-file] start[-server]
|
\ breakp
|
||||||
\ suspendc suspend-client switchc switch-client copy-mode
|
\ capture-pane
|
||||||
\ breakp break-pane capturep capture-pane choose-client choose-session
|
\ capturep
|
||||||
\ choose-tree choose-window displayp display-panes findw find-window
|
\ choose-buffer
|
||||||
\ joinp join-pane killp kill-pane killw kill-window lastp last-pane
|
\ choose-client
|
||||||
\ last[-window] linkw link-window lsp list-panes lsw list-windows movep
|
\ choose-list
|
||||||
\ move-pane movew move-window neww new-window nextl next-layout
|
\ choose-session
|
||||||
\ next[-window] pipep pipe-pane prevl previous-layout prev[ious-window]
|
\ choose-tree
|
||||||
\ renamew rename-window resizep resize-pane respawnp respawn-pane
|
\ choose-window
|
||||||
\ respawnw respawn-window rotatew rotate-window selectl select-layout
|
\ clear-history
|
||||||
\ selectp select-pane selectw select-window splitw split-window swapp
|
\ clearhist
|
||||||
\ swap-pane swapw swap-window unlinkw unlink-window
|
\ clock-mode
|
||||||
\ bind[-key] lsk list-keys send[-keys] send-prefix unbind[-key]
|
\ command-prompt
|
||||||
\ set[-option] setw set-window-option show[-options] showw
|
\ confirm[-before]
|
||||||
\ show-window-options setenv set-environment showenv show-environment
|
\ copy-mode
|
||||||
\ command-prompt confirm[-before] display[-message]
|
\ delete-buffer
|
||||||
\ choose-buffer clearhist clear-history deleteb delete-buffer lsb
|
\ deleteb
|
||||||
\ list-buffers loadb load-buffer pasteb paste-buffer saveb save-buffer
|
\ detach[-client]
|
||||||
\ setb set-buffer showb show-buffer
|
\ display[-message]
|
||||||
\ clock-mode if[-shell] lock[-server] run[-shell] [server-]info
|
\ display-panes
|
||||||
|
\ displayp
|
||||||
|
\ find-window
|
||||||
|
\ findw
|
||||||
|
\ has[-session]
|
||||||
|
\ if[-shell]
|
||||||
|
\ join-pane
|
||||||
|
\ joinp
|
||||||
|
\ kill-pane
|
||||||
|
\ killp
|
||||||
|
\ kill-server
|
||||||
|
\ kill-session
|
||||||
|
\ kill-window
|
||||||
|
\ killw
|
||||||
|
\ last-pane
|
||||||
|
\ lastp
|
||||||
|
\ last[-window]
|
||||||
|
\ link-window
|
||||||
|
\ linkw
|
||||||
|
\ list-buffers
|
||||||
|
\ lsb
|
||||||
|
\ list-clients
|
||||||
|
\ lsc
|
||||||
|
\ list-commands
|
||||||
|
\ lscm
|
||||||
|
\ list-keys
|
||||||
|
\ lsk
|
||||||
|
\ list-panes
|
||||||
|
\ lsp
|
||||||
|
\ list-sessions
|
||||||
|
\ ls
|
||||||
|
\ list-windows
|
||||||
|
\ lsw
|
||||||
|
\ load-buffer
|
||||||
|
\ loadb
|
||||||
|
\ lock-client
|
||||||
|
\ lockc
|
||||||
|
\ lock[-server]
|
||||||
|
\ lock-session
|
||||||
|
\ locks
|
||||||
|
\ move-pane
|
||||||
|
\ movep
|
||||||
|
\ move-window
|
||||||
|
\ movew
|
||||||
|
\ new[-session]
|
||||||
|
\ next-layout
|
||||||
|
\ nextl
|
||||||
|
\ next[-window]
|
||||||
|
\ paste-buffer
|
||||||
|
\ pasteb
|
||||||
|
\ pipe-pane
|
||||||
|
\ pipep
|
||||||
|
\ previous-layout
|
||||||
|
\ prevl
|
||||||
|
\ prev[ious-window]
|
||||||
|
\ refresh[-client]
|
||||||
|
\ rename[-session]
|
||||||
|
\ rename-window
|
||||||
|
\ renamew
|
||||||
|
\ resize-pane
|
||||||
|
\ resizep
|
||||||
|
\ respawn-pane
|
||||||
|
\ respawnp
|
||||||
|
\ respawn-window
|
||||||
|
\ respawnw
|
||||||
|
\ rotate-window
|
||||||
|
\ rotatew
|
||||||
|
\ run[-shell]
|
||||||
|
\ save-buffer
|
||||||
|
\ saveb
|
||||||
|
\ select-layout
|
||||||
|
\ selectl
|
||||||
|
\ select-pane
|
||||||
|
\ selectp
|
||||||
|
\ select-window
|
||||||
|
\ selectw
|
||||||
|
\ send[-keys]
|
||||||
|
\ send-prefix
|
||||||
|
\ server-info
|
||||||
|
\ info
|
||||||
|
\ set-buffer
|
||||||
|
\ setb
|
||||||
|
\ set-environment
|
||||||
|
\ setenv
|
||||||
|
\ set[-option]
|
||||||
|
\ set-window-option
|
||||||
|
\ setw
|
||||||
|
\ show-buffer
|
||||||
|
\ showb
|
||||||
|
\ show-environment
|
||||||
|
\ showenv
|
||||||
|
\ show-messages
|
||||||
|
\ showmsgs
|
||||||
|
\ show[-options]
|
||||||
|
\ show-window-options
|
||||||
|
\ showw
|
||||||
|
\ source[-file]
|
||||||
|
\ split-window
|
||||||
|
\ splitw
|
||||||
|
\ start[-server]
|
||||||
|
\ suspend-client
|
||||||
|
\ suspendc
|
||||||
|
\ swap-pane
|
||||||
|
\ swapp
|
||||||
|
\ swap-window
|
||||||
|
\ swapw
|
||||||
|
\ switch-client
|
||||||
|
\ switchc
|
||||||
|
\ unbind[-key]
|
||||||
|
\ unlink-window
|
||||||
|
\ unlinkw
|
||||||
|
\ wait[-for]
|
||||||
|
|
||||||
syn keyword tmuxOptsSet
|
syn keyword tmuxOptsSet
|
||||||
\ buffer-limit escape-time exit-unattached exit-unattached quiet
|
\ assume-paste-time
|
||||||
|
\ base-index
|
||||||
|
\ bell-action
|
||||||
|
\ bell-on-alert
|
||||||
|
\ buffer-limit
|
||||||
|
\ default-command
|
||||||
|
\ default-shell
|
||||||
|
\ default-terminal
|
||||||
|
\ destroy-unattached
|
||||||
|
\ detach-on-destroy
|
||||||
|
\ display-panes-active-colour
|
||||||
|
\ display-panes-colour
|
||||||
|
\ display-panes-time
|
||||||
|
\ display-time
|
||||||
|
\ escape-time
|
||||||
|
\ exit-unattached
|
||||||
|
\ focus-events
|
||||||
|
\ history-limit
|
||||||
|
\ lock-after-time
|
||||||
|
\ lock-command
|
||||||
|
\ lock-server
|
||||||
|
\ message-command-style
|
||||||
|
\ message-limit
|
||||||
|
\ message-style
|
||||||
|
\ mouse-resize-pane
|
||||||
|
\ mouse-select-pane
|
||||||
|
\ mouse-select-window
|
||||||
|
\ mouse-utf8
|
||||||
|
\ pane-active-border-style
|
||||||
|
\ pane-border-style
|
||||||
|
\ prefix
|
||||||
|
\ prefix2
|
||||||
|
\ quiet
|
||||||
|
\ renumber-windows
|
||||||
|
\ repeat-time
|
||||||
\ set-clipboard
|
\ set-clipboard
|
||||||
\ base-index bell-action bell-on-alert default-command default-path
|
\ set-remain-on-exit
|
||||||
\ default-shell default-terminal destroy-unattached detach-on-destroy
|
\ set-titles
|
||||||
\ display-panes-[active-]colour display-[panes-]time history-limit
|
\ set-titles-string
|
||||||
\ lock-after-time lock-command lock-server message-[command-]attr
|
\ status
|
||||||
\ message-[command-]bg message-[command-]fg message-limit
|
\ status-interval
|
||||||
\ mouse-resize-pane mouse-select-pane mouse-select-window mouse-utf8
|
\ status-justify
|
||||||
\ pane-[active-]border-style prefix prefix2
|
\ status-keys
|
||||||
\ renumber-windows repeat-time set-remain-on-exit set-titles
|
\ status-left
|
||||||
\ set-titles-string status status-style
|
\ status-left-length
|
||||||
\ status-interval status-justify status-keys status-left
|
\ status-left-style
|
||||||
\ status-left-style status-left-length status-position status-right
|
\ status-position
|
||||||
\ status-right-style status-right-length status-utf8 terminal-overrides
|
\ status-right
|
||||||
\ update-environment visual-activity visual-bell visual-content
|
\ status-right-length
|
||||||
\ visual-silence word-separators
|
\ status-utf8
|
||||||
|
\ staus-right-style
|
||||||
|
\ terminal-overrides
|
||||||
|
\ update-environment
|
||||||
|
\ visual-activity
|
||||||
|
\ visual-bell
|
||||||
|
\ visual-silence
|
||||||
|
\ word-separators
|
||||||
|
|
||||||
syn keyword tmuxOptsSetw
|
syn keyword tmuxOptsSetw
|
||||||
\ aggressive-resize alternate-screen automatic-rename
|
\ aggressive-resize
|
||||||
\ c0-change-interval c0-change-trigger clock-mode-colour
|
\ allow-rename
|
||||||
\ clock-mode-style force-height force-width layout-history-limit
|
\ alternate-screen
|
||||||
\ main-pane-height main-pane-width mode-style move-keys
|
\ automatic-rename
|
||||||
\ mode-mouse monitor-activity monitor-content monitor-silence
|
\ c0-change-interval
|
||||||
\ other-pane-height other-pane-width pane-base-index remain-on-exit
|
\ c0-change-trigger
|
||||||
\ synchronize-panes utf8 window-status-bell-style
|
\ clock-mode-colour
|
||||||
\ window-status-content-style window-status-activity-style
|
\ clock-mode-style
|
||||||
\ window-status-[current-]attr window-status-[current-]bg
|
\ force-height
|
||||||
\ window-status-[current-]fg window-status-[current-]format
|
\ force-width
|
||||||
\ window-status-separator xterm-keys wrap-search
|
\ main-pane-height
|
||||||
|
\ main-pane-width
|
||||||
|
\ mode-keys
|
||||||
|
\ mode-mouse
|
||||||
|
\ mode-style
|
||||||
|
\ monitor-activity
|
||||||
|
\ monitor-silence
|
||||||
|
\ other-pane-height
|
||||||
|
\ other-pane-width
|
||||||
|
\ pane-base-index
|
||||||
|
\ remain-on-exit
|
||||||
|
\ synchronize-panes
|
||||||
|
\ utf8
|
||||||
|
\ window-status-activity-style
|
||||||
|
\ window-status-bell-style
|
||||||
|
\ window-status-current-format
|
||||||
|
\ window-status-current-style
|
||||||
|
\ window-status-format
|
||||||
|
\ window-status-last-style
|
||||||
|
\ window-status-separator
|
||||||
|
\ window-status-style
|
||||||
|
\ wrap-search
|
||||||
|
\ xterm-keys
|
||||||
|
|
||||||
syn keyword tmuxTodo FIXME NOTE TODO XXX contained
|
syn keyword tmuxTodo FIXME NOTE TODO XXX contained
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ hi def link tomlFloat Float
|
|||||||
syn match tomlBoolean /\<\%(true\|false\)\>/ display
|
syn match tomlBoolean /\<\%(true\|false\)\>/ display
|
||||||
hi def link tomlBoolean Boolean
|
hi def link tomlBoolean Boolean
|
||||||
|
|
||||||
syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}T\d\{2\}:\d\{2\}:\d\{2\}Z/ display
|
" http://tools.ietf.org/html/rfc3339
|
||||||
|
syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}T\d\{2\}:\d\{2\}:\d\{2\}\%(\.\d\+\)\?\%(Z\|[+-]\d\{2\}:\d\{2\}\)/ display
|
||||||
hi def link tomlDate Constant
|
hi def link tomlDate Constant
|
||||||
|
|
||||||
syn match tomlTable /^\s*\[[^#\[\]]\+\]\s*\(#.*\)\?$/ contains=tomlComment
|
syn match tomlTable /^\s*\[[^#\[\]]\+\]\s*\(#.*\)\?$/ contains=tomlComment
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
|
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
|
||||||
" Last Change: {{LAST_CHANGE}}
|
" Last Change: {{LAST_CHANGE}}
|
||||||
"
|
"
|
||||||
" Instration:
|
" Installation:
|
||||||
" put tt2.vim and tt2html.vim in to your syntax diretory.
|
" put tt2.vim and tt2html.vim in to your syntax directory.
|
||||||
"
|
"
|
||||||
" add below in your filetype.vim.
|
" add below in your filetype.vim.
|
||||||
" au BufNewFile,BufRead *.tt2 setf tt2
|
" au BufNewFile,BufRead *.tt2 setf tt2
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: TypeScript
|
" Language: typescript
|
||||||
" Author: MicroSoft Open Technologies Inc.
|
" Author: MicroSoft Open Technologies Inc.
|
||||||
" Version: 0.1
|
" Version: 0.1
|
||||||
" Credits: Zhao Yi, Claudio Fleiner, Scott Shattuck, Jose Elera Campana
|
" Credits: Zhao Yi, Claudio Fleiner, Scott Shattuck, Jose Elera Campana
|
||||||
@@ -14,8 +14,8 @@ if !exists("main_syntax")
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Drop fold if it set but vim doesn't support it.
|
" Drop fold if it set but vim doesn't support it.
|
||||||
if version < 600 && exists("typeScript_fold")
|
if version < 600 && exists("typescript_fold")
|
||||||
unlet typeScript_fold
|
unlet typescript_fold
|
||||||
endif
|
endif
|
||||||
|
|
||||||
"" dollar sign is permitted anywhere in an identifier
|
"" dollar sign is permitted anywhere in an identifier
|
||||||
@@ -27,293 +27,301 @@ syntax sync fromstart
|
|||||||
syn match shebang "^#!.*/bin/env\s\+node\>"
|
syn match shebang "^#!.*/bin/env\s\+node\>"
|
||||||
hi link shebang Comment
|
hi link shebang Comment
|
||||||
|
|
||||||
"" typeScript comments"{{{
|
"" typescript comments"{{{
|
||||||
syn keyword typeScriptCommentTodo TODO FIXME XXX TBD contained
|
syn keyword typescriptCommentTodo TODO FIXME XXX TBD contained
|
||||||
syn match typeScriptLineComment "\/\/.*" contains=@Spell,typeScriptCommentTodo,typeScriptRef
|
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 typescriptRefD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+
|
||||||
syn region typeScriptRefS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+
|
syn region typescriptRefS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+
|
||||||
|
|
||||||
syn match typeScriptCommentSkip "^[ \t]*\*\($\|[ \t]\+\)"
|
syn match typescriptCommentSkip "^[ \t]*\*\($\|[ \t]\+\)"
|
||||||
syn region typeScriptComment start="/\*" end="\*/" contains=@Spell,typeScriptCommentTodo
|
syn region typescriptComment start="/\*" end="\*/" contains=@Spell,typescriptCommentTodo extend
|
||||||
"}}}
|
"}}}
|
||||||
"" JSDoc support start"{{{
|
"" JSDoc support start"{{{
|
||||||
if !exists("typeScript_ignore_typeScriptdoc")
|
if !exists("typescript_ignore_typescriptdoc")
|
||||||
syntax case ignore
|
syntax case ignore
|
||||||
|
|
||||||
" syntax coloring for JSDoc comments (HTML)
|
" syntax coloring for JSDoc comments (HTML)
|
||||||
"unlet b:current_syntax
|
"unlet b:current_syntax
|
||||||
|
|
||||||
syntax region typeScriptDocComment matchgroup=typeScriptComment start="/\*\*\s*$" end="\*/" contains=typeScriptDocTags,typeScriptCommentTodo,typeScriptCvsTag,@typeScriptHtml,@Spell fold
|
syntax region typescriptDocComment start="/\*\*\s*$" end="\*/" contains=typescriptDocTags,typescriptCommentTodo,typescriptCvsTag,@typescriptHtml,@Spell fold extend
|
||||||
syntax match typeScriptDocTags contained "@\(param\|argument\|requires\|exception\|throws\|type\|class\|extends\|see\|link\|member\|module\|method\|title\|namespace\|optional\|default\|base\|file\)\>" nextgroup=typeScriptDocParam,typeScriptDocSeeTag skipwhite
|
syntax match typescriptDocTags contained "@\(param\|argument\|requires\|exception\|throws\|type\|class\|extends\|see\|link\|member\|module\|method\|title\|namespace\|optional\|default\|base\|file\)\>" nextgroup=typescriptDocParam,typescriptDocSeeTag skipwhite
|
||||||
syntax match typeScriptDocTags contained "@\(beta\|deprecated\|description\|fileoverview\|author\|license\|version\|returns\=\|constructor\|private\|protected\|final\|ignore\|addon\|exec\)\>"
|
syntax match typescriptDocTags contained "@\(beta\|deprecated\|description\|fileoverview\|author\|license\|version\|returns\=\|constructor\|private\|protected\|final\|ignore\|addon\|exec\)\>"
|
||||||
syntax match typeScriptDocParam contained "\%(#\|\w\|\.\|:\|\/\)\+"
|
syntax match typescriptDocParam contained "\%(#\|\w\|\.\|:\|\/\)\+"
|
||||||
syntax region typeScriptDocSeeTag contained matchgroup=typeScriptDocSeeTag start="{" end="}" contains=typeScriptDocTags
|
syntax region typescriptDocSeeTag contained matchgroup=typescriptDocSeeTag start="{" end="}" contains=typescriptDocTags
|
||||||
|
|
||||||
syntax case match
|
syntax case match
|
||||||
endif "" JSDoc end
|
endif "" JSDoc end
|
||||||
"}}}
|
"}}}
|
||||||
syntax case match
|
syntax case match
|
||||||
|
|
||||||
"" Syntax in the typeScript code"{{{
|
"" Syntax in the typescript code"{{{
|
||||||
syn match typeScriptSpecial "\\\d\d\d\|\\."
|
syn match typescriptSpecial "\\\d\d\d\|\\."
|
||||||
syn region typeScriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ contains=typeScriptSpecial,@htmlPreproc
|
syn region typescriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ contains=typescriptSpecial,@htmlPreproc extend
|
||||||
syn region typeScriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ contains=typeScriptSpecial,@htmlPreproc
|
syn region typescriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ contains=typescriptSpecial,@htmlPreproc extend
|
||||||
|
syn region typescriptStringB start=+`+ skip=+\\\\\|\\`+ end=+`+ contains=typescriptSpecial,@htmlPreproc extend
|
||||||
|
|
||||||
syn match typeScriptSpecialCharacter "'\\.'"
|
syn match typescriptSpecialCharacter "'\\.'"
|
||||||
syn match typeScriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
|
syn match typescriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
|
||||||
syn region typeScriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gi]\{0,2\}\s*$+ end=+/[gi]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline
|
syn region typescriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gi]\{0,2\}\s*$+ end=+/[gi]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline
|
||||||
" syntax match typeScriptSpecial "\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\."
|
" syntax match typescriptSpecial "\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\."
|
||||||
" syntax region typeScriptStringD start=+"+ skip=+\\\\\|\\$"+ end=+"+ contains=typeScriptSpecial,@htmlPreproc
|
" syntax region typescriptStringD start=+"+ skip=+\\\\\|\\$"+ end=+"+ contains=typescriptSpecial,@htmlPreproc
|
||||||
" syntax region typeScriptStringS start=+'+ skip=+\\\\\|\\$'+ end=+'+ contains=typeScriptSpecial,@htmlPreproc
|
" syntax region typescriptStringS start=+'+ skip=+\\\\\|\\$'+ end=+'+ contains=typescriptSpecial,@htmlPreproc
|
||||||
" syntax region typeScriptRegexpString start=+/\(\*\|/\)\@!+ skip=+\\\\\|\\/+ end=+/[gim]\{,3}+ contains=typeScriptSpecial,@htmlPreproc oneline
|
" syntax region typescriptRegexpString start=+/\(\*\|/\)\@!+ skip=+\\\\\|\\/+ end=+/[gim]\{,3}+ contains=typescriptSpecial,@htmlPreproc oneline
|
||||||
" syntax match typeScriptNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/
|
" syntax match typescriptNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/
|
||||||
syntax match typeScriptFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
|
syntax match typescriptFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
|
||||||
" syntax match typeScriptLabel /\(?\s*\)\@<!\<\w\+\(\s*:\)\@=/
|
" syntax match typescriptLabel /\(?\s*\)\@<!\<\w\+\(\s*:\)\@=/
|
||||||
|
|
||||||
|
syn match typescriptDecorators /@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>/
|
||||||
"}}}
|
"}}}
|
||||||
"" typeScript Prototype"{{{
|
"" typescript Prototype"{{{
|
||||||
syntax keyword typeScriptPrototype prototype
|
syntax keyword typescriptPrototype contained prototype
|
||||||
"}}}
|
"}}}
|
||||||
" DOM, Browser and Ajax Support {{{
|
" DOM, Browser and Ajax Support {{{
|
||||||
""""""""""""""""""""""""
|
""""""""""""""""""""""""
|
||||||
syntax keyword typeScriptBrowserObjects window navigator screen history location
|
syntax keyword typescriptBrowserObjects window navigator screen history location
|
||||||
|
|
||||||
syntax keyword typeScriptDOMObjects document event HTMLElement Anchor Area Base Body Button Form Frame Frameset Image Link Meta Option Select Style Table TableCell TableRow Textarea
|
syntax keyword typescriptDOMObjects document event HTMLElement Anchor Area Base Body Button Form Frame Frameset Image Link Meta Option Select Style Table TableCell TableRow Textarea
|
||||||
syntax keyword typeScriptDOMMethods createTextNode createElement insertBefore replaceChild removeChild appendChild hasChildNodes cloneNode normalize isSupported hasAttributes getAttribute setAttribute removeAttribute getAttributeNode setAttributeNode removeAttributeNode getElementsByTagName hasAttribute getElementById adoptNode close compareDocumentPosition createAttribute createCDATASection createComment createDocumentFragment createElementNS createEvent createExpression createNSResolver createProcessingInstruction createRange createTreeWalker elementFromPoint evaluate getBoxObjectFor getElementsByClassName getSelection getUserData hasFocus importNode
|
syntax keyword typescriptDOMMethods contained createTextNode createElement insertBefore replaceChild removeChild appendChild hasChildNodes cloneNode normalize isSupported hasAttributes getAttribute setAttribute removeAttribute getAttributeNode setAttributeNode removeAttributeNode getElementsByTagName hasAttribute getElementById adoptNode close compareDocumentPosition createAttribute createCDATASection createComment createDocumentFragment createElementNS createEvent createExpression createNSResolver createProcessingInstruction createRange createTreeWalker elementFromPoint evaluate getBoxObjectFor getElementsByClassName getSelection getUserData hasFocus importNode
|
||||||
syntax keyword typeScriptDOMProperties nodeName nodeValue nodeType parentNode childNodes firstChild lastChild previousSibling nextSibling attributes ownerDocument namespaceURI prefix localName tagName
|
syntax keyword typescriptDOMProperties contained nodeName nodeValue nodeType parentNode childNodes firstChild lastChild previousSibling nextSibling attributes ownerDocument namespaceURI prefix localName tagName
|
||||||
|
|
||||||
syntax keyword typeScriptAjaxObjects XMLHttpRequest
|
syntax keyword typescriptAjaxObjects XMLHttpRequest
|
||||||
syntax keyword typeScriptAjaxProperties readyState responseText responseXML statusText
|
syntax keyword typescriptAjaxProperties contained readyState responseText responseXML statusText
|
||||||
syntax keyword typeScriptAjaxMethods onreadystatechange abort getAllResponseHeaders getResponseHeader open send setRequestHeader
|
syntax keyword typescriptAjaxMethods contained onreadystatechange abort getAllResponseHeaders getResponseHeader open send setRequestHeader
|
||||||
|
|
||||||
syntax keyword typeScriptPropietaryObjects ActiveXObject
|
syntax keyword typescriptPropietaryObjects ActiveXObject
|
||||||
syntax keyword typeScriptPropietaryMethods attachEvent detachEvent cancelBubble returnValue
|
syntax keyword typescriptPropietaryMethods contained attachEvent detachEvent cancelBubble returnValue
|
||||||
|
|
||||||
syntax keyword typeScriptHtmlElemProperties className clientHeight clientLeft clientTop clientWidth dir href id innerHTML lang length offsetHeight offsetLeft offsetParent offsetTop offsetWidth scrollHeight scrollLeft scrollTop scrollWidth style tabIndex target title
|
syntax keyword typescriptHtmlElemProperties contained className clientHeight clientLeft clientTop clientWidth dir href id innerHTML lang length offsetHeight offsetLeft offsetParent offsetTop offsetWidth scrollHeight scrollLeft scrollTop scrollWidth style tabIndex target title
|
||||||
|
|
||||||
syntax keyword typeScriptEventListenerKeywords blur click focus mouseover mouseout load item
|
syntax keyword typescriptEventListenerKeywords contained blur click focus mouseover mouseout load item
|
||||||
|
|
||||||
syntax keyword typeScriptEventListenerMethods scrollIntoView addEventListener dispatchEvent removeEventListener preventDefault stopPropagation
|
syntax keyword typescriptEventListenerMethods contained scrollIntoView addEventListener dispatchEvent removeEventListener preventDefault stopPropagation
|
||||||
" }}}
|
" }}}
|
||||||
"" Programm Keywords"{{{
|
"" Programm Keywords"{{{
|
||||||
syntax keyword typeScriptSource import export
|
syntax keyword typescriptSource import export from as
|
||||||
syntax keyword typeScriptIdentifier arguments this let var void yield
|
syntax keyword typescriptIdentifier arguments this let var void const
|
||||||
syntax keyword typeScriptOperator delete new instanceof typeof
|
syntax keyword typescriptOperator delete new instanceof typeof
|
||||||
syntax keyword typeScriptBoolean true false
|
syntax keyword typescriptBoolean true false
|
||||||
syntax keyword typeScriptNull null undefined
|
syntax keyword typescriptNull null undefined
|
||||||
syntax keyword typeScriptMessage alert confirm prompt status
|
syntax keyword typescriptMessage alert confirm prompt status
|
||||||
syntax keyword typeScriptGlobal self top parent
|
syntax keyword typescriptGlobal self top parent
|
||||||
syntax keyword typeScriptDeprecated escape unescape all applets alinkColor bgColor fgColor linkColor vlinkColor xmlEncoding
|
syntax keyword typescriptDeprecated escape unescape all applets alinkColor bgColor fgColor linkColor vlinkColor xmlEncoding
|
||||||
"}}}
|
"}}}
|
||||||
"" Statement Keywords"{{{
|
"" Statement Keywords"{{{
|
||||||
syntax keyword typeScriptConditional if else switch
|
syntax keyword typescriptConditional if else switch
|
||||||
syntax keyword typeScriptRepeat do while for in
|
syntax keyword typescriptRepeat do while for in of
|
||||||
syntax keyword typeScriptBranch break continue
|
syntax keyword typescriptBranch break continue yield await
|
||||||
syntax keyword typeScriptLabel case default
|
syntax keyword typescriptLabel case default async
|
||||||
syntax keyword typeScriptStatement return with
|
syntax keyword typescriptStatement return with
|
||||||
|
|
||||||
syntax keyword typeScriptGlobalObjects Array Boolean Date Function Infinity Math Number NaN Object Packages RegExp String netscape
|
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 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"{{{
|
"" typescript/DOM/HTML/CSS specified things"{{{
|
||||||
|
|
||||||
" TypeScript Objects"{{{
|
" typescript Objects"{{{
|
||||||
syn match typeScriptFunction "(super\s*|constructor\s*)" contained nextgroup=typeScriptVars
|
syn match typescriptFunction "(super\s*|constructor\s*)" contained nextgroup=typescriptVars
|
||||||
syn region typeScriptVars start="(" end=")" contained contains=typeScriptParameters transparent keepend
|
syn region typescriptVars start="(" end=")" contained contains=typescriptParameters transparent keepend
|
||||||
syn match typeScriptParameters "([a-zA-Z0-9_?.$][\w?.$]*)\s*:\s*([a-zA-Z0-9_?.$][\w?.$]*)" contained skipwhite
|
syn match typescriptParameters "([a-zA-Z0-9_?.$][\w?.$]*)\s*:\s*([a-zA-Z0-9_?.$][\w?.$]*)" contained skipwhite
|
||||||
"}}}
|
"}}}
|
||||||
" DOM2 Objects"{{{
|
" DOM2 Objects"{{{
|
||||||
syntax keyword typeScriptType DOMImplementation DocumentFragment Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction void any string boolean number
|
syntax keyword typescriptType DOMImplementation DocumentFragment Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction void any string boolean number
|
||||||
syntax keyword typeScriptExceptions DOMException
|
syntax keyword typescriptExceptions DOMException
|
||||||
"}}}
|
"}}}
|
||||||
" DOM2 CONSTANT"{{{
|
" DOM2 CONSTANT"{{{
|
||||||
syntax keyword typeScriptDomErrNo INDEX_SIZE_ERR DOMSTRING_SIZE_ERR HIERARCHY_REQUEST_ERR WRONG_DOCUMENT_ERR INVALID_CHARACTER_ERR NO_DATA_ALLOWED_ERR NO_MODIFICATION_ALLOWED_ERR NOT_FOUND_ERR NOT_SUPPORTED_ERR INUSE_ATTRIBUTE_ERR INVALID_STATE_ERR SYNTAX_ERR INVALID_MODIFICATION_ERR NAMESPACE_ERR INVALID_ACCESS_ERR
|
syntax keyword typescriptDomErrNo INDEX_SIZE_ERR DOMSTRING_SIZE_ERR HIERARCHY_REQUEST_ERR WRONG_DOCUMENT_ERR INVALID_CHARACTER_ERR NO_DATA_ALLOWED_ERR NO_MODIFICATION_ALLOWED_ERR NOT_FOUND_ERR NOT_SUPPORTED_ERR INUSE_ATTRIBUTE_ERR INVALID_STATE_ERR SYNTAX_ERR INVALID_MODIFICATION_ERR NAMESPACE_ERR INVALID_ACCESS_ERR
|
||||||
syntax keyword typeScriptDomNodeConsts ELEMENT_NODE ATTRIBUTE_NODE TEXT_NODE CDATA_SECTION_NODE ENTITY_REFERENCE_NODE ENTITY_NODE PROCESSING_INSTRUCTION_NODE COMMENT_NODE DOCUMENT_NODE DOCUMENT_TYPE_NODE DOCUMENT_FRAGMENT_NODE NOTATION_NODE
|
syntax keyword typescriptDomNodeConsts ELEMENT_NODE ATTRIBUTE_NODE TEXT_NODE CDATA_SECTION_NODE ENTITY_REFERENCE_NODE ENTITY_NODE PROCESSING_INSTRUCTION_NODE COMMENT_NODE DOCUMENT_NODE DOCUMENT_TYPE_NODE DOCUMENT_FRAGMENT_NODE NOTATION_NODE
|
||||||
"}}}
|
"}}}
|
||||||
" HTML events and internal variables"{{{
|
" HTML events and internal variables"{{{
|
||||||
syntax case ignore
|
syntax case ignore
|
||||||
syntax keyword typeScriptHtmlEvents onblur onclick oncontextmenu ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onresize onload onsubmit
|
syntax keyword typescriptHtmlEvents onblur onclick oncontextmenu ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onresize onload onsubmit
|
||||||
syntax case match
|
syntax case match
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
" Follow stuff should be highligh within a special context
|
" Follow stuff should be highligh within a special context
|
||||||
" While it can't be handled with context depended with Regex based highlight
|
" While it can't be handled with context depended with Regex based highlight
|
||||||
" So, turn it off by default
|
" So, turn it off by default
|
||||||
if exists("typeScript_enable_domhtmlcss")
|
if exists("typescript_enable_domhtmlcss")
|
||||||
|
|
||||||
" DOM2 things"{{{
|
" DOM2 things"{{{
|
||||||
syntax match typeScriptDomElemAttrs contained /\%(nodeName\|nodeValue\|nodeType\|parentNode\|childNodes\|firstChild\|lastChild\|previousSibling\|nextSibling\|attributes\|ownerDocument\|namespaceURI\|prefix\|localName\|tagName\)\>/
|
syntax match typescriptDomElemAttrs contained /\%(nodeName\|nodeValue\|nodeType\|parentNode\|childNodes\|firstChild\|lastChild\|previousSibling\|nextSibling\|attributes\|ownerDocument\|namespaceURI\|prefix\|localName\|tagName\)\>/
|
||||||
syntax match typeScriptDomElemFuncs contained /\%(insertBefore\|replaceChild\|removeChild\|appendChild\|hasChildNodes\|cloneNode\|normalize\|isSupported\|hasAttributes\|getAttribute\|setAttribute\|removeAttribute\|getAttributeNode\|setAttributeNode\|removeAttributeNode\|getElementsByTagName\|getAttributeNS\|setAttributeNS\|removeAttributeNS\|getAttributeNodeNS\|setAttributeNodeNS\|getElementsByTagNameNS\|hasAttribute\|hasAttributeNS\)\>/ nextgroup=typeScriptParen skipwhite
|
syntax match typescriptDomElemFuncs contained /\%(insertBefore\|replaceChild\|removeChild\|appendChild\|hasChildNodes\|cloneNode\|normalize\|isSupported\|hasAttributes\|getAttribute\|setAttribute\|removeAttribute\|getAttributeNode\|setAttributeNode\|removeAttributeNode\|getElementsByTagName\|getAttributeNS\|setAttributeNS\|removeAttributeNS\|getAttributeNodeNS\|setAttributeNodeNS\|getElementsByTagNameNS\|hasAttribute\|hasAttributeNS\)\>/ nextgroup=typescriptParen skipwhite
|
||||||
"}}}
|
"}}}
|
||||||
" HTML things"{{{
|
" HTML things"{{{
|
||||||
syntax match typeScriptHtmlElemAttrs contained /\%(className\|clientHeight\|clientLeft\|clientTop\|clientWidth\|dir\|id\|innerHTML\|lang\|length\|offsetHeight\|offsetLeft\|offsetParent\|offsetTop\|offsetWidth\|scrollHeight\|scrollLeft\|scrollTop\|scrollWidth\|style\|tabIndex\|title\)\>/
|
syntax match typescriptHtmlElemAttrs contained /\%(className\|clientHeight\|clientLeft\|clientTop\|clientWidth\|dir\|id\|innerHTML\|lang\|length\|offsetHeight\|offsetLeft\|offsetParent\|offsetTop\|offsetWidth\|scrollHeight\|scrollLeft\|scrollTop\|scrollWidth\|style\|tabIndex\|title\)\>/
|
||||||
syntax match typeScriptHtmlElemFuncs contained /\%(blur\|click\|focus\|scrollIntoView\|addEventListener\|dispatchEvent\|removeEventListener\|item\)\>/ nextgroup=typeScriptParen skipwhite
|
syntax match typescriptHtmlElemFuncs contained /\%(blur\|click\|focus\|scrollIntoView\|addEventListener\|dispatchEvent\|removeEventListener\|item\)\>/ nextgroup=typescriptParen skipwhite
|
||||||
"}}}
|
"}}}
|
||||||
" CSS Styles in typeScript"{{{
|
" CSS Styles in typescript"{{{
|
||||||
syntax keyword typeScriptCssStyles contained color font fontFamily fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontWeight letterSpacing lineBreak lineHeight quotes rubyAlign rubyOverhang rubyPosition
|
syntax keyword typescriptCssStyles contained color font fontFamily fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontWeight letterSpacing lineBreak lineHeight quotes rubyAlign rubyOverhang rubyPosition
|
||||||
syntax keyword typeScriptCssStyles contained textAlign textAlignLast textAutospace textDecoration textIndent textJustify textJustifyTrim textKashidaSpace textOverflowW6 textShadow textTransform textUnderlinePosition
|
syntax keyword typescriptCssStyles contained textAlign textAlignLast textAutospace textDecoration textIndent textJustify textJustifyTrim textKashidaSpace textOverflowW6 textShadow textTransform textUnderlinePosition
|
||||||
syntax keyword typeScriptCssStyles contained unicodeBidi whiteSpace wordBreak wordSpacing wordWrap writingMode
|
syntax keyword typescriptCssStyles contained unicodeBidi whiteSpace wordBreak wordSpacing wordWrap writingMode
|
||||||
syntax keyword typeScriptCssStyles contained bottom height left position right top width zIndex
|
syntax keyword typescriptCssStyles contained bottom height left position right top width zIndex
|
||||||
syntax keyword typeScriptCssStyles 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 typescriptCssStyles 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 typeScriptCssStyles contained margin marginBottom marginLeft marginRight marginTop outline outlineColor outlineStyle outlineWidth padding paddingBottom paddingLeft paddingRight paddingTop
|
syntax keyword typescriptCssStyles contained margin marginBottom marginLeft marginRight marginTop outline outlineColor outlineStyle outlineWidth padding paddingBottom paddingLeft paddingRight paddingTop
|
||||||
syntax keyword typeScriptCssStyles contained listStyle listStyleImage listStylePosition listStyleType
|
syntax keyword typescriptCssStyles contained listStyle listStyleImage listStylePosition listStyleType
|
||||||
syntax keyword typeScriptCssStyles contained background backgroundAttachment backgroundColor backgroundImage gackgroundPosition backgroundPositionX backgroundPositionY backgroundRepeat
|
syntax keyword typescriptCssStyles contained background backgroundAttachment backgroundColor backgroundImage gackgroundPosition backgroundPositionX backgroundPositionY backgroundRepeat
|
||||||
syntax keyword typeScriptCssStyles contained clear clip clipBottom clipLeft clipRight clipTop content counterIncrement counterReset cssFloat cursor direction display filter layoutGrid layoutGridChar layoutGridLine layoutGridMode layoutGridType
|
syntax keyword typescriptCssStyles contained clear clip clipBottom clipLeft clipRight clipTop content counterIncrement counterReset cssFloat cursor direction display filter layoutGrid layoutGridChar layoutGridLine layoutGridMode layoutGridType
|
||||||
syntax keyword typeScriptCssStyles contained marks maxHeight maxWidth minHeight minWidth opacity MozOpacity overflow overflowX overflowY verticalAlign visibility zoom cssText
|
syntax keyword typescriptCssStyles contained marks maxHeight maxWidth minHeight minWidth opacity MozOpacity overflow overflowX overflowY verticalAlign visibility zoom cssText
|
||||||
syntax keyword typeScriptCssStyles contained scrollbar3dLightColor scrollbarArrowColor scrollbarBaseColor scrollbarDarkShadowColor scrollbarFaceColor scrollbarHighlightColor scrollbarShadowColor scrollbarTrackColor
|
syntax keyword typescriptCssStyles contained scrollbar3dLightColor scrollbarArrowColor scrollbarBaseColor scrollbarDarkShadowColor scrollbarFaceColor scrollbarHighlightColor scrollbarShadowColor scrollbarTrackColor
|
||||||
"}}}
|
|
||||||
" Highlight ways"{{{
|
|
||||||
syntax match typeScriptDotNotation "\." nextgroup=typeScriptPrototype,typeScriptDomElemAttrs,typeScriptDomElemFuncs,typeScriptHtmlElemAttrs,typeScriptHtmlElemFuncs
|
|
||||||
syntax match typeScriptDotNotation "\.style\." nextgroup=typeScriptCssStyles
|
|
||||||
"}}}
|
"}}}
|
||||||
endif "DOM/HTML/CSS
|
endif "DOM/HTML/CSS
|
||||||
|
|
||||||
|
" Highlight ways"{{{
|
||||||
|
syntax match typescriptDotNotation "\." nextgroup=typescriptPrototype,typescriptDomElemAttrs,typescriptDomElemFuncs,typescriptDOMMethods,typescriptDOMProperties,typescriptHtmlElemAttrs,typescriptHtmlElemFuncs,typescriptHtmlElemProperties,typescriptAjaxProperties,typescriptAjaxMethods,typescriptPropietaryMethods,typescriptEventListenerMethods skipwhite skipnl
|
||||||
|
syntax match typescriptDotNotation "\.style\." nextgroup=typescriptCssStyles
|
||||||
|
"}}}
|
||||||
|
|
||||||
"" end DOM/HTML/CSS specified things""}}}
|
"" end DOM/HTML/CSS specified things""}}}
|
||||||
|
|
||||||
|
|
||||||
"" Code blocks
|
"" Code blocks
|
||||||
syntax cluster typeScriptAll contains=typeScriptComment,typeScriptLineComment,typeScriptDocComment,typeScriptStringD,typeScriptStringS,typeScriptRegexpString,typeScriptNumber,typeScriptFloat,typeScriptLabel,typeScriptSource,typeScriptType,typeScriptOperator,typeScriptBoolean,typeScriptNull,typeScriptFuncKeyword,typeScriptConditional,typeScriptGlobal,typeScriptRepeat,typeScriptBranch,typeScriptStatement,typeScriptGlobalObjects,typeScriptMessage,typeScriptIdentifier,typeScriptExceptions,typeScriptReserved,typeScriptDeprecated,typeScriptDomErrNo,typeScriptDomNodeConsts,typeScriptHtmlEvents,typeScriptDotNotation,typeScriptBrowserObjects,typeScriptDOMObjects,typeScriptAjaxObjects,typeScriptPropietaryObjects,typeScriptDOMMethods,typeScriptHtmlElemProperties,typeScriptDOMProperties,typeScriptEventListenerKeywords,typeScriptEventListenerMethods,typeScriptAjaxProperties,typeScriptAjaxMethods,typeScriptFuncArg
|
syntax cluster typescriptAll contains=typescriptComment,typescriptLineComment,typescriptDocComment,typescriptStringD,typescriptStringS,typescriptStringB,typescriptRegexpString,typescriptNumber,typescriptFloat,typescriptDecorators,typescriptLabel,typescriptSource,typescriptType,typescriptOperator,typescriptBoolean,typescriptNull,typescriptFuncKeyword,typescriptConditional,typescriptGlobal,typescriptRepeat,typescriptBranch,typescriptStatement,typescriptGlobalObjects,typescriptMessage,typescriptIdentifier,typescriptExceptions,typescriptReserved,typescriptDeprecated,typescriptDomErrNo,typescriptDomNodeConsts,typescriptHtmlEvents,typescriptDotNotation,typescriptBrowserObjects,typescriptDOMObjects,typescriptAjaxObjects,typescriptPropietaryObjects,typescriptDOMMethods,typescriptHtmlElemProperties,typescriptDOMProperties,typescriptEventListenerKeywords,typescriptEventListenerMethods,typescriptAjaxProperties,typescriptAjaxMethods,typescriptFuncArg
|
||||||
|
|
||||||
if main_syntax == "typeScript"
|
if main_syntax == "typescript"
|
||||||
syntax sync clear
|
syntax sync clear
|
||||||
syntax sync ccomment typeScriptComment minlines=200
|
syntax sync ccomment typescriptComment minlines=200
|
||||||
" syntax sync match typeScriptHighlight grouphere typeScriptBlock /{/
|
" syntax sync match typescriptHighlight grouphere typescriptBlock /{/
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syntax keyword typeScriptFuncKeyword function contained
|
syntax keyword typescriptFuncKeyword function
|
||||||
syntax region typeScriptFuncDef start="function" end="\([^)]*\)" contains=typeScriptFuncKeyword,typeScriptFuncArg keepend
|
"syntax region typescriptFuncDef start="function" end="\(.*\)" contains=typescriptFuncKeyword,typescriptFuncArg keepend
|
||||||
syntax match typeScriptFuncArg "\(([^()]*)\)" contains=typeScriptParens,typeScriptFuncComma contained
|
"syntax match typescriptFuncArg "\(([^()]*)\)" contains=typescriptParens,typescriptFuncComma contained
|
||||||
syntax match typeScriptFuncComma /,/ contained
|
"syntax match typescriptFuncComma /,/ contained
|
||||||
" syntax region typeScriptFuncBlock contained matchgroup=typeScriptFuncBlock start="{" end="}" contains=@typeScriptAll,typeScriptParensErrA,typeScriptParensErrB,typeScriptParen,typeScriptBracket,typeScriptBlock fold
|
" syntax region typescriptFuncBlock contained matchgroup=typescriptFuncBlock start="{" end="}" contains=@typescriptAll,typescriptParensErrA,typescriptParensErrB,typescriptParen,typescriptBracket,typescriptBlock fold
|
||||||
|
|
||||||
syn match typeScriptBraces "[{}\[\]]"
|
syn match typescriptBraces "[{}\[\]]"
|
||||||
syn match typeScriptParens "[()]"
|
syn match typescriptParens "[()]"
|
||||||
syn match typeScriptOpSymbols "=\{1,3}\|!==\|!=\|<\|>\|>=\|<=\|++\|+=\|--\|-="
|
syn match typescriptOpSymbols "=\{1,3}\|!==\|!=\|<\|>\|>=\|<=\|++\|+=\|--\|-="
|
||||||
syn match typeScriptEndColons "[;,]"
|
syn match typescriptEndColons "[;,]"
|
||||||
syn match typeScriptLogicSymbols "\(&&\)\|\(||\)"
|
syn match typescriptLogicSymbols "\(&&\)\|\(||\)"
|
||||||
|
|
||||||
" typeScriptFold Function {{{
|
" typescriptFold Function {{{
|
||||||
|
|
||||||
function! TypeScriptFold()
|
" 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
|
||||||
endfunction
|
syn region foldBraces start=/{/ skip=/\(\/\/.*\)\|\(\/.*\/\)/ end=/}/ transparent fold keepend extend
|
||||||
|
|
||||||
au FileType typeScript call TypeScriptFold()
|
" setl foldtext=FoldText()
|
||||||
|
" endfunction
|
||||||
|
|
||||||
|
" au FileType typescript call typescriptFold()
|
||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" 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
|
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
||||||
if version >= 508 || !exists("did_typeScript_syn_inits")
|
if version >= 508 || !exists("did_typescript_syn_inits")
|
||||||
if version < 508
|
if version < 508
|
||||||
let did_typeScript_syn_inits = 1
|
let did_typescript_syn_inits = 1
|
||||||
command -nargs=+ HiLink hi link <args>
|
command -nargs=+ HiLink hi link <args>
|
||||||
else
|
else
|
||||||
command -nargs=+ HiLink hi def link <args>
|
command -nargs=+ HiLink hi def link <args>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
"Typescript highlighting
|
"typescript highlighting
|
||||||
HiLink typeScriptParameters Operator
|
HiLink typescriptParameters Operator
|
||||||
HiLink typescriptSuperBlock Operator
|
HiLink typescriptSuperBlock Operator
|
||||||
|
|
||||||
HiLink typeScriptEndColons Exception
|
HiLink typescriptEndColons Exception
|
||||||
HiLink typeScriptOpSymbols Operator
|
HiLink typescriptOpSymbols Operator
|
||||||
HiLink typeScriptLogicSymbols Boolean
|
HiLink typescriptLogicSymbols Boolean
|
||||||
HiLink typeScriptBraces Function
|
HiLink typescriptBraces Function
|
||||||
HiLink typeScriptParens Operator
|
HiLink typescriptParens Operator
|
||||||
HiLink typeScriptComment Comment
|
HiLink typescriptComment Comment
|
||||||
HiLink typeScriptLineComment Comment
|
HiLink typescriptLineComment Comment
|
||||||
HiLink typeScriptRef Include
|
HiLink typescriptRefComment Include
|
||||||
HiLink typeScriptRefS String
|
HiLink typescriptRefS String
|
||||||
HiLink typeScriptRefD String
|
HiLink typescriptRefD String
|
||||||
HiLink typeScriptDocComment Comment
|
HiLink typescriptDocComment Comment
|
||||||
HiLink typeScriptCommentTodo Todo
|
HiLink typescriptCommentTodo Todo
|
||||||
HiLink typeScriptCvsTag Function
|
HiLink typescriptCvsTag Function
|
||||||
HiLink typeScriptDocTags Special
|
HiLink typescriptDocTags Special
|
||||||
HiLink typeScriptDocSeeTag Function
|
HiLink typescriptDocSeeTag Function
|
||||||
HiLink typeScriptDocParam Function
|
HiLink typescriptDocParam Function
|
||||||
HiLink typeScriptStringS String
|
HiLink typescriptStringS String
|
||||||
HiLink typeScriptStringD String
|
HiLink typescriptStringD String
|
||||||
HiLink typeScriptRegexpString String
|
HiLink typescriptStringB String
|
||||||
HiLink typeScriptGlobal Constant
|
HiLink typescriptRegexpString String
|
||||||
HiLink typeScriptCharacter Character
|
HiLink typescriptGlobal Constant
|
||||||
HiLink typeScriptPrototype Type
|
HiLink typescriptCharacter Character
|
||||||
HiLink typeScriptConditional Conditional
|
HiLink typescriptPrototype Type
|
||||||
HiLink typeScriptBranch Conditional
|
HiLink typescriptConditional Conditional
|
||||||
HiLink typeScriptIdentifier Identifier
|
HiLink typescriptBranch Conditional
|
||||||
HiLink typeScriptRepeat Repeat
|
HiLink typescriptIdentifier Identifier
|
||||||
HiLink typeScriptStatement Statement
|
HiLink typescriptRepeat Repeat
|
||||||
HiLink typeScriptFuncKeyword Type
|
HiLink typescriptStatement Statement
|
||||||
HiLink typeScriptMessage Keyword
|
HiLink typescriptFuncKeyword Function
|
||||||
HiLink typeScriptDeprecated Exception
|
HiLink typescriptMessage Keyword
|
||||||
HiLink typeScriptError Error
|
HiLink typescriptDeprecated Exception
|
||||||
HiLink typeScriptParensError Error
|
HiLink typescriptError Error
|
||||||
HiLink typeScriptParensErrA Error
|
HiLink typescriptParensError Error
|
||||||
HiLink typeScriptParensErrB Error
|
HiLink typescriptParensErrA Error
|
||||||
HiLink typeScriptParensErrC Error
|
HiLink typescriptParensErrB Error
|
||||||
HiLink typeScriptReserved Keyword
|
HiLink typescriptParensErrC Error
|
||||||
HiLink typeScriptOperator Operator
|
HiLink typescriptReserved Keyword
|
||||||
HiLink typeScriptType Type
|
HiLink typescriptOperator Operator
|
||||||
HiLink typeScriptNull Type
|
HiLink typescriptType Type
|
||||||
HiLink typeScriptNumber Number
|
HiLink typescriptNull Type
|
||||||
HiLink typeScriptFloat Number
|
HiLink typescriptNumber Number
|
||||||
HiLink typeScriptBoolean Boolean
|
HiLink typescriptFloat Number
|
||||||
HiLink typeScriptLabel Label
|
HiLink typescriptDecorators Special
|
||||||
HiLink typeScriptSpecial Special
|
HiLink typescriptBoolean Boolean
|
||||||
HiLink typeScriptSource Special
|
HiLink typescriptLabel Label
|
||||||
HiLink typeScriptGlobalObjects Special
|
HiLink typescriptSpecial Special
|
||||||
HiLink typeScriptExceptions Special
|
HiLink typescriptSource Special
|
||||||
|
HiLink typescriptGlobalObjects Special
|
||||||
|
HiLink typescriptExceptions Special
|
||||||
|
|
||||||
HiLink typeScriptDomErrNo Constant
|
HiLink typescriptDomErrNo Constant
|
||||||
HiLink typeScriptDomNodeConsts Constant
|
HiLink typescriptDomNodeConsts Constant
|
||||||
HiLink typeScriptDomElemAttrs Label
|
HiLink typescriptDomElemAttrs Label
|
||||||
HiLink typeScriptDomElemFuncs PreProc
|
HiLink typescriptDomElemFuncs PreProc
|
||||||
|
|
||||||
HiLink typeScriptHtmlElemAttrs Label
|
HiLink typescriptHtmlElemAttrs Label
|
||||||
HiLink typeScriptHtmlElemFuncs PreProc
|
HiLink typescriptHtmlElemFuncs PreProc
|
||||||
|
|
||||||
HiLink typeScriptCssStyles Label
|
HiLink typescriptCssStyles Label
|
||||||
" Ajax Highlighting
|
|
||||||
HiLink typeScriptBrowserObjects Constant
|
|
||||||
|
|
||||||
HiLink typeScriptDOMObjects Constant
|
" Ajax Highlighting
|
||||||
HiLink typeScriptDOMMethods Exception
|
HiLink typescriptBrowserObjects Constant
|
||||||
HiLink typeScriptDOMProperties Type
|
|
||||||
|
|
||||||
HiLink typeScriptAjaxObjects htmlH1
|
HiLink typescriptDOMObjects Constant
|
||||||
HiLink typeScriptAjaxMethods Exception
|
HiLink typescriptDOMMethods Function
|
||||||
HiLink typeScriptAjaxProperties Type
|
HiLink typescriptDOMProperties Special
|
||||||
|
|
||||||
HiLink typeScriptFuncDef Title
|
HiLink typescriptAjaxObjects Constant
|
||||||
HiLink typeScriptFuncArg Special
|
HiLink typescriptAjaxMethods Function
|
||||||
HiLink typeScriptFuncComma Operator
|
HiLink typescriptAjaxProperties Special
|
||||||
|
|
||||||
HiLink typeScriptHtmlEvents Special
|
HiLink typescriptFuncDef Title
|
||||||
HiLink typeScriptHtmlElemProperties Type
|
HiLink typescriptFuncArg Special
|
||||||
|
HiLink typescriptFuncComma Operator
|
||||||
|
|
||||||
HiLink typeScriptEventListenerKeywords Keyword
|
HiLink typescriptHtmlEvents Special
|
||||||
|
HiLink typescriptHtmlElemProperties Special
|
||||||
|
|
||||||
HiLink typeScriptNumber Number
|
HiLink typescriptEventListenerKeywords Keyword
|
||||||
HiLink typeScriptPropietaryObjects Constant
|
|
||||||
|
HiLink typescriptNumber Number
|
||||||
|
HiLink typescriptPropietaryObjects Constant
|
||||||
|
|
||||||
delcommand HiLink
|
delcommand HiLink
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Define the htmltypeScript for HTML syntax html.vim
|
" Define the htmltypescript for HTML syntax html.vim
|
||||||
"syntax clear htmltypeScript
|
"syntax clear htmltypescript
|
||||||
"syntax clear typeScriptExpression
|
"syntax clear typescriptExpression
|
||||||
syntax cluster htmltypeScript contains=@typeScriptAll,typeScriptBracket,typeScriptParen,typeScriptBlock,typeScriptParenError
|
syntax cluster htmltypescript contains=@typescriptAll,typescriptBracket,typescriptParen,typescriptBlock,typescriptParenError
|
||||||
syntax cluster typeScriptExpression contains=@typeScriptAll,typeScriptBracket,typeScriptParen,typeScriptBlock,typeScriptParenError,@htmlPreproc
|
syntax cluster typescriptExpression contains=@typescriptAll,typescriptBracket,typescriptParen,typescriptBlock,typescriptParenError,@htmlPreproc
|
||||||
|
|
||||||
let b:current_syntax = "typeScript"
|
let b:current_syntax = "typescript"
|
||||||
if main_syntax == 'typeScript'
|
if main_syntax == 'typescript'
|
||||||
unlet main_syntax
|
unlet main_syntax
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user