@@ -9,23 +9,26 @@ vim.api.nvim_command('packadd packer.nvim')
9
9
10
10
local no_errors , error_msg = pcall (function ()
11
11
12
- local time
13
- local profile_info
14
- local should_profile = false
15
- if should_profile then
16
- local hrtime = vim .loop .hrtime
17
- profile_info = {}
18
- time = function (chunk , start )
19
- if start then
20
- profile_info [chunk ] = hrtime ()
21
- else
22
- profile_info [chunk ] = (hrtime () - profile_info [chunk ]) / 1e6
23
- end
12
+ _G ._packer = _G ._packer or {}
13
+ _G ._packer .inside_compile = true
14
+
15
+ local time
16
+ local profile_info
17
+ local should_profile = false
18
+ if should_profile then
19
+ local hrtime = vim .loop .hrtime
20
+ profile_info = {}
21
+ time = function (chunk , start )
22
+ if start then
23
+ profile_info [chunk ] = hrtime ()
24
+ else
25
+ profile_info [chunk ] = (hrtime () - profile_info [chunk ]) / 1e6
24
26
end
25
- else
26
- time = function (chunk , start ) end
27
27
end
28
-
28
+ else
29
+ time = function (chunk , start ) end
30
+ end
31
+
29
32
local function save_profiles (threshold )
30
33
local sorted_times = {}
31
34
for chunk_name , time_taken in pairs (profile_info ) do
@@ -38,14 +41,16 @@ local function save_profiles(threshold)
38
41
results [i ] = elem [1 ] .. ' took ' .. elem [2 ] .. ' ms'
39
42
end
40
43
end
44
+ if threshold then
45
+ table.insert (results , ' (Only showing plugins that took longer than ' .. threshold .. ' ms ' .. ' to load)' )
46
+ end
41
47
42
- _G ._packer = _G ._packer or {}
43
48
_G ._packer .profile_output = results
44
49
end
45
50
46
51
time ([[ Luarocks path setup]] , true )
47
- local package_path_str = " /Users/cj/.cache/nvim/packer_hererocks/2.1.0-beta3 /share/lua/5.1/?.lua;/Users/cj/.cache/nvim/packer_hererocks/2.1.0-beta3 /share/lua/5.1/?/init.lua;/Users/cj/.cache/nvim/packer_hererocks/2.1.0-beta3 /lib/luarocks/rocks-5.1/?.lua;/Users/cj/.cache/nvim/packer_hererocks/2.1.0-beta3 /lib/luarocks/rocks-5.1/?/init.lua"
48
- local install_cpath_pattern = " /Users/cj/.cache/nvim/packer_hererocks/2.1.0-beta3 /lib/lua/5.1/?.so"
52
+ local package_path_str = " /Users/cj/.cache/nvim/packer_hererocks/2.1.1700008891 /share/lua/5.1/?.lua;/Users/cj/.cache/nvim/packer_hererocks/2.1.1700008891 /share/lua/5.1/?/init.lua;/Users/cj/.cache/nvim/packer_hererocks/2.1.1700008891 /lib/luarocks/rocks-5.1/?.lua;/Users/cj/.cache/nvim/packer_hererocks/2.1.1700008891 /lib/luarocks/rocks-5.1/?/init.lua"
53
+ local install_cpath_pattern = " /Users/cj/.cache/nvim/packer_hererocks/2.1.1700008891 /lib/lua/5.1/?.so"
49
54
if not string.find (package.path , package_path_str , 1 , true ) then
50
55
package.path = package.path .. ' ;' .. package_path_str
51
56
end
@@ -105,7 +110,7 @@ _G.packer_plugins = {
105
110
url = " https://github.com/github/copilot.vim"
106
111
},
107
112
[" gitsigns.nvim" ] = {
108
- config = { " \27 LJ\2 \n —\4\0\0\5\0\16\0\019 6\0\0\0 '\2\1\0 B\0\2\002 9\0\2\000 5\2\14\000 5\3\4\000 5\4\3\0 =\4\5\003 5\4\6\0 =\4 \a \003 5\4 \b \0 =\4 \t \003 5\4 \n \0 =\4 \v \003 5\4 \f \0 =\4 \r \3 =\3\15\2 B\0\2\1 K\0\1\0 \n signs\1\0\0\17 changedelete\1\0\4 \t text \b â– \n numhl\21 GitSignsChangeNr\a hl \19 GitSignsChange \v linehl\21 GitSignsChangeLn\14 topdelete\1\0\4 \t text \b â– \n numhl\21 GitSignsDeleteNr\a hl \19 GitSignsDelete \v linehl\21 GitSignsDeleteLn\v delete\1\0\4 \t text \b â– \n numhl\21 GitSignsDeleteNr\a hl \19 GitSignsDelete \v linehl\21 GitSignsDeleteLn\v change\1\0\4 \t text \b â– \n numhl\21 GitSignsChangeNr\a hl \19 GitSignsChange \v linehl\21 GitSignsChangeLn\b add\1\0\0\1\0\4 \t text \b â– \n numhl\18 GitSignsAddNr\a hl \16 GitSignsAdd \v linehl\18 GitSignsAddLn\n setup\r gitsigns\f require\0 " },
113
+ config = { " \27 LJ\2 \n —\4\0\0\5\0\16\0\019 6\0\0\0 '\2\1\0 B\0\2\002 9\0\2\000 5\2\14\000 5\3\4\000 5\4\3\0 =\4\5\003 5\4\6\0 =\4 \a \003 5\4 \b \0 =\4 \t \003 5\4 \n \0 =\4 \v \003 5\4 \f \0 =\4 \r \3 =\3\15\2 B\0\2\1 K\0\1\0 \n signs\1\0\0\17 changedelete\1\0\4 \a hl \19 GitSignsChange \n numhl\21 GitSignsChangeNr\t text \b â– \v linehl\21 GitSignsChangeLn\14 topdelete\1\0\4 \a hl \19 GitSignsDelete \n numhl\21 GitSignsDeleteNr\t text \b â– \v linehl\21 GitSignsDeleteLn\v delete\1\0\4 \a hl \19 GitSignsDelete \n numhl\21 GitSignsDeleteNr\t text \b â– \v linehl\21 GitSignsDeleteLn\v change\1\0\4 \a hl \19 GitSignsChange \n numhl\21 GitSignsChangeNr\t text \b â– \v linehl\21 GitSignsChangeLn\b add\1\0\0\1\0\4 \a hl \16 GitSignsAdd \n numhl\18 GitSignsAddNr\t text \b â– \v linehl\18 GitSignsAddLn\n setup\r gitsigns\f require\0 " },
109
114
loaded = true ,
110
115
path = " /Users/cj/.local/share/nvim/site/pack/packer/start/gitsigns.nvim" ,
111
116
url = " https://github.com/lewis6991/gitsigns.nvim"
@@ -180,8 +185,15 @@ _G.packer_plugins = {
180
185
time ([[ Defining packer_plugins]] , false )
181
186
-- Config for: gitsigns.nvim
182
187
time ([[ Config for gitsigns.nvim]] , true )
183
- try_loadstring (" \27 LJ\2 \n —\4\0\0\5\0\16\0\019 6\0\0\0 '\2\1\0 B\0\2\002 9\0\2\000 5\2\14\000 5\3\4\000 5\4\3\0 =\4\5\003 5\4\6\0 =\4 \a \003 5\4 \b \0 =\4 \t \003 5\4 \n \0 =\4 \v \003 5\4 \f \0 =\4 \r \3 =\3\15\2 B\0\2\1 K\0\1\0 \n signs\1\0\0\17 changedelete\1\0\4 \t text \b â– \n numhl\21 GitSignsChangeNr\a hl \19 GitSignsChange \v linehl\21 GitSignsChangeLn\14 topdelete\1\0\4 \t text \b â– \n numhl\21 GitSignsDeleteNr\a hl \19 GitSignsDelete \v linehl\21 GitSignsDeleteLn\v delete\1\0\4 \t text \b â– \n numhl\21 GitSignsDeleteNr\a hl \19 GitSignsDelete \v linehl\21 GitSignsDeleteLn\v change\1\0\4 \t text \b â– \n numhl\21 GitSignsChangeNr\a hl \19 GitSignsChange \v linehl\21 GitSignsChangeLn\b add\1\0\0\1\0\4 \t text \b â– \n numhl\18 GitSignsAddNr\a hl \16 GitSignsAdd \v linehl\18 GitSignsAddLn\n setup\r gitsigns\f require\0 " , " config" , " gitsigns.nvim" )
188
+ try_loadstring (" \27 LJ\2 \n —\4\0\0\5\0\16\0\019 6\0\0\0 '\2\1\0 B\0\2\002 9\0\2\000 5\2\14\000 5\3\4\000 5\4\3\0 =\4\5\003 5\4\6\0 =\4 \a \003 5\4 \b \0 =\4 \t \003 5\4 \n \0 =\4 \v \003 5\4 \f \0 =\4 \r \3 =\3\15\2 B\0\2\1 K\0\1\0 \n signs\1\0\0\17 changedelete\1\0\4 \a hl \19 GitSignsChange \n numhl\21 GitSignsChangeNr\t text \b â– \v linehl\21 GitSignsChangeLn\14 topdelete\1\0\4 \a hl \19 GitSignsDelete \n numhl\21 GitSignsDeleteNr\t text \b â– \v linehl\21 GitSignsDeleteLn\v delete\1\0\4 \a hl \19 GitSignsDelete \n numhl\21 GitSignsDeleteNr\t text \b â– \v linehl\21 GitSignsDeleteLn\v change\1\0\4 \a hl \19 GitSignsChange \n numhl\21 GitSignsChangeNr\t text \b â– \v linehl\21 GitSignsChangeLn\b add\1\0\0\1\0\4 \a hl \16 GitSignsAdd \n numhl\18 GitSignsAddNr\t text \b â– \v linehl\18 GitSignsAddLn\n setup\r gitsigns\f require\0 " , " config" , " gitsigns.nvim" )
184
189
time ([[ Config for gitsigns.nvim]] , false )
190
+
191
+ _G ._packer .inside_compile = false
192
+ if _G ._packer .needs_bufread == true then
193
+ vim .cmd (" doautocmd BufRead" )
194
+ end
195
+ _G ._packer .needs_bufread = false
196
+
185
197
if should_profile then save_profiles () end
186
198
187
199
end )
0 commit comments