-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathneovim.lua
More file actions
34 lines (29 loc) · 1.03 KB
/
neovim.lua
File metadata and controls
34 lines (29 loc) · 1.03 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
-- Main neovim configuration file
-- Get the path to dotfiles directory
local dotfiles_path = vim.fn.expand("~/Source/dotfiles")
-- Load plugin definitions
dofile(dotfiles_path .. "/neovim/plugins/init.lua")
-- Load core Neovim configurations
dofile(dotfiles_path .. "/neovim/behavior.lua")
dofile(dotfiles_path .. "/neovim/display.lua")
dofile(dotfiles_path .. "/neovim/keybindings.lua")
-- Load plugin configurations with VimEnter to ensure plugins are available
vim.api.nvim_create_autocmd("VimEnter", {
callback = function()
-- Wait for plugins to be loaded
vim.defer_fn(function()
-- Get all plugin config files
local plugin_dir = dotfiles_path .. "/neovim/plugins"
local files = vim.fn.glob(plugin_dir .. "/*.lua", false, true)
-- Skip init.lua
for _, file in ipairs(files) do
local basename = vim.fn.fnamemodify(file, ":t")
if basename ~= "init.lua" then
-- Try to load each plugin config
pcall(dofile, file)
end
end
end, 100)
end,
once = true
})