-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinit.lua
More file actions
102 lines (93 loc) · 2.16 KB
/
Copy pathinit.lua
File metadata and controls
102 lines (93 loc) · 2.16 KB
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
local cmd = vim.cmd
local fn = vim.fn
local api = vim.api
-- Global object
_G.NVMM = {}
local packer_bootstrap = false -- Indicate first time installation
-- packer.nvim configuration
local conf = {
profile = {
enable = true,
threshold = 0, -- the amount in ms that a plugins load time must be over for it to be included in the profile
},
display = {
open_fn = function()
return require("packer.util").float({ border = "rounded" })
end,
},
}
local function packer_init()
-- Check if packer.nvim is installed
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
if fn.empty(fn.glob(install_path)) > 0 then
packer_bootstrap = fn.system({
"git",
"clone",
"--depth",
"1",
"https://github.com/wbthomason/packer.nvim",
install_path,
})
cmd([[packadd packer.nvim]])
end
-- Run PackerCompile if there are changes in this file
local packerGrp = api.nvim_create_augroup("packer_user_config", { clear = true })
api.nvim_create_autocmd(
{ "BufWritePost" },
{ pattern = "init.lua", command = "source <afile> | PackerCompile", group = packerGrp }
)
end
-- Plugins
local function plugins(use)
use({ "wbthomason/packer.nvim" })
use({ "kyazdani42/nvim-web-devicons" })
use({ "nvim-lua/plenary.nvim" })
use({
"TimUntersberger/neogit",
cmd = { "Neogit" },
config = function()
require("neogit").setup({})
end,
})
use({
"echasnovski/mini.nvim",
config = function()
require("config.mini")
end,
})
use({
"neovim/nvim-lspconfig",
event = "BufReadPre",
requires = {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
{
"L3MON4D3/LuaSnip",
config = function()
require("config.luasnip")
end,
},
},
config = function()
require("config.lsp")
end,
})
use({
"nvim-treesitter/nvim-treesitter",
run = ":TSUpdate",
config = function()
require("config.treesitter")
end,
})
use({ "nvim-treesitter/playground" })
-- Bootstrap Neovim
if packer_bootstrap then
print("Neovim restart is required after installation!")
require("packer").sync()
end
end
-- packer.nvim
packer_init()
local packer = require("packer")
packer.init(conf)
packer.startup(plugins)