wishlist icon indicating copy to clipboard operation
wishlist copied to clipboard

Orgmode-like table completion

Open rambip opened this issue 4 years ago • 4 comments

What? I'm looking for a special kind of completion, that I only ever saw in emacs orgmode: table completion ( you tab inside a markdown table and it is completed foe you)

Why? Vim is about repeatable atomic edits, but it just doesn't work with tables. A smarter completion is required in these cases.

Potential existing implementations: There is an orgmode plugin for neovim that I didn't try, but I don't need all this functionality.

Potential pitfalls: One of the things that could be challenging is detecting when you're inside a table. Also, this could mess up with the tab completion. Maybe emacs way of doing it is not the best idea for neovim. Maj+enter could be a good keybinding for that. And I have no idea how that could integrate with treesiter.

rambip avatar Jul 28 '21 16:07 rambip

What kind of completion do you expect and isn't currently available?

bew avatar Jul 29 '21 05:07 bew

Not that I use any of these, but there's also this plugin https://github.com/vhyrro/neorg

rodamaral avatar Jul 29 '21 13:07 rodamaral

I think the table completion is on their todo-list, they still didn't implement it. What I would like is a way to start creating a table like that:

| foo | bar |

Then hit something like maj+enter, and that would escape, create a new line, and drop me in insert mode like that:

| foo | bar |
|-------|-------|
| x      |        |

And when I insert a text inside a cell and I go back to normal mode, the entire table would be re-indented:

| foo | bar |
|------|--------|
| really long thing | short |

Would became (when I hit enter)

|              foo            |  bar   |
|---------------------------|---------|
| really long thing | short |

And ideally, there could be text-objects like "cell" to use as a usual text-object (like dic deletes the content of a cell and reformat the table)

rambip avatar Jul 29 '21 18:07 rambip