From b3b5702588a3f8d6c94160b0bd43f96ccfb8a0a6 Mon Sep 17 00:00:00 2001 From: Jeremie Fraeys Date: Sun, 8 Feb 2026 15:30:13 -0500 Subject: [PATCH] perf: further startup optimizations - defer indent, luasnip, notify, oil, atac, auto-dark-mode --- lua/custom/plugins/indent.lua | 1 + lua/custom/plugins/notify.lua | 1 + lua/custom/plugins/oil.lua | 16 ++++++---------- lua/custom/plugins/snippets.lua | 7 +++---- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/lua/custom/plugins/indent.lua b/lua/custom/plugins/indent.lua index 0beaf5a..68149b9 100755 --- a/lua/custom/plugins/indent.lua +++ b/lua/custom/plugins/indent.lua @@ -7,6 +7,7 @@ return { -- Add indentation guides even on blank lines 'lukas-reineke/indent-blankline.nvim', main = 'ibl', + event = 'VeryLazy', opts = { indent = { highlight = highlight, diff --git a/lua/custom/plugins/notify.lua b/lua/custom/plugins/notify.lua index 4257823..a9ea8b8 100644 --- a/lua/custom/plugins/notify.lua +++ b/lua/custom/plugins/notify.lua @@ -1,5 +1,6 @@ return { 'rcarriga/nvim-notify', + event = 'VeryLazy', opts = { timeout = 5000, stages = 'static', diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua index 9ca2940..c62a7f7 100755 --- a/lua/custom/plugins/oil.lua +++ b/lua/custom/plugins/oil.lua @@ -1,8 +1,11 @@ return { 'stevearc/oil.nvim', - dependencies = { - 'nvim-tree/nvim-web-devicons', -- optional, for file icons + lazy = true, + keys = { + { 'e', 'Oil', desc = 'Open parent directory' }, + { 'E', function() require('oil').toggle_float() end, desc = 'Toggle oil floating window' }, }, + dependencies = { 'nvim-tree/nvim-web-devicons' }, config = function() local oil = require('oil') @@ -37,14 +40,7 @@ return { vim.api.nvim_set_hl(0, 'OilProgress', { fg = '#66D9EF' }) vim.api.nvim_set_hl(0, 'OilSymlink', { fg = '#F92672' }) - -- Oil keymaps - vim.keymap.set('n', 'e', 'Oil', { noremap = true, silent = true, desc = 'Open parent directory' }) - vim.keymap.set('n', 'E', function() - oil.toggle_float() - end, { noremap = true, silent = true, desc = 'Toggle oil floating window' }) - - -- Add selected file in oil.nvim to Harpoon - -- same keymapping as if in a buffer + -- Add selected file in oil.nvim to Harpoon (only when in oil buffer) vim.keymap.set('n', 'a', function() local ok_harpoon, harpoon = pcall(require, 'harpoon') if not ok_harpoon then diff --git a/lua/custom/plugins/snippets.lua b/lua/custom/plugins/snippets.lua index 0fe99cd..3e40842 100755 --- a/lua/custom/plugins/snippets.lua +++ b/lua/custom/plugins/snippets.lua @@ -1,11 +1,10 @@ return { { 'L3MON4D3/LuaSnip', - version = 'v2.*', -- Follows the latest major release version 2 - build = 'make install_jsregexp', -- Optional: install JavaScript-based regular expressions - + version = 'v2.*', + build = 'make install_jsregexp', + event = 'InsertEnter', dependencies = { 'rafamadriz/friendly-snippets' }, - config = function() local luasnip = require('luasnip')