Skip to content

runtime(beancount): add language files#20373

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

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

ambroisie commented May 29, 2026

Copy link
Copy Markdown
Contributor Author

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

mao-yining commented May 30, 2026

Copy link
Copy Markdown
Contributor

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

dkearns commented May 30, 2026

Copy link
Copy Markdown
Contributor

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

chrisbra commented Jun 1, 2026

Copy link
Copy Markdown
Member

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

@nathangrigg

Copy link
Copy Markdown

You have my approval, thanks

@chrisbra

chrisbra commented Jun 1, 2026

Copy link
Copy Markdown
Member

alright thanks all

@chrisbra chrisbra left a comment

Copy link
Copy Markdown
Member

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.

Comment thread runtime/ftplugin/beancount.vim Outdated
\ :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?

Comment thread runtime/autoload/beancountcomplete.vim Outdated
Comment thread runtime/autoload/beancountcomplete.vim Outdated
Comment thread runtime/ftplugin/beancount.vim Outdated
Comment thread runtime/compiler/bean_check.vim Outdated
@ambroisie ambroisie force-pushed the vim-beancount branch 2 times, most recently from 94abe3e to ef37461 Compare June 8, 2026 11:35
@chrisbra

chrisbra commented Jun 8, 2026

Copy link
Copy Markdown
Member

Did you test this out?

@ambroisie

ambroisie commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Not with the changes from review. I was waiting for reviews to be done first.

@ambroisie

Copy link
Copy Markdown
Contributor Author

There was a small typo in the suggested code. I've tested the update runtime files, they seem to be functional.

Comment thread runtime/autoload/beancountcomplete.vim Outdated
Comment thread runtime/ftplugin/beancount.vim
Comment thread runtime/doc/filetype.txt
Comment thread runtime/autoload/beancountcomplete.vim Outdated
Comment thread runtime/autoload/beancountcomplete.vim
Problem: beancount is recognized, but otherwise inert
Solution: import the filetype, syntax, indent, and compiler files from
          `vim-beancount`.
Comment thread runtime/autoload/beancountcomplete.vim
@chrisbra

chrisbra commented Jun 13, 2026

Copy link
Copy Markdown
Member

@nathangrigg please review the changes in the Vim commit 1fee3cd that have been done as part of including your maintained version of the beancount runtime files. There were quite a few changes added to make it a bit more robust and secure. If you notice anything you'd like to change, please create a follow-up PR. Thanks 🙏

@chrisbra chrisbra closed this in 1fee3cd Jun 13, 2026
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