(nvim) added bindings for save and quit again

This commit is contained in:
scbj
2026-03-05 10:10:47 +01:00
parent 054e6c9b34
commit 2b13dc894a

View File

@@ -8,6 +8,10 @@ vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { silent = true })
-- command options
local opts = { noremap = true, silent = true }
-- save & quit file
vim.keymap.set("n", "<C-s>", "<cmd> w <CR>", opts)
vim.keymap.set("n", "<C-q>", "<cmd> q <CR>", opts)
-- Allow moving the cursor through wrapped lines with j, k
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
@@ -16,7 +20,8 @@ vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = tr
vim.keymap.set("n", "<Esc>", ":noh<CR>", opts)
-- delete single character without copying into register
vim.keymap.set("n", "x", '"_x', opts)
-- also allows to delete selection without copying into register
vim.keymap.set({ "n", "v" }, "x", '"_x', opts)
-- Vertical scroll and center
vim.keymap.set("n", "<C-d>", "<C-d>zz", opts)