local map = vim.keymap.set -- Save/Quit map("n", "w", "w", { desc = "Save" }) map("n", "q", "q", { desc = "Quit" }) -- Better movement with wrapped lines (just in case you turn wrap on) map("n", "j", "gj", { noremap = true }) map("n", "k", "gk", { noremap = true }) -- Clear search highlight map("n", "h", "nohlsearch", { desc = "No highlight" }) -- Diagnostics map("n", "[d", vim.diagnostic.goto_prev, { desc = "Prev diagnostic" }) map("n", "]d", vim.diagnostic.goto_next, { desc = "Next diagnostic" }) map("n", "e", vim.diagnostic.open_float, { desc = "Diagnostic float" }) -- Window navigation map("n", "", "h", { desc = "Left window" }) map("n", "", "j", { desc = "Down window" }) map("n", "", "k", { desc = "Up window" }) map("n", "", "l", { desc = "Right window" }) local diagnostics_visible = true map("n", "td", function() diagnostics_visible = not diagnostics_visible vim.diagnostic.config({ virtual_text = diagnostics_visible, }) end, { desc = "Toggle inline diagnostics" })