local map = vim.api.nvim_set_keymap local opts = { noremap = true, silent = true } -- Getting stuck in ~~vim~~ terminal map("t", "", "", {}) -- Quick cursor movement map("n", "", "5j", opts) map("n", "", "5k", opts) -- Quick pasting/yoinking to system register map("n", "+y", '"+y', opts) map("n", "+p", '"+p', opts) map("n", "+d", '"+d', opts) map("n", "*y", '"*y', opts) map("n", "*p", '"*p', opts) map("n", "*d", '"*d', opts) -- Vimgrep map("n", "", ":cnext", opts) map("n", "", ":cprevious", opts) -- See `:help vim.lsp.*` for documentation on any of the below functions map("n", "-a", "lua vim.lsp.buf.code_action()", opts) map("n", "-d", "lua vim.diagnostic.goto_next()", opts) map("n", "-n", "lua vim.lsp.buf.rename()", opts) map("n", "-r", "lua vim.lsp.buf.format { asnyc = true }", opts) map("n", "", "lua vim.lsp.buf.signature_help()", opts) map("n", "e", "lua vim.diagnostic.open_float()", opts) map("n", "K", "lua vim.lsp.buf.hover()", opts) map("n", "gd", "Telescope lsp_definitions", opts) map("n", "gi", "Telescope lsp_implementations", opts) map("n", "gp", "Telescope diagnostics bufnr=0", opts) map("n", "gP", "Telescope diagnostics", opts) map("n", "gr", "Telescope lsp_references", opts) -- command to stop LSP servers vim.api.nvim_create_user_command("StopLsps", function() vim.lsp.stop_client(vim.lsp.get_active_clients()) end, { nargs = 0 })