require "nvchad.mappings" local map = vim.keymap.set local builtin = require "telescope.builtin" map("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" }) map("n", "gD", builtin.lsp_definitions, { desc = "Go to Definitions" }) map("n", "grr", builtin.lsp_references, { desc = "Go to references" }) map("n", "ge", ":Gen") map("n", "gl", "lua vim.lsp.buf.code_action()", { noremap = true, silent = true }) map("n", "dh", ":lua vim.diagnostic.open_float()", { desc = "Show diagnostics" }) map("n", "dj", ":lua vim.diagnostic.goto_next()", { desc = "Go to next" }) map("n", "dk", ":lua vim.diagnostic.goto_prev()", { desc = "Go to previous" }) map("n", "da", ":lua vim.lsp.buf.code_action()", { desc = "Code actions", noremap = true, silent = true }) -- Telescope map("n", "fr", ":Telescope resume", { desc = "Resume last search" }) map("n", "fs", ":Telescope grep_string", { desc = "Find selected string" }) map("n", "fk", ":Telescope keymaps", { desc = "Find keymaps" }) map("n", "fd", ":Telescope diagnostics", { desc = "Diagnostics" }) map({ "n", "v" }, "ge", ":Gen", { desc = "Gen.nvim" }) map({ "n", "t" }, "", function() require("nvchad.term").toggle { pos = "float", id = "floatTerm", float_opts = { row = 0.1, col = 0.1, width = 0.8, height = 0.8, }, } end, { desc = "terminal toggle floating term" })