[Nvim] mappings

This commit is contained in:
coja
2026-04-11 05:13:37 +02:00
parent 3705c90fda
commit a4675f15b9

View File

@@ -1,31 +1,25 @@
require "nvchad.mappings" require "nvchad.mappings"
-- add yours here
local map = vim.keymap.set local map = vim.keymap.set
-- map("n", ";", ":", { desc = "cmd enter command mode" })
map("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" }) map("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" })
map("n", "gD", "<cmd>Telescope lsp_definitions<CR>", { desc = "Go to Definitions" }) map("n", "gD", ":Telescope lsp_definitions<CR>", { desc = "Go to Definitions" })
map("n", "grr", "<cmd>Telescope lsp_references<CR>", { desc = "Go to references" }) map("n", "grr", ":Telescope lsp_references<CR>", { desc = "Go to References" })
map("n", "<leader>dh", ":lua vim.diagnostic.open_float()<cr>", { desc = "Show diagnostics" }) map("n", "<leader>gl", ":lua vim.lsp.buf.code_action()<CR>", { noremap = true, silent = true })
map("n", "<leader>dj", ":lua vim.diagnostic.goto_next()<cr>", { desc = "Go to next" }) map("n", "<leader>dh", ":lua vim.diagnostic.open_float()<CR>", { desc = "Show diagnostics" })
map("n", "<leader>dk", ":lua vim.diagnostic.goto_prev()<cr>", { desc = "Go to previous" }) map("n", "<leader>dj", ":lua vim.diagnostic.goto_next()<CR>", { desc = "Go to next" })
map("n", "<leader>da", ":lua vim.lsp.buf.code_action()<cr>", { desc = "Code actions", noremap = true, silent = true }) map("n", "<leader>dk", ":lua vim.diagnostic.goto_prev()<CR>", { desc = "Go to previous" })
map("n", "<leader>da", ":lua vim.lsp.buf.code_action()<CR>", { desc = "Code actions", noremap = true, silent = true })
-- Telescope -- Telescope
map("n", "<leader>fr", "<cmd>Telescope resume<CR>", { desc = "Resume last search" }) map("n", "<leader>fr", ":Telescope resume<CR>", { desc = "Resume last search" })
map("n", "<leader>fs", "<cmd>Telescope grep_string<CR>", { desc = "Find selected string" }) map("n", "<leader>fs", ":Telescope grep_string<CR>", { desc = "Find selected string" })
map("n", "<leader>fk", "<cmd>Telescope keymaps<CR>", { desc = "Find keymaps" }) map("n", "<leader>fk", ":Telescope keymaps<CR>", { desc = "Find keymaps" })
map("n", "<leader>fd", "<cmd>Telescope diagnostics<CR>", { desc = "Diagnostics" }) map("n", "<leader>fd", ":Telescope diagnostics<CR>", { desc = "Diagnostics" })
map("n", "x", '"_x', { desc = "Delete char without yanking" }) -- CodeCompanion
map("n", "c", '"_c', { desc = "Change without yanking" }) map({ "n", "v" }, "<leader>ge", ":CodeCompanion<CR>", { desc = "CodeCompanion" })
map({ "n", "v" }, "<leader>ga", ":CodeCompanionActions<CR>", { desc = "CodeCompanion actions" })
map({ "n", "v" }, "<leader>ge", "<cmd>CodeCompanion<CR>", { desc = "CodeCompanion" }) map("n", "<leader>gc", ":CodeCompanionChat Toggle<CR>", { desc = "CodeCompanion chat" })
map({ "n", "v" }, "<leader>ga", "<cmd>CodeCompanionActions<CR>", { desc = "CodeCompanion actions" }) map("v", "<leader>gc", ":CodeCompanionChat Add<CR>", { desc = "Send selection to CodeCompanion chat" })
map("n", "<leader>gc", "<cmd>CodeCompanionChat Toggle<CR>", { desc = "CodeCompanion chat" }) -- Remaps
map("v", "<leader>gc", "<cmd>CodeCompanionChat Add<CR>", { desc = "Send selection to CodeCompanion chat" }) map({ "n", "v" }, "x", '"_x', { desc = "Delete char without yanking" })
map({ "n", "v" }, "c", '"_c', { desc = "Change without yanking" })
-- P paste with
-- global marks
-- "{register}