diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-10-30 14:44:15 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-10-30 14:44:15 +1300 |
commit | 2ec6966a06ea4fa55f8a0fcf68e08a6e0c60332a (patch) | |
tree | 3e61728d8f982e37343a5498e49f459914ec30f2 /vim/ftplugin | |
parent | Use :setfiletype in lieu of :setlocal filetype= (diff) | |
download | dotfiles-2ec6966a06ea4fa55f8a0fcf68e08a6e0c60332a.tar.gz dotfiles-2ec6966a06ea4fa55f8a0fcf68e08a6e0c60332a.zip |
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.
Diffstat (limited to 'vim/ftplugin')
-rw-r--r-- | vim/ftplugin/csv.vim | 3 | ||||
-rw-r--r-- | vim/ftplugin/tsv.vim | 3 |
2 files changed, 6 insertions, 0 deletions
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 |