diff options
Diffstat (limited to '.config/nvim/syntax')
| -rw-r--r-- | .config/nvim/syntax/meson.vim | 162 | ||||
| -rw-r--r-- | .config/nvim/syntax/msmtp.vim | 67 |
2 files changed, 229 insertions, 0 deletions
diff --git a/.config/nvim/syntax/meson.vim b/.config/nvim/syntax/meson.vim new file mode 100644 index 0000000..85acf43 --- /dev/null +++ b/.config/nvim/syntax/meson.vim @@ -0,0 +1,162 @@ +" Vim syntax file +" Language: Meson +" Maintainer: Nirbheek Chauhan <nirbheek.chauhan@gmail.com> +" Last Change: 2016 Dec 7 +" Credits: Zvezdan Petkovic <zpetkovic@acm.org> +" Neil Schemenauer <nas@meson.ca> +" Dmitry Vasiliev +" +" This version is copied and edited from python.vim +" It's very basic, and doesn't do many things I'd like it to +" For instance, it should show errors for syntax that is valid in +" Python but not in Meson. +" +" Optional highlighting can be controlled using these variables. +" +" let meson_space_error_highlight = 1 +" + +" For version 5.x: Clear all syntax items. +" For version 6.x: Quit when a syntax file was already loaded. +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +" We need nocompatible mode in order to continue lines with backslashes. +" Original setting will be restored. +let s:cpo_save = &cpo +setlocal cpo&vim + +" http://mesonbuild.com/Syntax.html +syn keyword mesonConditional elif else if endif +syn keyword mesonRepeat foreach endforeach +syn keyword mesonOperator and not or + +syn match mesonComment "#.*$" contains=mesonTodo,@Spell +syn keyword mesonTodo FIXME NOTE NOTES TODO XXX contained + +" Strings can either be single quoted or triple counted across multiple lines, +" but always with a ' +syn region mesonString + \ start="\z('\)" end="\z1" skip="\\\\\|\\\z1" + \ contains=mesonEscape,@Spell +syn region mesonString + \ start="\z('''\)" end="\z1" keepend + \ contains=mesonEscape,mesonSpaceError,@Spell + +syn match mesonEscape "\\[abfnrtv'\\]" contained +syn match mesonEscape "\\\o\{1,3}" contained +syn match mesonEscape "\\x\x\{2}" contained +syn match mesonEscape "\%(\\u\x\{4}\|\\U\x\{8}\)" contained +" Meson allows case-insensitive Unicode IDs: http://www.unicode.org/charts/ +syn match mesonEscape "\\N{\a\+\%(\s\a\+\)*}" contained +syn match mesonEscape "\\$" + +" Meson only supports integer numbers +" http://mesonbuild.com/Syntax.html#numbers +syn match mesonNumber "\<\d\+\>" + +" booleans +syn keyword mesonConstant false true + +" Built-in functions +syn keyword mesonBuiltin + \ add_global_arguments + \ add_global_link_arguments + \ add_languages + \ add_project_arguments + \ add_project_link_arguments + \ add_test_setup + \ assert + \ benchmark + \ both_libraries + \ build_machine + \ build_target + \ configuration_data + \ configure_file + \ custom_target + \ declare_dependency + \ dependency + \ disabler + \ environment + \ error + \ executable + \ files + \ find_library + \ find_program + \ generator + \ get_option + \ get_variable + \ gettext + \ host_machine + \ import + \ include_directories + \ install_data + \ install_headers + \ install_man + \ install_subdir + \ is_variable + \ jar + \ join_paths + \ library + \ meson + \ message + \ option + \ project + \ run_command + \ run_target + \ set_variable + \ shared_library + \ shared_module + \ static_library + \ subdir + \ subdir_done + \ subproject + \ target_machine + \ test + \ vcs_tag + \ warning + +if exists("meson_space_error_highlight") + " trailing whitespace + syn match mesonSpaceError display excludenl "\s\+$" + " mixed tabs and spaces + syn match mesonSpaceError display " \+\t" + syn match mesonSpaceError display "\t\+ " +endif + +if version >= 508 || !exists("did_meson_syn_inits") + if version <= 508 + let did_meson_syn_inits = 1 + command -nargs=+ HiLink hi link <args> + else + command -nargs=+ HiLink hi def link <args> + endif + + " The default highlight links. Can be overridden later. + HiLink mesonStatement Statement + HiLink mesonConditional Conditional + HiLink mesonRepeat Repeat + HiLink mesonOperator Operator + HiLink mesonComment Comment + HiLink mesonTodo Todo + HiLink mesonString String + HiLink mesonEscape Special + HiLink mesonNumber Number + HiLink mesonBuiltin Function + HiLink mesonConstant Number + if exists("meson_space_error_highlight") + HiLink mesonSpaceError Error + endif + + delcommand HiLink +endif + +let b:current_syntax = "meson" + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim:set sw=2 sts=2 ts=8 noet: diff --git a/.config/nvim/syntax/msmtp.vim b/.config/nvim/syntax/msmtp.vim new file mode 100644 index 0000000..673c6af --- /dev/null +++ b/.config/nvim/syntax/msmtp.vim @@ -0,0 +1,67 @@ +" Vim syntax file +" Language: msmtp rc files +" Maintainer: Simon Ruderich <simon@ruderich.com> +" Eric Pruitt <eric.pruitt@gmail.com> +" Last Change: 2011-08-21 +" Filenames: msmtprc +" Version: 0.2 + + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + + +" Comments. +syn match msmtpComment /#.*$/ contains=@Spell + +" General commands. +syntax match msmtpOption /\<\(defaults\|account\|host\|port\|timeout\|protocol\|domain\)\>/ +" Authentication commands. +syntax match msmtpOption /\<\(auth\|user\|password\|passwordeval\|ntlmdomain\)\>/ +" TLS commands. +syntax match msmtpOption /\<\(tls\|tls_trust_file\|tls_crl_file\|tls_fingerprint\|tls_key_file\|tls_cert_file\|tls_certcheck\|tls_starttls\|tls_force_sslv3\|tls_min_dh_prime_bits\|tls_priorities\)\>/ +" Sendmail mode specific commands. +syntax match msmtpOption /\<\(auto_from\|from\|maildomain\|dsn_notify\|dsn_return\|keepbcc\|logfile\|syslog\)\>/ + +" Options which accept only an on/off value. +syn match msmtpWrongOption /\<\(tls\|tls_certcheck\|tls_starttls\|tls_force_sslv3\|auto_from\|keepbcc\) \(on$\|off$\)\@!.*$/ +" Option port accepts numeric values. +syn match msmtpWrongOption /\<port \(\d\+$\)\@!.*$/ +" Option timeout accepts off and numeric values. +syn match msmtpWrongOption /\<timeout \(off$\|\d\+$\)\@!.*$/ +" Option protocol accepts smtp and lmtp. +syn match msmtpWrongOption /\<protocol \(smtp$\|lmtp$\)\@!.*$/ +" Option auth accepts on, off and the method. +syn match msmtpWrongOption /\<auth \(on$\|off$\|plain$\|cram-md5$\|digest-md5$\|scram-sha-1$\|gssapi$\|external$\|login$\|ntlm$\)\@!.*$/ +" Option auth accepts on, off and the facility. +syn match msmtpWrongOption /\<syslog \(on$\|off$\|LOG_USER$\|LOG_MAIL$\|LOG_LOCAL\d$\)\@!.*$/ + +" Marks all wrong option values as errors. +syn match msmtpWrongOptionValue /\S* \zs.*$/ contained containedin=msmtpWrongOption + +" Mark the option part as a normal option. +highlight default link msmtpWrongOption msmtpOption + +"Email addresses (yanked from esmptrc) +syntax match msmtpAddress /[a-z0-9_.-]*[a-z0-9]\+@[a-z0-9_.-]*[a-z0-9]\+\.[a-z]\+/ +" Host names +syn match msmtpHost "\%(host\s*\)\@<=\h\%(\w\|\.\|-\)*" +" Numeric values +syn match msmtpNumber /\<\(\d\+$\)/ +"Strings +syntax region msmtpString start=/"/ end=/"/ +syntax region msmtpString start=/'/ end=/'/ + +highlight default link msmtpComment Comment +highlight default link msmtpOption Type +highlight default link msmtpWrongOptionValue Error +highlight default link msmtpString String +highlight default link msmtpAddress Constant +highlight default link msmtpNumber Number +highlight default link msmtpHost Identifier + + +let b:current_syntax = "msmtp" |
