-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support custom keybindings/shortcuts #1041
Comments
I'm not sure I follow... Is there some reason the usual vim key binding mechanisms do not work for you? For example, here are some key bindings I use in my " Shift Insert Paste (Command Mode, Insert Mode)
cmap <S-Insert> <C-R>+
imap <S-Insert> <C-R>+
nmap <silent> <Leader>t :GuiTreeviewToggle<CR> Is there some reason the following mapping does not work for you? I'm not sure the intent of the Note: There is a bug with Shift + Backspace specifically: We're somewhat blocked by Neovim here... Eventually, we may be forced to apply a hacky forced mapping workaround. |
Related:
Definitely would prefer to support this in Nvim so that GUIs don't need to reinvent this. Though I'm not sure if the exact request here is even blocked. |
@justinmk Currently nvim can catch custom sequences. The problem is that not every front-end sends them. Xterm or Konsole (uses PTY) doesn't send them by deafult. it can be enabled if bound by a proper key sequences in native terminal settings (.e.g in Konsole there are profiles). e.g. for Xterm: ! ~/.Xresources
! Last-Modified: Friday, December 16, 2022
! Use `man xterm` to learn more about these configs
XTerm.VT100.faceSize: 11
XTerm.VT100.faceName: JetBrains Mono Nerd Font
XTerm.VT100.background: #232627
XTerm.VT100.foreground: #fcfcfc
! ANSI-like escape codes!
XTerm.VT100.translations: #override \n\
Ctrl Shift <Key>BackSpace: string("\E[27;6;10~") \n\
Shift <Key>BackSpace: string("\E[27;6;8~")
In -- ~/.config/nvim/lua/keybindings.lua
...
nvim.keymap.set({ 'i' }, 'E[27;6;10~', ... ) |
@jgehrig It works, but I want separate bindings for ceratin commands, e.g.: ... <C-BS> " deletes space-separated words
... <C-S-BS> " deletes (space-and-othersymbols)-separated words The second one fails in many terminals and frontends. In Xterm it can be configured though (see above). |
I invented a brand new ANSI escape code. I'm using So anyway yeah I think we're still blocked on being able to introduce wholly new escape sequences to neovim??? There is the note by @hinell from above,
However this makes no sense because there is no escaped escape character here and I tried a bunch of combos and got nothing to work. Edit: sorry I don't use nvim-qt, will post in nvim github. |
Xterm allows you to specify custom keybindings for certain sequences (e.g.
<C-S-BS>
) via~/.Xresources
files.For neovim-qt, it's currently impossible to do the same so it makes sense to make feature configurable via
~/.config/nvim/ginit.vim
. The proposed API may look like:GuiKeybinding <keysequence> <string-to-emit>
.The actual use of config may look like:
The text was updated successfully, but these errors were encountered: