local map = vim.keymap.set -- Disable arrow keys in normal, visual, and insert modes. local keys = { "", "", "", "" } for _, key in ipairs(keys) do map({ "n", "i", "v" }, key, "", { noremap = true, silent = true }) end -- Neotree map("n", "", "Neotree toggle", { desc = "Open neotree"}) -- Telescope map("n", "", "Telescope find_files", { desc = "Telescope: Find files" }) map("n", "", "Telescope live_grep", { desc = "Telescope: Live grep" }) -- LSP Stuff vim.api.nvim_create_autocmd("LspAttach", { group = vim.api.nvim_create_augroup("UserLspConfig", {}), callback = function(ev) local opts = { buffer = ev.buf } local tele = require("telescope.builtin") -- LSP map("n", "gd", tele.lsp_definitions, vim.tbl_extend("force", opts, { desc = "Goto Definition" })) map("n", "fs", tele.lsp_document_symbols, vim.tbl_extend("force", opts, { desc = "Doc Symbols" })) map("n", "fS", tele.lsp_dynamic_workspace_symbols, vim.tbl_extend("force", opts, { desc = "Dynamic Symbols" })) map("n", "ft", tele.lsp_type_definitions, vim.tbl_extend("force", opts, { desc = "Goto Type" })) map("n", "fr", tele.lsp_references, vim.tbl_extend("force", opts, { desc = "Goto References" })) map("n", "fi", tele.lsp_implementations, vim.tbl_extend("force", opts, { desc = "Goto Impl" })) map("n", "K", vim.lsp.buf.hover, vim.tbl_extend("force", opts, { desc = "Hover" })) map("n", "e", vim.diagnostic.open_float, vim.tbl_extend("force", opts, { desc = "Diagnostic" })) map("n", "k", vim.lsp.buf.signature_help, vim.tbl_extend("force", opts, { desc = "Sig Help" })) map("n", "rn", vim.lsp.buf.rename, vim.tbl_extend("force", opts, { desc = "Rename" })) map("n", "ca", vim.lsp.buf.code_action, vim.tbl_extend("force", opts, { desc = "Code Action" })) map("n", "wf", vim.lsp.buf.format, vim.tbl_extend("force", opts, { desc = "Format" })) -- Visual mode code action map("v", "ca", vim.lsp.buf.code_action, vim.tbl_extend("force", opts, { desc = "Code Action" })) end, })