From 2ec6966a06ea4fa55f8a0fcf68e08a6e0c60332a Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 30 Oct 2017 14:44:15 +1300 Subject: Add detection, tweak indent/whitespace for CSV/TSV Vim does not seem to have any built-in detection or settings for CSV or TSV files, so I've added a couple here, based on filename patterns matching the .csv and .tsv extensions. If either of these types are detected, the 'autoindent' and 'expandtab' options are both switched off, as they're undesirable, especially in TSVs where a literal tab is almost certainly what's intended. Ideally, these same two setting would apply to any filetype not otherwise categorisable, but I can't figure out a way to do that safely yet; there was an attempt made in d3d998c. --- vim/ftplugin/csv.vim | 3 +++ vim/ftplugin/tsv.vim | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 vim/ftplugin/csv.vim create mode 100644 vim/ftplugin/tsv.vim (limited to 'vim/ftplugin') diff --git a/vim/ftplugin/csv.vim b/vim/ftplugin/csv.vim new file mode 100644 index 00000000..3d78df97 --- /dev/null +++ b/vim/ftplugin/csv.vim @@ -0,0 +1,3 @@ +" Manual indenting and literal tabs for CSVs +setlocal noautoindent +setlocal noexpandtab diff --git a/vim/ftplugin/tsv.vim b/vim/ftplugin/tsv.vim new file mode 100644 index 00000000..53841357 --- /dev/null +++ b/vim/ftplugin/tsv.vim @@ -0,0 +1,3 @@ +" Manual indenting and literal tabs for TSVs +setlocal noautoindent +setlocal noexpandtab -- cgit v1.2.3