-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
102 lines (92 loc) · 2.64 KB
/
Copy pathinit.lua
File metadata and controls
102 lines (92 loc) · 2.64 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
-- Set cache and leader keys
vim.g.base46_cache = vim.fn.stdpath("data") .. "/base46/"
vim.g.mapleader = " "
vim.g.maplocalleader = " " -- Set local leader key
-- VSCode-specific setup
if vim.g.vscode then
local vscode_plugins = require("user.vsplug")
require("lazy").setup(vscode_plugins)
require("user.vscode_keymaps")
else
-- Bootstrap lazy and all plugins
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
local repo = "https://github.com/folke/lazy.nvim.git"
vim.fn.system({ "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath })
end
vim.opt.rtp:prepend(lazypath)
local lazy_config = require("configs.lazy")
require("lazy").setup({
{
"NvChad/NvChad",
lazy = false,
branch = "v2.5",
import = "nvchad.plugins",
},
{ import = "plugins" },
-- Additional Neovim plugins
-- {
-- "nvim-treesitter/nvim-treesitter",
-- lazy = false,
-- config = function()
-- require("nvim-treesitter.configs").setup({
-- ensure_installed = { "lua", "python", "javascript", "html", "css" },
-- highlight = { enable = true },
-- })
-- end,
-- },
{
"nvim-lua/plenary.nvim",
lazy = false,
},
-- {
-- "hrsh7th/nvim-cmp",
-- config = function()
-- require("cmp").setup({
-- -- Configuration for nvim-cmp
-- })
-- end,
-- },
{
"L3MON4D3/LuaSnip",
lazy = false,
},
-- Other plugins for Neovim
})
-- Load theme
dofile(vim.g.base46_cache .. "defaults")
dofile(vim.g.base46_cache .. "statusline")
-- Ordinary Neovim setup
require("options")
--require("test")
require("cusmap")
-- require("plugins.themes.vscode")
-- require("plugins.themes.bambo")
-- Load mappings after everything else
vim.schedule(function()
require("mappings")
end)
-- Automatically require all Lua files in pluginconfig directory
local plugin_config_dir = vim.fn.stdpath("config") .. "/lua/plugconfig"
for _, file in ipairs(vim.fn.readdir(plugin_config_dir)) do
if file:match(".+%.lua$") then
require("plugconfig." .. file:match("^(.*)%.lua$"))
end
end
-- Autocmds and further Lua files sourcing
require("nvchad.autocmds")
-- Automatically source mappings.lua when saved
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "lua/mappings.lua", -- Trigger only for mappings.lua
callback = function()
local mappings_path = vim.fn.stdpath("config") .. "/lua/mappings.lua"
if vim.fn.filereadable(mappings_path) == 1 then
vim.cmd("source " .. mappings_path)
-- print("Reloaded mappings.lua")
else
-- print("Error: mappings.lua not found")
end
end,
desc = "Automatically source mappings.lua on save",
})
end