Vim Tips Wiki
(Change <tt> to <code>, perhaps also minor tweak.)
Line 3: Line 3:
 
==Uninstall!?!==
 
==Uninstall!?!==
 
How do I uninstall this plugin?
 
How do I uninstall this plugin?
::Open the csv*.vmb file with your vim and type <tt>:RmVimball %</tt>. That should uninstall the plugin. See also the help <tt>:h :RmVimball</tt>. [[User:Chrisbra|Chrisbra]] 21:49, March 13, 2012 (UTC)
+
::Open the csv*.vmb file with your vim and type <code>:RmVimball %</code>. That should uninstall the plugin. See also the help <code>:h :RmVimball</code>. [[User:Chrisbra|Chrisbra]] 21:49, March 13, 2012 (UTC)
   
 
==Sort request==
 
==Sort request==
Line 25: Line 25:
 
45,67,890
 
45,67,890
 
</pre>
 
</pre>
If the cursor is on the "3", command ":WhatColumn" gives 0. I'd expect it to give 3.
+
If the cursor is on the "3", command ":WhatColumn" gives 0. I'd expect it to give 3.
   
 
It would also be nice to have a setting where highlighting follows the current column when moving the cursor with something like this:
 
It would also be nice to have a setting where highlighting follows the current column when moving the cursor with something like this:
Line 78: Line 78:
 
in their vimrc file
 
in their vimrc file
   
:: I can't see why the colors are corrupt. The default color for CSVColumnEven is already defined like this. If you want to change the default color for CSVColumnOdd, put this in your .vimrc <tt>:hi CSVColumnOdd ctermfg=black ctermbg=white</tt>. This is also explained in the help below :h csv-syntax [[User:Chrisbra|Chrisbra]] 11:10, April 4, 2012 (UTC)
+
:: I can't see why the colors are corrupt. The default color for CSVColumnEven is already defined like this. If you want to change the default color for CSVColumnOdd, put this in your .vimrc <code>:hi CSVColumnOdd ctermfg=black ctermbg=white</code>. This is also explained in the help below :h csv-syntax [[User:Chrisbra|Chrisbra]] 11:10, April 4, 2012 (UTC)

Revision as of 09:47, 14 July 2012

Use this page to discuss script 2830 csv: filetype plugin for csv files

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on vim.org).
  • This page may be out of date: check the script's vim.org page above, and its release notes.

Uninstall!?!

How do I uninstall this plugin?

Open the csv*.vmb file with your vim and type :RmVimball %. That should uninstall the plugin. See also the help :h :RmVimball. Chrisbra 21:49, March 13, 2012 (UTC)

Sort request

When sorting it would be nice to avoid sorting the header row(s).

2,nSort! 3

I tried the above but it not seem to work as expected.

Doh! Just realised that the following was what I need to use:

2,$Sort! 3

Excuse the Vim newbie!

No problem. If you have questions, it might be better to ask me directly, cause I might not notice if something changes here Chrisbra 09:17, September 16, 2011 (UTC)

Bug report

I see a bug. With the following csv file:

1,2,3
45,67,890

If the cursor is on the "3", command ":WhatColumn" gives 0. I'd expect it to give 3.

It would also be nice to have a setting where highlighting follows the current column when moving the cursor with something like this:

au CursorMoved * HiColumn

--Preceding unsigned comment added by Dominiko 19:32, July 25, 2010

No idea about the plugin, but you do know that CSV works well? In the CSV tip, we decided against having the column highlighting change when you simply moved the cursor elsewhere because it's handy to keep track of what column you were last "interested" in (I think). Anyway, if you haven't tried it, give it a go and let me know what you think. JohnBeckett 10:38, July 26, 2010 (UTC)
Thanks, for pointing it out. I must admit, the script's RE does probably not always work best. But I see, how I can fix it. Chrisbra 17:25, July 28, 2010 (UTC)
Please try the version from github. That should have fixed it. Chrisbra 10:04, February 16, 2011 (UTC)

Comments

Hello, i really like your CSV script. One possible improvment could be a 'Column Header'. Like the command 'Header' freezes the first line, such a command could freeze the first column.

Some CSV is like:

  • item,1,2,3
  • stuff1,12,35,46
  • stuff2,12,35,46
  • stuff3,12,35,46
  • stuff4,12,35,46


jjinkou

This is harder than it sounds. First you could only have one Header, either horizontally or vertically. So you can't use both at the same time. Second the column can be different wide. So one needs to define the optimal width.
Let me see, what I can do. Chrisbra 22:26, February 23, 2011 (UTC)
Please try version 0.11. That adds an :VHeader command.
regards, Chrisbra 20:40, February 24, 2011 (UTC)


Bug Report

The column colo(u)rs are corrupt.

To get black and grey backgrounds to the columns, one must write:


" here ctermbg is the BACKGROUND colour for the EVEN columns

" here ctermbg is the FOREGROUND colour for the ODD columns

autocmd Filetype csv hi CSVColumnEven ctermfg=white ctermbg=darkgray

autocmd Filetype csv hi CSVColumnOdd ctermfg=black ctermbg=white


in their vimrc file

I can't see why the colors are corrupt. The default color for CSVColumnEven is already defined like this. If you want to change the default color for CSVColumnOdd, put this in your .vimrc :hi CSVColumnOdd ctermfg=black ctermbg=white. This is also explained in the help below :h csv-syntax Chrisbra 11:10, April 4, 2012 (UTC)