X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=csv.vim;h=04efc7061b0453162fa441f3cbe0350b2e276561;hb=85112f656262ae6592503f8760fd12d387f273e9;hp=baa0ea25a4499fa82d95fdd6fa67cac4c6691435;hpb=07317be27a3d6c654cb7f0b858d750b916cbe7c8;p=vim-syntax.git diff --git a/csv.vim b/csv.vim index baa0ea2..04efc70 100644 --- a/csv.vim +++ b/csv.vim @@ -4,10 +4,24 @@ highlight csv3 ctermfg=blue highlight csv4 ctermfg=yellow highlight csv5 ctermfg=cyan highlight csv6 ctermfg=white +highlight quoted1 ctermfg=darkred +highlight quoted2 ctermfg=green +highlight quoted3 ctermfg=blue +highlight quoted4 ctermfg=yellow +highlight quoted5 ctermfg=cyan +highlight quoted6 ctermfg=white + +syn region quoted1 start="\"" end="\"" contained +syn region quoted2 start="\"" end="\"" contained +syn region quoted3 start="\"" end="\"" contained +syn region quoted4 start="\"" end="\"" contained +syn region quoted5 start="\"" end="\"" contained +syn region quoted6 start="\"" end="\"" contained + +syn match csv1 /^[^,]*/ contains=quoted1 nextgroup=csv2 +syn match csv2 /,[^,]*/hs=s+1 contained contains=quoted2 nextgroup=csv3 +syn match csv3 /,[^,]*/hs=s+1 contained contains=quoted3 nextgroup=csv4 +syn match csv4 /,[^,]*/hs=s+1 contained contains=quoted4 nextgroup=csv5 +syn match csv5 /,[^,]*/hs=s+1 contained contains=quoted5 nextgroup=csv6 +syn match csv6 /,[^,]*/hs=s+1 contained contains=quoted6 nextgroup=csv2 -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