-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
54 lines (44 loc) · 1.46 KB
/
init.lua
File metadata and controls
54 lines (44 loc) · 1.46 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
local PACK_PATH = vim.fn.stdpath "data" .. "/site/pack"
local function ensure(repo, kind)
kind = kind or "opt"
local name = vim.split(repo, "/")[2]
local destination = string.format("%s/packer/%s/%s", PACK_PATH, kind, name)
if vim.fn.empty(vim.fn.glob(destination)) > 0 then
vim.notify("GIO: auto-installing " .. repo .. "...")
vim.fn.system {
"git",
"clone",
"--depth",
"1",
"https://github.com/" .. repo,
destination,
}
if vim.v.shell_error ~= 0 then
vim.notify("GIO: failed to install " .. repo .. "...", vim.log.levels.ERROR)
else
vim.notify("GIO: installed " .. repo .. "!")
end
end
end
local function is_installed(name, kind)
kind = kind or "opt"
return vim.fn.empty(vim.fn.glob(string.format("%s/packer/%s/%s", PACK_PATH, kind, name))) == 0
end
vim.opt.loadplugins = false
vim.opt.shadafile = "NONE"
vim.api.nvim_command "syntax off"
vim.api.nvim_command "filetype off"
vim.api.nvim_command "filetype plugin indent off"
-- TODO: auto-determine this one
pcall(require, "modules.colors.kanagawa")
vim.defer_fn(function()
vim.api.nvim_command "runtime! plugin/**/*.vim"
vim.api.nvim_command "runtime! plugin/**/*.lua"
vim.api.nvim_command "syntax on"
vim.api.nvim_command "filetype on"
vim.api.nvim_command "filetype plugin indent on"
ensure "wbthomason/packer.nvim"
vim.api.nvim_command "packadd packer.nvim"
require "composer"
vim.api.nvim_exec_autocmds("BufEnter", {})
end, 0)