vim-orgmode icon indicating copy to clipboard operation
vim-orgmode copied to clipboard

Use vim-table-mode for vim-orgmode table feature.

Open dkinzer opened this issue 11 years ago • 18 comments

dhruvasagar/vim-table-mode is a feature rich ascii table manipulator that seems to only be lacking a sorting feature and an export feature. At a glance, the code base seems pretty solid (though, it's vimscript not python); but the test suite looks very comprehensive.

I think incorporating this module into vim-orgmode could be very beneficial.

dkinzer avatar Mar 30 '14 21:03 dkinzer

I use https://github.com/godlygeek/tabular for my tables. It's not integrated in vim-orgmode and not as feature rich as Emacs' orgmode table thingy but all I have to do is :Tabular /| to align a table.

vim-table-mode looks pretty powerful though! Quite a few third-party plugins are integrated into vim-orgmode: utl, speeddating, tag-bar, etc. Maybe such an approach to integrate vim-table-mode would be sufficient. I don't have the time to do that but pull requests are welcome.

sotte avatar Mar 30 '14 23:03 sotte

Got it. I think the vim-table-mode either uses tabular or was heavily influenced by tabular at least that's my impression from an issue I read. Any specific requirements you look for when integrating a third party?

dkinzer avatar Mar 30 '14 23:03 dkinzer

  • The integration should be mentioned in the documentation: see "Suggested plugins", and "Tables". The documentation follows the orgmode-guide: documentation/emacs_orgguide.org.
  • Not having the plugin should not break anything.

I think we should not define new orgmode specific mappings but reuse the vim-table-mode mappings.

What do you think?

sotte avatar Mar 31 '14 09:03 sotte

Agreed. I'll see if I can put this together.

dkinzer avatar Apr 01 '14 00:04 dkinzer

:+1: :)

sotte avatar Apr 01 '14 12:04 sotte

@dkinzer any news? I'm using table-mode (without any modifications) and it works quite nicely.

sotte avatar Apr 20 '14 10:04 sotte

Sorry Stefan, I haven't had any time to work on this, but like you say the only thing to do is to add documentation because it works pretty fine out of the box.

On Sun, Apr 20, 2014 at 6:52 AM, Stefan Otte [email protected]:

@dkinzer https://github.com/dkinzer any news? I'm using table-mode (without any modifications) and it works quite nicely.

— Reply to this email directly or view it on GitHubhttps://github.com/jceb/vim-orgmode/issues/159#issuecomment-40892431 .

dkinzer avatar Apr 20 '14 19:04 dkinzer

Hey David,

I'll do some more testing and add the documentation then.

Thanks for opening the issue!

On Sun, Apr 20, 2014 at 9:48 PM, David Kinzer [email protected]:

Sorry Stefan, I haven't had any time to work on this, but like you say the only thing to do is to add documentation because it works pretty fine out of the box.

On Sun, Apr 20, 2014 at 6:52 AM, Stefan Otte [email protected]:

@dkinzer https://github.com/dkinzer any news? I'm using table-mode (without any modifications) and it works quite nicely.

— Reply to this email directly or view it on GitHub< https://github.com/jceb/vim-orgmode/issues/159#issuecomment-40892431> .

— Reply to this email directly or view it on GitHubhttps://github.com/jceb/vim-orgmode/issues/159#issuecomment-40903208 .

sotte avatar Apr 21 '14 11:04 sotte

OK, sorry I had started https://github.com/dkinzer/vim-orgmode/compare/vim-table-mode but then got bogged down with other stuff.

dkinzer avatar Apr 21 '14 20:04 dkinzer

Don't be sorry! If you want to add this feature I'm more than happy. There is no rush. Just let me know.

sotte avatar Apr 21 '14 20:04 sotte

@dkinzer @sotte What exactly is left here to do?

I just tried to use it and it seems to work quite nicely; I'm a bit confused though, as in the documentation (section "Creating table on-the-fly") each row seems to be separated by some filling row.

This does not seem to be the case for org-mode (see http://orgmode.org/manual/Built_002din-table-editor.html#Built_002din-table-editor) and we might have to set the option accordingly, see the

call s:SetGlobalOptDefault('table_mode_fillchar', '-')

at https://github.com/dhruvasagar/vim-table-mode/blob/master/plugin/table-mode.vim

Shurakai avatar Jul 02 '15 10:07 Shurakai

@Shurakai the table feature of emacs' orgmode is really a beast. It can do so many things: Tab to jump to the next cell, auto format on every Tab, do math on the cells (replace Excel), fill cells with previously defined data, etc.

So I guess there is a lot left to do :)

But if "just" want to integrate vim-table-mode, we should create a pull request and talk about the details.

sotte avatar Jul 03 '15 09:07 sotte

Yeah I think we should just go ahead with a PR. There are many other parts of vim-orgmode that require attention and vim-table-mode is quite sophisticated.

We need to add documentation for sure, but what else? It worked quite well already.

Shurakai avatar Jul 10 '15 22:07 Shurakai

Documentation, tests... And the plugin should be optional, i.e., nothing breaks if vim-table-mode is not installed.

sotte avatar Jul 13 '15 08:07 sotte

Curious to know if a PR's been crafted; I'm willing to test drive against a few cases of live data (or write tests for said examples).

jalcine avatar Aug 22 '16 06:08 jalcine

@dkinzer, why was this issue closed? Although no code is there, the comments here seem to be a good blueprint to put things together. And closed means either "not valid" or "done", imho neither is correct.

@Shurakai, did you managed to implement something?

doak avatar Feb 09 '20 14:02 doak

159

Not sure about MIT vs GPL licensing and what functionality you want... but vimwikis implementation automatically aligns the table whenever you exit insertmode or tab to the next cell...

Let me know and I'll submit my PR mid september.

0xACE avatar Jul 30 '20 18:07 0xACE

Let me know and I'll submit my PR mid september.

This would be very helpful for me! Since I did not see a merged or open PR about this: can I find the code somewhere or would you provide this as a PR @0xACE ? :-)

farao avatar Jun 25 '21 11:06 farao