]> git.rmz.io Git - dotfiles.git/commitdiff
lazyvim: replace LazyFile with their actual events
authorSamir Benmendil <me@rmz.io>
Sat, 22 Feb 2025 15:06:31 +0000 (15:06 +0000)
committerSamir Benmendil <me@rmz.io>
Sun, 2 Mar 2025 16:05:27 +0000 (16:05 +0000)
LazyFile is a custom event in LazyVim that simple wraps the BufReadPost,
BufNewFile and BufWritePre events. Let's just be explicit and use them
directly.

nvim/lua/plugins/editor.lua
nvim/lua/plugins/lint.lua
nvim/lua/plugins/lsp/init.lua
nvim/lua/plugins/treesitter.lua
nvim/lua/plugins/ui.lua

index 5dcdccf8deb853e82422a3bacda784b25a1734bf..b8bd5aa77c0e3105b8e0c0aab0861b4343c339f0 100644 (file)
@@ -73,7 +73,7 @@ return {
     -- Finds and lists all of the TODO, HACK, BUG, etc comment
     -- in your project and loads them into a browsable list.
     cmd = { "TodoTrouble"},
-    event = "LazyFile",
+    event = { "BufReadPost", "BufNewFile", "BufWritePre" },
     -- stylua: ignore
     keys = {
       { "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" },
@@ -104,7 +104,7 @@ return {
     -- git signs highlights text that has changed since the list
     -- git commit, and also lets you interactively stage & unstage
     -- hunks in a commit.
-    event = "LazyFile",
+    event = { "BufReadPost", "BufNewFile", "BufWritePre" },
     opts = {
       signs = {
         add = { text = "▎" },
index de4c4f2b8cedbb51f070d2a0266cdbd242afd833..018457752833067319d51bb366a4882919efbab6 100644 (file)
@@ -2,7 +2,7 @@ local M = {}
 
 return {
   { "mfussenegger/nvim-lint",
-    event = "LazyFile",
+    event = { "BufReadPost", "BufNewFile", "BufWritePre" },
     opts = {
       -- Event to trigger linters
       events = { "BufWritePost", "BufReadPost", "InsertLeave" },
index af50c8ca1438344f2e1b68dab2f34392aa438bcf..132c412e70d652a0dcdf51a1030f4be27b3719a7 100644 (file)
@@ -1,6 +1,6 @@
 return {
   { "neovim/nvim-lspconfig",
-    event = "LazyFile",
+    event = { "BufReadPost", "BufNewFile", "BufWritePre" },
     dependencies = {
       "mason.nvim",
       { "williamboman/mason-lspconfig.nvim", config = function() end }, -- don't configure yet
index f58f6aee67669193444bd54f605c481eecf1cc2f..5ffa798049ee980e5921fc5570ae9826e62e0760 100644 (file)
@@ -2,7 +2,7 @@ return {
   { "nvim-treesitter/nvim-treesitter",
     dependencies = { "nvim-treesitter/nvim-treesitter-textobjects" },
     build = ":TSUpdate",
-    event = { "LazyFile", "VeryLazy" },
+    event = { "BufReadPost", "BufNewFile", "BufWritePre" , "VeryLazy" },
     lazy = vim.fn.argc(-1) == 0, -- load treesitter early when opening a file from the cmdline
     init = function(plugin)
       -- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early
@@ -106,7 +106,7 @@ return {
   -- Automatically add closing tags for HTML and JSX
   {
     "windwp/nvim-ts-autotag",
-    event = "LazyFile",
+    event = { "BufReadPost", "BufNewFile", "BufWritePre" },
     opts = {},
   },
 }
index 261312af634b28dd235fbd356880588fe91b948f..8e52958f400bc38cee86cf17a846fc9c60f8dc84 100644 (file)
@@ -317,7 +317,7 @@ return {
   { "echasnovski/mini.indentscope",
     enabled = false,  -- replaced by snacks.indent
     version = false, -- wait till new 0.7.0 release to put it back on semver
-    event = "LazyFile",
+    event = { "BufReadPost", "BufNewFile", "BufWritePre" },
     opts = function (_, opts)
       return {
         draw = {