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

@ -5,11 +5,14 @@ local wk = require("which-key")
local map = vim.keymap.set
-- Tmux won't forward <C-Cr> to Neovim.
-- So, I've mapped ctrl+enter to \u2190 in kitty,
-- which is the "←" unicode symbol.
KITTY_SPECIAL = ""
map({ "n", "i", "x" }, KITTY_SPECIAL, "<C-Cr>", { remap = true })
-- required to remap special sequence
-- when inside tmux :)
require("tmux-remap").setup({
special = "",
remap = "<C-Cr>",
autoset = true,
})
map({ "n" }, "<C-Cr>", function()
vim.notify("Special!")
end)

View file

@ -9,12 +9,6 @@ return {
---@type blink.cmp.Config
opts = {
appearance = {
-- sets the fallback highlight groups to nvim-cmp's highlight groups
-- useful for when your theme doesn't support blink.cmp
-- will be removed in a future release, assuming themes add support
use_nvim_cmp_as_default = false,
-- set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
-- adjusts spacing to ensure icons are aligned
nerd_font_variant = "mono",
},
completion = {
@ -38,22 +32,17 @@ return {
},
},
-- experimental signature help support
-- signature = { enabled = true },
sources = {
-- adding any nvim-cmp sources here will enable them
-- with blink.compat
compat = {},
default = { "lsp", "path", "snippets", "buffer" },
cmdline = {},
},
keymap = {
preset = "default",
["<Tab>"] = {
LazyVim.cmp.map({ "snippet_forward", "ai_accept" }),
"fallback",
},
-- ["<Tab>"] = {
-- LazyVim.cmp.map({ "snippet_forward", "ai_accept" }),
-- "fallback",
-- },
["<C-Cr>"] = { "select_and_accept", "fallback" },
["<C-l>"] = { "select_prev" },
["<C-h>"] = { "select_next" },
["<C-L>"] = { "scroll_documentation_up" },
["<C-H>"] = { "scroll_documentation_down" },
},
},
}

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