" columnise a csv file for display only as may crop wide columns :let width = 20 :let fill=' ' | while strlen(fill) < width | let fill=fill.fill | endwhile :%s/\([^;]*\);\=/\=strpart(submatch(1).fill, 0, width)/ge :%s/\s\+$//ge " Highlight a particular csv column (put in .vimrc) function! CSVH(x) execute 'match Keyword /^\([^,]*,\)\{'.a:x.'}\zs[^,]*/' execute 'normal ^'.a:x.'f,' endfunction command! -nargs=1 Csv :call CSVH() " call with :Csv 5 : highlight fifth column