dhruvasagar / vim-table-mode

VIM Table Mode for instant table creation.
2.11k stars 96 forks source link

Option to auto-add header fill row when doing <leader>tt of selection of existing .csv content #190

Open jwel opened 4 years ago

jwel commented 4 years ago

Right now if I visually select the following .csv content

header1,header2,header3
value 1,value2,value3

and then do <leader>tt it results in

| header1 | header2 | header3 |
| value 1 | value2  | value3  |

so I have to manually do || after inserting a line after the first line. Instead, I would like a config option to be able to convert the existing content to the following for markdown:

| header1 | header2 | header3 |
|---------|---------|---------|
| value 1 | value2  | value3  |

Is there currently an option to do that? If not, what would be a good name for that option if I wanted to submit a PR?

dhruvasagar commented 4 years ago

@jwel There is g:table_mode_tabelize_auto_border that adds borders around all rows but nothing specifically for just the header. I would probably name it something like g:table_mode_tableize_auto_header