Overview
This configuration uses Neovim’s native LSP client (0.11+) with nvim-lspconfig for standardized server configurations. All language servers are installed globally and managed outside of Neovim. Configuration file:lua/plugins/lsp/init.lua:11
Architecture
The LSP configuration follows a three-layer approach:- Global defaults - Applied to all language servers via
vim.lsp.config("*") - nvim-lspconfig defaults - Standard configurations from the lspconfig repository
- Local overrides - Custom settings in
after/lsp/*.luafiles
Server-specific configurations in
after/lsp/ directories take precedence over default settings.Enabled language servers
The configuration enables the following language servers (source:42-60):- Languages
- Web technologies
- Formatting & linting
- Configuration formats
- Writing tools
- lua_ls - Lua language server
- gopls - Go language server
- tsgo - TypeScript/JavaScript (Microsoft’s native server)
- bashls - Bash/Shell script support
- clangd - C/C++ language server
markdown_oxide is currently disabled but can be re-enabled by uncommenting line 54.Global capabilities
All servers share these capabilities (source:21-29):Blink.cmp integration
Blink.cmp integration
Capabilities are automatically merged from Blink.cmp for intelligent completion:
Folding support
Folding support
Root markers
Root markers
All servers use
.git directory to detect project root.Keymaps
Keymaps are automatically set up when an LSP server attaches to a buffer (source:65-132):Navigation
Navigation
Information
Information
Code actions & refactoring
Code actions & refactoring
Diagnostics
Diagnostics
Workspace management
Workspace management
Inlay hints
Inlay hints
Toggle inlay hints - Enable/disable inline type annotations
Inlay hints are disabled by default. Press
<leader>ih to toggle them on.Diagnostic configuration
Diagnostics are configured globally (source:163-181):Display settings
Display settings
Sorts diagnostics by severity (errors first, then warnings, info, hints).
Uses rounded borders for diagnostic floating windows.
Shows the diagnostic source (e.g., “eslint”, “typescript”) in floating windows.
Underlines diagnostic regions in the buffer.
Disables diagnostic updates while in insert mode for better performance.
Disabled because the
tiny-diagnostic plugin provides better inline diagnostics.Diagnostic signs
Diagnostic signs
Custom icons are displayed in the sign column:
- Error:
(red background in line numbers) - Warning:
(yellow background in line numbers) - Info:
- Hint:
Server-specific configurations
Server-specific settings are defined inafter/lsp/*.lua files:
lua_ls (Lua)
lua_ls (Lua)
Configuration file:
after/lsp/lua_ls.luaRecognizes
vim as a global variable to avoid undefined warnings.Disables:
inject-field, undefined-field, missing-fieldsUses LuaJIT runtime (Neovim’s Lua version).
Includes Neovim runtime files for completion.
Disables third-party library prompts.
Disables telemetry.
gopls (Go)
gopls (Go)
Configuration file:
after/lsp/gopls.luaCode lenses (mostly disabled to reduce CPU usage):generate,gc_details,test,tidy,vendor,regenerate_cgo,upgrade_dependency,run_govulncheck- All disabled
- Variable types, composite literal fields/types, constant values, function type parameters, parameter names, range variable types
Uses gofumpt for stricter formatting.
Disabled to reduce CPU/memory usage. Use
<leader>ll for linting.Increases delay to reduce CPU spikes during typing.
Enables semantic highlighting.
tsgo (TypeScript/JavaScript)
tsgo (TypeScript/JavaScript)
Configuration file: Auto-imports:
after/lsp/tsgo.luaMemory settings:Allocates up to 8GB for the TypeScript server.
autoImports: true- Automatic import suggestionsimportModuleSpecifierPreference: "shortest"- Uses shortest import pathsincludePackageJsonAutoImports: "auto"- Includes package.json imports
- Parameter names, types, variable types, property types, return types, enum values
- Implementation references on interfaces and classes
- Reference counts on all functions
Settings apply to both TypeScript and JavaScript files.
LSP attach behavior
When an LSP server attaches to a buffer (source:137-158):- Keymaps are configured for that buffer
- Omnifunc is set to
vim.lsp.omnifuncfor<C-x><C-o>completion - Inlay hints are disabled by default (toggle with
<leader>ih)
LSP detach cleanup
When an LSP server detaches (source:186-192):- References are cleared from the buffer
- Document highlight autogroups are removed