Wednesday, December 24, 2014

Re: Markdown tables in Vim

On 2014-12-24 13:11, russurquhart1@verizon.net wrote:
> I am creating documents using Markdown formatting. There are many
> tables in the document i am working on. I'm trying to see if there
> is a plugin that will allow me to take text like the following:
>
> SignedAddition Instructions Effect on OVC/OVCU
> MOVU OVC,loc16 OVC = [loc16(5:0)]
>
> (where there is a tab character between the two columns above.) To
> something like this:
>
> +----------------------------------+------------------------+
> | **Signed Addition Instructions** | **Effect on OVC/OVCU** |
> +----------------------------------+------------------------+
> | MOVU OVC,loc16 | OVC = [loc16(5:0)] |
> +----------------------------------+------------------------+
>
> (I hope this looks alright, the webmail client keeps using a
> proportional spaced font instead of the Courier i wanted. But it
> should look like a box, above.)
>
> Any help is greatly appreciated!

While it's not exactly a plugin, I recently threw together a little
CSV-to-markup table generator

https://github.com/Gumnos/csv2markup

that makes pretty quick work of converting CSV (or tab-delimited)
data to your markup language of choice. For markdown, you'd use

./csv2markup -f md data.csv

optionally passing in the "-o" flag if you want to have it output
on stdout (instead of writing to a file), letting you read it
directly into vim. To specify a tab delimiter you can use

./csv2markup -f md -d$'\t' data.csv

which should at least work in bash (you'd have to use whatever your
shell's method is for entering a literal tab as a parameter).

-tim



--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: