2023-12-18 09:11:00 +01:00
|
|
|
-- move selected lines and auto indent
|
|
|
|
vim.keymap.set("v", "<A-j>", ":m '>+1<CR>gv=gv")
|
|
|
|
vim.keymap.set("v", "<A-k>", ":m '<-2<CR>gv=gv")
|
|
|
|
|
|
|
|
-- zz centers the cursor
|
|
|
|
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
|
|
|
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
|
|
|
vim.keymap.set("n", "n", "nzzzv")
|
|
|
|
vim.keymap.set("n", "N", "Nzzzv")
|
2023-12-28 14:50:39 +01:00
|
|
|
|
2023-12-30 13:08:26 +01:00
|
|
|
-- switch between buffers
|
2023-12-28 14:50:39 +01:00
|
|
|
vim.keymap.set("n", "<C-j>", "<cmd>bprev<CR>")
|
|
|
|
vim.keymap.set("n", "<C-k>", "<cmd>bnext<CR>")
|
2023-12-30 13:08:26 +01:00
|
|
|
|
|
|
|
-- exit from terminal easily
|
|
|
|
vim.keymap.set("t", "<Esc>", "<C-\\><C-n>")
|
|
|
|
vim.keymap.set("t", "<C-v><Esc>", "<Esc>") -- Verbatim escape (send an esc to underlying program)
|
2023-12-30 13:08:53 +01:00
|
|
|
|
|
|
|
-- fast open a new terminal
|
2024-01-14 22:29:32 +01:00
|
|
|
vim.keymap.set("n", "<leader>t", "<cmd>term<CR>", { nowait = true })
|