diff options
| author | Martin Fischer <martin@push-f.com> | 2026-10-24 08:15:31 +0200 |
|---|---|---|
| committer | Martin Fischer <martin@push-f.com> | 2026-10-24 10:09:33 +0200 |
| commit | c06e85e7da7508ffc622695c8fd90df69bc94b48 (patch) | |
| tree | 021e44425bf174de54b7a12d57c85751e62a918a | |
| parent | ecef518abb5253fa5a96408d7b0ace7f2b2c504d (diff) | |
feat(nvim): highlight TODO, FIXME, etc.
| -rw-r--r-- | nixos/profiles/workstation/pkgs/nvim.nix | 1 | ||||
| -rw-r--r-- | user/nvim/init.lua | 35 |
2 files changed, 36 insertions, 0 deletions
diff --git a/nixos/profiles/workstation/pkgs/nvim.nix b/nixos/profiles/workstation/pkgs/nvim.nix index 7f0ea83..c167376 100644 --- a/nixos/profiles/workstation/pkgs/nvim.nix +++ b/nixos/profiles/workstation/pkgs/nvim.nix @@ -7,6 +7,7 @@ pkgs.wrapNeovimUnstable pkgs.neovim-unwrapped { wrapRc = false; plugins = with pkgs.vimPlugins; [ + mini-hipatterns mini-pick vscode-nvim # neovim has no syntax highlighting for Svelte by default diff --git a/user/nvim/init.lua b/user/nvim/init.lua index 6caaffa..99d4b66 100644 --- a/user/nvim/init.lua +++ b/user/nvim/init.lua @@ -25,6 +25,41 @@ pick.setup({ source = { show = pick.default_show } }) -- Reuse Neovim's popup-menu selection color for mini.pick's selected item. vim.api.nvim_set_hl(0, 'MiniPickMatchCurrent', { link = 'PmenuSel' }) +-- Highlight patterns +require('mini.hipatterns').setup({ + highlighters = { + todo = { + pattern = '%f[%w]()TODO()%f[%W]', + group = 'MiniHipatternsTodo', + }, + future = { + pattern = '%f[%w]()FUTURE()%f[%W]', + group = 'MiniHipatternsFuture', + }, + fixme = { + pattern = '%f[%w]()FIXME()%f[%W]', + group = 'MiniHipatternsFixme', + }, + hack = { + pattern = '%f[%w]()HACK()%f[%W]', + group = 'MiniHipatternsHack', + }, + }, +}) +vim.api.nvim_set_hl(0, 'MiniHipatternsTodo', { + fg = '#ff8800', +}) +vim.api.nvim_set_hl(0, 'MiniHipatternsFuture', { + fg = '#c586c0', +}) +vim.api.nvim_set_hl(0, 'MiniHipatternsFixme', { + fg = '#f44747', +}) +vim.api.nvim_set_hl(0, 'MiniHipatternsHack', { + fg = '#ff8800', + bold = true, +}) + -- Enable language servers when they are available (for example, from a nix shell). local language_servers = { { name = 'rust_analyzer', cmd = { 'rust-analyzer' } }, |
