micro: Keybindings mostly not working
Description of the problem or steps to reproduce
- alt+left/right does not select
- binding
"Shift-Backspace": "DeleteWordLeft",
does not work - one can not rebind ctrl+e ?
- is there any Keybinding possible to swap the current line one up/ down (also works with selections in sublime using ctrl up+down)?
- creating keybidnings for plugins is confusing, I wanted to create one for
snippets
butsnippets.snippetinsert
and variants do not work, instead one has to look into the source and usesnippet.Insert
which is not documented or intuitive based on thectrl+e
command
Specifications
Version: 1.3.4 Commit hash: 5fc8f84 Compiled on November 25, 2017
Commit hash: OS: macOS 10.13.2 Terminal: Terminal
the editor is generally really a nice improvement upon nano
thanks
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 32 (16 by maintainers)
Commits related to this issue
- Allow binding commands Bind commands with `command:...` Ref #974 — committed to zyedidia/micro by zyedidia 6 years ago
- More command binding Now can bind editable commands with `command-edit:` Ref #974 — committed to zyedidia/micro by zyedidia 6 years ago
Here are the escape sequences I’m seeing when using iTerm2 vs alacritty. For Ctrl+Arrows and Alt+Arrows the sequences are the same (well iTerm2 uses 9 for meta, and alacritty uses 3 for alt, but it’s not a big deal since they both mean the same thing).
However, the differences come up with ctrl+shift+arrows and alt+shift+arrows.
iTerm2:
\x1b[1;10A/B/C/D
\x1b[1;6A/B/C/D
Alacritty:
\uf700
,\uf701
,\uf702
,\uf703
.The unfortunate fact is that a lot of these escape sequences are non-standard as the original terminals didn’t have alt, control, and shift with arrow keys, or at least people didn’t worry about it.
Here’s a comment in the terminfo database here, which explains the escape codes:
iTerm2 is using different escape codes from these ones with
9
being Meta,10
being Meta-Shift… I think you should just emit4
for Alt-Shift, and6
for Ctrl-Shift and everything will work fine.CommandMode
to whatever key you want, instead ofCtrlE
, in yourbindings.json
local function example()
), then it can be bound inbindings.json
by directly adding"AltE": "pluginname.functionname"
(or whatever key you want)vsplit
(I bound it toAlt-v
myself), but I don’t think there’s a way to specifically bind something that types into the command mode (CtrlE
), although you can emulate the desired behaviour with a plugin.