mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-09 12:03:53 -05:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6cd2d5417d | ||
|
|
b7a30b1f1a | ||
|
|
6745c49110 | ||
|
|
1a97304cf6 | ||
|
|
d8eaa50aed | ||
|
|
8e26e6e963 | ||
|
|
676e9dd82e | ||
|
|
23af3f70da | ||
|
|
b79385fecc | ||
|
|
03dd22587a | ||
|
|
bbc6be1099 | ||
|
|
7f2e366334 | ||
|
|
04f868b94a | ||
|
|
4071c094c6 | ||
|
|
617b01a5b6 | ||
|
|
bd35da8e9c | ||
|
|
91da1ec2a5 |
18
README.md
18
README.md
@@ -26,19 +26,22 @@ 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)
|
||||||
- [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)
|
- [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)
|
||||||
- [csv](https://github.com/chrisbra/csv.vim) (syntax, ftplugin, ftdetect)
|
- [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)
|
||||||
- [emberscript](https://github.com/heartsentwined/vim-ember-script) (syntax, indent, ftplugin, ftdetect)
|
- [emberscript](https://github.com/heartsentwined/vim-ember-script) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [erlang](https://github.com/oscarh/vimerl) (syntax, indent, compiler, autoload, ftplugin)
|
- [emblem](https://github.com/heartsentwined/vim-emblem) (syntax, indent, ftplugin, ftdetect)
|
||||||
|
- [erlang](https://github.com/hcs42/vim-erlang-runtime) (syntax, indent)
|
||||||
- [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin, ftdetect)
|
- [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [go](https://github.com/jnwhiteh/vim-golang) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
|
- [go](https://github.com/fatih/vim-go) (syntax, indent, ftdetect)
|
||||||
- [haml](https://github.com/tpope/vim-haml) (syntax, indent, compiler, ftplugin, ftdetect)
|
- [haml](https://github.com/tpope/vim-haml) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||||
- [handlebars](https://github.com/mustache/vim-mustache-handlebars) (syntax, ftplugin, ftdetect)
|
- [handlebars](https://github.com/mustache/vim-mustache-handlebars) (syntax, ftplugin, ftdetect)
|
||||||
- [haskell](https://github.com/travitch/hasksyn) (syntax, indent, ftplugin)
|
- [haskell](https://github.com/travitch/hasksyn) (syntax, indent, ftplugin)
|
||||||
@@ -60,26 +63,31 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
|||||||
- [perl](https://github.com/vim-perl/vim-perl) (syntax, indent, ftplugin, ftdetect)
|
- [perl](https://github.com/vim-perl/vim-perl) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [php](https://github.com/StanAngeloff/php.vim) (syntax)
|
- [php](https://github.com/StanAngeloff/php.vim) (syntax)
|
||||||
- [puppet](https://github.com/rodjek/vim-puppet) (syntax, indent, ftplugin, ftdetect)
|
- [puppet](https://github.com/rodjek/vim-puppet) (syntax, indent, ftplugin, ftdetect)
|
||||||
|
- [powershell](https://github.com/Persistent13/vim-ps1) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, ftdetect)
|
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, ftdetect)
|
||||||
- [python](https://github.com/mitsuhiko/vim-python-combined) (syntax, indent)
|
- [python](https://github.com/mitsuhiko/vim-python-combined) (syntax, indent)
|
||||||
- [r-lang](https://github.com/vim-scripts/R.vim) (syntax, ftplugin)
|
- [r-lang](https://github.com/vim-scripts/R.vim) (syntax, ftplugin)
|
||||||
- [rspec](https://github.com/sheerun/rspec.vim) (syntax, ftdetect)
|
- [rspec](https://github.com/sheerun/rspec.vim) (syntax, ftdetect)
|
||||||
- [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, 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, 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)
|
||||||
|
- [swift](https://github.com/toyamarinyon/vim-swift) (syntax, indent, ftdetect)
|
||||||
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, ftdetect)
|
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, ftdetect)
|
||||||
- [tmux](https://github.com/acustodioo/vim-tmux) (syntax, ftdetect)
|
- [tmux](https://github.com/tejr/vim-tmux) (syntax, ftdetect)
|
||||||
- [tomdoc](https://github.com/duwanis/tomdoc.vim) (syntax)
|
- [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, compiler, ftplugin, ftdetect)
|
||||||
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
|
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
|
||||||
- [toml](https://github.com/cespare/vim-toml) (syntax, ftdetect)
|
- [thrift](https://github.com/solarnz/thrift.vim) (syntax, ftdetect)
|
||||||
|
- [toml](https://github.com/cespare/vim-toml) (syntax, ftplugin, ftdetect)
|
||||||
- [twig](https://github.com/beyondwords/vim-twig) (syntax, ftplugin, ftdetect)
|
- [twig](https://github.com/beyondwords/vim-twig) (syntax, ftplugin, ftdetect)
|
||||||
- [xls](https://github.com/vim-scripts/XSLT-syntax) (syntax)
|
- [xls](https://github.com/vim-scripts/XSLT-syntax) (syntax)
|
||||||
- [yard](https://github.com/sheerun/vim-yardoc) (syntax)
|
- [yard](https://github.com/sheerun/vim-yardoc) (syntax)
|
||||||
|
- [vala](https://github.com/tkztmk/vim-vala) (syntax, indent, ftdetect)
|
||||||
|
- [vm](https://github.com/lepture/vim-velocity) (syntax, indent, ftdetect)
|
||||||
- [css-color](https://github.com/ap/vim-css-color) (autoload, syntax)
|
- [css-color](https://github.com/ap/vim-css-color) (autoload, syntax)
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
" Language: CoffeeScript
|
" Language: CoffeeScript
|
||||||
" Maintainer: Mick Koch <kchmck@gmail.com>
|
" Maintainer: Mick Koch <mick@kochm.co>
|
||||||
" URL: http://github.com/kchmck/vim-coffee-script
|
" URL: http://github.com/kchmck/vim-coffee-script
|
||||||
" License: WTFPL
|
" License: WTFPL
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: C Additions
|
" Language: C Additions
|
||||||
" Maintainer: Jon Haggblad <jon@haeggblad.com>
|
" Maintainer: Jon Haggblad <jon@haeggblad.com>
|
||||||
|
" Contributor: Mikhail Wolfson <mywolfson@gmail.com>
|
||||||
" URL: http://www.haeggblad.com
|
" URL: http://www.haeggblad.com
|
||||||
" Last Change: 9 Aug 2014
|
" Last Change: 6 Sep 2014
|
||||||
" Version: 0.1
|
" Version: 0.3
|
||||||
" Changelog:
|
" Changelog:
|
||||||
|
" 0.3 - integration of aftersyntaxc.vim
|
||||||
|
" 0.2 - Cleanup
|
||||||
" 0.1 - initial version.
|
" 0.1 - initial version.
|
||||||
"
|
"
|
||||||
" Syntax highlighting for functions in C.
|
" Syntax highlighting for functions in C.
|
||||||
@@ -13,31 +16,15 @@
|
|||||||
" http://stackoverflow.com/questions/736701/class-function-names-highlighting-in-vim
|
" http://stackoverflow.com/questions/736701/class-function-names-highlighting-in-vim
|
||||||
|
|
||||||
" -----------------------------------------------------------------------------
|
" -----------------------------------------------------------------------------
|
||||||
" Highlight Class and Function names.
|
" Highlight function names.
|
||||||
" -----------------------------------------------------------------------------
|
" -----------------------------------------------------------------------------
|
||||||
syn match cCustomParen "(" contains=cParen contains=cCppParen
|
syn match cCustomParen "(" contains=cParen contains=cCppParen
|
||||||
syn match cCustomFunc "\w\+\s*(\@=" contains=cCustomParen
|
syn match cCustomFunc "\w\+\s*(\@=" contains=cCustomParen
|
||||||
syn match cCustomScope "::"
|
|
||||||
syn match cCustomClass "\w\+\s*::" contains=cCustomScope
|
|
||||||
|
|
||||||
hi def link cCustomFunc Function
|
hi def link cCustomFunc Function
|
||||||
|
|
||||||
" Vim syntax file
|
" -----------------------------------------------------------------------------
|
||||||
" Language: C Additions
|
" Source: aftersyntaxc.vim
|
||||||
" Maintainer: Mikhail Wolfson <mywolfson@gmail.com>
|
" -----------------------------------------------------------------------------
|
||||||
" URL: http://web.mit.edu/wolfsonm
|
|
||||||
" Last Change: 2010 Dec. 3
|
|
||||||
" Version: 0.4
|
|
||||||
"
|
|
||||||
" Changelog:
|
|
||||||
" 0.4 - updates and fixes to cDelimiter to fix break with foldmethod=syntax,
|
|
||||||
" entirely suggested and solved by Ivan Freitas
|
|
||||||
" <ivansichfreitas@gmail.com>
|
|
||||||
" 0.3 - updates and fixes to cUserFunctionPointer, thanks to
|
|
||||||
" Alexei <lxmzhv@gmail.com>
|
|
||||||
" 0.2 - change [] to operator
|
|
||||||
" 0.1 - initial upload, modification from vimscript#1201, Extended c.vim
|
|
||||||
|
|
||||||
|
|
||||||
" Common ANSI-standard functions
|
" Common ANSI-standard functions
|
||||||
syn keyword cAnsiFunction MULU_ DIVU_ MODU_ MUL_ DIV_ MOD_
|
syn keyword cAnsiFunction MULU_ DIVU_ MODU_ MUL_ DIV_ MOD_
|
||||||
@@ -262,42 +249,43 @@ syn keyword cAnsiName bitand not or_eq
|
|||||||
|
|
||||||
hi def link cAnsiFunction cFunction
|
hi def link cAnsiFunction cFunction
|
||||||
hi def link cAnsiName cIdentifier
|
hi def link cAnsiName cIdentifier
|
||||||
|
hi def link cFunction Function
|
||||||
" Operators
|
hi def link cIdentifier Identifier
|
||||||
syn match cOperator "\(<<\|>>\|[-+*/%&^|<>!=]\)="
|
|
||||||
syn match cOperator "<<\|>>\|&&\|||\|++\|--\|->"
|
|
||||||
syn match cOperator "[.!~*&%<>^|=,+-]"
|
|
||||||
syn match cOperator "/[^/*=]"me=e-1
|
|
||||||
syn match cOperator "/$"
|
|
||||||
syn match cOperator "&&\|||"
|
|
||||||
syn match cOperator "[][]"
|
|
||||||
|
|
||||||
" Preprocs
|
|
||||||
syn keyword cDefined defined contained containedin=cDefine
|
|
||||||
hi def link cDefined cDefine
|
|
||||||
|
|
||||||
" Functions
|
|
||||||
syn match cUserFunction "\<\h\w*\>\(\s\|\n\)*("me=e-1 contains=cType,cDelimiter,cDefine
|
|
||||||
syn match cUserFunctionPointer "(\s*\*\s*\h\w*\s*)\(\s\|\n\)*(" contains=cDelimiter,cOperator
|
|
||||||
|
|
||||||
hi def link cUserFunction cFunction
|
|
||||||
hi def link cUserFunctionPointer cFunction
|
|
||||||
|
|
||||||
" Delimiters
|
|
||||||
syn match cDelimiter "[();\\]"
|
|
||||||
" foldmethod=syntax fix, courtesy of Ivan Freitas
|
|
||||||
syn match cBraces display "[{}]"
|
|
||||||
|
|
||||||
|
|
||||||
" Booleans
|
" Booleans
|
||||||
syn keyword cBoolean true false TRUE FALSE
|
syn keyword cBoolean true false TRUE FALSE
|
||||||
|
|
||||||
|
|
||||||
" Links
|
|
||||||
hi def link cFunction Function
|
|
||||||
hi def link cIdentifier Identifier
|
|
||||||
hi def link cDelimiter Delimiter
|
|
||||||
" foldmethod=syntax fix, courtesy of Ivan Freitas
|
|
||||||
hi def link cBraces Delimiter
|
|
||||||
hi def link cBoolean Boolean
|
hi def link cBoolean Boolean
|
||||||
|
|
||||||
|
" -----------------------------------------------------------------------------
|
||||||
|
" Additional optional highlighting
|
||||||
|
" -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
" Operators
|
||||||
|
"syn match cOperator "\(<<\|>>\|[-+*/%&^|<>!=]\)="
|
||||||
|
"syn match cOperator "<<\|>>\|&&\|||\|++\|--\|->"
|
||||||
|
"syn match cOperator "[.!~*&%<>^|=,+-]"
|
||||||
|
"syn match cOperator "/[^/*=]"me=e-1
|
||||||
|
"syn match cOperator "/$"
|
||||||
|
"syn match cOperator "&&\|||"
|
||||||
|
"syn match cOperator "[][]"
|
||||||
|
"
|
||||||
|
"" Preprocs
|
||||||
|
"syn keyword cDefined defined contained containedin=cDefine
|
||||||
|
"hi def link cDefined cDefine
|
||||||
|
|
||||||
|
"" Functions
|
||||||
|
"syn match cUserFunction "\<\h\w*\>\(\s\|\n\)*("me=e-1 contains=cType,cDelimiter,cDefine
|
||||||
|
"syn match cUserFunctionPointer "(\s*\*\s*\h\w*\s*)\(\s\|\n\)*(" contains=cDelimiter,cOperator
|
||||||
|
"
|
||||||
|
"hi def link cUserFunction cFunction
|
||||||
|
"hi def link cUserFunctionPointer cFunction
|
||||||
|
"
|
||||||
|
"" Delimiters
|
||||||
|
"syn match cDelimiter "[();\\]"
|
||||||
|
"" foldmethod=syntax fix, courtesy of Ivan Freitas
|
||||||
|
"syn match cBraces display "[{}]"
|
||||||
|
|
||||||
|
" Links
|
||||||
|
"hi def link cDelimiter Delimiter
|
||||||
|
" foldmethod=syntax fix, courtesy of Ivan Freitas
|
||||||
|
"hi def link cBraces Delimiter
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
" This file describes a very basic syntax for TomDoc comments in a
|
|
||||||
" CoffeeScript file.
|
|
||||||
"
|
|
||||||
" For more information on TomDoc, check it out here: http://tomdoc.org/
|
|
||||||
"
|
|
||||||
|
|
||||||
syn keyword tomdocKeywords Returns containedin=coffeeComment contained
|
|
||||||
syn keyword tomdocKeywords Throws containedin=coffeeComment contained
|
|
||||||
syn keyword tomdocKeywords Examples containedin=coffeeComment contained
|
|
||||||
syn keyword tomdocKeywords Signature containedin=coffeeComment contained
|
|
||||||
|
|
||||||
syn match tomdocArguments +\s*[A-Za-z0-9_\-&\*:]*\(\s*- \)+he=e-3 containedin=coffeeComment contained
|
|
||||||
|
|
||||||
syn match tomdocDescriptions +\s*Public:+he=e-1 containedin=coffeeComment contained
|
|
||||||
syn match tomdocDescriptions +\s*Internal:+he=e-1 containedin=coffeeComment contained
|
|
||||||
syn match tomdocDescriptions +\s*Deprecated:+he=e-1 containedin=coffeeComment contained
|
|
||||||
|
|
||||||
hi default link tomdocDescriptions String
|
|
||||||
hi default link tomdocKeywords String
|
|
||||||
hi default link tomdocArguments HELP
|
|
||||||
@@ -2,16 +2,18 @@
|
|||||||
" Language: C++ Additions
|
" Language: C++ Additions
|
||||||
" Maintainer: Jon Haggblad <jon@haeggblad.com>
|
" Maintainer: Jon Haggblad <jon@haeggblad.com>
|
||||||
" URL: http://www.haeggblad.com
|
" URL: http://www.haeggblad.com
|
||||||
" Last Change: 21 Apr 2014
|
" Last Change: 21 Sep 2014
|
||||||
" Version: 0.3
|
" Version: 0.5
|
||||||
" Changelog:
|
" Changelog:
|
||||||
" 0.1 - initial version.
|
" 0.1 - initial version.
|
||||||
" 0.2 - C++14
|
" 0.2 - C++14
|
||||||
" 0.3 - Incorporate lastest changes from Mizuchi/STL-Syntax
|
" 0.3 - Incorporate lastest changes from Mizuchi/STL-Syntax
|
||||||
|
" 0.4 - Add template function highlight
|
||||||
|
" 0.5 - Redo template function highlight to be more robust. Add options.
|
||||||
"
|
"
|
||||||
" Additional Vim syntax highlighting for C++ (including C++11)
|
" Additional Vim syntax highlighting for C++ (including C++11/14)
|
||||||
"
|
"
|
||||||
" This file contains additional syntax highlighting that I use for my C++11/14
|
" This file contains additional syntax highlighting that I use for C++11/14
|
||||||
" development in Vim. Compared to the standard syntax highlighting for C++ it
|
" development in Vim. Compared to the standard syntax highlighting for C++ it
|
||||||
" adds highlighting of (user defined) functions and the containers and types
|
" adds highlighting of (user defined) functions and the containers and types
|
||||||
" in the standard library / boost.
|
" in the standard library / boost.
|
||||||
@@ -29,21 +31,35 @@
|
|||||||
" Based on the discussion in:
|
" Based on the discussion in:
|
||||||
" http://stackoverflow.com/questions/736701/class-function-names-highlighting-in-vim
|
" http://stackoverflow.com/questions/736701/class-function-names-highlighting-in-vim
|
||||||
" -----------------------------------------------------------------------------
|
" -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
" Functions
|
||||||
syn match cCustomParen "(" contains=cParen contains=cCppParen
|
syn match cCustomParen "(" contains=cParen contains=cCppParen
|
||||||
syn match cCustomFunc "\w\+\s*(\@=" contains=cCustomParen
|
syn match cCustomFunc "\w\+\s*(\@=" contains=cCustomParen
|
||||||
syn match cCustomScope "::"
|
|
||||||
syn match cCustomClass "\w\+\s*::" contains=cCustomScope
|
|
||||||
|
|
||||||
hi def link cCustomFunc Function
|
hi def link cCustomFunc Function
|
||||||
|
|
||||||
" Uncomment this to also highlight 'class::' and 'namespace::'
|
" Template functions
|
||||||
"hi def link cCustomClass Function
|
if exists('g:cpp_experimental_template_highlight') && g:cpp_experimental_template_highlight
|
||||||
|
syn region cCustomAngleBrackets matchgroup=AngleBracketContents start="\v%(<operator\_s*)@<!%(%(\_i|template\_s*)@<=\<[<=]@!|\<@<!\<[[:space:]<=]@!)" end='>' contains=@cppSTLgroup,cppStructure,cType,cCustomClass,cCustomAngleBrackets,cNumbers
|
||||||
|
syn match cCustomBrack "<\|>" contains=cCustomAngleBrackets
|
||||||
|
syn match cCustomTemplateFunc "\w\+\s*<.*>(\@=" contains=cCustomBrack,cCustomAngleBrackets
|
||||||
|
hi def link cCustomTemplateFunc Function
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Class and namespace scope
|
||||||
|
if exists('g:cpp_class_scope_highlight') && g:cpp_class_scope_highlight
|
||||||
|
syn match cCustomScope "::"
|
||||||
|
syn match cCustomClass "\w\+\s*::" contains=cCustomScope
|
||||||
|
hi def link cCustomClass Function " disabled for now
|
||||||
|
endif
|
||||||
|
|
||||||
" Alternative syntax that is used in:
|
" Alternative syntax that is used in:
|
||||||
" http://www.vim.org/scripts/script.php?script_id=3064
|
" http://www.vim.org/scripts/script.php?script_id=3064
|
||||||
"syn match cUserFunction "\<\h\w*\>\(\s\|\n\)*("me=e-1 contains=cType,cDelimiter,cDefine
|
"syn match cUserFunction "\<\h\w*\>\(\s\|\n\)*("me=e-1 contains=cType,cDelimiter,cDefine
|
||||||
"hi def link cCustomFunc Function
|
"hi def link cCustomFunc Function
|
||||||
|
|
||||||
|
" Cluster for all the stdlib functions defined below
|
||||||
|
syn cluster cppSTLgroup contains=cppSTLfunction,cppSTLfunctional,cppSTLconstant,cppSTLnamespace,cppSTLtype,cppSTLexception,cppSTLiterator,cppSTLiterator_tagcppSTLenumcppSTLioscppSTLcast
|
||||||
|
|
||||||
" -----------------------------------------------------------------------------
|
" -----------------------------------------------------------------------------
|
||||||
" Standard library types and functions.
|
" Standard library types and functions.
|
||||||
"
|
"
|
||||||
@@ -1294,6 +1310,10 @@ if !exists("cpp_no_cpp11")
|
|||||||
syntax keyword cppSTLtype minutes
|
syntax keyword cppSTLtype minutes
|
||||||
syntax keyword cppSTLtype hours
|
syntax keyword cppSTLtype hours
|
||||||
|
|
||||||
|
"raw string literals
|
||||||
|
syntax region cppRawString matchgroup=cppRawDelimiter start=@\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(@ end=/)\z1"/ contains=@Spell
|
||||||
|
|
||||||
|
syn match cNumber "0b[01]\+"
|
||||||
endif " C++11
|
endif " C++11
|
||||||
|
|
||||||
if !exists("cpp_no_cpp14")
|
if !exists("cpp_no_cpp14")
|
||||||
@@ -1338,5 +1358,7 @@ if version >= 508 || !exists("did_cpp_syntax_inits")
|
|||||||
HiLink cppSTLenum Typedef
|
HiLink cppSTLenum Typedef
|
||||||
HiLink cppSTLios Function
|
HiLink cppSTLios Function
|
||||||
HiLink cppSTLcast Statement " be consistent with official syntax
|
HiLink cppSTLcast Statement " be consistent with official syntax
|
||||||
|
HiLink cppRawString String
|
||||||
|
HiLink cppRawDelimiter Delimiter
|
||||||
delcommand HiLink
|
delcommand HiLink
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
" Language: CoffeeScript
|
" Language: CoffeeScript
|
||||||
" Maintainer: Mick Koch <kchmck@gmail.com>
|
" Maintainer: Mick Koch <mick@kochm.co>
|
||||||
" URL: http://github.com/kchmck/vim-coffee-script
|
" URL: http://github.com/kchmck/vim-coffee-script
|
||||||
" License: WTFPL
|
" License: WTFPL
|
||||||
|
|
||||||
@@ -9,6 +9,32 @@ syn region coffeeScript start=#<script [^>]*type="text/coffeescript"[^>]*>#
|
|||||||
\ end=#</script>#me=s-1 keepend
|
\ end=#</script>#me=s-1 keepend
|
||||||
\ contains=@htmlCoffeeScript,htmlScriptTag,@htmlPreproc
|
\ contains=@htmlCoffeeScript,htmlScriptTag,@htmlPreproc
|
||||||
\ containedin=htmlHead
|
\ containedin=htmlHead
|
||||||
|
if !exists("g:less_html_style_tags")
|
||||||
|
let g:less_html_style_tags = 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !g:less_html_style_tags
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Unset (but preserve) so that less will run.
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
let s:pre_less_cur_syn = b:current_syntax
|
||||||
|
unlet b:current_syntax
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Inspired by code from github.com/kchmck/vim-coffee-script
|
||||||
|
" and the html syntax file included with vim 7.4.
|
||||||
|
|
||||||
|
syn include @htmlLess syntax/less.vim
|
||||||
|
|
||||||
|
" We have to explicitly add to htmlHead (containedin) as that region specifies 'contains'.
|
||||||
|
syn region lessStyle start=+<style [^>]*type *=[^>]*text/less[^>]*>+ keepend end=+</style>+ contains=@htmlLess,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc containedin=htmlHead
|
||||||
|
|
||||||
|
" Reset since 'less' isn't really the current_syntax.
|
||||||
|
if exists("s:pre_less_cur_syn")
|
||||||
|
let b:current_syntax = s:pre_less_cur_syn
|
||||||
|
endif
|
||||||
" Language: Colorful CSS Color Preview
|
" Language: Colorful CSS Color Preview
|
||||||
" Author: Aristotle Pagaltzis <pagaltzis@gmx.de>
|
" Author: Aristotle Pagaltzis <pagaltzis@gmx.de>
|
||||||
|
|
||||||
|
|||||||
@@ -3,4 +3,11 @@
|
|||||||
|
|
||||||
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
||||||
|
|
||||||
call css_color#init('css', 'lessVariableValue,lessDefinition,lessComment')
|
" variable | property | multiline | end-of-line | plugin
|
||||||
|
" -----------------------+----------------+----------------+-------------+---------
|
||||||
|
" lessCssAttribute | lessCssComment | lessComment | https://github.com/genoma/vim-less
|
||||||
|
" lessAttribute | lessCssComment | lessComment | https://github.com/KohPoll/vim-less
|
||||||
|
" lessVariableValue | lessDefinition | cssComment | lessComment | https://github.com/groenewege/vim-less
|
||||||
|
" lessVariableDefinition | cssDefinition | cssComment | lessComment | https://github.com/lunaru/vim-less
|
||||||
|
|
||||||
|
call css_color#init('css', 'lessVariableValue,lessVariableDefinition,lessDefinition,lessCssAttribute,lessAttribute,cssDefinition,cssComment,lessCssComment,lessComment')
|
||||||
|
|||||||
@@ -1,23 +1,3 @@
|
|||||||
" This file describes a very basic syntax for TomDoc comments in a Ruby file.
|
|
||||||
"
|
|
||||||
" For more information on TomDoc, check it out here: http://tomdoc.org/
|
|
||||||
"
|
|
||||||
|
|
||||||
syn keyword tomdocKeywords Returns containedin=rubyComment contained
|
|
||||||
syn keyword tomdocKeywords Yields containedin=rubyComment contained
|
|
||||||
syn keyword tomdocKeywords Raises containedin=rubyComment contained
|
|
||||||
syn keyword tomdocKeywords Examples containedin=rubyComment contained
|
|
||||||
syn keyword tomdocKeywords Signature containedin=rubyComment contained
|
|
||||||
|
|
||||||
syn match tomdocArguments +\s*[A-Za-z0-9_\-&\*:]*\(\s*- \)+he=e-3 containedin=rubyComment contained
|
|
||||||
|
|
||||||
syn match tomdocDescriptions +\s*Public:+he=e-1 containedin=rubyComment contained
|
|
||||||
syn match tomdocDescriptions +\s*Internal:+he=e-1 containedin=rubyComment contained
|
|
||||||
syn match tomdocDescriptions +\s*Deprecated:+he=e-1 containedin=rubyComment contained
|
|
||||||
|
|
||||||
hi default link tomdocDescriptions String
|
|
||||||
hi default link tomdocKeywords String
|
|
||||||
hi default link tomdocArguments HELP
|
|
||||||
" Ruby syntax extensions for highlighting YARD documentation.
|
" Ruby syntax extensions for highlighting YARD documentation.
|
||||||
"
|
"
|
||||||
" Author: Joel Holdbrooks <https://github.com/noprompt>
|
" Author: Joel Holdbrooks <https://github.com/noprompt>
|
||||||
|
|||||||
@@ -29,5 +29,3 @@ hi link rustNiceOperator Operator
|
|||||||
if !exists('g:rust_conceal_mod_path')
|
if !exists('g:rust_conceal_mod_path')
|
||||||
hi! link Conceal Operator
|
hi! link Conceal Operator
|
||||||
endif
|
endif
|
||||||
|
|
||||||
setlocal conceallevel=2
|
|
||||||
|
|||||||
6
after/syntax/scss.vim
Normal file
6
after/syntax/scss.vim
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
" Language: Colorful CSS Color Preview
|
||||||
|
" Author: Aristotle Pagaltzis <pagaltzis@gmx.de>
|
||||||
|
|
||||||
|
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
||||||
|
|
||||||
|
call css_color#init('css', 'scssAttribute,scssComment,scssVariableValue,sassCssAttribute,cssComment')
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
" Language: CoffeeScript
|
" Language: CoffeeScript
|
||||||
" Maintainer: Mick Koch <kchmck@gmail.com>
|
" Maintainer: Mick Koch <mick@kochm.co>
|
||||||
" URL: http://github.com/kchmck/vim-coffee-script
|
" URL: http://github.com/kchmck/vim-coffee-script
|
||||||
" License: WTFPL
|
" License: WTFPL
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
" Language: Colorful CSS Color Preview
|
" Language: Colorful CSS Color Preview
|
||||||
" Author: Aristotle Pagaltzis <pagaltzis@gmx.de>
|
" Author: Aristotle Pagaltzis <pagaltzis@gmx.de>
|
||||||
" Last Change: 2014-01-14
|
" Commit: $Format:%H$
|
||||||
" Licence: No Warranties. WTFPL. But please tell me!
|
" Licence: The MIT License (MIT)
|
||||||
" Version: 1.0
|
|
||||||
|
|
||||||
if v:version < 700
|
if v:version < 700
|
||||||
echoerr printf('Vim 7 is required for css-color (this is only %d.%d)',v:version/100,v:version%100)
|
echoerr printf('Vim 7 is required for css-color (this is only %d.%d)',v:version/100,v:version%100)
|
||||||
@@ -206,33 +205,39 @@ function! s:create_syn_match()
|
|||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:update_matches()
|
function! s:clear_matches()
|
||||||
call filter(b:color_match_id, 'matchdelete(v:val)')
|
if exists('w:color_match_id')
|
||||||
if &l:cursorline
|
call filter(w:color_match_id, 'matchdelete(v:val)')
|
||||||
|
unlet w:color_match_id
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:create_matches()
|
||||||
|
if ! &l:cursorline | return | endif
|
||||||
" adds matches based that duplicate the highlighted colors on the current line
|
" adds matches based that duplicate the highlighted colors on the current line
|
||||||
let lnr = line('.')
|
let lnr = line('.')
|
||||||
let group = ''
|
let group = ''
|
||||||
let groupstart = 0
|
let groupstart = 0
|
||||||
let endcol = col('$')
|
let endcol = col('$')
|
||||||
|
let w:color_match_id = []
|
||||||
for col in range( 1, endcol )
|
for col in range( 1, endcol )
|
||||||
let nextgroup = col < endcol ? synIDattr( synID( lnr, col, 1 ), 'name' ) : ''
|
let nextgroup = col < endcol ? synIDattr( synID( lnr, col, 1 ), 'name' ) : ''
|
||||||
if group == nextgroup | continue | endif
|
if group == nextgroup | continue | endif
|
||||||
if group =~ '^BG\x\{6}$'
|
if group =~ '^BG\x\{6}$'
|
||||||
let regex = '\%'.lnr.'l\%'.groupstart.'c'.repeat( '.', col - groupstart )
|
let regex = '\%'.lnr.'l\%'.groupstart.'c'.repeat( '.', col - groupstart )
|
||||||
let match = matchadd( group, regex, -1 )
|
let match = matchadd( group, regex, -1 )
|
||||||
let b:color_match_id += [ match ]
|
let w:color_match_id += [ match ]
|
||||||
endif
|
endif
|
||||||
let group = nextgroup
|
let group = nextgroup
|
||||||
let groupstart = col
|
let groupstart = col
|
||||||
endfor
|
endfor
|
||||||
endif
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let s:_hexcolor = '#\(\x\{3}\|\x\{6}\)\>' " submatch 1
|
let s:_hexcolor = '#\(\x\{3}\|\x\{6}\)\>' " submatch 1
|
||||||
let s:_funcname = '\(rgb\|hsl\)a\?' " submatch 2
|
let s:_funcname = '\(rgb\|hsl\)a\?' " submatch 2
|
||||||
let s:_numval = '\(\d\{1,3}%\?\)' " submatch 3,4,5
|
|
||||||
let s:_ws_ = '\s*'
|
let s:_ws_ = '\s*'
|
||||||
let s:_listsep = s:_ws_ . ',' . s:_ws_
|
let s:_numval = s:_ws_ . '\(\d\{1,3}%\?\)' " submatch 3,4,5
|
||||||
|
let s:_listsep = s:_ws_ . ','
|
||||||
let s:_otherargs_ = '\%(,[^)]*\)\?'
|
let s:_otherargs_ = '\%(,[^)]*\)\?'
|
||||||
let s:_funcexpr = s:_funcname . '[(]' . s:_numval . s:_listsep . s:_numval . s:_listsep . s:_numval . s:_ws_ . s:_otherargs_ . '[)]'
|
let s:_funcexpr = s:_funcname . '[(]' . s:_numval . s:_listsep . s:_numval . s:_listsep . s:_numval . s:_ws_ . s:_otherargs_ . '[)]'
|
||||||
let s:_csscolor = s:_hexcolor . '\|' . s:_funcexpr
|
let s:_csscolor = s:_hexcolor . '\|' . s:_funcexpr
|
||||||
@@ -242,11 +247,13 @@ let s:_csscolor = s:_hexcolor . '\|' . s:_funcexpr
|
|||||||
" scan without examining the start of the string over and over
|
" scan without examining the start of the string over and over
|
||||||
function! s:parse_css_screen()
|
function! s:parse_css_screen()
|
||||||
call substitute( join( getline('w0','w$'), "\n" ), s:_csscolor, '\=s:create_syn_match()', 'g' )
|
call substitute( join( getline('w0','w$'), "\n" ), s:_csscolor, '\=s:create_syn_match()', 'g' )
|
||||||
call s:update_matches()
|
call s:clear_matches()
|
||||||
|
call s:create_matches()
|
||||||
endfunction
|
endfunction
|
||||||
function! s:parse_any_screen()
|
function! s:parse_any_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:update_matches()
|
call s:clear_matches()
|
||||||
|
call s:create_matches()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
@@ -256,14 +263,15 @@ function! css_color#init(type, groups)
|
|||||||
|
|
||||||
let b:has_color_hi = {}
|
let b:has_color_hi = {}
|
||||||
let b:has_pattern_syn = {}
|
let b:has_pattern_syn = {}
|
||||||
let b:color_match_id = []
|
|
||||||
|
|
||||||
augroup CSSColor
|
augroup CSSColor
|
||||||
autocmd! * <buffer>
|
autocmd! * <buffer>
|
||||||
exe 'autocmd CursorMoved,CursorMovedI <buffer> call s:parse_'.a:type.'_screen()'
|
exe 'autocmd CursorMoved,CursorMovedI <buffer> call s:parse_'.a:type.'_screen()'
|
||||||
|
autocmd BufWinEnter <buffer> call s:create_matches()
|
||||||
|
autocmd BufWinLeave <buffer> call s:clear_matches()
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
do CSSColor CursorMoved <buffer>
|
exe 'call s:parse_'.a:type.'_screen()'
|
||||||
|
|
||||||
if a:type != 'css' | return | endif
|
if a:type != 'css' | return | endif
|
||||||
|
|
||||||
|
|||||||
@@ -1,161 +0,0 @@
|
|||||||
" ------------------------------------------------------------------------------
|
|
||||||
" Vim omni-completion script
|
|
||||||
" Author: Oscar Hellström
|
|
||||||
" Email: oscar@oscarh.net
|
|
||||||
" Version: 2010-08-10
|
|
||||||
" Contributors: kTT (http://github.com/kTT)
|
|
||||||
" Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
|
||||||
" ------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
" Patterns for completions {{{1
|
|
||||||
let s:erlangLocalFuncBeg = '\(\<[0-9A-Za-z_-]*\|\s*\)$'
|
|
||||||
let s:erlangExternalFuncBeg = '\<[0-9A-Za-z_-]\+:[0-9A-Za-z_-]*$'
|
|
||||||
let s:ErlangBlankLine = '^\s*\(%.*\)\?$'
|
|
||||||
let s:erlangCompletionPath = expand('<sfile>:p:h') . '/erlang_completion.erl'
|
|
||||||
|
|
||||||
if !exists('g:erlangCompletionGrep')
|
|
||||||
let g:erlangCompletionGrep = 'grep'
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:erlangManSuffix')
|
|
||||||
let g:erlangManSuffix = ''
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:erlangManPath')
|
|
||||||
let g:erlangManPath = '/usr/lib/erlang/man'
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:erlangCompletionDisplayDoc')
|
|
||||||
let g:erlangCompletionDisplayDoc = 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Main function for completion {{{1
|
|
||||||
function! erlangcomplete#Complete(findstart, base)
|
|
||||||
" 0) Init {{{2
|
|
||||||
let lnum = line('.')
|
|
||||||
let column = col('.')
|
|
||||||
let line = strpart(getline('.'), 0, column - 1)
|
|
||||||
|
|
||||||
" 1) First, check if completion is impossible {{{2
|
|
||||||
if line =~ '[^~\\]%'
|
|
||||||
return -1
|
|
||||||
endif
|
|
||||||
|
|
||||||
"echo "line[col - 1]:" . line[column - 1] . " line[col - 2]:" . line[column - 2] . "\n" . line . "\n"
|
|
||||||
|
|
||||||
" 2) Check if the char to the left of us are part of a function call {{{2
|
|
||||||
"
|
|
||||||
" Nothing interesting is written at the char just before the cursor
|
|
||||||
" This means _anything_ could be started here
|
|
||||||
" In this case, keyword completion should probably be used,
|
|
||||||
" for now we'll only try and complete local functions.
|
|
||||||
" TODO: Examine if we can stare Identifiers end complete on them
|
|
||||||
" Is this worth it? Is /completion/ of a "blank" wanted? Can we consider (
|
|
||||||
" interesting and check if we are in a function call etc.?
|
|
||||||
if line[column - 2] !~ '[0-9A-Za-z:_-]'
|
|
||||||
if a:findstart
|
|
||||||
return column
|
|
||||||
else
|
|
||||||
return s:erlangFindLocalFunc(a:base)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
" 3) Function in external module {{{2
|
|
||||||
if line =~ s:erlangExternalFuncBeg
|
|
||||||
let delimiter = match(line, ':[0-9A-Za-z_-]*$') + 1
|
|
||||||
if a:findstart
|
|
||||||
return delimiter
|
|
||||||
else
|
|
||||||
let module = matchstr(line[:-2], '\<\k*\>$')
|
|
||||||
return s:erlangFindExternalFunc(module, a:base)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
" 4) Local function {{{2
|
|
||||||
if line =~ s:erlangLocalFuncBeg
|
|
||||||
let funcstart = match(line, ':\@<![0-9A-Za-z_-]*$')
|
|
||||||
if a:findstart
|
|
||||||
return funcstart
|
|
||||||
else
|
|
||||||
return s:erlangFindLocalFunc(a:base)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
" 5) Unhandled situation {{{2
|
|
||||||
if a:findstart
|
|
||||||
return -1
|
|
||||||
else
|
|
||||||
return []
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Auxiliary functions for completion {{{1
|
|
||||||
" Find the next non-blank line {{{2
|
|
||||||
function s:erlangFindNextNonBlank(lnum)
|
|
||||||
let lnum = nextnonblank(a:lnum + 1)
|
|
||||||
let line = getline(lnum)
|
|
||||||
while line =~ s:ErlangBlankLine && 0 != lnum
|
|
||||||
let lnum = nextnonblank(lnum + 1)
|
|
||||||
let line = getline(lnum)
|
|
||||||
endwhile
|
|
||||||
return lnum
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" vim: foldmethod=marker:
|
|
||||||
" Find external function names {{{2
|
|
||||||
function s:erlangFindExternalFunc(module, base)
|
|
||||||
" If it's a local module, try to compile it
|
|
||||||
if filereadable(a:module . '.erl') && !filereadable(a:module . '.beam')
|
|
||||||
silent execute '!erlc' a:module . '.erl' '>/dev/null' '2>/dev/null'
|
|
||||||
redraw!
|
|
||||||
endif
|
|
||||||
let functions = system(s:erlangCompletionPath . ' ' . a:module)
|
|
||||||
for element in sort(split(functions, '\n'))
|
|
||||||
if match(element, a:base) == 0
|
|
||||||
let function_name = matchstr(element, a:base . '\w\+')
|
|
||||||
let number_of_args = matchstr(element, '\d\+', len(function_name))
|
|
||||||
let number_of_comma = max([number_of_args - 1, 0])
|
|
||||||
let file_path = g:erlangManPath . '/man?/' . a:module . '\.?' . g:erlangManSuffix
|
|
||||||
" [:-2] cutting some weird characters at the end
|
|
||||||
" becouse grep doesn't support multilines, we have to filter
|
|
||||||
" first by .B and next by looking via function name
|
|
||||||
" if someone have better idea, please change it
|
|
||||||
let description = ''
|
|
||||||
" Don't look man pages if the module is present in the current directory
|
|
||||||
if g:erlangCompletionDisplayDoc != 0 && !filereadable(a:module . '.erl')
|
|
||||||
let system_command = g:erlangCompletionGrep . ' -A 1 "\.B" ' . file_path . ' | grep -EZo "\<' .
|
|
||||||
\ function_name . '\>\((\w+, ){' . number_of_comma . '}[^),]*\) -> .*"'
|
|
||||||
let description = system(system_command)
|
|
||||||
let description = description[:-2]
|
|
||||||
endif
|
|
||||||
if description == ''
|
|
||||||
let description = element " if function doesn't have description e.g. lists:rmerge, put rmerge/2 instead
|
|
||||||
endif
|
|
||||||
let field = {'word': function_name . '(', 'abbr': description, 'kind': 'f', 'dup': 1} " always duplicate functions
|
|
||||||
call complete_add(field)
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
return []
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Find local function names {{{2
|
|
||||||
function s:erlangFindLocalFunc(base)
|
|
||||||
" begin at line 1
|
|
||||||
let lnum = s:erlangFindNextNonBlank(1)
|
|
||||||
if "" == a:base
|
|
||||||
let base = '\w' " used to match against word symbol
|
|
||||||
else
|
|
||||||
let base = a:base
|
|
||||||
endif
|
|
||||||
while 0 != lnum && !complete_check()
|
|
||||||
let line = getline(lnum)
|
|
||||||
let function_name = matchstr(line, '^' . base . '[0-9A-Za-z_-]\+(\@=')
|
|
||||||
if function_name != ""
|
|
||||||
call complete_add(function_name)
|
|
||||||
endif
|
|
||||||
let lnum = s:erlangFindNextNonBlank(lnum)
|
|
||||||
endwhile
|
|
||||||
return []
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
@@ -178,14 +178,14 @@ function! s:WithPath(func, ...)
|
|||||||
call mkdir(tmpdir)
|
call mkdir(tmpdir)
|
||||||
|
|
||||||
let save_cwd = getcwd()
|
let save_cwd = getcwd()
|
||||||
silent exe 'lcd' tmpdir
|
silent exe 'lcd' fnameescape(tmpdir)
|
||||||
|
|
||||||
let path = 'unnamed.rs'
|
let path = 'unnamed.rs'
|
||||||
|
|
||||||
let save_mod = &mod
|
let save_mod = &mod
|
||||||
set nomod
|
set nomod
|
||||||
|
|
||||||
silent exe 'keepalt write! ' . path
|
silent exe 'keepalt write! ' . fnameescape(path)
|
||||||
if pathisempty
|
if pathisempty
|
||||||
silent keepalt 0file
|
silent keepalt 0file
|
||||||
endif
|
endif
|
||||||
@@ -197,7 +197,7 @@ function! s:WithPath(func, ...)
|
|||||||
finally
|
finally
|
||||||
if exists("save_mod") | let &mod = save_mod | endif
|
if exists("save_mod") | let &mod = save_mod | endif
|
||||||
if exists("save_write") | let &write = save_write | endif
|
if exists("save_write") | let &write = save_write | endif
|
||||||
if exists("save_cwd") | silent exe 'lcd' save_cwd | endif
|
if exists("save_cwd") | silent exe 'lcd' fnameescape(save_cwd) | endif
|
||||||
if exists("tmpdir") | silent call s:RmDir(tmpdir) | endif
|
if exists("tmpdir") | silent call s:RmDir(tmpdir) | endif
|
||||||
endtry
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ endif
|
|||||||
|
|
||||||
" Ref: http://dev.w3.org/html5/markup/
|
" Ref: http://dev.w3.org/html5/markup/
|
||||||
" Version: Draft 05 April 2011
|
" Version: Draft 05 April 2011
|
||||||
let phrasing_elements = ['a', 'em', 'strong', 'small', 'mark', 'abbr', 'dfn', 'i', 'b', 'u', 'code', 'var', 'samp', 'kbd', 'sup', 'sub', 'q', 'cite', 'span', 'bdo', 'bdi', 'br', 'wbr', 'ins', 'del', 'img', 'embed', 'object', 'iframe', 'map', 'area', 'script', 'noscript', 'ruby', 'video', 'audio', 'input', 'textarea', 'select', 'button', 'label', 'output', 'datalist', 'keygen', 'progress', 'command', 'canvas', 'time', 'meter', 'data', 'content', 'shadow']
|
let phrasing_elements = ['a', 'em', 'strong', 'small', 'mark', 'abbr', 'dfn', 'i', 'b', 'u', 'code', 'var', 'samp', 'kbd', 'sup', 'sub', 'q', 'cite', 'span', 'bdo', 'bdi', 'br', 'wbr', 'ins', 'del', 'img', 'picture', 'embed', 'object', 'iframe', 'map', 'area', 'script', 'noscript', 'ruby', 'video', 'audio', 'input', 'textarea', 'select', 'button', 'label', 'output', 'datalist', 'keygen', 'progress', 'command', 'canvas', 'time', 'meter', 'data', 'content', 'shadow']
|
||||||
|
|
||||||
let metadata_elements = ['link', 'style', 'meta', 'script', 'noscript', 'command']
|
let metadata_elements = ['link', 'style', 'meta', 'script', 'noscript', 'command']
|
||||||
|
|
||||||
@@ -601,7 +601,7 @@ let g:xmldata_html5 = {
|
|||||||
\ ],
|
\ ],
|
||||||
\ 'meta': [
|
\ 'meta': [
|
||||||
\ [],
|
\ [],
|
||||||
\ extend(copy(global_attributes), {'name': [], 'http-equiv': ['refresh', 'default-style', 'content-type'], 'content': [], 'charset': charset})
|
\ extend(copy(global_attributes), {'name': ['application-name', 'author', 'description', 'generator', 'referrer', 'creator', 'googlebot', 'publisher', 'robots', 'slurp', 'viewport', 'theme-color'], 'http-equiv': ['refresh', 'default-style', 'content-type'], 'content': [], 'charset': charset})
|
||||||
\ ],
|
\ ],
|
||||||
\ 'meter': [
|
\ 'meter': [
|
||||||
\ phrasing_elements,
|
\ phrasing_elements,
|
||||||
@@ -643,6 +643,10 @@ let g:xmldata_html5 = {
|
|||||||
\ [],
|
\ [],
|
||||||
\ extend(copy(global_attributes), {'name': [], 'value': []})
|
\ extend(copy(global_attributes), {'name': [], 'value': []})
|
||||||
\ ],
|
\ ],
|
||||||
|
\ 'picture': [
|
||||||
|
\ flow_elements + ['source'],
|
||||||
|
\ global_attributes
|
||||||
|
\ ],
|
||||||
\ 'pre': [
|
\ 'pre': [
|
||||||
\ phrasing_elements,
|
\ phrasing_elements,
|
||||||
\ global_attributes
|
\ global_attributes
|
||||||
@@ -693,7 +697,7 @@ let g:xmldata_html5 = {
|
|||||||
\ ],
|
\ ],
|
||||||
\ 'source': [
|
\ 'source': [
|
||||||
\ [],
|
\ [],
|
||||||
\ extend(copy(global_attributes), {'src': [], 'type': [], 'media': []})
|
\ extend(copy(global_attributes), {'src': [], 'type': [], 'media': [], 'srcset': [], 'sizes': []})
|
||||||
\ ],
|
\ ],
|
||||||
\ 'span': [
|
\ 'span': [
|
||||||
\ phrasing_elements,
|
\ phrasing_elements,
|
||||||
|
|||||||
17
build
17
build
@@ -23,17 +23,18 @@ extract() {
|
|||||||
path="$(printf "$pack" | cut -d ':' -f 2)"
|
path="$(printf "$pack" | cut -d ':' -f 2)"
|
||||||
dir="tmp/$(printf "$path" | cut -d '/' -f 2)"
|
dir="tmp/$(printf "$path" | cut -d '/' -f 2)"
|
||||||
directories="DIRS$(printf "$pack" | cut -d ':' -f 3)"
|
directories="DIRS$(printf "$pack" | cut -d ':' -f 3)"
|
||||||
|
subtree="$(printf "$pack" | cut -d ':' -f 4)"
|
||||||
printf -- "- [$name](https://github.com/$path) ("
|
printf -- "- [$name](https://github.com/$path) ("
|
||||||
|
|
||||||
subdirs=""
|
subdirs=""
|
||||||
for subdir in ${!directories}; do
|
for subdir in ${!directories}; do
|
||||||
if [ -d "$dir/$subdir" ]; then
|
if [ -d "${dir}${subtree:-/}${subdir}" ]; then
|
||||||
base="$(basename "$subdir")"
|
base="$(basename "$subdir")"
|
||||||
if [[ "$subdirs" != *"$base"* ]]; then
|
if [[ "$subdirs" != *"$base"* ]]; then
|
||||||
subdirs="$subdirs, $base"
|
subdirs="$subdirs, $base"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
copy_dir "$dir" "$subdir"
|
copy_dir "${dir}${subtree}" "$subdir"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -45,8 +46,9 @@ extract() {
|
|||||||
name="$(printf "$pack" | cut -d ':' -f 1)"
|
name="$(printf "$pack" | cut -d ':' -f 1)"
|
||||||
path="$(printf "$pack" | cut -d ':' -f 2)"
|
path="$(printf "$pack" | cut -d ':' -f 2)"
|
||||||
dir="tmp/$(printf "$path" | cut -d '/' -f 2)"
|
dir="tmp/$(printf "$path" | cut -d '/' -f 2)"
|
||||||
|
subtree="$(printf "$pack" | cut -d ':' -f 4)"
|
||||||
|
|
||||||
if [ -d "$dir/plugin" ]; then
|
if [ -d "$dir${subtree:-/}plugin" ]; then
|
||||||
printf "Possible error (plugin directory exists): $path\n"
|
printf "Possible error (plugin directory exists): $path\n"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -72,7 +74,6 @@ PACKS="
|
|||||||
blade:xsbeats/vim-blade
|
blade:xsbeats/vim-blade
|
||||||
c++11:octol/vim-cpp-enhanced-highlight
|
c++11:octol/vim-cpp-enhanced-highlight
|
||||||
c/c++:vim-jp/cpp-vim
|
c/c++:vim-jp/cpp-vim
|
||||||
c-extensions:kergoth/aftersyntaxc.vim
|
|
||||||
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
|
||||||
@@ -82,7 +83,7 @@ PACKS="
|
|||||||
elixir:elixir-lang/vim-elixir
|
elixir:elixir-lang/vim-elixir
|
||||||
emberscript:heartsentwined/vim-ember-script
|
emberscript:heartsentwined/vim-ember-script
|
||||||
emblem:heartsentwined/vim-emblem
|
emblem:heartsentwined/vim-emblem
|
||||||
erlang:oscarh/vimerl
|
erlang:hcs42/vim-erlang-runtime
|
||||||
git:tpope/vim-git
|
git:tpope/vim-git
|
||||||
go:fatih/vim-go:_BASIC
|
go:fatih/vim-go:_BASIC
|
||||||
haml:tpope/vim-haml
|
haml:tpope/vim-haml
|
||||||
@@ -106,6 +107,7 @@ PACKS="
|
|||||||
perl:vim-perl/vim-perl
|
perl:vim-perl/vim-perl
|
||||||
php:StanAngeloff/php.vim
|
php:StanAngeloff/php.vim
|
||||||
puppet:rodjek/vim-puppet
|
puppet:rodjek/vim-puppet
|
||||||
|
powershell:Persistent13/vim-ps1
|
||||||
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
|
||||||
@@ -119,14 +121,17 @@ PACKS="
|
|||||||
systemd:kurayama/systemd-vim-syntax
|
systemd:kurayama/systemd-vim-syntax
|
||||||
swift:toyamarinyon/vim-swift
|
swift:toyamarinyon/vim-swift
|
||||||
textile:timcharper/textile.vim
|
textile:timcharper/textile.vim
|
||||||
tmux:acustodioo/vim-tmux
|
tmux:tejr/vim-tmux
|
||||||
tomdoc:duwanis/tomdoc.vim
|
tomdoc:duwanis/tomdoc.vim
|
||||||
typescript:leafgarland/typescript-vim
|
typescript:leafgarland/typescript-vim
|
||||||
vbnet:vim-scripts/vbnet.vim
|
vbnet:vim-scripts/vbnet.vim
|
||||||
|
thrift:solarnz/thrift.vim
|
||||||
toml:cespare/vim-toml
|
toml:cespare/vim-toml
|
||||||
twig:beyondwords/vim-twig
|
twig:beyondwords/vim-twig
|
||||||
xls:vim-scripts/XSLT-syntax
|
xls:vim-scripts/XSLT-syntax
|
||||||
yard:sheerun/vim-yardoc
|
yard:sheerun/vim-yardoc
|
||||||
|
vala:tkztmk/vim-vala
|
||||||
|
vm:lepture/vim-velocity
|
||||||
css-color:ap/vim-css-color
|
css-color:ap/vim-css-color
|
||||||
"
|
"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
" Language: CoffeeScript
|
" Language: CoffeeScript
|
||||||
" Maintainer: Mick Koch <kchmck@gmail.com>
|
" Maintainer: Mick Koch <mick@kochm.co>
|
||||||
" URL: http://github.com/kchmck/vim-coffee-script
|
" URL: http://github.com/kchmck/vim-coffee-script
|
||||||
" License: WTFPL
|
" License: WTFPL
|
||||||
|
|
||||||
|
|||||||
65
compiler/cargo.vim
Normal file
65
compiler/cargo.vim
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
" Vim compiler file
|
||||||
|
" Compiler: Cargo Compiler
|
||||||
|
" Maintainer: Damien Radtke <damienradtke@gmail.com>
|
||||||
|
" Latest Revision: 2014 Sep 24
|
||||||
|
|
||||||
|
if exists('current_compiler')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
runtime compiler/rustc.vim
|
||||||
|
let current_compiler = "cargo"
|
||||||
|
|
||||||
|
if exists(':CompilerSet') != 2
|
||||||
|
command -nargs=* CompilerSet setlocal <args>
|
||||||
|
endif
|
||||||
|
|
||||||
|
if exists('g:cargo_makeprg_params')
|
||||||
|
execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*'
|
||||||
|
else
|
||||||
|
CompilerSet makeprg=cargo\ $*
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Allow a configurable global Cargo.toml name. This makes it easy to
|
||||||
|
" support variations like 'cargo.toml'.
|
||||||
|
let s:cargo_manifest_name = get(g:, 'cargo_manifest_name', 'Cargo.toml')
|
||||||
|
|
||||||
|
function! s:is_absolute(path)
|
||||||
|
return a:path[0] == '/' || a:path =~ '[A-Z]\+:'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let s:local_manifest = findfile(s:cargo_manifest_name, '.;')
|
||||||
|
if s:local_manifest != ''
|
||||||
|
let s:local_manifest = fnamemodify(s:local_manifest, ':p:h').'/'
|
||||||
|
augroup cargo
|
||||||
|
au!
|
||||||
|
au QuickfixCmdPost make call s:FixPaths()
|
||||||
|
augroup END
|
||||||
|
|
||||||
|
" FixPaths() is run after Cargo, and is used to change the file paths
|
||||||
|
" to be relative to the current directory instead of Cargo.toml.
|
||||||
|
function! s:FixPaths()
|
||||||
|
let qflist = getqflist()
|
||||||
|
let manifest = s:local_manifest
|
||||||
|
for qf in qflist
|
||||||
|
if !qf.valid
|
||||||
|
let m = matchlist(qf.text, '(file://\(.*\))$')
|
||||||
|
if !empty(m)
|
||||||
|
let manifest = m[1].'/'
|
||||||
|
" Manually strip another slash if needed; usually just an
|
||||||
|
" issue on Windows.
|
||||||
|
if manifest =~ '^/[A-Z]\+:/'
|
||||||
|
let manifest = manifest[1:]
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
let filename = bufname(qf.bufnr)
|
||||||
|
if s:is_absolute(filename)
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
let qf.filename = simplify(manifest.filename)
|
||||||
|
call remove(qf, 'bufnr')
|
||||||
|
endfor
|
||||||
|
call setqflist(qflist, 'r')
|
||||||
|
endfunction
|
||||||
|
endif
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
" Language: CoffeeScript
|
" Language: CoffeeScript
|
||||||
" Maintainer: Mick Koch <kchmck@gmail.com>
|
" Maintainer: Mick Koch <mick@kochm.co>
|
||||||
" URL: http://github.com/kchmck/vim-coffee-script
|
" URL: http://github.com/kchmck/vim-coffee-script
|
||||||
" License: WTFPL
|
" License: WTFPL
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ CompilerSet makeprg=cucumber
|
|||||||
|
|
||||||
CompilerSet errorformat=
|
CompilerSet errorformat=
|
||||||
\%W%m\ (Cucumber::Undefined),
|
\%W%m\ (Cucumber::Undefined),
|
||||||
\%E%m\ (%.%#),
|
\%E%m\ (%\\S%#),
|
||||||
\%Z%f:%l,
|
\%Z%f:%l,
|
||||||
\%Z%f:%l:%.%#
|
\%Z%f:%l:%.%#
|
||||||
|
|
||||||
|
|||||||
@@ -1,80 +0,0 @@
|
|||||||
" Erlang compiler file
|
|
||||||
" Language: Erlang
|
|
||||||
" Maintainer: Pawel 'kTT' Salata <rockplayer.pl@gmail.com>
|
|
||||||
" URL: http://ktototaki.info
|
|
||||||
|
|
||||||
if exists("current_compiler")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
let current_compiler = "erlang"
|
|
||||||
|
|
||||||
if exists(":CompilerSet") != 2
|
|
||||||
command -nargs=* CompilerSet setlocal <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:erlangCheckFile')
|
|
||||||
let g:erlangCheckFile = "~/.vim/compiler/erlang_check_file.erl"
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:erlangHighlightErrors')
|
|
||||||
let g:erlangHighlightErrors = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:error_list = {}
|
|
||||||
let b:is_showing_msg = 0
|
|
||||||
|
|
||||||
function! HighlightErlangErrors()
|
|
||||||
if match(getline(1), "#!.*escript") != -1
|
|
||||||
setlocal makeprg=escript\ -s\ %
|
|
||||||
else
|
|
||||||
execute "setlocal makeprg=" . g:erlangCheckFile . "\\ \%"
|
|
||||||
endif
|
|
||||||
silent make!
|
|
||||||
call s:clear_matches()
|
|
||||||
for error in getqflist()
|
|
||||||
let item = {}
|
|
||||||
let item['lnum'] = error.lnum
|
|
||||||
let item['msg'] = error.text
|
|
||||||
let b:error_list[error.lnum] = item
|
|
||||||
call matchadd('SpellBad', "\\%" . error.lnum . "l")
|
|
||||||
endfor
|
|
||||||
if len(getqflist())
|
|
||||||
redraw!
|
|
||||||
endif
|
|
||||||
call s:show_msg()
|
|
||||||
setlocal makeprg=erlc\ %
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:show_msg()
|
|
||||||
let pos = getpos(".")
|
|
||||||
if has_key(b:error_list, pos[1])
|
|
||||||
let item = get(b:error_list, pos[1])
|
|
||||||
echo item.msg
|
|
||||||
let b:is_showing_msg = 1
|
|
||||||
else
|
|
||||||
if exists("b:is_showing_msg") && b:is_showing_msg == 1
|
|
||||||
echo
|
|
||||||
let b:is_showing_msg = 0
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endf
|
|
||||||
|
|
||||||
function! s:clear_matches()
|
|
||||||
call clearmatches()
|
|
||||||
let b:error_list = {}
|
|
||||||
if exists("b:is_showing_msg") && b:is_showing_msg == 1
|
|
||||||
echo
|
|
||||||
let b:is_showing_msg = 0
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
CompilerSet makeprg=erlc\ %
|
|
||||||
CompilerSet errorformat=%f:%l:\ %tarning:\ %m,%E%f:%l:\ %m
|
|
||||||
|
|
||||||
if g:erlangHighlightErrors
|
|
||||||
autocmd BufLeave *.erl call s:clear_matches()
|
|
||||||
autocmd BufEnter *.erl call s:clear_matches()
|
|
||||||
autocmd BufWritePost *.erl call HighlightErlangErrors()
|
|
||||||
autocmd CursorHold *.erl call s:show_msg()
|
|
||||||
autocmd CursorMoved *.erl call s:show_msg()
|
|
||||||
endif
|
|
||||||
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:
|
||||||
@@ -3,6 +3,14 @@ if exists("current_compiler")
|
|||||||
endif
|
endif
|
||||||
let current_compiler = "typescript"
|
let current_compiler = "typescript"
|
||||||
|
|
||||||
CompilerSet makeprg=tsc\ $*\ %
|
if !exists("g:typescript_compiler_binary")
|
||||||
|
let g:typescript_compiler_binary = "tsc"
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists("g:typescript_compiler_options")
|
||||||
|
let g:typescript_compiler_options = ""
|
||||||
|
endif
|
||||||
|
|
||||||
|
let &l:makeprg = g:typescript_compiler_binary . ' ' . g:typescript_compiler_options . ' $* %'
|
||||||
|
|
||||||
CompilerSet errorformat=%+A\ %#%f\ %#(%l\\\,%c):\ %m,%C%m
|
CompilerSet errorformat=%+A\ %#%f\ %#(%l\\\,%c):\ %m,%C%m
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
au BufRead,BufNewFile *.ino,*.pde set filetype=arduino
|
au BufRead,BufNewFile *.ino,*.pde set filetype=arduino
|
||||||
autocmd BufRead,BufNewFile *.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 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
|
||||||
@@ -14,14 +14,22 @@ autocmd BufNewFile,BufRead * call s:DetectCoffee()
|
|||||||
au BufRead,BufNewFile *.csv,*.dat,*.tsv,*.tab set filetype=csv
|
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 FileType eelixir setl sw=2 sts=2 et iskeyword+=!,?
|
||||||
au BufRead,BufNewFile *.ex,*.exs set filetype=elixir
|
au BufRead,BufNewFile *.ex,*.exs set filetype=elixir
|
||||||
au FileType elixir setl sw=2 sts=2 et iskeyword+=!,?
|
au FileType elixir setl sw=2 sts=2 et iskeyword+=!,?
|
||||||
|
function! s:DetectElixir()
|
||||||
|
if getline(1) =~ '^#!.*\<elixir\>'
|
||||||
|
set filetype=elixir
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
autocmd BufNewFile,BufRead * call s:DetectElixir()
|
||||||
autocmd BufNewFile,BufRead *.em set filetype=ember-script
|
autocmd BufNewFile,BufRead *.em set filetype=ember-script
|
||||||
autocmd FileType ember-script set tabstop=2|set shiftwidth=2|set expandtab
|
autocmd FileType ember-script set tabstop=2|set shiftwidth=2|set expandtab
|
||||||
autocmd BufNewFile,BufRead *.emblem set filetype=emblem
|
autocmd BufNewFile,BufRead *.emblem set filetype=emblem
|
||||||
autocmd FileType emblem set tabstop=2|set shiftwidth=2|set expandtab
|
autocmd FileType emblem set tabstop=2|set shiftwidth=2|set expandtab
|
||||||
autocmd BufNewFile,BufRead *.git/{,modules/**/}{COMMIT_EDIT,TAG_EDIT,MERGE_,}MSG set ft=gitcommit
|
autocmd BufNewFile,BufRead *.git/{,modules/**/}{COMMIT_EDIT,TAG_EDIT,MERGE_,}MSG set ft=gitcommit
|
||||||
autocmd BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules set ft=gitconfig
|
autocmd BufNewFile,BufRead *.git/config,.gitconfig,gitconfig,.gitmodules set ft=gitconfig
|
||||||
autocmd BufNewFile,BufRead */.config/git/config set ft=gitconfig
|
autocmd BufNewFile,BufRead */.config/git/config set ft=gitconfig
|
||||||
autocmd BufNewFile,BufRead *.git/modules/**/config set ft=gitconfig
|
autocmd BufNewFile,BufRead *.git/modules/**/config set ft=gitconfig
|
||||||
autocmd BufNewFile,BufRead git-rebase-todo set ft=gitrebase
|
autocmd BufNewFile,BufRead git-rebase-todo set ft=gitrebase
|
||||||
@@ -78,6 +86,7 @@ augroup END
|
|||||||
au BufNewFile,BufRead *.ejs set filetype=jst
|
au BufNewFile,BufRead *.ejs set filetype=jst
|
||||||
au BufNewFile,BufRead *.jst 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
|
||||||
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
|
||||||
@@ -102,7 +111,8 @@ autocmd BufRead *.html
|
|||||||
\ set filetype=mason |
|
\ set filetype=mason |
|
||||||
\ endif
|
\ endif
|
||||||
if has("autocmd")
|
if has("autocmd")
|
||||||
au BufNewFile,BufRead *.mustache,*.handlebars,*.hbs,*.hogan,*.hulk,*.hjs set filetype=html syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim
|
au BufNewFile,BufRead *.mustache,*.hogan,*.hulk,*.hjs set filetype=html.mustache syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim
|
||||||
|
au BufNewFile,BufRead *.handlebars,*.hbs set filetype=html.handlebars syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim
|
||||||
endif
|
endif
|
||||||
au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/*,*/nginx/vhosts.d/*,nginx.conf if &ft == '' | setfiletype nginx | endif
|
au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/*,*/nginx/vhosts.d/*,nginx.conf if &ft == '' | setfiletype nginx | endif
|
||||||
au BufRead,BufNewFile *.cl set filetype=opencl
|
au BufRead,BufNewFile *.cl set filetype=opencl
|
||||||
@@ -135,6 +145,10 @@ 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,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 *.psd1 set ft=ps1
|
||||||
|
au BufNewFile,BufRead *.psm1 set ft=ps1
|
||||||
|
au BufNewFile,BufRead *.ps1xml set ft=ps1xml
|
||||||
au! BufRead,BufNewFile *.pp setfiletype puppet
|
au! BufRead,BufNewFile *.pp setfiletype puppet
|
||||||
au! BufRead,BufNewFile Puppetfile setfiletype ruby
|
au! BufRead,BufNewFile Puppetfile setfiletype ruby
|
||||||
function! s:setf(filetype) abort
|
function! s:setf(filetype) abort
|
||||||
@@ -165,14 +179,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 scala'
|
||||||
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
|
||||||
@@ -186,8 +201,13 @@ au BufNewFile,BufRead *.swap set filetype=systemd
|
|||||||
au BufNewFile,BufRead *.target set filetype=systemd
|
au BufNewFile,BufRead *.target set filetype=systemd
|
||||||
au BufNewFile,BufRead *.timer set filetype=systemd
|
au BufNewFile,BufRead *.timer set filetype=systemd
|
||||||
au BufRead,BufNewFile *.textile set filetype=textile
|
au BufRead,BufNewFile *.textile set filetype=textile
|
||||||
autocmd BufNewFile,BufRead .tmux.conf*,tmux.conf* setf tmux
|
au BufNewFile,BufRead *.thrift setlocal filetype=thrift
|
||||||
|
autocmd BufNewFile,BufRead {.,}tmux.conf{.*,} setlocal filetype=tmux
|
||||||
autocmd BufNewFile,BufRead *.toml set filetype=toml
|
autocmd BufNewFile,BufRead *.toml 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
|
||||||
autocmd BufNewFile,BufRead *.html.twig set filetype=html.twig
|
autocmd BufNewFile,BufRead *.html.twig set filetype=html.twig
|
||||||
autocmd BufNewFile,BufRead *.ts setlocal filetype=typescript
|
autocmd BufNewFile,BufRead *.ts setlocal filetype=typescript
|
||||||
|
autocmd BufRead *.vala,*.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
|
||||||
|
au BufRead,BufNewFile *.vala,*.vapi setfiletype vala
|
||||||
|
au BufRead,BufNewFile *.vm set ft=velocity syntax=velocity
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
" Language: CoffeeScript
|
" Language: CoffeeScript
|
||||||
" Maintainer: Mick Koch <kchmck@gmail.com>
|
" Maintainer: Mick Koch <mick@kochm.co>
|
||||||
" URL: http://github.com/kchmck/vim-coffee-script
|
" URL: http://github.com/kchmck/vim-coffee-script
|
||||||
" License: WTFPL
|
" License: WTFPL
|
||||||
|
|
||||||
@@ -13,6 +13,7 @@ call coffee#CoffeeSetUpVariables()
|
|||||||
setlocal formatoptions-=t formatoptions+=croql
|
setlocal formatoptions-=t formatoptions+=croql
|
||||||
setlocal comments=:# commentstring=#\ %s
|
setlocal comments=:# commentstring=#\ %s
|
||||||
setlocal omnifunc=javascriptcomplete#CompleteJS
|
setlocal omnifunc=javascriptcomplete#CompleteJS
|
||||||
|
setlocal suffixesadd+=coffee
|
||||||
|
|
||||||
" Create custom augroups.
|
" Create custom augroups.
|
||||||
augroup CoffeeBufUpdate | augroup END
|
augroup CoffeeBufUpdate | augroup END
|
||||||
@@ -330,7 +331,7 @@ function! s:CoffeeLint(startline, endline, bang, args)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let output = system(g:coffee_linter .
|
let output = system(g:coffee_linter .
|
||||||
\ ' -s --csv' .
|
\ ' -s --reporter csv' .
|
||||||
\ ' ' . b:coffee_litcoffee .
|
\ ' ' . b:coffee_litcoffee .
|
||||||
\ ' ' . g:coffee_lint_options .
|
\ ' ' . g:coffee_lint_options .
|
||||||
\ ' ' . a:args .
|
\ ' ' . a:args .
|
||||||
@@ -394,11 +395,11 @@ if !exists('b:coffee_run_buf')
|
|||||||
call s:CoffeeRunResetVars()
|
call s:CoffeeRunResetVars()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
command! -range=% -bar -nargs=* -complete=customlist,s:CoffeeComplete
|
command! -buffer -range=% -bar -nargs=* -complete=customlist,s:CoffeeComplete
|
||||||
\ CoffeeCompile call s:CoffeeCompile(<line1>, <line2>, <q-args>)
|
\ CoffeeCompile call s:CoffeeCompile(<line1>, <line2>, <q-args>)
|
||||||
command! -bar -nargs=* -complete=customlist,s:CoffeeComplete
|
command! -buffer -bar -nargs=* -complete=customlist,s:CoffeeComplete
|
||||||
\ CoffeeWatch call s:CoffeeWatch(<q-args>)
|
\ CoffeeWatch call s:CoffeeWatch(<q-args>)
|
||||||
command! -range=% -bar -nargs=* CoffeeRun
|
command! -buffer -range=% -bar -nargs=* CoffeeRun
|
||||||
\ call s:CoffeeRun(<line1>, <line2>, <q-args>)
|
\ call s:CoffeeRun(<line1>, <line2>, <q-args>)
|
||||||
command! -range=% -bang -bar -nargs=* CoffeeLint
|
command! -buffer -range=% -bang -bar -nargs=* CoffeeLint
|
||||||
\ call s:CoffeeLint(<line1>, <line2>, <q-bang>, <q-args>)
|
\ call s:CoffeeLint(<line1>, <line2>, <q-bang>, <q-args>)
|
||||||
|
|||||||
410
ftplugin/csv.vim
410
ftplugin/csv.vim
@@ -1,16 +1,30 @@
|
|||||||
" Filetype plugin for editing CSV files. "{{{1
|
" Filetype plugin for editing CSV files. "{{{1
|
||||||
" Author: Christian Brabandt <cb@256bit.org>
|
" Author: Christian Brabandt <cb@256bit.org>
|
||||||
" Version: 0.30
|
" Version: 0.31
|
||||||
" Script: http://www.vim.org/scripts/script.php?script_id=2830
|
" Script: http://www.vim.org/scripts/script.php?script_id=2830
|
||||||
" License: VIM License
|
" License: VIM License
|
||||||
" Last Change: Thu, 27 Mar 2014 23:28:40 +0100
|
" Last Change: Thu, 15 Jan 2015 21:05:10 +0100
|
||||||
" Documentation: see :help ft-csv.txt
|
" Documentation: see :help ft-csv.txt
|
||||||
" GetLatestVimScripts: 2830 29 :AutoInstall: csv.vim
|
" GetLatestVimScripts: 2830 30 :AutoInstall: csv.vim
|
||||||
"
|
"
|
||||||
" Some ideas are taken from the wiki http://vim.wikia.com/wiki/VimTip667
|
" Some ideas are taken from the wiki http://vim.wikia.com/wiki/VimTip667
|
||||||
" though, implementation differs.
|
" though, implementation differs.
|
||||||
|
|
||||||
" Plugin folklore "{{{2
|
" Plugin folklore "{{{2
|
||||||
|
fu! <sid>DetermineSID()
|
||||||
|
let s:SID = matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_DetermineSID$')
|
||||||
|
endfu
|
||||||
|
call s:DetermineSID()
|
||||||
|
delf s:DetermineSID
|
||||||
|
|
||||||
|
fu! CSVArrangeCol(first, last, bang, limit) range "{{{2
|
||||||
|
if &ft =~? 'csv'
|
||||||
|
call <sid>ArrangeCol(a:first, a:last, a:bang, a:limit)
|
||||||
|
else
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
endfu
|
||||||
|
|
||||||
if v:version < 700 || exists('b:did_ftplugin')
|
if v:version < 700 || exists('b:did_ftplugin')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
@@ -20,7 +34,6 @@ let s:cpo_save = &cpo
|
|||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
" Function definitions: "{{{2
|
" Function definitions: "{{{2
|
||||||
"
|
|
||||||
" Script specific functions "{{{2
|
" Script specific functions "{{{2
|
||||||
fu! <sid>Warn(mess) "{{{3
|
fu! <sid>Warn(mess) "{{{3
|
||||||
echohl WarningMsg
|
echohl WarningMsg
|
||||||
@@ -28,7 +41,9 @@ fu! <sid>Warn(mess) "{{{3
|
|||||||
echohl Normal
|
echohl Normal
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
fu! <sid>Init(startline, endline) "{{{3
|
fu! <sid>Init(startline, endline, ...) "{{{3
|
||||||
|
" if a:1 is set, keep the b:delimiter
|
||||||
|
let keep = exists("a:1") && a:1
|
||||||
" Hilight Group for Columns
|
" Hilight Group for Columns
|
||||||
if exists("g:csv_hiGroup")
|
if exists("g:csv_hiGroup")
|
||||||
let s:hiGroup = g:csv_hiGroup
|
let s:hiGroup = g:csv_hiGroup
|
||||||
@@ -43,11 +58,13 @@ fu! <sid>Init(startline, endline) "{{{3
|
|||||||
exe "hi link CSVHeaderLine" s:hiHeader
|
exe "hi link CSVHeaderLine" s:hiHeader
|
||||||
|
|
||||||
" Determine default Delimiter
|
" Determine default Delimiter
|
||||||
|
if !keep
|
||||||
if !exists("g:csv_delim")
|
if !exists("g:csv_delim")
|
||||||
let b:delimiter=<SID>GetDelimiter(a:startline, a:endline)
|
let b:delimiter=<SID>GetDelimiter(a:startline, a:endline)
|
||||||
else
|
else
|
||||||
let b:delimiter=g:csv_delim
|
let b:delimiter=g:csv_delim
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
" Define custom commentstring
|
" Define custom commentstring
|
||||||
if !exists("g:csv_comment")
|
if !exists("g:csv_comment")
|
||||||
@@ -77,7 +94,7 @@ fu! <sid>Init(startline, endline) "{{{3
|
|||||||
" - Should work with most ugly solutions that are available
|
" - Should work with most ugly solutions that are available
|
||||||
let b:col='\%(\%(\%(' . (b:delimiter !~ '\s' ? '\s*' : '') .
|
let b:col='\%(\%(\%(' . (b:delimiter !~ '\s' ? '\s*' : '') .
|
||||||
\ '"\%(' . (exists("g:csv_nl") ? '\_' : '' ) .
|
\ '"\%(' . (exists("g:csv_nl") ? '\_' : '' ) .
|
||||||
\ '[^"]\|""\)*"\)' . s:del . '\)\|\%(' .
|
\ '[^"]\|""\)*"\s*\)' . s:del . '\)\|\%(' .
|
||||||
\ '[^' . b:delimiter . ']*' . s:del . '\)\)'
|
\ '[^' . b:delimiter . ']*' . s:del . '\)\)'
|
||||||
let b:col_end='\%(\%(\%(' . (b:delimiter !~ '\s' ? '\s*' : '') .
|
let b:col_end='\%(\%(\%(' . (b:delimiter !~ '\s' ? '\s*' : '') .
|
||||||
\ '"\%(' . (exists("g:csv_nl") ? '\_' : '' ) .
|
\ '"\%(' . (exists("g:csv_nl") ? '\_' : '' ) .
|
||||||
@@ -134,7 +151,7 @@ fu! <sid>Init(startline, endline) "{{{3
|
|||||||
let b:undo_ftplugin .= "| unlet! b:delimiter b:col"
|
let b:undo_ftplugin .= "| unlet! b:delimiter b:col"
|
||||||
\ . "| unlet! b:csv_fixed_width_cols b:csv_filter"
|
\ . "| unlet! b:csv_fixed_width_cols b:csv_filter"
|
||||||
\ . "| unlet! b:csv_fixed_width b:csv_list b:col_width"
|
\ . "| unlet! b:csv_fixed_width b:csv_list b:col_width"
|
||||||
\ . "| unlet! b:csv_SplitWindow b:csv_headerline"
|
\ . "| unlet! b:csv_SplitWindow b:csv_headerline b:csv_cmt"
|
||||||
\ . "| unlet! b:csv_thousands_sep b:csv_decimal_sep"
|
\ . "| unlet! b:csv_thousands_sep b:csv_decimal_sep"
|
||||||
\. " | unlet! b:browsefilter b:csv_cmt"
|
\. " | unlet! b:browsefilter b:csv_cmt"
|
||||||
\. " | unlet! b:csv_arrange_leftalign"
|
\. " | unlet! b:csv_arrange_leftalign"
|
||||||
@@ -169,7 +186,7 @@ fu! <sid>Init(startline, endline) "{{{3
|
|||||||
" \ delf <sid>SaveOptions | delf <sid>CheckDuplicates |
|
" \ delf <sid>SaveOptions | delf <sid>CheckDuplicates |
|
||||||
" \ delf <sid>CompleteColumnNr | delf <sid>CSVPat | delf <sid>Transpose |
|
" \ delf <sid>CompleteColumnNr | delf <sid>CSVPat | delf <sid>Transpose |
|
||||||
" \ delf <sid>LocalSettings() | delf <sid>AddColumn | delf <sid>SubstituteInColumn
|
" \ delf <sid>LocalSettings() | delf <sid>AddColumn | delf <sid>SubstituteInColumn
|
||||||
" \ delf <sid>SetupQuitPre() | delf CSV_CloseBuffer
|
" \ delf <sid>SetupAutoCmd() | delf CSV_CloseBuffer
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
fu! <sid>LocalSettings(type) "{{{3
|
fu! <sid>LocalSettings(type) "{{{3
|
||||||
@@ -181,11 +198,8 @@ fu! <sid>LocalSettings(type) "{{{3
|
|||||||
let b:undo_ftplugin = "setlocal sol& tw< wrap<"
|
let b:undo_ftplugin = "setlocal sol& tw< wrap<"
|
||||||
|
|
||||||
" Set browsefilter
|
" Set browsefilter
|
||||||
if (v:version > 703 || (v:version == 703 && has("patch593")))
|
|
||||||
\ && exists("browsefilter")
|
|
||||||
let b:browsefilter="CSV Files (*.csv, *.dat)\t*.csv;*.dat\n".
|
let b:browsefilter="CSV Files (*.csv, *.dat)\t*.csv;*.dat\n".
|
||||||
\ "All Files\t*.*\n"
|
\ "All Files\t*.*\n"
|
||||||
endif
|
|
||||||
|
|
||||||
if has("conceal")
|
if has("conceal")
|
||||||
setl cole=2 cocu=nc
|
setl cole=2 cocu=nc
|
||||||
@@ -239,35 +253,6 @@ fu! <sid>DoAutoCommands() "{{{3
|
|||||||
let b:undo_ftplugin .= '| exe "sil! au! CSV_HI CursorMoved <buffer> "'
|
let b:undo_ftplugin .= '| exe "sil! au! CSV_HI CursorMoved <buffer> "'
|
||||||
let b:undo_ftplugin .= '| exe "sil! aug! CSV_HI" |exe "sil! HiColumn!"'
|
let b:undo_ftplugin .= '| exe "sil! aug! CSV_HI" |exe "sil! HiColumn!"'
|
||||||
|
|
||||||
" Visually arrange columns when opening a csv file
|
|
||||||
if exists("g:csv_autocmd_arrange") &&
|
|
||||||
\ !exists("#CSV_Edit#BufReadPost")
|
|
||||||
aug CSV_Edit
|
|
||||||
au!
|
|
||||||
au BufReadPost,BufWritePost *.csv,*.dat :sil %ArrangeColumn
|
|
||||||
au BufWritePre *.csv,*.dat :sil %UnArrangeColumn
|
|
||||||
aug end
|
|
||||||
elseif exists("#CSV_Edit#BufReadPost")
|
|
||||||
aug CSV_Edit
|
|
||||||
au!
|
|
||||||
aug end
|
|
||||||
aug! CSV_Edit
|
|
||||||
endif
|
|
||||||
" undo autocommand:
|
|
||||||
let b:undo_ftplugin .= '| exe "sil! au! CSV_Edit "'
|
|
||||||
let b:undo_ftplugin .= '| exe "sil! aug! CSV_Edit"'
|
|
||||||
|
|
||||||
" if !exists("#CSV_ColorScheme#ColorScheme")
|
|
||||||
" " Make sure, syntax highlighting is applied
|
|
||||||
" " after changing the colorscheme
|
|
||||||
" augroup CSV_ColorScheme
|
|
||||||
" au!
|
|
||||||
" au ColorScheme *.csv,*.dat,*.tsv,*.tab do Syntax
|
|
||||||
" augroup end
|
|
||||||
" endif
|
|
||||||
" let b:undo_ftplugin .= '| exe "sil! au! CSV_ColorScheme "'
|
|
||||||
" let b:undo_ftplugin .= '| exe "sil! aug! CSV_ColorScheme"'
|
|
||||||
|
|
||||||
if has("gui_running") && !exists("#CSV_Menu#FileType")
|
if has("gui_running") && !exists("#CSV_Menu#FileType")
|
||||||
augroup CSV_Menu
|
augroup CSV_Menu
|
||||||
au!
|
au!
|
||||||
@@ -276,10 +261,6 @@ fu! <sid>DoAutoCommands() "{{{3
|
|||||||
au BufLeave <buffer> call <sid>Menu(0) " disable
|
au BufLeave <buffer> call <sid>Menu(0) " disable
|
||||||
au BufNewFile,BufNew * call <sid>Menu(0)
|
au BufNewFile,BufNew * call <sid>Menu(0)
|
||||||
augroup END
|
augroup END
|
||||||
"let b:undo_ftplugin .= '| sil! amenu disable CSV'
|
|
||||||
"
|
|
||||||
" b:undo_ftplugin does not support calling <sid> Functions
|
|
||||||
"let b:undo_ftplugin .= '| sil! call <sid>Menu(0)'
|
|
||||||
endif
|
endif
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
@@ -348,11 +329,6 @@ fu! <sid>SearchColumn(arg) "{{{3
|
|||||||
throw "E684"
|
throw "E684"
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
" let colnr=arglist[0]
|
|
||||||
" let pat=substitute(arglist[1], '^\(.\)\(.*\)\1$', '\2', '')
|
|
||||||
" if pat == arglist[1]
|
|
||||||
" throw "E684"
|
|
||||||
" endif
|
|
||||||
endif
|
endif
|
||||||
"catch /^Vim\%((\a\+)\)\=:E684/
|
"catch /^Vim\%((\a\+)\)\=:E684/
|
||||||
catch /E684/ " catch error index out of bounds
|
catch /E684/ " catch error index out of bounds
|
||||||
@@ -364,9 +340,10 @@ fu! <sid>SearchColumn(arg) "{{{3
|
|||||||
call <SID>Warn("There exists no column " . colnr)
|
call <SID>Warn("There exists no column " . colnr)
|
||||||
return 1
|
return 1
|
||||||
endif
|
endif
|
||||||
let @/ = <sid>GetPat(colnr, maxcolnr, pat)
|
let @/ = <sid>GetPat(colnr, maxcolnr, '\%('.pat. '\)')
|
||||||
try
|
try
|
||||||
norm! n
|
" force redraw, so that the search pattern isn't shown
|
||||||
|
exe "norm! n\<c-l>"
|
||||||
catch /^Vim\%((\a\+)\)\=:E486/
|
catch /^Vim\%((\a\+)\)\=:E486/
|
||||||
" Pattern not found
|
" Pattern not found
|
||||||
echohl Error
|
echohl Error
|
||||||
@@ -517,7 +494,13 @@ fu! <sid>WColumn(...) "{{{3
|
|||||||
" Return on which column the cursor is
|
" Return on which column the cursor is
|
||||||
let _cur = getpos('.')
|
let _cur = getpos('.')
|
||||||
if !exists("b:csv_fixed_width_cols")
|
if !exists("b:csv_fixed_width_cols")
|
||||||
|
if line('.') > 1 && mode('') != 'n'
|
||||||
|
" in insert mode, get line from above, just in case the current
|
||||||
|
" line is empty
|
||||||
|
let line = getline(line('.')-1)
|
||||||
|
else
|
||||||
let line=getline('.')
|
let line=getline('.')
|
||||||
|
endif
|
||||||
" move cursor to end of field
|
" move cursor to end of field
|
||||||
"call search(b:col, 'ec', line('.'))
|
"call search(b:col, 'ec', line('.'))
|
||||||
call search(b:col, 'ec')
|
call search(b:col, 'ec')
|
||||||
@@ -600,7 +583,15 @@ fu! <sid>ColWidth(colnr) "{{{3
|
|||||||
|
|
||||||
if !exists("b:csv_fixed_width_cols")
|
if !exists("b:csv_fixed_width_cols")
|
||||||
if !exists("b:csv_list")
|
if !exists("b:csv_list")
|
||||||
let b:csv_list=getline(1,'$')
|
" only check first 10000 lines, to be faster
|
||||||
|
let last = line('$')
|
||||||
|
if !get(b:, 'csv_arrange_use_all_rows', 0)
|
||||||
|
if last > 10000
|
||||||
|
let last = 10000
|
||||||
|
call <sid>Warn('File too large, only checking the first 10000 rows for the width')
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
let b:csv_list=getline(1,last)
|
||||||
let pat = '^\s*\V'. escape(b:csv_cmt[0], '\\')
|
let pat = '^\s*\V'. escape(b:csv_cmt[0], '\\')
|
||||||
call filter(b:csv_list, 'v:val !~ pat')
|
call filter(b:csv_list, 'v:val !~ pat')
|
||||||
call filter(b:csv_list, '!empty(v:val)')
|
call filter(b:csv_list, '!empty(v:val)')
|
||||||
@@ -637,11 +628,7 @@ fu! <sid>ColWidth(colnr) "{{{3
|
|||||||
endif
|
endif
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
fu! <sid>ArrangeCol(first, last, bang) range "{{{3
|
fu! <sid>ArrangeCol(first, last, bang, limit) range "{{{3
|
||||||
"TODO: Why doesn't that work?
|
|
||||||
" is this because of the range flag?
|
|
||||||
" It's because of the way, Vim works with
|
|
||||||
" a:firstline and a:lastline parameter, therefore
|
|
||||||
" explicitly give the range as argument to the function
|
" explicitly give the range as argument to the function
|
||||||
if exists("b:csv_fixed_width_cols")
|
if exists("b:csv_fixed_width_cols")
|
||||||
" Nothing to do
|
" Nothing to do
|
||||||
@@ -649,11 +636,16 @@ fu! <sid>ArrangeCol(first, last, bang) range "{{{3
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
let cur=winsaveview()
|
let cur=winsaveview()
|
||||||
if a:bang || !exists("b:col_width")
|
if a:bang
|
||||||
if a:bang
|
if a:bang
|
||||||
" Force recalculating the Column width
|
" Force recalculating the Column width
|
||||||
unlet! b:csv_list
|
unlet! b:csv_list b:col_width
|
||||||
endif
|
endif
|
||||||
|
elseif a:limit > -1 && a:limit < getfsize(fnamemodify(bufname(''), ':p'))
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists("b:col_width")
|
||||||
" Force recalculation of Column width
|
" Force recalculation of Column width
|
||||||
call <sid>CalculateColumnWidth()
|
call <sid>CalculateColumnWidth()
|
||||||
endif
|
endif
|
||||||
@@ -666,15 +658,40 @@ fu! <sid>ArrangeCol(first, last, bang) range "{{{3
|
|||||||
else
|
else
|
||||||
let ro = 0
|
let ro = 0
|
||||||
endif
|
endif
|
||||||
|
let s:count = 0
|
||||||
|
let _stl = &stl
|
||||||
|
let s:max = (a:last - a:first + 1) * len(b:col_width)
|
||||||
|
let s:temp = 0
|
||||||
|
try
|
||||||
exe "sil". a:first . ',' . a:last .'s/' . (b:col) .
|
exe "sil". a:first . ',' . a:last .'s/' . (b:col) .
|
||||||
\ '/\=<SID>Columnize(submatch(0))/' . (&gd ? '' : 'g')
|
\ '/\=<SID>Columnize(submatch(0))/' . (&gd ? '' : 'g')
|
||||||
|
finally
|
||||||
" Clean up variables, that were only needed for <sid>Columnize() function
|
" Clean up variables, that were only needed for <sid>Columnize() function
|
||||||
unlet! s:columnize_count s:max_cols s:prev_line
|
unlet! s:columnize_count s:max_cols s:prev_line s:max s:count s:temp s:val
|
||||||
if ro
|
if ro
|
||||||
setl ro
|
setl ro
|
||||||
unlet ro
|
unlet ro
|
||||||
endif
|
endif
|
||||||
|
let &stl = _stl
|
||||||
call winrestview(cur)
|
call winrestview(cur)
|
||||||
|
endtry
|
||||||
|
endfu
|
||||||
|
|
||||||
|
fu! <sid>ProgressBar(cnt, max) "{{{3
|
||||||
|
if get(g:, 'csv_no_progress', 0)
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
let width = 40 " max width of progressbar
|
||||||
|
if width > &columns
|
||||||
|
let width = &columns
|
||||||
|
endif
|
||||||
|
let s:val = a:cnt * width / a:max
|
||||||
|
if (s:val > s:temp || a:cnt==1)
|
||||||
|
let &stl='%#DiffAdd#['.repeat('=', s:val).'>'. repeat(' ', width-s:val).']'.
|
||||||
|
\ (width < &columns ? ' '.100*s:val/width. '%%' : '')
|
||||||
|
redrawstatus
|
||||||
|
let s:temp = s:val
|
||||||
|
endif
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
fu! <sid>PrepUnArrangeCol(first, last) "{{{3
|
fu! <sid>PrepUnArrangeCol(first, last) "{{{3
|
||||||
@@ -726,7 +743,7 @@ fu! <sid>CalculateColumnWidth() "{{{3
|
|||||||
endtry
|
endtry
|
||||||
" delete buffer content in variable b:csv_list,
|
" delete buffer content in variable b:csv_list,
|
||||||
" this was only necessary for calculating the max width
|
" this was only necessary for calculating the max width
|
||||||
unlet! b:csv_list
|
unlet! b:csv_list s:columnize_count s:decimal_column
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
fu! <sid>Columnize(field) "{{{3
|
fu! <sid>Columnize(field) "{{{3
|
||||||
@@ -743,6 +760,7 @@ fu! <sid>Columnize(field) "{{{3
|
|||||||
if exists("s:prev_line") && s:prev_line != line('.')
|
if exists("s:prev_line") && s:prev_line != line('.')
|
||||||
let s:columnize_count = 0
|
let s:columnize_count = 0
|
||||||
endif
|
endif
|
||||||
|
let s:count+=1
|
||||||
|
|
||||||
let s:prev_line = line('.')
|
let s:prev_line = line('.')
|
||||||
" convert zero based indexed list to 1 based indexed list,
|
" convert zero based indexed list to 1 based indexed list,
|
||||||
@@ -750,52 +768,85 @@ fu! <sid>Columnize(field) "{{{3
|
|||||||
" Careful: Keep this fast! Using
|
" Careful: Keep this fast! Using
|
||||||
" let width=get(b:col_width,<SID>WColumn()-1,20)
|
" let width=get(b:col_width,<SID>WColumn()-1,20)
|
||||||
" is too slow, so we are using:
|
" is too slow, so we are using:
|
||||||
let width=get(b:col_width, (s:columnize_count % s:max_cols), 20)
|
let colnr = s:columnize_count % s:max_cols
|
||||||
|
let width = get(b:col_width, colnr, 20)
|
||||||
|
let align = 'r'
|
||||||
|
if exists('b:csv_arrange_align')
|
||||||
|
let align_list=split(get(b:, 'csv_arrange_align', " "), '\zs')
|
||||||
|
try
|
||||||
|
let align = align_list[colnr]
|
||||||
|
catch
|
||||||
|
let align = 'r'
|
||||||
|
endtry
|
||||||
|
endif
|
||||||
|
if ((align isnot? 'r' && align isnot? 'l' &&
|
||||||
|
\ align isnot? 'c' && align isnot? '.') || get(b:, 'csv_arrange_leftalign', 0))
|
||||||
|
let align = 'r'
|
||||||
|
endif
|
||||||
|
call <sid>ProgressBar(s:count,s:max)
|
||||||
|
|
||||||
let s:columnize_count += 1
|
let s:columnize_count += 1
|
||||||
let has_delimiter = (a:field =~# b:delimiter.'$')
|
let has_delimiter = (a:field[-1:] is? b:delimiter)
|
||||||
if v:version > 703 || v:version == 703 && has("patch713")
|
if align is? 'l'
|
||||||
" printf knows about %S (e.g. can handle char length
|
|
||||||
if get(b:, 'csv_arrange_leftalign',0)
|
|
||||||
" left-align content
|
" left-align content
|
||||||
return printf("%-*S%s", width+1 ,
|
return printf("%-*S%s", width+1 ,
|
||||||
\ (has_delimiter ?
|
\ (has_delimiter ? a:field[:-2] : a:field),
|
||||||
\ matchstr(a:field, '.*\%('.b:delimiter.'\)\@=') : a:field),
|
|
||||||
\ (has_delimiter ? b:delimiter : ' '))
|
\ (has_delimiter ? b:delimiter : ' '))
|
||||||
|
elseif align is? 'c'
|
||||||
|
" center the column
|
||||||
|
let t = width - len(split(a:field, '\zs'))
|
||||||
|
let leftwidth = t/2
|
||||||
|
" uneven width, add one
|
||||||
|
let rightwidth = (t%2 ? leftwidth+1 : leftwidth)
|
||||||
|
let field = (has_delimiter ? a:field[:-2] : a:field). repeat(' ', rightwidth)
|
||||||
|
return printf("%*S%s", width , field, (has_delimiter ? b:delimiter : ' '))
|
||||||
|
elseif align is? '.'
|
||||||
|
if !exists("s:decimal_column")
|
||||||
|
let s:decimal_column = {}
|
||||||
|
endif
|
||||||
|
if get(s:decimal_column, colnr, 0) == 0
|
||||||
|
call <sid>CheckHeaderLine()
|
||||||
|
call <sid>NumberFormat()
|
||||||
|
let data = <sid>CopyCol('', colnr+1, '')[s:csv_fold_headerline : -1]
|
||||||
|
let pat1 = escape(s:nr_format[1], '.').'\zs[^'.s:nr_format[1].']*\ze'.
|
||||||
|
\ (has_delimiter ? b:delimiter : '').'$'
|
||||||
|
let pat2 = '\d\+\ze\%(\%('.escape(s:nr_format[1], '.'). '\d\+\)\|'.
|
||||||
|
\ (has_delimiter ? b:delimiter : '').'$\)'
|
||||||
|
let data1 = map(copy(data), 'matchstr(v:val, pat1)')
|
||||||
|
let data2 = map(data, 'matchstr(v:val, pat2)')
|
||||||
|
" strlen should be okay for decimals...
|
||||||
|
let data1 = map(data1, 'strlen(v:val)')
|
||||||
|
let data2 = map(data2, 'strlen(v:val)')
|
||||||
|
let dec = max(data1)
|
||||||
|
let scal = max(data2)
|
||||||
|
if dec + scal + 1 + (has_delimiter ? 1 : 0) > width
|
||||||
|
let width = dec + scal + 1 + (has_delimiter ? 1 :0)
|
||||||
|
let b:col_width[colnr] = width
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:decimal_column[colnr] = dec
|
||||||
else
|
else
|
||||||
|
let dec = get(s:decimal_column, colnr)
|
||||||
|
endif
|
||||||
|
let field = (has_delimiter ? a:field[:-2] : a:field)
|
||||||
|
let fmt = printf("%%%d.%df", width+1, dec)
|
||||||
|
try
|
||||||
|
if s:nr_format[1] isnot '.'
|
||||||
|
let field = substitute(field, s:nr_format[1], '.', 'g')
|
||||||
|
let field = substitute(field, s:nr_format[0], '', 'g')
|
||||||
|
endif
|
||||||
|
if field =~? '\h' " text in the column, can't be converted to float
|
||||||
|
throw "no decimal"
|
||||||
|
endif
|
||||||
|
let result = printf(fmt, str2float(field)). (has_delimiter ? b:delimiter : ' ')
|
||||||
|
catch
|
||||||
|
let result = printf("%*S", width+2, a:field)
|
||||||
|
endtry
|
||||||
|
return result
|
||||||
|
else
|
||||||
|
" right align
|
||||||
return printf("%*S", width+1 , a:field)
|
return printf("%*S", width+1 , a:field)
|
||||||
endif
|
endif
|
||||||
else
|
|
||||||
" printf only handles bytes
|
|
||||||
if !exists("g:csv_no_multibyte") &&
|
|
||||||
\ match(a:field, '[^ -~]') != -1
|
|
||||||
" match characters outside the ascii range
|
|
||||||
let a = split(a:field, '\zs')
|
|
||||||
let add = eval(join(map(a, 'len(v:val)'), '+'))
|
|
||||||
let add -= len(a)
|
|
||||||
else
|
|
||||||
let add = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Add one for the frame
|
|
||||||
" plus additional width for multibyte chars,
|
|
||||||
" since printf(%*s..) uses byte width!
|
|
||||||
let width = width + add + 1
|
|
||||||
|
|
||||||
if width == strlen(a:field)
|
|
||||||
" Column has correct length, don't use printf()
|
|
||||||
return a:field
|
|
||||||
else
|
|
||||||
if get(b:, 'csv_arrange_leftalign',0)
|
|
||||||
" left-align content
|
|
||||||
return printf("%-*s%s", width,
|
|
||||||
\ (has_delimiter ? matchstr(a:field, '.*\%('.b:delimiter.'\)\@=') : a:field),
|
|
||||||
\ (has_delimiter ? b:delimiter : ''))
|
|
||||||
else
|
|
||||||
return printf("%*s", width , a:field)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
fu! <sid>GetColPat(colnr, zs_flag) "{{{3
|
fu! <sid>GetColPat(colnr, zs_flag) "{{{3
|
||||||
@@ -823,14 +874,13 @@ fu! <sid>GetColPat(colnr, zs_flag) "{{{3
|
|||||||
return pat . (a:zs_flag ? '\zs' : '')
|
return pat . (a:zs_flag ? '\zs' : '')
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
fu! <sid>SetupQuitPre(window) "{{{3
|
fu! <sid>SetupAutoCmd(window,bufnr) "{{{3
|
||||||
" Setup QuitPre autocommand to quit cleanly
|
" Setup QuitPre autocommand to quit cleanly
|
||||||
if exists("##QuitPre")
|
aug CSV_QuitPre
|
||||||
augroup CSV_QuitPre
|
|
||||||
au!
|
au!
|
||||||
exe "au QuitPre * call CSV_CloseBuffer(".winbufnr(a:window).")"
|
exe "au QuitPre * call CSV_CloseBuffer(".winbufnr(a:window).")"
|
||||||
augroup end
|
exe "au CursorHold <buffer=".a:bufnr."> call CSV_SetSplitOptions(".a:window.")"
|
||||||
endif
|
aug END
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
fu! <sid>SplitHeaderLine(lines, bang, hor) "{{{3
|
fu! <sid>SplitHeaderLine(lines, bang, hor) "{{{3
|
||||||
@@ -851,8 +901,9 @@ fu! <sid>SplitHeaderLine(lines, bang, hor) "{{{3
|
|||||||
let _sbo = &sbo
|
let _sbo = &sbo
|
||||||
let a = []
|
let a = []
|
||||||
let b=b:col
|
let b=b:col
|
||||||
|
let bufnr = bufnr('.')
|
||||||
if a:hor
|
if a:hor
|
||||||
setl scrollopt=hor scrollbind
|
setl scrollopt=hor scrollbind cursorbind
|
||||||
let _fdc = &l:fdc
|
let _fdc = &l:fdc
|
||||||
let lines = empty(a:lines) ? s:csv_fold_headerline : a:lines
|
let lines = empty(a:lines) ? s:csv_fold_headerline : a:lines
|
||||||
let a = getline(1,lines)
|
let a = getline(1,lines)
|
||||||
@@ -865,16 +916,21 @@ fu! <sid>SplitHeaderLine(lines, bang, hor) "{{{3
|
|||||||
"setl syntax=csv
|
"setl syntax=csv
|
||||||
sil! doautocmd FileType csv
|
sil! doautocmd FileType csv
|
||||||
noa 1
|
noa 1
|
||||||
|
sil! sign unplace *
|
||||||
exe "resize" . lines
|
exe "resize" . lines
|
||||||
setl scrollopt=hor winfixheight nowrap
|
setl scrollopt=hor winfixheight nowrap cursorbind
|
||||||
"let &l:stl=repeat(' ', winwidth(0))
|
|
||||||
let &l:stl="%#Normal#".repeat(' ',winwidth(0))
|
let &l:stl="%#Normal#".repeat(' ',winwidth(0))
|
||||||
|
let s:local_stl = &l:stl
|
||||||
" set the foldcolumn to the same of the other window
|
" set the foldcolumn to the same of the other window
|
||||||
let &l:fdc = _fdc
|
let &l:fdc = _fdc
|
||||||
else
|
else
|
||||||
setl scrollopt=ver scrollbind
|
setl scrollopt=ver scrollbind cursorbind
|
||||||
noa 0
|
noa 0
|
||||||
let a=<sid>CopyCol('',1,a:lines)
|
if a:lines[-1:] is? '!'
|
||||||
|
let a=<sid>CopyCol('',a:lines,'')
|
||||||
|
else
|
||||||
|
let a=<sid>CopyCol('',1, a:lines-1)
|
||||||
|
endif
|
||||||
" Does it make sense to use the preview window?
|
" Does it make sense to use the preview window?
|
||||||
"vert sil! pedit |wincmd w | enew!
|
"vert sil! pedit |wincmd w | enew!
|
||||||
above vsp +enew
|
above vsp +enew
|
||||||
@@ -889,12 +945,15 @@ fu! <sid>SplitHeaderLine(lines, bang, hor) "{{{3
|
|||||||
syn clear
|
syn clear
|
||||||
noa 0
|
noa 0
|
||||||
let b:csv_SplitWindow = winnr()
|
let b:csv_SplitWindow = winnr()
|
||||||
sil :call <sid>ArrangeCol(1,line('$'), 1)
|
sil :call <sid>ArrangeCol(1,line('$'), 1, -1)
|
||||||
|
sil! sign unplace *
|
||||||
exe "vert res" . len(split(getline(1), '\zs'))
|
exe "vert res" . len(split(getline(1), '\zs'))
|
||||||
call matchadd("CSVHeaderLine", b:col)
|
call matchadd("CSVHeaderLine", b:col)
|
||||||
setl scrollopt=ver winfixwidth
|
setl scrollopt=ver winfixwidth cursorbind nonu nornu fdc=0
|
||||||
endif
|
endif
|
||||||
call <sid>SetupQuitPre(winnr())
|
call <sid>SetupAutoCmd(winnr(),bufnr)
|
||||||
|
" disable airline
|
||||||
|
let w:airline_disabled = 1
|
||||||
let win = winnr()
|
let win = winnr()
|
||||||
setl scrollbind buftype=nowrite bufhidden=wipe noswapfile nobuflisted
|
setl scrollbind buftype=nowrite bufhidden=wipe noswapfile nobuflisted
|
||||||
noa wincmd p
|
noa wincmd p
|
||||||
@@ -915,9 +974,9 @@ fu! <sid>SplitHeaderLine(lines, bang, hor) "{{{3
|
|||||||
if exists("_sbo")
|
if exists("_sbo")
|
||||||
let &sbo = _sbo
|
let &sbo = _sbo
|
||||||
endif
|
endif
|
||||||
setl noscrollbind
|
setl noscrollbind nocursorbind
|
||||||
try
|
try
|
||||||
wincmd c
|
noa wincmd c
|
||||||
catch /^Vim\%((\a\+)\)\=:E444/ " cannot close last window
|
catch /^Vim\%((\a\+)\)\=:E444/ " cannot close last window
|
||||||
catch /^Vim\%((\a\+)\)\=:E517/ " buffer already wiped
|
catch /^Vim\%((\a\+)\)\=:E517/ " buffer already wiped
|
||||||
" no-op
|
" no-op
|
||||||
@@ -973,6 +1032,9 @@ fu! <sid>MoveCol(forward, line, ...) "{{{3
|
|||||||
elseif line > line('$')
|
elseif line > line('$')
|
||||||
let line=line('$')
|
let line=line('$')
|
||||||
endif
|
endif
|
||||||
|
if foldclosed(line) != -1
|
||||||
|
let line = line > line('.') ? foldclosedend(line) : foldclosed(line)
|
||||||
|
endif
|
||||||
|
|
||||||
" Generate search pattern
|
" Generate search pattern
|
||||||
if colnr == 1
|
if colnr == 1
|
||||||
@@ -1586,12 +1648,6 @@ fu! <sid>DisableFolding() "{{{3
|
|||||||
endif
|
endif
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
fu! <sid>DetermineSID()
|
|
||||||
let s:SID = matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_DetermineSID$')
|
|
||||||
endfu
|
|
||||||
call s:DetermineSID()
|
|
||||||
delf s:DetermineSID
|
|
||||||
|
|
||||||
fu! <sid>NumberFormat() "{{{3
|
fu! <sid>NumberFormat() "{{{3
|
||||||
let s:nr_format = [',', '.']
|
let s:nr_format = [',', '.']
|
||||||
if exists("b:csv_thousands_sep")
|
if exists("b:csv_thousands_sep")
|
||||||
@@ -1629,7 +1685,7 @@ fu! <sid>AnalyzeColumn(...) "{{{3
|
|||||||
let qty = len(data)
|
let qty = len(data)
|
||||||
let res = {}
|
let res = {}
|
||||||
for item in data
|
for item in data
|
||||||
if empty(item)
|
if empty(item) || item ==# b:delimiter
|
||||||
let item = 'NULL'
|
let item = 'NULL'
|
||||||
endif
|
endif
|
||||||
if !get(res, item)
|
if !get(res, item)
|
||||||
@@ -1886,12 +1942,13 @@ fu! <sid>CommandDefinitions() "{{{3
|
|||||||
call <sid>LocalCmd("DeleteColumn", ':call <sid>DeleteColumn(<q-args>)',
|
call <sid>LocalCmd("DeleteColumn", ':call <sid>DeleteColumn(<q-args>)',
|
||||||
\ '-nargs=? -complete=custom,<sid>SortComplete')
|
\ '-nargs=? -complete=custom,<sid>SortComplete')
|
||||||
call <sid>LocalCmd("ArrangeColumn",
|
call <sid>LocalCmd("ArrangeColumn",
|
||||||
\ ':call <sid>ArrangeCol(<line1>, <line2>, <bang>0)',
|
\ ':call <sid>ArrangeCol(<line1>, <line2>, <bang>0, -1)',
|
||||||
\ '-range -bang')
|
\ '-range -bang')
|
||||||
call <sid>LocalCmd("UnArrangeColumn",
|
call <sid>LocalCmd("UnArrangeColumn",
|
||||||
\':call <sid>PrepUnArrangeCol(<line1>, <line2>)',
|
\':call <sid>PrepUnArrangeCol(<line1>, <line2>)',
|
||||||
\ '-range')
|
\ '-range')
|
||||||
call <sid>LocalCmd("InitCSV", ':call <sid>Init(<line1>,<line2>)', '-range=%')
|
call <sid>LocalCmd("InitCSV", ':call <sid>Init(<line1>,<line2>,<bang>0)',
|
||||||
|
\ '-bang -range=%')
|
||||||
call <sid>LocalCmd('Header',
|
call <sid>LocalCmd('Header',
|
||||||
\ ':call <sid>SplitHeaderLine(<q-args>,<bang>0,1)',
|
\ ':call <sid>SplitHeaderLine(<q-args>,<bang>0,1)',
|
||||||
\ '-nargs=? -bang')
|
\ '-nargs=? -bang')
|
||||||
@@ -1926,7 +1983,7 @@ fu! <sid>CommandDefinitions() "{{{3
|
|||||||
call <sid>LocalCmd("CSVFixed", ':call <sid>InitCSVFixedWidth()', '')
|
call <sid>LocalCmd("CSVFixed", ':call <sid>InitCSVFixedWidth()', '')
|
||||||
call <sid>LocalCmd("NewRecord", ':call <sid>NewRecord(<line1>,
|
call <sid>LocalCmd("NewRecord", ':call <sid>NewRecord(<line1>,
|
||||||
\ <line2>, <q-args>)', '-nargs=? -range')
|
\ <line2>, <q-args>)', '-nargs=? -range')
|
||||||
call <sid>LocalCmd("NewDelimiter", ':call <sid>NewDelimiter(<q-args>)',
|
call <sid>LocalCmd("NewDelimiter", ':call <sid>NewDelimiter(<q-args>, 1, line(''$''))',
|
||||||
\ '-nargs=1')
|
\ '-nargs=1')
|
||||||
call <sid>LocalCmd("Duplicates", ':call <sid>CheckDuplicates(<q-args>)',
|
call <sid>LocalCmd("Duplicates", ':call <sid>CheckDuplicates(<q-args>)',
|
||||||
\ '-nargs=1 -complete=custom,<sid>CompleteColumnNr')
|
\ '-nargs=1 -complete=custom,<sid>CompleteColumnNr')
|
||||||
@@ -2013,7 +2070,7 @@ fu! <sid>SaveOptions(list) "{{{3
|
|||||||
return save
|
return save
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
fu! <sid>NewDelimiter(newdelimiter) "{{{3
|
fu! <sid>NewDelimiter(newdelimiter, firstl, lastl) "{{{3
|
||||||
let save = <sid>SaveOptions(['ro', 'ma'])
|
let save = <sid>SaveOptions(['ro', 'ma'])
|
||||||
if exists("b:csv_fixed_width_cols")
|
if exists("b:csv_fixed_width_cols")
|
||||||
call <sid>Warn("NewDelimiter does not work with fixed width column!")
|
call <sid>Warn("NewDelimiter does not work with fixed width column!")
|
||||||
@@ -2025,8 +2082,12 @@ fu! <sid>NewDelimiter(newdelimiter) "{{{3
|
|||||||
if &l:ro
|
if &l:ro
|
||||||
setl noro
|
setl noro
|
||||||
endif
|
endif
|
||||||
let line=1
|
let delimiter = a:newdelimiter
|
||||||
while line <= line('$')
|
if a:newdelimiter is '\t'
|
||||||
|
let delimiter="\t"
|
||||||
|
endif
|
||||||
|
let line=a:firstl
|
||||||
|
while line <= a:lastl
|
||||||
" Don't change delimiter for comments
|
" Don't change delimiter for comments
|
||||||
if getline(line) =~ '^\s*\V'. escape(b:csv_cmt[0], '\\')
|
if getline(line) =~ '^\s*\V'. escape(b:csv_cmt[0], '\\')
|
||||||
let line+=1
|
let line+=1
|
||||||
@@ -2036,7 +2097,7 @@ fu! <sid>NewDelimiter(newdelimiter) "{{{3
|
|||||||
" Remove field delimiter
|
" Remove field delimiter
|
||||||
call map(fields, 'substitute(v:val, b:delimiter .
|
call map(fields, 'substitute(v:val, b:delimiter .
|
||||||
\ ''\?$'' , "", "")')
|
\ ''\?$'' , "", "")')
|
||||||
call setline(line, join(fields, a:newdelimiter))
|
call setline(line, join(fields, delimiter))
|
||||||
let line+=1
|
let line+=1
|
||||||
endwhile
|
endwhile
|
||||||
" reset local buffer options
|
" reset local buffer options
|
||||||
@@ -2044,7 +2105,17 @@ fu! <sid>NewDelimiter(newdelimiter) "{{{3
|
|||||||
call setbufvar('', '&'. key, value)
|
call setbufvar('', '&'. key, value)
|
||||||
endfor
|
endfor
|
||||||
"reinitialize the plugin
|
"reinitialize the plugin
|
||||||
|
if exists("g:csv_delim")
|
||||||
|
let _delim = g:csv_delim
|
||||||
|
endif
|
||||||
|
let g:csv_delim = delimiter
|
||||||
call <sid>Init(1,line('$'))
|
call <sid>Init(1,line('$'))
|
||||||
|
if exists("_delim")
|
||||||
|
let g:csv_delim = _delim
|
||||||
|
else
|
||||||
|
unlet g:csv_delim
|
||||||
|
endif
|
||||||
|
unlet! _delim
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
fu! <sid>IN(list, value) "{{{3
|
fu! <sid>IN(list, value) "{{{3
|
||||||
@@ -2199,6 +2270,10 @@ fu! <sid>NrColumns(bang) "{{{3
|
|||||||
endfu
|
endfu
|
||||||
|
|
||||||
fu! <sid>Tabularize(bang, first, last) "{{{3
|
fu! <sid>Tabularize(bang, first, last) "{{{3
|
||||||
|
if match(split(&ft, '\.'),'csv') == -1
|
||||||
|
call <sid>Warn("No CSV filetype, aborting!")
|
||||||
|
return
|
||||||
|
endif
|
||||||
let _c = winsaveview()
|
let _c = winsaveview()
|
||||||
" Table delimiter definition "{{{4
|
" Table delimiter definition "{{{4
|
||||||
if !exists("s:td")
|
if !exists("s:td")
|
||||||
@@ -2227,6 +2302,23 @@ fu! <sid>Tabularize(bang, first, last) "{{{3
|
|||||||
let adjust_last = 0
|
let adjust_last = 0
|
||||||
call cursor(a:first,0)
|
call cursor(a:first,0)
|
||||||
call <sid>CheckHeaderLine()
|
call <sid>CheckHeaderLine()
|
||||||
|
let line=a:first
|
||||||
|
if exists("g:csv_table_leftalign")
|
||||||
|
let b:csv_arrange_leftalign = 1
|
||||||
|
endif
|
||||||
|
let newlines=[]
|
||||||
|
while line <= a:last
|
||||||
|
let curline = getline(line)
|
||||||
|
if empty(split(curline, b:delimiter))
|
||||||
|
" only empty delimiters, add one empty delimiter
|
||||||
|
" (:NewDelimiter strips trailing delimiter
|
||||||
|
let curline = repeat(b:delimiter, <sid>MaxColumns())
|
||||||
|
call add(newlines, line)
|
||||||
|
call setline(line, curline)
|
||||||
|
endif
|
||||||
|
let line+=1
|
||||||
|
endw
|
||||||
|
unlet! line
|
||||||
if exists("b:csv_fixed_width_cols")
|
if exists("b:csv_fixed_width_cols")
|
||||||
let cols=copy(b:csv_fixed_width_cols)
|
let cols=copy(b:csv_fixed_width_cols)
|
||||||
let pat = join(map(cols, ' ''\(\%''. v:val. ''c\)'' '), '\|')
|
let pat = join(map(cols, ' ''\(\%''. v:val. ''c\)'' '), '\|')
|
||||||
@@ -2242,22 +2334,33 @@ fu! <sid>Tabularize(bang, first, last) "{{{3
|
|||||||
else
|
else
|
||||||
" don't clear column width variable, might have been set in the
|
" don't clear column width variable, might have been set in the
|
||||||
" plugin!
|
" plugin!
|
||||||
sil call <sid>ArrangeCol(a:first, a:last, 0)
|
sil call <sid>ArrangeCol(a:first, a:last, 0, -1)
|
||||||
|
if !get(b:, 'csv_arrange_leftalign',0)
|
||||||
|
for line in newlines
|
||||||
|
let cline = getline(line)
|
||||||
|
let cline = substitute(cline, '\s$', ' ', '')
|
||||||
|
call setline(line, cline)
|
||||||
|
endfor
|
||||||
|
unlet! line
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if empty(b:col_width)
|
if empty(b:col_width)
|
||||||
call <sid>Warn('An error occured, aborting!')
|
call <sid>Warn('An error occured, aborting!')
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
if getline(a:first)[-1:] isnot? b:delimiter
|
||||||
let b:col_width[-1] += 1
|
let b:col_width[-1] += 1
|
||||||
|
endif
|
||||||
let marginline = s:td.scol. join(map(copy(b:col_width), 'repeat(s:td.hbar, v:val)'), s:td.cros). s:td.ecol
|
let marginline = s:td.scol. join(map(copy(b:col_width), 'repeat(s:td.hbar, v:val)'), s:td.cros). s:td.ecol
|
||||||
|
|
||||||
exe printf('sil %d,%ds/%s/%s/ge', a:first, (a:last+adjust_last),
|
call <sid>NewDelimiter(s:td.vbar, a:first, a:last+adjust_last)
|
||||||
\ (exists("b:csv_fixed_width_cols") ? pat : b:delimiter ), s:td.vbar)
|
"exe printf('sil %d,%ds/%s/%s/ge', a:first, (a:last+adjust_last),
|
||||||
|
" \ (exists("b:csv_fixed_width_cols") ? pat : b:delimiter ), s:td.vbar)
|
||||||
" Add vertical bar in first column, if there isn't already one
|
" Add vertical bar in first column, if there isn't already one
|
||||||
exe printf('sil %d,%ds/%s/%s/e', a:first, a:last+adjust_last,
|
exe printf('sil %d,%ds/%s/%s/e', a:first, a:last+adjust_last,
|
||||||
\ '^[^'. s:td.vbar. s:td.scol. ']', s:td.vbar.'&')
|
\ '^[^'. s:td.vbar. s:td.scol. ']', s:td.vbar.'&')
|
||||||
" And add a final vertical bar, if there isn't already
|
" And add a final vertical bar, if there isn't one already
|
||||||
exe printf('sil %d,%ds/%s/%s/e', a:first, a:last+adjust_last,
|
exe printf('sil %d,%ds/%s/%s/e', a:first, a:last+adjust_last,
|
||||||
\ '[^'. s:td.vbar. s:td.ecol. ']$', '&'. s:td.vbar)
|
\ '[^'. s:td.vbar. s:td.ecol. ']$', '&'. s:td.vbar)
|
||||||
" Make nice intersection graphs
|
" Make nice intersection graphs
|
||||||
@@ -2267,11 +2370,18 @@ fu! <sid>Tabularize(bang, first, last) "{{{3
|
|||||||
call append(a:first-1, s:td.ltop. join(line, s:td.dhor). s:td.rtop)
|
call append(a:first-1, s:td.ltop. join(line, s:td.dhor). s:td.rtop)
|
||||||
call append(a:last+adjust_last+1, s:td.lbot. join(line, s:td.uhor). s:td.rbot)
|
call append(a:last+adjust_last+1, s:td.lbot. join(line, s:td.uhor). s:td.rbot)
|
||||||
|
|
||||||
if s:csv_fold_headerline > 0 && !a:bang
|
if s:csv_fold_headerline > 0
|
||||||
"call <sid>NewRecord(s:csv_fold_headerline, s:csv_fold_headerline, 1)
|
|
||||||
call append(a:first + s:csv_fold_headerline, marginline)
|
call append(a:first + s:csv_fold_headerline, marginline)
|
||||||
let adjust_last += 1
|
let adjust_last += 1
|
||||||
endif
|
endif
|
||||||
|
" Syntax will be turned off, so disable this part
|
||||||
|
"
|
||||||
|
" Adjust headerline to header of new table
|
||||||
|
"let b:csv_headerline = (exists('b:csv_headerline')?b:csv_headerline+2:3)
|
||||||
|
"call <sid>CheckHeaderLine()
|
||||||
|
" Adjust syntax highlighting
|
||||||
|
"unlet! b:current_syntax
|
||||||
|
"ru syntax/csv.vim
|
||||||
|
|
||||||
if a:bang
|
if a:bang
|
||||||
exe printf('sil %d,%ds/^%s\zs\n/&%s&/e', a:first + s:csv_fold_headerline, a:last + adjust_last,
|
exe printf('sil %d,%ds/^%s\zs\n/&%s&/e', a:first + s:csv_fold_headerline, a:last + adjust_last,
|
||||||
@@ -2398,6 +2508,9 @@ fu! csv#EvalColumn(nr, func, first, last) range "{{{3
|
|||||||
call <sid>CheckHeaderLine()
|
call <sid>CheckHeaderLine()
|
||||||
let nr = matchstr(a:nr, '^\-\?\d\+')
|
let nr = matchstr(a:nr, '^\-\?\d\+')
|
||||||
let col = (empty(nr) ? <sid>WColumn() : nr)
|
let col = (empty(nr) ? <sid>WColumn() : nr)
|
||||||
|
if col == 0
|
||||||
|
let col = 1
|
||||||
|
endif
|
||||||
" don't take the header line into consideration
|
" don't take the header line into consideration
|
||||||
let start = a:first - 1 + s:csv_fold_headerline
|
let start = a:first - 1 + s:csv_fold_headerline
|
||||||
let stop = a:last - 1 + s:csv_fold_headerline
|
let stop = a:last - 1 + s:csv_fold_headerline
|
||||||
@@ -2501,8 +2614,23 @@ fu! CSV_WCol(...) "{{{3
|
|||||||
endtry
|
endtry
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
|
fu! CSV_SetSplitOptions(window) "{{{3
|
||||||
|
if exists("s:local_stl")
|
||||||
|
" local horizontal statusline
|
||||||
|
for opt in items({'&nu': &l:nu, '&rnu': &l:rnu, '&fdc': &fdc})
|
||||||
|
if opt[1] != getwinvar(a:window, opt[0])
|
||||||
|
call setwinvar(a:window, opt[0], opt[1])
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
" Check statusline (airline might change it)
|
||||||
|
if getwinvar(a:window, '&l:stl') != s:local_stl
|
||||||
|
call setwinvar(a:window, '&stl', s:local_stl)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endfun
|
||||||
|
|
||||||
fu! CSV_CloseBuffer(buffer) "{{{3
|
fu! CSV_CloseBuffer(buffer) "{{{3
|
||||||
" Setup by SetupQuitPre autocommand
|
" Setup by SetupAutoCmd autocommand
|
||||||
try
|
try
|
||||||
if bufnr((a:buffer)+0) > -1
|
if bufnr((a:buffer)+0) > -1
|
||||||
exe a:buffer. "bw"
|
exe a:buffer. "bw"
|
||||||
@@ -2517,7 +2645,17 @@ fu! CSV_CloseBuffer(buffer) "{{{3
|
|||||||
endtry
|
endtry
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
|
fu! CSVSum(col, fmt, first, last) "{{{3
|
||||||
|
let first = a:first
|
||||||
|
let last = a:last
|
||||||
|
if empty(first)
|
||||||
|
let first = 1
|
||||||
|
endif
|
||||||
|
if empty(last)
|
||||||
|
let last = line('$')
|
||||||
|
endif
|
||||||
|
return csv#EvalColumn(a:col, '<sid>SumColumn', first, last)
|
||||||
|
endfu
|
||||||
" Initialize Plugin "{{{2
|
" Initialize Plugin "{{{2
|
||||||
let b:csv_start = exists("b:csv_start") ? b:csv_start : 1
|
let b:csv_start = exists("b:csv_start") ? b:csv_start : 1
|
||||||
let b:csv_end = exists("b:csv_end") ? b:csv_end : line('$')
|
let b:csv_end = exists("b:csv_end") ? b:csv_end : line('$')
|
||||||
|
|||||||
91
ftplugin/eelixir.vim
Normal file
91
ftplugin/eelixir.vim
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
" Vim filetype plugin
|
||||||
|
" Language: Embedded Elixir
|
||||||
|
" URL: https://github.com/elixir-lang/vim-elixir
|
||||||
|
|
||||||
|
if exists("b:did_ftplugin")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:save_cpo = &cpo
|
||||||
|
set cpo-=C
|
||||||
|
|
||||||
|
let s:undo_ftplugin = ""
|
||||||
|
let s:browsefilter = "All Files (*.*)\t*.*\n"
|
||||||
|
let s:match_words = ""
|
||||||
|
|
||||||
|
if !exists("g:eelixir_default_subtype")
|
||||||
|
let g:eelixir_default_subtype = "html"
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists("b:eelixir_subtype")
|
||||||
|
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
|
||||||
|
let b:eelixir_subtype = matchstr(s:lines,'eelixir_subtype=\zs\w\+')
|
||||||
|
if b:eelixir_subtype == ''
|
||||||
|
let b:eelixir_subtype = matchstr(&filetype,'^eex\.\zs\w\+')
|
||||||
|
endif
|
||||||
|
if b:eelixir_subtype == ''
|
||||||
|
let b:eelixir_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.eex\|\.eelixir\)\+$','',''),'\.\zs\w\+$')
|
||||||
|
endif
|
||||||
|
if b:eelixir_subtype == 'ex'
|
||||||
|
let b:eelixir_subtype = 'elixir'
|
||||||
|
elseif b:eelixir_subtype == 'exs'
|
||||||
|
let b:eelixir_subtype = 'elixir'
|
||||||
|
elseif b:eelixir_subtype == 'yml'
|
||||||
|
let b:eelixir_subtype = 'yaml'
|
||||||
|
elseif b:eelixir_subtype == 'js'
|
||||||
|
let b:eelixir_subtype = 'javascript'
|
||||||
|
elseif b:eelixir_subtype == 'txt'
|
||||||
|
" Conventional; not a real file type
|
||||||
|
let b:eelixir_subtype = 'text'
|
||||||
|
elseif b:eelixir_subtype == ''
|
||||||
|
let b:eelixir_subtype = g:eelixir_default_subtype
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if exists("b:eelixir_subtype") && b:eelixir_subtype != ''
|
||||||
|
exe "runtime! ftplugin/".b:eelixir_subtype.".vim ftplugin/".b:eelixir_subtype."_*.vim ftplugin/".b:eelixir_subtype."/*.vim"
|
||||||
|
else
|
||||||
|
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
|
||||||
|
endif
|
||||||
|
unlet! b:did_ftplugin
|
||||||
|
|
||||||
|
" Override our defaults if these were set by an included ftplugin.
|
||||||
|
if exists("b:undo_ftplugin")
|
||||||
|
let s:undo_ftplugin = b:undo_ftplugin
|
||||||
|
unlet b:undo_ftplugin
|
||||||
|
endif
|
||||||
|
if exists("b:browsefilter")
|
||||||
|
let s:browsefilter = b:browsefilter
|
||||||
|
unlet b:browsefilter
|
||||||
|
endif
|
||||||
|
if exists("b:match_words")
|
||||||
|
let s:match_words = b:match_words
|
||||||
|
unlet b:match_words
|
||||||
|
endif
|
||||||
|
|
||||||
|
runtime! ftplugin/elixir.vim ftplugin/elixir_*.vim ftplugin/elixir/*.vim
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
" Combine the new set of values with those previously included.
|
||||||
|
if exists("b:undo_ftplugin")
|
||||||
|
let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin
|
||||||
|
endif
|
||||||
|
if exists ("b:browsefilter")
|
||||||
|
let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter
|
||||||
|
endif
|
||||||
|
if exists("b:match_words")
|
||||||
|
let s:match_words = b:match_words . ',' . s:match_words
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Load the combined list of match_words for matchit.vim
|
||||||
|
if exists("loaded_matchit")
|
||||||
|
let b:match_words = s:match_words
|
||||||
|
endif
|
||||||
|
|
||||||
|
setlocal comments=:<%#
|
||||||
|
setlocal commentstring=<%#\ %s\ %>
|
||||||
|
|
||||||
|
let b:undo_ftplugin = "setl cms< "
|
||||||
|
\ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
|
||||||
|
|
||||||
|
let &cpo = s:save_cpo
|
||||||
@@ -1,151 +0,0 @@
|
|||||||
" Vim ftplugin file
|
|
||||||
" Language: Erlang
|
|
||||||
" Maintainer: Oscar Hellström <oscar@oscarh.net>
|
|
||||||
" URL: http://personal.oscarh.net
|
|
||||||
" Contributor: Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
|
||||||
" Version: 2010-09-03
|
|
||||||
" ------------------------------------------------------------------------------
|
|
||||||
" Usage:
|
|
||||||
"
|
|
||||||
" To enable folding put in your vimrc:
|
|
||||||
" set foldenable
|
|
||||||
"
|
|
||||||
" Folding will make only one fold for a complete function, even though it has
|
|
||||||
" more than one function head and body.
|
|
||||||
"
|
|
||||||
" To change this behaviour put in your vimrc file:
|
|
||||||
" let g:erlangFoldSplitFunction=1
|
|
||||||
"
|
|
||||||
" ------------------------------------------------------------------------------
|
|
||||||
" Plugin init
|
|
||||||
if exists("b:did_ftplugin")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Don't load any other
|
|
||||||
let b:did_ftplugin=1
|
|
||||||
|
|
||||||
if exists('s:doneFunctionDefinitions')
|
|
||||||
call s:SetErlangOptions()
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:doneFunctionDefinitions=1
|
|
||||||
|
|
||||||
" Local settings
|
|
||||||
function s:SetErlangOptions()
|
|
||||||
compiler erlang
|
|
||||||
if version >= 700
|
|
||||||
setlocal omnifunc=erlangcomplete#Complete
|
|
||||||
endif
|
|
||||||
|
|
||||||
setlocal foldmethod=expr
|
|
||||||
setlocal foldexpr=GetErlangFold(v:lnum)
|
|
||||||
setlocal foldtext=ErlangFoldText()
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Define folding functions
|
|
||||||
if !exists("*GetErlangFold")
|
|
||||||
" Folding params
|
|
||||||
let s:ErlangFunBegin = '^\a\w*(.*$'
|
|
||||||
let s:ErlangFunEnd = '^[^%]*\.\s*\(%.*\)\?$'
|
|
||||||
let s:ErlangBlankLine = '^\s*\(%.*\)\?$'
|
|
||||||
|
|
||||||
" Auxiliary fold functions
|
|
||||||
function s:GetNextNonBlank(lnum)
|
|
||||||
let lnum = nextnonblank(a:lnum + 1)
|
|
||||||
let line = getline(lnum)
|
|
||||||
while line =~ s:ErlangBlankLine && 0 != lnum
|
|
||||||
let lnum = nextnonblank(lnum + 1)
|
|
||||||
let line = getline(lnum)
|
|
||||||
endwhile
|
|
||||||
return lnum
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function s:GetFunName(str)
|
|
||||||
return matchstr(a:str, '^\a\w*(\@=')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function s:GetFunArgs(str, lnum)
|
|
||||||
let str = a:str
|
|
||||||
let lnum = a:lnum
|
|
||||||
while str !~ '->\s*\(%.*\)\?$'
|
|
||||||
let lnum = s:GetNextNonBlank(lnum)
|
|
||||||
if 0 == lnum " EOF
|
|
||||||
return ""
|
|
||||||
endif
|
|
||||||
let str .= getline(lnum)
|
|
||||||
endwhile
|
|
||||||
return matchstr(str,
|
|
||||||
\ '\(^(\s*\)\@<=.*\(\s*)\(\s\+when\s\+.*\)\?\s\+->\s*\(%.*\)\?$\)\@=')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function s:CountFunArgs(arguments)
|
|
||||||
let pos = 0
|
|
||||||
let ac = 0 " arg count
|
|
||||||
let arguments = a:arguments
|
|
||||||
|
|
||||||
" Change list / tuples into just one A(rgument)
|
|
||||||
let erlangTuple = '{\([A-Za-z_,|=\-\[\]]\|\s\)*}'
|
|
||||||
let erlangList = '\[\([A-Za-z_,|=\-{}]\|\s\)*\]'
|
|
||||||
|
|
||||||
" FIXME: Use searchpair?
|
|
||||||
while arguments =~ erlangTuple
|
|
||||||
let arguments = substitute(arguments, erlangTuple, "A", "g")
|
|
||||||
endwhile
|
|
||||||
" FIXME: Use searchpair?
|
|
||||||
while arguments =~ erlangList
|
|
||||||
let arguments = substitute(arguments, erlangList, "A", "g")
|
|
||||||
endwhile
|
|
||||||
|
|
||||||
let len = strlen(arguments)
|
|
||||||
while pos < len && pos > -1
|
|
||||||
let ac += 1
|
|
||||||
let pos = matchend(arguments, ',\s*', pos)
|
|
||||||
endwhile
|
|
||||||
return ac
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Main fold function
|
|
||||||
function GetErlangFold(lnum)
|
|
||||||
let lnum = a:lnum
|
|
||||||
let line = getline(lnum)
|
|
||||||
|
|
||||||
if line =~ s:ErlangFunEnd
|
|
||||||
return '<1'
|
|
||||||
endif
|
|
||||||
|
|
||||||
if line =~ s:ErlangFunBegin && foldlevel(lnum - 1) == 1
|
|
||||||
if exists("g:erlangFoldSplitFunction") && g:erlangFoldSplitFunction
|
|
||||||
return '>1'
|
|
||||||
else
|
|
||||||
return '1'
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if line =~ s:ErlangFunBegin
|
|
||||||
return '>1'
|
|
||||||
endif
|
|
||||||
|
|
||||||
return '='
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Erlang fold description (foldtext function)
|
|
||||||
function ErlangFoldText()
|
|
||||||
let foldlen = v:foldend - v:foldstart
|
|
||||||
if 1 < foldlen
|
|
||||||
let lines = "lines"
|
|
||||||
else
|
|
||||||
let lines = "line"
|
|
||||||
endif
|
|
||||||
let line = getline(v:foldstart)
|
|
||||||
let name = s:GetFunName(line)
|
|
||||||
let arguments = s:GetFunArgs(strpart(line, strlen(name)), v:foldstart)
|
|
||||||
let argcount = s:CountFunArgs(arguments)
|
|
||||||
let retval = "+" . v:folddashes . " " . name . "/" . argcount
|
|
||||||
let retval .= " (" . foldlen . " " . lines . ")"
|
|
||||||
return retval
|
|
||||||
endfunction
|
|
||||||
endif
|
|
||||||
|
|
||||||
call s:SetErlangOptions()
|
|
||||||
@@ -1,295 +0,0 @@
|
|||||||
" Erlang refactor file
|
|
||||||
" Language: Erlang
|
|
||||||
" Maintainer: Pawel 'kTT' Salata <rockplayer.pl@gmail.com>
|
|
||||||
" URL: http://ktototaki.info
|
|
||||||
|
|
||||||
if exists("b:did_ftplugin_erlang")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Don't load any other
|
|
||||||
let b:did_ftplugin_erlang=1
|
|
||||||
|
|
||||||
if !exists('g:erlangRefactoring') || g:erlangRefactoring == 0
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:erlangWranglerPath')
|
|
||||||
let g:erlangWranglerPath = '/usr/share/wrangler/'
|
|
||||||
endif
|
|
||||||
|
|
||||||
if glob(g:erlangWranglerPath) == ""
|
|
||||||
call confirm("Wrong path to wrangler dir")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
autocmd VimLeavePre * call StopWranglerServer()
|
|
||||||
|
|
||||||
let s:erlangServerName = "wrangler_vim"
|
|
||||||
|
|
||||||
" Starting background erlang session with wrangler on
|
|
||||||
function! StartWranglerServer()
|
|
||||||
let wranglerEbinDir = g:erlangWranglerPath . "/ebin"
|
|
||||||
let command = "erl_call -s -sname " . s:erlangServerName . " -x 'erl -pa " . wranglerEbinDir . "'"
|
|
||||||
call system(command)
|
|
||||||
call s:send_rpc('application', 'start', '[wrangler_app]')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Stopping erlang session
|
|
||||||
function! StopWranglerServer()
|
|
||||||
echo s:send_rpc('erlang', 'halt', '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Sending rpc call to erlang session
|
|
||||||
function! s:send_rpc(module, fun, args)
|
|
||||||
let command = "erl_call -sname " . s:erlangServerName . " -a '" . a:module . " " . a:fun . " " . a:args . "'"
|
|
||||||
let result = system(command)
|
|
||||||
if match(result, 'erl_call: failed to connect to node .*') != -1
|
|
||||||
call StartWranglerServer()
|
|
||||||
return system(command)
|
|
||||||
endif
|
|
||||||
return result
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ErlangUndo()
|
|
||||||
echo s:send_rpc("wrangler_undo_server", "undo", "[]")
|
|
||||||
:e!
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:trim(text)
|
|
||||||
return substitute(a:text, "^\\s\\+\\|\\s\\+$", "", "g")
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:get_msg(result, tuple_start)
|
|
||||||
let msg_begin = '{' . a:tuple_start . ','
|
|
||||||
let matching_start = match(a:result, msg_begin)
|
|
||||||
if matching_start != -1
|
|
||||||
return s:trim(matchstr(a:result, '[^}]*', matching_start + strlen(msg_begin)))
|
|
||||||
endif
|
|
||||||
return ""
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Check if there is an error in result
|
|
||||||
function! s:check_for_error(result)
|
|
||||||
let msg = s:get_msg(a:result, 'ok')
|
|
||||||
if msg != ""
|
|
||||||
return [0, msg]
|
|
||||||
endif
|
|
||||||
let msg = s:get_msg(a:result, 'warning')
|
|
||||||
if msg != ""
|
|
||||||
return [1, msg]
|
|
||||||
endif
|
|
||||||
let msg = s:get_msg(a:result, 'error')
|
|
||||||
if msg != ""
|
|
||||||
return [2, msg]
|
|
||||||
endif
|
|
||||||
return [-1, ""]
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Sending apply changes to file
|
|
||||||
function! s:send_confirm()
|
|
||||||
let choice = confirm("What do you want?", "&Preview\n&Confirm\nCa&ncel", 0)
|
|
||||||
if choice == 1
|
|
||||||
echo "TODO: Display preview :)"
|
|
||||||
elseif choice == 2
|
|
||||||
let module = 'wrangler_preview_server'
|
|
||||||
let fun = 'commit'
|
|
||||||
let args = '[]'
|
|
||||||
return s:send_rpc(module, fun, args)
|
|
||||||
else
|
|
||||||
let module = 'wrangler_preview_server'
|
|
||||||
let fun = 'abort'
|
|
||||||
let args = '[]'
|
|
||||||
return s:send_rpc(module, fun, args)
|
|
||||||
echo "Canceled"
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Manually send confirm, for testing purpose only
|
|
||||||
function! SendConfirm()
|
|
||||||
echo s:send_confirm()
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Format and send function extracton call
|
|
||||||
function! s:call_extract(start_line, start_col, end_line, end_col, name)
|
|
||||||
let file = expand("%:p")
|
|
||||||
let module = 'wrangler'
|
|
||||||
let fun = 'fun_extraction'
|
|
||||||
let args = '["' . file . '", {' . a:start_line . ', ' . a:start_col . '}, {' . a:end_line . ', ' . a:end_col . '}, "' . a:name . '", ' . &sw . ']'
|
|
||||||
let result = s:send_rpc(module, fun, args)
|
|
||||||
let [error_code, msg] = s:check_for_error(result)
|
|
||||||
if error_code != 0
|
|
||||||
call confirm(msg)
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
echo "This files will be changed: " . matchstr(msg, "[^]]*", 1)
|
|
||||||
echo s:send_confirm()
|
|
||||||
return 1
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ErlangExtractFunction(mode) range
|
|
||||||
silent w!
|
|
||||||
let name = inputdialog("New function name: ")
|
|
||||||
if name != ""
|
|
||||||
if a:mode == "v"
|
|
||||||
let start_pos = getpos("'<")
|
|
||||||
let start_line = start_pos[1]
|
|
||||||
let start_col = start_pos[2]
|
|
||||||
|
|
||||||
let end_pos = getpos("'>")
|
|
||||||
let end_line = end_pos[1]
|
|
||||||
let end_col = end_pos[2]
|
|
||||||
elseif a:mode == "n"
|
|
||||||
let pos = getpos(".")
|
|
||||||
let start_line = pos[1]
|
|
||||||
let start_col = pos[2]
|
|
||||||
let end_line = pos[1]
|
|
||||||
let end_col = pos[2]
|
|
||||||
else
|
|
||||||
echo "Mode not supported."
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
if s:call_extract(start_line, start_col, end_line, end_col, name)
|
|
||||||
let temp = &autoread
|
|
||||||
set autoread
|
|
||||||
:e
|
|
||||||
if temp == 0
|
|
||||||
set noautoread
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
echo "Empty function name. Ignoring."
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
nmap <A-r>e :call ErlangExtractFunction("n")<ENTER>
|
|
||||||
vmap <A-r>e :call ErlangExtractFunction("v")<ENTER>
|
|
||||||
|
|
||||||
function! s:call_rename(mode, line, col, name, search_path)
|
|
||||||
let file = expand("%:p")
|
|
||||||
let module = 'wrangler'
|
|
||||||
let fun = 'rename_' . a:mode
|
|
||||||
let args = '["' . file .'", '
|
|
||||||
if a:mode != "mod"
|
|
||||||
let args = args . a:line . ', ' . a:col . ', '
|
|
||||||
endif
|
|
||||||
let args = args . '"' . a:name . '", ["' . a:search_path . '"], ' . &sw . ']'
|
|
||||||
let result = s:send_rpc(module, fun, args)
|
|
||||||
let [error_code, msg] = s:check_for_error(result)
|
|
||||||
if error_code != 0
|
|
||||||
call confirm(msg)
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
echo "This files will be changed: " . matchstr(msg, "[^]]*", 1)
|
|
||||||
echo s:send_confirm()
|
|
||||||
return 1
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ErlangRename(mode)
|
|
||||||
silent w!
|
|
||||||
if a:mode == "mod"
|
|
||||||
let name = inputdialog('Rename module to: ')
|
|
||||||
else
|
|
||||||
let name = inputdialog('Rename "' . expand("<cword>") . '" to: ')
|
|
||||||
endif
|
|
||||||
if name != ""
|
|
||||||
let search_path = expand("%:p:h")
|
|
||||||
"let search_path = inputdialog('Search path: ', expand("%:p:h"))
|
|
||||||
let pos = getpos(".")
|
|
||||||
let line = pos[1]
|
|
||||||
let col = pos[2]
|
|
||||||
let current_filename = expand("%")
|
|
||||||
let current_filepath = expand("%:p")
|
|
||||||
let new_filename = name . '.erl'
|
|
||||||
if s:call_rename(a:mode, line, col, name, search_path)
|
|
||||||
if a:mode == "mod"
|
|
||||||
execute ':bd ' . current_filename
|
|
||||||
execute ':e ' . new_filename
|
|
||||||
silent execute '!mv ' . current_filepath . ' ' . current_filepath . '.bak'
|
|
||||||
redraw!
|
|
||||||
else
|
|
||||||
let temp = &autoread
|
|
||||||
set autoread
|
|
||||||
:e
|
|
||||||
if temp == 0
|
|
||||||
set noautoread
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
echo "Empty name. Ignoring."
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ErlangRenameFunction()
|
|
||||||
call ErlangRename("fun")
|
|
||||||
endfunction
|
|
||||||
map <A-r>f :call ErlangRenameFunction()<ENTER>
|
|
||||||
|
|
||||||
function! ErlangRenameVariable()
|
|
||||||
call ErlangRename("var")
|
|
||||||
endfunction
|
|
||||||
map <A-r>v :call ErlangRenameVariable()<ENTER>
|
|
||||||
|
|
||||||
function! ErlangRenameModule()
|
|
||||||
call ErlangRename("mod")
|
|
||||||
endfunction
|
|
||||||
map <A-r>m :call ErlangRenameModule()<ENTER>
|
|
||||||
|
|
||||||
function! ErlangRenameProcess()
|
|
||||||
call ErlangRename("process")
|
|
||||||
endfunction
|
|
||||||
map <A-r>p :call ErlangRenameProcess()<ENTER>
|
|
||||||
|
|
||||||
function! s:call_tuple_fun_args(start_line, start_col, end_line, end_col, search_path)
|
|
||||||
let file = expand("%:p")
|
|
||||||
let module = 'wrangler'
|
|
||||||
let fun = 'tuple_funpar'
|
|
||||||
let args = '["' . file . '", {' . a:start_line . ', ' . a:start_col . '}, {' . a:end_line . ', ' . a:end_col . '}, ["' . a:search_path . '"], ' . &sw . ']'
|
|
||||||
let result = s:send_rpc(module, fun, args)
|
|
||||||
if s:check_for_error(result)
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
call s:send_confirm()
|
|
||||||
return 1
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ErlangTupleFunArgs(mode)
|
|
||||||
silent w!
|
|
||||||
let search_path = expand("%:p:h")
|
|
||||||
"let search_path = inputdialog('Search path: ', expand("%:p:h"))
|
|
||||||
if a:mode == "v"
|
|
||||||
let start_pos = getpos("'<")
|
|
||||||
let start_line = start_pos[1]
|
|
||||||
let start_col = start_pos[2]
|
|
||||||
|
|
||||||
let end_pos = getpos("'>")
|
|
||||||
let end_line = end_pos[1]
|
|
||||||
let end_col = end_pos[2]
|
|
||||||
if s:call_tuple_fun_args(start_line, start_col, end_line, end_col, search_path)
|
|
||||||
let temp = &autoread
|
|
||||||
set autoread
|
|
||||||
:e
|
|
||||||
if temp == 0
|
|
||||||
set noautoread
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
elseif a:mode == "n"
|
|
||||||
let pos = getpos(".")
|
|
||||||
let line = pos[1]
|
|
||||||
let col = pos[2]
|
|
||||||
if s:call_tuple_fun_args(line, col, line, col, search_path)
|
|
||||||
let temp = &autoread
|
|
||||||
set autoread
|
|
||||||
:e
|
|
||||||
if temp == 0
|
|
||||||
set noautoread
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
echo "Mode not supported."
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
nmap <A-r>t :call ErlangTupleFunArgs("n")<ENTER>
|
|
||||||
vmap <A-r>t :call ErlangTupleFunArgs("v")<ENTER>
|
|
||||||
|
|
||||||
" vim: set foldmethod=marker:
|
|
||||||
@@ -27,7 +27,7 @@ elseif !exists("b:eruby_subtype")
|
|||||||
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
|
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
|
||||||
let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+')
|
let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+')
|
||||||
if b:eruby_subtype == ''
|
if b:eruby_subtype == ''
|
||||||
let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+$')
|
let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+\%(\ze+\w\+\)\=$')
|
||||||
endif
|
endif
|
||||||
if b:eruby_subtype == 'rhtml'
|
if b:eruby_subtype == 'rhtml'
|
||||||
let b:eruby_subtype = 'html'
|
let b:eruby_subtype = 'html'
|
||||||
|
|||||||
@@ -4,4 +4,4 @@
|
|||||||
" License: MIT
|
" License: MIT
|
||||||
" Changes: Add - to keyword
|
" Changes: Add - to keyword
|
||||||
|
|
||||||
setlocal iskeyword+=-
|
" setlocal iskeyword+=-
|
||||||
|
|||||||
@@ -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?
|
||||||
@@ -229,13 +239,19 @@ 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 g:LatexBox_viewer = ''
|
let s:viewer = ''
|
||||||
|
if has('unix')
|
||||||
|
" echo -n necessary as uname -s will append \n otherwise
|
||||||
|
let s:uname = system('echo -n $(uname -s)')
|
||||||
|
if s:uname == "Darwin"
|
||||||
|
let s:viewer = 'open'
|
||||||
else
|
else
|
||||||
let g:LatexBox_viewer = 'xdg-open'
|
let s:viewer = 'xdg-open'
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
let g:LatexBox_viewer = s:viewer
|
||||||
|
endif
|
||||||
|
|
||||||
function! LatexBox_View(...)
|
function! LatexBox_View(...)
|
||||||
let lvargs = join(a:000, ' ')
|
let lvargs = join(a:000, ' ')
|
||||||
|
|||||||
@@ -367,6 +367,7 @@ function! s:ExtractLabels()
|
|||||||
|
|
||||||
" Ignore cref entries (because they are duplicates)
|
" Ignore cref entries (because they are duplicates)
|
||||||
if curname =~# "@cref$"
|
if curname =~# "@cref$"
|
||||||
|
let [lblline, lblbegin] = searchpos( '\\newlabel{', 'ecW' )
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -458,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
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ function! LatexBox_GetMainFileName(...)
|
|||||||
" move up the directory tree until we find a .latexmain file.
|
" move up the directory tree until we find a .latexmain file.
|
||||||
" TODO: Should we be doing this recursion by default, or should there be a
|
" TODO: Should we be doing this recursion by default, or should there be a
|
||||||
" setting?
|
" setting?
|
||||||
while glob('*.latexmain') == ''
|
while glob('*.latexmain',1) == ''
|
||||||
let dirmodifier = dirmodifier.':h'
|
let dirmodifier = dirmodifier.':h'
|
||||||
let dirNew = fnameescape(expand(dirmodifier))
|
let dirNew = fnameescape(expand(dirmodifier))
|
||||||
" break from the loop if we cannot go up any further.
|
" break from the loop if we cannot go up any further.
|
||||||
@@ -41,7 +41,7 @@ function! LatexBox_GetMainFileName(...)
|
|||||||
exe 'cd '.dirLast
|
exe 'cd '.dirLast
|
||||||
endwhile
|
endwhile
|
||||||
|
|
||||||
let lheadfile = glob('*.latexmain')
|
let lheadfile = glob('*.latexmain',1)
|
||||||
if lheadfile != ''
|
if lheadfile != ''
|
||||||
" Remove the trailing .latexmain part of the filename... We never want
|
" Remove the trailing .latexmain part of the filename... We never want
|
||||||
" that.
|
" that.
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -156,7 +156,7 @@ let s:notcomment = '\%(\%(\\\@<!\%(\\\\\)*\)\@<=%.*\)\@<!'
|
|||||||
let s:envbeginpattern = s:notcomment . s:notbslash . '\\begin\s*{.\{-}}'
|
let s:envbeginpattern = s:notcomment . s:notbslash . '\\begin\s*{.\{-}}'
|
||||||
let s:envendpattern = s:notcomment . s:notbslash . '\\end\s*{.\{-}}'
|
let s:envendpattern = s:notcomment . s:notbslash . '\\end\s*{.\{-}}'
|
||||||
let s:foldparts = '^\s*\\\%(' . join(g:LatexBox_fold_parts, '\|') . '\)'
|
let s:foldparts = '^\s*\\\%(' . join(g:LatexBox_fold_parts, '\|') . '\)'
|
||||||
let s:folded = '\(% Fake\|\\\(document\|begin\|end\|'
|
let s:folded = '\(% Fake\|\\\(document\|begin\|end\|paragraph\|'
|
||||||
\ . 'front\|main\|back\|app\|sub\|section\|chapter\|part\)\)'
|
\ . 'front\|main\|back\|app\|sub\|section\|chapter\|part\)\)'
|
||||||
|
|
||||||
function! LatexBox_FoldLevel(lnum)
|
function! LatexBox_FoldLevel(lnum)
|
||||||
@@ -193,6 +193,10 @@ function! LatexBox_FoldLevel(lnum)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Fold environments
|
" Fold environments
|
||||||
|
if line =~# s:envbeginpattern && line =~# s:envendpattern
|
||||||
|
" If the begin and end pattern are on the same line , do not fold
|
||||||
|
return "="
|
||||||
|
else
|
||||||
if line =~# s:envbeginpattern
|
if line =~# s:envbeginpattern
|
||||||
if g:LatexBox_fold_envs == 1
|
if g:LatexBox_fold_envs == 1
|
||||||
return "a1"
|
return "a1"
|
||||||
@@ -216,6 +220,7 @@ function! LatexBox_FoldLevel(lnum)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
" Return foldlevel of previous line
|
" Return foldlevel of previous line
|
||||||
return "="
|
return "="
|
||||||
@@ -288,7 +293,7 @@ function! LatexBox_FoldText_title()
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Parts, sections and fakesections
|
" Parts, sections and fakesections
|
||||||
let sections = '\(\(sub\)*section\|part\|chapter\)'
|
let sections = '\(\(sub\)*\(section\|paragraph\)\|part\|chapter\)'
|
||||||
let secpat1 = '^\s*\\' . sections . '\*\?\s*{'
|
let secpat1 = '^\s*\\' . sections . '\*\?\s*{'
|
||||||
let secpat2 = '^\s*\\' . sections . '\*\?\s*\['
|
let secpat2 = '^\s*\\' . sections . '\*\?\s*\['
|
||||||
if line =~ '\\frontmatter'
|
if line =~ '\\frontmatter'
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ endif
|
|||||||
if ! exists('g:LatexBox_quickfix')
|
if ! exists('g:LatexBox_quickfix')
|
||||||
let g:LatexBox_quickfix = 1
|
let g:LatexBox_quickfix = 1
|
||||||
endif
|
endif
|
||||||
|
if ! exists('g:LatexBox_personal_latexmkrc')
|
||||||
|
let g:LatexBox_personal_latexmkrc = 0
|
||||||
|
endif
|
||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
@@ -177,7 +180,9 @@ function! LatexBox_Latexmk(force)
|
|||||||
let cmd = 'cd ' . texroot . ' && '
|
let cmd = 'cd ' . texroot . ' && '
|
||||||
endif
|
endif
|
||||||
let cmd .= env . ' latexmk'
|
let cmd .= env . ' latexmk'
|
||||||
|
if ! g:LatexBox_personal_latexmkrc
|
||||||
let cmd .= ' -' . g:LatexBox_output_type
|
let cmd .= ' -' . g:LatexBox_output_type
|
||||||
|
endif
|
||||||
let cmd .= ' -quiet '
|
let cmd .= ' -quiet '
|
||||||
let cmd .= g:LatexBox_latexmk_options
|
let cmd .= g:LatexBox_latexmk_options
|
||||||
if a:force
|
if a:force
|
||||||
@@ -438,10 +443,32 @@ function! LatexBox_LatexErrors(status, ...)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Redefine uniq() for compatibility with older Vim versions (< 7.4.218)
|
||||||
|
function! s:uniq(list)
|
||||||
|
if exists('*uniq')
|
||||||
|
return uniq(a:list)
|
||||||
|
elseif len(a:list) <= 1
|
||||||
|
return a:list
|
||||||
|
endif
|
||||||
|
|
||||||
|
let last_element = get(a:list,0)
|
||||||
|
let uniq_list = [last_element]
|
||||||
|
|
||||||
|
for i in range(1, len(a:list)-1)
|
||||||
|
let next_element = get(a:list, i)
|
||||||
|
if last_element == next_element
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
let last_element = next_element
|
||||||
|
call add(uniq_list, next_element)
|
||||||
|
endfor
|
||||||
|
return uniq_list
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:log_contains_error(file)
|
function! s:log_contains_error(file)
|
||||||
let lines = readfile(a:file)
|
let lines = readfile(a:file)
|
||||||
let lines = filter(lines, 'v:val =~ ''^.*:\d\+: ''')
|
let lines = filter(lines, 'v:val =~ ''^.*:\d\+: ''')
|
||||||
let lines = uniq(map(lines, 'matchstr(v:val, ''^.*\ze:\d\+:'')'))
|
let lines = s:uniq(map(lines, 'matchstr(v:val, ''^.*\ze:\d\+:'')'))
|
||||||
let lines = filter(lines, 'filereadable(fnameescape(v:val))')
|
let lines = filter(lines, 'filereadable(fnameescape(v:val))')
|
||||||
return len(lines) > 0
|
return len(lines) > 0
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -5,31 +5,31 @@ if exists("g:LatexBox_no_mappings")
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" latexmk {{{
|
" latexmk {{{
|
||||||
map <buffer> <LocalLeader>ll :Latexmk<CR>
|
noremap <buffer> <LocalLeader>ll :Latexmk<CR>
|
||||||
map <buffer> <LocalLeader>lL :Latexmk!<CR>
|
noremap <buffer> <LocalLeader>lL :Latexmk!<CR>
|
||||||
map <buffer> <LocalLeader>lc :LatexmkClean<CR>
|
noremap <buffer> <LocalLeader>lc :LatexmkClean<CR>
|
||||||
map <buffer> <LocalLeader>lC :LatexmkClean!<CR>
|
noremap <buffer> <LocalLeader>lC :LatexmkClean!<CR>
|
||||||
map <buffer> <LocalLeader>lg :LatexmkStatus<CR>
|
noremap <buffer> <LocalLeader>lg :LatexmkStatus<CR>
|
||||||
map <buffer> <LocalLeader>lG :LatexmkStatus!<CR>
|
noremap <buffer> <LocalLeader>lG :LatexmkStatus!<CR>
|
||||||
map <buffer> <LocalLeader>lk :LatexmkStop<CR>
|
noremap <buffer> <LocalLeader>lk :LatexmkStop<CR>
|
||||||
map <buffer> <LocalLeader>le :LatexErrors<CR>
|
noremap <buffer> <LocalLeader>le :LatexErrors<CR>
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" View {{{
|
" View {{{
|
||||||
map <buffer> <LocalLeader>lv :LatexView<CR>
|
noremap <buffer> <LocalLeader>lv :LatexView<CR>
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" TOC {{{
|
" TOC {{{
|
||||||
map <silent> <buffer> <LocalLeader>lt :LatexTOC<CR>
|
noremap <silent> <buffer> <LocalLeader>lt :LatexTOC<CR>
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" List of labels {{{
|
" List of labels {{{
|
||||||
map <silent> <buffer> <LocalLeader>lj :LatexLabels<CR>
|
noremap <silent> <buffer> <LocalLeader>lj :LatexLabels<CR>
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" Folding {{{
|
" Folding {{{
|
||||||
if g:LatexBox_Folding == 1
|
if g:LatexBox_Folding == 1
|
||||||
map <buffer> <LocalLeader>lf :LatexFold<CR>
|
noremap <buffer> <LocalLeader>lf :LatexFold<CR>
|
||||||
endif
|
endif
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
@@ -44,12 +44,12 @@ endif
|
|||||||
" Define text objects {{{
|
" Define text objects {{{
|
||||||
vmap <buffer> ie <Plug>LatexBox_SelectCurrentEnvInner
|
vmap <buffer> ie <Plug>LatexBox_SelectCurrentEnvInner
|
||||||
vmap <buffer> ae <Plug>LatexBox_SelectCurrentEnvOuter
|
vmap <buffer> ae <Plug>LatexBox_SelectCurrentEnvOuter
|
||||||
omap <buffer> ie :normal vie<CR>
|
onoremap <buffer> ie :normal vie<CR>
|
||||||
omap <buffer> ae :normal vae<CR>
|
onoremap <buffer> ae :normal vae<CR>
|
||||||
vmap <buffer> i$ <Plug>LatexBox_SelectInlineMathInner
|
vmap <buffer> i$ <Plug>LatexBox_SelectInlineMathInner
|
||||||
vmap <buffer> a$ <Plug>LatexBox_SelectInlineMathOuter
|
vmap <buffer> a$ <Plug>LatexBox_SelectInlineMathOuter
|
||||||
omap <buffer> i$ :normal vi$<CR>
|
onoremap <buffer> i$ :normal vi$<CR>
|
||||||
omap <buffer> a$ :normal va$<CR>
|
onoremap <buffer> a$ :normal va$<CR>
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" Jump between sections {{{
|
" Jump between sections {{{
|
||||||
|
|||||||
@@ -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] =~ '^\\\(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')
|
||||||
@@ -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)
|
||||||
|
|||||||
@@ -87,8 +87,12 @@ function! s:TOCActivate(close)
|
|||||||
endfor
|
endfor
|
||||||
|
|
||||||
" Find section in buffer (or inputted files)
|
" Find section in buffer (or inputted files)
|
||||||
call s:TOCFindMatch('\\' . entry['level'] . '\_\s*{' . titlestr . '}',
|
if entry['level'] == 'label'
|
||||||
\ duplicates, files)
|
let re = '\(\\label\_\s*{\|label\s*=\s*\)' . titlestr . '\>'
|
||||||
|
else
|
||||||
|
let re = '\\' . entry['level'] . '\_\s*{' . titlestr . '}'
|
||||||
|
endif
|
||||||
|
call s:TOCFindMatch(re, duplicates, files)
|
||||||
|
|
||||||
if a:close
|
if a:close
|
||||||
if g:LatexBox_split_resize
|
if g:LatexBox_split_resize
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
if exists('g:loaded_mustache_handlebars') && g:loaded_mustache_handlebars
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let g:loaded_mustache_handlebars = 1
|
||||||
|
|
||||||
let s:cpo_save = &cpo
|
let s:cpo_save = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -65,11 +65,22 @@ if !exists("perlpath")
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" 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
|
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.
|
||||||
|
|||||||
34
ftplugin/ps1.vim
Normal file
34
ftplugin/ps1.vim
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
" Vim filetype plugin file
|
||||||
|
" Language: Windows PowerShell
|
||||||
|
" Maintainer: Peter Provost <peter@provost.org>
|
||||||
|
" Version: 2.10
|
||||||
|
" Project Repository: https://github.com/PProvost/vim-ps1
|
||||||
|
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327
|
||||||
|
|
||||||
|
" Only do this when not done yet for this buffer
|
||||||
|
if exists("b:did_ftplugin") | finish | endif
|
||||||
|
|
||||||
|
" Don't load another plug-in for this buffer
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
setlocal tw=0
|
||||||
|
setlocal commentstring=#%s
|
||||||
|
setlocal formatoptions=tcqro
|
||||||
|
" Enable autocompletion of hyphenated PowerShell commands,
|
||||||
|
" e.g. Get-Content or Get-ADUser
|
||||||
|
setlocal iskeyword+=-
|
||||||
|
|
||||||
|
" Change the browse dialog on Win32 to show mainly PowerShell-related files
|
||||||
|
if has("gui_win32")
|
||||||
|
let b:browsefilter =
|
||||||
|
\ "All PowerShell Files (*.ps1, *.psd1, *.psm1, *.ps1xml)\t*.ps1;*.psd1;*.psm1;*.ps1xml\n" .
|
||||||
|
\ "PowerShell Script Files (*.ps1)\t*.ps1\n" .
|
||||||
|
\ "PowerShell Module Files (*.psd1, *.psm1)\t*.psd1;*.psm1\n" .
|
||||||
|
\ "PowerShell XML Files (*.ps1xml)\t*.ps1xml\n" .
|
||||||
|
\ "All Files (*.*)\t*.*\n"
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Undo the stuff we changed
|
||||||
|
let b:undo_ftplugin = "setlocal tw< cms< fo<" .
|
||||||
|
\ " | unlet! b:browsefilter"
|
||||||
|
|
||||||
31
ftplugin/ps1xml.vim
Normal file
31
ftplugin/ps1xml.vim
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
" Vim filetype plugin file
|
||||||
|
" Language: Windows PowerShell
|
||||||
|
" Maintainer: Peter Provost <peter@provost.org>
|
||||||
|
" Version: 2.10
|
||||||
|
" Project Repository: https://github.com/PProvost/vim-ps1
|
||||||
|
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327
|
||||||
|
|
||||||
|
" Only do this when not done yet for this buffer
|
||||||
|
if exists("b:did_ftplugin") | finish | endif
|
||||||
|
|
||||||
|
" Don't load another plug-in for this buffer
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
setlocal tw=0
|
||||||
|
setlocal commentstring=#%s
|
||||||
|
setlocal formatoptions=tcqro
|
||||||
|
|
||||||
|
" Change the browse dialog on Win32 to show mainly PowerShell-related files
|
||||||
|
if has("gui_win32")
|
||||||
|
let b:browsefilter =
|
||||||
|
\ "All PowerShell Files (*.ps1, *.psd1, *.psm1, *.ps1xml)\t*.ps1;*.psd1;*.psm1;*.ps1xml\n" .
|
||||||
|
\ "PowerShell Script Files (*.ps1)\t*.ps1\n" .
|
||||||
|
\ "PowerShell Module Files (*.psd1, *.psm1)\t*.psd1;*.psm1\n" .
|
||||||
|
\ "PowerShell XML Files (*.ps1xml)\t*.ps1xml\n" .
|
||||||
|
\ "All Files (*.*)\t*.*\n"
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Undo the stuff we changed
|
||||||
|
let b:undo_ftplugin = "setlocal tw< cms< fo<" .
|
||||||
|
\ " | unlet! b:browsefilter"
|
||||||
|
|
||||||
@@ -277,12 +277,12 @@ function! RubyBalloonexpr()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:searchsyn(pattern,syn,flags,mode)
|
function! s:searchsyn(pattern,syn,flags,mode)
|
||||||
|
let cnt = v:count1
|
||||||
norm! m'
|
norm! m'
|
||||||
if a:mode ==# 'v'
|
if a:mode ==# 'v'
|
||||||
norm! gv
|
norm! gv
|
||||||
endif
|
endif
|
||||||
let i = 0
|
let i = 0
|
||||||
let cnt = v:count ? v:count : 1
|
|
||||||
while i < cnt
|
while i < cnt
|
||||||
let i = i + 1
|
let i = i + 1
|
||||||
let line = line('.')
|
let line = line('.')
|
||||||
|
|||||||
@@ -35,9 +35,10 @@ silent! setlocal formatoptions+=j
|
|||||||
" otherwise it's better than nothing.
|
" otherwise it's better than nothing.
|
||||||
setlocal smartindent nocindent
|
setlocal smartindent nocindent
|
||||||
|
|
||||||
|
if !exists("g:rust_recommended_style") || g:rust_recommended_style == 1
|
||||||
setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
|
setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
|
||||||
|
|
||||||
setlocal textwidth=99
|
setlocal textwidth=99
|
||||||
|
endif
|
||||||
|
|
||||||
" This includeexpr isn't perfect, but it's a good start
|
" This includeexpr isn't perfect, but it's a good start
|
||||||
setlocal includeexpr=substitute(v:fname,'::','/','g')
|
setlocal includeexpr=substitute(v:fname,'::','/','g')
|
||||||
@@ -56,6 +57,21 @@ if exists("g:loaded_delimitMate")
|
|||||||
let b:delimitMate_excluded_regions = delimitMate#Get("excluded_regions") . ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
|
let b:delimitMate_excluded_regions = delimitMate#Get("excluded_regions") . ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
|
||||||
|
let b:rust_set_foldmethod=1
|
||||||
|
setlocal foldmethod=syntax
|
||||||
|
if g:rust_fold == 2
|
||||||
|
setlocal foldlevel<
|
||||||
|
else
|
||||||
|
setlocal foldlevel=99
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if has('conceal') && exists('g:rust_conceal')
|
||||||
|
let b:rust_set_conceallevel=1
|
||||||
|
setlocal conceallevel=2
|
||||||
|
endif
|
||||||
|
|
||||||
" Motion Commands {{{1
|
" Motion Commands {{{1
|
||||||
|
|
||||||
" Bind motion commands to support hanging indents
|
" Bind motion commands to support hanging indents
|
||||||
@@ -103,6 +119,14 @@ let b:undo_ftplugin = "
|
|||||||
\|else
|
\|else
|
||||||
\|unlet! b:delimitMate_excluded_regions
|
\|unlet! b:delimitMate_excluded_regions
|
||||||
\|endif
|
\|endif
|
||||||
|
\|if exists('b:rust_set_foldmethod')
|
||||||
|
\|setlocal foldmethod< foldlevel<
|
||||||
|
\|unlet b:rust_set_foldmethod
|
||||||
|
\|endif
|
||||||
|
\|if exists('b:rust_set_conceallevel')
|
||||||
|
\|setlocal conceallevel<
|
||||||
|
\|unlet b:rust_set_conceallevel
|
||||||
|
\|endif
|
||||||
\|unlet! b:rust_last_rustc_args b:rust_last_args
|
\|unlet! b:rust_last_rustc_args b:rust_last_args
|
||||||
\|delcommand RustRun
|
\|delcommand RustRun
|
||||||
\|delcommand RustExpand
|
\|delcommand RustExpand
|
||||||
|
|||||||
@@ -1,13 +1,33 @@
|
|||||||
setlocal commentstring=//%s
|
" Vim filetype plugin
|
||||||
let &l:include = '^\s*import'
|
" Language: Scala
|
||||||
let &l:includeexpr = 'substitute(v:fname,"\\.","/","g")'
|
" Maintainer: Derek Wyatt
|
||||||
|
" 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') != ''
|
||||||
"
|
"
|
||||||
@@ -126,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
|
||||||
@@ -190,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:
|
||||||
|
|||||||
47
ftplugin/scala/tagbar.vim
Normal file
47
ftplugin/scala/tagbar.vim
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
"
|
||||||
|
" 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',
|
||||||
|
\ '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'
|
||||||
|
\ }
|
||||||
|
\ }
|
||||||
|
|
||||||
|
" 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
|
||||||
37
ftplugin/toml.vim
Normal file
37
ftplugin/toml.vim
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
" File: ftplugin/toml.vim
|
||||||
|
" Author: Kevin Ballard <kevin@sb.org>
|
||||||
|
" Description: FileType Plugin for Toml
|
||||||
|
" Last Change: Dec 09, 2014
|
||||||
|
|
||||||
|
if exists('b:did_ftplugin')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
let s:save_cpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
setlocal commentstring=#\ %s
|
||||||
|
|
||||||
|
" Add NERDCommenter delimiters
|
||||||
|
|
||||||
|
let s:delims = { 'left': '#' }
|
||||||
|
if exists('g:NERDDelimiterMap')
|
||||||
|
if !has_key(g:NERDDelimiterMap, 'toml')
|
||||||
|
let g:NERDDelimiterMap.toml = s:delims
|
||||||
|
endif
|
||||||
|
elseif exists('g:NERDCustomDelimiters')
|
||||||
|
if !has_key(g:NERDCustomDelimiters, 'toml')
|
||||||
|
let g:NERDCustomDelimiters.toml = s:delims
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let g:NERDCustomDelimiters = { 'toml': s:delims }
|
||||||
|
endif
|
||||||
|
unlet s:delims
|
||||||
|
|
||||||
|
let b:undo_ftplugin = ""
|
||||||
|
|
||||||
|
let &cpo = s:save_cpo
|
||||||
|
unlet s:save_cpo
|
||||||
|
|
||||||
|
" vim: set et sw=4 ts=4:
|
||||||
@@ -1,10 +1,2 @@
|
|||||||
compiler typescript
|
compiler typescript
|
||||||
|
|
||||||
setlocal autoindent
|
|
||||||
setlocal smartindent
|
|
||||||
setlocal indentexpr&
|
|
||||||
|
|
||||||
setlocal cindent
|
|
||||||
setlocal cino=j1J1
|
|
||||||
|
|
||||||
setlocal commentstring=//\ %s
|
setlocal commentstring=//\ %s
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
" Language: Blade (Laravel)
|
|
||||||
" Maintainer: xsbeats <jwalton512@gmail.com>
|
|
||||||
" URL: http://github.com/xsbeats/vim-blade
|
|
||||||
" License: WTFPL
|
|
||||||
|
|
||||||
if exists("b:did_indent")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
runtime! indent/html.vim
|
|
||||||
|
|
||||||
let b:did_indent = 1
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
" Language: CoffeeScript
|
" Language: CoffeeScript
|
||||||
" Maintainer: Mick Koch <kchmck@gmail.com>
|
" Maintainer: Mick Koch <mick@kochm.co>
|
||||||
" URL: http://github.com/kchmck/vim-coffee-script
|
" URL: http://github.com/kchmck/vim-coffee-script
|
||||||
" License: WTFPL
|
" License: WTFPL
|
||||||
|
|
||||||
|
|||||||
72
indent/eelixir.vim
Normal file
72
indent/eelixir.vim
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
" Vim indent file
|
||||||
|
" Language: Embedded Elixir
|
||||||
|
" URL: https://github.com/elixir-lang/vim-elixir
|
||||||
|
|
||||||
|
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
runtime! indent/elixir.vim
|
||||||
|
unlet! b:did_indent
|
||||||
|
setlocal indentexpr=
|
||||||
|
|
||||||
|
if exists("b:eelixir_subtype")
|
||||||
|
exe "runtime! indent/".b:eelixir_subtype.".vim"
|
||||||
|
else
|
||||||
|
runtime! indent/html.vim
|
||||||
|
endif
|
||||||
|
unlet! b:did_indent
|
||||||
|
|
||||||
|
if &l:indentexpr == ''
|
||||||
|
if &l:cindent
|
||||||
|
let &l:indentexpr = 'cindent(v:lnum)'
|
||||||
|
else
|
||||||
|
let &l:indentexpr = 'indent(prevnonblank(v:lnum-1))'
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
let b:eelixir_subtype_indentexpr = &l:indentexpr
|
||||||
|
|
||||||
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
setlocal indentexpr=GetEelixirIndent()
|
||||||
|
setlocal indentkeys=o,O,*<Return>,<>>,{,},0),0],o,O,!^F,=end,=else,=elsif,=catch,=after,=rescue
|
||||||
|
|
||||||
|
" Only define the function once.
|
||||||
|
if exists("*GetEelixirIndent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
function! GetEelixirIndent(...)
|
||||||
|
if a:0 && a:1 == '.'
|
||||||
|
let v:lnum = line('.')
|
||||||
|
elseif a:0 && a:1 =~ '^\d'
|
||||||
|
let v:lnum = a:1
|
||||||
|
endif
|
||||||
|
let vcol = col('.')
|
||||||
|
call cursor(v:lnum,1)
|
||||||
|
let inelixir = searchpair('<%','','%>','W')
|
||||||
|
call cursor(v:lnum,vcol)
|
||||||
|
if inelixir && getline(v:lnum) !~ '^<%\|^\s*%>'
|
||||||
|
let ind = GetElixirIndent()
|
||||||
|
else
|
||||||
|
exe "let ind = ".b:eelixir_subtype_indentexpr
|
||||||
|
endif
|
||||||
|
let lnum = prevnonblank(v:lnum-1)
|
||||||
|
let line = getline(lnum)
|
||||||
|
let cline = getline(v:lnum)
|
||||||
|
if cline =~# '^\s*<%\s*\%(end\|else\|elsif\|catch\|after\|rescue\)\>.*%>'
|
||||||
|
let ind = ind - &sw
|
||||||
|
elseif line =~# '\S\s*<%\s*end\s*%>'
|
||||||
|
let ind = ind - &sw
|
||||||
|
endif
|
||||||
|
if line =~# '<%[=%]\=\s*.*\<do\s*%>'
|
||||||
|
let ind = ind + &sw
|
||||||
|
elseif line =~# '<%\s*\%(else\|elsif\|catch\|after\|rescue\)\>.*%>'
|
||||||
|
let ind = ind + &sw
|
||||||
|
endif
|
||||||
|
if cline =~# '^\s*%>\s*$'
|
||||||
|
let ind = ind - &sw
|
||||||
|
endif
|
||||||
|
return ind
|
||||||
|
endfunction
|
||||||
@@ -11,7 +11,7 @@ let b:did_indent = 1
|
|||||||
setlocal nosmartindent
|
setlocal nosmartindent
|
||||||
|
|
||||||
setlocal indentexpr=GetElixirIndent()
|
setlocal indentexpr=GetElixirIndent()
|
||||||
setlocal indentkeys+==end,=else:,=match:,=elsif:,=catch:,=after:,=rescue:
|
setlocal indentkeys+=0=end,0=else,0=match,0=elsif,0=catch,0=after,0=rescue
|
||||||
|
|
||||||
if exists("*GetElixirIndent")
|
if exists("*GetElixirIndent")
|
||||||
finish
|
finish
|
||||||
@@ -67,10 +67,17 @@ function! GetElixirIndent()
|
|||||||
let ind += &sw
|
let ind += &sw
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" if line starts with pipeline
|
||||||
|
" and last line contains pipeline(s)
|
||||||
|
" align them
|
||||||
|
if last_line =~ '|>.*$' &&
|
||||||
|
\ current_line =~ s:pipeline
|
||||||
|
let ind = float2nr(match(last_line, '|>') / &sw) * &sw
|
||||||
|
|
||||||
" if line starts with pipeline
|
" if line starts with pipeline
|
||||||
" and last line is an attribution
|
" and last line is an attribution
|
||||||
" indents pipeline in same level as attribution
|
" indents pipeline in same level as attribution
|
||||||
if current_line =~ s:pipeline &&
|
elseif current_line =~ s:pipeline &&
|
||||||
\ last_line =~ '^[^=]\+=.\+$'
|
\ last_line =~ '^[^=]\+=.\+$'
|
||||||
let b:old_ind = ind
|
let b:old_ind = ind
|
||||||
let ind = float2nr(matchend(last_line, '=\s*[^ ]') / &sw) * &sw
|
let ind = float2nr(matchend(last_line, '=\s*[^ ]') / &sw) * &sw
|
||||||
|
|||||||
1602
indent/erlang.vim
1602
indent/erlang.vim
File diff suppressed because it is too large
Load Diff
@@ -42,6 +42,13 @@ if exists("*GetErubyIndent")
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
function! GetErubyIndent(...)
|
function! GetErubyIndent(...)
|
||||||
|
" The value of a single shift-width
|
||||||
|
if exists('*shiftwidth')
|
||||||
|
let sw = shiftwidth()
|
||||||
|
else
|
||||||
|
let sw = &sw
|
||||||
|
endif
|
||||||
|
|
||||||
if a:0 && a:1 == '.'
|
if a:0 && a:1 == '.'
|
||||||
let v:lnum = line('.')
|
let v:lnum = line('.')
|
||||||
elseif a:0 && a:1 =~ '^\d'
|
elseif a:0 && a:1 =~ '^\d'
|
||||||
@@ -70,24 +77,24 @@ function! GetErubyIndent(...)
|
|||||||
let line = getline(lnum)
|
let line = getline(lnum)
|
||||||
let cline = getline(v:lnum)
|
let cline = getline(v:lnum)
|
||||||
if cline =~# '^\s*<%[-=]\=\s*\%(}\|end\|else\|\%(ensure\|rescue\|elsif\|when\).\{-\}\)\s*\%([-=]\=%>\|$\)'
|
if cline =~# '^\s*<%[-=]\=\s*\%(}\|end\|else\|\%(ensure\|rescue\|elsif\|when\).\{-\}\)\s*\%([-=]\=%>\|$\)'
|
||||||
let ind = ind - &sw
|
let ind = ind - sw
|
||||||
endif
|
endif
|
||||||
if line =~# '\S\s*<%[-=]\=\s*\%(}\|end\).\{-\}\s*\%([-=]\=%>\|$\)'
|
if line =~# '\S\s*<%[-=]\=\s*\%(}\|end\).\{-\}\s*\%([-=]\=%>\|$\)'
|
||||||
let ind = ind - &sw
|
let ind = ind - sw
|
||||||
endif
|
endif
|
||||||
if line =~# '\%({\|\<do\)\%(\s*|[^|]*|\)\=\s*[-=]\=%>'
|
if line =~# '\%({\|\<do\)\%(\s*|[^|]*|\)\=\s*[-=]\=%>'
|
||||||
let ind = ind + &sw
|
let ind = ind + sw
|
||||||
elseif line =~# '<%[-=]\=\s*\%(module\|class\|def\|if\|for\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\)\>.*%>'
|
elseif line =~# '<%[-=]\=\s*\%(module\|class\|def\|if\|for\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\)\>.*%>'
|
||||||
let ind = ind + &sw
|
let ind = ind + sw
|
||||||
endif
|
endif
|
||||||
if line =~# '^\s*<%[=#-]\=\s*$' && cline !~# '^\s*end\>'
|
if line =~# '^\s*<%[=#-]\=\s*$' && cline !~# '^\s*end\>'
|
||||||
let ind = ind + &sw
|
let ind = ind + sw
|
||||||
endif
|
endif
|
||||||
if line !~# '^\s*<%' && line =~# '%>\s*$'
|
if line !~# '^\s*<%' && line =~# '%>\s*$'
|
||||||
let ind = ind - &sw
|
let ind = ind - sw
|
||||||
endif
|
endif
|
||||||
if cline =~# '^\s*[-=]\=%>\s*$'
|
if cline =~# '^\s*[-=]\=%>\s*$'
|
||||||
let ind = ind - &sw
|
let ind = ind - sw
|
||||||
endif
|
endif
|
||||||
return ind
|
return ind
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -37,20 +37,21 @@ function! GoIndent(lnum)
|
|||||||
let previ = indent(prevlnum)
|
let previ = indent(prevlnum)
|
||||||
|
|
||||||
let ind = previ
|
let ind = previ
|
||||||
|
let s:shiftwidth = shiftwidth()
|
||||||
|
|
||||||
if prevl =~ '[({]\s*$'
|
if prevl =~ '[({]\s*$'
|
||||||
" previous line opened a block
|
" previous line opened a block
|
||||||
let ind += &sw
|
let ind += s:shiftwidth
|
||||||
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:shiftwidth
|
||||||
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:shiftwidth
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Colons are tricky.
|
" Colons are tricky.
|
||||||
@@ -58,7 +59,7 @@ function! GoIndent(lnum)
|
|||||||
" 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:shiftwidth
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return ind
|
return ind
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ function! HIndent(lnum)
|
|||||||
" This is the wrong thing if you are deeply indented already and want to put
|
" This is the wrong thing if you are deeply indented already and want to put
|
||||||
" a where clause on the top-level construct, but there isn't much that can
|
" a where clause on the top-level construct, but there isn't much that can
|
||||||
" be done about that case...
|
" be done about that case...
|
||||||
if thisl =~ '^\s*where\s*$'
|
if thisl =~ '^\s*where\s*'
|
||||||
return previ + &sw
|
return previ + &sw
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -175,11 +175,11 @@ function! HIndent(lnum)
|
|||||||
return previ - &sw
|
return previ - &sw
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" On the other hand, if the previous line is a where with some bindings
|
" On the other hand, if the previous line is a do or where with some bindings
|
||||||
" following it on the same line, accommodate and align with the first non-ws
|
" following it on the same line, accommodate and align with the first non-ws
|
||||||
" char after the where
|
" char after the where
|
||||||
if prevl =~ '\Wwhere\s\+\w'
|
if prevl =~ '\W\(do\|where\)\s\+\w'
|
||||||
let bindStart = match(prevl, '\(\Wwhere\s\+\)\@<=\w')
|
let bindStart = match(prevl, '\(\W\(do\|where\)\s\+\)\@<=\w')
|
||||||
if bindStart != -1
|
if bindStart != -1
|
||||||
return bindStart
|
return bindStart
|
||||||
endif
|
endif
|
||||||
@@ -248,7 +248,7 @@ function! s:GetAndStripTrailingComments(lnum)
|
|||||||
let aline = getline(a:lnum)
|
let aline = getline(a:lnum)
|
||||||
" We can't just remove the string literal since that leaves us with a
|
" We can't just remove the string literal since that leaves us with a
|
||||||
" trailing operator (=), so replace it with a fake identifier
|
" trailing operator (=), so replace it with a fake identifier
|
||||||
let noStrings = substitute(aline, '"\([^"]\|\\"\)*"', 's', '')
|
let noStrings = substitute(aline, '"\([^"]\|\\"\)*"', '\=repeat("s", len(submatch(0)))', '')
|
||||||
let noLineCom = substitute(noStrings, '--.*$', '', '')
|
let noLineCom = substitute(noStrings, '--.*$', '', '')
|
||||||
|
|
||||||
" If there are no fancy block comments involved, skip some of this extra
|
" If there are no fancy block comments involved, skip some of this extra
|
||||||
|
|||||||
@@ -127,10 +127,12 @@ call add(s:tags, 'meter')
|
|||||||
call add(s:tags, 'nav')
|
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, 'rp')
|
call add(s:tags, 'rp')
|
||||||
call add(s:tags, 'rt')
|
call add(s:tags, 'rt')
|
||||||
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, 'summary')
|
call add(s:tags, 'summary')
|
||||||
call add(s:tags, 'time')
|
call add(s:tags, 'time')
|
||||||
call add(s:tags, 'video')
|
call add(s:tags, 'video')
|
||||||
@@ -187,6 +189,7 @@ if exists('g:html_exclude_tags')
|
|||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
let s:html_indent_tags = join(s:tags, '\|')
|
let s:html_indent_tags = join(s:tags, '\|')
|
||||||
|
let s:html_indent_tags = s:html_indent_tags.'\|\w\+\(-\w\+\)\+'
|
||||||
if exists('g:html_indent_tags')
|
if exists('g:html_indent_tags')
|
||||||
let s:html_indent_tags = s:html_indent_tags.'\|'.g:html_indent_tags
|
let s:html_indent_tags = s:html_indent_tags.'\|'.g:html_indent_tags
|
||||||
endif
|
endif
|
||||||
@@ -281,7 +284,7 @@ fun! HtmlIndentGet(lnum)
|
|||||||
if 0 < searchpair(js, '', jse, 'nWb')
|
if 0 < searchpair(js, '', jse, 'nWb')
|
||||||
\ && 0 < searchpair(js, '', jse, 'nW')
|
\ && 0 < searchpair(js, '', jse, 'nW')
|
||||||
" we're inside javascript
|
" we're inside javascript
|
||||||
if getline(searchpair(js, '', '</script>', 'nWb')) !~ '<script [^>]*type=["'']\?text\/\(html\|template\)'
|
if getline(searchpair(js, '', '</script>', 'nWb')) !~ '<script [^>]*type=["'']\?text\/\(html\|\(ng-\)\?template\)'
|
||||||
\ && getline(lnum) !~ js && getline(a:lnum) !~ jse
|
\ && getline(lnum) !~ js && getline(a:lnum) !~ jse
|
||||||
if restore_ic == 0
|
if restore_ic == 0
|
||||||
setlocal noic
|
setlocal noic
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ setlocal nosmartindent
|
|||||||
|
|
||||||
" Now, set up our indentation expression and keys that trigger it.
|
" Now, set up our indentation expression and keys that trigger it.
|
||||||
setlocal indentexpr=GetJavascriptIndent()
|
setlocal indentexpr=GetJavascriptIndent()
|
||||||
|
setlocal formatexpr=Fixedgq(v:lnum,v:count)
|
||||||
setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e
|
setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e
|
||||||
|
|
||||||
" Only define the function once.
|
" Only define the function once.
|
||||||
@@ -48,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
|
||||||
|
|
||||||
@@ -437,3 +438,64 @@ endfunction
|
|||||||
|
|
||||||
let &cpo = s:cpo_save
|
let &cpo = s:cpo_save
|
||||||
unlet s:cpo_save
|
unlet s:cpo_save
|
||||||
|
|
||||||
|
function! Fixedgq(lnum, count)
|
||||||
|
let l:tw = &tw ? &tw : 80;
|
||||||
|
|
||||||
|
let l:count = a:count
|
||||||
|
let l:first_char = indent(a:lnum) + 1
|
||||||
|
|
||||||
|
if mode() == 'i' " gq was not pressed, but tw was set
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" This gq is only meant to do code with strings, not comments
|
||||||
|
if s:IsLineComment(a:lnum, l:first_char) || s:IsInMultilineComment(a:lnum, l:first_char)
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
if len(getline(a:lnum)) < l:tw && l:count == 1 " No need for gq
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Put all the lines on one line and do normal spliting after that
|
||||||
|
if l:count > 1
|
||||||
|
while l:count > 1
|
||||||
|
let l:count -= 1
|
||||||
|
normal J
|
||||||
|
endwhile
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:winview = winsaveview()
|
||||||
|
|
||||||
|
call cursor(a:lnum, l:tw + 1)
|
||||||
|
let orig_breakpoint = searchpairpos(' ', '', '\.', 'bcW', '', a:lnum)
|
||||||
|
call cursor(a:lnum, l:tw + 1)
|
||||||
|
let breakpoint = searchpairpos(' ', '', '\.', 'bcW', s:skip_expr, a:lnum)
|
||||||
|
|
||||||
|
" No need for special treatment, normal gq handles edgecases better
|
||||||
|
if breakpoint[1] == orig_breakpoint[1]
|
||||||
|
call winrestview(l:winview)
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Try breaking after string
|
||||||
|
if breakpoint[1] <= indent(a:lnum)
|
||||||
|
call cursor(a:lnum, l:tw + 1)
|
||||||
|
let breakpoint = searchpairpos('\.', '', ' ', 'cW', s:skip_expr, a:lnum)
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
if breakpoint[1] != 0
|
||||||
|
call feedkeys("r\<CR>")
|
||||||
|
else
|
||||||
|
let l:count = l:count - 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" run gq on new lines
|
||||||
|
if l:count == 1
|
||||||
|
call feedkeys("gqq")
|
||||||
|
endif
|
||||||
|
|
||||||
|
return 0
|
||||||
|
endfunction
|
||||||
|
|||||||
20
indent/ps1.vim
Normal file
20
indent/ps1.vim
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
" Vim indent file
|
||||||
|
" Language: Windows PowerShell
|
||||||
|
" Maintainer: Peter Provost <peter@provost.org>
|
||||||
|
" Version: 2.10
|
||||||
|
" Project Repository: https://github.com/PProvost/vim-ps1
|
||||||
|
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327"
|
||||||
|
|
||||||
|
" Only load this indent file when no other was loaded.
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
" smartindent is good enough for powershell
|
||||||
|
setlocal smartindent
|
||||||
|
" disable the indent removal for # marks
|
||||||
|
inoremap # X#
|
||||||
|
|
||||||
|
let b:undo_indent = "setl si<"
|
||||||
|
|
||||||
@@ -369,6 +369,13 @@ function GetRubyIndent(...)
|
|||||||
" 3.1. Setup {{{2
|
" 3.1. Setup {{{2
|
||||||
" ----------
|
" ----------
|
||||||
|
|
||||||
|
" The value of a single shift-width
|
||||||
|
if exists('*shiftwidth')
|
||||||
|
let sw = shiftwidth()
|
||||||
|
else
|
||||||
|
let sw = &sw
|
||||||
|
endif
|
||||||
|
|
||||||
" For the current line, use the first argument if given, else v:lnum
|
" For the current line, use the first argument if given, else v:lnum
|
||||||
let clnum = a:0 ? a:1 : v:lnum
|
let clnum = a:0 ? a:1 : v:lnum
|
||||||
|
|
||||||
@@ -388,7 +395,7 @@ function GetRubyIndent(...)
|
|||||||
if s:Match(clnum, s:access_modifier_regex)
|
if s:Match(clnum, s:access_modifier_regex)
|
||||||
let class_line = s:FindContainingClass()
|
let class_line = s:FindContainingClass()
|
||||||
if class_line > 0
|
if class_line > 0
|
||||||
return indent(class_line) + &sw
|
return indent(class_line) + sw
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
elseif g:ruby_indent_access_modifier_style == 'outdent'
|
elseif g:ruby_indent_access_modifier_style == 'outdent'
|
||||||
@@ -458,7 +465,7 @@ function GetRubyIndent(...)
|
|||||||
|
|
||||||
" If the current line starts with a leading operator, add a level of indent.
|
" If the current line starts with a leading operator, add a level of indent.
|
||||||
if s:Match(clnum, s:leading_operator_regex)
|
if s:Match(clnum, s:leading_operator_regex)
|
||||||
return indent(s:GetMSL(clnum)) + &sw
|
return indent(s:GetMSL(clnum)) + sw
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" 3.3. Work on the previous line. {{{2
|
" 3.3. Work on the previous line. {{{2
|
||||||
@@ -485,23 +492,23 @@ function GetRubyIndent(...)
|
|||||||
" If the previous line was a private/protected keyword, add a
|
" If the previous line was a private/protected keyword, add a
|
||||||
" level of indent.
|
" level of indent.
|
||||||
if s:Match(lnum, s:indent_access_modifier_regex)
|
if s:Match(lnum, s:indent_access_modifier_regex)
|
||||||
return indent(lnum) + &sw
|
return indent(lnum) + sw
|
||||||
endif
|
endif
|
||||||
elseif g:ruby_indent_access_modifier_style == 'outdent'
|
elseif g:ruby_indent_access_modifier_style == 'outdent'
|
||||||
" If the previous line was a private/protected/public keyword, add
|
" If the previous line was a private/protected/public keyword, add
|
||||||
" a level of indent, since the keyword has been out-dented.
|
" a level of indent, since the keyword has been out-dented.
|
||||||
if s:Match(lnum, s:access_modifier_regex)
|
if s:Match(lnum, s:access_modifier_regex)
|
||||||
return indent(lnum) + &sw
|
return indent(lnum) + sw
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if s:Match(lnum, s:continuable_regex) && s:Match(lnum, s:continuation_regex)
|
if s:Match(lnum, s:continuable_regex) && s:Match(lnum, s:continuation_regex)
|
||||||
return indent(s:GetMSL(lnum)) + &sw + &sw
|
return indent(s:GetMSL(lnum)) + sw + sw
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" If the previous line ended with a block opening, add a level of indent.
|
" If the previous line ended with a block opening, add a level of indent.
|
||||||
if s:Match(lnum, s:block_regex)
|
if s:Match(lnum, s:block_regex)
|
||||||
return indent(s:GetMSL(lnum)) + &sw
|
return indent(s:GetMSL(lnum)) + sw
|
||||||
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
|
||||||
@@ -512,7 +519,7 @@ function GetRubyIndent(...)
|
|||||||
|
|
||||||
" If the previous line ended with the "*" of a splat, add a level of indent
|
" If the previous line ended with the "*" of a splat, add a level of indent
|
||||||
if line =~ s:splat_regex
|
if line =~ s:splat_regex
|
||||||
return indent(lnum) + &sw
|
return indent(lnum) + sw
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" If the previous line contained unclosed opening brackets and we are still
|
" If the previous line contained unclosed opening brackets and we are still
|
||||||
@@ -527,20 +534,20 @@ function GetRubyIndent(...)
|
|||||||
if opening.pos != -1
|
if opening.pos != -1
|
||||||
if opening.type == '(' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
|
if opening.type == '(' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
|
||||||
if col('.') + 1 == col('$')
|
if col('.') + 1 == col('$')
|
||||||
return ind + &sw
|
return ind + sw
|
||||||
else
|
else
|
||||||
return virtcol('.')
|
return virtcol('.')
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
let nonspace = matchend(line, '\S', opening.pos + 1) - 1
|
let nonspace = matchend(line, '\S', opening.pos + 1) - 1
|
||||||
return nonspace > 0 ? nonspace : ind + &sw
|
return nonspace > 0 ? nonspace : ind + sw
|
||||||
endif
|
endif
|
||||||
elseif closing.pos != -1
|
elseif closing.pos != -1
|
||||||
call cursor(lnum, closing.pos + 1)
|
call cursor(lnum, closing.pos + 1)
|
||||||
normal! %
|
normal! %
|
||||||
|
|
||||||
if s:Match(line('.'), s:ruby_indent_keywords)
|
if s:Match(line('.'), s:ruby_indent_keywords)
|
||||||
return indent('.') + &sw
|
return indent('.') + sw
|
||||||
else
|
else
|
||||||
return indent('.')
|
return indent('.')
|
||||||
endif
|
endif
|
||||||
@@ -569,7 +576,7 @@ function GetRubyIndent(...)
|
|||||||
let col = s:Match(lnum, s:ruby_indent_keywords)
|
let col = s:Match(lnum, s:ruby_indent_keywords)
|
||||||
if col > 0
|
if col > 0
|
||||||
call cursor(lnum, col)
|
call cursor(lnum, col)
|
||||||
let ind = virtcol('.') - 1 + &sw
|
let ind = virtcol('.') - 1 + sw
|
||||||
" TODO: make this better (we need to count them) (or, if a searchpair
|
" TODO: make this better (we need to count them) (or, if a searchpair
|
||||||
" fails, we know that something is lacking an end and thus we indent a
|
" fails, we know that something is lacking an end and thus we indent a
|
||||||
" level
|
" level
|
||||||
@@ -606,9 +613,9 @@ function GetRubyIndent(...)
|
|||||||
" TODO: this does not take into account contrived things such as
|
" TODO: this does not take into account contrived things such as
|
||||||
" module Foo; class Bar; end
|
" module Foo; class Bar; end
|
||||||
if s:Match(lnum, s:ruby_indent_keywords)
|
if s:Match(lnum, s:ruby_indent_keywords)
|
||||||
let ind = msl_ind + &sw
|
let ind = msl_ind + sw
|
||||||
if s:Match(lnum, s:end_end_regex)
|
if s:Match(lnum, s:end_end_regex)
|
||||||
let ind = ind - &sw
|
let ind = ind - sw
|
||||||
endif
|
endif
|
||||||
return ind
|
return ind
|
||||||
endif
|
endif
|
||||||
@@ -617,7 +624,7 @@ function GetRubyIndent(...)
|
|||||||
" closing bracket, indent one extra level.
|
" closing bracket, indent one extra level.
|
||||||
if s:Match(lnum, s:non_bracket_continuation_regex) && !s:Match(lnum, '^\s*\([\])}]\|end\)')
|
if s:Match(lnum, s:non_bracket_continuation_regex) && !s:Match(lnum, '^\s*\([\])}]\|end\)')
|
||||||
if lnum == p_lnum
|
if lnum == p_lnum
|
||||||
let ind = msl_ind + &sw
|
let ind = msl_ind + sw
|
||||||
else
|
else
|
||||||
let ind = msl_ind
|
let ind = msl_ind
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
" Vim indent file
|
" Vim indent file
|
||||||
" Language: Rust
|
" Language: Rust
|
||||||
" Author: Chris Morgan <me@chrismorgan.info>
|
" Author: Chris Morgan <me@chrismorgan.info>
|
||||||
" Last Change: 2013 Oct 29
|
" Last Change: 2014 Sep 13
|
||||||
|
|
||||||
" Only load this indent file when no other was loaded.
|
" Only load this indent file when no other was loaded.
|
||||||
if exists("b:did_indent")
|
if exists("b:did_indent")
|
||||||
@@ -10,7 +10,7 @@ endif
|
|||||||
let b:did_indent = 1
|
let b:did_indent = 1
|
||||||
|
|
||||||
setlocal cindent
|
setlocal cindent
|
||||||
setlocal cinoptions=L0,(0,Ws,JN,j1
|
setlocal cinoptions=L0,(0,Ws,J1,j1
|
||||||
setlocal cinkeys=0{,0},!^F,o,O,0[,0]
|
setlocal cinkeys=0{,0},!^F,o,O,0[,0]
|
||||||
" Don't think cinwords will actually do anything at all... never mind
|
" Don't think cinwords will actually do anything at all... never mind
|
||||||
setlocal cinwords=for,if,else,while,loop,impl,mod,unsafe,trait,struct,enum,fn,extern
|
setlocal cinwords=for,if,else,while,loop,impl,mod,unsafe,trait,struct,enum,fn,extern
|
||||||
@@ -151,10 +151,11 @@ function GetRustIndent(lnum)
|
|||||||
"
|
"
|
||||||
" There are probably other cases where we don't want to do this as
|
" There are probably other cases where we don't want to do this as
|
||||||
" well. Add them as needed.
|
" well. Add them as needed.
|
||||||
return GetRustIndent(a:lnum - 1)
|
return indent(prevlinenum)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" cindent doesn't do the module scope well at all; e.g.::
|
if !has("patch-7.4.355")
|
||||||
|
" cindent before 7.4.355 doesn't do the module scope well at all; e.g.::
|
||||||
"
|
"
|
||||||
" static FOO : &'static [bool] = [
|
" static FOO : &'static [bool] = [
|
||||||
" true,
|
" true,
|
||||||
@@ -188,6 +189,7 @@ function GetRustIndent(lnum)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
" Fall back on cindent, which does it mostly right
|
" Fall back on cindent, which does it mostly right
|
||||||
return cindent(a:lnum)
|
return cindent(a:lnum)
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -36,12 +32,12 @@ endfunction
|
|||||||
|
|
||||||
function! scala#GetLine(lnum)
|
function! scala#GetLine(lnum)
|
||||||
let line = substitute(getline(a:lnum), '//.*$', '', '')
|
let line = substitute(getline(a:lnum), '//.*$', '', '')
|
||||||
let line = substitute(line, '"[^"]*"', '""', 'g')
|
let line = substitute(line, '"\(.\|\\"\)\{-}"', '""', 'g')
|
||||||
return line
|
return line
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! scala#CountBrackets(line, openBracket, closedBracket)
|
function! scala#CountBrackets(line, openBracket, closedBracket)
|
||||||
let line = substitute(a:line, '"\(.\|\\"\)*"', '', 'g')
|
let line = substitute(a:line, '"\(.\|\\"\)\{-}"', '', 'g')
|
||||||
let open = substitute(line, '[^' . a:openBracket . ']', '', 'g')
|
let open = substitute(line, '[^' . a:openBracket . ']', '', 'g')
|
||||||
let close = substitute(line, '[^' . a:closedBracket . ']', '', 'g')
|
let close = substitute(line, '[^' . a:closedBracket . ']', '', 'g')
|
||||||
return strlen(open) - strlen(close)
|
return strlen(open) - strlen(close)
|
||||||
@@ -102,7 +98,7 @@ function! scala#CurlyMatcher()
|
|||||||
if scala#CountParens(scala#GetLine(matchline)) < 0
|
if scala#CountParens(scala#GetLine(matchline)) < 0
|
||||||
let savedpos = getpos('.')
|
let savedpos = getpos('.')
|
||||||
call setpos('.', [savedpos[0], matchline, 9999, savedpos[3]])
|
call setpos('.', [savedpos[0], matchline, 9999, savedpos[3]])
|
||||||
call searchpos('{', 'Wb')
|
call searchpos('{', 'Wbc')
|
||||||
call searchpos(')', 'Wb')
|
call searchpos(')', 'Wb')
|
||||||
let [lnum, colnum] = searchpairpos('(', '', ')', 'Wbn')
|
let [lnum, colnum] = searchpairpos('(', '', ')', 'Wbn')
|
||||||
call setpos('.', savedpos)
|
call setpos('.', savedpos)
|
||||||
@@ -133,7 +129,7 @@ function! scala#GetLineAndColumnThatMatchesBracket(openBracket, closedBracket)
|
|||||||
call searchpos(a:closedBracket . '\ze[^' . a:closedBracket . a:openBracket . ']*' . a:openBracket, 'W')
|
call searchpos(a:closedBracket . '\ze[^' . a:closedBracket . a:openBracket . ']*' . a:openBracket, 'W')
|
||||||
else
|
else
|
||||||
call setpos('.', [savedpos[0], savedpos[1], 9999, savedpos[3]])
|
call setpos('.', [savedpos[0], savedpos[1], 9999, savedpos[3]])
|
||||||
call searchpos(a:closedBracket, 'Wb')
|
call searchpos(a:closedBracket, 'Wbc')
|
||||||
endif
|
endif
|
||||||
let [lnum, colnum] = searchpairpos(a:openBracket, '', a:closedBracket, 'Wbn')
|
let [lnum, colnum] = searchpairpos(a:openBracket, '', a:closedBracket, 'Wbn')
|
||||||
call setpos('.', savedpos)
|
call setpos('.', savedpos)
|
||||||
@@ -382,8 +378,12 @@ function! GetScalaIndent()
|
|||||||
let curline = scala#GetLine(curlnum)
|
let curline = scala#GetLine(curlnum)
|
||||||
|
|
||||||
if prevline =~ '^\s*/\*\*'
|
if prevline =~ '^\s*/\*\*'
|
||||||
|
if prevline =~ '\*/\s*$'
|
||||||
|
return ind
|
||||||
|
else
|
||||||
return ind + 1
|
return ind + 1
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
if curline =~ '^\s*\*'
|
if curline =~ '^\s*\*'
|
||||||
return cindent(curlnum)
|
return cindent(curlnum)
|
||||||
@@ -539,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
|
||||||
@@ -593,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:
|
||||||
|
|||||||
@@ -90,4 +90,35 @@ function! LatexBox_TexIndent()
|
|||||||
endfunction
|
endfunction
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
|
" Restore cursor position, window position, and last search after running a
|
||||||
|
" command.
|
||||||
|
function! Latexbox_CallIndent()
|
||||||
|
" Save the current cursor position.
|
||||||
|
let cursor = getpos('.')
|
||||||
|
|
||||||
|
" Save the current window position.
|
||||||
|
normal! H
|
||||||
|
let window = getpos('.')
|
||||||
|
call setpos('.', cursor)
|
||||||
|
|
||||||
|
" Execute the command.
|
||||||
|
execute 'normal! =='
|
||||||
|
|
||||||
|
" Restore the previous window position.
|
||||||
|
call setpos('.', window)
|
||||||
|
normal! zt
|
||||||
|
|
||||||
|
" Restore the previous cursor position.
|
||||||
|
call setpos('.', cursor)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" autocmd to call indent after completion
|
||||||
|
" 7.3.598
|
||||||
|
if v:version > 703 || (v:version == 703 && has('patch598'))
|
||||||
|
augroup LatexBox_Completion
|
||||||
|
autocmd!
|
||||||
|
autocmd CompleteDone <buffer> call Latexbox_CallIndent()
|
||||||
|
augroup END
|
||||||
|
endif
|
||||||
|
|
||||||
" vim:fdm=marker:ff=unix:noet:ts=4:sw=4
|
" vim:fdm=marker:ff=unix:noet:ts=4:sw=4
|
||||||
|
|||||||
32
indent/vala.vim
Normal file
32
indent/vala.vim
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
" Copyright (c) 2012 Takezoe Tomoaki <tkztmk@outlook.com>
|
||||||
|
"
|
||||||
|
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
" of
|
||||||
|
" this software and associated documentation files (the "Software"), to deal in
|
||||||
|
" the Software without restriction, including without limitation the rights to
|
||||||
|
" use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
" of
|
||||||
|
" the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
" so,
|
||||||
|
" subject to the following conditions:
|
||||||
|
"
|
||||||
|
" The above copyright notice and this permission notice shall be included in all
|
||||||
|
" copies or substantial portions of the Software.
|
||||||
|
"
|
||||||
|
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
" FITNESS
|
||||||
|
" FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
" COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
" IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
" Vim indent file for Vala.
|
||||||
|
" It just sets cindent for Vala files...
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_indent = 1
|
||||||
|
setl cin
|
||||||
|
let b:undo_indent = "setl cin<"
|
||||||
|
|
||||||
5
indent/velocity.vim
Normal file
5
indent/velocity.vim
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
runtime! indent/html.vim
|
||||||
@@ -1,35 +1,41 @@
|
|||||||
" Language: Blade (Laravel)
|
" Language: Blade
|
||||||
" Maintainer: xsbeats <jwalton512@gmail.com>
|
" Maintainer: Jason Walton <jwalton512@gmail.com>
|
||||||
" URL: http://github.com/xsbeats/vim-blade
|
" URL: https://github.com/xsbeats/vim-blade
|
||||||
" License: WTFPL
|
" License: DBAD
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
" Check if our syntax is already loaded
|
||||||
|
if exists('b:current_syntax') && b:current_syntax == 'blade'
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
runtime! syntax/html.vim
|
" Include PHP
|
||||||
unlet b:current_syntax
|
|
||||||
|
|
||||||
runtime! syntax/php.vim
|
runtime! syntax/php.vim
|
||||||
unlet b:current_syntax
|
silent! unlet b:current_syntax
|
||||||
|
|
||||||
syn match bladeConditional /@\(choice\|each\|elseif\|extends\|for\|foreach\|if\|include\|lang\|section\|unless\|while\|yield\)\>\s*/ nextgroup=bladeParenBlock containedin=ALLBUT,bladeComment
|
" Echos
|
||||||
|
syn region bladeUnescapedEcho matchgroup=bladeEchoDelim start=/@\@<!\s*{!!/ end=/!!}\s*/ oneline contains=@phpClTop containedin=ALLBUT,bladeComment
|
||||||
|
syn region bladeEscapedEcho matchgroup=bladeEchoDelim start=/@\@<!\s*{{{\@!/ end=/}}\s*/ oneline contains=@phpClTop containedin=ALLBUT,bladeComment
|
||||||
|
syn region bladeEscapedEcho matchgroup=bladeEchoDelim start=/@\@<!\s*{{{{\@!/ end=/}}}/ oneline contains=@phpClTop containedin=ALLBUT,bladeComment
|
||||||
|
|
||||||
syn match bladeKeyword /@\(else\|endfor\|endforeach\|endif\|endsection\|endunless\|endwhile\|overwrite\|parent\|show\|stop\)\>/ containedin=ALL,bladeComment
|
" Structures
|
||||||
|
syn match bladeStructure /\s*@\(else\|empty\|endfor\|endforeach\|endforelse\|endif\|endpush\|endsection\|endunless\|endwhile\|overwrite\|show\|stop\)\>/
|
||||||
|
syn match bladeStructure /\s*@\(append\|choice\|each\|elseif\|extends\|for\|foreach\|forelse\|if\|include\|lang\|push\|section\|stack\|unless\|while\|yield\|\)\>\s*/ nextgroup=bladeParens
|
||||||
|
syn region bladeParens matchgroup=bladeParen start=/(/ end=/)/ contained contains=@bladeAll,@phpClTop
|
||||||
|
|
||||||
syn region bladeCommentBlock start="{{--" end="--}}" contains=bladeComment keepend containedin=TOP
|
" Comments
|
||||||
syn match bladeComment /.*/ contained containedin=bladeCommentBlock
|
syn region bladeComments start=/\s*{{--/ end=/--}}/ contains=bladeComment keepend
|
||||||
|
syn match bladeComment /.*/ contained containedin=bladeComments
|
||||||
|
|
||||||
syn region bladeEchoUnescaped matchgroup=bladeEchoDelim start="\([@|{]\)\@<!{{\(--\)\@!" end="}}" contains=@phpClInside containedin=ALLBUT,bladeComment
|
" Clusters
|
||||||
syn region bladeEchoEscaped matchgroup=bladeEchoDelim start="\(@\)\@<!{{{" end="}}}" contains=@phpClInside containedin=ALLBUT,bladeComment
|
syn cluster bladeAll contains=bladeStructure,bladeParens
|
||||||
|
|
||||||
syn cluster bladeStatement contains=bladeConditional,bladeKeyword
|
|
||||||
|
|
||||||
syn region bladeParenBlock start="(" end=")" contained oneline contains=bladeParenBlock,@phpClInside,@bladeStatement extend keepend
|
|
||||||
|
|
||||||
|
" Highlighting
|
||||||
hi def link bladeComment Comment
|
hi def link bladeComment Comment
|
||||||
hi def link bladeConditional Conditional
|
|
||||||
hi def link bladeKeyword Keyword
|
|
||||||
hi def link bladeEchoDelim Delimiter
|
hi def link bladeEchoDelim Delimiter
|
||||||
|
hi def link bladeParen Delimiter
|
||||||
|
hi def link bladeStructure Keyword
|
||||||
|
|
||||||
|
|
||||||
|
if !exists('b:current_syntax')
|
||||||
let b:current_syntax = 'blade'
|
let b:current_syntax = 'blade'
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
" Language: CoffeeScript
|
" Language: CoffeeScript
|
||||||
" Maintainer: Mick Koch <kchmck@gmail.com>
|
" Maintainer: Mick Koch <mick@kochm.co>
|
||||||
" URL: http://github.com/kchmck/vim-coffee-script
|
" URL: http://github.com/kchmck/vim-coffee-script
|
||||||
" License: WTFPL
|
" License: WTFPL
|
||||||
|
|
||||||
|
|||||||
@@ -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: 2013 Nov.27
|
" Last Change: 2014 Oct.28
|
||||||
|
|
||||||
" 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
|
||||||
@@ -26,18 +26,19 @@ set cpo&vim
|
|||||||
|
|
||||||
syn case ignore
|
syn case ignore
|
||||||
|
|
||||||
" All HTML4 tags
|
" HTML4 tags
|
||||||
syn keyword cssTagName abbr acronym address applet area a b base
|
syn keyword cssTagName abbr address area a b base
|
||||||
syn keyword cssTagName basefont bdo big blockquote body br button
|
syn keyword cssTagName bdo blockquote body br button
|
||||||
syn keyword cssTagName caption center cite code col colgroup dd del
|
syn keyword cssTagName caption cite code col colgroup dd del
|
||||||
syn keyword cssTagName dfn dir div dl dt em fieldset font form frame
|
syn keyword cssTagName dfn div dl dt em fieldset form
|
||||||
syn keyword cssTagName frameset h1 h2 h3 h4 h5 h6 head hr html img i
|
syn keyword cssTagName h1 h2 h3 h4 h5 h6 head hr html img i
|
||||||
syn keyword cssTagName iframe img input ins isindex kbd label legend li
|
syn keyword cssTagName iframe input ins isindex kbd label legend li
|
||||||
syn keyword cssTagName link map menu meta noframes noscript ol optgroup
|
syn keyword cssTagName link map menu meta noscript ol optgroup
|
||||||
syn keyword cssTagName option p param pre q s samp script select small
|
syn keyword cssTagName option p param pre q s samp script small
|
||||||
syn keyword cssTagName span strike strong style sub sup table tbody td
|
syn keyword cssTagName span strong sub sup tbody td
|
||||||
syn keyword cssTagName textarea tfoot th thead title tr tt ul u var
|
syn keyword cssTagName textarea tfoot th thead title tr ul u var
|
||||||
syn keyword cssTagName object svg
|
syn keyword cssTagName object svg
|
||||||
|
syn match cssTagName /\<select\>\|\<style\>\|\<table\>/
|
||||||
|
|
||||||
" 34 HTML5 tags
|
" 34 HTML5 tags
|
||||||
syn keyword cssTagName article aside audio bdi canvas command data
|
syn keyword cssTagName article aside audio bdi canvas command data
|
||||||
@@ -47,8 +48,8 @@ syn keyword cssTagName output progress rt rp ruby section
|
|||||||
syn keyword cssTagName source summary time track video wbr
|
syn keyword cssTagName source summary time track video wbr
|
||||||
|
|
||||||
" Tags not supported in HTML5
|
" Tags not supported in HTML5
|
||||||
syn keyword cssDeprecated acronym applet basefont big center dir
|
" acronym applet basefont big center dir
|
||||||
syn keyword cssDeprecated font frame frameset noframes strike tt
|
" font frame frameset noframes strike tt
|
||||||
|
|
||||||
syn match cssTagName "\*"
|
syn match cssTagName "\*"
|
||||||
|
|
||||||
@@ -70,10 +71,10 @@ endtry
|
|||||||
" digits
|
" digits
|
||||||
syn match cssValueInteger contained "[-+]\=\d\+" contains=cssUnitDecorators
|
syn match cssValueInteger contained "[-+]\=\d\+" contains=cssUnitDecorators
|
||||||
syn match cssValueNumber contained "[-+]\=\d\+\(\.\d*\)\=" contains=cssUnitDecorators
|
syn match cssValueNumber contained "[-+]\=\d\+\(\.\d*\)\=" contains=cssUnitDecorators
|
||||||
syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|dpi\|dppx\|dpcm\)" contains=cssUnitDecorators
|
syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|dpi\|dppx\|dpcm\)\>" contains=cssUnitDecorators
|
||||||
syn match cssValueAngle contained "[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)" contains=cssUnitDecorators
|
syn match cssValueAngle contained "[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)\>" contains=cssUnitDecorators
|
||||||
syn match cssValueTime contained "+\=\d\+\(\.\d*\)\=\(ms\|s\)" contains=cssUnitDecorators
|
syn match cssValueTime contained "+\=\d\+\(\.\d*\)\=\(ms\|s\)\>" contains=cssUnitDecorators
|
||||||
syn match cssValueFrequency contained "+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)" contains=cssUnitDecorators
|
syn match cssValueFrequency contained "+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)\>" contains=cssUnitDecorators
|
||||||
|
|
||||||
|
|
||||||
syn match cssIncludeKeyword /@\(-[a-z]\+-\)\=\(media\|keyframes\|import\|charset\|namespace\|page\)/ contained
|
syn match cssIncludeKeyword /@\(-[a-z]\+-\)\=\(media\|keyframes\|import\|charset\|namespace\|page\)/ contained
|
||||||
@@ -116,15 +117,27 @@ syn region cssInclude start=/@namespace\>/ end=/\ze;/ transparent contains=cssSt
|
|||||||
" @font-face
|
" @font-face
|
||||||
" http://www.w3.org/TR/css3-fonts/#at-font-face-rule
|
" http://www.w3.org/TR/css3-fonts/#at-font-face-rule
|
||||||
syn match cssFontDescriptor "@font-face\>" nextgroup=cssFontDescriptorBlock skipwhite skipnl
|
syn match cssFontDescriptor "@font-face\>" nextgroup=cssFontDescriptorBlock skipwhite skipnl
|
||||||
syn region cssFontDescriptorBlock contained transparent matchgroup=cssBraces start="{" end="}" contains=cssComment,cssError,cssUnicodeEscape,cssFontProp,cssFontAttr,cssCommonAttr,cssStringQ,cssStringQQ,cssFontDescriptorProp,cssValue.*,cssFontDescriptorFunction,cssUnicodeRange,cssFontDescriptorAttr,cssNoise
|
syn region cssFontDescriptorBlock contained transparent matchgroup=cssBraces start="{" end="}" contains=cssComment,cssError,cssUnicodeEscape,cssCommonAttr,cssFontDescriptorProp,cssValue.*,cssFontDescriptorFunction,cssFontDescriptorAttr,cssNoise
|
||||||
"syn match cssFontDescriptorProp contained "\<\(unicode-range\|unit-per-em\|panose-1\|cap-height\|x-height\|definition-src\)\>"
|
|
||||||
"syn keyword cssFontDescriptorProp contained src stemv stemh slope ascent descent widths bbox baseline centerline mathline topline
|
syn match cssFontDescriptorProp contained "\<font-family\>"
|
||||||
syn keyword cssFontDescriptorProp contained src
|
syn keyword cssFontDescriptorProp contained src
|
||||||
|
syn match cssFontDescriptorProp contained "\<font-\(style\|weight\|stretch\)\>"
|
||||||
syn match cssFontDescriptorProp contained "\<unicode-range\>"
|
syn match cssFontDescriptorProp contained "\<unicode-range\>"
|
||||||
syn keyword cssFontDescriptorAttr contained all
|
syn match cssFontDescriptorProp contained "\<font-\(variant\|feature-settings\)\>"
|
||||||
|
|
||||||
|
" src functions
|
||||||
syn region cssFontDescriptorFunction contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline keepend
|
syn region cssFontDescriptorFunction contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline keepend
|
||||||
syn match cssUnicodeRange contained "U+[0-9A-Fa-f?]\+"
|
" font-sytle and font-weight attributes
|
||||||
syn match cssUnicodeRange contained "U+\x\+-\x\+"
|
syn keyword cssFontDescriptorAttr contained normal italic oblique bold
|
||||||
|
" font-stretch attributes
|
||||||
|
syn match cssFontDescriptorAttr contained "\<\(\(ultra\|extra\|semi\)-\)\=\(condensed\|expanded\)\>"
|
||||||
|
" unicode-range attributes
|
||||||
|
syn match cssFontDescriptorAttr contained "U+[0-9A-Fa-f?]\+"
|
||||||
|
syn match cssFontDescriptorAttr contained "U+\x\+-\x\+"
|
||||||
|
" font-feature-settings attributes
|
||||||
|
syn keyword cssFontDescriptorAttr contained on off
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
" The 16 basic color names
|
" The 16 basic color names
|
||||||
syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon navy olive purple red silver teal yellow
|
syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon navy olive purple red silver teal yellow
|
||||||
@@ -133,23 +146,23 @@ syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon na
|
|||||||
syn keyword cssColor contained aliceblue antiquewhite aquamarine azure
|
syn keyword cssColor contained aliceblue antiquewhite aquamarine azure
|
||||||
syn keyword cssColor contained beige bisque blanchedalmond blueviolet brown burlywood
|
syn keyword cssColor contained beige bisque blanchedalmond blueviolet brown burlywood
|
||||||
syn keyword cssColor contained cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan
|
syn keyword cssColor contained cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan
|
||||||
syn match cssColor contained /dark\(blue\|cyan\|goldenrod\|gray\|green\|grey\|khaki\)/
|
syn match cssColor contained /\<dark\(blue\|cyan\|goldenrod\|gray\|green\|grey\|khaki\)\>/
|
||||||
syn match cssColor contained /dark\(magenta\|olivegreen\|orange\|orchid\|red\|salmon\|seagreen\)/
|
syn match cssColor contained /\<dark\(magenta\|olivegreen\|orange\|orchid\|red\|salmon\|seagreen\)\>/
|
||||||
syn match cssColor contained /darkslate\(blue\|gray\|grey\)/
|
syn match cssColor contained /\<darkslate\(blue\|gray\|grey\)\>/
|
||||||
syn match cssColor contained /dark\(turquoise\|violet\)/
|
syn match cssColor contained /\<dark\(turquoise\|violet\)\>/
|
||||||
syn keyword cssColor contained deeppink deepskyblue dimgray dimgrey dodgerblue firebrick
|
syn keyword cssColor contained deeppink deepskyblue dimgray dimgrey dodgerblue firebrick
|
||||||
syn keyword cssColor contained floralwhite forestgreen gainsboro ghostwhite gold
|
syn keyword cssColor contained floralwhite forestgreen gainsboro ghostwhite gold
|
||||||
syn keyword cssColor contained goldenrod greenyellow grey honeydew hotpink
|
syn keyword cssColor contained goldenrod greenyellow grey honeydew hotpink
|
||||||
syn keyword cssColor contained indianred indigo ivory khaki lavender lavenderblush lawngreen
|
syn keyword cssColor contained indianred indigo ivory khaki lavender lavenderblush lawngreen
|
||||||
syn keyword cssColor contained lemonchiffon limegreen linen magenta
|
syn keyword cssColor contained lemonchiffon limegreen linen magenta
|
||||||
syn match cssColor contained /light\(blue\|coral\|cyan\|goldenrodyellow\|gray\|green\)/
|
syn match cssColor contained /\<light\(blue\|coral\|cyan\|goldenrodyellow\|gray\|green\)\>/
|
||||||
syn match cssColor contained /light\(grey\|pink\|salmon\|seagreen\|skyblue\|yellow\)/
|
syn match cssColor contained /\<light\(grey\|pink\|salmon\|seagreen\|skyblue\|yellow\)\>/
|
||||||
syn match cssColor contained /light\(slategray\|slategrey\|steelblue\)/
|
syn match cssColor contained /\<light\(slategray\|slategrey\|steelblue\)\>/
|
||||||
syn match cssColor contained /medium\(aquamarine\|blue\|orchid\|purple\|seagreen\)/
|
syn match cssColor contained /\<medium\(aquamarine\|blue\|orchid\|purple\|seagreen\)\>/
|
||||||
syn match cssColor contained /medium\(slateblue\|springgreen\|turquoise\|violetred\)/
|
syn match cssColor contained /\<medium\(slateblue\|springgreen\|turquoise\|violetred\)\>/
|
||||||
syn keyword cssColor contained midnightblue mintcream mistyrose moccasin navajowhite
|
syn keyword cssColor contained midnightblue mintcream mistyrose moccasin navajowhite
|
||||||
syn keyword cssColor contained oldlace olivedrab orange orangered orchid
|
syn keyword cssColor contained oldlace olivedrab orange orangered orchid
|
||||||
syn match cssColor contained /pale\(goldenrod\|green\|turquoise\|violetred\)/
|
syn match cssColor contained /\<pale\(goldenrod\|green\|turquoise\|violetred\)\>/
|
||||||
syn keyword cssColor contained papayawhip peachpuff peru pink plum powderblue
|
syn keyword cssColor contained papayawhip peachpuff peru pink plum powderblue
|
||||||
syn keyword cssColor contained rosybrown royalblue saddlebrown salmon sandybrown
|
syn keyword cssColor contained rosybrown royalblue saddlebrown salmon sandybrown
|
||||||
syn keyword cssColor contained seagreen seashell sienna skyblue slateblue
|
syn keyword cssColor contained seagreen seashell sienna skyblue slateblue
|
||||||
@@ -265,6 +278,7 @@ syn match cssFlexibleBoxAttr contained "\<\(inline\|block\)-axis\>"
|
|||||||
" 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/
|
||||||
syn match cssFontProp contained "\<font\(-\(family\|\|feature-settings\|kerning\|language-override\|size\(-adjust\)\=\|stretch\|style\|synthesis\|variant\(-\(alternates\|caps\|east-asian\|ligatures\|numeric\|position\)\)\=\|weight\)\)\=\>"
|
syn match cssFontProp contained "\<font\(-\(family\|\|feature-settings\|kerning\|language-override\|size\(-adjust\)\=\|stretch\|style\|synthesis\|variant\(-\(alternates\|caps\|east-asian\|ligatures\|numeric\|position\)\)\=\|weight\)\)\=\>"
|
||||||
|
|
||||||
" font attributes
|
" font attributes
|
||||||
syn keyword cssFontAttr contained icon menu caption
|
syn keyword cssFontAttr contained icon menu caption
|
||||||
syn match cssFontAttr contained "\<small-\(caps\|caption\)\>"
|
syn match cssFontAttr contained "\<small-\(caps\|caption\)\>"
|
||||||
@@ -272,27 +286,21 @@ syn match cssFontAttr contained "\<message-box\>"
|
|||||||
syn match cssFontAttr contained "\<status-bar\>"
|
syn match cssFontAttr contained "\<status-bar\>"
|
||||||
syn keyword cssFontAttr contained larger smaller
|
syn keyword cssFontAttr contained larger smaller
|
||||||
syn match cssFontAttr contained "\<\(x\{1,2\}-\)\=\(large\|small\)\>"
|
syn match cssFontAttr contained "\<\(x\{1,2\}-\)\=\(large\|small\)\>"
|
||||||
|
|
||||||
" font-family attributes
|
" font-family attributes
|
||||||
syn match cssFontAttr contained "\<\(sans-\)\=serif\>"
|
syn match cssFontAttr contained "\<\(sans-\)\=serif\>"
|
||||||
syn keyword cssFontAttr contained Antiqua Arial Black Book Charcoal Comic Courier Dingbats Gadget Geneva Georgia Grande Helvetica Impact Linotype Lucida MS Monaco Neue New Palatino Roboto Roman Symbol Tahoma Times Trebuchet Unicode Verdana Webdings Wingdings York Zapf
|
syn keyword cssFontAttr contained Antiqua Arial Black Book Charcoal Comic Courier Dingbats Gadget Geneva Georgia Grande Helvetica Impact Linotype Lucida MS Monaco Neue New Palatino Roboto Roman Symbol Tahoma Times Trebuchet Verdana Webdings Wingdings York Zapf
|
||||||
syn keyword cssFontAttr contained cursive fantasy monospace
|
syn keyword cssFontAttr contained cursive fantasy monospace
|
||||||
|
|
||||||
" font-feature-settings attributes
|
" font-feature-settings attributes
|
||||||
syn keyword cssFontAttr contained on off
|
syn keyword cssFontAttr contained on off
|
||||||
|
|
||||||
" font-stretch attributes
|
" font-stretch attributes
|
||||||
syn match cssFontAttr contained "\<\(\(ultra\|extra\|semi\)-\)\=\(condensed\|expanded\)\>"
|
syn match cssFontAttr contained "\<\(\(ultra\|extra\|semi\)-\)\=\(condensed\|expanded\)\>"
|
||||||
|
|
||||||
" font-style attributes
|
" font-style attributes
|
||||||
syn keyword cssFontAttr contained italic oblique
|
syn keyword cssFontAttr contained italic oblique
|
||||||
|
" font-synthesis attributes
|
||||||
" font-variant-caps attributes
|
syn keyword cssFontAttr contained weight style
|
||||||
syn match cssFontAttr contained "\<\(all-\)\=\(small-\|petite-\|titling-\)caps\>"
|
|
||||||
syn keyword cssFontAttr contained unicase
|
|
||||||
|
|
||||||
" font-weight attributes
|
" font-weight attributes
|
||||||
syn keyword cssFontAttr contained bold bolder lighter
|
syn keyword cssFontAttr contained bold bolder lighter
|
||||||
|
" TODO: font-variant-* attributes
|
||||||
"------------------------------------------------
|
"------------------------------------------------
|
||||||
|
|
||||||
" Webkit specific property/attributes
|
" Webkit specific property/attributes
|
||||||
|
|||||||
@@ -106,10 +106,9 @@ fu! <sid>DoHighlight() "{{{3
|
|||||||
\ . s:col . '/ contains=CSVDelimiter'
|
\ . s:col . '/ contains=CSVDelimiter'
|
||||||
exe 'syn match CSVColumnOdd nextgroup=CSVColumnEven /'
|
exe 'syn match CSVColumnOdd nextgroup=CSVColumnEven /'
|
||||||
\ . s:col . '/ contains=CSVDelimiter'
|
\ . s:col . '/ contains=CSVDelimiter'
|
||||||
|
exe 'syn match CSVColumnHeaderEven nextgroup=CSVColumnHeaderOdd /\%<'. (get(b:, 'csv_headerline', 1)+1).'l'
|
||||||
exe 'syn match CSVColumnHeaderEven nextgroup=CSVColumnHeaderOdd /\%1l'
|
|
||||||
\. s:col . '/ contains=CSVDelimiter'
|
\. s:col . '/ contains=CSVDelimiter'
|
||||||
exe 'syn match CSVColumnHeaderOdd nextgroup=CSVColumnHeaderEven /\%1l'
|
exe 'syn match CSVColumnHeaderOdd nextgroup=CSVColumnHeaderEven /\%<'. (get(b:, 'csv_headerline', 1)+1).'l'
|
||||||
\. s:col . '/ contains=CSVDelimiter'
|
\. s:col . '/ contains=CSVDelimiter'
|
||||||
else
|
else
|
||||||
for i in range(len(b:csv_fixed_width_cols))
|
for i in range(len(b:csv_fixed_width_cols))
|
||||||
@@ -137,36 +136,12 @@ fu! <sid>DoSyntaxDefinitions() "{{{3
|
|||||||
|
|
||||||
hi def link CSVColumnHeaderOdd WarningMsg
|
hi def link CSVColumnHeaderOdd WarningMsg
|
||||||
hi def link CSVColumnHeaderEven 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 CSVColumnOdd DiffAdd
|
||||||
hi def link CSVColumnEven DiffChange
|
hi def link CSVColumnEven DiffChange
|
||||||
" Old Version
|
|
||||||
if 0
|
|
||||||
if &t_Co < 88
|
|
||||||
if !exists("b:csv_fixed_width_cols")
|
|
||||||
hi default CSVColumnHeaderOdd ctermfg=DarkRed ctermbg=15
|
|
||||||
\ guibg=grey80 guifg=black term=underline cterm=standout,bold
|
|
||||||
\ gui=bold,underline
|
|
||||||
endif
|
|
||||||
hi default CSVColumnOdd ctermfg=DarkRed ctermbg=15 guibg=grey80
|
|
||||||
\ guifg=black term=underline cterm=bold gui=underline
|
|
||||||
else
|
|
||||||
if !exists("b:csv_fixed_width_cols")
|
|
||||||
hi default CSVColumnHeaderOdd ctermfg=darkblue ctermbg=white
|
|
||||||
\ guibg=grey80 guifg=black cterm=standout,underline
|
|
||||||
\ gui=bold,underline
|
|
||||||
endif
|
|
||||||
hi default CSVColumnOdd ctermfg=darkblue ctermbg=white guibg=grey80
|
|
||||||
\ guifg=black cterm=reverse,underline gui=underline
|
|
||||||
endif
|
|
||||||
|
|
||||||
" ctermbg=8 should be safe, even in 8 color terms
|
|
||||||
if !exists("b:csv_fixed_width_cols")
|
|
||||||
hi default CSVColumnHeaderEven ctermfg=white ctermbg=darkgrey
|
|
||||||
\ guibg=grey50 guifg=black term=bold cterm=standout,underline
|
|
||||||
\ gui=bold,underline
|
|
||||||
endif
|
|
||||||
hi default CSVColumnEven ctermfg=white ctermbg=darkgrey guibg=grey50
|
|
||||||
\ guifg=black term=bold cterm=underline gui=bold,underline
|
|
||||||
endif
|
endif
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
|
|||||||
@@ -7,12 +7,10 @@ if exists("b:current_syntax")
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let b:current_syntax = "dockerfile"
|
|
||||||
|
|
||||||
syntax case ignore
|
syntax case ignore
|
||||||
|
|
||||||
syntax match dockerfileKeyword /\v^\s*(FROM|MAINTAINER|RUN|CMD|EXPOSE|ENV|ADD)\s/
|
syntax match dockerfileKeyword /\v^\s*(FROM|MAINTAINER|RUN|CMD|EXPOSE|ENV|ADD)\s/
|
||||||
syntax match dockerfileKeyword /\v^\s*(ENTRYPOINT|VOLUME|USER|WORKDIR)\s/
|
syntax match dockerfileKeyword /\v^\s*(ENTRYPOINT|VOLUME|USER|WORKDIR|COPY)\s/
|
||||||
highlight link dockerfileKeyword Keyword
|
highlight link dockerfileKeyword Keyword
|
||||||
|
|
||||||
syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/
|
syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/
|
||||||
@@ -20,3 +18,14 @@ highlight link dockerfileString String
|
|||||||
|
|
||||||
syntax match dockerfileComment "\v^\s*#.*$"
|
syntax match dockerfileComment "\v^\s*#.*$"
|
||||||
highlight link dockerfileComment Comment
|
highlight link dockerfileComment Comment
|
||||||
|
|
||||||
|
syntax include @DockerSh syntax/sh.vim
|
||||||
|
try
|
||||||
|
syntax include @DockerSh after/syntax/sh.vim
|
||||||
|
catch
|
||||||
|
endtry
|
||||||
|
|
||||||
|
syntax region dockerShSnip matchgroup=DockerShGroup start="^\s*\%(RUN\|CMD\)\s\+" end="$" contains=@DockerSh
|
||||||
|
highlight link DockerShGroup dockerfileKeyword
|
||||||
|
|
||||||
|
let b:current_syntax = "dockerfile"
|
||||||
|
|||||||
66
syntax/eelixir.vim
Normal file
66
syntax/eelixir.vim
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
" Vim syntax file
|
||||||
|
" Language: Embedded Elixir
|
||||||
|
" URL: https://github.com/elixir-lang/vim-elixir
|
||||||
|
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists("main_syntax")
|
||||||
|
let main_syntax = 'eelixir'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists("g:eelixir_default_subtype")
|
||||||
|
let g:eelixir_default_subtype = "html"
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists("b:eelixir_subtype")
|
||||||
|
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
|
||||||
|
let b:eelixir_subtype = matchstr(s:lines,'eelixir_subtype=\zs\w\+')
|
||||||
|
if b:eelixir_subtype == ''
|
||||||
|
let b:eelixir_subtype = matchstr(&filetype,'^eex\.\zs\w\+')
|
||||||
|
endif
|
||||||
|
if b:eelixir_subtype == ''
|
||||||
|
let b:eelixir_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.eex\|\.eelixir\)\+$','',''),'\.\zs\w\+$')
|
||||||
|
endif
|
||||||
|
if b:eelixir_subtype == 'ex'
|
||||||
|
let b:eelixir_subtype = 'elixir'
|
||||||
|
elseif b:eelixir_subtype == 'exs'
|
||||||
|
let b:eelixir_subtype = 'elixir'
|
||||||
|
elseif b:eelixir_subtype == 'yml'
|
||||||
|
let b:eelixir_subtype = 'yaml'
|
||||||
|
elseif b:eelixir_subtype == 'js'
|
||||||
|
let b:eelixir_subtype = 'javascript'
|
||||||
|
elseif b:eelixir_subtype == 'txt'
|
||||||
|
" Conventional; not a real file type
|
||||||
|
let b:eelixir_subtype = 'text'
|
||||||
|
elseif b:eelixir_subtype == ''
|
||||||
|
let b:eelixir_subtype = g:eelixir_default_subtype
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if exists("b:eelixir_subtype") && b:eelixir_subtype != ''
|
||||||
|
exe "runtime! syntax/".b:eelixir_subtype.".vim"
|
||||||
|
unlet! b:current_syntax
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn include @elixirTop syntax/elixir.vim
|
||||||
|
|
||||||
|
syn cluster eelixirRegions contains=eelixirBlock,eelixirExpression,eelixirComment
|
||||||
|
|
||||||
|
exe 'syn region eelixirExpression matchgroup=eelixirDelimiter start="<%" end="%\@<!%>" contains=@elixirTop containedin=ALLBUT,@eelixirRegions keepend'
|
||||||
|
exe 'syn region eelixirExpression matchgroup=eelixirDelimiter start="<%=" end="%\@<!%>" contains=@elixirTop containedin=ALLBUT,@eelixirRegions keepend'
|
||||||
|
exe 'syn region eelixirQuote matchgroup=eelixirDelimiter start="<%%" end="%\@<!%>" contains=@elixirTop containedin=ALLBUT,@eelixirRegions keepend'
|
||||||
|
exe 'syn region eelixirComment matchgroup=eelixirDelimiter start="<%#" end="%\@<!%>" contains=elixirTodo,@Spell containedin=ALLBUT,@eelixirRegions keepend'
|
||||||
|
|
||||||
|
" Define the default highlighting.
|
||||||
|
|
||||||
|
hi def link eelixirDelimiter PreProc
|
||||||
|
hi def link eelixirComment Comment
|
||||||
|
|
||||||
|
let b:current_syntax = 'eelixir'
|
||||||
|
|
||||||
|
if main_syntax == 'eelixir'
|
||||||
|
unlet main_syntax
|
||||||
|
endif
|
||||||
|
|
||||||
@@ -15,13 +15,15 @@ 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_number is_pid is_port is_record is_reference is_tuple is_exception
|
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 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
|
||||||
|
|
||||||
syn keyword elixirInclude import require alias use
|
syn keyword elixirInclude import require alias use
|
||||||
|
|
||||||
|
syn keyword elixirSelf self
|
||||||
|
|
||||||
syn match elixirId '\<[_a-zA-Z]\w*[!?]\?\>'
|
syn match elixirId '\<[_a-zA-Z]\w*[!?]\?\>'
|
||||||
|
|
||||||
" This unfortunately also matches function names in function calls
|
" This unfortunately also matches function names in function calls
|
||||||
@@ -63,14 +65,14 @@ syn match elixirRegexQuantifier "[*?+][?+]\=" contained display
|
|||||||
syn match elixirRegexQuantifier "{\d\+\%(,\d*\)\=}?\=" contained display
|
syn match elixirRegexQuantifier "{\d\+\%(,\d*\)\=}?\=" contained display
|
||||||
syn match elixirRegexCharClass "\[:\(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|word\|xdigit\):\]" contained display
|
syn match elixirRegexCharClass "\[:\(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|word\|xdigit\):\]" contained display
|
||||||
|
|
||||||
syn region elixirRegex matchgroup=elixirDelimiter start="%r/" end="/[uiomxfr]*" skip="\\\\" contains=@elixirRegexSpecial
|
syn region elixirRegex matchgroup=elixirRegexDelimiter start="%r/" end="/[uiomxfr]*" skip="\\\\" contains=@elixirRegexSpecial
|
||||||
|
|
||||||
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=elixirDelimiter start="'" end="'" skip="\\'"
|
syn region elixirString matchgroup=elixirStringDelimiter start="'" end="'" skip="\\'|\\\\"
|
||||||
syn region elixirString matchgroup=elixirDelimiter start='"' end='"' skip='\\"' contains=@elixirStringContained
|
syn region elixirString matchgroup=elixirStringDelimiter start='"' end='"' skip='\\"' contains=@elixirStringContained
|
||||||
syn region elixirInterpolation matchgroup=elixirDelimiter start="#{" end="}" contained contains=ALLBUT,elixirComment,@elixirNotTop
|
syn region elixirInterpolation matchgroup=elixirInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,elixirComment,@elixirNotTop
|
||||||
|
|
||||||
syn region elixirDocStringStart matchgroup=elixirDocString start=+"""+ end=+$+ oneline contains=ALLBUT,@elixirNotTop
|
syn region elixirDocStringStart matchgroup=elixirDocString start=+"""+ end=+$+ oneline contains=ALLBUT,@elixirNotTop
|
||||||
syn region elixirDocStringStart matchgroup=elixirDocString start=+'''+ end=+$+ oneline contains=ALLBUT,@elixirNotTop
|
syn region elixirDocStringStart matchgroup=elixirDocString start=+'''+ end=+$+ oneline contains=ALLBUT,@elixirNotTop
|
||||||
@@ -83,25 +85,25 @@ syn match elixirString "\(\w\)\@<!?\%(\\\(x\d{1,2}\|\h{1,2}\h\@!\>\|
|
|||||||
syn region elixirBlock matchgroup=elixirKeyword start="\<do\>\(:\)\@!" end="\<end\>" contains=ALLBUT,@elixirNotTop fold
|
syn region elixirBlock matchgroup=elixirKeyword start="\<do\>\(:\)\@!" end="\<end\>" contains=ALLBUT,@elixirNotTop fold
|
||||||
syn region elixirAnonymousFunction matchgroup=elixirKeyword start="\<fn\>" end="\<end\>" contains=ALLBUT,@elixirNotTop fold
|
syn region elixirAnonymousFunction matchgroup=elixirKeyword start="\<fn\>" end="\<end\>" contains=ALLBUT,@elixirNotTop fold
|
||||||
|
|
||||||
syn region elixirArguments start="(" end=")" contained contains=elixirOperator,elixirAtom,elixirPseudoVariable,elixirAlias,elixirBoolean,elixirVariable,elixirUnusedVariable,elixirNumber,elixirDocString,elixirAtomInterpolated,elixirRegex,elixirString,elixirDelimiter
|
syn region elixirArguments start="(" end=")" contained contains=elixirOperator,elixirAtom,elixirPseudoVariable,elixirAlias,elixirBoolean,elixirVariable,elixirUnusedVariable,elixirNumber,elixirDocString,elixirAtomInterpolated,elixirRegex,elixirString,elixirStringDelimiter,elixirRegexDelimiter,elixirInterpolationDelimiter,elixirSigilDelimiter
|
||||||
|
|
||||||
syn match elixirDelimEscape "\\[(<{\[)>}\]/\"'|]" transparent display contained contains=NONE
|
syn match elixirDelimEscape "\\[(<{\[)>}\]/\"'|]" transparent display contained contains=NONE
|
||||||
|
|
||||||
syn region elixirSigil matchgroup=elixirDelimiter start="\~\u\z(/\|\"\|'\||\)" end="\z1" skip="\\\\\|\\\z1" contains=elixirDelimEscape fold
|
syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\u\z(/\|\"\|'\||\)" end="\z1" skip="\\\\\|\\\z1" contains=elixirDelimEscape fold
|
||||||
syn region elixirSigil matchgroup=elixirDelimiter start="\~\u{" end="}" skip="\\\\\|\\}" contains=elixirDelimEscape fold
|
syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\u{" end="}" skip="\\\\\|\\}" contains=elixirDelimEscape fold
|
||||||
syn region elixirSigil matchgroup=elixirDelimiter start="\~\u<" end=">" skip="\\\\\|\\>" contains=elixirDelimEscape fold
|
syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\u<" end=">" skip="\\\\\|\\>" contains=elixirDelimEscape fold
|
||||||
syn region elixirSigil matchgroup=elixirDelimiter start="\~\u\[" end="\]" skip="\\\\\|\\\]" contains=elixirDelimEscape fold
|
syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\u\[" end="\]" skip="\\\\\|\\\]" contains=elixirDelimEscape fold
|
||||||
syn region elixirSigil matchgroup=elixirDelimiter start="\~\u(" end=")" skip="\\\\\|\\)" contains=elixirDelimEscape fold
|
syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\u(" end=")" skip="\\\\\|\\)" contains=elixirDelimEscape fold
|
||||||
|
|
||||||
syn region elixirSigil matchgroup=elixirDelimiter start="\~\l\z(/\|\"\|'\||\)" end="\z1" skip="\\\\\|\\\z1" fold
|
syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l\z(/\|\"\|'\||\)" end="\z1" skip="\\\\\|\\\z1" fold
|
||||||
syn region elixirSigil matchgroup=elixirDelimiter start="\~\l{" end="}" skip="\\\\\|\\}" fold contains=@elixirStringContained,elixirRegexEscapePunctuation
|
syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l{" end="}" skip="\\\\\|\\}" fold contains=@elixirStringContained,elixirRegexEscapePunctuation
|
||||||
syn region elixirSigil matchgroup=elixirDelimiter start="\~\l<" end=">" skip="\\\\\|\\>" fold contains=@elixirStringContained,elixirRegexEscapePunctuation
|
syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l<" end=">" skip="\\\\\|\\>" fold contains=@elixirStringContained,elixirRegexEscapePunctuation
|
||||||
syn region elixirSigil matchgroup=elixirDelimiter start="\~\l\[" end="\]" skip="\\\\\|\\\]" fold contains=@elixirStringContained,elixirRegexEscapePunctuation
|
syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l\[" end="\]" skip="\\\\\|\\\]" fold contains=@elixirStringContained,elixirRegexEscapePunctuation
|
||||||
syn region elixirSigil matchgroup=elixirDelimiter start="\~\l(" end=")" skip="\\\\\|\\)" fold contains=@elixirStringContained,elixirRegexEscapePunctuation
|
syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l(" end=")" skip="\\\\\|\\)" fold contains=@elixirStringContained,elixirRegexEscapePunctuation
|
||||||
|
|
||||||
" Sigils surrounded with docString
|
" Sigils surrounded with docString
|
||||||
syn region elixirSigil matchgroup=elixirDelimiter start=+\~\a\z("""\)+ end=+^\s*\zs\z1+ skip=+\\"+ fold
|
syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z("""\)+ end=+^\s*\zs\z1+ skip=+\\"+ fold
|
||||||
syn region elixirSigil matchgroup=elixirDelimiter start=+\~\a\z('''\)+ end=+^\s*\zs\z1+ skip=+\\'+ fold
|
syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z('''\)+ end=+^\s*\zs\z1+ skip=+\\'+ fold
|
||||||
|
|
||||||
" Defines
|
" Defines
|
||||||
syn keyword elixirDefine def nextgroup=elixirFunctionDeclaration skipwhite skipnl
|
syn keyword elixirDefine def nextgroup=elixirFunctionDeclaration skipwhite skipnl
|
||||||
@@ -117,7 +119,7 @@ syn keyword elixirDelegateDefine defdelegate nextgroup=elixirDelegateDec
|
|||||||
syn keyword elixirOverridableDefine defoverridable nextgroup=elixirOverridableDeclaration skipwhite skipnl
|
syn keyword elixirOverridableDefine defoverridable nextgroup=elixirOverridableDeclaration skipwhite skipnl
|
||||||
syn keyword elixirExceptionDefine defexception nextgroup=elixirExceptionDeclaration skipwhite skipnl
|
syn keyword elixirExceptionDefine defexception nextgroup=elixirExceptionDeclaration skipwhite skipnl
|
||||||
syn keyword elixirCallbackDefine defcallback nextgroup=elixirCallbackDeclaration skipwhite skipnl
|
syn keyword elixirCallbackDefine defcallback nextgroup=elixirCallbackDeclaration skipwhite skipnl
|
||||||
syn keyword elixirStructDefine defstruct nextgroup=elixirStructDeclaration skipwhite skipnl
|
syn keyword elixirStructDefine defstruct skipwhite skipnl
|
||||||
|
|
||||||
" Declarations
|
" Declarations
|
||||||
syn match elixirModuleDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias nextgroup=elixirBlock skipwhite skipnl
|
syn match elixirModuleDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias nextgroup=elixirBlock skipwhite skipnl
|
||||||
@@ -131,7 +133,6 @@ syn region elixirDelegateDeclaration start='\[' end='\]' contained con
|
|||||||
syn match elixirOverridableDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl
|
syn match elixirOverridableDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl
|
||||||
syn match elixirExceptionDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl
|
syn match elixirExceptionDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl
|
||||||
syn match elixirCallbackDeclaration "[^[:space:];#<,()\[\]]\+" contained contains=elixirFunctionDeclaration skipwhite skipnl
|
syn match elixirCallbackDeclaration "[^[:space:];#<,()\[\]]\+" contained contains=elixirFunctionDeclaration skipwhite skipnl
|
||||||
syn match elixirStructDeclaration "[^[:space:];#<]\+" contained nextgroup=elixirArguments skipwhite skipnl
|
|
||||||
|
|
||||||
syn cluster elixirDeclaration contains=elixirFunctionDeclaration,elixirModuleDeclaration,elixirProtocolDeclaration,elixirImplDeclaration,elixirRecordDeclaration,elixirMacroDeclaration,elixirDelegateDeclaration,elixirOverridableDeclaration,elixirExceptionDeclaration,elixirCallbackDeclaration,elixirStructDeclaration
|
syn cluster elixirDeclaration contains=elixirFunctionDeclaration,elixirModuleDeclaration,elixirProtocolDeclaration,elixirImplDeclaration,elixirRecordDeclaration,elixirMacroDeclaration,elixirDelegateDeclaration,elixirOverridableDeclaration,elixirExceptionDeclaration,elixirCallbackDeclaration,elixirStructDeclaration
|
||||||
|
|
||||||
@@ -161,6 +162,7 @@ hi def link elixirPseudoVariable Constant
|
|||||||
hi def link elixirAlias Type
|
hi def link elixirAlias Type
|
||||||
hi def link elixirBoolean Boolean
|
hi def link elixirBoolean Boolean
|
||||||
hi def link elixirVariable Identifier
|
hi def link elixirVariable Identifier
|
||||||
|
hi def link elixirSelf Identifier
|
||||||
hi def link elixirUnusedVariable Comment
|
hi def link elixirUnusedVariable Comment
|
||||||
hi def link elixirNumber Number
|
hi def link elixirNumber Number
|
||||||
hi def link elixirDocString String
|
hi def link elixirDocString String
|
||||||
@@ -173,4 +175,7 @@ hi def link elixirRegexQuantifier elixirSpecial
|
|||||||
hi def link elixirSpecial Special
|
hi def link elixirSpecial Special
|
||||||
hi def link elixirString String
|
hi def link elixirString String
|
||||||
hi def link elixirSigil String
|
hi def link elixirSigil String
|
||||||
hi def link elixirDelimiter Delimiter
|
hi def link elixirStringDelimiter Delimiter
|
||||||
|
hi def link elixirRegexDelimiter Delimiter
|
||||||
|
hi def link elixirInterpolationDelimiter Delimiter
|
||||||
|
hi def link elixirSigilDelimiter Delimiter
|
||||||
|
|||||||
@@ -1,19 +1,34 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: Erlang
|
" Language: Erlang (http://www.erlang.org)
|
||||||
" Maintainer: Oscar Hellstr<74>m <oscar@oscarh.net>
|
" Maintainer: Csaba Hoch <csaba.hoch@gmail.com>
|
||||||
" URL: http://oscar.hellstrom.st
|
" Contributor: Adam Rutkowski <hq@mtod.org>
|
||||||
" Version: 2010-08-09
|
" Last Update: 2013-Nov-23
|
||||||
" ------------------------------------------------------------------------------
|
" License: Vim license
|
||||||
" {{{1
|
" URL: https://github.com/hcs42/vim-erlang
|
||||||
" Options:
|
|
||||||
"
|
" Acknowledgements: This script was originally created by Kresimir Marzic [1].
|
||||||
" Erlang BIFs
|
" The script was then revamped by Csaba Hoch [2]. During the revamp, the new
|
||||||
" g:erlangHighlightBif - highlight erlang built in functions (default: off)
|
" highlighting style and some code was taken from the Erlang syntax script
|
||||||
"
|
" that is part of vimerl [3], created by Oscar Hellström [4] and improved by
|
||||||
" }}}
|
" Ricardo Catalinas Jiménez [5].
|
||||||
" -----------------------------------------------------------------------------
|
|
||||||
|
" [1]: Kreąimir Marľić (Kresimir Marzic) <kmarzic@fly.srk.fer.hr>
|
||||||
|
" [2]: Csaba Hoch <csaba.hoch@gmail.com>
|
||||||
|
" [3]: https://github.com/jimenezrick/vimerl
|
||||||
|
" [4]: Oscar Hellström <oscar@oscarh.net> (http://oscar.hellstrom.st)
|
||||||
|
" [5]: Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
||||||
|
|
||||||
|
" Customization:
|
||||||
|
"
|
||||||
|
" To use the old highlighting style, add this to your .vimrc:
|
||||||
|
"
|
||||||
|
" let g:erlang_old_style_highlight = 1
|
||||||
|
"
|
||||||
|
" To highlight further module attributes, add them to
|
||||||
|
" ~/.vim/after/syntax/erlang.vim:
|
||||||
|
"
|
||||||
|
" syn keyword erlangAttribute myattr1 myattr2 contained
|
||||||
|
|
||||||
" Setup {{{1
|
|
||||||
" For version 5.x: Clear all syntax items
|
" For version 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
|
||||||
if version < 600
|
if version < 600
|
||||||
@@ -22,116 +37,235 @@ elseif exists("b:current_syntax")
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Erlang is case sensitive
|
let s:cpo_save = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
" Case sensitive
|
||||||
syn case match
|
syn case match
|
||||||
|
|
||||||
" Match groups {{{1
|
if version >= 600
|
||||||
syn match erlangStringModifier /\\./ contained
|
setlocal iskeyword+=$,@-@
|
||||||
syn match erlangStringModifier /\~\%(-\?[0-9*]\+\)\?\%(\.[0-9*]\+\..\?\)\?\%(c\|f\|e\|g\|s\|w\|p\|W\|P\|B\|X\|#\|b\|+\|n\|i\)/ contained
|
endif
|
||||||
syn match erlangModifier /\$\\\?./
|
|
||||||
|
" Comments
|
||||||
syn match erlangInteger /\<\%([0-9]\+#[0-9a-fA-F]\+\|[0-9]\+\)\>/
|
syn match erlangComment '%.*$' contains=erlangCommentAnnotation,erlangTodo
|
||||||
syn match erlangFloat /\<[0-9]\+\.[0-9]\+\%(e-\?[0-9]\+\)\?\>/
|
syn match erlangCommentAnnotation ' \@<=@\%(clear\|docfile\|end\|headerfile\|todo\|TODO\|type\|author\|copyright\|doc\|reference\|see\|since\|title\|version\|deprecated\|hidden\|private\|equiv\|spec\|throws\)' contained
|
||||||
|
syn match erlangCommentAnnotation /`[^']*'/ contained
|
||||||
syn keyword erlangTodo TODO FIXME XXX contained
|
syn keyword erlangTodo TODO FIXME XXX contained
|
||||||
syn match erlangComment /%.*$/ contains=@Spell,erlangTodo
|
|
||||||
|
" Numbers (minimum base is 2, maximum is 36.)
|
||||||
syn keyword erlangKeyword band bor bnot bsl bsr bxor div rem xor
|
syn match erlangNumberInteger '\<\d\+\>'
|
||||||
syn keyword erlangKeyword try catch begin receive after cond fun let query
|
syn match erlangNumberInteger '\<\%([2-9]\|[12]\d\|3[0-6]\)\+#[[:alnum:]]\+\>'
|
||||||
|
syn match erlangNumberFloat '\<\d\+\.\d\+\%([eE][+-]\=\d\+\)\=\>'
|
||||||
syn keyword erlangConditional case if of end
|
|
||||||
syn keyword erlangConditional not and or andalso orelse
|
" Strings, atoms, characters
|
||||||
syn keyword erlangConditional when
|
syn region erlangString start=/"/ end=/"/ contains=erlangStringModifier
|
||||||
|
syn region erlangQuotedAtom start=/'/ end=/'/ contains=erlangQuotedAtomModifier
|
||||||
syn keyword erlangBoolean true false
|
syn match erlangStringModifier '\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)\|\~\%([ni~]\|\%(-\=\d\+\|\*\)\=\.\=\%(\*\|\d\+\)\=\%(\..\)\=[tl]*[cfegswpWPBX#bx+]\)' contained
|
||||||
|
syn match erlangQuotedAtomModifier '\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)' contained
|
||||||
syn keyword erlangGuard is_list is_alive is_atom is_binary is_bitstring is_boolean is_tuple is_number is_integer is_float is_function is_constant is_pid is_port is_reference is_record is_process_alive
|
syn match erlangModifier '\$\%([^\\]\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)\)'
|
||||||
|
|
||||||
syn match erlangOperator /\/\|*\|+\|-\|++\|--/
|
" Operators, separators
|
||||||
syn match erlangOperator /->\|<-\|||\||\|!\|=/
|
syn match erlangOperator '==\|=:=\|/=\|=/=\|<\|=<\|>\|>=\|=>\|:=\|++\|--\|=\|!\|<-\|+\|-\|\*\|\/'
|
||||||
syn match erlangOperator /=:=\|==\|\/=\|=\/=\|<\|>\|=<\|>=/
|
syn keyword erlangOperator div rem or xor bor bxor bsl bsr and band not bnot andalso orelse
|
||||||
syn keyword erlangOperator div rem
|
syn match erlangBracket '{\|}\|\[\|]\||\|||'
|
||||||
|
syn match erlangPipe '|'
|
||||||
syn region erlangString start=/"/ end=/"/ skip=/\\/ contains=@Spell,erlangStringModifier
|
syn match erlangRightArrow '->'
|
||||||
|
|
||||||
syn match erlangVariable /\<[A-Z_]\w*\>/
|
" Atoms, function calls (order is important)
|
||||||
syn match erlangAtom /\%(\%(^-\)\|#\)\@<!\<[a-z][A-Za-z0-9_]*\>\%(\s*[(:]\)\@!/
|
syn match erlangAtom '\<\l[[:alnum:]_@]*' contains=erlangBoolean
|
||||||
syn match erlangAtom /\\\@<!'[^']*\\\@<!'/
|
syn keyword erlangBoolean true false contained
|
||||||
|
syn match erlangLocalFuncCall '\<\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*(\)\@=' contains=erlangBIF
|
||||||
syn match erlangRecord /#\w\+/
|
syn match erlangLocalFuncRef '\<\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*/\)\@='
|
||||||
|
syn match erlangGlobalFuncCall '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\|\n\|%.*\n\)*\)*\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*:\%(\s\|\n\|%.*\n\)*\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*(\)\@=' contains=erlangComment
|
||||||
syn match erlangTuple /{\|}/
|
syn match erlangGlobalFuncRef '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\|\n\|%.*\n\)*\)*\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*:\%(\s\|\n\|%.*\n\)*\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*/\)\@=' contains=erlangComment
|
||||||
syn match erlangList /\[\|\]/
|
|
||||||
|
" Variables, macros, records, maps
|
||||||
syn match erlangAttribute /^-\%(vsn\|author\|copyright\|compile\|deprecated\|module\|export\|import\|behaviour\|export_type\|ignore_xref\) *(\@=/
|
syn match erlangVariable '\<[A-Z_][[:alnum:]_@]*'
|
||||||
syn match erlangInclude /^-include\%(_lib\)\?\s*(\@=/
|
syn match erlangMacro '??\=[[:alnum:]_@]\+'
|
||||||
syn match erlangRecordDef /^-record\s*(\@=/
|
syn match erlangMacro '\%(-define(\)\@<=[[:alnum:]_@]\+'
|
||||||
syn match erlangDefine /^-\%(define\|undef\)\s*(\@=/
|
syn match erlangMap '#'
|
||||||
syn match erlangPreCondit /^-\%(ifdef\|ifndef\|else\|endif\)\%(\s*(\@=\)\?/
|
syn match erlangRecord '#\s*\l[[:alnum:]_@]*'
|
||||||
|
|
||||||
syn match erlangType /^-\%(spec\|type\)[( ]\@=/
|
" Shebang (this line has to be after the ErlangMap)
|
||||||
|
syn match erlangShebang '^#!.*'
|
||||||
syn match erlangMacro /\%(-define(\)\@<=\w\+/
|
|
||||||
syn match erlangMacro /?\w\+/
|
" Bitstrings
|
||||||
|
syn match erlangBitType '\%(\/\%(\s\|\n\|%.*\n\)*\)\@<=\%(integer\|float\|binary\|bytes\|bitstring\|bits\|binary\|utf8\|utf16\|utf32\|signed\|unsigned\|big\|little\|native\|unit\)\%(\%(\s\|\n\|%.*\n\)*-\%(\s\|\n\|%.*\n\)*\%(integer\|float\|binary\|bytes\|bitstring\|bits\|binary\|utf8\|utf16\|utf32\|signed\|unsigned\|big\|little\|native\|unit\)\)*' contains=erlangComment
|
||||||
syn match erlangBitType /\%(\/\|-\)\@<=\%(bits\|bitstring\|binary\|integer\|float\|unit\)\>/
|
|
||||||
syn match erlangBitSize /:\@<=[0-9]\+/
|
" Constants and Directives
|
||||||
|
syn match erlangUnknownAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\l[[:alnum:]_@]*' contains=erlangComment
|
||||||
syn match erlangBinary /<<\|>>/
|
syn match erlangAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\%(behaviou\=r\|compile\|export\(_type\)\=\|file\|import\|module\|author\|copyright\|doc\|vsn\|on_load\)\>' contains=erlangComment
|
||||||
|
syn match erlangInclude '^\s*-\%(\s\|\n\|%.*\n\)*\%(include\|include_lib\)\>' contains=erlangComment
|
||||||
" BIFS
|
syn match erlangRecordDef '^\s*-\%(\s\|\n\|%.*\n\)*record\>' contains=erlangComment
|
||||||
syn match erlangBIF /\%([^:0-9A-Za-z_]\|\<erlang:\)\@<=\%(abs\|apply\|atom_to_list\|binary_part\|binary_to_list\|binary_to_term\|binary_to_atom\|binary_to_existing_atom\|bitstring_to_list\|check_process_code\|concat_binary\|date\|delete_module\|disconnect_node\|element\|erase\|error\|exit\|float\|float_to_list\|garbage_collect\|get\|get_keys\|group_leader\|halt\|hd\|integer_to_list\|iolist_to_binary\|iolist_size\|length\|link\|list_to_atom\|list_to_binary\|list_to_bitstring\|list_to_existing_atom\|list_to_float\|list_to_integer\|list_to_pid\|list_to_tuple\|load_module\|make_ref\|monitor_node\|node\|nodes\|now\|open_port\|pid_to_list\|port_close\|port_command\|port_connect\|port_control\|pre_loaded\|process_flag\|process_info\|processes\|purge_module\|put\|register\|registered\|round\|self\|setelement\|size\|bit_size\|byte_size\|spawn\|spawn_link\|spawn_opt\|split_binary\|statistics\|term_to_binary\|throw\|time\|tl\|trunc\|tuple_to_list\|unlink\|unregister\|whereis\)\((\|\/[0-9]\)\@=/
|
syn match erlangDefine '^\s*-\%(\s\|\n\|%.*\n\)*\%(define\|undef\)\>' contains=erlangComment
|
||||||
syn match erlangBIF /\<\%(erlang:\)\@<=\%(append_element\|bump_reductions\|cancel_timer\|decode_packet\|demonitor\|display\|fault\|fun_info\|fun_to_list\|function_exported\|get_cookie\|get_stacktrace\|hash\|hibernate\|info\|is_builtin\|loaded\|localtime\|localtime_to_universaltime\|localtime_to_universaltime\|make_tuple\|md5\|md5_init\|md5_update\|memory\|monitor\|monitor_node\|phash\|phash2\|port_call\|port_info\|port_to_list\|ports\|process_display\|raise\|read_timer\|ref_to_list\|resume_process\|send\|send_after\|send_nosuspend\|set_cookie\|spawn_monitor\|start_timer\|suspend_process\|system_flag\|system_info\|system_monitor\|trace\|trace_delivered\|trace_info\|trace_pattern\|universaltime\|universaltime_to_localtime\|yield\)(\@=/
|
syn match erlangPreCondit '^\s*-\%(\s\|\n\|%.*\n\)*\%(ifdef\|ifndef\|else\|endif\)\>' contains=erlangComment
|
||||||
syn match erlangGBIF /erlang\(:\w\)\@=/
|
syn match erlangType '^\s*-\%(\s\|\n\|%.*\n\)*\%(spec\|type\|opaque\|callback\)\>' contains=erlangComment
|
||||||
" }}}
|
|
||||||
|
" Keywords
|
||||||
" Link Erlang stuff to Vim groups {{{1
|
syn keyword erlangKeyword after begin case catch cond end fun if let of
|
||||||
hi link erlangTodo Todo
|
syn keyword erlangKeyword receive when try
|
||||||
hi link erlangString String
|
|
||||||
hi link erlangNoSpellString String
|
" Build-in-functions (BIFs)
|
||||||
hi link erlangModifier SpecialChar
|
syn keyword erlangBIF abs alive apply atom_to_binary atom_to_list contained
|
||||||
hi link erlangStringModifier SpecialChar
|
syn keyword erlangBIF binary_part binary_to_atom contained
|
||||||
hi link erlangComment Comment
|
syn keyword erlangBIF binary_to_existing_atom binary_to_float contained
|
||||||
hi link erlangVariable Identifier
|
syn keyword erlangBIF binary_to_integer bitstring_to_list contained
|
||||||
hi link erlangInclude Include
|
syn keyword erlangBIF binary_to_list binary_to_term bit_size contained
|
||||||
hi link erlangRecordDef Keyword
|
syn keyword erlangBIF byte_size check_old_code check_process_code contained
|
||||||
hi link erlangAttribute Keyword
|
syn keyword erlangBIF concat_binary date delete_module demonitor contained
|
||||||
hi link erlangKeyword Keyword
|
syn keyword erlangBIF disconnect_node element erase error exit contained
|
||||||
hi link erlangMacro Macro
|
syn keyword erlangBIF float float_to_binary float_to_list contained
|
||||||
hi link erlangDefine Define
|
syn keyword erlangBIF garbage_collect get get_keys group_leader contained
|
||||||
hi link erlangPreCondit PreCondit
|
syn keyword erlangBIF halt hd integer_to_binary integer_to_list contained
|
||||||
hi link erlangPreProc PreProc
|
syn keyword erlangBIF iolist_to_binary iolist_size is_alive contained
|
||||||
hi link erlangDelimiter Delimiter
|
syn keyword erlangBIF is_atom is_binary is_bitstring is_boolean contained
|
||||||
hi link erlangBitDelimiter Normal
|
syn keyword erlangBIF is_float is_function is_integer is_list contained
|
||||||
hi link erlangOperator Operator
|
syn keyword erlangBIF is_number is_pid is_port is_process_alive contained
|
||||||
hi link erlangConditional Conditional
|
syn keyword erlangBIF is_record is_reference is_tuple length link contained
|
||||||
hi link erlangGuard Conditional
|
syn keyword erlangBIF list_to_atom list_to_binary contained
|
||||||
hi link erlangBoolean Boolean
|
syn keyword erlangBIF list_to_bitstring list_to_existing_atom contained
|
||||||
hi link erlangAtom Constant
|
syn keyword erlangBIF list_to_float list_to_integer list_to_pid contained
|
||||||
hi link erlangRecord Structure
|
syn keyword erlangBIF list_to_tuple load_module make_ref max min contained
|
||||||
hi link erlangInteger Number
|
syn keyword erlangBIF module_loaded monitor monitor_node node contained
|
||||||
hi link erlangFloat Number
|
syn keyword erlangBIF nodes now open_port pid_to_list port_close contained
|
||||||
hi link erlangFloat Number
|
syn keyword erlangBIF port_command port_connect pre_loaded contained
|
||||||
hi link erlangFloat Number
|
syn keyword erlangBIF process_flag process_flag process_info contained
|
||||||
hi link erlangFloat Number
|
syn keyword erlangBIF process purge_module put register registered contained
|
||||||
hi link erlangHex Number
|
syn keyword erlangBIF round self setelement size spawn spawn_link contained
|
||||||
hi link erlangBIF Keyword
|
syn keyword erlangBIF spawn_monitor spawn_opt split_binary contained
|
||||||
hi link erlangFun Keyword
|
syn keyword erlangBIF statistics term_to_binary throw time tl contained
|
||||||
hi link erlangList Delimiter
|
syn keyword erlangBIF trunc tuple_size tuple_to_list unlink contained
|
||||||
hi link erlangTuple Delimiter
|
syn keyword erlangBIF unregister whereis contained
|
||||||
hi link erlangBinary Keyword
|
|
||||||
hi link erlangBitVariable Identifier
|
" Sync at the beginning of functions: if this is not used, multiline string
|
||||||
hi link erlangBitType Type
|
" are not always recognized, and the indentation script cannot use the
|
||||||
hi link erlangType Type
|
" "searchpair" (because it would not always skip strings and comments when
|
||||||
hi link erlangBitSize Number
|
" looking for keywords and opening parens/brackets).
|
||||||
" }}}
|
syn sync match erlangSync grouphere NONE "^[a-z]\s*("
|
||||||
|
let b:erlang_syntax_synced = 1
|
||||||
" Optional linkings {{{1
|
|
||||||
if exists("g:erlangHighlightBif") && g:erlangHighlightBif
|
" Define the default highlighting. See ":help group-name" for the groups and
|
||||||
hi link erlangGBIF Keyword
|
" their colors.
|
||||||
|
|
||||||
|
let s:old_style = (exists("g:erlang_old_style_highlight") &&
|
||||||
|
\g:erlang_old_style_highlight == 1)
|
||||||
|
|
||||||
|
" For version 5.7 and earlier: only when not done already
|
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
||||||
|
if version >= 508 || !exists("did_erlang_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_erlang_inits = 1
|
||||||
|
command -nargs=+ HiLink hi link <args>
|
||||||
|
else
|
||||||
|
command -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
HiLink erlangComment Comment
|
||||||
|
HiLink erlangCommentAnnotation Special
|
||||||
|
HiLink erlangTodo Todo
|
||||||
|
HiLink erlangShebang Comment
|
||||||
|
|
||||||
|
" Numbers
|
||||||
|
HiLink erlangNumberInteger Number
|
||||||
|
HiLink erlangNumberFloat Float
|
||||||
|
|
||||||
|
" Strings, atoms, characters
|
||||||
|
HiLink erlangString String
|
||||||
|
|
||||||
|
if s:old_style
|
||||||
|
HiLink erlangQuotedAtom Type
|
||||||
|
else
|
||||||
|
HiLink erlangQuotedAtom String
|
||||||
|
endif
|
||||||
|
|
||||||
|
HiLink erlangStringModifier Special
|
||||||
|
HiLink erlangQuotedAtomModifier Special
|
||||||
|
HiLink erlangModifier Special
|
||||||
|
|
||||||
|
" Operators, separators
|
||||||
|
HiLink erlangOperator Operator
|
||||||
|
HiLink erlangRightArrow Operator
|
||||||
|
if s:old_style
|
||||||
|
HiLink erlangBracket Normal
|
||||||
|
HiLink erlangPipe Normal
|
||||||
|
else
|
||||||
|
HiLink erlangBracket Delimiter
|
||||||
|
HiLink erlangPipe Delimiter
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Atoms, functions, variables, macros
|
||||||
|
if s:old_style
|
||||||
|
HiLink erlangAtom Normal
|
||||||
|
HiLink erlangLocalFuncCall Normal
|
||||||
|
HiLink erlangLocalFuncRef Normal
|
||||||
|
HiLink erlangGlobalFuncCall Function
|
||||||
|
HiLink erlangGlobalFuncRef Function
|
||||||
|
HiLink erlangVariable Normal
|
||||||
|
HiLink erlangMacro Normal
|
||||||
|
HiLink erlangRecord Normal
|
||||||
|
HiLink erlangMap Normal
|
||||||
|
else
|
||||||
|
HiLink erlangAtom String
|
||||||
|
HiLink erlangLocalFuncCall Normal
|
||||||
|
HiLink erlangLocalFuncRef Normal
|
||||||
|
HiLink erlangGlobalFuncCall Normal
|
||||||
|
HiLink erlangGlobalFuncRef Normal
|
||||||
|
HiLink erlangVariable Identifier
|
||||||
|
HiLink erlangMacro Macro
|
||||||
|
HiLink erlangRecord Structure
|
||||||
|
HiLink erlangMap Structure
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Bitstrings
|
||||||
|
if !s:old_style
|
||||||
|
HiLink erlangBitType Type
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Constants and Directives
|
||||||
|
if s:old_style
|
||||||
|
HiLink erlangAttribute Type
|
||||||
|
HiLink erlangMacroDef Type
|
||||||
|
HiLink erlangUnknownAttribute Normal
|
||||||
|
HiLink erlangInclude Type
|
||||||
|
HiLink erlangRecordDef Type
|
||||||
|
HiLink erlangDefine Type
|
||||||
|
HiLink erlangPreCondit Type
|
||||||
|
HiLink erlangType Type
|
||||||
|
else
|
||||||
|
HiLink erlangAttribute Keyword
|
||||||
|
HiLink erlangMacroDef Macro
|
||||||
|
HiLink erlangUnknownAttribute Normal
|
||||||
|
HiLink erlangInclude Include
|
||||||
|
HiLink erlangRecordDef Keyword
|
||||||
|
HiLink erlangDefine Define
|
||||||
|
HiLink erlangPreCondit PreCondit
|
||||||
|
HiLink erlangType Type
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Keywords
|
||||||
|
HiLink erlangKeyword Keyword
|
||||||
|
|
||||||
|
" Build-in-functions (BIFs)
|
||||||
|
HiLink erlangBIF Function
|
||||||
|
|
||||||
|
if s:old_style
|
||||||
|
HiLink erlangBoolean Statement
|
||||||
|
HiLink erlangExtra Statement
|
||||||
|
HiLink erlangSignal Statement
|
||||||
|
else
|
||||||
|
HiLink erlangBoolean Boolean
|
||||||
|
HiLink erlangExtra Statement
|
||||||
|
HiLink erlangSignal Statement
|
||||||
|
endif
|
||||||
|
|
||||||
|
delcommand HiLink
|
||||||
endif
|
endif
|
||||||
" }}}
|
|
||||||
|
|
||||||
let b:current_syntax = "erlang"
|
let b:current_syntax = "erlang"
|
||||||
|
|
||||||
" vim: set foldmethod=marker:
|
let &cpo = s:cpo_save
|
||||||
|
unlet s:cpo_save
|
||||||
|
|
||||||
|
" vim: sw=2 et
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ elseif !exists("b:eruby_subtype") && main_syntax == 'eruby'
|
|||||||
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
|
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
|
||||||
let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+')
|
let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+')
|
||||||
if b:eruby_subtype == ''
|
if b:eruby_subtype == ''
|
||||||
let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+$')
|
let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+\%(\ze+\w\+\)\=$')
|
||||||
endif
|
endif
|
||||||
if b:eruby_subtype == 'rhtml'
|
if b:eruby_subtype == 'rhtml'
|
||||||
let b:eruby_subtype = 'html'
|
let b:eruby_subtype = 'html'
|
||||||
|
|||||||
@@ -10,7 +10,9 @@
|
|||||||
" let OPTION_NAME = 0
|
" let OPTION_NAME = 0
|
||||||
" in your ~/.vimrc file to disable particular options. You can also write:
|
" in your ~/.vimrc file to disable particular options. You can also write:
|
||||||
" let OPTION_NAME = 1
|
" let OPTION_NAME = 1
|
||||||
" to enable particular options. At present, all options default to on.
|
" to enable particular options.
|
||||||
|
" At present, all options default to on, except highlight of:
|
||||||
|
" functions, methods and structs.
|
||||||
"
|
"
|
||||||
" - go_highlight_array_whitespace_error
|
" - go_highlight_array_whitespace_error
|
||||||
" Highlights white space after "[]".
|
" Highlights white space after "[]".
|
||||||
@@ -29,40 +31,44 @@ if exists("b:current_syntax")
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists("go_highlight_array_whitespace_error")
|
if !exists("g:go_highlight_array_whitespace_error")
|
||||||
let go_highlight_array_whitespace_error = 1
|
let g:go_highlight_array_whitespace_error = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists("go_highlight_chan_whitespace_error")
|
if !exists("g:go_highlight_chan_whitespace_error")
|
||||||
let go_highlight_chan_whitespace_error = 1
|
let g:go_highlight_chan_whitespace_error = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists("go_highlight_extra_types")
|
if !exists("g:go_highlight_extra_types")
|
||||||
let go_highlight_extra_types = 1
|
let g:go_highlight_extra_types = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists("go_highlight_space_tab_error")
|
if !exists("g:go_highlight_space_tab_error")
|
||||||
let go_highlight_space_tab_error = 1
|
let g:go_highlight_space_tab_error = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists("go_highlight_trailing_whitespace_error")
|
if !exists("g:go_highlight_trailing_whitespace_error")
|
||||||
let go_highlight_trailing_whitespace_error = 1
|
let g:go_highlight_trailing_whitespace_error = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists("go_highlight_operators")
|
if !exists("g:go_highlight_operators")
|
||||||
let go_highlight_operators = 1
|
let g:go_highlight_operators = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists("go_highlight_functions")
|
if !exists("g:go_highlight_functions")
|
||||||
let go_highlight_functions = 1
|
let g:go_highlight_functions = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists("go_highlight_methods")
|
if !exists("g:go_highlight_methods")
|
||||||
let go_highlight_methods = 1
|
let g:go_highlight_methods = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists("go_highlight_structs")
|
if !exists("g:go_highlight_structs")
|
||||||
let go_highlight_structs = 1
|
let g:go_highlight_structs = 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists("g:go_highlight_build_constraints")
|
||||||
|
let g:go_highlight_build_constraints = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syn case match
|
syn case match
|
||||||
@@ -107,10 +113,10 @@ syn match goDeclaration /\<func\>/
|
|||||||
" Predefined functions and values
|
" Predefined functions and values
|
||||||
syn keyword goBuiltins append cap close complex copy delete imag len
|
syn keyword goBuiltins append cap close complex copy delete imag len
|
||||||
syn keyword goBuiltins make new panic print println real recover
|
syn keyword goBuiltins make new panic print println real recover
|
||||||
syn keyword goConstants iota true false nil
|
syn keyword goBoolean iota true false nil
|
||||||
|
|
||||||
hi def link goBuiltins Keyword
|
hi def link goBuiltins Keyword
|
||||||
hi def link goConstants Keyword
|
hi def link goBoolean Boolean
|
||||||
|
|
||||||
" Comments; their contents
|
" Comments; their contents
|
||||||
syn keyword goTodo contained TODO FIXME XXX BUG
|
syn keyword goTodo contained TODO FIXME XXX BUG
|
||||||
@@ -141,9 +147,11 @@ 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
|
||||||
|
|
||||||
hi def link goString String
|
hi def link goString String
|
||||||
hi def link goRawString String
|
hi def link goRawString String
|
||||||
|
hi def link goFormatSpecifier goSpecialString
|
||||||
|
|
||||||
" Characters; their contents
|
" Characters; their contents
|
||||||
syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU
|
syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU
|
||||||
@@ -182,12 +190,12 @@ syn match goImaginary "\<\d\+[Ee][-+]\d\+i\>"
|
|||||||
hi def link goImaginary Number
|
hi def link goImaginary Number
|
||||||
|
|
||||||
" Spaces after "[]"
|
" Spaces after "[]"
|
||||||
if go_highlight_array_whitespace_error != 0
|
if g:go_highlight_array_whitespace_error != 0
|
||||||
syn match goSpaceError display "\(\[\]\)\@<=\s\+"
|
syn match goSpaceError display "\(\[\]\)\@<=\s\+"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Spacing errors around the 'chan' keyword
|
" Spacing errors around the 'chan' keyword
|
||||||
if go_highlight_chan_whitespace_error != 0
|
if g:go_highlight_chan_whitespace_error != 0
|
||||||
" receive-only annotation on chan type
|
" receive-only annotation on chan type
|
||||||
syn match goSpaceError display "\(<-\)\@<=\s\+\(chan\>\)\@="
|
syn match goSpaceError display "\(<-\)\@<=\s\+\(chan\>\)\@="
|
||||||
" send-only annotation on chan type
|
" send-only annotation on chan type
|
||||||
@@ -197,20 +205,20 @@ if go_highlight_chan_whitespace_error != 0
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Extra types commonly seen
|
" Extra types commonly seen
|
||||||
if go_highlight_extra_types != 0
|
if g:go_highlight_extra_types != 0
|
||||||
syn match goExtraType /\<bytes\.\(Buffer\)\>/
|
syn match goExtraType /\<bytes\.\(Buffer\)\>/
|
||||||
syn match goExtraType /\<io\.\(Reader\|Writer\|ReadWriter\|ReadWriteCloser\)\>/
|
syn match goExtraType /\<io\.\(Reader\|ReadSeeker\|ReadWriter\|ReadCloser\|ReadWriteCloser\|Writer\|WriteCloser\|Seeker\)\>/
|
||||||
syn match goExtraType /\<reflect\.\(Kind\|Type\|Value\)\>/
|
syn match goExtraType /\<reflect\.\(Kind\|Type\|Value\)\>/
|
||||||
syn match goExtraType /\<unsafe\.Pointer\>/
|
syn match goExtraType /\<unsafe\.Pointer\>/
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Space-tab error
|
" Space-tab error
|
||||||
if go_highlight_space_tab_error != 0
|
if g:go_highlight_space_tab_error != 0
|
||||||
syn match goSpaceError display " \+\t"me=e-1
|
syn match goSpaceError display " \+\t"me=e-1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Trailing white space error
|
" Trailing white space error
|
||||||
if go_highlight_trailing_whitespace_error != 0
|
if g:go_highlight_trailing_whitespace_error != 0
|
||||||
syn match goSpaceError display excludenl "\s\+$"
|
syn match goSpaceError display excludenl "\s\+$"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -227,7 +235,7 @@ hi def link goTodo Todo
|
|||||||
|
|
||||||
|
|
||||||
" Operators;
|
" Operators;
|
||||||
if go_highlight_operators != 0
|
if g:go_highlight_operators != 0
|
||||||
syn match goOperator /:=/
|
syn match goOperator /:=/
|
||||||
syn match goOperator />=/
|
syn match goOperator />=/
|
||||||
syn match goOperator /<=/
|
syn match goOperator /<=/
|
||||||
@@ -246,26 +254,41 @@ endif
|
|||||||
hi def link goOperator Operator
|
hi def link goOperator Operator
|
||||||
|
|
||||||
" Functions;
|
" Functions;
|
||||||
if go_highlight_functions != 0
|
if g:go_highlight_functions != 0
|
||||||
syn match goFunction /\(func\s\+\)\@<=\w\+\((\)\@=/
|
syn match goFunction /\(func\s\+\)\@<=\w\+\((\)\@=/
|
||||||
syn match goFunction /\()\s\+\)\@<=\w\+\((\)\@=/
|
syn match goFunction /\()\s\+\)\@<=\w\+\((\)\@=/
|
||||||
endif
|
endif
|
||||||
hi def link goFunction Function
|
hi def link goFunction Function
|
||||||
|
|
||||||
" Methods;
|
" Methods;
|
||||||
if go_highlight_methods != 0
|
if g:go_highlight_methods != 0
|
||||||
syn match goMethod /\(\.\)\@<=\w\+\((\)\@=/
|
syn match goMethod /\(\.\)\@<=\w\+\((\)\@=/
|
||||||
endif
|
endif
|
||||||
hi def link goMethod Type
|
hi def link goMethod Type
|
||||||
|
|
||||||
" Structs;
|
" Structs;
|
||||||
if go_highlight_structs != 0
|
if g:go_highlight_structs != 0
|
||||||
syn match goStruct /\(.\)\@<=\w\+\({\)\@=/
|
syn match goStruct /\(.\)\@<=\w\+\({\)\@=/
|
||||||
syn match goStructDef /\(type\s\+\)\@<=\w\+\(\s\+struct\s\+{\)\@=/
|
syn match goStructDef /\(type\s\+\)\@<=\w\+\(\s\+struct\s\+{\)\@=/
|
||||||
endif
|
endif
|
||||||
hi def link goStruct Function
|
hi def link goStruct Function
|
||||||
hi def link goStructDef Function
|
hi def link goStructDef Function
|
||||||
|
|
||||||
|
" Build Constraints
|
||||||
|
if g:go_highlight_build_constraints != 0
|
||||||
|
syn keyword goBuildOs contained ignore cgo android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 solaris windows
|
||||||
|
syn keyword goBuildArch contained 386 amd64 amd64p32 arm
|
||||||
|
syn match goBuildDirective display contained "+build"
|
||||||
|
syn region goBuildComment start="//\s*+build" end="$" contains=goBuildDirective,goBuildOs,goBuildArch
|
||||||
|
syn region goBuildComment start="/\*\s*+build" end="\*/" contains=goBuildDirective,goBuildOs,goBuildArch
|
||||||
|
endif
|
||||||
|
|
||||||
|
hi def link goBuildComment Comment
|
||||||
|
hi def link goBuildOs Type
|
||||||
|
hi def link goBuildArch Type
|
||||||
|
hi def link goBuildDirective PreProc
|
||||||
|
|
||||||
|
|
||||||
" Search backwards for a global declaration to start processing the syntax.
|
" Search backwards for a global declaration to start processing the syntax.
|
||||||
"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/
|
"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ syn keyword htmlTagName contained header hgroup keygen main mark meter menu nav
|
|||||||
syn keyword htmlTagName contained progress ruby rt rp section source summary time track video data
|
syn keyword htmlTagName contained progress ruby rt rp 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
|
||||||
|
|
||||||
" SVG tags
|
" SVG tags
|
||||||
" http://www.w3.org/TR/SVG/
|
" http://www.w3.org/TR/SVG/
|
||||||
@@ -68,13 +69,15 @@ syn keyword htmlArg contained autoplay preload controls loop poster media kind c
|
|||||||
" <form>, <input>, <button>
|
" <form>, <input>, <button>
|
||||||
syn keyword htmlArg contained form autocomplete autofocus list min max step
|
syn keyword htmlArg contained form autocomplete autofocus list min max step
|
||||||
syn keyword htmlArg contained formaction autofocus formenctype formmethod formtarget formnovalidate
|
syn keyword htmlArg contained formaction autofocus formenctype formmethod formtarget formnovalidate
|
||||||
syn keyword htmlArg contained required placeholder
|
syn keyword htmlArg contained required placeholder pattern
|
||||||
" <command>, <details>, <time>
|
" <command>, <details>, <time>
|
||||||
syn keyword htmlArg contained label icon open datetime pubdate
|
syn keyword htmlArg contained label icon open datetime pubdate
|
||||||
" <script>
|
" <script>
|
||||||
syn keyword htmlArg contained async
|
syn keyword htmlArg contained async
|
||||||
" <content>
|
" <content>
|
||||||
syn keyword htmlArg contained select
|
syn keyword htmlArg contained select
|
||||||
|
" <picture>
|
||||||
|
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
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ syn match jadeBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=jadeTag,jadeClassCha
|
|||||||
syn match jadeTag "+\?\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@jadeComponent
|
syn match jadeTag "+\?\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@jadeComponent
|
||||||
syn cluster jadeComponent contains=jadeAttributes,jadeIdChar,jadeBlockExpansionChar,jadeClassChar,jadePlainChar,jadeJavascript,jadeTagBlockChar,jadeTagInlineText
|
syn cluster jadeComponent contains=jadeAttributes,jadeIdChar,jadeBlockExpansionChar,jadeClassChar,jadePlainChar,jadeJavascript,jadeTagBlockChar,jadeTagInlineText
|
||||||
syn match jadeComment '\s*\/\/.*$'
|
syn match jadeComment '\s*\/\/.*$'
|
||||||
|
syn region jadeCommentBlock start="\z(\s*\)\/\/.*$" end="^\%(\z1\s\|\s*$\)\@!" keepend
|
||||||
syn region jadeHtmlConditionalComment start="<!--\%(.*\)>" end="<!\%(.*\)-->"
|
syn region jadeHtmlConditionalComment start="<!--\%(.*\)>" end="<!\%(.*\)-->"
|
||||||
syn region jadeAttributes matchgroup=jadeAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,jadeHtmlArg,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@jadeComponent
|
syn region jadeAttributes matchgroup=jadeAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,jadeHtmlArg,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@jadeComponent
|
||||||
syn match jadeClassChar "\." contained nextgroup=jadeClass
|
syn match jadeClassChar "\." contained nextgroup=jadeClass
|
||||||
@@ -45,7 +46,7 @@ syn region jadeDocType start="^\s*\(!!!\|doctype\)" end="$"
|
|||||||
syn keyword jadeHtmlArg contained href title
|
syn keyword jadeHtmlArg contained href title
|
||||||
|
|
||||||
syn match jadePlainChar "\\" contained
|
syn match jadePlainChar "\\" contained
|
||||||
syn region jadeInterpolation matchgroup=jadeInterpolationDelimiter start="#{" end="}" contains=@htmlJavascript
|
syn region jadeInterpolation matchgroup=jadeInterpolationDelimiter start="[#!]{" end="}" contains=@htmlJavascript
|
||||||
syn match jadeInterpolationEscape "\\\@<!\%(\\\\\)*\\\%(\\\ze#{\|#\ze{\)"
|
syn match jadeInterpolationEscape "\\\@<!\%(\\\\\)*\\\%(\\\ze#{\|#\ze{\)"
|
||||||
syn match jadeTagInlineText "\s.*$" contained contains=jadeInterpolation,jadeTextInlineJade
|
syn match jadeTagInlineText "\s.*$" contained contains=jadeInterpolation,jadeTextInlineJade
|
||||||
syn region jadePipedText matchgroup=jadePipeChar start="|" end="$" contained contains=jadeInterpolation,jadeTextInlineJade nextgroup=jadePipedText skipnl
|
syn region jadePipedText matchgroup=jadePipeChar start="|" end="$" contained contains=jadeInterpolation,jadeTextInlineJade nextgroup=jadePipedText skipnl
|
||||||
@@ -90,6 +91,7 @@ hi def link jadeInlineDelimiter Delimiter
|
|||||||
hi def link jadeFilter PreProc
|
hi def link jadeFilter PreProc
|
||||||
hi def link jadeDocType PreProc
|
hi def link jadeDocType PreProc
|
||||||
hi def link jadeComment Comment
|
hi def link jadeComment Comment
|
||||||
|
hi def link jadeCommentBlock Comment
|
||||||
hi def link jadeHtmlConditionalComment jadeComment
|
hi def link jadeHtmlConditionalComment jadeComment
|
||||||
|
|
||||||
let b:current_syntax = "jade"
|
let b:current_syntax = "jade"
|
||||||
|
|||||||
@@ -35,6 +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 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
|
||||||
@@ -52,24 +59,24 @@ 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\|augments\|borrows\|class\|constructs\|default\|defaultvalue\|emits\|exception\|exports\|extends\|file\|fires\|kind\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|throws\|var\|variation\|version\)\>" nextgroup=jsDocParam skipwhite
|
syntax match jsDocTags contained "@\(alias\|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
|
||||||
" tags containing type and param
|
" tags containing type and param
|
||||||
syntax match jsDocTags contained "@\(arg\|argument\|param\|property\)\>" nextgroup=jsDocType skipwhite
|
syntax match jsDocTags contained "@\(arg\|argument\|param\|property\)\>" nextgroup=jsDocType skipwhite
|
||||||
" tags containing type but no param
|
" tags containing type but no param
|
||||||
syntax match jsDocTags contained "@\(callback\|enum\|external\|this\|type\|typedef\|return\|returns\)\>" nextgroup=jsDocTypeNoParam skipwhite
|
syntax match jsDocTags contained "@\(callback\|define\|enum\|external\|implements\|this\|type\|typedef\|return\|returns\)\>" nextgroup=jsDocTypeNoParam skipwhite
|
||||||
" tags containing references
|
" tags containing references
|
||||||
syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" nextgroup=jsDocSeeTag skipwhite
|
syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" nextgroup=jsDocSeeTag skipwhite
|
||||||
" other tags (no extra syntax)
|
" other tags (no extra syntax)
|
||||||
syntax match jsDocTags contained "@\(abstract\|access\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|event\|example\|file[oO]verview\|function\|global\|ignore\|inner\|instance\|license\|method\|mixin\|overview\|private\|protected\|public\|readonly\|since\|static\|todo\|summary\|undocumented\|virtual\)\>"
|
syntax match jsDocTags contained "@\(abstract\|access\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|dict\|event\|example\|file[oO]verview\|final\|function\|global\|ignore\|inheritDoc\|inner\|instance\|interface\|license\|method\|mixin\|nosideeffects\|override\|overview\|preserve\|private\|protected\|public\|readonly\|since\|static\|struct\|todo\|summary\|undocumented\|virtual\)\>"
|
||||||
|
|
||||||
syntax region jsDocType start="{" end="}" oneline contained nextgroup=jsDocParam skipwhite
|
syntax region jsDocType start="{" end="}" oneline contained nextgroup=jsDocParam skipwhite
|
||||||
syntax match jsDocType contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" nextgroup=jsDocParam skipwhite
|
syntax match jsDocType contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" nextgroup=jsDocParam skipwhite
|
||||||
syntax region jsDocTypeNoParam start="{" end="}" oneline contained
|
syntax region jsDocTypeNoParam start="{" end="}" oneline contained
|
||||||
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
|
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
|
||||||
syntax match jsDocParam contained "\%(#\|\"\|{\|}\|\w\|\.\|:\|\/\)\+"
|
syntax match jsDocParam contained "\%(#\|\"\|{\|}\|\w\|\.\|:\|\/\|\[\|]\|=\)\+"
|
||||||
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
|
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
|
||||||
|
|
||||||
syntax case match
|
syntax case match
|
||||||
@@ -81,9 +88,10 @@ syntax case match
|
|||||||
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 jsTaggedTemplate start=/\k\+\(\(\n\|\s\)\+\)\?`/ end=+`\|$+ contains=jsTemplateString
|
||||||
syntax region jsRegexpCharClass start=+\[+ skip=+\\.+ end=+\]+ contained
|
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
|
||||||
@@ -91,29 +99,28 @@ syntax match jsRegexpQuantifier "\v\\@<!%([?*+]|\{\d+%(,|,\d+)?})\??" containe
|
|||||||
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="\\\@<!(" 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\=\>\|\<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
|
||||||
|
|
||||||
if g:javascript_conceal == 1
|
syntax match jsAssignmentExpr /\v%([a-zA-Z_$]\k*\.)*[a-zA-Z_$]\k*\s*\=/ contains=jsFuncAssignExpr,jsAssignExpIdent,jsPrototype,jsOperator,jsThis,jsNoise
|
||||||
syntax keyword jsNull null conceal cchar=ø
|
syntax match jsAssignExpIdent /\v[a-zA-Z_$]\k*\ze%(\s*\=)/ contained
|
||||||
syntax keyword jsThis this conceal cchar=@
|
syntax match jsFuncAssignExpr /\v%(%([a-zA-Z_$]\k*\.)*[a-zA-Z_$]\k*\s*\=\s*){-1,}\ze%(function\s*\*?\s*\()/ contains=jsFuncAssignObjChain,jsFuncAssignIdent,jsFunction,jsPrototype,jsOperator,jsThis contained
|
||||||
syntax keyword jsReturn return conceal cchar=⇚
|
syntax match jsFuncAssignObjChain /\v%([a-zA-Z_$]\k*\.)+/ contains=jsPrototype,jsNoise contained
|
||||||
syntax keyword jsUndefined undefined conceal cchar=¿
|
syntax match jsFuncAssignIdent /\v[a-zA-Z_$]\k*\ze%(\s*\=)/ contained
|
||||||
syntax keyword jsNan NaN conceal cchar=ℕ
|
|
||||||
syntax keyword jsPrototype prototype conceal cchar=¶
|
exe 'syntax keyword jsNull null '.(exists('g:javascript_conceal_null') ? 'conceal cchar='.g:javascript_conceal_null : '')
|
||||||
else
|
exe 'syntax keyword jsReturn return '.(exists('g:javascript_conceal_return') ? 'conceal cchar='.g:javascript_conceal_return : '')
|
||||||
syntax keyword jsNull null
|
exe 'syntax keyword jsUndefined undefined '.(exists('g:javascript_conceal_undefined') ? 'conceal cchar='.g:javascript_conceal_undefined : '')
|
||||||
syntax keyword jsThis this
|
exe 'syntax keyword jsNan NaN '.(exists('g:javascript_conceal_NaN') ? 'conceal cchar='.g:javascript_conceal_NaN : '')
|
||||||
syntax keyword jsReturn return
|
exe 'syntax keyword jsPrototype prototype '.(exists('g:javascript_conceal_prototype') ? 'conceal cchar='.g:javascript_conceal_prototype : '')
|
||||||
syntax keyword jsUndefined undefined
|
exe 'syntax keyword jsThis this '.(exists('g:javascript_conceal_this') ? 'conceal cchar='.g:javascript_conceal_this : '')
|
||||||
syntax keyword jsNan NaN
|
exe 'syntax keyword jsStatic static '.(exists('g:javascript_conceal_static') ? 'conceal cchar='.g:javascript_conceal_static : '')
|
||||||
syntax keyword jsPrototype prototype
|
exe 'syntax keyword jsSuper super '.(exists('g:javascript_conceal_super') ? 'conceal cchar='.g:javascript_conceal_super : '')
|
||||||
endif
|
|
||||||
|
|
||||||
"" Statement Keywords
|
"" Statement Keywords
|
||||||
syntax keyword jsStatement break continue with
|
syntax keyword jsStatement break continue with
|
||||||
@@ -121,16 +128,17 @@ 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
|
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 export interface static byte extends long super char final native synchronized class float package throws goto private transient debugger implements protected volatile double import public
|
syntax keyword jsFutureKeys abstract enum int short boolean interface 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
|
||||||
|
|
||||||
@@ -180,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
|
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
|
||||||
@@ -202,14 +209,11 @@ if main_syntax == "javascript"
|
|||||||
syntax sync match jsHighlight grouphere jsBlock /{/
|
syntax sync match jsHighlight grouphere jsBlock /{/
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if g:javascript_conceal == 1
|
exe 'syntax match jsFunction /\<function\>/ nextgroup=jsGenerator,jsFuncName,jsFuncArgs skipwhite '.(exists('g:javascript_conceal_function') ? 'conceal cchar='.g:javascript_conceal_function : '')
|
||||||
syntax match jsFunction /\<function\>/ nextgroup=jsFuncName,jsFuncArgs skipwhite conceal cchar=ƒ
|
|
||||||
else
|
|
||||||
syntax match jsFunction /\<function\>/ nextgroup=jsFuncName,jsFuncArgs skipwhite
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
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
|
||||||
@@ -230,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
|
||||||
@@ -241,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
|
||||||
@@ -262,6 +267,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
|||||||
HiLink jsKeyword Keyword
|
HiLink jsKeyword Keyword
|
||||||
HiLink jsArrowFunction Type
|
HiLink jsArrowFunction Type
|
||||||
HiLink jsFunction Type
|
HiLink jsFunction Type
|
||||||
|
HiLink jsGenerator jsFunction
|
||||||
HiLink jsFuncName Function
|
HiLink jsFuncName Function
|
||||||
HiLink jsArgsObj Special
|
HiLink jsArgsObj Special
|
||||||
HiLink jsError Error
|
HiLink jsError Error
|
||||||
@@ -270,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
|
||||||
@@ -291,6 +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 jsModules Include
|
||||||
|
HiLink jsModuleWords Include
|
||||||
|
|
||||||
HiLink jsDomErrNo Constant
|
HiLink jsDomErrNo Constant
|
||||||
HiLink jsDomNodeConsts Constant
|
HiLink jsDomNodeConsts Constant
|
||||||
@@ -307,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
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ 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 == '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 +72,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:
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ syntax match mustacheHandlebars '{{\|}}' contained containedin=mustacheInside,@h
|
|||||||
syntax match mustacheUnescape '{{{\|}}}' contained containedin=mustacheInside,@htmlMustacheContainer
|
syntax match mustacheUnescape '{{{\|}}}' contained containedin=mustacheInside,@htmlMustacheContainer
|
||||||
syntax match mustacheConditionals '\([/#]\(if\|unless\)\|else\)' contained containedin=mustacheInside
|
syntax match mustacheConditionals '\([/#]\(if\|unless\)\|else\)' contained containedin=mustacheInside
|
||||||
syntax match mustacheHelpers '[/#]\(with\|each\)' contained containedin=mustacheSection
|
syntax match mustacheHelpers '[/#]\(with\|each\)' contained containedin=mustacheSection
|
||||||
syntax region mustacheComment start=/{{!/rs=s+2 end=/}}/re=e-2 contains=Todo contained containedin=mustacheInside,@htmlMustacheContainer
|
syntax region mustacheComment start=/{{!/rs=s+2 skip=/{{.\{-}}}/ end=/}}/re=e-2 contains=Todo contained containedin=mustacheInside,@htmlMustacheContainer
|
||||||
syntax region mustacheBlockComment start=/{{!--/rs=s+2 end=/--}}/re=e-2 contains=Todo
|
syntax region mustacheBlockComment start=/{{!--/rs=s+2 skip=/{{.\{-}}}/ end=/--}}/re=e-2 contains=Todo contained extend containedin=mustacheInside,@htmlMustacheContainer
|
||||||
syntax region mustacheQString start=/'/ skip=/\\'/ end=/'/ contained containedin=mustacheInside
|
syntax region mustacheQString start=/'/ skip=/\\'/ end=/'/ contained containedin=mustacheInside
|
||||||
syntax region mustacheDQString start=/"/ skip=/\\"/ end=/"/ contained containedin=mustacheInside
|
syntax region mustacheDQString start=/"/ skip=/\\"/ end=/"/ contained containedin=mustacheInside
|
||||||
|
|
||||||
|
|||||||
@@ -56,15 +56,15 @@ syn keyword clType cl_image_format
|
|||||||
|
|
||||||
syn keyword clCast vec_type_hint work_group_size_hint aligned packed endian
|
syn keyword clCast vec_type_hint work_group_size_hint aligned packed endian
|
||||||
|
|
||||||
syn match clCast "as_\(uchar\|char\|ushort\|short\|uint\|int\|ulong\|long\|float\|double\)("
|
syn match clCast "as_\(uchar\|char\|ushort\|short\|uint\|int\|ulong\|long\|float\|double\)"
|
||||||
|
|
||||||
syn match clCast "as_\(uchar\|char\|ushort\|short\|uint\|int\|ulong\|long\|float\|double\)\(2\|3\|4\|8\|16\)("
|
syn match clCast "as_\(uchar\|char\|ushort\|short\|uint\|int\|ulong\|long\|float\|double\)\(2\|3\|4\|8\|16\)"
|
||||||
|
|
||||||
syn match clCast "convert_\(uchar\|char\|ushort\|short\|uint\|int\|ulong\|long\|float\|double\))\(2\|3\|4\|8\|16\)("
|
syn match clCast "convert_\(uchar\|char\|ushort\|short\|uint\|int\|ulong\|long\|float\|double\))\(2\|3\|4\|8\|16\)"
|
||||||
|
|
||||||
syn match clCast "convert_\(uchar\|char\|ushort\|short\|uint\|int\|ulong\|long\|float\|double\))\(2\|3\|4\|8\|16\)_sat("
|
syn match clCast "convert_\(uchar\|char\|ushort\|short\|uint\|int\|ulong\|long\|float\|double\))\(2\|3\|4\|8\|16\)_sat"
|
||||||
|
|
||||||
syn match clCast "convert_\(uchar\|char\|ushort\|short\|uint\|int\|ulong\|long\|float\|double\))\(2\|3\|4\|8\|16\)_sat_\(rte\|rtz\|rtp\|rtn\)("
|
syn match clCast "convert_\(uchar\|char\|ushort\|short\|uint\|int\|ulong\|long\|float\|double\))\(2\|3\|4\|8\|16\)_sat_\(rte\|rtz\|rtp\|rtn\)"
|
||||||
|
|
||||||
" work item functions
|
" work item functions
|
||||||
syn keyword clFunction get_work_dim get_global_size get_global_id get_local_size get_local_id get_num_groups get_group_id get_global_offset
|
syn keyword clFunction get_work_dim get_global_size get_global_id get_local_size get_local_id get_num_groups get_group_id get_global_offset
|
||||||
@@ -105,21 +105,21 @@ syn keyword clFunction isequal isnotequal isgreater isgreaterequal isle
|
|||||||
|
|
||||||
" vector data load and store functions
|
" vector data load and store functions
|
||||||
syn keyword clFunction vload_half vstore_half
|
syn keyword clFunction vload_half vstore_half
|
||||||
syn match clFunction "vload\(2\|3\|4\|8\|16\)("
|
syn match clFunction "vload\(2\|3\|4\|8\|16\)"
|
||||||
syn match clFunction "vload_half\(2\|3\|4\|8\|16\)("
|
syn match clFunction "vload_half\(2\|3\|4\|8\|16\)"
|
||||||
syn match clFunction "vloada_half\(2\|3\|4\|8\|16\)("
|
syn match clFunction "vloada_half\(2\|3\|4\|8\|16\)"
|
||||||
syn match clFunction "vloada_half\(2\|3\|4\|8\|16\)_\(rte\|rtz\|rtp\)("
|
syn match clFunction "vloada_half\(2\|3\|4\|8\|16\)_\(rte\|rtz\|rtp\)"
|
||||||
syn match clFunction "vstore\(2\|3\|4\|8\|16\)("
|
syn match clFunction "vstore\(2\|3\|4\|8\|16\)"
|
||||||
syn match clFunction "vstore\(rte\|rtz\|rtp\|rtn\)("
|
syn match clFunction "vstore\(rte\|rtz\|rtp\|rtn\)"
|
||||||
syn match clFunction "vstore_half\(2\|3\|4\|8\|16\)("
|
syn match clFunction "vstore_half\(2\|3\|4\|8\|16\)"
|
||||||
syn match clFunction "vstore_half_\(rte\|rtz\|rtp\|rtn\)("
|
syn match clFunction "vstore_half_\(rte\|rtz\|rtp\|rtn\)"
|
||||||
syn match clFunction "vstore_half\(2\|3\|4\|8\|16\)_\(rte\|rtz\|rtp\|rtn\)("
|
syn match clFunction "vstore_half\(2\|3\|4\|8\|16\)_\(rte\|rtz\|rtp\|rtn\)"
|
||||||
syn match clFunction "vstorea_half\(2\|3\|4\|8\|16\)("
|
syn match clFunction "vstorea_half\(2\|3\|4\|8\|16\)"
|
||||||
syn match clFunction "vstorea_half\(2\|3\|4\|8\|16\)_\(rte\|rtz\|rtp\|rtn\)("
|
syn match clFunction "vstorea_half\(2\|3\|4\|8\|16\)_\(rte\|rtz\|rtp\|rtn\)"
|
||||||
|
|
||||||
" image read and write functions
|
" image read and write functions
|
||||||
syn match clFunction "read_image\(f\|i\|ui\|h\)("
|
syn match clFunction "read_image\(f\|i\|ui\|h\)"
|
||||||
syn match clFunction "write_image\(f\|i\|ui\|h\)("
|
syn match clFunction "write_image\(f\|i\|ui\|h\)"
|
||||||
syn keyword clFunction get_image_width get_image_height get_image_depth get_image_channel_data_type get_image_channel_order get_image_dim
|
syn keyword clFunction get_image_width get_image_height get_image_depth get_image_channel_data_type get_image_channel_order get_image_dim
|
||||||
|
|
||||||
" explicit memory fence functions
|
" explicit memory fence functions
|
||||||
@@ -129,7 +129,7 @@ syn keyword clFunction barrier mem_fence read_mem_fence write_mem_fence
|
|||||||
syn keyword clFunction async_work_group_copy async_work_group__strided_copy wait_group_events prefetch
|
syn keyword clFunction async_work_group_copy async_work_group__strided_copy wait_group_events prefetch
|
||||||
|
|
||||||
" atomic functions
|
" atomic functions
|
||||||
syn match clFunction "atom_\(add\|sub\|xchg\|inc\|dec\|cmpxchg\|min\|max\|and\|or\|xor\)("
|
syn match clFunction "atom_\(add\|sub\|xchg\|inc\|dec\|cmpxchg\|min\|max\|and\|or\|xor\)"
|
||||||
|
|
||||||
syn keyword clConstant MAXFLOAT HUGE_VALF INFINITY NAN
|
syn keyword clConstant MAXFLOAT HUGE_VALF INFINITY NAN
|
||||||
syn keyword clConstant FLT_DIG FLT_MANT_DIG FLT_MAX_10_EXP FLT_MAX_EXP FLT_MIN_10_EXP FLT_MIN_EXP FLT_RADIX FLT_MAX FLT_MIN FLT_EPSILON
|
syn keyword clConstant FLT_DIG FLT_MANT_DIG FLT_MAX_10_EXP FLT_MAX_EXP FLT_MIN_10_EXP FLT_MIN_EXP FLT_RADIX FLT_MAX FLT_MIN FLT_EPSILON
|
||||||
|
|||||||
@@ -39,11 +39,6 @@ endif
|
|||||||
let s:cpo_save = &cpo
|
let s:cpo_save = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
if exists('®expengine')
|
|
||||||
let s:regexpengine=®expengine
|
|
||||||
set regexpengine=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
" POD starts with ^=<word> and ends with ^=cut
|
" POD starts with ^=<word> and ends with ^=cut
|
||||||
|
|
||||||
if !exists("perl_include_pod") || perl_include_pod == 1
|
if !exists("perl_include_pod") || perl_include_pod == 1
|
||||||
@@ -334,19 +329,24 @@ syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s
|
|||||||
" XXX Any statements after the identifier are in perlString colour (i.e.
|
" XXX Any statements after the identifier are in perlString colour (i.e.
|
||||||
" 'if $a' in 'print <<EOF if $a'). This is almost impossible to get right it
|
" 'if $a' in 'print <<EOF if $a'). This is almost impossible to get right it
|
||||||
" seems due to the 'auto-extending nature' of regions.
|
" seems due to the 'auto-extending nature' of regions.
|
||||||
|
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\z(\I\i*\)+ end=+$+ contains=@perlTop oneline
|
||||||
|
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+$+ contains=@perlTop oneline
|
||||||
|
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+$+ contains=@perlTop oneline
|
||||||
|
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*""+ end=+$+ contains=@perlTop oneline
|
||||||
|
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*''+ end=+$+ contains=@perlTop oneline
|
||||||
if exists("perl_fold")
|
if exists("perl_fold")
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\).*+ end=+^\z1$+ contains=@perlInterpDQ fold extend
|
syn region perlHereDoc start=+<<\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ fold extend
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+^\z1$+ contains=@perlInterpDQ fold extend
|
syn region perlHereDoc start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ fold extend
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+^\z1$+ contains=@perlInterpSQ fold extend
|
syn region perlHereDoc start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpSQ fold extend
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine fold extend
|
syn region perlHereDoc start=+<<\s*""+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine fold extend
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine fold extend
|
syn region perlHereDoc start=+<<\s*''+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpSQ,perlNotEmptyLine fold extend
|
||||||
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL fold extend
|
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL fold extend
|
||||||
else
|
else
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\).*+ end=+^\z1$+ contains=@perlInterpDQ
|
syn region perlHereDoc start=+<<\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+^\z1$+ contains=@perlInterpDQ
|
syn region perlHereDoc start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+^\z1$+ contains=@perlInterpSQ
|
syn region perlHereDoc start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpSQ
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine
|
syn region perlHereDoc start=+<<\s*""+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine
|
syn region perlHereDoc start=+<<\s*''+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpSQ,perlNotEmptyLine
|
||||||
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL
|
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -360,15 +360,11 @@ syn keyword perlStatementPackage package contained
|
|||||||
" sub [name] [(prototype)] {
|
" sub [name] [(prototype)] {
|
||||||
"
|
"
|
||||||
syn match perlSubError "[^[:space:];{#]" contained
|
syn match perlSubError "[^[:space:];{#]" contained
|
||||||
if v:version == 701 && !has('patch221') " XXX I hope that's the right one
|
|
||||||
syn match perlSubAttributes ":" contained
|
|
||||||
else
|
|
||||||
syn match perlSubAttributesCont "\h\w*\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained
|
syn match perlSubAttributesCont "\h\w*\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained
|
||||||
syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*(" end=")\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained contains=@perlInterpSQ,perlParensSQ
|
syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*(" end=")\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained contains=@perlInterpSQ,perlParensSQ
|
||||||
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
|
||||||
endif
|
|
||||||
if !exists("perl_no_subprototype_error") " Set 1 if using signatures feature in perl5.19.9
|
if !exists("perl_no_subprototype_error") " Set 1 if using signatures feature in perl5.19.9
|
||||||
syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained
|
syn match 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
|
||||||
@@ -583,11 +579,6 @@ syn sync match perlSyncPOD grouphere NONE "^=cut"
|
|||||||
|
|
||||||
let b:current_syntax = "perl"
|
let b:current_syntax = "perl"
|
||||||
|
|
||||||
if exists('®expengine')
|
|
||||||
let ®expengine=s:regexpengine
|
|
||||||
unlet s:regexpengine
|
|
||||||
endif
|
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
let &cpo = s:cpo_save
|
||||||
unlet s:cpo_save
|
unlet s:cpo_save
|
||||||
|
|
||||||
|
|||||||
@@ -2245,8 +2245,6 @@ endif
|
|||||||
" know how to use them reliably)
|
" know how to use them reliably)
|
||||||
syn sync fromstart
|
syn sync fromstart
|
||||||
|
|
||||||
setlocal foldmethod=syntax
|
|
||||||
|
|
||||||
let b:current_syntax = "perl6"
|
let b:current_syntax = "perl6"
|
||||||
|
|
||||||
let &cpo = s:keepcpo
|
let &cpo = s:keepcpo
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
162
syntax/ps1.vim
Normal file
162
syntax/ps1.vim
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
" Vim syntax file
|
||||||
|
" Language: Windows PowerShell
|
||||||
|
" Maintainer: Peter Provost <peter@provost.org>
|
||||||
|
" Version: 2.10
|
||||||
|
" Project Repository: https://github.com/PProvost/vim-ps1
|
||||||
|
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327"
|
||||||
|
"
|
||||||
|
" The following settings are available for tuning syntax highlighting:
|
||||||
|
" let ps1_nofold_blocks = 1
|
||||||
|
" let ps1_nofold_sig = 1
|
||||||
|
|
||||||
|
" Compatible VIM syntax file start
|
||||||
|
if version < 600
|
||||||
|
syntax clear
|
||||||
|
elseif exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" PowerShell doesn't care about case
|
||||||
|
syn case ignore
|
||||||
|
|
||||||
|
" Sync-ing method
|
||||||
|
syn sync minlines=100
|
||||||
|
|
||||||
|
" Certain tokens can't appear at the top level of the document
|
||||||
|
syn cluster ps1NotTop contains=@ps1Comment,ps1CDocParam,ps1Function
|
||||||
|
|
||||||
|
" Comments and special comment words
|
||||||
|
syn keyword ps1CommentTodo TODO FIXME XXX TBD HACK NOTE contained
|
||||||
|
syn match ps1CDocParam /.*/ contained
|
||||||
|
syn match ps1CommentDoc /^\s*\zs\.\w\+\>/ nextgroup=ps1CDocParam contained
|
||||||
|
syn match ps1CommentDoc /#\s*\zs\.\w\+\>/ nextgroup=ps1CDocParam contained
|
||||||
|
syn match ps1Comment /#.*/ contains=ps1CommentTodo,ps1CommentDoc,@Spell
|
||||||
|
syn region ps1Comment start="<#" end="#>" contains=ps1CommentTodo,ps1CommentDoc,@Spell
|
||||||
|
|
||||||
|
" Language keywords and elements
|
||||||
|
syn keyword ps1Conditional if else elseif switch default
|
||||||
|
syn keyword ps1Repeat while for do until break continue foreach in
|
||||||
|
syn match ps1Repeat /\<foreach\>/ nextgroup=ps1Block skipwhite
|
||||||
|
syn match ps1Keyword /\<while\>/ nextgroup=ps1Block skipwhite
|
||||||
|
syn match ps1Keyword /\<where\>/ nextgroup=ps1Block skipwhite
|
||||||
|
|
||||||
|
syn keyword ps1Exception begin process end exit
|
||||||
|
syn keyword ps1Keyword try catch finally throw
|
||||||
|
syn keyword ps1Keyword return filter in trap param data dynamicparam
|
||||||
|
syn match ps1Keyword /&/
|
||||||
|
syn keyword ps1Constant $true $false $null
|
||||||
|
syn match ps1Constant +\$?+
|
||||||
|
syn match ps1Constant +\$_+
|
||||||
|
syn match ps1Constant +\$\$+
|
||||||
|
syn match ps1Constant +\$^+
|
||||||
|
|
||||||
|
" Keywords reserved for future use
|
||||||
|
syn keyword ps1Keyword class define from using var
|
||||||
|
|
||||||
|
" Functions and Cmdlets
|
||||||
|
syn match ps1Cmdlet /\w\+-\w\+/
|
||||||
|
syn keyword ps1Keyword function nextgroup=ps1Function skipwhite
|
||||||
|
syn keyword ps1Keyword filter nextgroup=ps1Function skipwhite
|
||||||
|
syn match ps1Function /\w\+-*\w*/ contained
|
||||||
|
|
||||||
|
" Type declarations
|
||||||
|
syn match ps1Type /\[[a-z0-9_:.]\+\(\[\]\)\?\]/
|
||||||
|
syn match ps1StandaloneType /[a-z0-9_.]\+/ contained
|
||||||
|
syn keyword ps1Scope global local private script contained
|
||||||
|
|
||||||
|
" Variables and other user defined items
|
||||||
|
syn match ps1Variable /\$\w\+/
|
||||||
|
syn match ps1Variable /\${\w\+:\\\w\+}/
|
||||||
|
syn match ps1ScopedVariable /\$\w\+:\w\+/ contains=ps1Scope
|
||||||
|
syn match ps1VariableName /\w\+/ contained
|
||||||
|
|
||||||
|
" Operators all start w/ dash
|
||||||
|
syn match ps1OperatorStart /-c\?/ nextgroup=ps1Operator
|
||||||
|
syn keyword ps1Operator eq ne ge gt lt le like notlike match notmatch replace split /contains/ notcontains contained
|
||||||
|
syn keyword ps1Operator ieq ine ige igt ile ilt ilike inotlike imatch inotmatch ireplace isplit icontains inotcontains contained
|
||||||
|
syn keyword ps1Operator ceq cne cge cgt clt cle clike cnotlike cmatch cnotmatch creplace csplit ccontains cnotcontains contained
|
||||||
|
syn keyword ps1Operator is isnot as join contained
|
||||||
|
syn keyword ps1Operator and or not xor band bor bnot bxor contained
|
||||||
|
syn keyword ps1Operator f contained
|
||||||
|
|
||||||
|
" Regular Strings
|
||||||
|
" These aren't precisely correct and could use some work
|
||||||
|
syn region ps1String start=/"/ skip=/`"/ end=/"/ contains=@ps1StringSpecial
|
||||||
|
syn region ps1String start=/'/ skip=/''/ end=/'/
|
||||||
|
|
||||||
|
" Here-Strings
|
||||||
|
syn region ps1String start=/@"$/ end=/^"@/ contains=@ps1StringSpecial
|
||||||
|
syn region ps1String start=/@'$/ end=/^'@/
|
||||||
|
|
||||||
|
" Interpolation
|
||||||
|
syn match ps1Escape /`./ contained
|
||||||
|
syn region ps1Interpolation matchgroup=ps1InterpolationDelimiter start="$(" end=")" contained contains=ALLBUT,@ps1NotTop
|
||||||
|
syn region ps1NestedParentheses start="(" skip="\\\\\|\\)" matchgroup=ps1Interpolation end=")" transparent contained
|
||||||
|
syn cluster ps1StringSpecial contains=ps1Escape,ps1Interpolation,ps1Variable,ps1Boolean,ps1Constant,ps1BuiltIn
|
||||||
|
|
||||||
|
" Numbers
|
||||||
|
syn match ps1Number "\<\(0[xX]\x\+\|\d\+\)\([KMGTP][B]\)\=\>"
|
||||||
|
syn match ps1Number "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[dD]\="
|
||||||
|
syn match ps1Number "\<\d\+[eE][-+]\=\d\+[dD]\=\>"
|
||||||
|
syn match ps1Number "\<\d\+\([eE][-+]\=\d\+\)\=[dD]\>"
|
||||||
|
|
||||||
|
" Constants
|
||||||
|
syn match ps1Boolean "$\%(true\|false\)\>"
|
||||||
|
syn match ps1Constant /\$null\>/
|
||||||
|
syn match ps1BuiltIn "$^\|$?\|$_\|$\$"
|
||||||
|
syn match ps1BuiltIn "$\%(args\|error\|foreach\|home\|input\)\>"
|
||||||
|
syn match ps1BuiltIn "$\%(match\(es\)\?\|myinvocation\|host\|lastexitcode\)\>"
|
||||||
|
syn match ps1BuiltIn "$\%(ofs\|shellid\|stacktrace\)\>"
|
||||||
|
|
||||||
|
" Folding blocks
|
||||||
|
if !exists('g:ps1_nofold_blocks')
|
||||||
|
syn region ps1Block start=/{/ end=/}/ transparent fold
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:ps1_nofold_sig')
|
||||||
|
syn region ps1Signature start=/# SIG # Begin signature block/ end=/# SIG # End signature block/ transparent fold
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Setup default color highlighting
|
||||||
|
if version >= 508 || !exists("did_ps1_syn_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_ps1_syn_inits = 1
|
||||||
|
command -nargs=+ HiLink hi link <args>
|
||||||
|
else
|
||||||
|
command -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
|
||||||
|
HiLink ps1Number Number
|
||||||
|
HiLink ps1Block Block
|
||||||
|
HiLink ps1Exception Exception
|
||||||
|
HiLink ps1Constant Constant
|
||||||
|
HiLink ps1String String
|
||||||
|
HiLink ps1Escape SpecialChar
|
||||||
|
HiLink ps1InterpolationDelimiter Delimiter
|
||||||
|
HiLink ps1Conditional Conditional
|
||||||
|
HiLink ps1Function Function
|
||||||
|
HiLink ps1Variable Identifier
|
||||||
|
HiLink ps1ScopedVariable Identifier
|
||||||
|
HiLink ps1VariableName Identifier
|
||||||
|
HiLink ps1Boolean Boolean
|
||||||
|
HiLink ps1Constant Constant
|
||||||
|
HiLink ps1BuiltIn StorageClass
|
||||||
|
HiLink ps1Type Type
|
||||||
|
HiLink ps1Scope Type
|
||||||
|
HiLink ps1StandaloneType Type
|
||||||
|
HiLink ps1Number Number
|
||||||
|
HiLink ps1Comment Comment
|
||||||
|
HiLink ps1CommentTodo Todo
|
||||||
|
HiLink ps1CommentDoc Tag
|
||||||
|
HiLink ps1CDocParam Todo
|
||||||
|
HiLink ps1Operator Operator
|
||||||
|
HiLink ps1Repeat Repeat
|
||||||
|
HiLink ps1RepeatAndCmdlet Repeat
|
||||||
|
HiLink ps1Keyword Keyword
|
||||||
|
HiLink ps1KeywordAndCmdlet Keyword
|
||||||
|
HiLink ps1Cmdlet Statement
|
||||||
|
delcommand HiLink
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:current_syntax = "ps1"
|
||||||
|
|
||||||
56
syntax/ps1xml.vim
Normal file
56
syntax/ps1xml.vim
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
" Vim syntax file
|
||||||
|
" Language: Windows PowerShell XML
|
||||||
|
" Maintainer: Peter Provost <peter@provost.org>
|
||||||
|
" Version: 2.10
|
||||||
|
" Project Repository: https://github.com/PProvost/vim-ps1
|
||||||
|
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327"
|
||||||
|
|
||||||
|
" Compatible VIM syntax file start
|
||||||
|
if version < 600
|
||||||
|
syntax clear
|
||||||
|
elseif exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:ps1xml_cpo_save = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
doau syntax xml
|
||||||
|
unlet b:current_syntax
|
||||||
|
|
||||||
|
syn case ignore
|
||||||
|
syn include @ps1xmlScriptBlock <sfile>:p:h/ps1.vim
|
||||||
|
unlet b:current_syntax
|
||||||
|
|
||||||
|
syn region ps1xmlScriptBlock
|
||||||
|
\ matchgroup=xmlTag start="<Script>"
|
||||||
|
\ matchgroup=xmlEndTag end="</Script>"
|
||||||
|
\ fold
|
||||||
|
\ contains=@ps1xmlScriptBlock
|
||||||
|
\ keepend
|
||||||
|
syn region ps1xmlScriptBlock
|
||||||
|
\ matchgroup=xmlTag start="<ScriptBlock>"
|
||||||
|
\ matchgroup=xmlEndTag end="</ScriptBlock>"
|
||||||
|
\ fold
|
||||||
|
\ contains=@ps1xmlScriptBlock
|
||||||
|
\ keepend
|
||||||
|
syn region ps1xmlScriptBlock
|
||||||
|
\ matchgroup=xmlTag start="<GetScriptBlock>"
|
||||||
|
\ matchgroup=xmlEndTag end="</GetScriptBlock>"
|
||||||
|
\ fold
|
||||||
|
\ contains=@ps1xmlScriptBlock
|
||||||
|
\ keepend
|
||||||
|
syn region ps1xmlScriptBlock
|
||||||
|
\ matchgroup=xmlTag start="<SetScriptBlock>"
|
||||||
|
\ matchgroup=xmlEndTag end="</SetScriptBlock>"
|
||||||
|
\ fold
|
||||||
|
\ contains=@ps1xmlScriptBlock
|
||||||
|
\ keepend
|
||||||
|
|
||||||
|
syn cluster xmlRegionHook add=ps1xmlScriptBlock
|
||||||
|
|
||||||
|
let b:current_syntax = "ps1xml"
|
||||||
|
|
||||||
|
let &cpo = s:ps1xml_cpo_save
|
||||||
|
unlet s:ps1xml_cpo_save
|
||||||
|
|
||||||
@@ -130,8 +130,13 @@ 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
|
||||||
|
if exists('ruby_spellcheck_strings')
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial,@Spell fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial,@Spell fold
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape,@Spell fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=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
|
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
|
||||||
|
|||||||
148
syntax/rust.vim
148
syntax/rust.vim
@@ -3,7 +3,7 @@
|
|||||||
" Maintainer: Patrick Walton <pcwalton@mozilla.com>
|
" Maintainer: Patrick Walton <pcwalton@mozilla.com>
|
||||||
" Maintainer: Ben Blum <bblum@cs.cmu.edu>
|
" Maintainer: Ben Blum <bblum@cs.cmu.edu>
|
||||||
" Maintainer: Chris Morgan <me@chrismorgan.info>
|
" Maintainer: Chris Morgan <me@chrismorgan.info>
|
||||||
" Last Change: July 18, 2014
|
" Last Change: January 5, 2015
|
||||||
|
|
||||||
if version < 600
|
if version < 600
|
||||||
syntax clear
|
syntax clear
|
||||||
@@ -11,41 +11,32 @@ elseif exists("b:current_syntax")
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Fold settings {{{1
|
|
||||||
|
|
||||||
if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
|
|
||||||
setlocal foldmethod=syntax
|
|
||||||
if g:rust_fold == 2
|
|
||||||
setlocal foldlevel<
|
|
||||||
else
|
|
||||||
setlocal foldlevel=99
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Syntax definitions {{{1
|
" Syntax definitions {{{1
|
||||||
" Basic keywords {{{2
|
" Basic keywords {{{2
|
||||||
syn keyword rustConditional match if else
|
syn keyword rustConditional match if else
|
||||||
syn keyword rustOperator as
|
syn keyword rustOperator as
|
||||||
|
|
||||||
syn match rustAssert "\<assert\(\w\)*!" contained
|
syn match rustAssert "\<assert\(\w\)*!" contained
|
||||||
syn match rustFail "\<fail\(\w\)*!" contained
|
syn match rustPanic "\<panic\(\w\)*!" contained
|
||||||
syn keyword rustKeyword break
|
syn keyword rustKeyword break
|
||||||
syn keyword rustKeyword box nextgroup=rustBoxPlacement skipwhite skipempty
|
syn keyword rustKeyword box nextgroup=rustBoxPlacement skipwhite skipempty
|
||||||
syn keyword rustKeyword continue
|
syn keyword rustKeyword continue
|
||||||
syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty
|
syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty
|
||||||
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
|
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
|
||||||
syn keyword rustKeyword for in if impl let
|
syn keyword rustKeyword for in if impl let
|
||||||
syn keyword rustKeyword loop once proc pub
|
syn keyword rustKeyword loop once pub
|
||||||
syn keyword rustKeyword return super
|
syn keyword rustKeyword return super
|
||||||
syn keyword rustKeyword unsafe virtual while
|
syn keyword rustKeyword unsafe virtual where while
|
||||||
syn keyword rustKeyword use nextgroup=rustModPath,rustModPathInUse skipwhite skipempty
|
syn keyword rustKeyword use nextgroup=rustModPath skipwhite skipempty
|
||||||
" FIXME: Scoped impl's name is also fallen in this category
|
" FIXME: Scoped impl's name is also fallen in this category
|
||||||
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite skipempty
|
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite skipempty
|
||||||
syn keyword rustStorage mut ref static const
|
syn keyword rustStorage move mut ref static const
|
||||||
|
|
||||||
syn keyword rustInvalidBareKeyword crate
|
syn keyword rustInvalidBareKeyword crate
|
||||||
|
|
||||||
syn keyword rustExternCrate crate contained nextgroup=rustIdentifier skipwhite skipempty
|
syn keyword rustExternCrate crate contained nextgroup=rustIdentifier,rustExternCrateString skipwhite skipempty
|
||||||
|
" This is to get the `bar` part of `extern crate "foo" as bar;` highlighting.
|
||||||
|
syn match rustExternCrateString /".*"\_s*as/ contained nextgroup=rustIdentifier skipwhite transparent skipempty contains=rustString,rustOperator
|
||||||
syn keyword rustObsoleteExternMod mod contained nextgroup=rustIdentifier skipwhite skipempty
|
syn keyword rustObsoleteExternMod mod contained nextgroup=rustIdentifier skipwhite skipempty
|
||||||
|
|
||||||
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
|
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
|
||||||
@@ -65,86 +56,54 @@ syn match rustMacroRepeatCount ".\?[*+]" contained
|
|||||||
syn match rustMacroVariable "$\w\+"
|
syn match rustMacroVariable "$\w\+"
|
||||||
|
|
||||||
" Reserved (but not yet used) keywords {{{2
|
" Reserved (but not yet used) keywords {{{2
|
||||||
syn keyword rustReservedKeyword alignof be do offsetof priv pure sizeof typeof unsized yield
|
syn keyword rustReservedKeyword alignof be do offsetof priv pure sizeof typeof unsized yield abstract final override macro
|
||||||
|
|
||||||
" Built-in types {{{2
|
" Built-in types {{{2
|
||||||
syn keyword rustType int uint float char bool u8 u16 u32 u64 f32
|
syn keyword rustType isize usize float char bool u8 u16 u32 u64 f32
|
||||||
syn keyword rustType f64 i8 i16 i32 i64 str Self
|
syn keyword rustType f64 i8 i16 i32 i64 str Self
|
||||||
|
|
||||||
" Things from the prelude (src/libstd/prelude.rs) {{{2
|
" Things from the prelude (src/libstd/prelude.rs) {{{2
|
||||||
" This section is just straight transformation of the contents of the prelude,
|
" This section is just straight transformation of the contents of the prelude,
|
||||||
" to make it easy to update.
|
" to make it easy to update.
|
||||||
|
|
||||||
" Core operators {{{3
|
" Reexported core operators {{{3
|
||||||
syn keyword rustTrait Copy Send Sized Sync
|
syn keyword rustTrait Copy Send Sized Sync
|
||||||
syn keyword rustTrait Add Sub Mul Div Rem Neg Not
|
syn keyword rustTrait Drop Fn FnMut FnOnce
|
||||||
syn keyword rustTrait BitAnd BitOr BitXor
|
|
||||||
syn keyword rustTrait Drop Deref DerefMut
|
" Reexported functions {{{3
|
||||||
syn keyword rustTrait Shl Shr Index IndexMut
|
syn keyword rustFunction drop
|
||||||
|
|
||||||
|
" Reexported types and traits {{{3
|
||||||
|
syn keyword rustTrait Box
|
||||||
|
syn keyword rustTrait CharExt
|
||||||
|
syn keyword rustTrait Clone
|
||||||
|
syn keyword rustTrait PartialEq PartialOrd Eq Ord
|
||||||
|
syn keyword rustTrait DoubleEndedIterator
|
||||||
|
syn keyword rustTrait ExactSizeIterator
|
||||||
|
syn keyword rustTrait Iterator IteratorExt Extend
|
||||||
syn keyword rustEnum Option
|
syn keyword rustEnum Option
|
||||||
syn keyword rustEnumVariant Some None
|
syn keyword rustEnumVariant Some None
|
||||||
|
syn keyword rustTrait PtrExt MutPtrExt
|
||||||
syn keyword rustEnum Result
|
syn keyword rustEnum Result
|
||||||
syn keyword rustEnumVariant Ok Err
|
syn keyword rustEnumVariant Ok Err
|
||||||
|
syn keyword rustTrait AsSlice
|
||||||
" Functions {{{3
|
syn keyword rustTrait SliceExt SliceConcatExt
|
||||||
"syn keyword rustFunction from_str
|
syn keyword rustTrait Str StrExt
|
||||||
"syn keyword rustFunction range
|
syn keyword rustTrait String ToString
|
||||||
"syn keyword rustFunction drop
|
|
||||||
|
|
||||||
" Types and traits {{{3
|
|
||||||
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr
|
|
||||||
syn keyword rustTrait IntoBytes
|
|
||||||
syn keyword rustTrait ToCStr
|
|
||||||
syn keyword rustTrait Char
|
|
||||||
syn keyword rustTrait Clone
|
|
||||||
syn keyword rustTrait PartialEq PartialOrd Eq Ord Equiv
|
|
||||||
syn keyword rustEnum Ordering
|
|
||||||
syn keyword rustEnumVariant Less Equal Greater
|
|
||||||
syn keyword rustTrait Collection Mutable Map MutableMap MutableSeq
|
|
||||||
syn keyword rustTrait Set MutableSet
|
|
||||||
syn keyword rustTrait FromIterator Extendable ExactSize
|
|
||||||
syn keyword rustTrait Iterator DoubleEndedIterator
|
|
||||||
syn keyword rustTrait RandomAccessIterator CloneableIterator
|
|
||||||
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator
|
|
||||||
syn keyword rustTrait Num NumCast CheckedAdd CheckedSub CheckedMul CheckedDiv
|
|
||||||
syn keyword rustTrait Signed Unsigned Primitive Int Float
|
|
||||||
syn keyword rustTrait FloatMath ToPrimitive FromPrimitive
|
|
||||||
syn keyword rustTrait Box
|
|
||||||
syn keyword rustTrait GenericPath Path PosixPath WindowsPath
|
|
||||||
syn keyword rustTrait RawPtr
|
|
||||||
syn keyword rustTrait Buffer Writer Reader Seek
|
|
||||||
syn keyword rustTrait Str StrVector StrSlice OwnedStr
|
|
||||||
syn keyword rustTrait IntoMaybeOwned StrAllocating
|
|
||||||
syn keyword rustTrait ToString IntoStr
|
|
||||||
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
|
|
||||||
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
|
|
||||||
syn keyword rustTrait Tuple9 Tuple10 Tuple11 Tuple12
|
|
||||||
syn keyword rustTrait CloneableVector ImmutableCloneableVector
|
|
||||||
syn keyword rustTrait MutableCloneableVector MutableOrdVector
|
|
||||||
syn keyword rustTrait ImmutableVector MutableVector
|
|
||||||
syn keyword rustTrait ImmutableEqVector ImmutableOrdVector
|
|
||||||
syn keyword rustTrait Vector VectorVector
|
|
||||||
syn keyword rustTrait MutableVectorAllocating
|
|
||||||
syn keyword rustTrait String
|
|
||||||
syn keyword rustTrait Vec
|
syn keyword rustTrait Vec
|
||||||
|
" FIXME: remove when path reform lands
|
||||||
"syn keyword rustFunction sync_channel channel
|
syn keyword rustTrait Path GenericPath
|
||||||
syn keyword rustTrait SyncSender Sender Receiver
|
" FIXME: remove when I/O reform lands
|
||||||
"syn keyword rustFunction spawn
|
syn keyword rustTrait Buffer Writer Reader Seek BufferPrelude
|
||||||
|
|
||||||
"syn keyword rustConstant GC
|
|
||||||
|
|
||||||
syn keyword rustSelf self
|
|
||||||
syn keyword rustBoolean true false
|
|
||||||
|
|
||||||
" Other syntax {{{2
|
" Other syntax {{{2
|
||||||
|
syn keyword rustSelf self
|
||||||
|
syn keyword rustBoolean true false
|
||||||
|
|
||||||
" If foo::bar changes to foo.bar, change this ("::" to "\.").
|
" If foo::bar changes to foo.bar, change this ("::" to "\.").
|
||||||
" If foo::bar changes to Foo::bar, change this (first "\w" to "\u").
|
" If foo::bar changes to Foo::bar, change this (first "\w" to "\u").
|
||||||
syn match rustModPath "\w\(\w\)*::[^<]"he=e-3,me=e-3
|
syn match rustModPath "\w\(\w\)*::[^<]"he=e-3,me=e-3
|
||||||
syn match rustModPathInUse "\w\(\w\)*" contained " only for 'use path;'
|
|
||||||
syn match rustModPathSep "::"
|
syn match rustModPathSep "::"
|
||||||
" rustModPathInUse is split out from rustModPath so that :syn-include can get the group list right.
|
|
||||||
|
|
||||||
syn match rustFuncCall "\w\(\w\)*("he=e-1,me=e-1
|
syn match rustFuncCall "\w\(\w\)*("he=e-1,me=e-1
|
||||||
syn match rustFuncCall "\w\(\w\)*::<"he=e-3,me=e-3 " foo::<T>();
|
syn match rustFuncCall "\w\(\w\)*::<"he=e-3,me=e-3 " foo::<T>();
|
||||||
@@ -162,30 +121,32 @@ syn match rustSigil display /[&~@*][^)= \t\r\n]/he=e-1,me=e-1
|
|||||||
" Last, because the & in && isn't a sigil
|
" Last, because the & in && isn't a sigil
|
||||||
syn match rustOperator display "&&\|||"
|
syn match rustOperator display "&&\|||"
|
||||||
|
|
||||||
syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustFail
|
syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustPanic
|
||||||
syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustFail
|
syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustPanic
|
||||||
|
|
||||||
syn match rustEscapeError display contained /\\./
|
syn match rustEscapeError display contained /\\./
|
||||||
syn match rustEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/
|
syn match rustEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/
|
||||||
syn match rustEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{8}\)/
|
syn match rustEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{8}\)/
|
||||||
|
syn match rustEscapeUnicode display contained /\\u{\x\{1,6}}/
|
||||||
syn match rustStringContinuation display contained /\\\n\s*/
|
syn match rustStringContinuation display contained /\\\n\s*/
|
||||||
syn region rustString start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeError,rustStringContinuation
|
syn region rustString start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeError,rustStringContinuation
|
||||||
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell
|
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell
|
||||||
syn region rustString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell
|
syn region rustString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell
|
||||||
|
|
||||||
syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDeriving
|
syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDerive
|
||||||
syn region rustDeriving start="deriving(" end=")" contained contains=rustTrait
|
syn region rustDerive start="derive(" end=")" contained contains=rustTrait
|
||||||
|
|
||||||
" Number literals
|
" Number literals
|
||||||
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(8\|16\|32\|64\)\=\)\="
|
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(s\|8\|16\|32\|64\)\)\="
|
||||||
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
|
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\="
|
||||||
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
|
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\="
|
||||||
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
|
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\="
|
||||||
|
|
||||||
" Special case for numbers of the form "1." which are float literals, unless followed by
|
" Special case for numbers of the form "1." which are float literals, unless followed by
|
||||||
" an identifier, which makes them integer literals with a method call or field access.
|
" an identifier, which makes them integer literals with a method call or field access,
|
||||||
|
" or by another ".", which makes them integer literals followed by the ".." token.
|
||||||
" (This must go first so the others take precedence.)
|
" (This must go first so the others take precedence.)
|
||||||
syn match rustFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\@!"
|
syn match rustFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\|\.\)\@!"
|
||||||
" To mark a number as a normal float, it must have at least one of the three things integral values don't have:
|
" To mark a number as a normal float, it must have at least one of the three things integral values don't have:
|
||||||
" a decimal point and more numbers; an exponent; and a type suffix.
|
" a decimal point and more numbers; an exponent; and a type suffix.
|
||||||
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)\="
|
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)\="
|
||||||
@@ -203,7 +164,7 @@ syn match rustCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/
|
|||||||
" The groups negated here add up to 0-255 but nothing else (they do not seem to go beyond ASCII).
|
" The groups negated here add up to 0-255 but nothing else (they do not seem to go beyond ASCII).
|
||||||
syn match rustCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/
|
syn match rustCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/
|
||||||
syn match rustCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=rustEscape,rustEscapeError,rustCharacterInvalid,rustCharacterInvalidUnicode
|
syn match rustCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=rustEscape,rustEscapeError,rustCharacterInvalid,rustCharacterInvalidUnicode
|
||||||
syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid
|
syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\|u{\x\{1,6}}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid
|
||||||
|
|
||||||
syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell
|
syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell
|
||||||
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell
|
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell
|
||||||
@@ -227,7 +188,7 @@ syn keyword rustTodo contained TODO FIXME XXX NB NOTE
|
|||||||
|
|
||||||
" Folding rules {{{2
|
" Folding rules {{{2
|
||||||
" Trivial folding rules to begin with.
|
" Trivial folding rules to begin with.
|
||||||
" TODO: use the AST to make really good folding
|
" FIXME: use the AST to make really good folding
|
||||||
syn region rustFoldBraces start="{" end="}" transparent fold
|
syn region rustFoldBraces start="{" end="}" transparent fold
|
||||||
|
|
||||||
" Default highlighting {{{1
|
" Default highlighting {{{1
|
||||||
@@ -263,7 +224,6 @@ hi def link rustReservedKeyword Error
|
|||||||
hi def link rustConditional Conditional
|
hi def link rustConditional Conditional
|
||||||
hi def link rustIdentifier Identifier
|
hi def link rustIdentifier Identifier
|
||||||
hi def link rustCapsIdent rustIdentifier
|
hi def link rustCapsIdent rustIdentifier
|
||||||
hi def link rustModPathInUse rustModPath
|
|
||||||
hi def link rustModPath Include
|
hi def link rustModPath Include
|
||||||
hi def link rustModPathSep Delimiter
|
hi def link rustModPathSep Delimiter
|
||||||
hi def link rustFunction Function
|
hi def link rustFunction Function
|
||||||
@@ -274,12 +234,12 @@ hi def link rustCommentLineDoc SpecialComment
|
|||||||
hi def link rustCommentBlock rustCommentLine
|
hi def link rustCommentBlock rustCommentLine
|
||||||
hi def link rustCommentBlockDoc rustCommentLineDoc
|
hi def link rustCommentBlockDoc rustCommentLineDoc
|
||||||
hi def link rustAssert PreCondit
|
hi def link rustAssert PreCondit
|
||||||
hi def link rustFail PreCondit
|
hi def link rustPanic PreCondit
|
||||||
hi def link rustMacro Macro
|
hi def link rustMacro Macro
|
||||||
hi def link rustType Type
|
hi def link rustType Type
|
||||||
hi def link rustTodo Todo
|
hi def link rustTodo Todo
|
||||||
hi def link rustAttribute PreProc
|
hi def link rustAttribute PreProc
|
||||||
hi def link rustDeriving PreProc
|
hi def link rustDerive PreProc
|
||||||
hi def link rustStorage StorageClass
|
hi def link rustStorage StorageClass
|
||||||
hi def link rustObsoleteStorage Error
|
hi def link rustObsoleteStorage Error
|
||||||
hi def link rustLifetime Special
|
hi def link rustLifetime Special
|
||||||
@@ -291,9 +251,9 @@ hi def link rustBoxPlacementExpr rustKeyword
|
|||||||
|
|
||||||
" Other Suggestions:
|
" Other Suggestions:
|
||||||
" hi rustAttribute ctermfg=cyan
|
" hi rustAttribute ctermfg=cyan
|
||||||
" hi rustDeriving ctermfg=cyan
|
" hi rustDerive ctermfg=cyan
|
||||||
" hi rustAssert ctermfg=yellow
|
" hi rustAssert ctermfg=yellow
|
||||||
" hi rustFail ctermfg=red
|
" hi rustPanic ctermfg=red
|
||||||
" hi rustMacro ctermfg=magenta
|
" hi rustMacro ctermfg=magenta
|
||||||
|
|
||||||
syn sync minlines=200
|
syn sync minlines=200
|
||||||
|
|||||||
@@ -1,22 +1,40 @@
|
|||||||
|
" Vim syntax file
|
||||||
|
" Language: Scala
|
||||||
|
" Maintainer: Derek Wyatt
|
||||||
|
" URL: https://github.com/derekwyatt/vim-scala
|
||||||
|
" License: Apache 2
|
||||||
|
" ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if !exists('main_syntax')
|
||||||
if version < 600
|
if version < 600
|
||||||
syntax clear
|
syntax clear
|
||||||
elseif exists("b:current_syntax")
|
elseif exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
let main_syntax = 'scala'
|
||||||
|
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
|
||||||
|
|
||||||
@@ -58,6 +76,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,12 +118,15 @@ 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
|
||||||
@@ -146,7 +170,7 @@ syn match scalaTypeAnnotationParameter /@\<[`_A-Za-z0-9$]\+\>/ contained
|
|||||||
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 region scalaMultilineComment start="/\*" end="\*/" contains=scalaMultilineComment,scalaDocLinks,scalaParameterAnnotation,scalaCommentAnnotation,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
|
||||||
@@ -162,7 +186,7 @@ hi link scalaCommentCodeBlock String
|
|||||||
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=@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 +202,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:
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ syn match sdUnitKey contained /^Documentation=/ nextgroup=sdDocURI
|
|||||||
syn match sdUnitKey contained /^SourcePath=/ nextgroup=sdFilename,sdErr
|
syn match sdUnitKey contained /^SourcePath=/ nextgroup=sdFilename,sdErr
|
||||||
syn match sdUnitKey contained /^\%(Requires\|RequiresOverridable\|Requisite\|RequisiteOverridable\|Wants\|BindsTo\|PartOf\|Conflicts\|Before\|After\|OnFailure\|Names|PropagatesReloadTo\|ReloadPropagatedFrom\)=/ nextgroup=sdUnitList
|
syn match sdUnitKey contained /^\%(Requires\|RequiresOverridable\|Requisite\|RequisiteOverridable\|Wants\|BindsTo\|PartOf\|Conflicts\|Before\|After\|OnFailure\|Names|PropagatesReloadTo\|ReloadPropagatedFrom\)=/ nextgroup=sdUnitList
|
||||||
syn match sdUnitKey contained /^\%(OnFailureIsolate\|IgnoreOnIsolate\|IgnoreOnSnapshot\|StopWhenUnneeded\|RefuseManualStart\|RefuseManualStop\|AllowIsolate\|DefaultDependencies\)=/ nextgroup=sdBool,sdErr
|
syn match sdUnitKey contained /^\%(OnFailureIsolate\|IgnoreOnIsolate\|IgnoreOnSnapshot\|StopWhenUnneeded\|RefuseManualStart\|RefuseManualStop\|AllowIsolate\|DefaultDependencies\)=/ nextgroup=sdBool,sdErr
|
||||||
|
syn match sdUnitKey contained /^OnFailureJobMode=/ nextgroup=sdFailJobMode,sdErr
|
||||||
syn match sdUnitKey contained /^JobTimeoutSec=/ nextgroup=sdDuration,sdErr
|
syn match sdUnitKey contained /^JobTimeoutSec=/ nextgroup=sdDuration,sdErr
|
||||||
" ConditionXXX. Note that they all have an optional '|' after the '='
|
" ConditionXXX. Note that they all have an optional '|' after the '='
|
||||||
syn match sdUnitKey contained /^Condition\(PathExists\|PathExistsGlob\|PathIsDirectory\|PathIsMountPoint\|PathIsReadWrite\|PathIsSymbolicLink\|DirectoryNotEmpty\|FileNotEmpty\|FileIsExecutable\)=|\=!\=/ contains=sdConditionFlag nextgroup=sdFilename,sdErr
|
syn match sdUnitKey contained /^Condition\(PathExists\|PathExistsGlob\|PathIsDirectory\|PathIsMountPoint\|PathIsReadWrite\|PathIsSymbolicLink\|DirectoryNotEmpty\|FileNotEmpty\|FileIsExecutable\)=|\=!\=/ contains=sdConditionFlag nextgroup=sdFilename,sdErr
|
||||||
@@ -59,6 +60,7 @@ syn match sdUnitList contained /.*/ contains=sdUnitName,sdErr
|
|||||||
syn match sdConditionFlag contained /[!|]/
|
syn match sdConditionFlag contained /[!|]/
|
||||||
syn keyword sdVirtType contained nextgroup=sdErr vm container qemu kvm vmware microsoft oracle xen bochs chroot openvz lxc lxc-libvirt systemd-nspawn
|
syn keyword sdVirtType contained nextgroup=sdErr vm container qemu kvm vmware microsoft oracle xen bochs chroot openvz lxc lxc-libvirt systemd-nspawn
|
||||||
syn keyword sdSecurityType contained nextgroup=sdErr selinux
|
syn keyword sdSecurityType contained nextgroup=sdErr selinux
|
||||||
|
syn keyword sdFailJobMode contained nextgroup=sderr fail replace replace-irreversibly
|
||||||
syn match sdDocUri contained /\%(https\=:\/\/\|file:\|info:\|man:\)\S\+\s*/ nextgroup=sdDocUri,sdErr
|
syn match sdDocUri contained /\%(https\=:\/\/\|file:\|info:\|man:\)\S\+\s*/ nextgroup=sdDocUri,sdErr
|
||||||
|
|
||||||
" [Install] {{{1
|
" [Install] {{{1
|
||||||
@@ -94,6 +96,7 @@ syn match sdExecKey contained /^IOSchedulingClass=/ nextgroup=sdIOSchedClass,sdE
|
|||||||
syn match sdExecKey contained /^IOSchedulingPriority=/ nextgroup=sdIOSchedPrio,sdErr
|
syn match sdExecKey contained /^IOSchedulingPriority=/ nextgroup=sdIOSchedPrio,sdErr
|
||||||
syn match sdExecKey contained /^CPUSchedulingPolicy=/ nextgroup=sdCPUSchedPol,sdErr
|
syn match sdExecKey contained /^CPUSchedulingPolicy=/ nextgroup=sdCPUSchedPol,sdErr
|
||||||
syn match sdExecKey contained /^MountFlags=/ nextgroup=sdMountFlags,sdErr
|
syn match sdExecKey contained /^MountFlags=/ nextgroup=sdMountFlags,sdErr
|
||||||
|
syn match sdExecKey contained /^IgnoreSIGPIPE=/ nextgroup=sdBool,sdErr
|
||||||
syn match sdExecKey contained /^Environment=/ nextgroup=sdEnvDefs
|
syn match sdExecKey contained /^Environment=/ nextgroup=sdEnvDefs
|
||||||
syn match sdExecKey contained /^EnvironmentFile=-\=/ contains=sdEnvDashFlag nextgroup=sdFilename,sdErr
|
syn match sdExecKey contained /^EnvironmentFile=-\=/ contains=sdEnvDashFlag nextgroup=sdFilename,sdErr
|
||||||
|
|
||||||
@@ -248,6 +251,7 @@ hi def link sdSecurityType sdValue
|
|||||||
hi def link sdSecureBits sdValue
|
hi def link sdSecureBits sdValue
|
||||||
hi def link sdMountFlags sdValue
|
hi def link sdMountFlags sdValue
|
||||||
hi def link sdKillMode sdValue
|
hi def link sdKillMode sdValue
|
||||||
|
hi def link sdFailJobMode sdValue
|
||||||
hi def link sdRestartType sdValue
|
hi def link sdRestartType sdValue
|
||||||
hi def link sdSignal sdValue
|
hi def link sdSignal sdValue
|
||||||
hi def link sdStdin sdValue
|
hi def link sdStdin sdValue
|
||||||
|
|||||||
97
syntax/tap.vim
Normal file
97
syntax/tap.vim
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
" Vim syntax file
|
||||||
|
" Language: Verbose TAP Output
|
||||||
|
" Maintainer: Rufus Cable <rufus@threebytesfull.com>
|
||||||
|
" Remark: Simple syntax highlighting for TAP output
|
||||||
|
" License:
|
||||||
|
" Copyright: (c) 2008-2013 Rufus Cable
|
||||||
|
" Last Change: {{LAST_CHANGE}}
|
||||||
|
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn match tapTestDiag /^ *#.*/ contains=tapTestTodo
|
||||||
|
syn match tapTestTime /^ *\[\d\d:\d\d:\d\d\].*/ contains=tapTestFile
|
||||||
|
syn match tapTestFile /\w\+\/[^. ]*/ contained
|
||||||
|
syn match tapTestFileWithDot /\w\+\/[^ ]*/ contained
|
||||||
|
|
||||||
|
syn match tapTestPlan /^ *\d\+\.\.\d\+$/
|
||||||
|
|
||||||
|
" tapTest is a line like 'ok 1', 'not ok 2', 'ok 3 - xxxx'
|
||||||
|
syn match tapTest /^ *\(not \)\?ok \d\+.*/ contains=tapTestStatusOK,tapTestStatusNotOK,tapTestLine
|
||||||
|
|
||||||
|
" tapTestLine is the line without the ok/not ok status - i.e. number and
|
||||||
|
" optional message
|
||||||
|
syn match tapTestLine /\d\+\( .*\|$\)/ contains=tapTestNumber,tapTestLoadMessage,tapTestTodo,tapTestSkip contained
|
||||||
|
|
||||||
|
" turn ok/not ok messages green/red respectively
|
||||||
|
syn match tapTestStatusOK /ok/ contained
|
||||||
|
syn match tapTestStatusNotOK /not ok/ contained
|
||||||
|
|
||||||
|
" highlight todo tests
|
||||||
|
syn match tapTestTodo /\(# TODO\|Failed (TODO)\) .*$/ contained contains=tapTestTodoRev
|
||||||
|
syn match tapTestTodoRev /\<TODO\>/ contained
|
||||||
|
|
||||||
|
" highlight skipped tests
|
||||||
|
syn match tapTestSkip /# skip .*$/ contained contains=tapTestSkipTag
|
||||||
|
syn match tapTestSkipTag /\(# \)\@<=skip\>/ contained
|
||||||
|
|
||||||
|
" look behind so "ok 123" and "not ok 124" match test number
|
||||||
|
syn match tapTestNumber /\(ok \)\@<=\d\d*/ contained
|
||||||
|
syn match tapTestLoadMessage /\*\*\*.*\*\*\*/ contained contains=tapTestThreeStars,tapTestFileWithDot
|
||||||
|
syn match tapTestThreeStars /\*\*\*/ contained
|
||||||
|
|
||||||
|
syn region tapTestRegion start=/^ *\(not \)\?ok.*$/me=e+1 end=/^\(\(not \)\?ok\|# Looks like you planned \|All tests successful\|Bailout called\)/me=s-1 fold transparent excludenl
|
||||||
|
syn region tapTestResultsOKRegion start=/^\(All tests successful\|Result: PASS\)/ end=/$/
|
||||||
|
syn region tapTestResultsNotOKRegion start=/^\(# Looks like you planned \|Bailout called\|# Looks like you failed \|Result: FAIL\)/ end=/$/
|
||||||
|
syn region tapTestResultsSummaryRegion start=/^Test Summary Report/ end=/^Files=.*$/ contains=tapTestResultsSummaryHeading,tapTestResultsSummaryNotOK
|
||||||
|
|
||||||
|
syn region tapTestResultsSummaryHeading start=/^Test Summary Report/ end=/^-\+$/ contained
|
||||||
|
syn region tapTestResultsSummaryNotOK start=/TODO passed:/ end=/$/ contained
|
||||||
|
|
||||||
|
syn region tapTestInstructionsRegion start=/\%1l/ end=/^$/
|
||||||
|
|
||||||
|
set foldtext=TAPTestLine_foldtext()
|
||||||
|
function! TAPTestLine_foldtext()
|
||||||
|
let line = getline(v:foldstart)
|
||||||
|
let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g')
|
||||||
|
return sub
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
set foldminlines=5
|
||||||
|
set foldcolumn=2
|
||||||
|
set foldenable
|
||||||
|
set foldmethod=syntax
|
||||||
|
syn sync fromstart
|
||||||
|
|
||||||
|
if !exists("did_tapverboseoutput_syntax_inits")
|
||||||
|
let did_tapverboseoutput_syntax_inits = 1
|
||||||
|
|
||||||
|
hi tapTestStatusOK term=bold ctermfg=green guifg=Green
|
||||||
|
hi tapTestStatusNotOK term=reverse ctermfg=black ctermbg=red guifg=Black guibg=Red
|
||||||
|
hi tapTestTodo term=bold ctermfg=yellow ctermbg=black guifg=Yellow guibg=Black
|
||||||
|
hi tapTestTodoRev term=reverse ctermfg=black ctermbg=yellow guifg=Black guibg=Yellow
|
||||||
|
hi tapTestSkip term=bold ctermfg=lightblue guifg=LightBlue
|
||||||
|
hi tapTestSkipTag term=reverse ctermfg=black ctermbg=lightblue guifg=Black guibg=LightBlue
|
||||||
|
hi tapTestTime term=bold ctermfg=blue guifg=Blue
|
||||||
|
hi tapTestFile term=reverse ctermfg=black ctermbg=yellow guibg=Black guifg=Yellow
|
||||||
|
hi tapTestLoadedFile term=bold ctermfg=black ctermbg=cyan guibg=Cyan guifg=Black
|
||||||
|
hi tapTestThreeStars term=reverse ctermfg=blue guifg=Blue
|
||||||
|
hi tapTestPlan term=bold ctermfg=yellow guifg=Yellow
|
||||||
|
|
||||||
|
hi link tapTestFileWithDot tapTestLoadedFile
|
||||||
|
hi link tapTestNumber Number
|
||||||
|
hi link tapTestDiag Comment
|
||||||
|
|
||||||
|
hi tapTestRegion ctermbg=green
|
||||||
|
|
||||||
|
hi tapTestResultsOKRegion ctermbg=green ctermfg=black
|
||||||
|
hi tapTestResultsNotOKRegion ctermbg=red ctermfg=black
|
||||||
|
|
||||||
|
hi tapTestResultsSummaryHeading ctermbg=blue ctermfg=white
|
||||||
|
hi tapTestResultsSummaryNotOK ctermbg=red ctermfg=black
|
||||||
|
|
||||||
|
hi tapTestInstructionsRegion ctermbg=lightmagenta ctermfg=black
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:current_syntax="tapVerboseOutput"
|
||||||
98
syntax/thrift.vim
Normal file
98
syntax/thrift.vim
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
" Vim syntax file
|
||||||
|
" Language: Thrift
|
||||||
|
" Maintainer: Martin Smith <martin@facebook.com>
|
||||||
|
" Last Change: $Date: $
|
||||||
|
"
|
||||||
|
" $Id: $
|
||||||
|
"
|
||||||
|
" Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
" or more contributor license agreements. See the NOTICE file
|
||||||
|
" distributed with this work for additional information
|
||||||
|
" regarding copyright ownership. The ASF licenses this file
|
||||||
|
" to you under the Apache License, Version 2.0 (the
|
||||||
|
" "License"); you may not use this file except in compliance
|
||||||
|
" with the License. You may obtain a copy of the License at
|
||||||
|
"
|
||||||
|
" http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
"
|
||||||
|
" Unless required by applicable law or agreed to in writing,
|
||||||
|
" software distributed under the License is distributed on an
|
||||||
|
" "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
" KIND, either express or implied. See the License for the
|
||||||
|
" specific language governing permissions and limitations
|
||||||
|
" under the License.
|
||||||
|
"
|
||||||
|
|
||||||
|
if version < 600
|
||||||
|
syntax clear
|
||||||
|
elseif exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Todo
|
||||||
|
syn keyword thriftTodo TODO todo FIXME fixme XXX xxx contained
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
syn match thriftComment "#.*" contains=thriftTodo,@Spell
|
||||||
|
syn region thriftComment start="/\*" end="\*/" contains=thriftTodo,@Spell
|
||||||
|
syn match thriftComment "//.\{-}\(?>\|$\)\@="
|
||||||
|
|
||||||
|
" String
|
||||||
|
syn region thriftStringDouble matchgroup=None start=+"+ end=+"+
|
||||||
|
|
||||||
|
" Number
|
||||||
|
syn match thriftNumber "-\=\<\d\+\>" contained
|
||||||
|
|
||||||
|
" Keywords
|
||||||
|
syn keyword thriftStatement namespace
|
||||||
|
syn keyword thriftInclude include
|
||||||
|
syn keyword thriftKeyword xsd_all xsd_optional xsd_nillable xsd_attrs
|
||||||
|
syn keyword thriftKeyword cpp_include cpp_type const optional required
|
||||||
|
syn keyword thriftStatement throws typedef
|
||||||
|
syn keyword thriftBasicTypes void bool byte string binary
|
||||||
|
syn keyword thriftBasicTypes i16 i32 i64 double
|
||||||
|
syn keyword thriftType map list set
|
||||||
|
syn keyword thriftClass struct exception enum
|
||||||
|
syn region thriftString start=+"+ end=+"+
|
||||||
|
|
||||||
|
" Special
|
||||||
|
syn match thriftNumber "\d\+:"
|
||||||
|
|
||||||
|
" Structure
|
||||||
|
syn keyword thriftStructure service oneway extends
|
||||||
|
"async" { return tok_async; }
|
||||||
|
"exception" { return tok_xception; }
|
||||||
|
"extends" { return tok_extends; }
|
||||||
|
"throws" { return tok_throws; }
|
||||||
|
"service" { return tok_service; }
|
||||||
|
"enum" { return tok_enum; }
|
||||||
|
"const" { return tok_const; }
|
||||||
|
|
||||||
|
if version >= 508 || !exists("did_thrift_syn_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_thrift_syn_inits = 1
|
||||||
|
command! -nargs=+ HiLink hi link <args>
|
||||||
|
else
|
||||||
|
command! -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
|
||||||
|
HiLink thriftComment Comment
|
||||||
|
HiLink thriftKeyword Special
|
||||||
|
HiLink thriftBasicTypes Type
|
||||||
|
HiLink thriftType Type
|
||||||
|
HiLink thriftStructure StorageClass
|
||||||
|
HiLink thriftTodo Todo
|
||||||
|
HiLink thriftString String
|
||||||
|
HiLink thriftNumber Number
|
||||||
|
HiLink thriftSpecial Special
|
||||||
|
HiLink thriftStructure Structure
|
||||||
|
HiLink thriftStatement Statement
|
||||||
|
HiLink thriftInclude Include
|
||||||
|
HiLink thriftClass Type
|
||||||
|
HiLink thriftString String
|
||||||
|
|
||||||
|
delcommand HiLink
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:current_syntax = "thrift"
|
||||||
|
|
||||||
302
syntax/tmux.vim
302
syntax/tmux.vim
@@ -1,8 +1,22 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: tmux(1) configuration file
|
" Language: tmux(1) configuration file
|
||||||
" Maintainer: Tiago Cunha <me@tiagocunha.org>
|
" Maintainer: Tiago Cunha <tcunha@users.sourceforge.net>
|
||||||
" Last Change: $Date: 2010-07-27 18:29:07 $
|
" 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
|
||||||
@@ -16,64 +30,238 @@ syntax case match
|
|||||||
syn keyword tmuxAction any current none
|
syn keyword tmuxAction any current none
|
||||||
syn keyword tmuxBoolean off on
|
syn keyword tmuxBoolean off on
|
||||||
|
|
||||||
syn keyword tmuxCmds detach[-client] ls list-sessions neww new-window
|
syn keyword tmuxCmds
|
||||||
syn keyword tmuxCmds bind[-key] unbind[-key] prev[ious-window] last[-window]
|
\ attach[-session]
|
||||||
syn keyword tmuxCmds lsk list-keys set[-option] renamew rename-window selectw
|
\ bind[-key]
|
||||||
syn keyword tmuxCmds select-window lsw list-windows attach[-session]
|
\ break-pane
|
||||||
syn keyword tmuxCmds send-prefix refresh[-client] killw kill-window lsc
|
\ breakp
|
||||||
syn keyword tmuxCmds list-clients linkw link-window unlinkw unlink-window
|
\ capture-pane
|
||||||
syn keyword tmuxCmds next[-window] send[-keys] swapw swap-window
|
\ capturep
|
||||||
syn keyword tmuxCmds rename[-session] kill-session switchc switch-client
|
\ choose-buffer
|
||||||
syn keyword tmuxCmds has[-session] copy-mode pasteb paste-buffer
|
\ choose-client
|
||||||
syn keyword tmuxCmds new[-session] start[-server] kill-server setw
|
\ choose-list
|
||||||
syn keyword tmuxCmds set-window-option show[-options] showw show-window-options
|
\ choose-session
|
||||||
syn keyword tmuxCmds command-prompt setb set-buffer showb show-buffer lsb
|
\ choose-tree
|
||||||
syn keyword tmuxCmds list-buffers deleteb delete-buffer lscm list-commands
|
\ choose-window
|
||||||
syn keyword tmuxCmds movew move-window respawnw respawn-window
|
\ clear-history
|
||||||
syn keyword tmuxCmds source[-file] info server-info clock-mode lock[-server]
|
\ clearhist
|
||||||
syn keyword tmuxCmds saveb save-buffer killp
|
\ clock-mode
|
||||||
syn keyword tmuxCmds kill-pane resizep resize-pane selectp select-pane swapp
|
\ command-prompt
|
||||||
syn keyword tmuxCmds swap-pane splitw split-window choose-session
|
\ confirm[-before]
|
||||||
syn keyword tmuxCmds choose-window loadb load-buffer copyb copy-buffer suspendc
|
\ copy-mode
|
||||||
syn keyword tmuxCmds suspend-client findw find-window breakp break-pane nextl
|
\ delete-buffer
|
||||||
syn keyword tmuxCmds next-layout rotatew rotate-window confirm[-before]
|
\ deleteb
|
||||||
syn keyword tmuxCmds clearhist clear-history selectl select-layout if[-shell]
|
\ detach[-client]
|
||||||
syn keyword tmuxCmds display[-message] setenv set-environment showenv
|
\ display[-message]
|
||||||
syn keyword tmuxCmds show-environment choose-client displayp display-panes
|
\ display-panes
|
||||||
syn keyword tmuxCmds run[-shell] lockc lock-client locks lock-session lsp
|
\ displayp
|
||||||
syn keyword tmuxCmds list-panes pipep pipe-pane showmsgs show-messages capturep
|
\ find-window
|
||||||
syn keyword tmuxCmds capture-pane joinp join-pane choose-buffer
|
\ 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 prefix status status-fg status-bg bell-action
|
syn keyword tmuxOptsSet
|
||||||
syn keyword tmuxOptsSet default-command history-limit status-left status-right
|
\ assume-paste-time
|
||||||
syn keyword tmuxOptsSet status-interval set-titles display-time buffer-limit
|
\ base-index
|
||||||
syn keyword tmuxOptsSet status-left-length status-right-length
|
\ bell-action
|
||||||
syn keyword tmuxOptsSet message-[command-]bg lock-after-time default-path
|
\ bell-on-alert
|
||||||
syn keyword tmuxOptsSet message-[command-]attr status-attr set-remain-on-exit
|
\ buffer-limit
|
||||||
syn keyword tmuxOptsSet status-utf8 default-terminal visual-activity repeat-time
|
\ default-command
|
||||||
syn keyword tmuxOptsSet visual-bell visual-content status-justify status-keys
|
\ default-shell
|
||||||
syn keyword tmuxOptsSet terminal-overrides status-left-attr status-left-bg
|
\ default-terminal
|
||||||
syn keyword tmuxOptsSet status-left-fg status-right-attr status-right-bg
|
\ destroy-unattached
|
||||||
syn keyword tmuxOptsSet status-right-fg update-environment base-index
|
\ detach-on-destroy
|
||||||
syn keyword tmuxOptsSet display-panes-colour display-panes-time default-shell
|
\ display-panes-active-colour
|
||||||
syn keyword tmuxOptsSet set-titles-string lock-command lock-server
|
\ display-panes-colour
|
||||||
syn keyword tmuxOptsSet mouse-select-pane message-limit quiet escape-time
|
\ display-panes-time
|
||||||
syn keyword tmuxOptsSet pane-active-border-bg pane-active-border-fg
|
\ display-time
|
||||||
syn keyword tmuxOptsSet pane-border-bg pane-border-fg message-[command-]fg
|
\ escape-time
|
||||||
syn keyword tmuxOptsSet display-panes-active-colour alternate-screen
|
\ exit-unattached
|
||||||
syn keyword tmuxOptsSet detach-on-destroy
|
\ 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-remain-on-exit
|
||||||
|
\ set-titles
|
||||||
|
\ set-titles-string
|
||||||
|
\ status
|
||||||
|
\ status-interval
|
||||||
|
\ status-justify
|
||||||
|
\ status-keys
|
||||||
|
\ status-left
|
||||||
|
\ status-left-length
|
||||||
|
\ status-left-style
|
||||||
|
\ status-position
|
||||||
|
\ status-right
|
||||||
|
\ status-right-length
|
||||||
|
\ status-utf8
|
||||||
|
\ staus-right-style
|
||||||
|
\ terminal-overrides
|
||||||
|
\ update-environment
|
||||||
|
\ visual-activity
|
||||||
|
\ visual-bell
|
||||||
|
\ visual-content
|
||||||
|
\ visual-silence
|
||||||
|
\ word-separators
|
||||||
|
|
||||||
syn keyword tmuxOptsSetw monitor-activity aggressive-resize force-width
|
syn keyword tmuxOptsSetw
|
||||||
syn keyword tmuxOptsSetw force-height remain-on-exit uft8 mode-fg mode-bg
|
\ aggressive-resize
|
||||||
syn keyword tmuxOptsSetw mode-keys clock-mode-colour clock-mode-style
|
\ allow-rename
|
||||||
syn keyword tmuxOptsSetw xterm-keys mode-attr window-status-attr
|
\ alternate-screen
|
||||||
syn keyword tmuxOptsSetw window-status-bg window-status-fg automatic-rename
|
\ automatic-rename
|
||||||
syn keyword tmuxOptsSetw main-pane-width main-pane-height monitor-content
|
\ c0-change-interval
|
||||||
syn keyword tmuxOptsSetw window-status-current-attr window-status-current-bg
|
\ c0-change-trigger
|
||||||
syn keyword tmuxOptsSetw window-status-current-fg mode-mouse synchronize-panes
|
\ clock-mode-colour
|
||||||
syn keyword tmuxOptsSetw window-status-format window-status-current-format
|
\ clock-mode-style
|
||||||
syn keyword tmuxOptsSetw word-separators window-status-alert-attr
|
\ force-height
|
||||||
syn keyword tmuxOptsSetw window-status-alert-bg window-status-alert-fg
|
\ force-width
|
||||||
|
\ main-pane-height
|
||||||
|
\ main-pane-width
|
||||||
|
\ mode-keys
|
||||||
|
\ mode-mouse
|
||||||
|
\ mode-style
|
||||||
|
\ monitor-activity
|
||||||
|
\ monitor-content
|
||||||
|
\ 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-content-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
|
||||||
|
|
||||||
|
|||||||
18
syntax/tomdoc.vim
Normal file
18
syntax/tomdoc.vim
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
syn keyword tomdocKeywords
|
||||||
|
\ Returns Yields Raises Examples Signature
|
||||||
|
\ containedin=.*Comment
|
||||||
|
\ contained
|
||||||
|
|
||||||
|
syn match tomdocDescriptions
|
||||||
|
\ +\s*\(Public\|Internal\|Deprecated\):+he=e-1
|
||||||
|
\ containedin=.*Comment
|
||||||
|
\ contained
|
||||||
|
|
||||||
|
syn match tomdocArguments
|
||||||
|
\ +\s*[A-Za-z0-9_\-&\*:]*\(\s*- \)+he=e-3
|
||||||
|
\ containedin=.*Comment
|
||||||
|
\ contained
|
||||||
|
|
||||||
|
hi default link tomdocDescriptions String
|
||||||
|
hi default link tomdocKeywords String
|
||||||
|
hi default link tomdocArguments HELP
|
||||||
@@ -7,10 +7,22 @@ if exists("b:current_syntax")
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syn match tomlEscape /\\[0tnr"\\]/ display
|
syn match tomlEscape /\\[btnfr"/\\]/ display contained
|
||||||
|
syn match tomlEscape /\\u\x\{4}/ contained
|
||||||
|
syn match tomlEscape /\\U\x\{8}/ contained
|
||||||
hi def link tomlEscape SpecialChar
|
hi def link tomlEscape SpecialChar
|
||||||
|
|
||||||
syn region tomlString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=tomlEscape
|
syn match tomlLineEscape /\\$/ contained
|
||||||
|
hi def link tomlLineEscape SpecialChar
|
||||||
|
|
||||||
|
" Basic strings
|
||||||
|
syn region tomlString oneline start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=tomlEscape
|
||||||
|
" Multi-line basic strings
|
||||||
|
syn region tomlString start=/"""/ end=/"""/ contains=tomlEscape,tomlLineEscape
|
||||||
|
" Literal strings
|
||||||
|
syn region tomlString oneline start=/'/ end=/'/
|
||||||
|
" Multi-line literal strings
|
||||||
|
syn region tomlString start=/'''/ end=/'''/
|
||||||
hi def link tomlString String
|
hi def link tomlString String
|
||||||
|
|
||||||
syn match tomlInteger /\<-\?\d\+\>/ display
|
syn match tomlInteger /\<-\?\d\+\>/ display
|
||||||
@@ -25,8 +37,11 @@ hi def link tomlBoolean Boolean
|
|||||||
syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}T\d\{2\}:\d\{2\}:\d\{2\}Z/ display
|
syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}T\d\{2\}:\d\{2\}:\d\{2\}Z/ display
|
||||||
hi def link tomlDate Constant
|
hi def link tomlDate Constant
|
||||||
|
|
||||||
syn match tomlKeyGroup /^\s*\[.\+\]\s*\(#.*\)\?$/ contains=tomlComment
|
syn match tomlTable /^\s*\[[^#\[\]]\+\]\s*\(#.*\)\?$/ contains=tomlComment
|
||||||
hi def link tomlKeyGroup Identifier
|
hi def link tomlTable Identifier
|
||||||
|
|
||||||
|
syn match tomlTableArray /^\s*\[\[[^#\[\]]\+\]\]\s*\(#.*\)\?$/ contains=tomlComment
|
||||||
|
hi def link tomlTableArray Identifier
|
||||||
|
|
||||||
syn keyword tomlTodo TODO FIXME XXX BUG contained
|
syn keyword tomlTodo TODO FIXME XXX BUG contained
|
||||||
hi def link tomlTodo Todo
|
hi def link tomlTodo Todo
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ 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 /\/\/\/\s*<reference\s\+.*\/>$/ contains=typeScriptRefD,typeScriptRefS
|
syn match typeScriptRef /\/\/\/<reference\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=+'\|$+
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ syntax keyword typeScriptGlobalObjects Array Boolean Date Function Infinity Math
|
|||||||
|
|
||||||
syntax keyword typeScriptExceptions try catch throw finally Error EvalError RangeError ReferenceError SyntaxError TypeError URIError
|
syntax keyword typeScriptExceptions try catch throw finally Error EvalError RangeError ReferenceError SyntaxError TypeError URIError
|
||||||
|
|
||||||
syntax keyword typeScriptReserved constructor declare as interface module abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public
|
syntax keyword typeScriptReserved constructor declare as interface module abstract enum int short export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public type
|
||||||
"}}}
|
"}}}
|
||||||
"" TypeScript/DOM/HTML/CSS specified things"{{{
|
"" TypeScript/DOM/HTML/CSS specified things"{{{
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ syntax keyword typeScriptReserved constructor declare as interface module abstra
|
|||||||
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 bool 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"{{{
|
||||||
@@ -250,7 +250,7 @@ if version >= 508 || !exists("did_typeScript_syn_inits")
|
|||||||
HiLink typeScriptIdentifier Identifier
|
HiLink typeScriptIdentifier Identifier
|
||||||
HiLink typeScriptRepeat Repeat
|
HiLink typeScriptRepeat Repeat
|
||||||
HiLink typeScriptStatement Statement
|
HiLink typeScriptStatement Statement
|
||||||
HiLink typeScriptFuncKeyword Function
|
HiLink typeScriptFuncKeyword Type
|
||||||
HiLink typeScriptMessage Keyword
|
HiLink typeScriptMessage Keyword
|
||||||
HiLink typeScriptDeprecated Exception
|
HiLink typeScriptDeprecated Exception
|
||||||
HiLink typeScriptError Error
|
HiLink typeScriptError Error
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user