aboutsummaryrefslogtreecommitdiff
path: root/runtime/syntax
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/syntax')
-rw-r--r--runtime/syntax/gitconfig.vim12
-rw-r--r--runtime/syntax/xml.vim43
2 files changed, 32 insertions, 23 deletions
diff --git a/runtime/syntax/gitconfig.vim b/runtime/syntax/gitconfig.vim
index c6c56f77b6..e5eaf10f94 100644
--- a/runtime/syntax/gitconfig.vim
+++ b/runtime/syntax/gitconfig.vim
@@ -2,24 +2,22 @@
" Language: git config file
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Filenames: gitconfig, .gitconfig, *.git/config
-" Last Change: 2010 May 21
+" Last Change: 2019 Dec 05
if exists("b:current_syntax")
finish
endif
-setlocal iskeyword+=-
-setlocal iskeyword-=_
syn case ignore
syn sync minlines=10
-syn match gitconfigComment "[#;].*"
+syn match gitconfigComment "[#;].*" contains=@Spell
syn match gitconfigSection "\%(^\s*\)\@<=\[[a-z0-9.-]\+\]"
syn match gitconfigSection '\%(^\s*\)\@<=\[[a-z0-9.-]\+ \+\"\%([^\\"]\|\\.\)*"\]'
-syn match gitconfigVariable "\%(^\s*\)\@<=\a\k*\%(\s*\%([=#;]\|$\)\)\@=" nextgroup=gitconfigAssignment skipwhite
+syn match gitconfigVariable "\%(^\s*\)\@<=\a[a-z0-9-]*\%(\s*\%([=#;]\|$\)\)\@=" nextgroup=gitconfigAssignment skipwhite
syn region gitconfigAssignment matchgroup=gitconfigNone start=+=\s*+ skip=+\\+ end=+\s*$+ contained contains=gitconfigBoolean,gitconfigNumber,gitConfigString,gitConfigEscape,gitConfigError,gitconfigComment keepend
syn keyword gitconfigBoolean true false yes no contained
-syn match gitconfigNumber "\d\+" contained
+syn match gitconfigNumber "\<\d\+\>" contained
syn region gitconfigString matchgroup=gitconfigDelim start=+"+ skip=+\\+ end=+"+ matchgroup=gitconfigError end=+[^\\"]\%#\@!$+ contained contains=gitconfigEscape,gitconfigEscapeError
syn match gitconfigError +\\.+ contained
syn match gitconfigEscape +\\[\\"ntb]+ contained
@@ -32,7 +30,7 @@ hi def link gitconfigBoolean Boolean
hi def link gitconfigNumber Number
hi def link gitconfigString String
hi def link gitconfigDelim Delimiter
-hi def link gitconfigEscape Delimiter
+hi def link gitconfigEscape Special
hi def link gitconfigError Error
let b:current_syntax = "gitconfig"
diff --git a/runtime/syntax/xml.vim b/runtime/syntax/xml.vim
index 7b503abf49..7c9791a7cc 100644
--- a/runtime/syntax/xml.vim
+++ b/runtime/syntax/xml.vim
@@ -1,11 +1,15 @@
" Vim syntax file
-" Language: XML
-" Maintainer: Johannes Zellner <johannes@zellner.org>
-" Author and previous maintainer:
-" Paul Siegmann <pauls@euronet.nl>
-" Last Change: 2013 Jun 07
+" Language: XML
+" Maintainer: Christian Brabandt <cb@256bit.org>
+" Repository: https://github.com/chrisbra/vim-xml-ftplugin
+" Previous Maintainer: Johannes Zellner <johannes@zellner.org>
+" Author: Paul Siegmann <pauls@euronet.nl>
+" Last Changed: Nov 03, 2019
" Filenames: *.xml
-" $Id: xml.vim,v 1.3 2006/04/11 21:32:00 vimboss Exp $
+" Last Change:
+" 20190923 - Fix xmlEndTag to match xmlTag (vim/vim#884)
+" 20190924 - Fix xmlAttribute property (amadeus/vim-xml@d8ce1c946)
+" 20191103 - Enable spell checking globally
" CONFIGURATION:
" syntax folding can be turned on by
@@ -49,6 +53,12 @@ set cpo&vim
syn case match
+" Allow spell checking in tag values,
+" there is no syntax region for that,
+" so enable spell checking in top-level elements
+" <tag>This text is spell checked</tag>
+syn spell toplevel
+
" mark illegal characters
syn match xmlError "[<&]"
@@ -81,7 +91,7 @@ syn match xmlEqual +=+ display
" ^^^^^^^^^^^^^
"
syn match xmlAttrib
- \ +[-'"<]\@1<!\<[a-zA-Z:_][-.0-9a-zA-Z:_]*\>\%(['">]\@!\|$\)+
+ \ +[-'"<]\@1<!\<[a-zA-Z:_][-.0-9a-zA-Z:_]*\>\%(['"]\@!\|$\)+
\ contained
\ contains=xmlAttribPunct,@xmlAttribHook
\ display
@@ -122,7 +132,7 @@ endif
" ^^^
"
syn match xmlTagName
- \ +<\@1<=[^ /!?<>"']\++
+ \ +\%(<\|</\)\@2<=[^ /!?<>"']\++
\ contained
\ contains=xmlNamespace,xmlAttribPunct,@xmlTagHook
\ display
@@ -157,11 +167,11 @@ if exists('g:xml_syntax_folding')
" </tag>
" ^^^^^^
"
- syn match xmlEndTag
- \ +</[^ /!?<>"']\+>+
+ syn region xmlEndTag
+ \ matchgroup=xmlTag start=+</[^ /!?<>"']\@=+
+ \ matchgroup=xmlTag end=+>+
\ contained
- \ contains=xmlNamespace,xmlAttribPunct,@xmlTagHook
-
+ \ contains=xmlTagName,xmlNamespace,xmlAttribPunct,@xmlTagHook
" tag elements with syntax-folding.
" NOTE: NO HIGHLIGHTING -- highlighting is done by contained elements
@@ -181,7 +191,7 @@ if exists('g:xml_syntax_folding')
\ start=+<\z([^ /!?<>"']\+\)+
\ skip=+<!--\_.\{-}-->+
\ end=+</\z1\_\s\{-}>+
- \ matchgroup=xmlEndTag end=+/>+
+ \ end=+/>+
\ fold
\ contains=xmlTag,xmlEndTag,xmlCdata,xmlRegion,xmlComment,xmlEntity,xmlProcessing,@xmlRegionHook,@Spell
\ keepend
@@ -198,9 +208,10 @@ else
\ matchgroup=xmlTag end=+>+
\ contains=xmlError,xmlTagName,xmlAttrib,xmlEqual,xmlString,@xmlStartTagHook
- syn match xmlEndTag
- \ +</[^ /!?<>"']\+>+
- \ contains=xmlNamespace,xmlAttribPunct,@xmlTagHook
+ syn region xmlEndTag
+ \ matchgroup=xmlTag start=+</[^ /!?<>"']\@=+
+ \ matchgroup=xmlTag end=+>+
+ \ contains=xmlTagName,xmlNamespace,xmlAttribPunct,@xmlTagHook
endif