AndrewRadev / sideways.vim

A Vim plugin to move function arguments (and other delimited-by-something items) left and right.
http://www.vim.org/scripts/script.php?script_id=4171
MIT License
479 stars 9 forks source link

Empty Cell #47

Open ivanGarciaBernal opened 3 years ago

ivanGarciaBernal commented 3 years ago

Cannot switch one cell to empty one in Cucumber, Markdown, Vimwiki tables. One solution on any of these filetypes should work in the others

AndrewRadev commented 3 years ago

I think I've managed to pull this off in the branch empty-markdown-cells. The problem is the plugin tends to consider whitespace between items to be unimportant. When you have, for instance foo(bar, baz), the two items should be bar and baz instead of bar and <space>baz. With markdown tables, I think this isn't a big concern, since you'd probably use an alignment plugin to normalize whitespace when manipulating (like tabularize).

Could you try that branch and let me know how it feels? It's a tricky problem to solve in the general case -- if the plugin was specifically for these kinds of tables, I could automatically maintain same column-width and such. Now, I shift items around and press sa| to realign, and it works well, but it does involve several moving parts (sa| being mapped to Tabularize/|) -- and I think this might be the best I can do within the limitations of sideways.