BeancountAutocomplete
No description provided
Details
Installs
- Total 0
- Win 0
- Mac 0
- Linux 0
| Feb 10 | Feb 9 | Feb 8 | Feb 7 | Feb 6 | Feb 5 | Feb 4 | Feb 3 | Feb 2 | Feb 1 | Jan 31 | Jan 30 | Jan 29 | Jan 28 | Jan 27 | Jan 26 | Jan 25 | Jan 24 | Jan 23 | Jan 22 | Jan 21 | Jan 20 | Jan 19 | Jan 18 | Jan 17 | Jan 16 | Jan 15 | Jan 14 | Jan 13 | Jan 12 | Jan 11 | Jan 10 | Jan 9 | Jan 8 | Jan 7 | Jan 6 | Jan 5 | Jan 4 | Jan 3 | Jan 2 | Jan 1 | Dec 31 | Dec 30 | Dec 29 | Dec 28 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Beancount Autocomplete
A Sublime Text plugin that provides intelligent autocomplete for Beancount account names.
Features
- Smart Account Discovery: Automatically scans your Beancount file for account definitions
- Cached Performance: Intelligently caches accounts and only reloads when your Beancount file changes
- Instant Completions: Get autocomplete suggestions for all your accounts as you type
- Hierarchical Account Support: Handles Beancount's hierarchical account structure (e.g.,
Assets:Bank:Checking,Expenses:Food:Groceries)
Installation
Via Package Control (Recommended)
- Open the Command Palette (
Cmd+Shift+Pon macOS,Ctrl+Shift+Pon Windows/Linux) - Select “Package Control: Install Package”
- Search for “BeancountAutocomplete”
- Press Enter to install
Manual Installation
- Clone this repository into your Sublime Text Packages directory:
macOS:
cd ~/Library/Application\ Support/Sublime\ Text/Packages/
git clone https://github.com/rhydlewis/BeancountAutocomplete.git
Linux:
cd ~/.config/sublime-text/Packages/
git clone https://github.com/rhydlewis/BeancountAutocomplete.git
Windows:
cd %APPDATA%\Sublime Text\Packages\
git clone https://github.com/rhydlewis/BeancountAutocomplete.git
- Restart Sublime Text
Configuration
To use this plugin, you must configure the path to your main Beancount file.
Global Configuration
- Open Sublime Text preferences:
Preferences → Settings - Add the following configuration:
{
"beancount_file": "/absolute/path/to/your/accounts.beancount"
}
Project-Specific Configuration
For project-specific settings, add to your .sublime-project file:
{
"folders": [
{
"path": "."
}
],
"settings": {
"beancount_file": "/absolute/path/to/your/accounts.beancount"
}
}
Important: The beancount_file path must be an absolute path, not a relative path.
Usage
Once configured, the plugin works automatically:
- Open any file in Sublime Text
- Start typing an account name (e.g.,
Assets:) - Autocomplete suggestions will appear showing all matching accounts
- Press
TaborEnterto insert the selected account
The plugin specifically looks for open directives in your Beancount file to build the list of valid accounts:
2020-01-01 open Assets:Bank:Checking
2020-01-01 open Expenses:Food:Groceries
2020-01-01 open Income:Salary
How It Works
- The plugin scans your configured Beancount file for account definitions
- Accounts are cached in memory for performance
- The cache automatically refreshes when your Beancount file is modified
- Only accounts from
opendirectives are included for cleaner suggestions
Requirements
- Sublime Text 3 or 4
- A Beancount ledger file
Development
Local Deployment
For local development and testing, use the included deployment script:
./deploy.sh
This script:
- Detects your operating system (macOS, Linux, Windows)
- Copies beancount_autocomplete.py to Sublime Text's User packages directory
- Creates a timestamped backup of any existing version
- Works across all platforms
After deployment:
1. Restart Sublime Text or reload the plugin via Command Palette (Ctrl+Shift+P → “Plugin Development: Reload Plugin”)
2. Test your changes in a Beancount file
Running Tests
The plugin includes a comprehensive test suite using Python's unittest framework. To run the tests:
python3 -m unittest tests.test_beancount_autocomplete -v
The tests cover: - Account name regex pattern matching - Loading accounts from Beancount files - File caching behavior - Completion filtering by prefix - Case-insensitive matching - Error handling for missing files
All tests use mocks for Sublime Text's API, so they can run independently without Sublime Text installed.
Troubleshooting
No completions appear
- Verify your
beancount_filesetting points to the correct file path - Check that the file exists and is readable
- Ensure your Beancount file contains
opendirectives - View the Sublime Text console (
View → Show Console) for any error messages
Completions are outdated
The plugin caches accounts for performance. If you've added new accounts, they should appear automatically after saving your Beancount file. If not, restart Sublime Text.
License
MIT License - see LICENSE file for details
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
About Beancount
Beancount is a double-entry bookkeeping system that uses plain text files. Learn more at beancount.github.io.