csv.vim icon indicating copy to clipboard operation
csv.vim copied to clipboard

remove delimiter

Open bbbart opened this issue 4 years ago • 2 comments

My apologies if I'm missing something blatantly obvious, but I can't find a way to remove a character as a delimiter in csv.vim. In a file that looks like this

2018-01-03T20:31:20.187658+01:00,97.8
2018-01-04T02:38:53.141040+01:00,98.5
2018-01-04T10:18:30.896722+01:00,97.6
2018-01-05T10:08:58.491900+01:00,97.1
...

csv.vim incorrectly autodetects : as a delimiter.

When I run :NewDelimiter , the , character is added to the list of delimiter characters, but the : is not removed from it. Running :let g:csv_delim=, has no apparent effect.

Bug, or feature?

bbbart avatar Jan 17 '21 13:01 bbbart

I think after the g:csv_delim=',' you may need to re-init the plugin :InitCSV.

Alternatively, try setting g:csv_delim_test as mentioned in the help:

https://github.com/chrisbra/csv.vim/blob/350af4840991142230103e4f4fc58581d9c07812/doc/ft-csv.txt#L1131-L1133

 :let g:csv_delim_test = ',;|'

chrisbra avatar Jan 18 '21 07:01 chrisbra

Thanks for the quick reply. Unfortunately, setting g:csv_delim_test doesn't have any effect when doing it in a running vim session. Also, :InitCSV is "not an editor command" (E492).

Perhaps it helps to know that I am loading csv.vim through vim-polyglot?

I have now (not really) solved it by putting let g:csv_delim=',' in my vim configuration file.

bbbart avatar Jan 19 '21 08:01 bbbart