AutoYADM commit: 2024-12-13 16:30:02

This commit is contained in:
Daniel Fichtinger 2024-12-13 16:30:02 -05:00
parent 486f694fbd
commit 25396da2b6
4 changed files with 44 additions and 30 deletions

View file

@ -1,12 +1,34 @@
-- Tmux won't forward <C-Cr> to Neovim.
-- So, I've mapped ctrl+enter to \u2190 in kitty,
-- which is the "←" unicode symbol.
local M = {}
M.config = {
special = "",
remap = "<C-Cr>",
autoset = true,
}
M.set = function(opts)
if not opts then
opts = M.config
end
vim.keymap.set({ "n", "i", "x" }, opts.special, opts.remap, { remap = true })
end
M.setup = function(opts)
M.config = vim.tbl_extend("force", M.config, opts)
M.config = vim.tbl_extend("force", M.config, opts or {})
TMUX_SPECIAL = M.config.special
TMUX_REMAP = M.config.remap
if not vim.g.tmux_special then
vim.g.tmux_special = TMUX_SPECIAL
end
if not vim.g.tmux_remap then
vim.g.tmux_remap = TMUX_REMAP
end
if M.config.autoset then
M.set()
end
end
return M