Repository navigation
Expand file tree
/
Copy pathinit.lua
More file actions
73 lines (68 loc) · 3.32 KB
/
Copy pathinit.lua
File metadata and controls
73 lines (68 loc) · 3.32 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
-- Bootstrap lazy.nvim plugin manager
-- This section ensures that lazy.nvim is installed before proceeding with the configuration
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not (vim.uv or vim.loop).fs_stat(lazypath) then
-- Clone lazy.nvim repository if it doesn't exist
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
-- Use --depth=1 instead of --filter=blob:none (partial clone broken on NixOS git 2.54+)
local out = vim.fn.system({ 'git', 'clone', '--depth=1', '--branch=stable', lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
-- Display error message and exit if cloning fails
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
-- Add lazy.nvim to the runtime path
vim.opt.runtimepath:prepend(lazypath)
-- Set leader keys for custom key mappings
-- The leader key is used as a prefix for custom shortcuts
vim.g.mapleader = ','
vim.g.maplocalleader = ','
-- Load core configuration modules
-- These modules contain the main Neovim configuration
require('core.options') -- General Neovim settings and options
require('core.keymaps') -- Custom key mappings and shortcuts
require('core.autocommands') -- Automatic commands triggered by events
require('core.usercommands') -- Custom user-defined commands
require('core.notifications').setup() -- Enhanced notification system
require('core.smart-redraw').setup() -- Smart lazyredraw optimization
require('core.error-logging').setup() -- Enhanced error logging system
-- Load utility modules (local function replacements for plugins)
-- NOTE: surround/autopairs/buffer/comment were replaced by mini.surround /
-- mini.pairs / mini.bufremove / mini.comment (see lua/plugins/mini-suite.lua).
-- The remaining utils have NO mini.nvim equivalent — do not remove them
-- without a verified drop-in replacement (see AGENTS.md "Custom Utilities").
require('utils.window').setup() -- Window management (replaces smart-splits.nvim)
require('utils.todo-marker').setup() -- TODO/checkbox markers (replaces todo-marker.nvim)
require('utils.toggler').setup() -- Boolean toggling (replaces nvim-toggler)
require('utils.substitute').setup() -- Cmdline substitute alt (replaces nvim-alt-substitute)
-- Configure lazy.nvim options
-- These settings customize the appearance and behavior of the plugin manager
local opts = {
ui = {
border = 'single', -- Set border style for lazy.nvim windows
icons = {
lazy = '💤', -- Icon displayed for lazy.nvim in the UI
},
},
checker = {
enabled = true, -- Enable automatic checking for plugin updates
},
-- Limit concurrent git operations to avoid OOM during cloning
-- With 47+ plugins to clone, unlimited parallelism overwhelms memory
concurrency = 8,
git = {
timeout = 600,
-- Disable --filter=blob:none (partial clone) — broken on NixOS git 2.54+
-- Falls back to regular shallow clones which work at full speed
filter = false,
},
}
-- Initialize lazy.nvim with plugin configurations
-- This loads all plugins from the 'plugins' and 'plugins.lsp' directories
require('lazy').setup({ { import = 'plugins' }, { import = 'plugins.lsp' } }, opts)