-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
56 lines (51 loc) · 2.17 KB
/
Copy pathinit.lua
File metadata and controls
56 lines (51 loc) · 2.17 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
--- Entry point: bootstraps lazy.nvim, loads core config, then plugins and root detection.
-- Minimum version check: Neovim 0.11+ is required for vim.system, vim.text.diff, and LSP improvements.
if vim.fn.has("nvim-0.11") == 0 then
local ver = vim.version and vim.version().string or "unknown"
vim.api.nvim_echo({
{ "Error: this config requires Neovim 0.11+ (running " .. ver .. ")\n", "ErrorMsg" },
{ "Please upgrade to Neovim 0.11 or nightly.\n", "WarningMsg" },
}, true, {})
return
end
--- Clone lazy.nvim into the data dir on first launch, aborting on clone failure.
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Leaders must be set before lazy loads any mappings.
vim.g.mapleader = " " ---@type string external: read by every plugin mapping
vim.g.maplocalleader = "\\" ---@type string external: read by every plugin mapping
require("core")
require("lazy").setup({
spec = {
{ import = "plugins" },
},
checker = { enabled = true }, -- automatic plugin update checks
-- The plugin manager is a float like any other: rounded border one step off
-- the background, a titled frame instead of a bare slab, and no backdrop
-- (100 = fully transparent dim layer), matching the snacks windows. Colours
-- for it are in plugins/ui/catppuccin.lua, under "lazy.nvim UI".
ui = {
border = "rounded",
backdrop = 100,
title = " Plugins ",
title_pos = "center",
size = { width = 0.85, height = 0.85 },
},
})
-- Root detection: register autocmds, then publish the spec globals it reads.
require("lib.root").setup()
vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" } ---@type lib.RootSpec[] external: read by lib.root
vim.g.root_lsp_ignore = { "copilot" } ---@type string[] external: read by lib.root.detectors.lsp