diff options
| author | triethyl <triethylammonium@pm.me> | 2025-08-13 22:40:29 -0400 |
|---|---|---|
| committer | triethyl <triethylammonium@pm.me> | 2025-08-13 22:40:29 -0400 |
| commit | ad1329bf205454a8b13110475687775a8456f787 (patch) | |
| tree | 84c72324a46915cefd7eb7cd6b3583c1eeaf03f7 /pkgs/custom-neovim/config/init.lua | |
| parent | 0f588b826771f4843e28531cb503403a0785ae57 (diff) | |
neovim: bunch of stuff
Diffstat (limited to 'pkgs/custom-neovim/config/init.lua')
| -rw-r--r-- | pkgs/custom-neovim/config/init.lua | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/pkgs/custom-neovim/config/init.lua b/pkgs/custom-neovim/config/init.lua index 9d21de2..cd5e09b 100644 --- a/pkgs/custom-neovim/config/init.lua +++ b/pkgs/custom-neovim/config/init.lua @@ -1,3 +1,29 @@ +local should_profile = os.getenv("NVIM_PROFILE") +if should_profile then + require("profile").instrument_autocmds() + if should_profile:lower():match("^start") then + require("profile").start("*") + else + require("profile").instrument("*") + end +end + +local function toggle_profile() + local prof = require("profile") + if prof.is_recording() then + prof.stop() + vim.ui.input({ prompt = "Save profile to:", completion = "file", default = "profile.json" }, function(filename) + if filename then + prof.export(filename) + vim.notify(string.format("Wrote %s", filename)) + end + end) + else + prof.start("*") + end +end +vim.keymap.set("", "<f1>", toggle_profile) + -- Require utilities. require("utilities") require("art") |
