2.2 KiB
2.2 KiB
merged-repl-plugin
Neovim plugin that synchronizes a REPL repository with a main repository and provides a Perl REPL workflow inside Neovim.
Features
- Automatic synchronization of REPL repo branches with main repo (polling-based)
:REPLcommand to open the REPL session file:RUNcommand to execute the REPL script and show output in a readonly buffer- Auto-commit of REPL repo changes by default
Defaults
auto_commit = true(auto-commit changes in REPL repo if dirty)output_target = 'buffer'(REPL output appears in an in-editor readonly buffer)auto_start = false(sync timer not started automatically)
Installation
- Place the
lua/directory inside your Neovim config or as part of a plugin path. - In your
init.luaadd:
require('merged-repl-plugin').setup{
main_repo_path = '/path/to/main/repo',
repl_repo_path = '/path/to/repl/repo',
repl_file = '/path/to/repl/repo/repl.pl',
auto_commit = true, -- default
output_target = 'buffer', -- default
auto_start = false, -- default
}
Usage
:REPL— open the configuredrepl.plfile for editing:RUN— save and runrepl.pl; output streams to a buffer calledREPL Output: <repo-name>require('merged-repl-plugin').start_auto_sync()— start automatic polling for branch changesrequire('merged-repl-plugin').stop_auto_sync()— stop automatic polling
Testing
- A basic integration test script is provided at
tests/run_tests.sh. - Run it from the project root:
./tests/run_tests.sh
Notes & Caveats
- The plugin performs Git operations (add/commit/checkout).
auto_commitwill create commits automatically using the repo's configured Git author. - The plugin runs Git and Perl via asynchronous jobs to avoid blocking the editor, but operations may still fail due to hooks or merge conflicts — the plugin will notify and leave repositories unchanged in those cases.
auto_startisfalseby default to avoid surprising behavior. Callstart_auto_sync()when you're ready to enable automatic syncing.
Contributing
- Feel free to open PRs for improvements: add
auto_stashbehavior, enable file-based output for headless environments, or enhance logging.
License
- MIT