vim-table-mode
vim-table-mode copied to clipboard
Feature Request - Support multi-line cells
I love VIM, and the table plugin is great. For single line cells it's perfect. It would be awesome if multi line cells where supported. This is how table functionality works in OneNote, and it's a dream. Here's an example:

I haven't thought through what the multi line cell UX should be in VIM, but if someone is interested in working on this, I can spend time thinking about it.
Technically, this is already possible. You just choose where to draw the line separators, which aren't a necessity anymore.
Although from vim-table-mode's perspective they are 2 separate rows, but that shouldn't be a problem I believe. Unless you need something more.
That's a great way to proceed. Let me list out a few features I use often in OneNote tables, to see if there's a good map to vim-table-mode:
A) Re-order rows (as opposed to lines) by erasing and pasting.
From table example:
Put cursor on [C] hit dd, and then move up to [A] and hit p.
Expect both 'lines' in row C to move.
B) Add a line within a multi line cell, by hitting enter (equivalent of o/O) will be cell relative.
From table example:
Put cursor on 'Two Row' hit o
Expect cursor under 'Two Row' so can type Three Row in the same cell.
A) You could just do 2dd
B) Again you can always press O from the border line or o from the last line where you actually intend the same.
I can understand how these may seem slightly inconvenient but they also allow for more flexibility and ease.
Is there a way I can press o, and stay in the same cell (vs go to the start of the next row?) See gif @ link: http://i.imgur.com/QID8Xxj.gifv
ah, well no. That I can look into supporting.
Awesome. Tell me as you think about this. I'm happy to brainstorm approaches if you'll find that helpful.
Well I have been meaning to add more editing supports like the one you mentioned for a while. Things like adding a cell under the current cell, move cells etc.
I was just about to suggest this too. Having o or J commands restricted to a cell would be really useful, or some similar commands that achieve the same thing.
That functionality could also open up the possibility of resizing rows and columns with multi-line wrapping for each cell.
Multi lines or being able to set max column widths with wrapping would be great. I use table mode with dbext to format the results a lot better.
The only issue is columns with large text fields means large columns.
ok gotta shift gears soon.
Does the inability to edit multi-line tables, specifically without them flowing to the side as a new column, go as part of this feature request? :) I was hoping to edit the table and having the columns follow. If not, I'll create a new issue if desired.
Bump, multiline cells and/or fixed cell width for auto wrapping would be great to have!
I would also like to use such a feature
I'm so motivated to have multi-line cells, can we be of any help on this ?
I have started receiving sponsorship recently and some folks have been generous. I am going to start allocating more time / day. Other than sponsoring, feel free to take a stab and submit a PR, I can help you get through if required.
This seems like a very common use case, but I've searched and couldn't find a solution. Has anybody found one? There is this plugin for Obsidian which implements the markdown table syntax to include multiline cells, rowspan (long) cells and colspan (tall) cells. I'm very surprised that there doesn't seem to be an equivalent for it in Vim?
@arisolt Thanks for sharing that, this looks like a pretty good approach, i'll take a look at it.
That would also work really well with this jekyll plugin which seems to use the same markdown scheme.
multiple lines per cell will be great, is this supported now?
@laoshaw No, not yet. I would be happy to review a PR :). I am struggling to find large chunks of time to work on features, mostly focusing on bug fixing and improving test coverage.