This commit is contained in:
RingOfStorms (Joshua Bell) 2023-12-05 22:42:08 -06:00
parent 697fb497f0
commit d10a5f1a83
3 changed files with 56 additions and 19 deletions

View file

@ -275,10 +275,16 @@ return {
return true
end,
},
{ name = "nvim_lsp", priority = 8 },
{ nane = "buffer", priority = 7 },
{ name = "luasnip", priority = 6 },
{ name = "path" },
-- This source uses the built-in Language Server Protocol (LSP) client of Neovim to provide code completions based on the language server for the current buffer
-- TODO I am getting lag sometimes I think this may be the cause, limiting to 100 for a while to see what happens
{ name = "nvim_lsp", priority = 8, max_item_count = 100 },
-- This source integrates with LuaSnip, a snippet engine for Neovim. It suggests snippets that you can insert into your code
{ name = "luasnip", priority = 7 },
-- This source provides file path completions, helping you to complete file paths in your code
{ name = "path", priority = 7 },
-- This source provides completion items from the current buffer, meaning it suggests words that have already been typed in the same file.
{ name = "buffer", priority = 6 },
-- Rust crates.io integration
{ name = "crates" },
},
sorting = {

30
lua/plugins/profile.lua Normal file
View file

@ -0,0 +1,30 @@
return {
"stevearc/profile.nvim",
config = function()
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)
end,
}