diff options
Diffstat (limited to '.vim/plugin/packer_compiled.vim')
| -rw-r--r-- | .vim/plugin/packer_compiled.vim | 116 |
1 files changed, 96 insertions, 20 deletions
diff --git a/.vim/plugin/packer_compiled.vim b/.vim/plugin/packer_compiled.vim index 6e796b8..19c1df9 100644 --- a/.vim/plugin/packer_compiled.vim +++ b/.vim/plugin/packer_compiled.vim @@ -12,6 +12,41 @@ packadd packer.nvim try lua << END + 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 + 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 + sorted_times[#sorted_times + 1] = {chunk_name, time_taken} + end + table.sort(sorted_times, function(a, b) return a[2] > b[2] end) + local results = {} + for i, elem in ipairs(sorted_times) do + if not threshold or threshold and elem[2] > threshold then + results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms' + end + end + + _G._packer = _G._packer or {} + _G._packer.profile_output = results +end + +time("Luarocks path setup", true) local package_path_str = "/tmp/robert/.cache/nvim/packer_hererocks/2.0.5/share/lua/5.1/?.lua;/tmp/robert/.cache/nvim/packer_hererocks/2.0.5/share/lua/5.1/?/init.lua;/tmp/robert/.cache/nvim/packer_hererocks/2.0.5/lib/luarocks/rocks-5.1/?.lua;/tmp/robert/.cache/nvim/packer_hererocks/2.0.5/lib/luarocks/rocks-5.1/?/init.lua" local install_cpath_pattern = "/tmp/robert/.cache/nvim/packer_hererocks/2.0.5/lib/lua/5.1/?.so" if not string.find(package.path, package_path_str, 1, true) then @@ -22,6 +57,8 @@ if not string.find(package.cpath, install_cpath_pattern, 1, true) then package.cpath = package.cpath .. ';' .. install_cpath_pattern end +time("Luarocks path setup", false) +time("try_loadstring definition", true) local function try_loadstring(s, component, name) local success, result = pcall(loadstring(s)) if not success then @@ -31,6 +68,8 @@ local function try_loadstring(s, component, name) return result end +time("try_loadstring definition", false) +time("Defining packer_plugins", true) _G.packer_plugins = { ["astronauta.nvim"] = { loaded = true, @@ -49,6 +88,11 @@ _G.packer_plugins = { loaded = true, path = "/home/robert/.local/share/nvim/site/pack/packer/start/completion-treesitter" }, + ["editorconfig-vim"] = { + config = { "require('plugins._editorconfig')" }, + loaded = true, + path = "/home/robert/.local/share/nvim/site/pack/packer/start/editorconfig-vim" + }, ["gentoo-syntax"] = { loaded = true, path = "/home/robert/.local/share/nvim/site/pack/packer/start/gentoo-syntax" @@ -85,10 +129,8 @@ _G.packer_plugins = { path = "/home/robert/.local/share/nvim/site/pack/packer/start/neoformat" }, neogit = { - commands = { "Neogit" }, - loaded = false, - needs_bufread = true, - path = "/home/robert/.local/share/nvim/site/pack/packer/opt/neogit" + loaded = true, + path = "/home/robert/.local/share/nvim/site/pack/packer/start/neogit" }, ["neuron.nvim"] = { config = { "require('.plugins._neuron')" }, @@ -162,10 +204,6 @@ _G.packer_plugins = { loaded = true, path = "/home/robert/.local/share/nvim/site/pack/packer/start/vim-easy-align" }, - ["vim-editorconfig"] = { - loaded = true, - path = "/home/robert/.local/share/nvim/site/pack/packer/start/vim-editorconfig" - }, ["vim-github-link"] = { loaded = true, path = "/home/robert/.local/share/nvim/site/pack/packer/start/vim-github-link" @@ -219,47 +257,85 @@ _G.packer_plugins = { } } +time("Defining packer_plugins", false) -- Config for: nvim-lightbulb +time("Config for nvim-lightbulb", true) require('plugins._lightbulb') +time("Config for nvim-lightbulb", false) +-- Config for: editorconfig-vim +time("Config for editorconfig-vim", true) +require('plugins._editorconfig') +time("Config for editorconfig-vim", false) +-- Config for: neuron.nvim +time("Config for neuron.nvim", true) +require('.plugins._neuron') +time("Config for neuron.nvim", false) +-- Config for: vim-sneak +time("Config for vim-sneak", true) +vim.g['sneak#label'] = true +time("Config for vim-sneak", false) -- Config for: completion-nvim +time("Config for completion-nvim", true) require('plugins._completion') +time("Config for completion-nvim", false) -- Config for: nvim-colorizer.lua +time("Config for nvim-colorizer.lua", true) require('plugins._colorizer') --- Config for: vim-sneak -vim.g['sneak#label'] = true --- Config for: nvim-treesitter -require('plugins._treesitter') --- Config for: nvim-lspconfig -require('plugins._lsp') +time("Config for nvim-colorizer.lua", false) +-- Config for: telescope.nvim +time("Config for telescope.nvim", true) +require('plugins._telescope') +time("Config for telescope.nvim", false) -- Config for: vim-signify +time("Config for vim-signify", true) require('plugins._signify') +time("Config for vim-signify", false) -- Config for: git-messenger.vim +time("Config for git-messenger.vim", true) require('plugins._git-messenger') --- Config for: telescope.nvim -require('plugins._telescope') +time("Config for git-messenger.vim", false) +-- Config for: nvim-treesitter +time("Config for nvim-treesitter", true) +require('plugins._treesitter') +time("Config for nvim-treesitter", false) -- Config for: ultisnips +time("Config for ultisnips", true) require('plugins._ultisnips') --- Config for: neuron.nvim -require('.plugins._neuron') +time("Config for ultisnips", false) +-- Config for: nvim-lspconfig +time("Config for nvim-lspconfig", true) +require('plugins._lsp') +time("Config for nvim-lspconfig", false) -- Command lazy-loads +time("Defining lazy-load commands", true) vim.cmd [[command! -nargs=* -range -bang -complete=file Goyo lua require("packer.load")({'goyo.vim'}, { cmd = "Goyo", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]] vim.cmd [[command! -nargs=* -range -bang -complete=file Limelight lua require("packer.load")({'limelight.vim'}, { cmd = "Limelight", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]] -vim.cmd [[command! -nargs=* -range -bang -complete=file Neogit lua require("packer.load")({'neogit'}, { cmd = "Neogit", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]] +time("Defining lazy-load commands", false) vim.cmd [[augroup packer_load_aucmds]] vim.cmd [[au!]] -- Filetype lazy-loads -vim.cmd [[au FileType markdown ++once lua require("packer.load")({'vim-markdown', 'vim-markdown-folding'}, { ft = "markdown" }, _G.packer_plugins)]] +time("Defining lazy-load filetype autocommands", true) +vim.cmd [[au FileType markdown ++once lua require("packer.load")({'vim-markdown-folding', 'vim-markdown'}, { ft = "markdown" }, _G.packer_plugins)]] vim.cmd [[au FileType cue ++once lua require("packer.load")({'vim-cue'}, { ft = "cue" }, _G.packer_plugins)]] vim.cmd [[au FileType latex ++once lua require("packer.load")({'vimtex'}, { ft = "latex" }, _G.packer_plugins)]] vim.cmd [[au FileType tex ++once lua require("packer.load")({'vimtex'}, { ft = "tex" }, _G.packer_plugins)]] +time("Defining lazy-load filetype autocommands", false) vim.cmd("augroup END") vim.cmd [[augroup filetypedetect]] +time("Sourcing ftdetect script at: /home/robert/.local/share/nvim/site/pack/packer/opt/vimtex/ftdetect/tex.vim", true) vim.cmd [[source /home/robert/.local/share/nvim/site/pack/packer/opt/vimtex/ftdetect/tex.vim]] +time("Sourcing ftdetect script at: /home/robert/.local/share/nvim/site/pack/packer/opt/vimtex/ftdetect/tex.vim", false) +time("Sourcing ftdetect script at: /home/robert/.local/share/nvim/site/pack/packer/opt/vim-markdown/ftdetect/markdown.vim", true) vim.cmd [[source /home/robert/.local/share/nvim/site/pack/packer/opt/vim-markdown/ftdetect/markdown.vim]] +time("Sourcing ftdetect script at: /home/robert/.local/share/nvim/site/pack/packer/opt/vim-markdown/ftdetect/markdown.vim", false) +time("Sourcing ftdetect script at: /home/robert/.local/share/nvim/site/pack/packer/opt/vim-cue/ftdetect/cue.vim", true) vim.cmd [[source /home/robert/.local/share/nvim/site/pack/packer/opt/vim-cue/ftdetect/cue.vim]] +time("Sourcing ftdetect script at: /home/robert/.local/share/nvim/site/pack/packer/opt/vim-cue/ftdetect/cue.vim", false) vim.cmd("augroup END") +if should_profile then save_profiles() end + END catch |