diff --git a/lua/config/profile.lua b/deprecated/old_profile.lua similarity index 100% rename from lua/config/profile.lua rename to deprecated/old_profile.lua diff --git a/lua/config/profiler.lua b/lua/config/profiler.lua new file mode 100644 index 0000000..8eff52c --- /dev/null +++ b/lua/config/profiler.lua @@ -0,0 +1,23 @@ +--- @module "config.profiler" +--- This module configures the profiler for the Neovim configuration. +--- This tool can be used to profile specific modules or all modules. +--- +--- The profiler can be toggled with the leader keybinding `d` +--- or with the `PROF` environment variable. +-- ╭─────────────────────────────────────────────────────────╮ +-- │ PROFILER │ +-- ╰─────────────────────────────────────────────────────────╯ + +if vim.env.PROF then + -- example for lazy.nvim + -- change this to the correct path for your plugin manager + local snacks = vim.fn.stdpath('data') .. '/lazy/snacks.nvim' + vim.opt.rtp:append(snacks) + require('snacks.profiler').startup({ + startup = { + event = 'VimEnter', -- stop profiler on this event. Defaults to `VimEnter` + -- event = "UIEnter", + -- event = "VeryLazy", + }, + }) +end