Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orgmode-like table completion #28

Open
rambip opened this issue Jul 28, 2021 · 4 comments
Open

Orgmode-like table completion #28

rambip opened this issue Jul 28, 2021 · 4 comments
Labels
help wanted Extra attention is needed idea

Comments

@rambip
Copy link

rambip commented Jul 28, 2021

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 rambip added help wanted Extra attention is needed idea labels Jul 28, 2021
@bew
Copy link

bew commented Jul 29, 2021

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

@rodamaral
Copy link

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

@rambip
Copy link
Author

rambip commented Jul 29, 2021

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)

@skbolton
Copy link

Vimwiki has this feature. You could add that or yoink the logic into a dedicated plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed idea
Projects
None yet
Development

No branches or pull requests

4 participants