nvim: Lazy load zen-mode, nvim-cmp

Correctly lazy load nvim-cmp as much as possible.
Loading it with certain events but also before lsp.
See here: https://github.com/hrsh7th/nvim-cmp/discussions/688#discussioncomment-1891544
This commit is contained in:
Marty Oehme 2023-12-09 01:11:36 +01:00
parent eec90ad7e2
commit ea224ebbc1
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
2 changed files with 4 additions and 5 deletions

View file

@ -59,7 +59,8 @@ return {
"WhoIsSethDaniel/mason-tool-installer.nvim",
},
},
event = "BufReadPost",
event = { "BufRead", "BufNewFile", "InsertEnter" },
after = { "nvim-cmp" },
config = function()
require("plugins.config.lsp")
end,
@ -232,7 +233,7 @@ return {
config = function()
require("plugins.config.cmp")
end,
event = { "InsertEnter", "CmdlineEnter", "VeryLazy" },
event = { "InsertEnter", "CmdlineEnter" },
},
-- loading animations for some LSP

View file

@ -3,9 +3,7 @@ local writing_ft = { "quarto", "pandoc", "markdown", "text", "tex" }
local prose_plugs = {
-- UI improvements
-- provide distraction free writing
{ "folke/zen-mode.nvim", config = true, event = "VeryLazy" },
-- provide even distraction free-er writing (lowlight paragraphs)
{ "folke/twilight.nvim", event = "VeryLazy" },
{ "folke/zen-mode.nvim", config = true, cmd = { "ZenMode" }, dependencies = { "folke/twilight.nvim" } },
{
"andrewferrier/wrapping.nvim",
config = function()