-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.lua
39 lines (34 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
38
39
-- Check if Neovim version is sufficient
if vim.fn.has("nvim-0.9.2") == 0 then
error("Need Neovim 0.9.2+ in order to use this config")
end
-- Define required commands
local required_commands = {
"git", -- Required by mason and to bootstrap lazy.nvim
"curl", -- Required by mason
"unzip", -- Required by mason
"tar", -- Required by mason
"gzip", -- Required by mason
"npm", -- Required by mason to install packages
"rg", -- Ripgrep required by telescope
"lazygit", -- Required by lazygit plugin
}
-- Check if required programs are installed
for _, command in ipairs(required_commands) do
local name = type(command) == "string" and command or vim.inspect(command)
local commands = type(command) == "string" and { command } or command
---@cast commands string[]
local found = false
for _, cmd in ipairs(commands) do
if vim.fn.executable(cmd) == 1 then
name = cmd
found = true
end
end
if not found then
error(("`%s` is not installed"):format(name))
end
end
-- Load core config and lazy.nvim
require("tomhesse.core")
require("tomhesse.lazy")