(nvim) added bindings for save and quit again
This commit is contained in:
@@ -8,6 +8,10 @@ vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { silent = true })
|
|||||||
-- command options
|
-- command options
|
||||||
local opts = { noremap = true, silent = true }
|
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
|
-- 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", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||||
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { 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)
|
vim.keymap.set("n", "<Esc>", ":noh<CR>", opts)
|
||||||
|
|
||||||
-- delete single character without copying into register
|
-- 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
|
-- Vertical scroll and center
|
||||||
vim.keymap.set("n", "<C-d>", "<C-d>zz", opts)
|
vim.keymap.set("n", "<C-d>", "<C-d>zz", opts)
|
||||||
|
|||||||
Reference in New Issue
Block a user