-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.lua
37 lines (31 loc) · 1.13 KB
/
init.lua
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
-- Use impatient.nvim to load Lua modules faster
local cmd = vim.cmd
-- Configuration to load after loading plugins
local function load_post_plugin_config()
require('plugins')
require('impatient') -- Use impatient.nvim to load Lua modules faster
require('settings')
require('keybinds')
require('config')
end
-- If Packer is not installed, download it and all plugins and reload config
-- If Packer is installed, load configuration as usual
local packer_install_path = vim.fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if vim.fn.isdirectory(packer_install_path) == 0 then
-- Download Packer and add it
cmd('!git clone https://github.com/wbthomason/packer.nvim ' .. packer_install_path)
cmd('packadd packer.nvim')
-- Load plugins
require('plugins')
-- Automatically sync packer and load the rest of the config
cmd('PackerSync')
require('utils').create_augroup({
{
event = 'User PackerComplete',
opts = { once = true, callback = load_post_plugin_config }
}
}, 'load_post_plugin_config')
else
require('plugins')
load_post_plugin_config()
end