feature request: Is there any way to create custom strategy?
Did you check existing requests?
- [X] I have searched the existing issues
Describe the feature
Is there any way to create custom strategy? Use case: use custom command runner, for runnig command outside neovim (like https://github.com/lolpie244/simple-kitty-runner.nvim)
Provide background
No response
What is the significance of this feature?
nice to have
Additional details
No response
Sure, you just need to implement all the required methods. The type is defined here:
https://github.com/stevearc/overseer.nvim/blob/a6dc0600f675f10b8840c61d3f9d72fdf8cf970c/lua/overseer/strategy/init.lua#L6-L14
You can look at the other strategies in that dir to see how they do things. The test strategy is nice in that it shows you exactly what the responsibilities of a strategy are with minimal code.
@stevearc, should I somewhere add this class? Or just make fork and add it inside code?
The strategy is passed in as a name and is loaded on this line: https://github.com/stevearc/overseer.nvim/blob/fdcd46ce738ef342bce38e5433df004ebdab3a1a/lua/overseer/strategy/init.lua#L44
This means that if your strategy is "mystrategy", we'll be calling require("overseer.strategy.mystrategy"). So you can put the code in the file <runtimepath>/lua/overseer/strategy/mystrategy.lua. See :help runtimepath for more info, and :=vim.fn.stdpath("config") to see the most likely path to use as the root.