From 542885dbd17153b17635fea81efe7d68e4f967c3 Mon Sep 17 00:00:00 2001 From: th3r00t Date: Tue, 9 Sep 2025 02:02:07 -0400 Subject: [PATCH] Adjusting nim lsp --- CLAUDE.md | 29 +++++++++++++++++++++++++++-- lua/lsp.lua | 18 +++++++++++++++++- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 47b945f..1a1c7b6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -15,6 +15,12 @@ This is a Neovim configuration written in Lua using Neovim's native package mana - `lsp.lua` - LSP configuration (lua_ls, gopls) with lsp_signature - `completion.lua` - nvim-cmp completion setup - `treesitter.lua` - Treesitter configuration + - `autocmds.lua` - Auto commands and event handling + - `diagnostics.lua` - LSP diagnostics configuration + - `telescope_configuration.lua` - Telescope picker configuration + - `terminal.lua` - Terminal and toggleterm setup + - `vimwiki.lua` - Vimwiki configuration + - `functions.lua` - Custom utility functions - `utils/` - Utility functions and overrides - `t3_functions.lua` - Custom functions for file finding, note capture, and navigation - `t3_overrides.lua` - Custom overrides @@ -24,9 +30,13 @@ This is a Neovim configuration written in Lua using Neovim's native package mana - **Multi-host theming**: Different TokyoNight themes based on hostname (xps13 uses "moon", Titan uses "storm") - **TTY compatibility**: Automatic fallback to console-friendly themes and no icons when running in Linux console - **Dual picker system**: Uses both FzfLua and Mini.pick for different workflows +- **Triple picker integration**: FzfLua, Mini.pick, and Telescope for comprehensive file/buffer navigation - **Comprehensive key bindings**: Leader-based, Meta-X (Emacs-style), Ctrl-X, and function keys -- **Claude Code integration**: Built-in support with dedicated keymaps under `a` +- **AI integration**: Both Claude Code and Avante plugins for AI-assisted development +- **Task management**: TaskWarrior integration with dedicated keymaps +- **Terminal integration**: ToggleTerm and tmux navigation support - **Note-taking workflow**: Custom functions for capturing notes and snippets +- **Advanced buffer management**: Barbar for visual buffer tabs with Alt+number navigation ### Plugin Management Uses Neovim's native package manager (`vim.pack.add`). No external package manager like lazy.nvim or packer.nvim is used. @@ -58,6 +68,9 @@ This configuration doesn't have traditional build/test commands as it's a Neovim ### Custom Functions - `:NeorgCapture` - Capture notes using the custom note-taking workflow - `:CaptureSnip` - Capture code snippets for LuaSnip +- `:TWEditTask`, `:TWView`, `:TWUpdateCurrent`, `:TWSyncTasks`, `:TWToggle` - TaskWarrior task management +- `:UndotreeToggle` - Visual undo tree navigation +- `:Ranger`, `:RangerNewTab` - File manager integration - Various `t3_*` functions for file navigation and workflows ## Important Conventions @@ -76,4 +89,16 @@ This configuration doesn't have traditional build/test commands as it's a Neovim The config detects hostname and adjusts theming accordingly. When adding host-specific features, follow the pattern in `init.lua` lines 17-45. ### TTY Compatibility -The configuration automatically detects TTY environments and disables icons/complex UI elements. When adding new UI features, consider TTY fallbacks. \ No newline at end of file +The configuration automatically detects TTY environments and disables icons/complex UI elements. When adding new UI features, consider TTY fallbacks. + +### Key Binding Categories +- **Leader mappings** (``): Organized with clear prefixes (`f` for files, `g` for grep, `G` for git, `a` for AI) +- **Alt mappings**: Buffer/tab navigation (`Alt+1-9` for buffer jumping, `Alt+Left/Right` for buffer cycling) +- **Meta-X mappings** (``): Emacs-style command palette using Telescope +- **Ctrl-X mappings** (``): Alternative workflows using Mini.pick and TaskWarrior +- **Function keys**: Direct access to tools (F2 for UndoTree, F3 for Ranger, F9 for grep, F11/F12 for spell/wrap toggle) + +### AI Integration +- **Claude Code**: Primary AI assistant with keymaps under `a` for chat, diff management, and file operations +- **Avante**: Secondary AI integration (currently configured for Copilot provider) +- **GitHub Copilot**: Code completion integration via copilot.vim \ No newline at end of file diff --git a/lua/lsp.lua b/lua/lsp.lua index 6c62de6..e59efef 100644 --- a/lua/lsp.lua +++ b/lua/lsp.lua @@ -28,7 +28,23 @@ vim.lsp.enable('gopls', { }, }, }) -vim.lsp.enable('nimlsp') +-- Configure nimlangserver +local lspconfig = require('lspconfig') +lspconfig.nim_langserver.setup({ + cmd = { "nimlangserver" }, + filetypes = { "nim" }, + root_dir = function(fname) + return lspconfig.util.find_git_ancestor(fname) or + lspconfig.util.find_node_modules_ancestor(fname) or + lspconfig.util.path.dirname(fname) + end, + settings = { + nim = { + nimsuggestPath = "nimsuggest", + nimprettyPath = "nimpretty", + } + }, +}) require("lsp_signature").setup({ debug = false, bind = true, -- registers signature handler