packer_compiled.lua 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. -- Automatically generated packer.nvim plugin loader code
  2. if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then
  3. vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"')
  4. return
  5. end
  6. vim.api.nvim_command('packadd packer.nvim')
  7. local no_errors, error_msg = pcall(function()
  8. _G._packer = _G._packer or {}
  9. _G._packer.inside_compile = true
  10. local time
  11. local profile_info
  12. local should_profile = false
  13. if should_profile then
  14. local hrtime = vim.loop.hrtime
  15. profile_info = {}
  16. time = function(chunk, start)
  17. if start then
  18. profile_info[chunk] = hrtime()
  19. else
  20. profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6
  21. end
  22. end
  23. else
  24. time = function(chunk, start) end
  25. end
  26. local function save_profiles(threshold)
  27. local sorted_times = {}
  28. for chunk_name, time_taken in pairs(profile_info) do
  29. sorted_times[#sorted_times + 1] = {chunk_name, time_taken}
  30. end
  31. table.sort(sorted_times, function(a, b) return a[2] > b[2] end)
  32. local results = {}
  33. for i, elem in ipairs(sorted_times) do
  34. if not threshold or threshold and elem[2] > threshold then
  35. results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms'
  36. end
  37. end
  38. if threshold then
  39. table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)')
  40. end
  41. _G._packer.profile_output = results
  42. end
  43. time([[Luarocks path setup]], true)
  44. local package_path_str = "/Users/sdaduanbilei/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/Users/sdaduanbilei/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/Users/sdaduanbilei/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/Users/sdaduanbilei/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
  45. local install_cpath_pattern = "/Users/sdaduanbilei/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so"
  46. if not string.find(package.path, package_path_str, 1, true) then
  47. package.path = package.path .. ';' .. package_path_str
  48. end
  49. if not string.find(package.cpath, install_cpath_pattern, 1, true) then
  50. package.cpath = package.cpath .. ';' .. install_cpath_pattern
  51. end
  52. time([[Luarocks path setup]], false)
  53. time([[try_loadstring definition]], true)
  54. local function try_loadstring(s, component, name)
  55. local success, result = pcall(loadstring(s), name, _G.packer_plugins[name])
  56. if not success then
  57. vim.schedule(function()
  58. vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {})
  59. end)
  60. end
  61. return result
  62. end
  63. time([[try_loadstring definition]], false)
  64. time([[Defining packer_plugins]], true)
  65. _G.packer_plugins = {
  66. ["dashboard-nvim"] = {
  67. loaded = false,
  68. needs_bufread = false,
  69. only_cond = false,
  70. path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/opt/dashboard-nvim",
  71. url = "https://github.com/glepnir/dashboard-nvim"
  72. },
  73. ["lualine.nvim"] = {
  74. loaded = true,
  75. path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/lualine.nvim",
  76. url = "https://github.com/nvim-lualine/lualine.nvim"
  77. },
  78. ["nvim-tree.lua"] = {
  79. loaded = true,
  80. path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/nvim-tree.lua",
  81. url = "https://github.com/kyazdani42/nvim-tree.lua"
  82. },
  83. ["nvim-treesitter"] = {
  84. loaded = true,
  85. path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
  86. url = "https://github.com/nvim-treesitter/nvim-treesitter"
  87. },
  88. ["nvim-web-devicons"] = {
  89. loaded = false,
  90. needs_bufread = false,
  91. path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/opt/nvim-web-devicons",
  92. url = "https://github.com/nvim-tree/nvim-web-devicons"
  93. },
  94. ["packer.nvim"] = {
  95. loaded = true,
  96. path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/packer.nvim",
  97. url = "https://github.com/wbthomason/packer.nvim"
  98. },
  99. ["plenary.nvim"] = {
  100. loaded = true,
  101. path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/plenary.nvim",
  102. url = "https://github.com/nvim-lua/plenary.nvim"
  103. },
  104. ["project.nvim"] = {
  105. loaded = true,
  106. path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/project.nvim",
  107. url = "https://github.com/ahmedkhalf/project.nvim"
  108. },
  109. ["telescope.nvim"] = {
  110. loaded = true,
  111. path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/telescope.nvim",
  112. url = "https://github.com/nvim-telescope/telescope.nvim"
  113. },
  114. ["tokyonight.nvim"] = {
  115. loaded = true,
  116. path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/tokyonight.nvim",
  117. url = "https://github.com/folke/tokyonight.nvim"
  118. }
  119. }
  120. time([[Defining packer_plugins]], false)
  121. vim.cmd [[augroup packer_load_aucmds]]
  122. vim.cmd [[au!]]
  123. -- Event lazy-loads
  124. time([[Defining lazy-load event autocommands]], true)
  125. vim.cmd [[au VimEnter * ++once lua require("packer.load")({'dashboard-nvim'}, { event = "VimEnter *" }, _G.packer_plugins)]]
  126. time([[Defining lazy-load event autocommands]], false)
  127. vim.cmd("augroup END")
  128. _G._packer.inside_compile = false
  129. if _G._packer.needs_bufread == true then
  130. vim.cmd("doautocmd BufRead")
  131. end
  132. _G._packer.needs_bufread = false
  133. if should_profile then save_profiles() end
  134. end)
  135. if not no_errors then
  136. error_msg = error_msg:gsub('"', '\\"')
  137. vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None')
  138. end