-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
74 lines (61 loc) · 1.93 KB
/
init.lua
File metadata and controls
74 lines (61 loc) · 1.93 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
-- Enable the experimental Lua module loader
vim.loader.enable()
local fn = vim.fn
local lazypath = fn.stdpath('data') .. '/lazy/lazy.nvim'
local os_utils = require('utilities.os')
local CheckConfigDeps
local LoadPlugins
-- Load settings and keybinds
require('settings')
require('keymaps')
--- Check if dependencies for Neovim config are installed before bootstrapping the config.
CheckConfigDeps = function()
-- Ensure that the OS is Windows, Mac or Linux.
if not os_utils.is_linux() and not os_utils.is_macos() and not os_utils.is_windows() then
error('Neovim configuration does not support the OS ' .. vim.uv.os_uname().sysname)
end
local deps = {
{ exe = 'rg', reason = 'Live grep' },
{ exe = 'fd', reason = 'File search' },
{ exe = 'fzf', reason = 'Fuzzy finder' },
{ exe = 'node', reason = 'Tree-sitter and LSP' },
}
local missing_deps = false
for _, dep in ipairs(deps) do
if fn.executable(dep.exe) == 0 then
vim.notify('Missing ' .. dep.exe .. ' required for ' .. dep.reason, vim.log.levels.ERROR)
missing_deps = true
end
end
if missing_deps then
error('Missing dependencies')
end
end
LoadPlugins = function()
vim.opt.rtp:prepend(lazypath)
require('lazy').setup({ import = 'plugins' }, {
ui = { border = 'rounded' },
git = {
timeout = -1, -- Disable timeout.
},
dev = {
path = vim.uv.os_homedir() .. '/Dev/neovim',
fallback = true,
},
concurrency = require('utilities.os').pu_count(),
})
end
-- Check to see if config dependencies are found.
CheckConfigDeps()
-- Bootstrap lazy.nvim if required.
if not vim.uv.fs_stat(lazypath) then
fn.system({
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable',
lazypath,
})
end
LoadPlugins()