rohit-px2 / nvui

A modern frontend for Neovim.
MIT License
1.72k stars 49 forks source link

Custom shortcuts #154

Open hinell opened 1 year ago

hinell commented 1 year ago

Xterm allows you to specify custom keybindings for certain sequences (e.g. <C-S-BS>) via ~/.Xresources files.

For nvui, 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:

if exists(':GuiTabline')
    GuiKeybinding Ctrl+Shift+BackSpace "\E[27;6;8~"
endif

In nvim

In nvim I catch them like this:


-- ~/.config/nvim/lua/keybindings.lua
... 
nvim.keymap.set({ 'i' }, 'E[27;6;8~', ... )