From 06affa9723e36f49006a8c64810a146c51895c6d Mon Sep 17 00:00:00 2001 From: Joakim Hulthe Date: Tue, 19 Nov 2024 14:45:50 +0100 Subject: [PATCH] nvim: todo-notes: Add highlight for rust safety comments --- tree/.config/nvim/init.lua | 2 -- tree/.config/nvim/lua/plugins.lua | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tree/.config/nvim/init.lua b/tree/.config/nvim/init.lua index e9cf5d4..fea3ef4 100644 --- a/tree/.config/nvim/init.lua +++ b/tree/.config/nvim/init.lua @@ -127,8 +127,6 @@ require('cmp').setup.filetype({ "rust" }, { }, }) -require("todo-comments").setup() - -- Format file on save vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]] diff --git a/tree/.config/nvim/lua/plugins.lua b/tree/.config/nvim/lua/plugins.lua index 3246365..c3480f7 100644 --- a/tree/.config/nvim/lua/plugins.lua +++ b/tree/.config/nvim/lua/plugins.lua @@ -8,6 +8,19 @@ require("lazy").setup({ { 'folke/todo-comments.nvim', dependencies = { "nvim-lua/plenary.nvim" }, + opts = { + keywords = { + SAFETY = { + icon = "☢", + color = "warning", + alt = { "SOUNDNESS", "UNSAFE", "UNSOUND" }, + }, + INVARIANT = { + icon = "🦑", + color = "hint", + }, + }, + }, }, { "folke/which-key.nvim", @@ -20,7 +33,7 @@ require("lazy").setup({ -- your configuration comes here -- or leave it empty to use the default settings -- refer to the configuration section below - } + }, }, { 'rktjmp/fwatch.nvim' },