From 4d18a5e5dd427a2962fe34c6a12007cac67ce89c Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 23 Apr 2019 11:32:40 +0200 Subject: [PATCH] Update --- README.md | 4 +- autoload/elm/util.vim | 8 +- autoload/go/config.vim | 6 +- autoload/racket.vim | 7 -- autoload/rustfmt.vim | 10 +- autoload/scss_indent.vim | 41 -------- ftdetect/polyglot.vim | 2 +- ftplugin/eelixir.vim | 5 +- ftplugin/elixir.vim | 2 +- indent/scss.vim | 93 ++++++++++++++++++ syntax/carp.vim | 2 +- syntax/cmake.vim | 114 ++++++++++++---------- syntax/eelixir.vim | 5 +- syntax/elixir.vim | 22 +++-- syntax/elm.vim | 2 + syntax/i3config.vim | 2 +- syntax/javascript.vim | 6 +- syntax/json5.vim | 67 ++++++++----- syntax/julia.vim | 6 +- syntax/markdown.vim | 2 +- syntax/ruby.vim | 202 ++++++++++++++++++++++----------------- syntax/terraform.vim | 108 ++++++++++++++++++++- syntax/typescript.vim | 2 +- 23 files changed, 477 insertions(+), 241 deletions(-) delete mode 100644 autoload/racket.vim delete mode 100644 autoload/scss_indent.vim create mode 100644 indent/scss.vim diff --git a/README.md b/README.md index 9802619..1af7fad 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ If you need full functionality of any plugin, please use it directly with your p - [qmake](https://github.com/artoj/qmake-syntax-vim) (syntax) - [qml](https://github.com/peterhoeg/vim-qml) (syntax, indent, ftplugin) - [r-lang](https://github.com/vim-scripts/R.vim) (syntax, ftplugin) -- [racket](https://github.com/wlangstroth/vim-racket) (syntax, indent, autoload, ftplugin) +- [racket](https://github.com/wlangstroth/vim-racket) (syntax, indent, ftplugin) - [ragel](https://github.com/jneen/ragel.vim) (syntax) - [raml](https://github.com/IN3D/vim-raml) (syntax, ftplugin) - [reason](https://github.com/reasonml-editor/vim-reason-plus) (syntax, indent) @@ -150,7 +150,7 @@ If you need full functionality of any plugin, please use it directly with your p - [rust](https://github.com/rust-lang/rust.vim) (syntax, indent, compiler, autoload, ftplugin) - [sbt](https://github.com/derekwyatt/vim-sbt) (syntax) - [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, compiler, ftplugin) -- [scss](https://github.com/cakebaker/scss-syntax.vim) (syntax, autoload, ftplugin) +- [scss](https://github.com/cakebaker/scss-syntax.vim) (syntax, indent, ftplugin) - [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftplugin) - [slime](https://github.com/slime-lang/vim-slime-syntax) (syntax, indent) - [smt2](https://github.com/bohlender/vim-smt2) (syntax, autoload, ftplugin) diff --git a/autoload/elm/util.vim b/autoload/elm/util.vim index aee823c..6d1014e 100644 --- a/autoload/elm/util.vim +++ b/autoload/elm/util.vim @@ -136,7 +136,13 @@ function! elm#util#GoToModule(name) endfunction function! s:findLocalModule(rel_path, root) - let l:package_json = a:root . '/elm-package.json' + let l:old_match = findfile('elm-package.json', a:root . ';') + let l:new_match = findfile('elm.json', a:root . ';') + if !empty(l:new_match) + let l:package_json = l:new_match + elseif !empty(l:old_match) + let l:package_json = l:old_match + endif if exists('*json_decode') let l:package = json_decode(readfile(l:package_json)) let l:source_roots = l:package['source-directories'] diff --git a/autoload/go/config.vim b/autoload/go/config.vim index 7c840c5..4a9c149 100644 --- a/autoload/go/config.vim +++ b/autoload/go/config.vim @@ -52,7 +52,7 @@ function! go#config#TermMode() abort endfunction function! go#config#TermEnabled() abort - return get(g:, 'go_term_enabled', 0) + return has('nvim') && get(g:, 'go_term_enabled', 0) endfunction function! go#config#SetTermEnabled(value) abort @@ -214,6 +214,10 @@ function! go#config#DebugCommands() abort return g:go_debug_commands endfunction +function! go#config#DebugLogOutput() abort + return get(g:, 'go_debug_log_output', 'debugger, rpc') +endfunction + function! go#config#LspLog() abort " make sure g:go_lsp_log is set so that it can be added to easily. let g:go_lsp_log = get(g:, 'go_lsp_log', []) diff --git a/autoload/racket.vim b/autoload/racket.vim deleted file mode 100644 index 08e0d31..0000000 --- a/autoload/racket.vim +++ /dev/null @@ -1,7 +0,0 @@ -if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'racket') != -1 - finish -endif - -if !exists("g:raco_command") - let g:raco_command = system("which raco") -endif diff --git a/autoload/rustfmt.vim b/autoload/rustfmt.vim index 96fffb2..908eb32 100644 --- a/autoload/rustfmt.vim +++ b/autoload/rustfmt.vim @@ -149,6 +149,7 @@ function! s:RunRustfmt(command, tmpname, fail_silently) call delete(l:stderr_tmpname) + let l:open_lwindow = 0 if v:shell_error == 0 " remove undo point caused via BufWritePre try | silent undojoin | catch | endtry @@ -169,7 +170,7 @@ function! s:RunRustfmt(command, tmpname, fail_silently) if s:got_fmt_error let s:got_fmt_error = 0 call setloclist(0, []) - lwindow + let l:open_lwindow = 1 endif elseif g:rustfmt_fail_silently == 0 && a:fail_silently == 0 " otherwise get the errors and put them in the location list @@ -201,7 +202,7 @@ function! s:RunRustfmt(command, tmpname, fail_silently) endif let s:got_fmt_error = 1 - lwindow + let l:open_lwindow = 1 endif " Restore the current directory if needed @@ -213,6 +214,11 @@ function! s:RunRustfmt(command, tmpname, fail_silently) endif endif + " Open lwindow after we have changed back to the previous directory + if l:open_lwindow == 1 + lwindow + endif + silent! loadview endfunction diff --git a/autoload/scss_indent.vim b/autoload/scss_indent.vim deleted file mode 100644 index 27caa78..0000000 --- a/autoload/scss_indent.vim +++ /dev/null @@ -1,41 +0,0 @@ -if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'scss') != -1 - finish -endif - -" usage: -" set indentexpr=scss_indent#GetIndent(v:lnum) -fun! scss_indent#GetIndent(lnum) - " { -> increase indent - " } -> decrease indent - if a:lnum == 1 - " start at 0 indentation - return 0 - endif - - " try to find last line ending with { or } - " ignoring // comments - let regex = '\([{}]\)\%(\/\/.*\)\?$' - let nr = search(regex, 'bnW') - if nr > 0 - let last = indent(nr) - let m = matchlist(getline(nr), regex) - let m_curr = matchlist(getline(a:lnum), regex) - echoe string(m).string(m_curr) - if !empty(m_curr) && m_curr[1] == '}' && m[1] == '{' - " last was open, current is close, use same indent - return last - elseif !empty(m_curr) && m_curr[1] == '}' && m[1] == '}' - " } line and last line was }: decrease - return last - &sw - endif - if m[1] == '{' - " line after {: increase indent - return last + &sw - else - " line after } or { - same indent - return last - endif - else - return 0 - endif -endfun diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index 85409bc..9391127 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -1069,7 +1069,7 @@ endif if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'racket') == -1 augroup filetypedetect " racket, from racket.vim in wlangstroth/vim-racket -au BufRead,BufNewFile *.rkt,*.rktl set filetype=racket +au BufRead,BufNewFile *.rkt,*.rktl setf racket augroup end endif diff --git a/ftplugin/eelixir.vim b/ftplugin/eelixir.vim index 2e3656c..7c1b2b9 100644 --- a/ftplugin/eelixir.vim +++ b/ftplugin/eelixir.vim @@ -24,7 +24,10 @@ if !exists("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\+$') + let b:eelixir_subtype = matchstr(&filetype,'^leex\.\zs\w\+') + endif + if b:eelixir_subtype == '' + let b:eelixir_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.eex\|\.leex\|\.eelixir\)\+$','',''),'\.\zs\w\+$') endif if b:eelixir_subtype == 'ex' let b:eelixir_subtype = 'elixir' diff --git a/ftplugin/elixir.vim b/ftplugin/elixir.vim index a49d639..5354a6c 100644 --- a/ftplugin/elixir.vim +++ b/ftplugin/elixir.vim @@ -32,7 +32,7 @@ let &l:path = \ &g:path \ ], ',') setlocal includeexpr=elixir#util#get_filename(v:fname) -setlocal suffixesadd=.ex,.exs,.eex,.erl,.xrl,.yrl,.hrl +setlocal suffixesadd=.ex,.exs,.eex,.leex,.erl,.xrl,.yrl,.hrl let &l:define = 'def\(macro\|guard\|delegate\)\=p\=' diff --git a/indent/scss.vim b/indent/scss.vim new file mode 100644 index 0000000..f602f35 --- /dev/null +++ b/indent/scss.vim @@ -0,0 +1,93 @@ +if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'scss') != -1 + finish +endif + +" Vim indent file +" Language : SCSS (Sassy CSS) +" Maintainer : Daniel Hofstetter (daniel.hofstetter@42dh.com) +" URL : https://github.com/cakebaker/scss-syntax.vim +" Last Change : 2019-08-04 +" Based on : css.vim by Nikolai Weibull, Oleg Zubchenko +" Modified by : ObserverOfTime + +if exists('b:did_indent') | finish | endif +let b:did_indent = 1 + +setlocal indentexpr=GetSCSSIndent() +setlocal indentkeys=0{,0},0(,0),!^F,o,O +setlocal nosmartindent + +let b:undo_indent = 'setl smartindent< indentkeys< indentexpr<' + +if exists('*GetSCSSIndent') | finish | endif +let s:keepcpo= &cpoptions +set cpoptions&vim + +function s:prevnonblanknoncomment(lnum) + let l:lnum = a:lnum + while l:lnum > 1 + let l:lnum = prevnonblank(l:lnum) + let l:line = getline(l:lnum) + if l:line =~? '\*/' + while l:lnum > 1 && l:line !~? '/\*' + let l:lnum -= 1 + endwhile + if l:line =~? '^\s*/\*' + let l:lnum -= 1 + else + break + endif + else + break + endif + endwhile + return l:lnum +endfunction + +function s:count_chars(lnum, count_open, chars) + let l:n_open = 0 + let l:n_close = 0 + let l:line = getline(a:lnum) + let l:pattern = '['. a:chars .']' + let l:i = match(l:line, l:pattern) + let l:noi = 'scss\%(Comment\|StringQ\{1,2}\)' + while l:i != -1 + if synIDattr(synID(a:lnum, l:i + 1, 0), 'name') !~? l:noi + if l:line[l:i] ==# a:chars[0] + let l:n_open += 1 + elseif l:line[l:i] ==# a:chars[1] + if l:n_open > 0 + let l:n_open -= 1 + else + let l:n_close += 1 + endif + endif + endif + let l:i = match(l:line, l:pattern, l:i + 1) + endwhile + return a:count_open ? l:n_open : l:n_close +endfunction + +function GetSCSSIndent() + let l:line = getline(v:lnum) + if l:line =~? '^\s*\*' + return cindent(v:lnum) + endif + + let l:pnum = s:prevnonblanknoncomment(v:lnum - 1) + if l:pnum == 0 + return 0 + endif + + return indent(l:pnum) + \ + s:count_chars(l:pnum, 1, '{}') * shiftwidth() + \ - s:count_chars(v:lnum, 0, '{}') * shiftwidth() + \ + s:count_chars(l:pnum, 1, '()') * shiftwidth() + \ - s:count_chars(v:lnum, 0, '()') * shiftwidth() +endfunction + +let &cpoptions = s:keepcpo +unlet s:keepcpo + +" vim:set et ts=2 sw=2: + diff --git a/syntax/carp.vim b/syntax/carp.vim index c2b800b..692ffb3 100644 --- a/syntax/carp.vim +++ b/syntax/carp.vim @@ -21,7 +21,7 @@ else endif syn keyword carpSyntax def defn let do if while ref address set! the -syn keyword carpSyntax defmacro defdynamic quote cons list array fn +syn keyword carpSyntax defmacro defdynamic defndynamic quote cons list array fn syn keyword carpSyntax expand deftype register system-include register-type syn keyword carpSyntax defmodule copy use module defalias definterface eval syn keyword carpSyntax expand instantiate type info help quit env build run diff --git a/syntax/cmake.vim b/syntax/cmake.vim index 7b99c9a..041fd0e 100644 --- a/syntax/cmake.vim +++ b/syntax/cmake.vim @@ -4,14 +4,14 @@ endif " Vim syntax file " Program: CMake - Cross-Platform Makefile Generator -" Version: cmake version 3.13.20181220-g0495c +" Version: cmake version 3.14.20190402-g56ae2 " Language: CMake " Author: Andy Cedilnik , " Nicholas Hutchinson , " Patrick Boettcher " Maintainer: Dimitri Merejkowsky " Former Maintainer: Karthik Krishnan -" Last Change: 2018 Dec 20 +" Last Change: 2019 Apr 15 " " Licence: The CMake license applies to this file. See " https://cmake.org/licensing @@ -35,7 +35,7 @@ syn region cmakeGeneratorExpression start="$<" end=">" contained oneline contain syn region cmakeString start='"' end='"' contained contains=cmakeTodo,cmakeVariableValue,cmakeEscaped -syn region cmakeVariableValue start="${" end="}" contained oneline contains=cmakeVariable,cmakeTodo +syn region cmakeVariableValue start="${" end="}" contained oneline contains=cmakeVariable,cmakeTodo,cmakeVariableValue syn region cmakeEnvironment start="$ENV{" end="}" contained oneline contains=cmakeTodo @@ -79,14 +79,17 @@ syn keyword cmakeProperty contained \ AUTOMOC \ AUTOMOC_COMPILER_PREDEFINES \ AUTOMOC_DEPEND_FILTERS + \ AUTOMOC_EXECUTABLE \ AUTOMOC_MACRO_NAMES \ AUTOMOC_MOC_OPTIONS \ AUTOMOC_SOURCE_GROUP \ AUTOMOC_TARGETS_FOLDER \ AUTORCC + \ AUTORCC_EXECUTABLE \ AUTORCC_OPTIONS \ AUTORCC_SOURCE_GROUP \ AUTOUIC + \ AUTOUIC_EXECUTABLE \ AUTOUIC_OPTIONS \ AUTOUIC_SEARCH_PATHS \ BINARY_DIR @@ -102,6 +105,7 @@ syn keyword cmakeProperty contained \ CMAKE_CONFIGURE_DEPENDS \ CMAKE_CXX_KNOWN_FEATURES \ CMAKE_C_KNOWN_FEATURES + \ CMAKE_ROLE \ COMMON_LANGUAGE_RUNTIME \ COMPATIBLE_INTERFACE_BOOL \ COMPATIBLE_INTERFACE_NUMBER_MAX @@ -171,6 +175,8 @@ syn keyword cmakeProperty contained \ GENERATED \ GENERATOR_FILE_NAME \ GENERATOR_IS_MULTI_CONFIG + \ GHS_INTEGRITY_APP + \ GHS_NO_SOURCE_GROUP_FILE \ GLOBAL_DEPENDS_DEBUG_MODE \ GLOBAL_DEPENDS_NO_CYCLES \ GNUtoMS @@ -328,6 +334,7 @@ syn keyword cmakeProperty contained \ VS_IOT_STARTUP_TASK \ VS_KEYWORD \ VS_MOBILE_EXTENSIONS_VERSION + \ VS_NO_SOLUTION_DEPLOY \ VS_RESOURCE_GENERATOR \ VS_SCC_AUXPATH \ VS_SCC_LOCALPATH @@ -359,11 +366,13 @@ syn keyword cmakeProperty contained \ XCODE_EMIT_EFFECTIVE_PLATFORM_NAME \ XCODE_EXPLICIT_FILE_TYPE \ XCODE_FILE_ATTRIBUTES + \ XCODE_GENERATE_SCHEME \ XCODE_LAST_KNOWN_FILE_TYPE \ XCODE_PRODUCT_TYPE \ XCODE_SCHEME_ADDRESS_SANITIZER \ XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN \ XCODE_SCHEME_ARGUMENTS + \ XCODE_SCHEME_DEBUG_AS_ROOT \ XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER \ XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS \ XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE @@ -455,10 +464,6 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_FLAGS_RELEASE_INIT \ CMAKE_ASM_FLAGS_RELWITHDEBINFO \ CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT - \ CMAKE_ASM_GHS_KERNEL_FLAGS_DEBUG - \ CMAKE_ASM_GHS_KERNEL_FLAGS_MINSIZEREL - \ CMAKE_ASM_GHS_KERNEL_FLAGS_RELEASE - \ CMAKE_ASM_GHS_KERNEL_FLAGS_RELWITHDEBINFO \ CMAKE_ASM_IGNORE_EXTENSIONS \ CMAKE_ASM_IMPLICIT_INCLUDE_DIRECTORIES \ CMAKE_ASM_IMPLICIT_LINK_DIRECTORIES @@ -509,10 +514,6 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_MASM_FLAGS_RELEASE_INIT \ CMAKE_ASM_MASM_FLAGS_RELWITHDEBINFO \ CMAKE_ASM_MASM_FLAGS_RELWITHDEBINFO_INIT - \ CMAKE_ASM_MASM_GHS_KERNEL_FLAGS_DEBUG - \ CMAKE_ASM_MASM_GHS_KERNEL_FLAGS_MINSIZEREL - \ CMAKE_ASM_MASM_GHS_KERNEL_FLAGS_RELEASE - \ CMAKE_ASM_MASM_GHS_KERNEL_FLAGS_RELWITHDEBINFO \ CMAKE_ASM_MASM_IGNORE_EXTENSIONS \ CMAKE_ASM_MASM_IMPLICIT_INCLUDE_DIRECTORIES \ CMAKE_ASM_MASM_IMPLICIT_LINK_DIRECTORIES @@ -572,10 +573,6 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_NASM_FLAGS_RELEASE_INIT \ CMAKE_ASM_NASM_FLAGS_RELWITHDEBINFO \ CMAKE_ASM_NASM_FLAGS_RELWITHDEBINFO_INIT - \ CMAKE_ASM_NASM_GHS_KERNEL_FLAGS_DEBUG - \ CMAKE_ASM_NASM_GHS_KERNEL_FLAGS_MINSIZEREL - \ CMAKE_ASM_NASM_GHS_KERNEL_FLAGS_RELEASE - \ CMAKE_ASM_NASM_GHS_KERNEL_FLAGS_RELWITHDEBINFO \ CMAKE_ASM_NASM_IGNORE_EXTENSIONS \ CMAKE_ASM_NASM_IMPLICIT_INCLUDE_DIRECTORIES \ CMAKE_ASM_NASM_IMPLICIT_LINK_DIRECTORIES @@ -687,10 +684,6 @@ syn keyword cmakeVariable contained \ CMAKE_CSharp_FLAGS_RELEASE_INIT \ CMAKE_CSharp_FLAGS_RELWITHDEBINFO \ CMAKE_CSharp_FLAGS_RELWITHDEBINFO_INIT - \ CMAKE_CSharp_GHS_KERNEL_FLAGS_DEBUG - \ CMAKE_CSharp_GHS_KERNEL_FLAGS_MINSIZEREL - \ CMAKE_CSharp_GHS_KERNEL_FLAGS_RELEASE - \ CMAKE_CSharp_GHS_KERNEL_FLAGS_RELWITHDEBINFO \ CMAKE_CSharp_IGNORE_EXTENSIONS \ CMAKE_CSharp_IMPLICIT_INCLUDE_DIRECTORIES \ CMAKE_CSharp_IMPLICIT_LINK_DIRECTORIES @@ -752,10 +745,6 @@ syn keyword cmakeVariable contained \ CMAKE_CUDA_FLAGS_RELEASE_INIT \ CMAKE_CUDA_FLAGS_RELWITHDEBINFO \ CMAKE_CUDA_FLAGS_RELWITHDEBINFO_INIT - \ CMAKE_CUDA_GHS_KERNEL_FLAGS_DEBUG - \ CMAKE_CUDA_GHS_KERNEL_FLAGS_MINSIZEREL - \ CMAKE_CUDA_GHS_KERNEL_FLAGS_RELEASE - \ CMAKE_CUDA_GHS_KERNEL_FLAGS_RELWITHDEBINFO \ CMAKE_CUDA_HOST_COMPILER \ CMAKE_CUDA_IGNORE_EXTENSIONS \ CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES @@ -827,10 +816,6 @@ syn keyword cmakeVariable contained \ CMAKE_CXX_FLAGS_RELEASE_INIT \ CMAKE_CXX_FLAGS_RELWITHDEBINFO \ CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT - \ CMAKE_CXX_GHS_KERNEL_FLAGS_DEBUG - \ CMAKE_CXX_GHS_KERNEL_FLAGS_MINSIZEREL - \ CMAKE_CXX_GHS_KERNEL_FLAGS_RELEASE - \ CMAKE_CXX_GHS_KERNEL_FLAGS_RELWITHDEBINFO \ CMAKE_CXX_IGNORE_EXTENSIONS \ CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES \ CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES @@ -893,10 +878,6 @@ syn keyword cmakeVariable contained \ CMAKE_C_FLAGS_RELEASE_INIT \ CMAKE_C_FLAGS_RELWITHDEBINFO \ CMAKE_C_FLAGS_RELWITHDEBINFO_INIT - \ CMAKE_C_GHS_KERNEL_FLAGS_DEBUG - \ CMAKE_C_GHS_KERNEL_FLAGS_MINSIZEREL - \ CMAKE_C_GHS_KERNEL_FLAGS_RELEASE - \ CMAKE_C_GHS_KERNEL_FLAGS_RELWITHDEBINFO \ CMAKE_C_IGNORE_EXTENSIONS \ CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES \ CMAKE_C_IMPLICIT_LINK_DIRECTORIES @@ -940,6 +921,7 @@ syn keyword cmakeVariable contained \ CMAKE_EXE_LINKER_FLAGS_INIT \ CMAKE_EXPORT_COMPILE_COMMANDS \ CMAKE_EXPORT_NO_PACKAGE_REGISTRY + \ CMAKE_EXPORT_PACKAGE_REGISTRY \ CMAKE_EXTRA_GENERATOR \ CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES \ CMAKE_FIND_APPBUNDLE @@ -951,6 +933,7 @@ syn keyword cmakeVariable contained \ CMAKE_FIND_PACKAGE_NAME \ CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY \ CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY + \ CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS \ CMAKE_FIND_PACKAGE_SORT_DIRECTION \ CMAKE_FIND_PACKAGE_SORT_ORDER \ CMAKE_FIND_PACKAGE_WARN_NO_MODULE @@ -999,10 +982,6 @@ syn keyword cmakeVariable contained \ CMAKE_Fortran_FLAGS_RELWITHDEBINFO \ CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT \ CMAKE_Fortran_FORMAT - \ CMAKE_Fortran_GHS_KERNEL_FLAGS_DEBUG - \ CMAKE_Fortran_GHS_KERNEL_FLAGS_MINSIZEREL - \ CMAKE_Fortran_GHS_KERNEL_FLAGS_RELEASE - \ CMAKE_Fortran_GHS_KERNEL_FLAGS_RELWITHDEBINFO \ CMAKE_Fortran_IGNORE_EXTENSIONS \ CMAKE_Fortran_IMPLICIT_INCLUDE_DIRECTORIES \ CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES @@ -1033,6 +1012,7 @@ syn keyword cmakeVariable contained \ CMAKE_GENERATOR_INSTANCE \ CMAKE_GENERATOR_PLATFORM \ CMAKE_GENERATOR_TOOLSET + \ CMAKE_GHS_NO_SOURCE_GROUP_FILE \ CMAKE_GLOBAL_AUTOGEN_TARGET \ CMAKE_GLOBAL_AUTOGEN_TARGET_NAME \ CMAKE_GLOBAL_AUTORCC_TARGET @@ -1106,10 +1086,6 @@ syn keyword cmakeVariable contained \ CMAKE_Java_FLAGS_RELEASE_INIT \ CMAKE_Java_FLAGS_RELWITHDEBINFO \ CMAKE_Java_FLAGS_RELWITHDEBINFO_INIT - \ CMAKE_Java_GHS_KERNEL_FLAGS_DEBUG - \ CMAKE_Java_GHS_KERNEL_FLAGS_MINSIZEREL - \ CMAKE_Java_GHS_KERNEL_FLAGS_RELEASE - \ CMAKE_Java_GHS_KERNEL_FLAGS_RELWITHDEBINFO \ CMAKE_Java_IGNORE_EXTENSIONS \ CMAKE_Java_IMPLICIT_INCLUDE_DIRECTORIES \ CMAKE_Java_IMPLICIT_LINK_DIRECTORIES @@ -1152,6 +1128,7 @@ syn keyword cmakeVariable contained \ CMAKE_MAJOR_VERSION \ CMAKE_MAKE_PROGRAM \ CMAKE_MATCH_COUNT + \ CMAKE_MAXIMUM_RECURSION_DEPTH \ CMAKE_MFC_FLAG \ CMAKE_MINIMUM_REQUIRED_VERSION \ CMAKE_MINOR_VERSION @@ -1177,6 +1154,7 @@ syn keyword cmakeVariable contained \ CMAKE_PROGRAM_PATH \ CMAKE_PROJECT_DESCRIPTION \ CMAKE_PROJECT_HOMEPAGE_URL + \ CMAKE_PROJECT_INCLUDE \ CMAKE_PROJECT_NAME \ CMAKE_PROJECT_VERSION \ CMAKE_PROJECT_VERSION_MAJOR @@ -1221,10 +1199,6 @@ syn keyword cmakeVariable contained \ CMAKE_RC_FLAGS_RELEASE_INIT \ CMAKE_RC_FLAGS_RELWITHDEBINFO \ CMAKE_RC_FLAGS_RELWITHDEBINFO_INIT - \ CMAKE_RC_GHS_KERNEL_FLAGS_DEBUG - \ CMAKE_RC_GHS_KERNEL_FLAGS_MINSIZEREL - \ CMAKE_RC_GHS_KERNEL_FLAGS_RELEASE - \ CMAKE_RC_GHS_KERNEL_FLAGS_RELWITHDEBINFO \ CMAKE_RC_IGNORE_EXTENSIONS \ CMAKE_RC_IMPLICIT_INCLUDE_DIRECTORIES \ CMAKE_RC_IMPLICIT_LINK_DIRECTORIES @@ -1323,10 +1297,6 @@ syn keyword cmakeVariable contained \ CMAKE_Swift_FLAGS_RELEASE_INIT \ CMAKE_Swift_FLAGS_RELWITHDEBINFO \ CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT - \ CMAKE_Swift_GHS_KERNEL_FLAGS_DEBUG - \ CMAKE_Swift_GHS_KERNEL_FLAGS_MINSIZEREL - \ CMAKE_Swift_GHS_KERNEL_FLAGS_RELEASE - \ CMAKE_Swift_GHS_KERNEL_FLAGS_RELWITHDEBINFO \ CMAKE_Swift_IGNORE_EXTENSIONS \ CMAKE_Swift_IMPLICIT_INCLUDE_DIRECTORIES \ CMAKE_Swift_IMPLICIT_LINK_DIRECTORIES @@ -1449,7 +1419,7 @@ syn keyword cmakeVariable contained \ CTEST_CUSTOM_POST_TEST \ CTEST_CUSTOM_PRE_MEMCHECK \ CTEST_CUSTOM_PRE_TEST - \ CTEST_CUSTOM_TEST_IGNORE + \ CTEST_CUSTOM_TESTS_IGNORE \ CTEST_CUSTOM_WARNING_EXCEPTION \ CTEST_CUSTOM_WARNING_MATCH \ CTEST_CVS_CHECKOUT @@ -1483,6 +1453,7 @@ syn keyword cmakeVariable contained \ CTEST_SCP_COMMAND \ CTEST_SITE \ CTEST_SOURCE_DIRECTORY + \ CTEST_SUBMIT_URL \ CTEST_SVN_COMMAND \ CTEST_SVN_OPTIONS \ CTEST_SVN_UPDATE_OPTIONS @@ -1497,6 +1468,7 @@ syn keyword cmakeVariable contained \ ENV \ EXECUTABLE_OUTPUT_PATH \ GHS-MULTI + \ IOS \ LIBRARY_OUTPUT_PATH \ MINGW \ MSVC @@ -1512,6 +1484,7 @@ syn keyword cmakeVariable contained \ MSVC_IDE \ MSVC_TOOLSET_VERSION \ MSVC_VERSION + \ MSYS \ PROJECT_BINARY_DIR \ PROJECT_DESCRIPTION \ PROJECT_HOMEPAGE_URL @@ -1592,6 +1565,7 @@ syn keyword cmakeKWExternalProject contained \ LOG_DOWNLOAD \ LOG_INSTALL \ LOG_MERGED_STDOUTERR + \ LOG_OUTPUT_ON_FAILURE \ LOG_PATCH \ LOG_TEST \ LOG_UPDATE @@ -1645,6 +1619,7 @@ syn keyword cmakeKWadd_compile_options contained \ COMPILE_OPTIONS \ SHELL \ UNIX_COMMAND + \ WX syn keyword cmakeKWadd_custom_command contained \ APPEND @@ -1767,6 +1742,7 @@ syn keyword cmakeKWadd_test contained \ CONFIGURATIONS \ FAIL_REGULAR_EXPRESSION \ NAME + \ OFF \ PASS_REGULAR_EXPRESSION \ TARGET_FILE \ WILL_FAIL @@ -1818,6 +1794,7 @@ syn keyword cmakeKWcmake_parse_arguments contained \ MY_INSTALL_CONFIGURATIONS \ MY_INSTALL_DESTINATION \ MY_INSTALL_FAST + \ MY_INSTALL_KEYWORDS_MISSING_VALUES \ MY_INSTALL_OPTIONAL \ MY_INSTALL_RENAME \ MY_INSTALL_TARGETS @@ -1828,6 +1805,7 @@ syn keyword cmakeKWcmake_parse_arguments contained \ TARGETS \ TRUE \ UNDEFINED + \ _KEYWORDS_MISSING_VALUES \ _UNPARSED_ARGUMENTS syn keyword cmakeKWcmake_policy contained @@ -1926,6 +1904,7 @@ syn keyword cmakeKWctest_start contained syn keyword cmakeKWctest_submit contained \ API + \ BUILD_ID \ CAPTURE_CMAKE_ERROR \ CDASH_UPLOAD \ CDASH_UPLOAD_TYPE @@ -1938,6 +1917,7 @@ syn keyword cmakeKWctest_submit contained \ RETRY_COUNT \ RETRY_DELAY \ RETURN_VALUE + \ SUBMIT_URL syn keyword cmakeKWctest_test contained \ APPEND @@ -1993,6 +1973,9 @@ syn keyword cmakeKWenable_language contained \ CUDA \ OPTIONAL +syn keyword cmakeKWenable_testing contained + \ BUILD_TESTING + syn keyword cmakeKWexec_program contained \ ARGS \ OUTPUT_VARIABLE @@ -2055,6 +2038,8 @@ syn keyword cmakeKWfile contained \ CONFIGURE_DEPENDS \ CONTENT \ COPY + \ COPY_ON_ERROR + \ CREATE_LINK \ DESTINATION \ DIRECTORY_PERMISSIONS \ DOWNLOAD @@ -2108,12 +2093,14 @@ syn keyword cmakeKWfile contained \ REMOVE_RECURSE \ RENAME \ REQUIRED + \ RESULT \ RESULT_VARIABLE \ SHOW_PROGRESS \ SIZE \ SSL \ STATUS \ STRINGS + \ SYMBOLIC \ TIMESTAMP \ TLS_CAINFO \ TLS_VERIFY @@ -2295,8 +2282,10 @@ syn keyword cmakeKWget_filename_component contained \ BASE_DIR \ DIRECTORY \ EXT + \ LAST_EXT \ NAME \ NAME_WE + \ NAME_WLE \ PATH \ PROGRAM \ PROGRAM_ARGS @@ -2432,6 +2421,7 @@ syn keyword cmakeKWinstall contained \ EXPORT \ EXPORT_ANDROID_MK \ EXPORT_LINK_INTERFACE_LIBRARIES + \ EXPORT_NAME \ FILES \ FILES_MATCHING \ FILE_PERMISSIONS @@ -2466,6 +2456,7 @@ syn keyword cmakeKWinstall contained \ PRE_INSTALL_SCRIPT \ PRIVATE_HEADER \ PROGRAMS + \ PROPERTIES \ PUBLIC_HEADER \ REGEX \ RENAME @@ -2479,6 +2470,7 @@ syn keyword cmakeKWinstall contained \ SETUID \ SHAREDSTATE \ SOVERSION + \ STATIC \ SYSCONF \ TARGETS \ TRUE @@ -2533,6 +2525,8 @@ syn keyword cmakeKWlist contained \ ORDER \ OUTPUT_VARIABLE \ PARENT_SCOPE + \ POP_BACK + \ POP_FRONT \ PREPEND \ REGEX \ REMOVE_AT @@ -2613,6 +2607,12 @@ syn keyword cmakeKWproject contained \ _VERSION_PATCH \ _VERSION_TWEAK +syn keyword cmakeKWqt_wrap_cpp contained + \ AUTOMOC + +syn keyword cmakeKWqt_wrap_ui contained + \ AUTOUIC + syn keyword cmakeKWremove contained \ VALUE \ VAR @@ -2635,6 +2635,7 @@ syn keyword cmakeKWset contained \ STRINGS syn keyword cmakeKWset_directory_properties contained + \ DIRECTORY \ PROPERTIES syn keyword cmakeKWset_property contained @@ -2652,6 +2653,7 @@ syn keyword cmakeKWset_property contained syn keyword cmakeKWset_source_files_properties contained \ PROPERTIES + \ SOURCE syn keyword cmakeKWset_target_properties contained \ PROPERTIES @@ -2659,6 +2661,7 @@ syn keyword cmakeKWset_target_properties contained syn keyword cmakeKWset_tests_properties contained \ PROPERTIES + \ TEST syn keyword cmakeKWsource_group contained \ FILES @@ -2845,17 +2848,20 @@ syn keyword cmakeKWtry_compile contained \ DEFINED \ DLINK_LIBRARIES \ DVAR + \ EXECUTABLE \ FALSE + \ GHS \ INCLUDE_DIRECTORIES \ LANG \ LINK_DIRECTORIES \ LINK_LIBRARIES \ LINK_OPTIONS + \ MULTI \ NOT \ OUTPUT_VARIABLE \ PRIVATE - \ RESULT_VAR \ SOURCES + \ STATIC_LIBRARY \ STATIC_LIBRARY_OPTIONS \ TRUE \ TYPE @@ -2869,7 +2875,6 @@ syn keyword cmakeKWtry_run contained \ CMAKE_FLAGS \ COMPILE_DEFINITIONS \ COMPILE_OUTPUT_VARIABLE - \ COMPILE_RESULT_VAR \ DLINK_LIBRARIES \ DVAR \ FAILED_TO_RUN @@ -2879,7 +2884,6 @@ syn keyword cmakeKWtry_run contained \ LINK_LIBRARIES \ LINK_OPTIONS \ RUN_OUTPUT_VARIABLE - \ RUN_RESULT_VAR \ TRUE \ TYPE \ VALUE @@ -2924,7 +2928,8 @@ syn keyword cmakeGeneratorExpressions contained \ COMPILING_CXX \ CONFIG \ CONFIGURATION - \ CUDA + \ CUDA_COMPILER_ID + \ CUDA_COMPILER_VERSION \ CUSTOM_KEYS \ CXX_COMPILER_ID \ CXX_COMPILER_VERSION @@ -2953,7 +2958,6 @@ syn keyword cmakeGeneratorExpressions contained \ LOWER_CASE \ MAKE_C_IDENTIFIER \ MAP_IMPORTED_CONFIG_ - \ MSYS \ NO \ NOT \ OBJECT_LIBRARY @@ -2964,6 +2968,7 @@ syn keyword cmakeGeneratorExpressions contained \ PDB_OUTPUT_DIRECTORY \ PDB_OUTPUT_DIRECTORY_ \ PLATFORM_ID + \ POSIX \ PRIVATE \ PUBLIC \ SDK @@ -3189,6 +3194,7 @@ hi def link cmakeKWctest_update ModeMsg hi def link cmakeKWctest_upload ModeMsg hi def link cmakeKWdefine_property ModeMsg hi def link cmakeKWenable_language ModeMsg +hi def link cmakeKWenable_testing ModeMsg hi def link cmakeKWexec_program ModeMsg hi def link cmakeKWexecute_process ModeMsg hi def link cmakeKWexport ModeMsg @@ -3228,6 +3234,8 @@ hi def link cmakeKWmath ModeMsg hi def link cmakeKWmessage ModeMsg hi def link cmakeKWoption ModeMsg hi def link cmakeKWproject ModeMsg +hi def link cmakeKWqt_wrap_cpp ModeMsg +hi def link cmakeKWqt_wrap_ui ModeMsg hi def link cmakeKWremove ModeMsg hi def link cmakeKWseparate_arguments ModeMsg hi def link cmakeKWset ModeMsg diff --git a/syntax/eelixir.vim b/syntax/eelixir.vim index bd7f861..398becc 100644 --- a/syntax/eelixir.vim +++ b/syntax/eelixir.vim @@ -24,7 +24,10 @@ if !exists("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\+$') + let b:eelixir_subtype = matchstr(&filetype,'^leex\.\zs\w\+') + endif + if b:eelixir_subtype == '' + let b:eelixir_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.eex\|\.leex\|\.eelixir\)\+$','',''),'\.\zs\w\+$') endif if b:eelixir_subtype == 'ex' let b:eelixir_subtype = 'elixir' diff --git a/syntax/elixir.vim b/syntax/elixir.vim index a6e5991..89440f7 100644 --- a/syntax/elixir.vim +++ b/syntax/elixir.vim @@ -109,6 +109,12 @@ syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l\/" syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z("""\)+ end=+^\s*\z1+ skip=+\\"+ fold syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z('''\)+ end=+^\s*\z1+ skip=+\\'+ fold + +" LiveView Sigils surrounded with ~L""" +syntax include @HTML syntax/html.vim +syntax region elixirLiveViewSigil matchgroup=elixirSigilDelimiter keepend start=+\~L\z("""\)+ end=+^\s*\z1+ skip=+\\"+ contains=@HTML fold + + " Documentation if exists('g:elixir_use_markdown_for_docs') && g:elixir_use_markdown_for_docs syn include @markdown syntax/markdown.vim @@ -122,14 +128,14 @@ else endif syn region elixirDocString matchgroup=elixirDocSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]\z(/\|\"\|'\||\)" end="\z1" skip="\\\\\|\\\z1" contains=@elixirDocStringContained fold keepend -syn region elixirDocString matchgroup=elixirDocSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]{" end="}" skip="\\\\\|\\}" contains=@elixirDocStringContained fold keepend -syn region elixirDocString matchgroup=elixirDocSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]<" end=">" skip="\\\\\|\\>" contains=@elixirDocStringContained fold keepend -syn region elixirDocString matchgroup=elixirDocSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]\[" end="\]" skip="\\\\\|\\\]" contains=@elixirDocStringContained fold keepend -syn region elixirDocString matchgroup=elixirDocSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss](" end=")" skip="\\\\\|\\)" contains=@elixirDocStringContained fold keepend -syn region elixirDocString matchgroup=elixirDocStringDelimiter start=+\%(@\w*doc\s\+\)\@<=\z("\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=@elixirDocStringContained keepend -syn region elixirDocString matchgroup=elixirDocStringDelimiter start=+\%(@\w*doc\s\+\)\@<=\z("""\)+ end=+\z1+ contains=@elixirDocStringContained fold keepend -syn region elixirDocString matchgroup=elixirDocSigilDelimiter start=+\%(@\w*doc\s\+\)\@<=\~[Ss]\z('''\)+ end=+\z1+ skip=+\\'+ contains=@elixirDocStringContained fold keepend -syn region elixirDocString matchgroup=elixirDocSigilDelimiter start=+\%(@\w*doc\s\+\)\@<=\~[Ss]\z("""\)+ end=+\z1+ skip=+\\"+ contains=@elixirDocStringContained fold keepend +syn region elixirDocString matchgroup=elixirDocSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]{" end="}" skip="\\\\\|\\}" contains=@elixirDocStringContained fold keepend +syn region elixirDocString matchgroup=elixirDocSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]<" end=">" skip="\\\\\|\\>" contains=@elixirDocStringContained fold keepend +syn region elixirDocString matchgroup=elixirDocSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]\[" end="\]" skip="\\\\\|\\\]" contains=@elixirDocStringContained fold keepend +syn region elixirDocString matchgroup=elixirDocSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss](" end=")" skip="\\\\\|\\)" contains=@elixirDocStringContained fold keepend +syn region elixirDocString matchgroup=elixirDocStringDelimiter start=+\%(@\w*doc\s\+\)\@<=\z("\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=@elixirDocStringContained keepend +syn region elixirDocString matchgroup=elixirDocStringDelimiter start=+\%(@\w*doc\s\+\)\@<=\z("""\)+ end=+^\s*\z1+ contains=@elixirDocStringContained fold keepend +syn region elixirDocString matchgroup=elixirDocSigilDelimiter start=+\%(@\w*doc\s\+\)\@<=\~[Ss]\z('''\)+ end=+^\s*\z1+ contains=@elixirDocStringContained fold keepend +syn region elixirDocString matchgroup=elixirDocSigilDelimiter start=+\%(@\w*doc\s\+\)\@<=\~[Ss]\z("""\)+ end=+^\s*\z1+ contains=@elixirDocStringContained fold keepend " Defines syn match elixirDefine '\\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl diff --git a/syntax/elm.vim b/syntax/elm.vim index 687bee0..3e64306 100644 --- a/syntax/elm.vim +++ b/syntax/elm.vim @@ -46,6 +46,7 @@ syn match elmFloat "\(\<\d\+\.\d\+\>\)" " Identifiers syn match elmTopLevelDecl "^\s*[a-zA-Z][a-zA-z0-9_]*\('\)*\s\+:\(\r\n\|\r\|\n\|\s\)\+" contains=elmOperator +syn match elmFuncName /^\l\w*/ " Folding syn region elmTopLevelTypedef start="type" end="\n\(\n\n\)\@=" contains=ALL fold @@ -54,6 +55,7 @@ syn region elmCaseBlock matchgroup=elmCaseBlockDefinition start="^\z\(\s\+\)\" -syn keyword json5Number Infinity -Infinity - -" Syntax: An integer part of 0 followed by other digits is not allowed. -syn match json5NumError "-\=\<0\d\.\d*\>" - -" Syntax: Boolean {{{1 +" Boolean syn keyword json5Boolean true false -" Syntax: Null {{{1 +" Null syn keyword json5Null null -" Syntax: Braces {{{1 +" Delimiters and Operators +syn match json5Delimiter "," +syn match json5Operator ":" + +" Braces syn match json5Braces "[{}\[\]]" -syn match json5ObjAssign /@\?\%(\I\|\$\)\%(\i\|\$\)*\s*\ze::\@!/ -" Syntax: Comment {{{1 -syn region json5LineComment start=+\/\/+ end=+$+ keepend -syn region json5LineComment start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ keepend fold -syn region json5Comment start="/\*" end="\*/" fold +" Keys +syn match json5Key /@\?\%(\I\|\$\)\%(\i\|\$\)*\s*\ze::\@!/ contains=@Spell +syn match json5Key /"\([^"]\|\\"\)\{-}"\ze\s*:/ contains=json5Escape,@Spell -" Define the default highlighting. {{{1 +" Comment +syn region json5LineComment start=+\/\/+ end=+$+ keepend contains=@Spell +syn region json5LineComment start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ keepend fold contains=@Spell +syn region json5Comment start="/\*" end="\*/" fold contains=@Spell + +" Define the default highlighting hi def link json5String String -hi def link json5ObjAssign Identifier +hi def link json5Key Identifier hi def link json5Escape Special hi def link json5Number Number -hi def link json5Braces Operator -hi def link json5Null Function +hi def link json5Delimiter Delimiter +hi def link json5Operator Operator +hi def link json5Braces Delimiter +hi def link json5Null Keyword hi def link json5Boolean Boolean hi def link json5LineComment Comment hi def link json5Comment Comment @@ -53,4 +69,3 @@ if !exists('b:current_syntax') let b:current_syntax = 'json5' endif -" vim: fdm=marker diff --git a/syntax/julia.vim b/syntax/julia.vim index 3166c4c..8baed24 100644 --- a/syntax/julia.vim +++ b/syntax/julia.vim @@ -66,16 +66,16 @@ let s:nonidS_chars = "[:space:])\\U5D}" . s:nonid_chars " the following excludes '!' since it can be used as an identifier, " and '$' since it can be used in interpolations " note that \U2D is '-' -let s:uniop_chars = "+\\U2D~¬√∛∜" +let s:uniop_chars = "+\\U2D~¬√∛∜⋆" -let s:binop_chars = "=+\\U2D*/\\%÷^&|⊻<>≤≥≡≠≢∈∉⋅×∪∩⊆⊈⊂⊄⊊←→∋∌⊕⊖⊞⊟∘∧⊗⊘↑↓∨⊠±" +let s:binop_chars = "=+\\U2D*/\\%÷^&|⊻<>≤≥≡≠≢∈∉⋅×∪∩⊆⊈⊂⊄⊊←→∋∌⊕⊖⊞⊟∘∧⊗⊘↑↓∨⊠±⟂⋆" " the following is a list of all remainig valid operator chars, " but it's more efficient when expressed with ranges (see below) " let s:binop_chars_extra = "↔↚↛↠↣↦↮⇎⇏⇒⇔⇴⇶⇷⇸⇹⇺⇻⇼⇽⇾⇿⟵⟶⟷⟷⟹⟺⟻⟼⟽⟾⟿⤀⤁⤂⤃⤄⤅⤆⤇⤌⤍⤎⤏⤐⤑⤔⤕⤖⤗⤘⤝⤞⤟⤠⥄⥅⥆⥇⥈⥊⥋⥎⥐⥒⥓⥖⥗⥚⥛⥞⥟⥢⥤⥦⥧⥨⥩⥪⥫⥬⥭⥰⧴⬱⬰⬲⬳⬴⬵⬶⬷⬸⬹⬺⬻⬼⬽⬾⬿⭀⭁⭂⭃⭄⭇⭈⭉⭊⭋⭌←→" . " \ "∝∊∍∥∦∷∺∻∽∾≁≃≄≅≆≇≈≉≊≋≌≍≎≐≑≒≓≔≕≖≗≘≙≚≛≜≝≞≟≣≦≧≨≩≪≫≬≭≮≯≰≱≲≳≴≵≶≷≸≹≺≻≼≽≾≿⊀⊁⊃⊅⊇⊉⊋⊏⊐⊑⊒⊜⊩⊬⊮⊰⊱⊲⊳⊴⊵⊶⊷⋍⋐⋑⋕⋖⋗⋘⋙⋚⋛⋜⋝⋞⋟⋠⋡⋢⋣⋤⋥⋦⋧⋨⋩⋪⋫⋬⋭⋲⋳⋴⋵⋶⋷⋸⋹⋺⋻⋼⋽⋾⋿⟈⟉⟒⦷⧀⧁⧡⧣⧤⧥⩦⩧⩪⩫⩬⩭⩮⩯⩰⩱⩲⩳⩴⩵⩶⩷⩸⩹⩺⩻⩼⩽⩾⩿⪀⪁⪂⪃⪄⪅⪆⪇⪈⪉⪊⪋⪌⪍⪎⪏⪐⪑⪒⪓⪔⪕⪖⪗⪘⪙⪚⪛⪜⪝⪞⪟⪠⪡⪢⪣⪤⪥⪦⪧⪨⪩⪪⪫⪬⪭⪮⪯⪰⪱⪲⪳⪴⪵⪶⪷⪸⪹⪺⪻⪼⪽⪾⪿⫀⫁⫂⫃⫄⫅⫆⫇⫈⫉⫊⫋⫌⫍⫎⫏⫐⫑⫒⫓⫔⫕⫖⫗⫘⫙⫷⫸⫹⫺⊢⊣" . " \ "⊔∓∔∸≂≏⊎⊽⋎⋓⧺⧻⨈⨢⨣⨤⨥⨦⨧⨨⨩⨪⨫⨬⨭⨮⨹⨺⩁⩂⩅⩊⩌⩏⩐⩒⩔⩖⩗⩛⩝⩡⩢⩣" . -" \ "⊙⊚⊛⊡⊓∗∙∤⅋≀⊼⋄⋆⋇⋉⋊⋋⋌⋏⋒⟑⦸⦼⦾⦿⧶⧷⨇⨰⨱⨲⨳⨴⨵⨶⨷⨸⨻⨼⨽⩀⩃⩄⩋⩍⩎⩑⩓⩕⩘⩚⩜⩞⩟⩠⫛⊍▷⨝⟕⟖⟗" . +" \ "⊙⊚⊛⊡⊓∗∙∤⅋≀⊼⋄⋇⋉⋊⋋⋌⋏⋒⟑⦸⦼⦾⦿⧶⧷⨇⨰⨱⨲⨳⨴⨵⨶⨷⨸⨻⨼⨽⩀⩃⩄⩋⩍⩎⩑⩓⩕⩘⩚⩜⩞⩟⩠⫛⊍▷⨝⟕⟖⟗" . " \ "⇵⟰⟱⤈⤉⤊⤋⤒⤓⥉⥌⥍⥏⥑⥔⥕⥘⥙⥜⥝⥠⥡⥣⥥⥮⥯↑↓" " same as above, but with character ranges, for performance diff --git a/syntax/markdown.vim b/syntax/markdown.vim index b1758cd..e7d27b0 100644 --- a/syntax/markdown.vim +++ b/syntax/markdown.vim @@ -103,7 +103,7 @@ syn match htmlH2 /^.\+\n-\+$/ contains=mkdLink,mkdInlineURL,@Spell syn match mkdLineBreak / \+$/ syn region mkdBlockquote start=/^\s*>/ end=/$/ contains=mkdLink,mkdInlineURL,mkdLineBreak,@Spell execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@) " Not-Top Cluster {{{1 -syn cluster rubyNotTop contains=@rubyCommentNotTop,@rubyStringNotTop,@rubyRegexpSpecial,@rubyDeclaration,@rubyExceptionHandler,rubyConditional,rubyModuleName,rubyClassName,rubySymbolDelimiter +syn cluster rubyNotTop contains=@rubyCommentNotTop,@rubyStringNotTop,@rubyRegexpSpecial,@rubyDeclaration,@rubyExceptionHandler,@rubyClassOperator,rubyConditional,rubyModuleName,rubyClassName,rubySymbolDelimiter,rubyParentheses " Whitespace Errors {{{1 if exists("ruby_space_errors") @@ -82,20 +82,39 @@ if exists("ruby_space_errors") endif " Operators {{{1 -if exists("ruby_operators") - syn match rubyDotOperator "\.\|&\." - syn match rubyTernaryOperator "\%(\w\|[^\x00-\x7F]\)\@1\@!" - syn match rubyComparisonOperator "<=>\|<=\|\%(<\|\=\|[-=]\@1" - syn match rubyBitwiseOperator "[~^|]\|&\.\@!\|\%(class\s*\)\@>" - syn match rubyBooleanOperator "\%(\w\|[^\x00-\x7F]\)\@1\@!\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|||=\||=\|%=\|+=\|>>=\|<<=\|\^=" - syn match rubyEqualityOperator "===\|==\|!=\|!\~\|=\~" - syn match rubyScopeOperator "::" - syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\%(\w\|[^\x00-\x7F]\)[?!]\=\|[]})]\)\@2<=\[" end="]" contains=ALLBUT,@rubyNotTop - syn cluster rubyOperator contains=ruby.*Operator +syn match rubyEnglishBooleanOperator "\<\%(and\|or\|not\)\>" + +if exists("ruby_operators") || exists("ruby_pseudo_operators") + syn match rubyDotOperator "\.\|&\." + + syn match rubyTernaryOperator "\%(\w\|[^\x00-\x7F]\)\@1\@!" + syn match rubyComparisonOperator "<=>\|<=\|<\|>=\|[-=]\@1" + syn match rubyBitwiseOperator "[~^|]\|&\.\@!\|<<\|>>" + syn match rubyBooleanOperator "\%(\w\|[^\x00-\x7F]\)\@1\@!\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|||=\||=\|%=\|+=\|>>=\|<<=\|\^=" + syn match rubyAssignmentOperator "=>\@!" containedin=rubyBlockParameterList " TODO: this is inelegant + syn match rubyEqualityOperator "===\|==\|!=\|!\~\|=\~" + + syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\%(\w\|[^\x00-\x7F]\)[?!]\=\|[]})]\)\@2<=\[" end="]" contains=ALLBUT,@rubyNotTop + + syn match rubyScopeOperator "::" + syn match rubySuperClassOperator "<" contained + syn match rubyEigenClassOperator "<<" contained + syn match rubyLambdaOperator "->" + syn match rubySplatOperator "\%([[{(|,=]\_s*\)\@<=\*" + syn match rubySplatOperator "\%(^\|\s\)\@1<=\*\%(\h\|[^\x00-\x7F]\|[:$@[]\)\@=" + syn match rubyDoubleSplatOperator "\%([{(|,]\_s*\)\@<=\*\*" + syn match rubyDoubleSplatOperator "\s\@1<=\*\*\%(\h\|[^\x00-\x7F]\|[:$@{]\)\@=" + syn match rubyProcOperator "\%([[(|,]\_s*\)\@<=&" + syn match rubyProcOperator "\s\@1<=&\%(\h\|[^\x00-\x7F]\|[:$@]\|->\)\@=" + + syn cluster rubyProperOperator contains=rubyTernaryOperator,rubyArithmeticOperator,rubyComparisonOperator,rubyBitwiseOperator,rubyBooleanOperator,rubyRangeOperator,rubyAssignmentOperator,rubyEqualityOperator,rubyDefinedOperator,rubyEnglishBooleanOperator + syn cluster rubyClassOperator contains=rubyEigenClassOperator,rubySuperClassOperator + syn cluster rubyPseudoOperator contains=rubyDotOperator,rubyScopeOperator,rubyEigenClassOperator,rubySuperClassOperator,rubyLambdaOperator,rubySplatOperator,rubyDoubleSplatOperator,rubyProcOperator + syn cluster rubyOperator contains=ruby.*Operator endif " String Interpolation and Backslash Notation {{{1 @@ -113,8 +132,8 @@ syn match rubyBackslashEscape "\\\\" contained display syn match rubyQuoteEscape "\\'" contained display syn match rubySpaceEscape "\\ " contained display -syn match rubyParenthesisEscape "\\[()]" contained display -syn match rubyCurlyBraceEscape "\\[{}]" contained display +syn match rubyParenthesisEscape "\\[()]" contained display +syn match rubyCurlyBraceEscape "\\[{}]" contained display syn match rubyAngleBracketEscape "\\[<>]" contained display syn match rubySquareBracketEscape "\\[[\]]" contained display @@ -160,9 +179,6 @@ syn match rubyFloat "\%(\%(\w\|[^\x00-\x7F]\|[]})\"']\s*\)\@" display " Identifiers {{{1 -syn match rubyLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!]\=" contains=NONE display transparent -syn match rubyBlockArgument "&[_[:lower:]][_[:alnum:]]" contains=NONE display transparent - syn match rubyClassName "\%(\%(^\|[^.]\)\.\s*\)\@\%(\s*(\)\@!" contained syn match rubyModuleName "\%(\%(^\|[^.]\)\.\s*\)\@\%(\s*(\)\@!" contained syn match rubyConstant "\%(\%(^\|[^.]\)\.\s*\)\@\%(\s*(\)\@!" @@ -180,8 +196,8 @@ SynFold ':' syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"': syn match rubyCapitalizedMethod "\%(\%(^\|[^.]\)\.\s*\)\@\%(\s*(\)\@=" -syn match rubyBlockParameter "\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" contained -syn region rubyBlockParameterList start="\%(\%(\\|{\)\_s*\)\@32<=|" end="|" oneline display contains=rubyBlockParameter +syn region rubyParentheses start="(" end=")" contains=ALLBUT,@rubyNotTop containedin=rubyBlockParameterList +syn region rubyBlockParameterList start="\%(\%(\\|{\)\_s*\)\@32<=|" end="|" contains=ALLBUT,@rubyNotTop,@rubyProperOperator if exists('ruby_global_variable_error') syn match rubyGlobalVariableError "$[^A-Za-z_]" display @@ -283,9 +299,9 @@ SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="% SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%i(" end=")" skip="\\\\\|\\)" contains=rubyBackslashEscape,rubySpaceEscape,rubyParenthesisEscape,rubyNestedParentheses " Generalized Double Quoted Strings, Array of Strings, Array of Symbols and Shell Command Output {{{1 -" Note: %= is not matched here as the beginning of a double quoted string +SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="\%(\%(\w\|[^\x00-\x7F]\|]\)\s*\)\@" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets @@ -300,6 +316,7 @@ SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="% " Here Documents {{{1 syn region rubyHeredocStart matchgroup=rubyHeredocDelimiter start=+\%(\%(class\|::\|\.\@1>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration -syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration,rubyModuleDeclaration,rubyClassDeclaration,rubyMethodName,rubyBlockParameter +syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration,rubyModuleDeclaration,rubyClassDeclaration,rubyMethodName " Keywords {{{1 -" Note: the following keywords have already been defined: -" begin case class def do end for if module unless until while -syn match rubyControl "\<\%(and\|break\|in\|next\|not\|or\|redo\|retry\|return\)\>" -syn match rubyKeyword "\<\%(super\|yield\)\>" -syn match rubyBoolean "\<\%(true\|false\)\>[?!]\@!" -syn match rubyPseudoVariable "\<\(self\|nil\)\>[?!]\@!" -syn match rubyPseudoVariable "\<__\%(ENCODING\|dir\|FILE\|LINE\|callee\|method\)__\>" -syn match rubyBeginEnd "\<\%(BEGIN\|END\)\>" +" TODO: reorganise +syn match rubyControl "\%#=1\<\%(break\|in\|next\|redo\|retry\|return\)\>" +syn match rubyKeyword "\%#=1\<\%(super\|yield\)\>" +syn match rubyBoolean "\%#=1\<\%(true\|false\)\>[?!]\@!" +syn match rubyPseudoVariable "\%#=1\<\(self\|nil\)\>[?!]\@!" +syn match rubyPseudoVariable "\%#=1\<__\%(ENCODING\|dir\|FILE\|LINE\|callee\|method\)__\>" +syn match rubyBeginEnd "\%#=1\<\%(BEGIN\|END\)\>" " Expensive Mode {{{1 " Match 'end' with the appropriate opening keyword for syntax based folding " and special highlighting of module/class/method definitions if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive") - syn match rubyDefine "\" nextgroup=rubyAliasDeclaration skipwhite skipnl - syn match rubyDefine "\" nextgroup=rubyMethodDeclaration skipwhite skipnl - syn match rubyDefine "\" nextgroup=rubyMethodName skipwhite skipnl - syn match rubyClass "\" nextgroup=rubyClassDeclaration skipwhite skipnl - syn match rubyModule "\" nextgroup=rubyModuleDeclaration skipwhite skipnl + syn match rubyDefine "\" nextgroup=rubyAliasDeclaration skipwhite skipnl + syn match rubyDefine "\" nextgroup=rubyMethodDeclaration skipwhite skipnl + syn match rubyDefine "\" nextgroup=rubyMethodName skipwhite skipnl + syn match rubyClass "\" nextgroup=rubyClassDeclaration,rubyEigenClassOperator skipwhite skipnl + syn match rubyModule "\" nextgroup=rubyModuleDeclaration skipwhite skipnl - SynFold 'def' syn region rubyMethodBlock start="\" matchgroup=rubyDefine end="\%(\" contains=ALLBUT,@rubyNotTop - SynFold 'class' syn region rubyClassBlock start="\" matchgroup=rubyClass end="\" contains=ALLBUT,@rubyNotTop - SynFold 'module' syn region rubyModuleBlock start="\" matchgroup=rubyModule end="\" contains=ALLBUT,@rubyNotTop + SynFold 'def' syn region rubyMethodBlock start="\" matchgroup=rubyDefine skip="\" end="\" contains=ALLBUT,@rubyNotTop + SynFold 'class' syn region rubyClassBlock start="\" matchgroup=rubyClass skip="\" contained containedin=rubyCaseExpression syn match rubyConditional "\<\%(then\|else\|elsif\)\>" contained containedin=rubyConditionalExpression syn match rubyExceptionHandler "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>" contained containedin=rubyBlockExpression,rubyDoBlock - syn match rubyExceptionHandler1 "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>" contained containedin=rubyModuleBlock,rubyClassBlock,rubyMethodBlock - syn cluster rubyExceptionHandler contains=rubyExceptionHandler,rubyExceptionHandler1 + syn match rubyExceptionHandler2 "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>" contained containedin=rubyModuleBlock,rubyClassBlock,rubyMethodBlock + syn cluster rubyExceptionHandler contains=rubyExceptionHandler,rubyExceptionHandler2 " statements with optional 'do' syn region rubyOptionalDoLine matchgroup=rubyRepeat start="\" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\@" matchgroup=rubyOptionalDo end="\" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@rubyNotTop - SynFold 'for' syn region rubyRepeatExpression start="\" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\@" matchgroup=rubyRepeat end="\" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine + SynFold 'for' syn region rubyRepeatExpression start="\" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\@" matchgroup=rubyRepeat skip="\" - syn match rubyAccess "\<\%(public_class_method\|private_class_method\)\>" - syn match rubyAccess "\<\%(public_constant\|private_constant\)\>" - syn match rubyAccess "\" - syn match rubyAttribute "\%(\%(^\|;\)\s*\)\@<=attr\>\(\s*[.=]\)\@!" " attr is a common variable name - syn match rubyAttribute "\<\%(attr_accessor\|attr_reader\|attr_writer\)\>" - syn match rubyControl "\<\%(abort\|at_exit\|exit\|fork\|loop\|trap\)\>" - syn match rubyEval "\<\%(eval\|class_eval\|instance_eval\|module_eval\)\>" - syn match rubyException "\<\%(raise\|fail\|catch\|throw\)\>" - syn match rubyInclude "\<\%(autoload\|gem\|load\|require\|require_relative\)\>" - syn match rubyKeyword "\<\%(callcc\|caller\|lambda\|proc\)\>" - syn match rubyMacro "\<\%(extend\|include\|prepend\|refine\|using\)\>" - syn match rubyMacro "\<\%(alias_method\|define_method\|define_singleton_method\|remove_method\|undef_method\)\>" + syn match rubyAccess "\<\%(public\|protected\|private\)\>" " use re=2 + syn match rubyAccess "\%#=1\<\%(public\|private\)_class_method\>" + syn match rubyAccess "\%#=1\<\%(public\|private\)_constant\>" + syn match rubyAccess "\%#=1\" + syn match rubyAttribute "\%#=1\%(\%(^\|;\)\s*\)\@<=attr\>\(\s*[.=]\)\@!" " attr is a common variable name + syn match rubyAttribute "\%#=1\" + syn match rubyControl "\%#=1\<\%(abort\|at_exit\|exit\|fork\|loop\|trap\)\>" + syn match rubyEval "\%#=1\" + syn match rubyEval "\%#=1\<\%(class\|instance\|module\)_eval\>" + syn match rubyException "\%#=1\<\%(raise\|fail\|catch\|throw\)\>" + syn match rubyInclude "\%#=1\<\%(autoload\|gem\|load\|require\%(_relative\)\=\)\>" + syn match rubyKeyword "\%#=1\<\%(callcc\|caller\|lambda\|proc\)\>" + syn match rubyMacro "\%#=1\<\%(extend\|include\|prepend\|refine\|using\)\>" + syn match rubyMacro "\%#=1\<\%(alias\|define\|define_singleton\|remove\|undef\)_method\>" endif " Comments and Documentation {{{1 @@ -436,21 +453,20 @@ syn match rubyUselessLineContinuation "\%([.:,;{([<>~\*%&^|+=-]\|%(\%(\w\|[^\x00 syn match rubyUselessLineContinuation "\\$" nextgroup=rubyUselessLineContinuation skipwhite skipempty contained " Keyword Nobbling {{{1 -" prevent methods with keyword names (and possible ?! suffixes) being highlighted as keywords when called +" prevent methods with keyword names being highlighted as keywords when called syn match rubyKeywordAsMethod "\%(\%(\.\@1\)" transparent contains=rubyDotOperator,rubyScopeOperator -syn match rubyKeywordAsMethod "\<[_[:lower:]][_[:alnum:]]*[?!]" transparent contains=NONE -" Bang/Predicate Special Methods and Operators {{{1 +" Bang and Predicate Methods and Operators {{{1 +syn match rubyBangPredicateMethod "\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[?!]" + if !exists("ruby_no_special_methods") - syn match rubyControl "\