2025-05-16 20:41:31 +02:00

33 lines
1.1 KiB
Lua

-- For some reason the lua lsp thinks that vim. is a undefined global :| just ignore if it tells you lies.
-- Settings leader as space. Leader is requred for all custom keybinds
vim.g.mapleader = " "
-- Enters netrw/file explore in nvim
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
-- Creating keybinds for using tabs
vim.keymap.set("n", "<leader>ct", vim.cmd.tabnew)
vim.keymap.set("n", "<leader>qt", vim.cmd.tabclose)
-- Lests you move visual marked blocks up and down
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
-- Lets you move the line below onto current line
vim.keymap.set("n", "J", "mzJ`z")
-- Lets you jump half page up and down
vim.keymap.set("n", "<C-d>", "<C-d>zz")
vim.keymap.set("n", "<C-u>", "<C-u>zz")
-- Lets you paste without swapping the yoink/paste buffer
vim.keymap.set("x", "<leader>p", [["_dP]])
-- Lets you yoink into clipboard
vim.keymap.set({"n", "v"}, "<leader>y", [["+y]])
vim.keymap.set("n", "<leader>Y", [["+Y]])
-- Ctrl-c remap to Esc
vim.keymap.set("i", "<C-c>", "<Esc>")
vim.keymap.set("n", "Q", "<nop>")