I’ve been using #ctags with #ledger for a couple months now. It’s been a complete game changer to update my journal with fast completions and code navigation. It works out of the box with my editor of choice #neovim/#vim and also with other editors, sometimes with a plugin (#emacs, #vscode…).
I’m now sharing the ctags configuration, as this could benefit others: https://cj.rs/ledger-ctags/
Please let me know if you have issues or if some things are unclear!
#plaintextaccounting #ledgercli
1/4
The Language Server Protocol (LSP) is the long-running process that VS Code uses to get clever completions, code navigation and error checking. You get one LSP per language and it continuously “builds your code” in the background and answers queries from the text editor. Such queries can be: “Where was this variable declared?” or “What symbols of type X could complete what was just typed”.
2/4
I’m also setting #ledger-cli as a custom compiler in vim (with https://github.com/ledger/vim-ledger). So on write, the file is parsed by ledger and any errors are highlighted straight away in the editor, with the usual navigation convenience.
3/4
Ctags + this compiler support actually makes for a great LSP substitute, but much lighter. There is no long running process building an in memory view from all the files, just a text file with pointers to definitions (the tag file) and quick calls to the ledger command to get errors.
4/4
@cjoly No way!!1 Using ctags for auto-completion is such a great idea