commit 209d80bd9069b906ed8d88875c109f0511827dd9
parent 2a30b58e34e465500c4660afd498bc90841d2862
Author: hhvn <dev@hhvn.uk>
Date: Tue, 9 Nov 2021 16:46:40 +0000
.c/n/a/s/{c,sh}.vim: hilight trailing spaces
Diffstat:
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/.config/nvim/after/syntax/c.vim b/.config/nvim/after/syntax/c.vim
@@ -0,0 +1,3 @@
+syn match TrailSpace "[[:space:]]*$"
+
+hi link TrailSpace Error
diff --git a/.config/nvim/after/syntax/sh.vim b/.config/nvim/after/syntax/sh.vim
@@ -1,8 +1,10 @@
if exists("b:current_syntax")
unlet b:current_syntax
endif
+syn match TrailSpace "[[:space:]]*$"
syn include @AWKScript syntax/awk.vim
syn region AWKScriptCode matchgroup=AWKCommand start=+[=\\]\@<!'+ skip=+\\'+ end=+'+ contains=@AWKScript contained
syn region AWKScriptEmbedded matchgroup=AWKCommand start=+\<awk\>+ skip=+\\$+ end=+[=\\]\@<!'+me=e-1 contains=@shIdList,@shExprList2 nextgroup=AWKScriptCode
syn cluster shCommandSubList add=AWKScriptEmbedded
hi def link AWKCommand statement
+hi link TrailSpace error