Neovim Configuration
This Neovim configuration is built on top of LazyVim, a modern Neovim configuration framework that provides a complete IDE experience out of the box.LazyVim Setup
LazyVim provides a structured approach to Neovim configuration with:- Pre-configured LSP, formatting, and linting
- Smart plugin management with lazy loading
- Beautiful UI with statusline and bufferline
- Extensive keybindings and which-key integration
- Git integration with gitsigns and diffview
Plugin Structure
Plugins are organized in~/.config/nvim/lua/plugins/:
Key Features
LSP Support
Full Language Server Protocol integration with Mason for easy installation
Auto-completion
Intelligent code completion with nvim-cmp and snippet support
Formatting
Automatic code formatting with conform.nvim
Linting
Real-time code linting and diagnostics
Git Integration
Gitsigns for inline git blame, hunks, and diff viewing
Fuzzy Finding
Telescope for files, grep, and symbol search
Session Management
Automatic session persistence and restoration
Treesitter
Advanced syntax highlighting and code understanding
LSP Configuration
Language servers are managed with Mason and configured for optimal development:Diagnostic Configuration
- Underline: Enabled for all diagnostics
- Virtual Text: Shows with bullet prefix and 4px spacing
- Severity Sort: Sorts diagnostics by severity
- Update in Insert: Disabled for less distraction
Coding Features
Auto-completion
Powered by nvim-cmp with multiple sources:Completion Keybindings
Completion Keybindings
| Key | Action |
|---|---|
Ctrl + Space | Trigger completion |
Ctrl + B | Scroll docs up |
Ctrl + F | Scroll docs down |
Ctrl + E | Abort completion |
Enter | Confirm selection |
Tab | Next item / expand snippet |
Shift + Tab | Previous item |
Auto Pairs
Automatic bracket, quote, and tag pairing:Text Objects
mini.ai extends Neovim’s text objects:af/if- Function outer/innerac/ic- Class outer/innerao/io- Block, conditional, loopau/iu- Function call
Editor Options
Core editor settings inlua/config/options.lua:
Auto-save on Insert Leave
Files are automatically saved when leaving insert mode, reducing the need for manual saves.
Keymaps
Extensive keybindings organized by functionality inlua/config/keymaps.lua:
Telescope (Fuzzy Finder)
File Navigation
File Navigation
Code Navigation
Code Navigation
LSP Actions
| Key | Action |
|---|---|
K | Show hover documentation |
<leader>ca | Code actions |
<leader>cr | Rename symbol |
<leader>e | Show diagnostics |
[d | Previous diagnostic |
]d | Next diagnostic |
Git Operations
Hunk Navigation
Hunk Navigation
Hunk Actions
Hunk Actions
| Key | Action |
|---|---|
<leader>ghs | Stage hunk |
<leader>ghr | Reset hunk |
<leader>ghS | Stage buffer |
<leader>ghR | Reset buffer |
<leader>ghu | Undo stage hunk |
<leader>ghp | Preview hunk inline |
<leader>ghb | Blame line |
<leader>ghd | Diff this |
Formatting
| Key | Action |
|---|---|
<leader>cf | Format buffer |
<leader>cF | Format injected languages |
Trouble (Diagnostics)
| Key | Action |
|---|---|
<leader>xx | Toggle diagnostics |
<leader>xX | Buffer diagnostics |
<leader>cs | Symbols |
<leader>cS | LSP references |
[q | Previous item |
]q | Next item |
Flash (Quick Navigation)
| Key | Action |
|---|---|
s | Flash jump |
S | Flash treesitter |
Ctrl + Space | Treesitter selection |
Session Management
| Key | Action |
|---|---|
<leader>qs | Restore session |
<leader>qS | Select session |
<leader>ql | Restore last session |
<leader>qd | Don’t save session |
Todo Comments
| Key | Action |
|---|---|
]t | Next todo comment |
[t | Previous todo comment |
<leader>xt | Todo list (Trouble) |
<leader>st | Search todos (Telescope) |
Auto Commands
Several auto commands enhance the editing experience:Highlight on Yank
Remove Trailing Whitespace
Restore Cursor Position
Snippets
LuaSnip provides snippet expansion with friendly-snippets:| Key | Action |
|---|---|
Ctrl + K | Expand/jump forward |
Ctrl + J | Jump backward |
