-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
119 lines (111 loc) · 2.96 KB
/
init.lua
File metadata and controls
119 lines (111 loc) · 2.96 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
local path_package = vim.fn.stdpath("data") .. "/site/"
local mini_path = path_package .. "pack/deps/start/mini.nvim"
if not vim.uv.fs_stat(mini_path) then
vim.cmd('echo "Installing `mini.nvim`" | redraw')
local clone_cmd = {
"git",
"clone",
"--filter=blob:none",
"https://github.com/nvim-mini/mini.nvim",
mini_path,
}
vim.fn.system(clone_cmd)
vim.cmd("packadd mini.nvim | helptags ALL")
vim.cmd('echo "Installed `mini.nvim`" | redraw')
end
if vim.loader then
vim.loader.enable()
end
MiniDeps = require("mini.deps")
MiniDeps.setup({ path = { package = path_package } })
local add, now, later = MiniDeps.add, MiniDeps.now, MiniDeps.later
package.path = package.path
.. ";"
.. vim.g.config_dir
.. "?.lua;"
.. vim.g.config_dir
.. "?/init.lua"
-- control if all vim plugins to be loaded now - only for Plugin Sync and Update
if LoadVimPlugin == nil then
LoadVimPlugin = false
end
local add_vim_plugin = function(value)
if type(value) == "table" then
add({ source = value[1], name = value[2] })
else
add({ source = value })
end
end
local vim_now_index = 4
-- deps now: UI & early utilities
now(function()
if LoadVimPlugin then
for _, value in ipairs(vim.g.vim_plugin) do
add_vim_plugin(value)
end
end
-- vim plugins, StartupTime
for index, value in ipairs(vim.g.share_plugin) do
if index <= vim_now_index then
add_vim_plugin(value)
end
end
add({ source = "folke/snacks.nvim" })
add({ source = "thesimonho/kanagawa-paper.nvim" })
require("lua.now_mini")
require("lua.now_config")
end)
-- deps later: utilities
later(function()
-- vim plugins
for index, value in ipairs(vim.g.share_plugin) do
if index > vim_now_index then
add_vim_plugin(value)
end
end
-- nvim plugins
add({ source = "https://codeberg.org/andyg/leap.nvim" })
add({ source = "monaqa/dial.nvim" })
require("lua.univ_config")
if vim.g.vscode == nil then
require("lua.utils_config")
end
end)
if vim.g.vscode == nil then
-- deps later: lsp, iron and treesitter
later(function()
add({
source = "saghen/blink.cmp",
depends = {
"echaya/friendly-snippets",
},
checkout = "v1.8.0",
})
add({
source = "nvim-treesitter/nvim-treesitter",
checkout = "main",
hooks = {
post_checkout = function()
vim.cmd("TSUpdate")
end,
},
})
add({ source = "nvim-treesitter/nvim-treesitter-context" })
require("lua.lsp_config")
end)
end
-- deps later: programming tools
later(function()
if vim.g.vscode == nil then
add({ source = "milanglacier/yarepl.nvim" })
add({ source = "echaya/neowiki.nvim", checkout = "dev" })
-- add({ source = "NStefan002/screenkey.nvim" })
add({ source = "esmuellert/codediff.nvim" })
add({ source = "MeanderingProgrammer/render-markdown.nvim" })
require("lua.code_config")
require("lua.repl_config")
require("lua.git_config")
else
require("lua.vscode_config")
end
end)