sync
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
|
||||
|
||||
@@ -104,6 +109,11 @@ _G.packer_plugins = {
|
||||
path = "/home/alican/.local/share/nvim/site/pack/packer/start/friendly-snippets",
|
||||
url = "https://github.com/rafamadriz/friendly-snippets"
|
||||
},
|
||||
["git-blame.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/alican/.local/share/nvim/site/pack/packer/start/git-blame.nvim",
|
||||
url = "https://github.com/f-person/git-blame.nvim"
|
||||
},
|
||||
["gitsigns.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/alican/.local/share/nvim/site/pack/packer/start/gitsigns.nvim",
|
||||
@@ -119,6 +129,13 @@ _G.packer_plugins = {
|
||||
path = "/home/alican/.local/share/nvim/site/pack/packer/start/lualine.nvim",
|
||||
url = "https://github.com/nvim-lualine/lualine.nvim"
|
||||
},
|
||||
["markdown-preview.nvim"] = {
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/alican/.local/share/nvim/site/pack/packer/opt/markdown-preview.nvim",
|
||||
url = "https://github.com/iamcco/markdown-preview.nvim"
|
||||
},
|
||||
["null-ls.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/alican/.local/share/nvim/site/pack/packer/start/null-ls.nvim",
|
||||
@@ -149,6 +166,11 @@ _G.packer_plugins = {
|
||||
path = "/home/alican/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
|
||||
url = "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
["oxocarbon.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/alican/.local/share/nvim/site/pack/packer/start/oxocarbon.nvim",
|
||||
url = "https://github.com/shaunsingh/oxocarbon.nvim"
|
||||
},
|
||||
["packer.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/alican/.local/share/nvim/site/pack/packer/start/packer.nvim",
|
||||
@@ -173,10 +195,33 @@ _G.packer_plugins = {
|
||||
loaded = true,
|
||||
path = "/home/alican/.local/share/nvim/site/pack/packer/start/toggleterm.nvim",
|
||||
url = "https://github.com/akinsho/toggleterm.nvim"
|
||||
},
|
||||
["vim-fugitive"] = {
|
||||
loaded = true,
|
||||
path = "/home/alican/.local/share/nvim/site/pack/packer/start/vim-fugitive",
|
||||
url = "https://github.com/tpope/vim-fugitive"
|
||||
}
|
||||
}
|
||||
|
||||
time([[Defining packer_plugins]], false)
|
||||
-- Setup for: markdown-preview.nvim
|
||||
time([[Setup for markdown-preview.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n=\0\0\2\0\4\0\0056\0\0\0009\0\1\0005\1\3\0=\1\2\0K\0\1\0\1\2\0\0\rmarkdown\19mkdp_filetypes\6g\bvim\0", "setup", "markdown-preview.nvim")
|
||||
time([[Setup for markdown-preview.nvim]], false)
|
||||
vim.cmd [[augroup packer_load_aucmds]]
|
||||
vim.cmd [[au!]]
|
||||
-- Filetype lazy-loads
|
||||
time([[Defining lazy-load filetype autocommands]], true)
|
||||
vim.cmd [[au FileType markdown ++once lua require("packer.load")({'markdown-preview.nvim'}, { ft = "markdown" }, _G.packer_plugins)]]
|
||||
time([[Defining lazy-load filetype autocommands]], false)
|
||||
vim.cmd("augroup END")
|
||||
|
||||
_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