1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
" Automatically generated packer.nvim plugin loader code
if !has('nvim')
finish
endif
lua << END
local plugins = {
["emmet-vim"] = {
loaded = false,
only_sequence = false,
only_setup = false,
path = "/home/robert/.local/share/nvim/site/pack/packer/opt/emmet-vim"
},
["goyo.vim"] = {
commands = { "Goyo" },
loaded = false,
only_sequence = false,
only_setup = false,
path = "/home/robert/.local/share/nvim/site/pack/packer/opt/goyo.vim"
},
["limelight.vim"] = {
commands = { "Limelight" },
loaded = false,
only_sequence = false,
only_setup = false,
path = "/home/robert/.local/share/nvim/site/pack/packer/opt/limelight.vim"
},
["vim-easy-align"] = {
commands = { "EasyAlign" },
loaded = false,
only_sequence = false,
only_setup = false,
path = "/home/robert/.local/share/nvim/site/pack/packer/opt/vim-easy-align"
},
["vim-markdown"] = {
loaded = false,
only_sequence = false,
only_setup = false,
path = "/home/robert/.local/share/nvim/site/pack/packer/opt/vim-markdown"
},
["vim-markdown-folding"] = {
loaded = false,
only_sequence = false,
only_setup = false,
path = "/home/robert/.local/share/nvim/site/pack/packer/opt/vim-markdown-folding"
},
vimtex = {
loaded = false,
only_sequence = false,
only_setup = false,
path = "/home/robert/.local/share/nvim/site/pack/packer/opt/vimtex"
}
}
local function handle_bufread(names)
for _, name in ipairs(names) do
local path = plugins[name].path
for _, dir in ipairs({ 'ftdetect', 'ftplugin', 'after/ftdetect', 'after/ftplugin' }) do
if #vim.fn.finddir(dir, path) > 0 then
vim.cmd('doautocmd BufRead')
return
end
end
end
end
_packer_load = nil
local function handle_after(name, before)
local plugin = plugins[name]
plugin.load_after[before] = nil
if next(plugin.load_after) == nil then
_packer_load({name}, {})
end
end
_packer_load = function(names, cause)
local some_unloaded = false
for _, name in ipairs(names) do
if not plugins[name].loaded then
some_unloaded = true
break
end
end
if not some_unloaded then return end
local fmt = string.format
local del_cmds = {}
local del_maps = {}
for _, name in ipairs(names) do
if plugins[name].commands then
for _, cmd in ipairs(plugins[name].commands) do
del_cmds[cmd] = true
end
end
if plugins[name].keys then
for _, key in ipairs(plugins[name].keys) do
del_maps[key] = true
end
end
end
for cmd, _ in pairs(del_cmds) do
vim.cmd('silent! delcommand ' .. cmd)
end
for key, _ in pairs(del_maps) do
vim.cmd(fmt('silent! %sunmap %s', key[1], key[2]))
end
for _, name in ipairs(names) do
if not plugins[name].loaded then
vim.cmd('packadd ' .. name)
if plugins[name].config then
for _i, config_line in ipairs(plugins[name].config) do
loadstring(config_line)()
end
end
if plugins[name].after then
for _, after_name in ipairs(plugins[name].after) do
handle_after(after_name, name)
vim.cmd('redraw')
end
end
plugins[name].loaded = true
end
end
handle_bufread(names)
if cause.cmd then
local lines = cause.l1 == cause.l2 and '' or (cause.l1 .. ',' .. cause.l2)
vim.cmd(fmt('%s%s%s %s', lines, cause.cmd, cause.bang, cause.args))
elseif cause.keys then
local keys = cause.keys
local extra = ''
while true do
local c = vim.fn.getchar(0)
if c == 0 then break end
extra = extra .. vim.fn.nr2char(c)
end
if cause.prefix then
local prefix = vim.v.count and vim.v.count or ''
prefix = prefix .. '"' .. vim.v.register .. cause.prefix
if vim.fn.mode('full') == 'no' then
if vim.v.operator == 'c' then
prefix = '' .. prefix
end
prefix = prefix .. vim.v.operator
end
vim.fn.feedkeys(prefix, 'n')
end
-- NOTE: I'm not sure if the below substitution is correct; it might correspond to the literal
-- characters \<Plug> rather than the special <Plug> key.
vim.fn.feedkeys(string.gsub(string.gsub(cause.keys, '^<Plug>', '\\<Plug>') .. extra, '<[cC][rR]>', '\r'))
elseif cause.event then
vim.cmd(fmt('doautocmd <nomodeline> %s', cause.event))
elseif cause.ft then
vim.cmd(fmt('doautocmd <nomodeline> %s FileType %s', 'filetypeplugin', cause.ft))
vim.cmd(fmt('doautocmd <nomodeline> %s FileType %s', 'filetypeindent', cause.ft))
end
end
-- Runtimepath customization
-- Pre-load configuration
-- Post-load configuration
-- Config for: nvim-treesitter
loadstring("\27LJ\1\2/\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\20conf.treesitter\frequire\0")()
-- Config for: nvim-colorizer.lua
loadstring("\27LJ\1\2z\0\0\3\0\4\0\b4\0\0\0%\1\1\0>\0\2\0027\0\2\0)\1\0\0003\2\3\0>\0\3\1G\0\1\0\1\0\6\vrgb_fn\2\tname\2\rRRGGBBAA\1\vhsl_fn\2\tmode\15background\vRRGGBB\2\nsetup\14colorizer\frequire\0")()
-- Config for: galaxyline.nvim
loadstring("\27LJ\1\2$\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\tline\frequire\0")()
-- Config for: nvim-lspconfig
loadstring("\27LJ\1\2(\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\rconf.lsp\frequire\0")()
-- Config for: telescope.nvim
loadstring("\27LJ\1\2.\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\19conf.telescope\frequire\0")()
-- Conditional loads
-- Load plugins in order defined by `after`
END
function! s:load(names, cause) abort
call luaeval('_packer_load(_A[1], _A[2])', [a:names, a:cause])
endfunction
" Command lazy-loads
command! -nargs=* -range -bang -complete=file Goyo call s:load(['goyo.vim'], { "cmd": "Goyo", "l1": <line1>, "l2": <line2>, "bang": <q-bang>, "args": <q-args> })
command! -nargs=* -range -bang -complete=file Limelight call s:load(['limelight.vim'], { "cmd": "Limelight", "l1": <line1>, "l2": <line2>, "bang": <q-bang>, "args": <q-args> })
command! -nargs=* -range -bang -complete=file EasyAlign call s:load(['vim-easy-align'], { "cmd": "EasyAlign", "l1": <line1>, "l2": <line2>, "bang": <q-bang>, "args": <q-args> })
" Keymap lazy-loads
augroup packer_load_aucmds
au!
" Filetype lazy-loads
au FileType markdown ++once call s:load(['vim-markdown', 'vim-markdown-folding'], { "ft": "markdown" })
au FileType html ++once call s:load(['emmet-vim'], { "ft": "html" })
au FileType latex ++once call s:load(['vimtex'], { "ft": "latex" })
au FileType tex ++once call s:load(['vimtex'], { "ft": "tex" })
" Event lazy-loads
augroup END
|