Compare commits
8 Commits
master2.0
...
87aa445764
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
87aa445764 | ||
|
|
3f9a502503 | ||
|
|
031b49ac77 | ||
|
|
e1a1c9f82a | ||
|
|
01015a3447 | ||
|
|
dc64c3fef8 | ||
|
|
236f777f99 | ||
|
|
8f186686d4 |
@@ -86,3 +86,19 @@ keymap.set("n", "<leader>ct", "<Plug>(git-conflict-theirs)", { desc = "Choose th
|
||||
keymap.set("n", "<leader>cb", "<Plug>(git-conflict-both)", { desc = "Choose both (git conflict)" })
|
||||
keymap.set("n", "<leader>c0", "<Plug>(git-conflict-none)", { desc = "Choose none (git conflict)" })
|
||||
keymap.set("n", "<leader>cq", "<Plug>(git-conflict-list)", { desc = "List all git conflicts" })
|
||||
|
||||
-- LeetCode Mappings
|
||||
keymap.set("n", "<leader>lr", "<cmd>Leet run<CR>", { desc = "LeetCode: Run Code" })
|
||||
keymap.set("n", "<leader>ls", "<cmd>Leet submit<CR>", { desc = "LeetCode: Submit Code" })
|
||||
keymap.set("n", "<leader>ld", "<cmd>Leet daily<CR>", { desc = "LeetCode: Daily Challenge" })
|
||||
keymap.set("n", "<leader>ll", "<cmd>Leet list<CR>", { desc = "LeetCode: List Problems" })
|
||||
keymap.set("n", "<leader>lc", "<cmd>Leet console<CR>", { desc = "LeetCode: Open Console" })
|
||||
keymap.set("n", "<leader>lu", "<cmd>Leet cookie update<CR>", { desc = "LeetCode: Update Cookie" })
|
||||
keymap.set("n", "<leader>lls", "<cmd>Leet last_submit<CR>", { desc = "LeetCode: Get latest submition" })
|
||||
|
||||
-- Copilot
|
||||
-- Add key map on normal mode to open copilot panel on c + tab
|
||||
keymap.set("n", "<leader>cp", ":Copilot panel<CR>", { desc = "Copilot: Open copilot panel" })
|
||||
|
||||
-- Add key map on normal mode to open copilot chat explain on c + shift + e
|
||||
keymap.set("n", "<leader>ce", ":CopilotChatExplain<CR>", { desc = "Copilot Chat: Explain code" })
|
||||
|
||||
56
lua/cargdev/plugins/aicargdev.lua.bak
Normal file
56
lua/cargdev/plugins/aicargdev.lua.bak
Normal file
@@ -0,0 +1,56 @@
|
||||
-- return {
|
||||
-- {
|
||||
-- "yetone/avante.nvim",
|
||||
-- event = "VeryLazy",
|
||||
-- lazy = false,
|
||||
-- version = false, -- Always pull the latest change
|
||||
-- opts = {
|
||||
-- provider = "cargdev", -- API provider configuration
|
||||
-- providers = {
|
||||
-- cargdev = {
|
||||
-- name = "cargdev", -- Optional
|
||||
-- endpoint = "https://api-ai.cargdev.io", -- API endpoint
|
||||
-- api_key_name = "CARGDEV_API_KEY", -- reference the ENV VAR below
|
||||
-- model = "deepseek-r1:latest",
|
||||
-- __inherited_from = "ollama", -- ensures compatibility
|
||||
-- max_tokens = 8192,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- -- Optional: Build from source if required
|
||||
-- build = "make",
|
||||
-- dependencies = {
|
||||
-- "nvim-treesitter/nvim-treesitter", -- Syntax highlighting support
|
||||
-- "stevearc/dressing.nvim", -- UI elements
|
||||
-- "nvim-lua/plenary.nvim", -- Utility library
|
||||
-- "MunifTanjim/nui.nvim", -- UI library for modal components
|
||||
-- -- Optional dependencies:
|
||||
-- "nvim-tree/nvim-web-devicons", -- Icons support
|
||||
-- "zbirenbaum/copilot.lua", -- Copilot integration
|
||||
-- {
|
||||
-- "HakonHarnes/img-clip.nvim", -- Image pasting support
|
||||
-- event = "VeryLazy",
|
||||
-- opts = {
|
||||
-- -- Recommended settings
|
||||
-- default = {
|
||||
-- embed_image_as_base64 = false,
|
||||
-- prompt_for_file_name = false,
|
||||
-- drag_and_drop = {
|
||||
-- insert_mode = true,
|
||||
-- },
|
||||
-- use_absolute_path = true, -- For Windows users
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- {
|
||||
-- "MeanderingProgrammer/render-markdown.nvim",
|
||||
-- ft = { "markdown", "Avante" },
|
||||
-- config = function()
|
||||
-- require("render-markdown").setup({
|
||||
-- file_types = { "markdown", "Avante" },
|
||||
-- })
|
||||
-- end,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- }
|
||||
@@ -5,28 +5,32 @@ return {
|
||||
lazy = false,
|
||||
version = false, -- Always pull the latest change
|
||||
opts = {
|
||||
provider = "cargdev", -- API provider configuration
|
||||
vendors = {
|
||||
cargdev = {
|
||||
name = "cargdev", -- Optional
|
||||
endpoint = "https://api-ai.cargdev.io/api/generate", -- API endpoint
|
||||
api_key_name = "CARGDEV_API_KEY", -- reference the ENV VAR below
|
||||
model = "codellama:7b",
|
||||
__inherited_from = "ollama", -- ensures compatibility
|
||||
max_tokens = 8192,
|
||||
provider = "claude", -- API provider configuration
|
||||
providers = {
|
||||
claude = {
|
||||
endpoint = "https://api.anthropic.com",
|
||||
model = "claude-3-haiku-20240307",
|
||||
timeout = 30000, -- Timeout in milliseconds
|
||||
extra_request_body = {
|
||||
temperature = 0.75,
|
||||
max_tokens = 4096,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- Optional: Build from source if required
|
||||
build = "make",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter", -- Syntax highlighting support
|
||||
"stevearc/dressing.nvim", -- UI elements
|
||||
"nvim-lua/plenary.nvim", -- Utility library
|
||||
"MunifTanjim/nui.nvim", -- UI library for modal components
|
||||
-- Optional dependencies:
|
||||
"nvim-tree/nvim-web-devicons", -- Icons support
|
||||
"zbirenbaum/copilot.lua", -- Copilot integration
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
"echasnovski/mini.pick", -- for file_selector provider mini.pick
|
||||
"nvim-telescope/telescope.nvim", -- for file_selector provider telescope
|
||||
"hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions
|
||||
"ibhagwan/fzf-lua", -- for file_selector provider fzf
|
||||
"stevearc/dressing.nvim", -- for input provider dressing
|
||||
"folke/snacks.nvim", -- for input provider snacks
|
||||
"nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
|
||||
{
|
||||
"HakonHarnes/img-clip.nvim", -- Image pasting support
|
||||
event = "VeryLazy",
|
||||
@@ -1,12 +0,0 @@
|
||||
return {
|
||||
"ap/vim-buftabline",
|
||||
event = "VeryLazy", -- Loads when Neovim starts up
|
||||
config = function()
|
||||
-- Enable the buffer tabline
|
||||
vim.g.buftabline_numbers = 2 -- Shows buffer numbers
|
||||
vim.g.buftabline_separators = 1 -- Shows separators between tabs
|
||||
vim.g.buftabline_indicators = 1 -- Show indicators for modified buffers
|
||||
vim.g.buftabline_show = 1 -- 0: never, 1: always, 2: auto-hide when only one buffer
|
||||
vim.g.buftabline_modified_indicator = "[+]" -- Custom indicator for modified buffers
|
||||
end,
|
||||
}
|
||||
@@ -6,6 +6,7 @@ return {
|
||||
enabled = true,
|
||||
config = function()
|
||||
require("copilot").setup({
|
||||
-- General settings
|
||||
panel = {
|
||||
enabled = true,
|
||||
auto_refresh = false,
|
||||
@@ -14,7 +15,6 @@ return {
|
||||
jump_next = "]]",
|
||||
accept = "<CR>",
|
||||
refresh = "gr",
|
||||
open = "<M-CR>",
|
||||
},
|
||||
layout = {
|
||||
position = "bottom", -- | top | left | right | horizontal | vertical
|
||||
@@ -25,9 +25,9 @@ return {
|
||||
enabled = true,
|
||||
auto_trigger = true,
|
||||
debounce = 75,
|
||||
trigger_on_accept = true,
|
||||
trigger_on_accept = false,
|
||||
keymap = {
|
||||
accept = "<Tab>", -- Accept suggestion
|
||||
accept = "<C-l>", -- Accept suggestion
|
||||
next = "<C-j>", -- Next suggestion
|
||||
prev = "<C-k>", -- Previous suggestion
|
||||
dismiss = "<C-x>", -- Dismiss suggestion
|
||||
@@ -45,7 +45,7 @@ return {
|
||||
-- Copilot Chat plugin
|
||||
"CopilotC-Nvim/CopilotChat.nvim",
|
||||
dependencies = {
|
||||
{ "github/copilot.vim" }, -- Or zbirenbaum/copilot.lua
|
||||
{ "zbirenbaum/copilot.lua" },
|
||||
{ "nvim-lua/plenary.nvim", branch = "master" }, -- For curl, log and async functions
|
||||
},
|
||||
build = "make tiktoken", -- Only on MacOS or Linux
|
||||
@@ -54,6 +54,9 @@ return {
|
||||
position = "right", -- Position of the chat window
|
||||
ratio = 0.5,
|
||||
},
|
||||
tiktoken = {
|
||||
enabled = false, -- Enable token counting
|
||||
},
|
||||
floating = {
|
||||
enabled = true,
|
||||
border = "rounded",
|
||||
|
||||
10
lua/cargdev/plugins/ideaMap.lua
Normal file
10
lua/cargdev/plugins/ideaMap.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
--[[ dir = "/Users/carlos/Documents/SSD_Documents/personals/ideaDrop", ]]
|
||||
"CarGDev/ideadrop.nvim",
|
||||
name = "ideaDrop",
|
||||
config = function()
|
||||
require("ideaDrop").setup({
|
||||
idea_dir = "/Users/carlos/Nextcloud/ObsidianVault",
|
||||
})
|
||||
end,
|
||||
}
|
||||
98
lua/cargdev/plugins/leetcode.lua
Normal file
98
lua/cargdev/plugins/leetcode.lua
Normal file
@@ -0,0 +1,98 @@
|
||||
return {
|
||||
--[[ dir = '/Users/carlos/Documents/SSD_Documents/personals/leetcode.nvim', ]]
|
||||
"kawre/leetcode.nvim",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
cmd = { "Leet" }, -- lazy load on command
|
||||
opts = {
|
||||
---@type string
|
||||
arg = "leetcode.nvim", -- for CLI mode
|
||||
---@type lc.lang
|
||||
lang = "python3", -- or "cpp", "java", etc.
|
||||
logging = true,
|
||||
cn = {
|
||||
enabled = false, -- enable for leetcode.cn
|
||||
translator = true,
|
||||
translate_problems = true,
|
||||
},
|
||||
|
||||
---@type lc.storage
|
||||
storage = {
|
||||
home = vim.fn.stdpath("data") .. "/leetcode",
|
||||
cache = vim.fn.stdpath("cache") .. "/leetcode",
|
||||
},
|
||||
|
||||
---@type table<string, boolean>
|
||||
plugins = {
|
||||
non_standalone = true, -- allow use inside your regular session
|
||||
},
|
||||
|
||||
---@type boolean
|
||||
logging = true,
|
||||
|
||||
cache = {
|
||||
update_interval = 60 * 60 * 24 * 7, ---@type integer 7 days
|
||||
},
|
||||
|
||||
console = {
|
||||
open_on_runcode = true, ---@type boolean
|
||||
dir = "row", ---@type lc.direction
|
||||
size = { ---@type lc.size
|
||||
width = "90%",
|
||||
height = "75%",
|
||||
},
|
||||
result = {
|
||||
size = "60%", ---@type boolean
|
||||
},
|
||||
testcase = {
|
||||
virt_text = true, ---@type boolean
|
||||
size = "40%", ---@type lc.size
|
||||
},
|
||||
},
|
||||
|
||||
description = {
|
||||
position = "left", ---@type lc.position
|
||||
width = "40%", ---@type lc.size
|
||||
show_stats = true, ---@type boolean
|
||||
},
|
||||
|
||||
---@type lc.picker
|
||||
picker = { provider = "telescope" },
|
||||
|
||||
hooks = {
|
||||
---@type fun()[]
|
||||
["enter"] = {},
|
||||
|
||||
---@type fun(question: lc.ui.Question)[]
|
||||
["question_enter"] = {},
|
||||
|
||||
---@type fun()[]
|
||||
["leave"] = {},
|
||||
},
|
||||
|
||||
injector = { ---@type table<lc.lang, lc.inject>
|
||||
["python3"] = {
|
||||
before = true,
|
||||
},
|
||||
},
|
||||
|
||||
keys = {
|
||||
toggle = { "q" }, ---@type string|string[]
|
||||
confirm = { "<CR>" }, ---@type string|string[]
|
||||
|
||||
reset_testcases = "r", ---@type string
|
||||
use_testcase = "U", ---@type string
|
||||
focus_testcases = "H", ---@type string
|
||||
focus_result = "L", ---@type string
|
||||
},
|
||||
|
||||
---@type lc.highlights
|
||||
theme = {},
|
||||
|
||||
---@type boolean
|
||||
image_support = false,
|
||||
},
|
||||
}
|
||||
@@ -5,7 +5,10 @@ return {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
{ "antosha417/nvim-lsp-file-operations", config = true },
|
||||
{ "folke/neodev.nvim", opts = {} },
|
||||
{ "pmizio/typescript-tools.nvim", dependencies = { "nvim-lua/plenary.nvim" } }
|
||||
{
|
||||
"pmizio/typescript-tools.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
@@ -21,31 +24,29 @@ return {
|
||||
"gopls",
|
||||
"graphql",
|
||||
"html",
|
||||
"jdtls",
|
||||
-- "jdtls", -- uncomment if you’re actively doing Java
|
||||
"lua_ls",
|
||||
"prismals",
|
||||
"pyright",
|
||||
"svelte",
|
||||
"tailwindcss",
|
||||
"ts_ls"
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
|
||||
-- Define signs for diagnostics
|
||||
vim.diagnostic.config({
|
||||
signs = {
|
||||
severity = {
|
||||
min = vim.diagnostic.severity.WARN
|
||||
min = vim.diagnostic.severity.WARN,
|
||||
},
|
||||
icons = {
|
||||
Error = " ",
|
||||
Warn = " ",
|
||||
Hint = " ",
|
||||
Info = " "
|
||||
}
|
||||
}
|
||||
Info = " ",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local servers = {
|
||||
@@ -55,23 +56,22 @@ return {
|
||||
gopls = {},
|
||||
graphql = {},
|
||||
html = {},
|
||||
jdtls = {},
|
||||
-- jdtls = {}, -- same here
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = { globals = { "vim" } },
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
checkThirdParty = false
|
||||
}
|
||||
}
|
||||
}
|
||||
checkThirdParty = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
prismals = {},
|
||||
pyright = {},
|
||||
svelte = {},
|
||||
tailwindcss = {},
|
||||
ts_ls = {}
|
||||
}
|
||||
|
||||
for server, config in pairs(servers) do
|
||||
@@ -79,6 +79,16 @@ return {
|
||||
lspconfig[server].setup(config)
|
||||
end
|
||||
|
||||
-- ✅ Correct way to setup typescript-tools
|
||||
require("typescript-tools").setup({
|
||||
capabilities = capabilities,
|
||||
-- optional settings:
|
||||
-- settings = {
|
||||
-- tsserver_plugins = {},
|
||||
-- tsserver_max_memory = 4096,
|
||||
-- }
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
||||
callback = function(ev)
|
||||
@@ -96,7 +106,7 @@ return {
|
||||
["[d"] = { vim.diagnostic.goto_prev, "Go to previous diagnostic" },
|
||||
["]d"] = { vim.diagnostic.goto_next, "Go to next diagnostic" },
|
||||
["K"] = { vim.lsp.buf.hover, "Show documentation for cursor" },
|
||||
["<leader>rs"] = { ":LspRestart<CR>", "Restart LSP" }
|
||||
["<leader>rs"] = { ":LspRestart<CR>", "Restart LSP" },
|
||||
}
|
||||
|
||||
for key, map in pairs(mappings) do
|
||||
@@ -107,11 +117,11 @@ return {
|
||||
buffer = ev.buf,
|
||||
callback = function()
|
||||
vim.diagnostic.open_float(nil, { focusable = false })
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.o.updatetime = 250
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ return {
|
||||
mason_lspconfig.setup({
|
||||
-- list of servers for mason to install
|
||||
ensure_installed = {
|
||||
"tsserver",
|
||||
"ts_ls",
|
||||
"html",
|
||||
"cssls",
|
||||
"tailwindcss",
|
||||
|
||||
53
lua/cargdev/plugins/mcphub.lua
Normal file
53
lua/cargdev/plugins/mcphub.lua
Normal file
@@ -0,0 +1,53 @@
|
||||
return {
|
||||
"ravitemer/mcphub.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
build = "npm install -g mcp-hub@latest", -- Installs `mcp-hub` node binary globally
|
||||
config = function()
|
||||
require("mcphub").setup({
|
||||
--- `mcp-hub` binary related options-------------------
|
||||
config = vim.fn.expand("~/.config/mcphub/servers.json"), -- Absolute path to MCP Servers config file (will create if not exists)
|
||||
port = 37373, -- The port `mcp-hub` server listens to
|
||||
shutdown_delay = 60 * 10 * 000, -- Delay in ms before shutting down the server when last instance closes (default: 10 minutes)
|
||||
use_bundled_binary = false, -- Use local `mcp-hub` binary (set this to true when using build = "bundled_build.lua")
|
||||
mcp_request_timeout = 60000, --Max time allowed for a MCP tool or resource to execute in milliseconds, set longer for long running tasks
|
||||
|
||||
---Chat-plugin related options-----------------
|
||||
auto_approve = false, -- Auto approve mcp tool calls
|
||||
auto_toggle_mcp_servers = true, -- Let LLMs start and stop MCP servers automatically
|
||||
extensions = {
|
||||
avante = {
|
||||
make_slash_commands = true, -- make /slash commands from MCP server prompts
|
||||
},
|
||||
},
|
||||
|
||||
--- Plugin specific options-------------------
|
||||
native_servers = {}, -- add your custom lua native servers here
|
||||
ui = {
|
||||
window = {
|
||||
width = 0.8, -- 0-1 (ratio); "50%" (percentage); 50 (raw number)
|
||||
height = 0.8, -- 0-1 (ratio); "50%" (percentage); 50 (raw number)
|
||||
relative = "editor",
|
||||
zindex = 50,
|
||||
border = "rounded", -- "none", "single", "double", "rounded", "solid", "shadow"
|
||||
},
|
||||
wo = { -- window-scoped options (vim.wo)
|
||||
winhl = "Normal:MCPHubNormal,FloatBorder:MCPHubBorder",
|
||||
},
|
||||
},
|
||||
on_ready = function(hub)
|
||||
-- Called when hub is ready
|
||||
end,
|
||||
on_error = function(err)
|
||||
-- Called on errors
|
||||
end,
|
||||
log = {
|
||||
level = vim.log.levels.WARN,
|
||||
to_file = false,
|
||||
file_path = nil,
|
||||
prefix = "MCPHub",
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -34,6 +34,7 @@ return {
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion
|
||||
["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
|
||||
|
||||
@@ -71,12 +71,6 @@ return {
|
||||
-- Navigate Forward (Enter a Folder)
|
||||
vim.keymap.set("n", "<leader>f", api.tree.change_root_to_node, opts)
|
||||
|
||||
-- Reload the tree (useful when files are added/removed)
|
||||
vim.keymap.set("n", "l", function()
|
||||
api.tree.reload() -- Reload the tree
|
||||
print("NvimTree reloaded!") -- Optional confirmation message
|
||||
end, opts)
|
||||
|
||||
-- File Management keybindings
|
||||
vim.keymap.set("n", "a", function() -- Add a new file
|
||||
vim.cmd("set modifiable") -- Ensure modifiable mode is on
|
||||
|
||||
@@ -1,4 +1,22 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"lua",
|
||||
"html", -- required by leetcode.nvim
|
||||
"python",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"cpp",
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
lazy = true,
|
||||
config = function()
|
||||
@@ -107,4 +125,5 @@ return {
|
||||
vim.keymap.set({ "n", "x", "o" }, "t", ts_repeat_move.builtin_t)
|
||||
vim.keymap.set({ "n", "x", "o" }, "T", ts_repeat_move.builtin_T)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user