Skip to content

runtime(beancount): add language files#20373

Open
ambroisie wants to merge 1 commit into
vim:masterfrom
ambroisie:vim-beancount
Open

runtime(beancount): add language files#20373
ambroisie wants to merge 1 commit into
vim:masterfrom
ambroisie:vim-beancount

Conversation

@ambroisie
Copy link
Copy Markdown
Contributor

Problem: beancount is recognized, but otherwise inert
Solution: import the filetype, syntax, indent, and compiler files from vim-beancount.

@ambroisie
Copy link
Copy Markdown
Contributor Author

ambroisie commented May 29, 2026

This is taken from https://github.com/nathangrigg/vim-beancount, hence why I set @nathangrigg as the author.

It does not include:

  • the omnifunc setting, mostly because I wasn't sure if Vim usually sets it unconditionally in its built-in filetypes.
  • AlignCommodity and GetContext commands, for similar reasons.
  • setl regexpengine=1, because it seems to be a performance hack from 2021, not sure if it is still relevant.

@mao-yining
Copy link
Copy Markdown
Contributor

mao-yining commented May 30, 2026

Please Update MAINTAINER file

And I remember that every files needs a header. Take a look at files in the same directory.

You can't set others as maintainer unless you have their permission.

@chrisbra
Copy link
Copy Markdown
Member

Thanks, but do we really need those autoloaded functions here in the Vim tree? I am not sure how popular beancount is, well it doesn't seem to be for me. So I'd suggest just importing the indent, syntax and ftplugin and leave the rest as a separate plugin

@mao-yining
Copy link
Copy Markdown
Contributor

Apart from bean count. There also has some similar project and need has similar stars. Like ledger cli and hledger. That is hard to say whether include things in autoload is a good idea.

@ambroisie
Copy link
Copy Markdown
Contributor Author

Thanks, but do we really need those autoloaded functions here in the Vim tree? I am not sure how popular beancount is, well it doesn't seem to be for me. So I'd suggest just importing the indent, syntax and ftplugin and leave the rest as a separate plugin

Sure, I don't really have a strong opinion either way, as noted in my first comment I initially uploaded without them.

@dkearns
Copy link
Copy Markdown
Contributor

dkearns commented May 30, 2026

This is taken from https://github.com/nathangrigg/vim-beancount, hence why I set @nathangrigg as the author.

Did you seek approval from the author for inclusion in the Vim runtime? Even if licensing allows it we generally like to have approval from the original author. There can be negative consequences for the main project from partial distribution with Vim.

@ambroisie
Copy link
Copy Markdown
Contributor Author

Yes, I reached out to him privately, he gave his approval.

@chrisbra
Copy link
Copy Markdown
Member

chrisbra commented Jun 1, 2026

@nathangrigg can you please confirm and give public approval here? Thanks

@nathangrigg
Copy link
Copy Markdown

You have my approval, thanks

@chrisbra
Copy link
Copy Markdown
Member

chrisbra commented Jun 1, 2026

alright thanks all

Copy link
Copy Markdown
Member

@chrisbra chrisbra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am afraid at the current state, this is not yet suitable for inclusion. Also, is there a reason, you did not include the documentation? That should go into runtime/doc/filetype.txt

Comment thread runtime/autoload/beancountcomplete.vim Outdated
Comment thread runtime/autoload/beancountcomplete.vim
Comment thread runtime/autoload/beancountcomplete.vim Outdated
Comment thread runtime/autoload/beancountcomplete.vim Outdated
Comment thread runtime/autoload/beancountcomplete.vim Outdated
Comment thread runtime/autoload/beancountcomplete.vim Outdated
@ambroisie
Copy link
Copy Markdown
Contributor Author

I am afraid at the current state, this is not yet suitable for inclusion. Also, is there a reason, you did not include the documentation? That should go into runtime/doc/filetype.txt

Forgot about it 🙃.

@ambroisie
Copy link
Copy Markdown
Contributor Author

A condensed doc for the filetype has been added to filetype.txt.

\ :call beancount#get_context()

" Omnifunc for account completion.
if exists('g:beancount_completion_enable') && (g:beancount_completion_enable == 1)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if &omnifunc == ""

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addtionally?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like any other files in ftplugin check for that value?

Problem: beancount is recognized, but otherwise inert
Solution: import the filetype, syntax, indent, and compiler files from
          `vim-beancount`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants