From: Jason Woofenden Date: Wed, 26 Sep 2012 14:16:36 +0000 (-0400) Subject: add csv.vim for coloring columns X-Git-Url: https://jasonwoof.com/gitweb/?p=vim-syntax.git;a=commitdiff_plain;h=07317be27a3d6c654cb7f0b858d750b916cbe7c8 add csv.vim for coloring columns --- diff --git a/csv.vim b/csv.vim new file mode 100644 index 0000000..baa0ea2 --- /dev/null +++ b/csv.vim @@ -0,0 +1,13 @@ +highlight csv1 ctermfg=darkred +highlight csv2 ctermfg=green +highlight csv3 ctermfg=blue +highlight csv4 ctermfg=yellow +highlight csv5 ctermfg=cyan +highlight csv6 ctermfg=white + +syn match csv1 /^[^,]*/ nextgroup=csv2 +syn match csv2 /,[^,]*/hs=s+1 contained nextgroup=csv3 +syn match csv3 /,[^,]*/hs=s+1 contained nextgroup=csv4 +syn match csv4 /,[^,]*/hs=s+1 contained nextgroup=csv5 +syn match csv5 /,[^,]*/hs=s+1 contained nextgroup=csv6 +syn match csv6 /,[^,]*/hs=s+1 contained nextgroup=csv2