adding notes
This commit is contained in:
5
.nvim/project.lua
Normal file
5
.nvim/project.lua
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
return {
|
||||||
|
type = 'custom',
|
||||||
|
run = [[yarn start]],
|
||||||
|
debug = [[yarn start]],
|
||||||
|
}
|
||||||
27
lua/cargdev/core/function/project_commands.lua
Normal file
27
lua/cargdev/core/function/project_commands.lua
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
vim.api.nvim_create_user_command("RunProject", function()
|
||||||
|
local config_path = ".nvim/project.lua"
|
||||||
|
if vim.fn.filereadable(config_path) == 0 then
|
||||||
|
vim.notify("No project config found. Run `:e` on any file to generate it.", vim.log.levels.WARN)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local config = loadfile(config_path)()
|
||||||
|
if config and config.run then
|
||||||
|
vim.cmd("vsplit | terminal " .. config.run)
|
||||||
|
else
|
||||||
|
vim.notify("Run command not found in project config.", vim.log.levels.ERROR)
|
||||||
|
end
|
||||||
|
end, {})
|
||||||
|
|
||||||
|
vim.api.nvim_create_user_command("DebugProject", function()
|
||||||
|
local config_path = ".nvim/project.lua"
|
||||||
|
if vim.fn.filereadable(config_path) == 0 then
|
||||||
|
vim.notify("No project config found. Run `:e` on any file to generate it.", vim.log.levels.WARN)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local config = loadfile(config_path)()
|
||||||
|
if config and config.debug then
|
||||||
|
vim.cmd("vsplit | terminal " .. config.debug)
|
||||||
|
else
|
||||||
|
vim.notify("Debug command not found in project config.", vim.log.levels.ERROR)
|
||||||
|
end
|
||||||
|
end, {})
|
||||||
@@ -16,4 +16,12 @@ local function load_functions()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--[[ vim.api.nvim_create_autocmd("BufReadPost", {
|
||||||
|
once = true,
|
||||||
|
callback = function()
|
||||||
|
require("cargdev.core.project_config").bootstrap_config()
|
||||||
|
end
|
||||||
|
})
|
||||||
|
]]
|
||||||
load_functions()
|
load_functions()
|
||||||
|
|||||||
@@ -65,3 +65,7 @@ keymap.set("n", "<C-l>", ":vertical resize -5<CR>", { noremap = true, silent = t
|
|||||||
keymap.set("n", "<C-h>", ":vertical resize +5<CR>", { noremap = true, silent = true })
|
keymap.set("n", "<C-h>", ":vertical resize +5<CR>", { noremap = true, silent = true })
|
||||||
keymap.set("n", "<C-k>", ":resize +5<CR>", { noremap = true, silent = true })
|
keymap.set("n", "<C-k>", ":resize +5<CR>", { noremap = true, silent = true })
|
||||||
keymap.set("n", "<C-j>", ":resize -5<CR>", { noremap = true, silent = true })
|
keymap.set("n", "<C-j>", ":resize -5<CR>", { noremap = true, silent = true })
|
||||||
|
|
||||||
|
-- Run and Debug Project
|
||||||
|
keymap.set("n", "<leader>pr", ":RunProject<CR>", { desc = "Run Project" })
|
||||||
|
keymap.set("n", "<leader>pd", ":DebugProject<CR>", { desc = "Debug Project" })
|
||||||
|
|||||||
57
lua/cargdev/core/project_config.lua
Normal file
57
lua/cargdev/core/project_config.lua
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
local M = {}
|
||||||
|
|
||||||
|
local function ask_input(prompt, default)
|
||||||
|
vim.fn.inputsave()
|
||||||
|
local result = vim.fn.input(prompt .. " [" .. default .. "]: ")
|
||||||
|
vim.fn.inputrestore()
|
||||||
|
return result ~= "" and result or default
|
||||||
|
end
|
||||||
|
|
||||||
|
local function detect_project_type()
|
||||||
|
if vim.fn.filereadable("pom.xml") == 1 then
|
||||||
|
return "java"
|
||||||
|
elseif vim.fn.filereadable("angular.json") == 1 then
|
||||||
|
return "angular"
|
||||||
|
elseif vim.fn.filereadable("package.json") == 1 then
|
||||||
|
local pkg = vim.fn.readfile("package.json")
|
||||||
|
for _, line in ipairs(pkg) do
|
||||||
|
if line:match("nestjs") then return "node" end
|
||||||
|
if line:match("react") then return "react" end
|
||||||
|
end
|
||||||
|
return "node"
|
||||||
|
end
|
||||||
|
return "custom"
|
||||||
|
end
|
||||||
|
|
||||||
|
M.bootstrap_config = function()
|
||||||
|
local config_file = ".nvim/project.lua"
|
||||||
|
if vim.fn.filereadable(config_file) == 1 then return end
|
||||||
|
|
||||||
|
vim.fn.mkdir(".nvim", "p")
|
||||||
|
|
||||||
|
local type = detect_project_type()
|
||||||
|
vim.notify("Detected project type: " .. type, vim.log.levels.INFO)
|
||||||
|
|
||||||
|
-- Ask user for run/debug commands
|
||||||
|
local run = ask_input("Enter run command", type == "java" and "./mvnw spring-boot:run" or "yarn start")
|
||||||
|
local debug = ask_input("Enter debug command", type == "java"
|
||||||
|
and "./mvnw spring-boot:run -Dspring-boot.run.jvmArguments='-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005'"
|
||||||
|
or "node --inspect-brk dist/main.js")
|
||||||
|
|
||||||
|
-- Write to file
|
||||||
|
local f = io.open(config_file, "w")
|
||||||
|
if f then
|
||||||
|
f:write("return {\n")
|
||||||
|
f:write(" type = '" .. type .. "',\n")
|
||||||
|
f:write(" run = [[" .. run .. "]],\n")
|
||||||
|
f:write(" debug = [[" .. debug .. "]],\n")
|
||||||
|
f:write("}\n")
|
||||||
|
f:close()
|
||||||
|
vim.notify("Project configuration written to " .. config_file, vim.log.levels.INFO)
|
||||||
|
else
|
||||||
|
vim.notify("Failed to write config file", vim.log.levels.ERROR)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"CarGDev/avante.nvim",
|
"yetone/avante.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
version = false, -- Always pull the latest change
|
version = false, -- Always pull the latest change
|
||||||
opts = {
|
opts = {
|
||||||
provider = "cargdev", -- API provider configuration
|
provider = "cargdev", -- API provider configuration
|
||||||
vendors = {
|
vendors = {
|
||||||
cargdev = {
|
cargdev = {
|
||||||
name = "cargdev", -- Optional
|
name = "cargdev", -- Optional
|
||||||
endpoint = "https://api-ai.cargdev.io/api/generate",
|
endpoint = "https://api-ai.cargdev.io/api/generate",
|
||||||
api_key_name = "CARGDEV_API_KEY", -- reference the ENV VAR below
|
api_key_name = "CARGDEV_API_KEY", -- reference the ENV VAR below
|
||||||
model = "qwen2.5-coder:7b",
|
model = "codellama:7b",
|
||||||
__inherited_from = "ollama", -- ensures compatibility
|
__inherited_from = "ollama", -- ensures compatibility
|
||||||
max_tokens = 8192,
|
max_tokens = 8192,
|
||||||
},
|
},
|
||||||
@@ -21,12 +21,12 @@ return {
|
|||||||
build = "make",
|
build = "make",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-treesitter/nvim-treesitter", -- Syntax highlighting support
|
"nvim-treesitter/nvim-treesitter", -- Syntax highlighting support
|
||||||
"stevearc/dressing.nvim", -- UI elements
|
"stevearc/dressing.nvim", -- UI elements
|
||||||
"nvim-lua/plenary.nvim", -- Utility library
|
"nvim-lua/plenary.nvim", -- Utility library
|
||||||
"MunifTanjim/nui.nvim", -- UI library for modal components
|
"MunifTanjim/nui.nvim", -- UI library for modal components
|
||||||
-- Optional dependencies:
|
-- Optional dependencies:
|
||||||
"nvim-tree/nvim-web-devicons", -- Icons support
|
"nvim-tree/nvim-web-devicons", -- Icons support
|
||||||
"zbirenbaum/copilot.lua", -- Copilot integration
|
"zbirenbaum/copilot.lua", -- Copilot integration
|
||||||
{
|
{
|
||||||
"HakonHarnes/img-clip.nvim", -- Image pasting support
|
"HakonHarnes/img-clip.nvim", -- Image pasting support
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
@@ -38,18 +38,19 @@ return {
|
|||||||
drag_and_drop = {
|
drag_and_drop = {
|
||||||
insert_mode = true,
|
insert_mode = true,
|
||||||
},
|
},
|
||||||
use_absolute_path = true, -- For Windows users
|
use_absolute_path = true, -- For Windows users
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"MeanderingProgrammer/render-markdown.nvim", -- Render markdown support
|
"MeanderingProgrammer/render-markdown.nvim",
|
||||||
opts = {
|
|
||||||
file_types = { "markdown", "Avante" },
|
|
||||||
},
|
|
||||||
ft = { "markdown", "Avante" },
|
ft = { "markdown", "Avante" },
|
||||||
|
config = function()
|
||||||
|
require("render-markdown").setup({
|
||||||
|
file_types = { "markdown", "Avante" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
32
lua/cargdev/plugins/companion.lua.bak
Normal file
32
lua/cargdev/plugins/companion.lua.bak
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
-- return {
|
||||||
|
-- {
|
||||||
|
-- "olimorris/codecompanion.nvim",
|
||||||
|
-- event = "VeryLazy",
|
||||||
|
-- lazy = false,
|
||||||
|
-- version = false,
|
||||||
|
-- opts = {
|
||||||
|
-- adapters = {
|
||||||
|
-- openai = function()
|
||||||
|
-- return require("codecompanion.adapters").extend("openai", {
|
||||||
|
-- name = "openai",
|
||||||
|
-- model = "codellama:7b",
|
||||||
|
-- endpoint = "https://api-ai.cargdev.io/v1",
|
||||||
|
-- api_key = os.getenv("CARGDEV_API_KEY"),
|
||||||
|
-- max_tokens = 2048,
|
||||||
|
-- })
|
||||||
|
-- end,
|
||||||
|
-- },
|
||||||
|
-- strategies = {
|
||||||
|
-- chat = { adapter = "openai" },
|
||||||
|
-- inline = { adapter = "openai" },
|
||||||
|
-- agent = { adapter = "openai" },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- dependencies = {
|
||||||
|
-- "nvim-lua/plenary.nvim",
|
||||||
|
-- "nvim-treesitter/nvim-treesitter",
|
||||||
|
-- "nvim-telescope/telescope.nvim",
|
||||||
|
-- },
|
||||||
|
-- }
|
||||||
|
-- }
|
||||||
|
--
|
||||||
@@ -1,27 +1,108 @@
|
|||||||
return {
|
return {
|
||||||
"mfussenegger/nvim-dap",
|
"mfussenegger/nvim-dap",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{ "nvim-neotest/nvim-nio", lazy = false }, -- Ensure `nvim-nio` loads first
|
{ "nvim-neotest/nvim-nio", lazy = false },
|
||||||
"rcarriga/nvim-dap-ui",
|
"rcarriga/nvim-dap-ui",
|
||||||
"jay-babu/mason-nvim-dap.nvim",
|
"jay-babu/mason-nvim-dap.nvim",
|
||||||
"mfussenegger/nvim-dap-python",
|
"mfussenegger/nvim-dap-python",
|
||||||
"theHamsta/nvim-dap-virtual-text",
|
"theHamsta/nvim-dap-virtual-text",
|
||||||
"nvim-telescope/telescope-dap.nvim",
|
"nvim-telescope/telescope-dap.nvim",
|
||||||
|
"Weissle/persistent-breakpoints.nvim",
|
||||||
|
{
|
||||||
|
"nvim-neotest/neotest",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-neotest/neotest-jest",
|
||||||
|
"nvim-neotest/neotest-python",
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"antoinemadec/FixCursorHold.nvim",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("neotest").setup({
|
||||||
|
adapters = {
|
||||||
|
require("neotest-jest")({}),
|
||||||
|
require("neotest-python")({}),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local dap = require("dap")
|
local dap = require("dap")
|
||||||
local dapui = require("dapui")
|
local dapui = require("dapui")
|
||||||
|
local widgets = require("dap.ui.widgets")
|
||||||
|
local api, fn = vim.api, vim.fn
|
||||||
|
local keymap = vim.keymap.set
|
||||||
|
|
||||||
-- UI Setup
|
-- 🎯 Fixed Layout UI (no floating)
|
||||||
dapui.setup()
|
dapui.setup({
|
||||||
|
layouts = {
|
||||||
|
{
|
||||||
|
elements = {
|
||||||
|
{ id = "scopes", size = 0.25 },
|
||||||
|
{ id = "breakpoints", size = 0.25 },
|
||||||
|
{ id = "stacks", size = 0.25 },
|
||||||
|
{ id = "watches", size = 0.25 },
|
||||||
|
},
|
||||||
|
size = 40, -- width (left)
|
||||||
|
position = "left",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
elements = {
|
||||||
|
{ id = "repl", size = 0.5 },
|
||||||
|
{ id = "console", size = 0.5 },
|
||||||
|
},
|
||||||
|
size = 10, -- height (bottom)
|
||||||
|
position = "bottom",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
controls = {
|
||||||
|
enabled = true,
|
||||||
|
element = "repl",
|
||||||
|
icons = {
|
||||||
|
pause = "⏸",
|
||||||
|
play = "▶",
|
||||||
|
step_into = "⤵",
|
||||||
|
step_over = "⏭",
|
||||||
|
step_out = "⤴",
|
||||||
|
step_back = "⏮",
|
||||||
|
run_last = "🔁",
|
||||||
|
terminate = "⏹",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
floating = { border = "rounded", mappings = { close = { "q", "<Esc>" } } },
|
||||||
|
windows = { indent = 1 },
|
||||||
|
})
|
||||||
|
|
||||||
-- Mason Debugger Installer
|
-- 🧠 Mason DAP
|
||||||
require("mason-nvim-dap").setup({
|
require("mason-nvim-dap").setup({
|
||||||
ensure_installed = { "node2", "chrome", "firefox" },
|
ensure_installed = { "node2", "chrome", "firefox" },
|
||||||
automatic_setup = true,
|
automatic_setup = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Automatically open DAP UI when debugging starts
|
-- 🔍 Virtual Text
|
||||||
|
require("nvim-dap-virtual-text").setup({
|
||||||
|
commented = true,
|
||||||
|
highlight_changed_variables = true,
|
||||||
|
highlight_new_as_changed = true,
|
||||||
|
virt_text_pos = "eol",
|
||||||
|
all_frames = true,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- 💾 Persistent Breakpoints
|
||||||
|
require("persistent-breakpoints").setup({
|
||||||
|
load_breakpoints_event = { "BufReadPost" },
|
||||||
|
})
|
||||||
|
|
||||||
|
api.nvim_create_autocmd("VimLeavePre", {
|
||||||
|
callback = function()
|
||||||
|
local ok, pb = pcall(require, "persistent-breakpoints.api")
|
||||||
|
if ok and type(pb.save_breakpoints) == "function" then
|
||||||
|
pb.save_breakpoints()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- 🔁 Auto-open/close UI on debug events
|
||||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||||
dapui.open()
|
dapui.open()
|
||||||
end
|
end
|
||||||
@@ -32,56 +113,63 @@ return {
|
|||||||
dapui.close()
|
dapui.close()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Enable virtual text for debugging
|
-- 🎮 Keymaps
|
||||||
require("nvim-dap-virtual-text").setup({})
|
keymap("n", "<leader>dc", dap.continue, { desc = "▶ Start Debugging" })
|
||||||
|
keymap("n", "<leader>do", dap.step_over, { desc = "⏭ Step Over" })
|
||||||
-- Keymaps for debugging
|
keymap("n", "<leader>di", dap.step_into, { desc = "⤵ Step Into" })
|
||||||
local keymap = vim.keymap.set
|
keymap("n", "<leader>dot", dap.step_out, { desc = "⤴ Step Out" })
|
||||||
keymap("n", "<leader>dc", "<Cmd>lua require'dap'.continue()<CR>", { desc = "Start Debugging" })
|
keymap("n", "<leader>db", dap.toggle_breakpoint, { desc = "🔴 Toggle Breakpoint" })
|
||||||
|
|
||||||
keymap("n", "<leader>do", function()
|
|
||||||
dap.step_over()
|
|
||||||
end, { desc = "Step Over" })
|
|
||||||
|
|
||||||
keymap("n", "<leader>di", function()
|
|
||||||
dap.step_into()
|
|
||||||
end, { desc = "Step Into" })
|
|
||||||
|
|
||||||
keymap("n", "<leader>dot", function()
|
|
||||||
dap.step_out()
|
|
||||||
end, { desc = "Step Out" })
|
|
||||||
|
|
||||||
keymap("n", "<leader>db", function()
|
|
||||||
dap.toggle_breakpoint()
|
|
||||||
end, { desc = "Toggle Breakpoint" })
|
|
||||||
|
|
||||||
keymap("n", "<leader>dB", function()
|
keymap("n", "<leader>dB", function()
|
||||||
dap.set_breakpoint(vim.fn.input("Breakpoint condition: "))
|
dap.set_breakpoint(fn.input("Breakpoint condition: "))
|
||||||
end, { desc = "Conditional Breakpoint" })
|
end, { desc = "⚠ Conditional Breakpoint" })
|
||||||
|
keymap("n", "<leader>dr", dap.repl.open, { desc = "💬 Open REPL" })
|
||||||
|
keymap("n", "<leader>dl", dap.run_last, { desc = "🔁 Run Last Debug" })
|
||||||
|
keymap("n", "<leader>du", dapui.toggle, { desc = "🧩 Toggle DAP UI" })
|
||||||
|
keymap("n", "<leader>dq", dap.terminate, { desc = "⛔ Stop Debugging" })
|
||||||
|
|
||||||
keymap("n", "<leader>dr", function()
|
-- 🧼 Reset UI
|
||||||
dap.repl.open()
|
keymap("n", "<leader>drt", function()
|
||||||
end, { desc = "Open REPL" })
|
dap.terminate()
|
||||||
|
dapui.close()
|
||||||
|
vim.defer_fn(function()
|
||||||
|
dapui.open()
|
||||||
|
end, 200)
|
||||||
|
end, { desc = "🧼 Reset DAP UI Layout" })
|
||||||
|
|
||||||
keymap("n", "<leader>dl", function()
|
-- 🔭 Telescope Integration
|
||||||
dap.run_last()
|
require("telescope").load_extension("dap")
|
||||||
end, { desc = "Run Last Debug Session" })
|
keymap("n", "<leader>dcf", "<cmd>Telescope dap configurations<cr>", { desc = "🔭 DAP Configs" })
|
||||||
|
keymap("n", "<leader>dcb", "<cmd>Telescope dap list_breakpoints<cr>", { desc = "🧷 List Breakpoints" })
|
||||||
|
keymap("n", "<leader>dco", "<cmd>Telescope dap commands<cr>", { desc = "⚙️ DAP Commands" })
|
||||||
|
|
||||||
keymap("n", "<leader>du", function()
|
-- 🧿 Sign Icons
|
||||||
dapui.toggle()
|
for name, icon in pairs({
|
||||||
end, { desc = "Toggle DAP UI" })
|
DapBreakpoint = "🔴",
|
||||||
|
DapBreakpointCondition = "⚠️",
|
||||||
keymap("n", "<leader>dq", "<Cmd>lua require'dap'.terminate()<CR>", { desc = "Stop Debugging" })
|
DapBreakpointRejected = "🚫",
|
||||||
|
DapLogPoint = "💬",
|
||||||
-- Java DAP Configuration
|
DapStopped = "▶",
|
||||||
dap.adapters.java = function(callback)
|
}) do
|
||||||
callback({
|
fn.sign_define(name, { text = icon, texthl = "DiagnosticSignInfo", linehl = "", numhl = "" })
|
||||||
type = "server",
|
|
||||||
host = "127.0.0.1",
|
|
||||||
port = { port }, -- Port JDTLS uses for debugging
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 🔁 NestJS Smart Watcher (optional)
|
||||||
|
api.nvim_create_autocmd("BufWritePost", {
|
||||||
|
pattern = "*.ts",
|
||||||
|
callback = function()
|
||||||
|
if fn.filereadable(".nvim/project.lua") == 1 then
|
||||||
|
local config = loadfile(".nvim/project.lua")()
|
||||||
|
if config and config.run and config.run:match("nest") then
|
||||||
|
-- Your custom logic here
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- ☕ Java Debug Adapter
|
||||||
|
dap.adapters.java = function(callback)
|
||||||
|
callback({ type = "server", host = "127.0.0.1", port = { port } })
|
||||||
|
end
|
||||||
dap.configurations.java = {
|
dap.configurations.java = {
|
||||||
{
|
{
|
||||||
name = "Attach to running Java process",
|
name = "Attach to running Java process",
|
||||||
@@ -92,11 +180,13 @@ return {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Node.js Adapter Configuration for NestJS
|
-- 🧠 Node.js (NestJS / TypeScript)
|
||||||
dap.adapters.node2 = {
|
dap.adapters.node2 = {
|
||||||
type = "executable",
|
type = "executable",
|
||||||
command = "node",
|
command = "node",
|
||||||
args = { os.getenv("HOME") .. "/.local/share/nvim/mason/packages/node-debug2-adapter/out/src/nodedebug.js" },
|
args = {
|
||||||
|
os.getenv("HOME") .. "/.local/share/nvim/mason/packages/node-debug2-adapter/out/src/nodedebug.js",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
dap.configurations.typescript = {
|
dap.configurations.typescript = {
|
||||||
@@ -110,82 +200,21 @@ return {
|
|||||||
outFiles = { "${workspaceFolder}/dist/**/*.js" },
|
outFiles = { "${workspaceFolder}/dist/**/*.js" },
|
||||||
sourceMaps = true,
|
sourceMaps = true,
|
||||||
protocol = "inspector",
|
protocol = "inspector",
|
||||||
cwd = vim.fn.getcwd(),
|
cwd = fn.getcwd(),
|
||||||
runtimeArgs = { "--inspect-brk" }, -- 🚀 Ensures debugging starts properly
|
runtimeArgs = { "--inspect-brk" },
|
||||||
restart = true,
|
restart = true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "Attach to Process",
|
name = "Attach to NestJS (start:debug)",
|
||||||
type = "node2",
|
type = "node2",
|
||||||
request = "attach",
|
request = "attach",
|
||||||
processId = require("dap.utils").pick_process,
|
port = 9229,
|
||||||
|
protocol = "inspector",
|
||||||
|
cwd = fn.getcwd(),
|
||||||
|
sourceMaps = true,
|
||||||
|
outFiles = { "${workspaceFolder}/dist/**/*.js" },
|
||||||
|
skipFiles = { "<node_internals>/**" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- dap.configurations.typescript = {
|
|
||||||
-- {
|
|
||||||
-- name = "Launch NestJS",
|
|
||||||
-- type = "node2",
|
|
||||||
-- request = "launch",
|
|
||||||
-- program = "${workspaceFolder}/dist/main.js", -- ⚠️ Ensure this is correct!
|
|
||||||
-- args = {},
|
|
||||||
-- console = "integratedTerminal",
|
|
||||||
-- outFiles = { "${workspaceFolder}/dist/**/*.js" },
|
|
||||||
-- sourceMaps = true,
|
|
||||||
-- protocol = "inspector",
|
|
||||||
-- cwd = vim.fn.getcwd(),
|
|
||||||
-- runtimeArgs = { "--nolazy" },
|
|
||||||
-- },
|
|
||||||
-- {
|
|
||||||
-- name = "Attach to Process",
|
|
||||||
-- type = "node2",
|
|
||||||
-- request = "attach",
|
|
||||||
-- processId = require("dap.utils").pick_process,
|
|
||||||
-- },
|
|
||||||
-- }
|
|
||||||
|
|
||||||
-- dap.adapters.chrome = {
|
|
||||||
-- type = "executable",
|
|
||||||
-- command = "node",
|
|
||||||
-- args = { os.getenv("HOME") .. "/.local/share/nvim/mason/packages/chrome-debug-adapter/out/src/chromeDebug.js" },
|
|
||||||
-- }
|
|
||||||
--
|
|
||||||
-- dap.configurations.typescript = {
|
|
||||||
-- {
|
|
||||||
-- name = "Attach to Chrome",
|
|
||||||
-- type = "chrome",
|
|
||||||
-- request = "attach",
|
|
||||||
-- program = "${file}",
|
|
||||||
-- cwd = vim.fn.getcwd(),
|
|
||||||
-- port = 9222, -- 🚀 Chrome debugging port
|
|
||||||
-- webRoot = "${workspaceFolder}",
|
|
||||||
-- sourceMaps = true,
|
|
||||||
-- skipFiles = { "<node_internals>/**", "webpack://_N_E/./node_modules/**" },
|
|
||||||
-- },
|
|
||||||
-- {
|
|
||||||
-- name = "Launch Chrome with DevTools",
|
|
||||||
-- type = "chrome",
|
|
||||||
-- request = "launch",
|
|
||||||
-- url = "http://localhost:4000", -- Your React app runs on this port
|
|
||||||
-- webRoot = "${workspaceFolder}",
|
|
||||||
-- runtimeArgs = { "--remote-debugging-port=9222" },
|
|
||||||
-- sourceMaps = true,
|
|
||||||
-- skipFiles = { "<node_internals>/**", "webpack://_N_E/./node_modules/**" },
|
|
||||||
-- },
|
|
||||||
-- }
|
|
||||||
--
|
|
||||||
-- dap.configurations.javascript = {
|
|
||||||
-- {
|
|
||||||
-- name = "Attach to Chrome",
|
|
||||||
-- type = "chrome",
|
|
||||||
-- request = "attach",
|
|
||||||
-- program = "${file}",
|
|
||||||
-- cwd = vim.fn.getcwd(),
|
|
||||||
-- port = 9222, -- 🚀 Default Chrome Debug Port
|
|
||||||
-- webRoot = "${workspaceFolder}",
|
|
||||||
-- sourceMaps = true,
|
|
||||||
-- skipFiles = { "<node_internals>/**", "webpack://_N_E/./node_modules/**" },
|
|
||||||
-- },
|
|
||||||
-- }
|
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
11
lua/cargdev/plugins/fileOperations.lua
Normal file
11
lua/cargdev/plugins/fileOperations.lua
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
return {
|
||||||
|
"antosha417/nvim-lsp-file-operations",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"nvim-tree/nvim-tree.lua", -- or "nvim-neo-tree/neo-tree.nvim"
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("lsp-file-operations").setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
@@ -5,6 +5,7 @@ return {
|
|||||||
"hrsh7th/cmp-nvim-lsp",
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
{ "antosha417/nvim-lsp-file-operations", config = true },
|
{ "antosha417/nvim-lsp-file-operations", config = true },
|
||||||
{ "folke/neodev.nvim", opts = {} },
|
{ "folke/neodev.nvim", opts = {} },
|
||||||
|
{ "pmizio/typescript-tools.nvim", dependencies = { "nvim-lua/plenary.nvim" } }, -- <- CORRECT HERE
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
-- import lspconfig plugin
|
-- import lspconfig plugin
|
||||||
@@ -64,6 +65,27 @@ return {
|
|||||||
|
|
||||||
opts.desc = "Restart LSP"
|
opts.desc = "Restart LSP"
|
||||||
keymap.set("n", "<leader>rs", ":LspRestart<CR>", opts) -- mapping to restart lsp if necessary
|
keymap.set("n", "<leader>rs", ":LspRestart<CR>", opts) -- mapping to restart lsp if necessary
|
||||||
|
vim.api.nvim_create_autocmd("CursorHold", {
|
||||||
|
buffer = ev.buf,
|
||||||
|
callback = function()
|
||||||
|
vim.diagnostic.open_float(nil, { focusable = false })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
vim.o.updatetime = 250
|
||||||
|
vim.diagnostic.config({
|
||||||
|
float = {
|
||||||
|
border = "rounded",
|
||||||
|
source = "always", -- Or "if_many"
|
||||||
|
header = "",
|
||||||
|
prefix = "",
|
||||||
|
},
|
||||||
|
virtual_text = {
|
||||||
|
spacing = 4,
|
||||||
|
prefix = "●", -- Could be '●', '■', '▎', or empty ""
|
||||||
|
severity = { min = vim.diagnostic.severity.WARN }, -- only show Warn or higher
|
||||||
|
},
|
||||||
|
severity_sort = true,
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -81,6 +103,7 @@ return {
|
|||||||
mason_lspconfig.setup_handlers({
|
mason_lspconfig.setup_handlers({
|
||||||
["tsserver"] = function()
|
["tsserver"] = function()
|
||||||
lspconfig["tsserver"].setup({
|
lspconfig["tsserver"].setup({
|
||||||
|
cmd = { "typescript-language-server", "--stdio" },
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
root_dir = lspconfig.util.root_pattern("package.json"),
|
root_dir = lspconfig.util.root_pattern("package.json"),
|
||||||
settings = {
|
settings = {
|
||||||
@@ -165,5 +188,17 @@ return {
|
|||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
require("typescript-tools").setup({
|
||||||
|
settings = {
|
||||||
|
expose_as_code_action = "all",
|
||||||
|
tsserver_file_preferences = {
|
||||||
|
importModuleSpecifierPreference = "relative",
|
||||||
|
quotePreference = "single",
|
||||||
|
},
|
||||||
|
tsserver_format_options = {
|
||||||
|
allowIncompleteCompletions = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,14 @@ return {
|
|||||||
vim.g.loaded_netrw = 1
|
vim.g.loaded_netrw = 1
|
||||||
vim.g.loaded_netrwPlugin = 1
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
|
||||||
|
-- 🧼 Remove invalid autocommand (FileExplorer) if it exists
|
||||||
|
vim.api.nvim_create_autocmd("VimEnter", {
|
||||||
|
once = true,
|
||||||
|
callback = function()
|
||||||
|
pcall(vim.cmd, "autocmd! FileExplorer *")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
nvimtree.setup({
|
nvimtree.setup({
|
||||||
view = {
|
view = {
|
||||||
width = 35,
|
width = 35,
|
||||||
|
|||||||
95
tree.log
95
tree.log
@@ -1,5 +1,4 @@
|
|||||||
.
|
.
|
||||||
├── README.md
|
|
||||||
├── ftplugin
|
├── ftplugin
|
||||||
│ └── java.lua
|
│ └── java.lua
|
||||||
├── init.lua
|
├── init.lua
|
||||||
@@ -8,52 +7,52 @@
|
|||||||
├── lazigitconfig.log
|
├── lazigitconfig.log
|
||||||
├── lazy-lock.json
|
├── lazy-lock.json
|
||||||
├── lua
|
├── lua
|
||||||
│ ├── cargdev
|
│ └── cargdev
|
||||||
│ │ ├── core
|
│ ├── core
|
||||||
│ │ │ ├── function
|
│ │ ├── function
|
||||||
│ │ │ │ └── openTerminal.lua
|
│ │ │ └── openTerminal.lua
|
||||||
│ │ │ ├── init.lua
|
│ │ ├── init.lua
|
||||||
│ │ │ ├── keymaps.lua
|
│ │ ├── keymaps.lua
|
||||||
│ │ │ └── options.lua
|
│ │ └── options.lua
|
||||||
│ │ ├── lazy.lua
|
│ ├── lazy.lua
|
||||||
│ │ └── plugins
|
│ └── plugins
|
||||||
│ │ ├── alpha.lua
|
│ ├── aicargdev.lua
|
||||||
│ │ ├── auto-session.lua
|
│ ├── alpha.lua
|
||||||
│ │ ├── autopairs.lua
|
│ ├── auto-session.lua
|
||||||
│ │ ├── bufferline.lua
|
│ ├── autopairs.lua
|
||||||
│ │ ├── buffertabs.lua
|
│ ├── bufferline.lua
|
||||||
│ │ ├── colorscheme.lua
|
│ ├── buffertabs.lua
|
||||||
│ │ ├── comments.lua
|
│ ├── colorscheme.lua
|
||||||
│ │ ├── copilot.lua
|
│ ├── comments.lua
|
||||||
│ │ ├── dap.lua
|
│ ├── copilot.lua
|
||||||
│ │ ├── dressing.lua
|
│ ├── dap.lua
|
||||||
│ │ ├── formatting.lua
|
│ ├── dressing.lua
|
||||||
│ │ ├── gitsigns.lua
|
│ ├── formatting.lua
|
||||||
│ │ ├── indent-blankline.lua
|
│ ├── gitsigns.lua
|
||||||
│ │ ├── init.lua
|
│ ├── indent-blankline.lua
|
||||||
│ │ ├── lazygit.lua
|
│ ├── init.lua
|
||||||
│ │ ├── linting.lua
|
│ ├── lazygit.lua
|
||||||
│ │ ├── lsp
|
│ ├── linting.lua
|
||||||
│ │ │ ├── jdtls.lua
|
│ ├── lsp
|
||||||
│ │ │ ├── lspconfig.lua
|
│ │ ├── lspconfig.lua
|
||||||
│ │ │ └── mason.lua
|
│ │ └── mason.lua
|
||||||
│ │ ├── lualine.lua
|
│ ├── lualine.lua
|
||||||
│ │ ├── noice.lua
|
│ ├── noice.lua
|
||||||
│ │ ├── nvim-cmp.lua
|
│ ├── nvim-cmp.lua
|
||||||
│ │ ├── nvim-jdtls.lua
|
│ ├── nvim-jdtls.lua
|
||||||
│ │ ├── nvim-tree.lua
|
│ ├── nvim-tree.lua
|
||||||
│ │ ├── nvim-treesitter-text-objects.lua
|
│ ├── nvim-treesitter-text-objects.lua
|
||||||
│ │ ├── substitute.lua
|
│ ├── substitute.lua
|
||||||
│ │ ├── surround.lua
|
│ ├── surround.lua
|
||||||
│ │ ├── telescope.lua
|
│ ├── telescope.lua
|
||||||
│ │ ├── tmux.lua
|
│ ├── tmux.lua
|
||||||
│ │ ├── todo-comments.lua
|
│ ├── todo-comments.lua
|
||||||
│ │ ├── treesitter.lua
|
│ ├── treesitter.lua
|
||||||
│ │ ├── trouble.lua
|
│ ├── trouble.lua
|
||||||
│ │ ├── vim-maximizer.lua
|
│ ├── vim-maximizer.lua
|
||||||
│ │ ├── wakatime.lua
|
│ ├── wakatime.lua
|
||||||
│ │ └── which-key.lua
|
│ └── which-key.lua
|
||||||
│ └── myconfig
|
├── README.md
|
||||||
└── tree.log
|
└── tree.log
|
||||||
|
|
||||||
9 directories, 48 files
|
8 directories, 48 files
|
||||||
|
|||||||
Reference in New Issue
Block a user