nvim: big lua update
This commit is contained in:
@@ -9,23 +9,26 @@ vim.api.nvim_command('packadd packer.nvim')
|
||||
|
||||
local no_errors, error_msg = pcall(function()
|
||||
|
||||
local time
|
||||
local profile_info
|
||||
local should_profile = false
|
||||
if should_profile then
|
||||
local hrtime = vim.loop.hrtime
|
||||
profile_info = {}
|
||||
time = function(chunk, start)
|
||||
if start then
|
||||
profile_info[chunk] = hrtime()
|
||||
else
|
||||
profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6
|
||||
end
|
||||
_G._packer = _G._packer or {}
|
||||
_G._packer.inside_compile = true
|
||||
|
||||
local time
|
||||
local profile_info
|
||||
local should_profile = false
|
||||
if should_profile then
|
||||
local hrtime = vim.loop.hrtime
|
||||
profile_info = {}
|
||||
time = function(chunk, start)
|
||||
if start then
|
||||
profile_info[chunk] = hrtime()
|
||||
else
|
||||
profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6
|
||||
end
|
||||
else
|
||||
time = function(chunk, start) end
|
||||
end
|
||||
|
||||
else
|
||||
time = function(chunk, start) end
|
||||
end
|
||||
|
||||
local function save_profiles(threshold)
|
||||
local sorted_times = {}
|
||||
for chunk_name, time_taken in pairs(profile_info) do
|
||||
@@ -38,8 +41,10 @@ local function save_profiles(threshold)
|
||||
results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms'
|
||||
end
|
||||
end
|
||||
if threshold then
|
||||
table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)')
|
||||
end
|
||||
|
||||
_G._packer = _G._packer or {}
|
||||
_G._packer.profile_output = results
|
||||
end
|
||||
|
||||
@@ -74,11 +79,21 @@ _G.packer_plugins = {
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/LuaSnip",
|
||||
url = "https://github.com/L3MON4D3/LuaSnip"
|
||||
},
|
||||
["cmp-nvim-lsp"] = {
|
||||
loaded = true,
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
|
||||
url = "https://github.com/hrsh7th/cmp-nvim-lsp"
|
||||
},
|
||||
cmp_luasnip = {
|
||||
loaded = true,
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/cmp_luasnip",
|
||||
url = "https://github.com/saadparwaiz1/cmp_luasnip"
|
||||
},
|
||||
["comment.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/comment.nvim",
|
||||
url = "https://github.com/numtostr/comment.nvim"
|
||||
},
|
||||
["ctrlsf.vim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/ctrlsf.vim",
|
||||
@@ -104,15 +119,30 @@ _G.packer_plugins = {
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/glow.nvim",
|
||||
url = "https://github.com/ellisonleao/glow.nvim"
|
||||
},
|
||||
nerdtree = {
|
||||
["mason-lspconfig.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/nerdtree",
|
||||
url = "https://github.com/scrooloose/nerdtree"
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim",
|
||||
url = "https://github.com/williamboman/mason-lspconfig.nvim"
|
||||
},
|
||||
["nord-vim"] = {
|
||||
["mason-tool-installer.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/nord-vim",
|
||||
url = "https://github.com/arcticicestudio/nord-vim"
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/mason-tool-installer.nvim",
|
||||
url = "https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim"
|
||||
},
|
||||
["mason.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/mason.nvim",
|
||||
url = "https://github.com/williamboman/mason.nvim"
|
||||
},
|
||||
["nord.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/nord.nvim",
|
||||
url = "https://github.com/shaunsingh/nord.nvim"
|
||||
},
|
||||
["null-ls.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/null-ls.nvim",
|
||||
url = "https://github.com/jose-elias-alvarez/null-ls.nvim"
|
||||
},
|
||||
["nvim-cmp"] = {
|
||||
loaded = true,
|
||||
@@ -124,6 +154,11 @@ _G.packer_plugins = {
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
|
||||
url = "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
["nvim-tree.lua"] = {
|
||||
loaded = true,
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/nvim-tree.lua",
|
||||
url = "https://github.com/nvim-tree/nvim-tree.lua"
|
||||
},
|
||||
["nvim-treesitter"] = {
|
||||
loaded = true,
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
|
||||
@@ -139,16 +174,24 @@ _G.packer_plugins = {
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/plenary.nvim",
|
||||
url = "https://github.com/nvim-lua/plenary.nvim"
|
||||
},
|
||||
["splitjoin.vim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/splitjoin.vim",
|
||||
url = "https://github.com/AndrewRadev/splitjoin.vim"
|
||||
},
|
||||
["telescope-fzf-native.nvim"] = {
|
||||
cond = { true },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = true,
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/opt/telescope-fzf-native.nvim",
|
||||
url = "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
|
||||
},
|
||||
["telescope.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/telescope.nvim",
|
||||
url = "https://github.com/nvim-telescope/telescope.nvim"
|
||||
},
|
||||
["vim-commentary"] = {
|
||||
loaded = true,
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/vim-commentary",
|
||||
url = "https://github.com/tpope/vim-commentary"
|
||||
},
|
||||
["vim-easy-align"] = {
|
||||
loaded = true,
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/vim-easy-align",
|
||||
@@ -174,6 +217,11 @@ _G.packer_plugins = {
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/vim-repeat",
|
||||
url = "https://github.com/tpope/vim-repeat"
|
||||
},
|
||||
["vim-rhubarb"] = {
|
||||
loaded = true,
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/vim-rhubarb",
|
||||
url = "https://github.com/tpope/vim-rhubarb"
|
||||
},
|
||||
["vim-surround"] = {
|
||||
loaded = true,
|
||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/vim-surround",
|
||||
@@ -197,6 +245,17 @@ _G.packer_plugins = {
|
||||
}
|
||||
|
||||
time([[Defining packer_plugins]], false)
|
||||
-- Conditional loads
|
||||
time([[Conditional loading of telescope-fzf-native.nvim]], true)
|
||||
require("packer.load")({"telescope-fzf-native.nvim"}, {}, _G.packer_plugins)
|
||||
time([[Conditional loading of telescope-fzf-native.nvim]], false)
|
||||
|
||||
_G._packer.inside_compile = false
|
||||
if _G._packer.needs_bufread == true then
|
||||
vim.cmd("doautocmd BufRead")
|
||||
end
|
||||
_G._packer.needs_bufread = false
|
||||
|
||||
if should_profile then save_profiles() end
|
||||
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user