Skip to content

Commit b172d02

Browse files
authored
feat: LSP and keymap updates (#21)
* feat: add install.sh script for cross-platform setup - Support for Arch Linux, Debian/Ubuntu, and macOS - Automatic dependency installation (neovim, ripgrep, fd, etc.) - Python/Node/Go toolchain setup - Plugin installation via Lazy.nvim - Pre-commit hooks setup * ci: add GitHub Actions workflow for config validation - Lua syntax checking with luac - Neovim startup validation in headless mode - StyLua formatting check - Triggers on push/PR to main for .lua files * feat: add keymap conflict detection utility - Add :CheckKeymaps command to find conflicting keybindings - Add :ExportKeymaps to export all keymaps to markdown - Filter known intentional overrides (folds, diagnostics, etc.) - Load utility on init * feat: add validation script for pre-commit hooks - Lua syntax validation via luac - Neovim headless startup check - Plugin loading verification - LSP configuration check - Keymap conflict detection integration * feat: add codecompanion.nvim plugin for AI assistance - Local llama server adapter configuration - DeepSeek R1 reasoning support - Disable Qwen3 thinking mode for cleaner responses - Keybindings: <leader>cc, <leader>ca, <leader>ci * refactor: update pre-commit config and stylua settings - Bump StyLua to v2.3.1 and use stylua-github hook - Add validate-nvim-config hook using scripts/validate.sh - Add check-lua-syntax hook with luac - Set LuaJIT syntax mode in stylua.toml * refactor(lsp): modernize lspconfig and simplify mason-lspconfig - Use new vim.lsp.config() API for lua_ls - Add custom hover handler with rounded border - Consolidate diagnostic config - Simplify LspAttach keybindings with descriptions - Toggle inlay hints per buffer with <leader>ih - Simplify mason-lspconfig to basic ensure_installed - Update mason-lspconfig to mason-org/mason-lspconfig.nvim * refactor(keymaps): resolve keymap conflicts across plugins - Change decrement from <leader>- to <leader>= (avoid conflict) - Aerial: <leader>o -> <leader>oa, [[ ]] -> [s ]s - Outline: <leader>o -> <leader>oo - Overseer: <leader>r* -> <leader>O* (avoid refactor conflict) - Lint: <leader>cl -> <leader>xl (move to diagnostics group) - Treesitter swap: <leader>s* -> [p ]p, [m ]m (bracket motions) - Update which-key group descriptions * refactor: update various plugin configurations - blink-cmp: remove optional flag, fix unused parameter warnings - go-nvim: disable lsp_keymaps and formatting (use conform.nvim) - lsp_signature: add on_trigger/on_close callbacks - lspkind: expand symbol_map with more icons and menu labels - nvim-devdocs: disable plugin - nvim-navic: enable highlighting, add status line component - snacks: enable picker and explorer, add file finder keybindings - telescope: add trouble.nvim dependency, move file keymaps to snacks - terrareg: enable debug mode, update config - trouble: update to v3 config format with new icons - pr_description: add LuaDoc annotations - update-readme.sh: fix shell formatting * docs: update README, PLUGINS.md, and KEYBINDINGS.md - Update plugin count to 73 - Add codecompanion.nvim to plugin list - Update mason-lspconfig repo to mason-org - Update keybindings for aerial, outline, overseer - Remove deprecated keybindings - Add new [s ]s symbol navigation keybindings * fix: CI uses older 5.1 without goto * fix: nvim tests in ci * fix: just validate the core * fix: duplicate mapleader
1 parent 9520c53 commit b172d02

32 files changed

Lines changed: 1422 additions & 447 deletions

.github/workflows/validate.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Validate Neovim Config
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
paths:
7+
- "**.lua"
8+
- "init.lua"
9+
- ".github/workflows/validate.yml"
10+
pull_request:
11+
branches: [main, master]
12+
paths:
13+
- "**.lua"
14+
- "init.lua"
15+
workflow_dispatch:
16+
17+
jobs:
18+
validate:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Install Neovim
25+
uses: rhysd/action-setup-vim@v1
26+
with:
27+
neovim: true
28+
version: stable
29+
30+
- name: Install Lua
31+
uses: leafo/gh-actions-lua@v10
32+
with:
33+
luaVersion: "5.1"
34+
35+
- name: Check Lua syntax
36+
run: |
37+
echo "Checking Lua syntax..."
38+
errors=0
39+
while IFS= read -r -d '' file; do
40+
if ! luac -p "$file" 2>/dev/null; then
41+
echo "❌ Syntax error in: $file"
42+
errors=$((errors + 1))
43+
fi
44+
done < <(find lua -name "*.lua" -print0)
45+
46+
if [ $errors -gt 0 ]; then
47+
echo "Found $errors Lua syntax errors"
48+
exit 1
49+
fi
50+
echo "✅ All Lua files have valid syntax"
51+
52+
- name: Validate Neovim startup
53+
run: |
54+
echo "Testing Neovim startup..."
55+
56+
# Create minimal config to test
57+
export XDG_CONFIG_HOME=$(pwd)/test_config
58+
export XDG_DATA_HOME=$(pwd)/test_data
59+
export XDG_STATE_HOME=$(pwd)/test_state
60+
export XDG_CACHE_HOME=$(pwd)/test_cache
61+
62+
mkdir -p "$XDG_CONFIG_HOME/nvim"
63+
mkdir -p "$XDG_DATA_HOME"
64+
mkdir -p "$XDG_STATE_HOME"
65+
mkdir -p "$XDG_CACHE_HOME"
66+
67+
# Create minimal init that skips plugin installation
68+
cat > "$XDG_CONFIG_HOME/nvim/init.lua" << 'EOF'
69+
vim.g.mapleader = " "
70+
-- Skip lazy.nvim in CI - just validate core config loads
71+
require("config.options")
72+
require("config.keymaps")
73+
print("STARTUP_OK")
74+
EOF
75+
cp -r lua "$XDG_CONFIG_HOME/nvim/"
76+
77+
# Test startup (should be fast without plugins)
78+
timeout 10 nvim --headless -c "qa!" 2>&1
79+
echo "✅ Neovim startup check completed"
80+
81+
- name: Check for common issues
82+
run: |
83+
echo "Checking for common issues..."
84+
85+
# Check for deprecated API usage
86+
if grep -r "vim.lsp.diagnostic" lua/ 2>/dev/null; then
87+
echo "⚠️ Warning: Found deprecated vim.lsp.diagnostic usage"
88+
fi
89+
90+
# Check for vim.fn.input without proper escaping
91+
if grep -r 'vim.fn.input.*vim.lsp.get_client' lua/ 2>/dev/null; then
92+
echo "⚠️ Warning: Found potentially unsafe input usage"
93+
fi
94+
95+
# Check for duplicate leader key settings
96+
leader_count=$(grep -r "vim.g.mapleader" lua/ init.lua 2>/dev/null | wc -l)
97+
if [ "$leader_count" -gt 2 ]; then
98+
echo "⚠️ Warning: mapleader set multiple times ($leader_count occurrences)"
99+
fi
100+
101+
echo "✅ Common issues check completed"
102+
103+
stylua:
104+
runs-on: ubuntu-latest
105+
steps:
106+
- name: Checkout
107+
uses: actions/checkout@v4
108+
109+
- name: Check formatting with StyLua
110+
uses: JohnnyMorganz/stylua-action@v4
111+
with:
112+
token: ${{ secrets.GITHUB_TOKEN }}
113+
version: latest
114+
args: --check lua/

.pre-commit-config.yaml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ repos:
1414

1515
# Lua formatting with StyLua
1616
- repo: https://github.com/JohnnyMorganz/StyLua
17-
rev: v2.1.0
17+
rev: v2.3.1
1818
hooks:
19-
- id: stylua
19+
- id: stylua-github
2020
args: [--config-path=stylua.toml]
2121

2222
# Lua linting with Luacheck
@@ -41,6 +41,23 @@ repos:
4141
args: [--baseline, .secrets.baseline]
4242
exclude: package.lock.json
4343

44+
# Neovim config validation
45+
- repo: local
46+
hooks:
47+
- id: validate-nvim-config
48+
name: Validate Neovim Config
49+
entry: scripts/validate.sh
50+
language: script
51+
files: ^(lua/.*\.lua|init\.lua)$
52+
pass_filenames: false
53+
54+
- id: check-lua-syntax
55+
name: Check Lua Syntax
56+
entry: bash -c 'for f in "$@"; do luac -p "$f" || exit 1; done' --
57+
language: system
58+
files: \.lua$
59+
types: [lua]
60+
4461
# Auto-documentation generation
4562
- repo: local
4663
hooks:

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,18 +149,19 @@ This configuration is released into the public domain under the [Unlicense](LICE
149149

150150

151151

152+
152153

153154

154155
<!-- AUTO-GENERATED PLUGIN LIST START -->
155156

156-
### Installed Plugins (72 total)
157+
### Installed Plugins (73 total)
157158

158159
#### 🔧 Language & LSP
159160

160161
- [neovim/nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)
161162
- [onsails/lspkind.nvim](https://github.com/onsails/lspkind.nvim)
162163
- [ray-x/lsp_signature.nvim](https://github.com/ray-x/lsp_signature.nvim)
163-
- [williamboman/mason-lspconfig.nvim](https://github.com/williamboman/mason-lspconfig.nvim)
164+
- [mason-org/mason-lspconfig.nvim](https://github.com/mason-org/mason-lspconfig.nvim)
164165
- [williamboman/mason.nvim](https://github.com/williamboman/mason.nvim)
165166

166167
#### 🎨 UI & Themes
@@ -210,6 +211,7 @@ This configuration is released into the public domain under the [Unlicense](LICE
210211

211212
- [stevearc/aerial.nvim](https://github.com/stevearc/aerial.nvim)
212213
- [laytan/cloak.nvim](https://github.com/laytan/cloak.nvim)
214+
- [olimorris/codecompanion.nvim](https://github.com/olimorris/codecompanion.nvim)
213215
- [stevearc/conform.nvim](https://github.com/stevearc/conform.nvim)
214216
- [sindrets/diffview.nvim](https://github.com/sindrets/diffview.nvim)
215217
- [elixir-tools/elixir-tools.nvim](https://github.com/elixir-tools/elixir-tools.nvim)
@@ -246,7 +248,7 @@ This configuration is released into the public domain under the [Unlicense](LICE
246248
- [folke/snacks.nvim](https://github.com/folke/snacks.nvim)
247249
- [nvim-pack/nvim-spectre](https://github.com/nvim-pack/nvim-spectre)
248250
- [nvim-lua/plenary.nvim](https://github.com/nvim-lua/plenary.nvim)
249-
- [nvim-telescope/telescope.nvim](https://github.com/nvim-telescope/telescope.nvim)
251+
- [nvim-lua/plenary.nvim](https://github.com/nvim-lua/plenary.nvim)
250252
- [folke/trouble.nvim](https://github.com/folke/trouble.nvim)
251253
- [linux-cultist/venv-selector.nvim](https://github.com/linux-cultist/venv-selector.nvim)
252254
- [RRethy/vim-illuminate](https://github.com/RRethy/vim-illuminate)

docs/KEYBINDINGS.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@
2424
| `<leader>Gsj` | Add JSON tags | go-nvim |
2525
| `<leader>Gsr` | Remove tags | go-nvim |
2626
| `<leader>Gsy` | Add YAML tags | go-nvim |
27-
| `<leader>O` | Toggle Outline Navigation | aerial |
27+
| `<leader>Oa` | Quick action | overseer |
28+
| `<leader>Ob` | Build task | overseer |
29+
| `<leader>Oc` | Clear cache | overseer |
30+
| `<leader>Or` | Run task | overseer |
31+
| `<leader>Osf` | Run tfsec Terraform scan | overseer |
32+
| `<leader>Ost` | Run trivy security scan | overseer |
33+
| `<leader>Ot` | Toggle task list | overseer |
2834
| `<leader>Ri` | Inspect REST request | kulala |
2935
| `<leader>Rl` | Replay last REST request | kulala |
3036
| `<leader>Rp` | Preview REST request | kulala |
@@ -35,7 +41,6 @@
3541
| `<leader>bo` | Delete other buffers | bufferline |
3642
| `<leader>bp` | Pin buffer | bufferline |
3743
| `<leader>br` | Delete buffers to the right | bufferline |
38-
| `<leader>cl` | Run linting | nvim-lint |
3944
| `<leader>coh` | Hide coverage | nvim-coverage |
4045
| `<leader>col` | Load coverage | nvim-coverage |
4146
| `<leader>cos` | Coverage summary | nvim-coverage |
@@ -52,7 +57,6 @@
5257
| `<leader>dt` | Terminate | nvim-dap |
5358
| `<leader>du` | Toggle DAP UI | nvim-dap |
5459
| `<leader>fS` | Workspace Symbols | telescope |
55-
| `<leader>fr` | Recent Files | telescope |
5660
| `<leader>fs` | Document Symbols | telescope |
5761
| `<leader>gCo` | Checkout PR | octo |
5862
| `<leader>gD` | Close diffview | diffview |
@@ -104,22 +108,15 @@
104108
| `<leader>ns` | Show dependency versions | package-info |
105109
| `<leader>nt` | Toggle dependency versions | package-info |
106110
| `<leader>nu` | Update dependency on line | package-info |
107-
| `<leader>o` | Toggle Outline | aerial |
108-
| `<leader>o` | Toggle Outline | outline-nvim |
111+
| `<leader>oA` | Toggle Aerial Navigation | aerial |
112+
| `<leader>oa` | Toggle Aerial | aerial |
113+
| `<leader>oo` | Toggle Outline | outline-nvim |
109114
| `<leader>pp` | Toggle profiling | profile |
110-
| `<leader>ra` | Quick action | overseer |
111-
| `<leader>rb` | Build task | overseer |
112-
| `<leader>rc` | Clear cache | overseer |
113115
| `<leader>rn` | LSP Rename | refactoring |
114-
| `<leader>rr` | Run task | overseer |
115-
| `<leader>rsf` | Run tfsec Terraform scan | overseer |
116-
| `<leader>rst` | Run trivy security scan | overseer |
117-
| `<leader>rt` | Toggle task list | overseer |
118116
| `<leader>sc` | Screenshot code | nvim-silicon |
119117
| `<leader>se` | [S]earch [E]moji | emoji |
120118
| `<leader>tF` | Run tests in file | neotest |
121119
| `<leader>tO` | Toggle test output panel | neotest |
122-
| `<leader>tV` | Show Module Info | mason-lspconfig |
123120
| `<leader>ta` | Run all tests | neotest |
124121
| `<leader>tn` | Run nearest test | neotest |
125122
| `<leader>ts` | Toggle test summary | neotest |
@@ -129,16 +126,15 @@
129126
| `<leader>xL` | Location List (Trouble) | trouble |
130127
| `<leader>xQ` | Quickfix List (Trouble) | trouble |
131128
| `<leader>xX` | Buffer Diagnostics (Trouble) | trouble |
129+
| `<leader>xl` | Run linting | nvim-lint |
132130
| `<leader>xl` | LSP Definitions / references / ... (Trouble) | trouble |
133131
| `<leader>xs` | Symbols (Trouble) | trouble |
134132
| `<leader>xx` | Diagnostics (Trouble) | trouble |
135133
| `K` | Peek fold or hover | nvim-ufo |
136-
| `[[` | Previous symbol | aerial |
137-
| `[[` | Previous symbol (up level) | aerial |
138134
| `[b` | Prev buffer | bufferline |
139-
| `]]` | Next symbol | aerial |
140-
| `]]` | Next symbol (up level) | aerial |
135+
| `[s` | Previous symbol | aerial |
141136
| `]b` | Next buffer | bufferline |
137+
| `]s` | Next symbol | aerial |
142138
| `zM` | Close all folds | nvim-ufo |
143139
| `zR` | Open all folds | nvim-ufo |
144140
| `zm` | Close folds with | nvim-ufo |

docs/PLUGINS.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This file is auto-generated by pre-commit hooks. Do not edit manually.
1515
## Blink Cmp
1616

1717
- **Repository:** https://github.com/saghen/blink.cmp
18-
- Enhanced LSP completion for Terraform
18+
- disable buggy anims in completion windows
1919
- **Dependencies:**
2020
- [allaman/emoji.nvim](https://github.com/allaman/emoji.nvim)
2121
- [rafamadriz/friendly-snippets](https://github.com/rafamadriz/friendly-snippets)
@@ -39,6 +39,15 @@ This file is auto-generated by pre-commit hooks. Do not edit manually.
3939
- **Repository:** https://github.com/laytan/cloak.nvim
4040
- **Configured:** Yes
4141

42+
## Codecompanion
43+
44+
- **Repository:** https://github.com/olimorris/codecompanion.nvim
45+
- Disable Qwen3 thinking mode for cleaner inline responses
46+
- **Dependencies:**
47+
- [nvim-lua/plenary.nvim](https://github.com/nvim-lua/plenary.nvim)
48+
- [nvim-treesitter/nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter)
49+
- **Configured:** Basic setup
50+
4251
## Comment
4352

4453
- **Repository:** https://github.com/numToStr/Comment.nvim
@@ -132,7 +141,7 @@ This file is auto-generated by pre-commit hooks. Do not edit manually.
132141
## Lspconfig
133142

134143
- **Repository:** https://github.com/neovim/nvim-lspconfig
135-
- Configure diagnostic signs (modern approach)
144+
- Lua language server configuration
136145
- **Dependencies:**
137146
- [saghen/blink.cmp](https://github.com/saghen/blink.cmp)
138147
- **Configured:** Basic setup
@@ -165,9 +174,8 @@ This file is auto-generated by pre-commit hooks. Do not edit manually.
165174

166175
## Mason Lspconfig
167176

168-
- **Repository:** https://github.com/williamboman/mason-lspconfig.nvim
169-
- **Configured:** Yes
170-
- **Has keybindings:** Yes
177+
- **Repository:** https://github.com/mason-org/mason-lspconfig.nvim
178+
- **Configured:** Basic setup
171179

172180
## Mason
173181

@@ -275,7 +283,7 @@ This file is auto-generated by pre-commit hooks. Do not edit manually.
275283
## Nvim Navic
276284

277285
- **Repository:** https://github.com/SmiteshP/nvim-navic
278-
- Attach navic to LSP
286+
- Enhanced navic configuration
279287
- **Configured:** Yes
280288

281289
## Nvim Silicon
@@ -431,7 +439,9 @@ This file is auto-generated by pre-commit hooks. Do not edit manually.
431439
## Telescope
432440

433441
- **Repository:** https://github.com/nvim-telescope/telescope.nvim
442+
- File search keymaps moved to snacks.lua (using Snacks picker)
434443
- **Dependencies:**
444+
- [folke/trouble.nvim](https://github.com/folke/trouble.nvim)
435445
- [nvim-lua/plenary.nvim](https://github.com/nvim-lua/plenary.nvim)
436446
- [nvim-telescope/telescope-fzf-native.nvim](https://github.com/nvim-telescope/telescope-fzf-native.nvim)
437447
- [nvim-tree/nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons)
@@ -454,10 +464,10 @@ This file is auto-generated by pre-commit hooks. Do not edit manually.
454464

455465
## Terrareg
456466

457-
- **Repository:** https://github.com/nvim-telescope/telescope.nvim
467+
- **Repository:** https://github.com/nvim-lua/plenary.nvim
468+
- ft = { "terraform", "hcl" },
458469
- **Dependencies:**
459470
- [nvim-lua/plenary.nvim](https://github.com/nvim-lua/plenary.nvim)
460-
- [nvim-telescope/telescope.nvim](https://github.com/nvim-telescope/telescope.nvim)
461471
- **Configured:** Yes
462472

463473
## Todo Comments

init.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ vim.g.mapleader = " "
44
require("config.options")
55
require("config.lazy")
66
require("config.keymaps")
7+
8+
-- Setup keymap checking utilities (run :CheckKeymaps to find conflicts)
9+
require("utils.keymap_check").setup()

0 commit comments

Comments
 (0)