JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
add csv.vim for coloring columns
authorJason Woofenden <jason@jasonwoof.com>
Wed, 26 Sep 2012 14:16:36 +0000 (10:16 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Wed, 26 Sep 2012 14:16:36 +0000 (10:16 -0400)
csv.vim [new file with mode: 0644]

diff --git a/csv.vim b/csv.vim
new file mode 100644 (file)
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