deprecate old profiler in favor of snacks.profiler

Use PROF=1 env variable to enable startup profiling
This commit is contained in:
2025-02-11 20:48:09 -05:00
parent 98ab9da88c
commit 588a46e239
2 changed files with 23 additions and 0 deletions
+23
View File
@@ -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<f1>`
--- 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