summaryrefslogtreecommitdiffstats
path: root/init.lua
blob: d89096ac715478e35e71e10475d50eef6da1ae8f (plain) (blame)
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
-- TODO: after switching to dep with lazy loading check out vim-startuptime
-- again

-- enable performance stuff
if vim.fn.has("nvim-0.9") == true then
  vim.loader.enable()
end

-- bootstrap plugin manager
local path = vim.fn.stdpath("data").."/site/pack/deps/opt/dep"
if vim.fn.empty(vim.fn.glob(path)) > 0 then
	vim.fn.system({ "git", "clone", "--depth=1", "https://git.squi.bid/dep",
    path })
end
vim.cmd("packadd dep")

-- load miscellaneous utilities
local misc = require("core.misc")

-- load user config
misc.include("conf.opts") -- setup options
misc.include("conf.binds") -- setup keybinds
misc.include("conf.autos") -- setup autos

-- load plugins
require("dep") {
  { "squibid/dep",
    url = "https://git.squi.bid/dep",
    branch = "dev"
  },

  load = function()
    -- aquire all plugin specs
    local plugs = {}

    for _, file in ipairs(vim.api.nvim_get_runtime_file(
      "lua/conf/plugins/*.lua", true)) do
      local ret = misc.include("conf.plugins."..file:gsub("^.*/",
        ""):gsub("%.lua$", ""))
      if type(ret) ~= "boolean" then
        plugs[#plugs + 1] = ret
      end
    end

    return plugs
  end
}