Use word-boundary wrapping and count-aware displayed-line movement in ordinary buffers. Escape cancels Blink completion before falling back. Preserve the existing ergonomics check; it was not rerun during Git cleanup.
29 lines
1.2 KiB
Lua
29 lines
1.2 KiB
Lua
vim.g.mapleader = " "
|
|
vim.g.maplocalleader = ","
|
|
|
|
for _, lhs in ipairs({ "grn", "gra", "grx", "grr", "gri", "grt", "gO" }) do
|
|
vim.keymap.del("n", lhs)
|
|
end
|
|
vim.keymap.del("x", "gra")
|
|
vim.keymap.del({ "i", "s" }, "<C-S>")
|
|
|
|
for _, key in ipairs({ "j", "k" }) do
|
|
vim.keymap.set({ "n", "x" }, key, function()
|
|
return vim.bo.buftype == "" and vim.v.count == 0 and "g" .. key or key
|
|
end, { expr = true, desc = "Move by displayed line, or logical line with a count" })
|
|
end
|
|
|
|
vim.keymap.set("n", "<C-h>", "<C-w><C-h>", { desc = "Focus left window" })
|
|
vim.keymap.set("n", "<C-j>", "<C-w><C-j>", { desc = "Focus lower window" })
|
|
vim.keymap.set("n", "<C-k>", "<C-w><C-k>", { desc = "Focus upper window" })
|
|
vim.keymap.set("n", "<C-l>", "<C-w><C-l>", { desc = "Focus right window" })
|
|
vim.keymap.set("n", "gl", vim.diagnostic.open_float, { desc = "Show diagnostic details" })
|
|
vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-n>", { desc = "Leave terminal mode" })
|
|
vim.keymap.set("n", "<leader>bd", "<cmd>bdelete<cr>", { desc = "Delete current buffer" })
|
|
vim.keymap.set("n", "[d", function()
|
|
vim.diagnostic.jump({ count = -1 })
|
|
end, { desc = "Previous diagnostic" })
|
|
vim.keymap.set("n", "]d", function()
|
|
vim.diagnostic.jump({ count = 1 })
|
|
end, { desc = "Next diagnostic" })
|