Lets say you working on some data in a Vim buffer/window and you would like to convert this data from comma delimited to tab delimited so you can paste the tab delimited data directly into Excel.

Run the following ex command


:   Ex mode command
%   Process command on the entire buffer
s   search and replace command
/,/\t/  search for any commas, and replace with a <tab> character.

g   process command globally

To paste the data from GVim to Excel, you would.

  1. In normal mode, type:  ggVG          Like Ctrl-A on windows
  2. You should now have the entire buffer selected
  3. While still in normal mode, type: "+y       Like Ctrl-C on windows
  4. You should now have the data on the windows clipboard
  5. Switch to Excel, Ctrl-V to paste the data from the clipboard.