zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
24.39k stars 1.16k forks source link

keybinding for comments and joinlines don't work #3265

Closed evanescente-ondine closed 2 months ago

evanescente-ondine commented 2 months ago

{ "Ctrl/": "comment", "CtrlJ": "joinLines", "CtrlUnderscore": "lua:comment.comment" "CtrlShiftC": "Copy" "CtrlShiftV": "Paste" }

Neither of Ctrl/, CtrlJ, Alt+j, Alt+/ do anything., with or without the "lua:" prefix.

Version: 2.0.13 OS: Linux B8-97-5A-F9-E4-87 6.6.15-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.6.15-2 (2024-02-04) x86_64 GNU/Linux Terminal: fish, version 3.7.1

Andriamanitra commented 2 months ago

There is no action called "joinLines". If your bindings.json looks like that you should get an error

Error in bindings: action joinLines does not exist

when you start micro, that's assuming your bindings.json is located in the correct place which is ~/.config/micro/bindings.json by default. The comment plugin needs to be enabled (set comment on) for the "lua:comment.comment" keybinding to work.

You can use raw to open a buffer where you can see all the key events that micro gets. Sometimes another program (like the terminal emulator or desktop environment) may be capturing the key events before they get to micro, in which case they obviously won't work.

dmaluka commented 2 months ago

I think @evanescente-ondine is using the joinLines plugin (as am I). The correct keybinding for it is lua:joinLines.joinLines.

BTW I've noticed that the comment plugin's help mentions an incorrect (non-working) keybinding. Pushed fix: https://github.com/zyedidia/micro/commit/24406a5ae80f0742f6970aad0e083f64bb421551

And so does the joinLines plugin's help. Submitted PR with the fix: https://github.com/Lisiadito/join-lines-plugin/pull/9