From 4e1a9cad9236d5b9b9a675eab6db9d252783e3ad Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Tue, 23 Jul 2024 14:02:30 +0300 Subject: feat(neovim): lazy loaded lualine and todo-comments --- .config/nvim/lua/custom/plugins/statusline.lua | 2 +- .config/nvim/lua/custom/plugins/todo-comments.lua | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to '.config/nvim') diff --git a/.config/nvim/lua/custom/plugins/statusline.lua b/.config/nvim/lua/custom/plugins/statusline.lua index 8dfe41f..8d3b4ac 100644 --- a/.config/nvim/lua/custom/plugins/statusline.lua +++ b/.config/nvim/lua/custom/plugins/statusline.lua @@ -1,7 +1,7 @@ return { 'nvim-lualine/lualine.nvim', dependencies = { 'nvim-tree/nvim-web-devicons', 'linrongbin16/lsp-progress.nvim' }, - event = 'BufWinEnter', + event = 'VeryLazy', config = function() require('custom.configs.statusline') end, diff --git a/.config/nvim/lua/custom/plugins/todo-comments.lua b/.config/nvim/lua/custom/plugins/todo-comments.lua index 6d8b58f..4ceb972 100644 --- a/.config/nvim/lua/custom/plugins/todo-comments.lua +++ b/.config/nvim/lua/custom/plugins/todo-comments.lua @@ -11,9 +11,14 @@ return { 'folke/todo-comments.nvim', dependencies = { 'nvim-lua/plenary.nvim' }, + event = "VeryLazy", + keys = { + { 'st', 'TodoTelescope keywords=TODO,FIX', desc = '[S]earch [T]odos' }, + { 'lt', 'TodoTrouble', desc = '[L]ist [T]odos' }, + }, config = function() require('todo-comments').setup({ - signs = true, -- show icons in the signs column + signs = false, -- show icons in the signs column sign_priority = 8, -- sign priority keywords = { @@ -44,10 +49,10 @@ return { highlight = { multiline = true, multiline_pattern = '^.', -- lua pattern to match the next multiline from the start of the matched keyword - multiline_context = 10, -- extra lines that will be re-evaluated when changing a line - before = '', -- "fg" or "bg" or empty - keyword = 'wide', -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. (wide and wide_bg is the same as bg, but will also highlight surrounding characters, wide_fg acts accordingly but with fg) - after = 'fg', -- "fg" or "bg" or empty + multiline_context = 10, -- extra lines that will be re-evaluated when changing a line + before = '', -- "fg" or "bg" or empty + keyword = 'wide', -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. (wide and wide_bg is the same as bg, but will also highlight surrounding characters, wide_fg acts accordingly but with fg) + after = 'fg', -- "fg" or "bg" or empty pattern = { [[.*<(KEYWORDS)\s*:]], -- [[.*<(KEYWORDS)\s*]], @@ -88,7 +93,5 @@ return { -- pattern = [[\b(KEYWORDS)\b]], }, }) - vim.keymap.set('n', 'st', 'TodoTelescope keywords=TODO,FIX', { desc = '[S]earch [T]odos' }) - vim.keymap.set('n', 'lt', 'TodoTrouble', { desc = '[L]ist [T]odos' }) end, } -- cgit v1.3.1