Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Invalid column pattern warning

📅 2019-Sep-17 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

Problem

I use the csv.vim plugin to view CSV files in Vim. When I opened a CSV file today, the plugin showed this warning:

CSV Syntax:Invalid column pattern, using default pattern \%([^,]*,\|$\)

Solution

Turns out that this cryptic warning has nothing to do with the content in my CSV file. The root cause was that my .vimrc had the syntax and filetype settings turned on in this order:

syntax on
filetype on
filetype plugin on
filetype indent on

Due to this order of enablement, the syntax script could not access the config variables setup by the filetype plugin. The solution was to place the syntax enabling after the filetype settings, like this:

filetype on
filetype plugin on
filetype indent on
syntax on

Tried with: Vim 8.0 and Ubuntu 18.04