fixing configuration to change the windows
This commit is contained in:
29
CHANGELOG.md
29
CHANGELOG.md
@@ -9,6 +9,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
- **Python Debugger (debugpy)**: Full Python debugging support with multiple configurations
|
||||
- Launch File - Debug current Python file
|
||||
- Launch with Arguments - Debug with custom arguments
|
||||
- Attach Remote - Attach to debugpy server (port 5678)
|
||||
- Django - Debug Django with `manage.py runserver`
|
||||
- FastAPI - Debug FastAPI with uvicorn
|
||||
- Flask - Debug Flask application
|
||||
- **Node.js/NestJS Debug Configurations**: Extended TypeScript/JavaScript debugging
|
||||
- Launch NestJS (`dist/main.js`) with source maps
|
||||
- Launch Current File
|
||||
- Launch with ts-node (debug TypeScript directly)
|
||||
- Attach to NestJS (port 9229)
|
||||
- Attach to Process (pick from running processes)
|
||||
- **Mason Debug Adapters**: Added `debugpy` and `js-debug-adapter` to auto-install list
|
||||
- **README Documentation**: Added comprehensive "Debugging Setup" section with all configurations
|
||||
- **Avante.nvim AI Assistant**: Added Avante.nvim with local LLM support to README documentation
|
||||
- **Bash Treesitter Parser**: Installed bash parser for noice.nvim cmdline highlighting
|
||||
- **Local Configuration Support**: `local.lua` is now loaded at startup and exposed via `vim.g.cargdev_local`
|
||||
@@ -30,6 +45,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- `lazygit.lua` - removed commented hardcoded path
|
||||
|
||||
### Fixed
|
||||
- **Java Debug Adapter Paths**: Fixed incorrect paths in `ftplugin/java.lua`
|
||||
- Changed `java-debug` → `java-debug-adapter/extension/server/`
|
||||
- Changed `vscode-java-test` → `java-test/extension/server/`
|
||||
- **Node.js DAP Adapter**: Fixed js-debug-adapter configuration in `dap.lua`
|
||||
- Changed adapter type from `executable` to `server` (required by js-debug-adapter)
|
||||
- Renamed adapter from `node` to `pwa-node` (standard DAP name)
|
||||
- Added proper source map resolution and skipFiles patterns
|
||||
- **Auto-session Lazy Loading**: Changed from `event = "VeryLazy"` to `lazy = false` to enable session auto-restore on startup
|
||||
- **Alpha Dashboard Config**: Fixed `enable` to `enabled` (correct lazy.nvim spec key)
|
||||
- **Snacks vs Alpha Conflict**: Disabled `Snacks.dashboard` in favor of `alpha-nvim` for CARGDEV branding
|
||||
@@ -163,6 +185,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
### Modified Files
|
||||
| File | Changes |
|
||||
|------|---------|
|
||||
| `lua/cargdev/plugins/dap.lua` | Fixed Node.js adapter, added Python debugpy config |
|
||||
| `ftplugin/java.lua` | Fixed java-debug-adapter and java-test paths |
|
||||
| `lua/cargdev/plugins/lsp/mason.lua` | Added debugpy and js-debug-adapter to ensure_installed |
|
||||
| `README.md` | Added Debugging Setup section with keymaps and configurations |
|
||||
| `lua/cargdev/core/keymaps/README.md` | Added dap.lua and other keymap files to structure |
|
||||
| `lua/cargdev/core/keymaps/personal.lua` | Removed duplicates, added quickfix/location keymaps, safe buffer close |
|
||||
| `lua/cargdev/core/keymaps/plugins.lua` | Fixed session/substitute keymap conflicts |
|
||||
| `lua/cargdev/core/keymaps/general.lua` | Added vault_path validation, removed commented code |
|
||||
@@ -216,4 +243,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
---
|
||||
|
||||
*Last Updated: January 10, 2026*
|
||||
*Last Updated: January 13, 2026*
|
||||
|
||||
71
README.md
71
README.md
@@ -65,7 +65,7 @@ nvim
|
||||
- **File Explorer**: nvim-tree
|
||||
- **Git Integration**: LazyGit, Gitsigns
|
||||
- **AI Assistants**: GitHub Copilot + [Avante.nvim](https://github.com/yetone/avante.nvim) (local LLM support)
|
||||
- **Debugging**: DAP with UI
|
||||
- **Debugging**: DAP with UI (Java, Node.js/NestJS, Python)
|
||||
- **Formatting**: Conform.nvim with auto-format on save
|
||||
- **Diagnostics**: Trouble.nvim for organized diagnostics view
|
||||
|
||||
@@ -149,6 +149,33 @@ nvim
|
||||
| `<leader>ze` | Explain code (visual) |
|
||||
| `<leader>zf` | Fix code (visual) |
|
||||
|
||||
### Debugging (DAP)
|
||||
| Keymap | Description |
|
||||
|--------|-------------|
|
||||
| `<leader>dcr` | Start/Continue Debugging |
|
||||
| `<leader>db` | Toggle Breakpoint |
|
||||
| `<leader>dB` | Conditional Breakpoint |
|
||||
| `<leader>do` | Step Over |
|
||||
| `<leader>di` | Step Into |
|
||||
| `<leader>dot` | Step Out |
|
||||
| `<leader>du` | Toggle DAP UI |
|
||||
| `<leader>dq` | Stop Debugging |
|
||||
| `<leader>dr` | Open REPL |
|
||||
| `<leader>dl` | Run Last Debug |
|
||||
| `<leader>dcf` | DAP Configurations |
|
||||
| `<leader>dcb` | List Breakpoints |
|
||||
| `<leader>dco` | DAP Commands |
|
||||
|
||||
### Java Debugging
|
||||
| Keymap | Description |
|
||||
|--------|-------------|
|
||||
| `<leader>jd` | Debug Class (DAP) |
|
||||
| `<leader>jt` | Test Class |
|
||||
| `<leader>jn` | Test Nearest Method |
|
||||
| `<leader>jr` | Run Java File |
|
||||
| `<leader>jm` | Run Maven Project |
|
||||
| `<leader>jg` | Run Gradle Project |
|
||||
|
||||
## Commands
|
||||
|
||||
| Command | Description |
|
||||
@@ -159,6 +186,48 @@ nvim
|
||||
| `:CheckConfig` | Run config validation |
|
||||
| `:FormatToggle` | Toggle auto-format on save |
|
||||
|
||||
## Debugging Setup
|
||||
|
||||
This configuration includes full debugging support for multiple languages using DAP (Debug Adapter Protocol).
|
||||
|
||||
### Supported Languages
|
||||
|
||||
| Language | Debug Adapter | Configuration |
|
||||
|----------|---------------|---------------|
|
||||
| **Java** | java-debug-adapter | Auto-configured via nvim-jdtls |
|
||||
| **Node.js/NestJS/TypeScript** | js-debug-adapter (pwa-node) | Launch & Attach configurations |
|
||||
| **Python** | debugpy | Django, FastAPI, Flask, and general Python |
|
||||
|
||||
### Debug Configurations
|
||||
|
||||
#### Node.js/NestJS/TypeScript
|
||||
- **Launch NestJS** - Runs `dist/main.js` with source maps
|
||||
- **Launch Current File** - Debug the current TypeScript/JavaScript file
|
||||
- **Launch with ts-node** - Debug TypeScript directly without compilation
|
||||
- **Attach to NestJS** - Attach to running process on port 9229
|
||||
- **Attach to Process** - Pick from running Node.js processes
|
||||
|
||||
#### Python
|
||||
- **Launch File** - Debug current Python file
|
||||
- **Launch with Arguments** - Debug with custom arguments
|
||||
- **Attach Remote** - Attach to debugpy server (port 5678)
|
||||
- **Django** - Debug Django with `manage.py runserver`
|
||||
- **FastAPI** - Debug FastAPI with uvicorn
|
||||
- **Flask** - Debug Flask application
|
||||
|
||||
#### Java
|
||||
- Auto-discovers main classes and test methods
|
||||
- Hot code replacement enabled
|
||||
- Use `<leader>jd` to debug the current class
|
||||
|
||||
### Installation
|
||||
|
||||
Debug adapters are automatically installed via Mason. Run `:Mason` to verify:
|
||||
- `debugpy` - Python debugger
|
||||
- `js-debug-adapter` - Node.js/TypeScript debugger
|
||||
- `java-debug-adapter` - Java debugger
|
||||
- `java-test` - Java test runner
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Check Configuration Health
|
||||
|
||||
@@ -13,13 +13,13 @@ local extendedClientCapabilities = jdtls.extendedClientCapabilities
|
||||
|
||||
local bundles = {
|
||||
vim.fn.glob(
|
||||
home
|
||||
.. "/.local/share/nvim/mason/packages/java-debug/com.microsoft.java.debug.plugin/target/com.microsoft.java.debug.plugin-*.jar"
|
||||
home .. "/.local/share/nvim/mason/packages/java-debug-adapter/extension/server/com.microsoft.java.debug.plugin-*.jar",
|
||||
true
|
||||
),
|
||||
}
|
||||
vim.list_extend(
|
||||
bundles,
|
||||
vim.split(vim.fn.glob(home .. "/.local/share/nvim/mason/packages/vscode-java-test/server/*.jar", true), "\n")
|
||||
vim.split(vim.fn.glob(home .. "/.local/share/nvim/mason/packages/java-test/extension/server/*.jar", true), "\n")
|
||||
)
|
||||
|
||||
local config = {
|
||||
|
||||
@@ -9,9 +9,13 @@ keymaps/
|
||||
├── README.md # This file
|
||||
├── general.lua # General keymaps (leader, basic navigation)
|
||||
├── personal.lua # Personal workflow keymaps
|
||||
├── lsp.lua # LSP and function navigation keymaps
|
||||
├── snacks.lua # Snacks search and navigation keymaps (replacing Telescope)
|
||||
└── plugins.lua # Plugin-specific keymaps
|
||||
├── lsp.lua # LSP and function navigation keymaps
|
||||
├── dap.lua # DAP debugging keymaps
|
||||
├── snacks.lua # Snacks search and navigation keymaps (replacing Telescope)
|
||||
├── window.lua # Window management keymaps
|
||||
├── copilot.lua # Copilot AI keymaps
|
||||
├── gitconflict.lua # Git conflict resolution keymaps
|
||||
└── plugins.lua # Plugin-specific keymaps
|
||||
```
|
||||
|
||||
## 🔧 How It Works
|
||||
@@ -36,6 +40,13 @@ The main `keymaps.lua` file automatically loads all `.lua` files from this folde
|
||||
- Code actions and documentation
|
||||
- Diagnostics
|
||||
|
||||
### **dap.lua**
|
||||
- Debug session control (`<leader>dcr`, `<leader>dq`)
|
||||
- Breakpoints (`<leader>db`, `<leader>dB`)
|
||||
- Step navigation (`<leader>do`, `<leader>di`, `<leader>dot`)
|
||||
- DAP UI toggle (`<leader>du`)
|
||||
- REPL and configuration pickers
|
||||
|
||||
### **snacks.lua**
|
||||
- File search (`<leader>ff`, `<leader>fs`)
|
||||
- Buffer management
|
||||
@@ -71,7 +82,11 @@ To add new keymaps:
|
||||
| General | `general.lua` | Basic setup and utilities |
|
||||
| Personal | `personal.lua` | Your workflow shortcuts |
|
||||
| LSP | `lsp.lua` | Function navigation and LSP features |
|
||||
| Debugging | `dap.lua` | DAP debugging (Java, Node.js, Python) |
|
||||
| Search | `snacks.lua` | File and text search |
|
||||
| Window | `window.lua` | Window/split management |
|
||||
| Copilot | `copilot.lua` | AI assistant keymaps |
|
||||
| Git Conflicts | `gitconflict.lua` | Conflict resolution |
|
||||
| Plugins | `plugins.lua` | Plugin-specific functionality |
|
||||
|
||||
## 🔄 Benefits
|
||||
|
||||
@@ -3,8 +3,8 @@ local keymap = vim.keymap
|
||||
|
||||
keymap.set("n", "]x", "<Plug>(git-conflict-next-conflict)", { desc = "Go to next git conflict" })
|
||||
keymap.set("n", "[x", "<Plug>(git-conflict-prev-conflict)", { desc = "Go to previous git conflict" })
|
||||
keymap.set("n", "<leader>co", "<Plug>(git-conflict-ours)", { desc = "Choose ours (git conflict)" })
|
||||
keymap.set("n", "<leader>ct", "<Plug>(git-conflict-theirs)", { desc = "Choose theirs (git conflict)" })
|
||||
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" })
|
||||
keymap.set("n", "<leader>gco", "<Plug>(git-conflict-ours)", { desc = "Choose ours (git conflict)" })
|
||||
keymap.set("n", "<leader>gct", "<Plug>(git-conflict-theirs)", { desc = "Choose theirs (git conflict)" })
|
||||
keymap.set("n", "<leader>gcb", "<Plug>(git-conflict-both)", { desc = "Choose both (git conflict)" })
|
||||
keymap.set("n", "<leader>gc0", "<Plug>(git-conflict-none)", { desc = "Choose none (git conflict)" })
|
||||
keymap.set("n", "<leader>gcl", "<Plug>(git-conflict-list)", { desc = "List all git conflicts" })
|
||||
|
||||
@@ -67,7 +67,6 @@ keymap.set(
|
||||
)
|
||||
keymap.set("n", "<leader>,", "$a,<ESC>", { desc = "Adding ',' at the end of the line" })
|
||||
keymap.set("n", "<leader>;", "$a;<ESC>", { desc = "Adding ';' at the end of the line" })
|
||||
keymap.set("n", "<leader>con", "oconsole.log()<ESC>0w$h", { desc = "Adding console.log() on the line below" })
|
||||
keymap.set("n", "<leader>xr", ":!node %<CR>", { desc = "Run file with node" })
|
||||
|
||||
-- Resize splits keymaps are centralized in lua/cargdev/core/keymaps/window.lua
|
||||
|
||||
@@ -77,8 +77,9 @@ return {
|
||||
|
||||
-- 🧠 Mason DAP
|
||||
require("mason-nvim-dap").setup({
|
||||
ensure_installed = { "js-debug-adapter", "firefox", "javadbg", "javatest" },
|
||||
automatic_setup = true,
|
||||
ensure_installed = { "python", "js", "javadbg", "javatest" },
|
||||
automatic_installation = true,
|
||||
handlers = {},
|
||||
})
|
||||
|
||||
-- 🔍 Virtual Text
|
||||
@@ -144,45 +145,160 @@ return {
|
||||
-- via jdtls.setup_dap() which automatically sets up the adapter
|
||||
-- The configurations are dynamically discovered from the project
|
||||
|
||||
-- 🧠 Node.js (NestJS / TypeScript) - Using js-debug-adapter
|
||||
dap.adapters.node = {
|
||||
type = "executable",
|
||||
command = "node",
|
||||
args = {
|
||||
os.getenv("HOME") .. "/.local/share/nvim/mason/packages/js-debug-adapter/js-debug/src/dapDebugServer.js",
|
||||
"${port}",
|
||||
-- 🐍 Python (debugpy)
|
||||
local debugpy_path = os.getenv("HOME") .. "/.local/share/nvim/mason/packages/debugpy/venv/bin/python"
|
||||
require("dap-python").setup(debugpy_path)
|
||||
|
||||
dap.configurations.python = {
|
||||
{
|
||||
name = "Launch File",
|
||||
type = "python",
|
||||
request = "launch",
|
||||
program = "${file}",
|
||||
console = "integratedTerminal",
|
||||
cwd = fn.getcwd(),
|
||||
},
|
||||
{
|
||||
name = "Launch File with Arguments",
|
||||
type = "python",
|
||||
request = "launch",
|
||||
program = "${file}",
|
||||
args = function()
|
||||
local args_string = vim.fn.input("Arguments: ")
|
||||
return vim.split(args_string, " +")
|
||||
end,
|
||||
console = "integratedTerminal",
|
||||
cwd = fn.getcwd(),
|
||||
},
|
||||
{
|
||||
name = "Attach Remote",
|
||||
type = "python",
|
||||
request = "attach",
|
||||
connect = {
|
||||
host = "127.0.0.1",
|
||||
port = 5678,
|
||||
},
|
||||
},
|
||||
{
|
||||
name = "Django",
|
||||
type = "python",
|
||||
request = "launch",
|
||||
program = "${workspaceFolder}/manage.py",
|
||||
args = { "runserver", "--noreload" },
|
||||
console = "integratedTerminal",
|
||||
django = true,
|
||||
},
|
||||
{
|
||||
name = "FastAPI",
|
||||
type = "python",
|
||||
request = "launch",
|
||||
module = "uvicorn",
|
||||
args = { "main:app", "--reload" },
|
||||
console = "integratedTerminal",
|
||||
cwd = fn.getcwd(),
|
||||
},
|
||||
{
|
||||
name = "Flask",
|
||||
type = "python",
|
||||
request = "launch",
|
||||
module = "flask",
|
||||
env = { FLASK_APP = "app.py", FLASK_DEBUG = "1" },
|
||||
args = { "run", "--no-debugger", "--no-reload" },
|
||||
console = "integratedTerminal",
|
||||
},
|
||||
}
|
||||
|
||||
-- 🧠 Node.js (NestJS / TypeScript) - Using js-debug-adapter (pwa-node)
|
||||
dap.adapters["pwa-node"] = {
|
||||
type = "server",
|
||||
host = "localhost",
|
||||
port = "${port}",
|
||||
executable = {
|
||||
command = "node",
|
||||
args = {
|
||||
os.getenv("HOME") .. "/.local/share/nvim/mason/packages/js-debug-adapter/js-debug/src/dapDebugServer.js",
|
||||
"${port}",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
dap.configurations.typescript = {
|
||||
{
|
||||
name = "Launch NestJS",
|
||||
type = "node",
|
||||
name = "Launch NestJS (dist/main.js)",
|
||||
type = "pwa-node",
|
||||
request = "launch",
|
||||
program = "${workspaceFolder}/dist/main.js",
|
||||
args = {},
|
||||
console = "integratedTerminal",
|
||||
outFiles = { "${workspaceFolder}/dist/**/*.js" },
|
||||
cwd = "${workspaceFolder}",
|
||||
sourceMaps = true,
|
||||
protocol = "inspector",
|
||||
cwd = fn.getcwd(),
|
||||
runtimeArgs = { "--inspect-brk" },
|
||||
outFiles = { "${workspaceFolder}/dist/**/*.js" },
|
||||
resolveSourceMapLocations = { "${workspaceFolder}/**", "!**/node_modules/**" },
|
||||
console = "integratedTerminal",
|
||||
skipFiles = { "<node_internals>/**", "node_modules/**" },
|
||||
},
|
||||
{
|
||||
name = "Launch Current File",
|
||||
type = "pwa-node",
|
||||
request = "launch",
|
||||
program = "${file}",
|
||||
cwd = "${workspaceFolder}",
|
||||
sourceMaps = true,
|
||||
console = "integratedTerminal",
|
||||
skipFiles = { "<node_internals>/**", "node_modules/**" },
|
||||
},
|
||||
{
|
||||
name = "Launch with ts-node",
|
||||
type = "pwa-node",
|
||||
request = "launch",
|
||||
runtimeExecutable = "node",
|
||||
runtimeArgs = { "--loader", "ts-node/esm" },
|
||||
program = "${file}",
|
||||
cwd = "${workspaceFolder}",
|
||||
sourceMaps = true,
|
||||
console = "integratedTerminal",
|
||||
skipFiles = { "<node_internals>/**", "node_modules/**" },
|
||||
},
|
||||
{
|
||||
name = "Attach to NestJS (port 9229)",
|
||||
type = "pwa-node",
|
||||
request = "attach",
|
||||
port = 9229,
|
||||
cwd = "${workspaceFolder}",
|
||||
sourceMaps = true,
|
||||
outFiles = { "${workspaceFolder}/dist/**/*.js" },
|
||||
resolveSourceMapLocations = { "${workspaceFolder}/**", "!**/node_modules/**" },
|
||||
skipFiles = { "<node_internals>/**", "node_modules/**" },
|
||||
restart = true,
|
||||
},
|
||||
{
|
||||
name = "Attach to NestJS (start:debug)",
|
||||
type = "node",
|
||||
name = "Attach to Process",
|
||||
type = "pwa-node",
|
||||
request = "attach",
|
||||
port = 9229,
|
||||
protocol = "inspector",
|
||||
cwd = fn.getcwd(),
|
||||
processId = require("dap.utils").pick_process,
|
||||
cwd = "${workspaceFolder}",
|
||||
sourceMaps = true,
|
||||
outFiles = { "${workspaceFolder}/dist/**/*.js" },
|
||||
skipFiles = { "<node_internals>/**" },
|
||||
skipFiles = { "<node_internals>/**", "node_modules/**" },
|
||||
},
|
||||
}
|
||||
|
||||
-- Also add JavaScript configurations
|
||||
dap.configurations.javascript = dap.configurations.typescript
|
||||
-- JavaScript uses same configurations as TypeScript
|
||||
dap.configurations.javascript = {
|
||||
{
|
||||
name = "Launch Current File",
|
||||
type = "pwa-node",
|
||||
request = "launch",
|
||||
program = "${file}",
|
||||
cwd = "${workspaceFolder}",
|
||||
console = "integratedTerminal",
|
||||
skipFiles = { "<node_internals>/**", "node_modules/**" },
|
||||
},
|
||||
{
|
||||
name = "Attach to Process",
|
||||
type = "pwa-node",
|
||||
request = "attach",
|
||||
processId = require("dap.utils").pick_process,
|
||||
cwd = "${workspaceFolder}",
|
||||
skipFiles = { "<node_internals>/**", "node_modules/**" },
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -54,6 +54,8 @@ return {
|
||||
"tree-sitter-cli", -- required for nvim-treesitter parser compilation
|
||||
"java-debug-adapter", -- Java debugger
|
||||
"java-test", -- Java test runner
|
||||
"debugpy", -- Python debugger
|
||||
"js-debug-adapter", -- Node.js/TypeScript debugger
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
||||
Reference in New Issue
Block a user