adding new theme
This commit is contained in:
@@ -94,8 +94,23 @@ function M.show_notification(message, level, opts)
|
|||||||
local notification_id = notify(message, level, opts)
|
local notification_id = notify(message, level, opts)
|
||||||
return notification_id
|
return notification_id
|
||||||
else
|
else
|
||||||
-- Fallback to vim.notify
|
-- Fallback to echo instead of vim.notify to avoid circular dependency
|
||||||
vim.notify(message, level, opts)
|
local icon = "💬"
|
||||||
|
if level == vim.log.levels.ERROR then
|
||||||
|
icon = "❌"
|
||||||
|
elseif level == vim.log.levels.WARN then
|
||||||
|
icon = "⚠️"
|
||||||
|
elseif level == vim.log.levels.INFO then
|
||||||
|
icon = "ℹ️"
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Use echo for fallback notifications
|
||||||
|
vim.cmd("echo '" .. icon .. " " .. message .. "'")
|
||||||
|
|
||||||
|
-- Clear message after a delay
|
||||||
|
vim.defer_fn(function()
|
||||||
|
vim.cmd("echo ''")
|
||||||
|
end, opts.timeout or 3000)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -256,22 +271,13 @@ function M.eliminate_enter_prompts()
|
|||||||
once = true,
|
once = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Create autocmd to handle message events
|
-- Create autocmd to handle message events - use valid events
|
||||||
vim.api.nvim_create_autocmd("MsgShow", {
|
vim.api.nvim_create_autocmd("BufReadPost", {
|
||||||
callback = function()
|
callback = function()
|
||||||
-- Clear messages that might cause prompts
|
-- Clear messages that might cause prompts
|
||||||
vim.cmd("redraw!")
|
vim.cmd("redraw!")
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Create autocmd to handle any prompt events
|
|
||||||
vim.api.nvim_create_autocmd("PromptDone", {
|
|
||||||
callback = function()
|
|
||||||
-- Clear any remaining prompts
|
|
||||||
vim.cmd("redraw!")
|
|
||||||
vim.cmd("echo ''")
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Function to setup notification system
|
-- Function to setup notification system
|
||||||
@@ -295,11 +301,8 @@ function M.setup()
|
|||||||
-- Eliminate "Press ENTER" prompts
|
-- Eliminate "Press ENTER" prompts
|
||||||
M.eliminate_enter_prompts()
|
M.eliminate_enter_prompts()
|
||||||
|
|
||||||
-- Override vim.notify to use our custom system
|
-- Don't override vim.notify here to avoid circular dependency
|
||||||
local original_notify = vim.notify
|
-- Let the system handle notifications naturally
|
||||||
vim.notify = function(msg, level, opts)
|
|
||||||
M.show_notification(msg, level, opts)
|
|
||||||
end
|
|
||||||
|
|
||||||
print("Notification manager initialized")
|
print("Notification manager initialized")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,27 +4,44 @@ require("cargdev.core.compatibility").setup()
|
|||||||
-- Load startup optimizations early
|
-- Load startup optimizations early
|
||||||
require("cargdev.core.startup_optimization")
|
require("cargdev.core.startup_optimization")
|
||||||
|
|
||||||
-- Load notification manager for better UX
|
|
||||||
require("cargdev.core.function.notification_manager")
|
|
||||||
|
|
||||||
require("cargdev.core.options")
|
require("cargdev.core.options")
|
||||||
require("cargdev.core.keymaps")
|
require("cargdev.core.keymaps")
|
||||||
|
|
||||||
-- Load all Lua files inside `cargdev/core/function/`
|
-- Load all Lua files inside `cargdev/core/function/` AFTER plugins are loaded
|
||||||
local function load_functions()
|
local function load_functions()
|
||||||
local function_path = vim.fn.stdpath("config") .. "/lua/cargdev/core/function"
|
local function_path = vim.fn.stdpath("config") .. "/lua/cargdev/core/function"
|
||||||
local scan = vim.fn.globpath(function_path, "*.lua", false, true)
|
local scan = vim.fn.globpath(function_path, "*.lua", false, true)
|
||||||
|
|
||||||
for _, file in ipairs(scan) do
|
for _, file in ipairs(scan) do
|
||||||
local module_name = "cargdev.core.function." .. file:match("([^/]+)%.lua$")
|
local module_name = "cargdev.core.function." .. file:match("([^/]+)%.lua$")
|
||||||
local success, err = pcall(require, module_name)
|
-- Skip notification manager as it's loaded separately
|
||||||
|
if module_name ~= "cargdev.core.function.notification_manager" then
|
||||||
|
local success, err = pcall(require, module_name)
|
||||||
|
|
||||||
if not success then
|
if not success then
|
||||||
vim.notify("Error loading function module: " .. module_name .. "\n" .. err, vim.log.levels.ERROR)
|
vim.notify("Error loading function module: " .. module_name .. "\n" .. err, vim.log.levels.ERROR)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Defer function loading until after plugins are loaded
|
||||||
|
vim.api.nvim_create_autocmd("User", {
|
||||||
|
pattern = "LazyDone",
|
||||||
|
callback = function()
|
||||||
|
-- Load notification manager after plugins with error handling
|
||||||
|
local success, err = pcall(require, "cargdev.core.function.notification_manager")
|
||||||
|
if not success then
|
||||||
|
-- Use safe echo instead of vim.notify to avoid circular dependency
|
||||||
|
local safe_msg = tostring(err):gsub("'", "\\'")
|
||||||
|
vim.api.nvim_echo({{"Warning: Notification manager failed to load: " .. safe_msg, "WarningMsg"}}, false, {})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Load all other functions
|
||||||
|
load_functions()
|
||||||
|
end,
|
||||||
|
once = true,
|
||||||
|
})
|
||||||
|
|
||||||
--[[ vim.api.nvim_create_autocmd("BufReadPost", {
|
--[[ vim.api.nvim_create_autocmd("BufReadPost", {
|
||||||
once = true,
|
once = true,
|
||||||
@@ -33,4 +50,3 @@ end
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
]]
|
]]
|
||||||
load_functions()
|
|
||||||
|
|||||||
@@ -15,6 +15,13 @@ keymap.set("i", "jk", "<ESC>", opts) -- Exit insert mode with jk
|
|||||||
keymap.set("n", "<leader>nh", ":nohl<CR>", opts) -- Clear search highlights
|
keymap.set("n", "<leader>nh", ":nohl<CR>", opts) -- Clear search highlights
|
||||||
keymap.set("n", "x", '"_x', opts) -- Delete character without copying into register
|
keymap.set("n", "x", '"_x', opts) -- Delete character without copying into register
|
||||||
|
|
||||||
|
-- Comment keymaps
|
||||||
|
keymap.set("n", "gcc", "<cmd>CommentToggle<CR>", { desc = "Toggle comment line" })
|
||||||
|
keymap.set("n", "gc", "<cmd>CommentToggle<CR>", { desc = "Toggle comment line" })
|
||||||
|
keymap.set("v", "gc", "<cmd>CommentToggle<CR>", { desc = "Toggle comment selection" })
|
||||||
|
keymap.set("n", "gbc", "<cmd>CommentToggle<CR>", { desc = "Toggle comment block" })
|
||||||
|
keymap.set("v", "gb", "<cmd>CommentToggle<CR>", { desc = "Toggle comment block" })
|
||||||
|
|
||||||
-- Save and quit (additional)
|
-- Save and quit (additional)
|
||||||
keymap.set("n", "<leader>Q", ":qa!<CR>", { desc = "Quit all" })
|
keymap.set("n", "<leader>Q", ":qa!<CR>", { desc = "Quit all" })
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ function M.optimize_startup()
|
|||||||
|
|
||||||
-- Disable unused providers
|
-- Disable unused providers
|
||||||
vim.g.loaded_python3_provider = 0
|
vim.g.loaded_python3_provider = 0
|
||||||
vim.g.loaded_node_provider = 0
|
|
||||||
vim.g.loaded_ruby_provider = 0
|
vim.g.loaded_ruby_provider = 0
|
||||||
vim.g.loaded_perl_provider = 0
|
vim.g.loaded_perl_provider = 0
|
||||||
|
|
||||||
@@ -42,8 +41,14 @@ function M.optimize_startup()
|
|||||||
vim.g.do_filetype_lua = 1
|
vim.g.do_filetype_lua = 1
|
||||||
vim.g.did_load_filetypes = 0
|
vim.g.did_load_filetypes = 0
|
||||||
|
|
||||||
-- Fix lazyredraw conflict with Noice
|
-- Fix lazyredraw conflict with Noice - but only after LazyVim loads
|
||||||
vim.opt.lazyredraw = false -- Disable to prevent Noice conflicts
|
vim.api.nvim_create_autocmd("User", {
|
||||||
|
pattern = "LazyDone",
|
||||||
|
callback = function()
|
||||||
|
vim.opt.lazyredraw = false -- Disable to prevent Noice conflicts
|
||||||
|
end,
|
||||||
|
once = true,
|
||||||
|
})
|
||||||
|
|
||||||
-- Optimize completion settings
|
-- Optimize completion settings
|
||||||
vim.opt.completeopt = "menuone,noselect"
|
vim.opt.completeopt = "menuone,noselect"
|
||||||
@@ -99,32 +104,50 @@ end
|
|||||||
-- Function to defer heavy operations
|
-- Function to defer heavy operations
|
||||||
function M.defer_heavy_operations()
|
function M.defer_heavy_operations()
|
||||||
-- Defer treesitter loading
|
-- Defer treesitter loading
|
||||||
vim.defer_fn(function()
|
vim.api.nvim_create_autocmd("User", {
|
||||||
if vim.fn.exists(":TSBufEnable") > 0 then
|
pattern = "LazyDone",
|
||||||
vim.cmd("TSBufEnable highlight")
|
callback = function()
|
||||||
end
|
vim.defer_fn(function()
|
||||||
end, 100)
|
if vim.fn.exists(":TSBufEnable") > 0 then
|
||||||
|
vim.cmd("TSBufEnable highlight")
|
||||||
|
end
|
||||||
|
end, 100)
|
||||||
|
end,
|
||||||
|
once = true,
|
||||||
|
})
|
||||||
|
|
||||||
-- Defer LSP setup for non-critical buffers
|
-- Defer LSP setup for non-critical buffers
|
||||||
vim.defer_fn(function()
|
vim.api.nvim_create_autocmd("User", {
|
||||||
-- Enable LSP for current buffer if it's a supported filetype
|
pattern = "LazyDone",
|
||||||
local supported_ft = {
|
callback = function()
|
||||||
"lua", "javascript", "typescript", "python", "java", "cpp", "c", "rust", "go",
|
vim.defer_fn(function()
|
||||||
"html", "css", "json", "yaml", "markdown"
|
-- Enable LSP for current buffer if it's a supported filetype
|
||||||
}
|
local supported_ft = {
|
||||||
|
"lua", "javascript", "typescript", "python", "java", "cpp", "c", "rust", "go",
|
||||||
|
"html", "css", "json", "yaml", "markdown"
|
||||||
|
}
|
||||||
|
|
||||||
local current_ft = vim.bo.filetype
|
local current_ft = vim.bo.filetype
|
||||||
if vim.tbl_contains(supported_ft, current_ft) then
|
if vim.tbl_contains(supported_ft, current_ft) then
|
||||||
vim.cmd("LspStart")
|
vim.cmd("LspStart")
|
||||||
end
|
end
|
||||||
end, 200)
|
end, 200)
|
||||||
|
end,
|
||||||
|
once = true,
|
||||||
|
})
|
||||||
|
|
||||||
-- Defer completion setup
|
-- Defer completion setup
|
||||||
vim.defer_fn(function()
|
vim.api.nvim_create_autocmd("User", {
|
||||||
if vim.fn.exists(":CmpStatus") > 0 then
|
pattern = "LazyDone",
|
||||||
vim.cmd("CmpStatus")
|
callback = function()
|
||||||
end
|
vim.defer_fn(function()
|
||||||
end, 300)
|
if vim.fn.exists(":CmpStatus") > 0 then
|
||||||
|
vim.cmd("CmpStatus")
|
||||||
|
end
|
||||||
|
end, 300)
|
||||||
|
end,
|
||||||
|
once = true,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Function to check if we're in a large repository
|
-- Function to check if we're in a large repository
|
||||||
@@ -142,7 +165,7 @@ function M.check_repo_size()
|
|||||||
vim.opt.cursorline = false -- Disable cursor line
|
vim.opt.cursorline = false -- Disable cursor line
|
||||||
vim.opt.relativenumber = false -- Disable relative numbers
|
vim.opt.relativenumber = false -- Disable relative numbers
|
||||||
|
|
||||||
print("Large repository detected (" .. file_count .. " files). Applied additional optimizations.")
|
print("Large repository detected (" .. file_count .. " lines). Applied additional optimizations.")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -165,8 +188,8 @@ function M.eliminate_startup_prompts()
|
|||||||
once = true,
|
once = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Create autocmd to handle any message events
|
-- Create autocmd to handle any message events - use valid events
|
||||||
vim.api.nvim_create_autocmd("MsgShow", {
|
vim.api.nvim_create_autocmd("BufReadPost", {
|
||||||
callback = function()
|
callback = function()
|
||||||
-- Clear messages that might cause prompts
|
-- Clear messages that might cause prompts
|
||||||
vim.cmd("redraw!")
|
vim.cmd("redraw!")
|
||||||
|
|||||||
@@ -33,10 +33,14 @@ return {
|
|||||||
dashboard.button("n", "📄 New File", "<cmd>ene<CR>"),
|
dashboard.button("n", "📄 New File", "<cmd>ene<CR>"),
|
||||||
dashboard.button("g", "📝 Find Text", "<cmd>Telescope live_grep<CR>"),
|
dashboard.button("g", "📝 Find Text", "<cmd>Telescope live_grep<CR>"),
|
||||||
dashboard.button("r", "📚 Recent Files", "<cmd>Telescope oldfiles<CR>"),
|
dashboard.button("r", "📚 Recent Files", "<cmd>Telescope oldfiles<CR>"),
|
||||||
|
dashboard.button("t", "🌳 File Tree", "<cmd>NvimTreeToggle<CR>"),
|
||||||
dashboard.button("c", "⚙️ Config", "<cmd>e ~/.config/nvim/init.lua<CR>"),
|
dashboard.button("c", "⚙️ Config", "<cmd>e ~/.config/nvim/init.lua<CR>"),
|
||||||
dashboard.button("L", "🦥 Lazy", "<cmd>Lazy<CR>"),
|
dashboard.button("L", "🦥 Lazy", "<cmd>Lazy<CR>"),
|
||||||
dashboard.button("p", "📊 Performance", "<cmd>lua require('cargdev.core.function.performance_monitor').check_performance()<CR>"),
|
dashboard.button("p", "📊 Performance", "<cmd>lua require('cargdev.core.function.performance_monitor').check_performance()<CR>"),
|
||||||
dashboard.button("l", "🔧 LSP Health", "<cmd>lua require('cargdev.core.function.performance_monitor').check_lsp_health()<CR>"),
|
dashboard.button("l", "🔧 LSP Health", "<cmd>lua require('cargdev.core.function.performance_monitor').check_lsp_health()<CR>"),
|
||||||
|
dashboard.button("s", "🧩 Sudoku", "<cmd>Sudoku<CR>"),
|
||||||
|
dashboard.button("e", "💻 LeetCode", "<cmd>Leet<CR>"),
|
||||||
|
dashboard.button("m", "🔨 Mason", "<cmd>Mason<CR>"),
|
||||||
dashboard.button("q", "🚪 Quit", "<cmd>qa<CR>"),
|
dashboard.button("q", "🚪 Quit", "<cmd>qa<CR>"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
return {
|
return {
|
||||||
"CarGDev/cargdev-cyberpunk",
|
"CarGDev/cargdev-cyberpunk",
|
||||||
--[[ dir = "/Users/carlos/Documents/SSD_Documents/projects/cargdevschemecolor.nvim", ]]
|
--[[ dir = "/Users/carlos/Documents/SSD_Documents/projects/cargdevschemecolor.nvim", ]]
|
||||||
event = "VimEnter", -- Load only when entering Vim
|
|
||||||
priority = 1000,
|
|
||||||
config = function()
|
config = function()
|
||||||
require("cargdev-cyberpunk").setup()
|
require("cargdev-cyberpunk").setup()
|
||||||
end,
|
end,
|
||||||
|
priority = 1000,
|
||||||
|
lazy = false,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,12 +8,32 @@ return {
|
|||||||
-- import comment plugin safely
|
-- import comment plugin safely
|
||||||
local comment = require("Comment")
|
local comment = require("Comment")
|
||||||
|
|
||||||
local ts_context_commentstring = require("ts_context_commentstring.integrations.comment_nvim")
|
-- Check if treesitter context commentstring is available
|
||||||
|
local ok, ts_context_commentstring = pcall(require, "ts_context_commentstring.integrations.comment_nvim")
|
||||||
|
|
||||||
-- enable comment
|
-- enable comment with safe configuration
|
||||||
comment.setup({
|
comment.setup({
|
||||||
-- for commenting tsx, jsx, svelte, html files
|
-- for commenting tsx, jsx, svelte, html files
|
||||||
pre_hook = ts_context_commentstring.create_pre_hook(),
|
pre_hook = ok and ts_context_commentstring.create_pre_hook() or nil,
|
||||||
|
-- Add explicit commentstring fallbacks
|
||||||
|
opleader = {
|
||||||
|
line = "gc",
|
||||||
|
block = "gb",
|
||||||
|
},
|
||||||
|
toggler = {
|
||||||
|
line = "gcc",
|
||||||
|
block = "gbc",
|
||||||
|
},
|
||||||
|
extra = {
|
||||||
|
above = "gcO",
|
||||||
|
below = "gco",
|
||||||
|
eol = "gcA",
|
||||||
|
},
|
||||||
|
mappings = {
|
||||||
|
basic = true,
|
||||||
|
extra = true,
|
||||||
|
extended = false,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -288,18 +288,6 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Better indentation guides
|
|
||||||
{
|
|
||||||
"lukas-reineke/indent-blankline.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
opts = {
|
|
||||||
char = "│",
|
|
||||||
filetype_exclude = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason" },
|
|
||||||
show_trailing_blankline_indent = false,
|
|
||||||
show_current_context = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Better git integration
|
-- Better git integration
|
||||||
{
|
{
|
||||||
"lewis6991/gitsigns.nvim",
|
"lewis6991/gitsigns.nvim",
|
||||||
|
|||||||
@@ -3,6 +3,15 @@ return {
|
|||||||
event = { "BufReadPre", "BufNewFile" },
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
main = "ibl",
|
main = "ibl",
|
||||||
opts = {
|
opts = {
|
||||||
indent = { char = "┊" },
|
indent = {
|
||||||
|
char = "┊",
|
||||||
|
exclude_filetypes = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason" }
|
||||||
|
},
|
||||||
|
scope = {
|
||||||
|
enabled = false
|
||||||
|
},
|
||||||
|
exclude = {
|
||||||
|
filetypes = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason" }
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ return {
|
|||||||
dependencies = {
|
dependencies = {
|
||||||
"hrsh7th/cmp-buffer", -- source for text in buffer
|
"hrsh7th/cmp-buffer", -- source for text in buffer
|
||||||
"hrsh7th/cmp-path", -- source for file system paths
|
"hrsh7th/cmp-path", -- source for file system paths
|
||||||
|
"hrsh7th/cmp-nvim-lsp", -- LSP completion source
|
||||||
{
|
{
|
||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
-- follow latest release.
|
-- follow latest release.
|
||||||
|
|||||||
Reference in New Issue
Block a user