Skip to content

Commit

Permalink
feat(nvim): toggle diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
kerumitdg authored and fredrikaverpil committed Jun 1, 2024
1 parent d5211eb commit b58f841
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nvim-fredrik/lua/config/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,12 @@ function M.setup_minimap_keymaps()
}
end

function M.setup_diagnostics_keymaps()
map_normal_mode("<leader>ud", function()
vim.diagnostic.enable(not vim.diagnostic.is_enabled())
end, "Toggle diagnostics")
end

function M.setup_winshift_keymaps()
vim.keymap.set({ "n", "v" }, "<leader>uw", "<cmd>WinShift<CR>", { desc = "[w]inshift (shift + arrows)" })
end
Expand Down
2 changes: 2 additions & 0 deletions nvim-fredrik/lua/utils/diagnostics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ function M.setup_diagnostics()
end

vim.diagnostic.config(vim.deepcopy(diagnostics))

require("config.keymaps").setup_diagnostics_keymaps()
end

return M

0 comments on commit b58f841

Please # to comment.