Closed jabbalaci closed 11 months ago
In what order are the plugins loaded? First the built-ins, then the custom ones in ~/.config/plug
? Are they loaded in alphabetical order?
I tried to make a custom plugin that would overwrite the setting of the built-in plugin "comment":
VERSION = "0.1.0"
local config = import("micro/config")
function init()
config.TryBindKey("CtrlUnderscore", "lua:comment.comment,CursorDown,StartOfTextToggle", true)
config.Reload()
end
However, when I check bindings.json
, it's not modified :(
Update: Sorry, I made a mistake previously. It actually works!
However, what I want is this:
"CtrlUnderscore": "lua:comment.comment,CursorDown,StartOfTextToggle",
When I define that in my bindings.json
then it isn't overwritten by the comment plugin, because it uses TryBindKey(..., ..., false)
so not overwriting user defined bindings.
Update:
Update: Sorry, I made a mistake previously. It actually works!
If this was meant to tell that the issue is obsolete, then please close it. ;)
Thanks for the reply! Now that I tried again, it's not overwritten. Sorry, it can be closed.
micro has a built-in plugin called "comment", which is very useful but I have an issue with this. I'm playing with a new terminal emulator (wezterm), and according to "> raw", when I press
Ctrl-/
, it is recognized asCtrl-_
, which is the same asCtrlUnderscore
. The comment plugin adds this line:However, what I want is this:
That is, when I comment a line, I want the cursor to move down 1 line, thus I can comment several lines easily. However, the built-in plugin overwrites my setting each time I launch micro :(
How could this issue be resolved? If the comment plugin didn't register its keybinding, there would be no problem.