ledger / vim-ledger

Vim plugin for Ledger
GNU General Public License v2.0
374 stars 54 forks source link

Provide CMP completion source (Lua) #134

Open alerque opened 2 years ago

alerque commented 2 years ago

I think it would be useful if, in addition to the native vimscript omnicomplete function currently provided, we provide a Lua source suitable for consumption in other completion frameworks.

In particular I'm interested in nvim-cmp. Providing a Lua module that outputs possible completion would make a much nicer integrated experience rather than my current workaround of having this plugin complete descriptions and accounts and something else providing other completions. In particular not having to re-implement all the bindings so they roughly match would be nice!

I presume this can be done without interrupting VIM users that want to keep using this plugin as-is, but if not I suppose we could launch a new plugin project for the Lua interface.

alerque commented 2 years ago

c.f. cmp-beancount

kirasok commented 1 year ago

Hi! I made my cmp-hledger source that works with ledger and hledger

boydkelly commented 1 year ago

I think it would be useful if, in addition to the native vimscript omnicomplete function currently provided, we provide a Lua source suitable for consumption in other completion frameworks.

In particular I'm interested in nvim-cmp. Providing a Lua module that outputs possible completion would make a much nicer integrated experience rather than my current workaround of having this plugin complete descriptions and accounts and something else providing other completions. In particular not having to re-implement all the bindings so they roughly match would be nice!

Screenshot from 2023-05-19 17-50-32

I presume this can be done without interrupting VIM users that want to keep using this plugin as-is, but if not I suppose we could launch a new plugin project for the Lua interface.

I'd vote for a new plugin that brings in the completion from cmp-(h)ledger, and highlighting from treesitter (which is quite awesome now with a highlight group for negative numbers.... Maybe a new plugin would be lean and more about workflow and shortcuts.

boydkelly commented 1 year ago

Hi! I made my cmp-hledger source that works with ledger and hledger

Awesome! So glad I came here to discover that!!!!