Skip to content

Latest commit

 

History

History
231 lines (185 loc) · 6.18 KB

File metadata and controls

231 lines (185 loc) · 6.18 KB

Personal Neovim Config

A modular Neovim configuration built with lazy.nvim, organized under the phaezer namespace.

Features

  • 🔌 Modular plugin system - Plugins organized by category (ai, completion, editing, lsp, ui, vcs, etc.)
  • 🎨 Multiple themes - tokyonight (default), kanagawa, rose-pine, catppuccin, everforest, and more
  • 📝 Advanced LSP - Custom LSP system with toggle support and multiple diagnostic display modes
  • Modern completion - blink.cmp with LSP, snippets, copilot, and ripgrep integration
  • 🔍 Powerful navigation - flash.nvim, telescope, neo-tree, and mini.ai
  • 🤖 AI integration - Copilot, Avante, OpenCode, and Sidekick support
  • 📊 Git workflows - lazygit, neogit, diffview, fugitive, and gitsigns
  • 🎯 Language support - Ansible, Go, Rust, Python, TypeScript, and more

Installation

  1. Backup your existing Neovim config:

    mv ~/.config/nvim ~/.config/nvim.backup
  2. Clone this repository:

    git clone <repo-url> ~/.config/nvim
  3. Start Neovim - lazy.nvim will automatically install plugins:

    nvim

Structure

.
├── init.lua                    # Entry point
├── lsp/                        # LSP server configs (auto-discovered)
│   ├── lua_ls.lua
│   ├── gopls.lua
│   └── ...
└── lua/phaezer/
    ├── config/                 # Core configurations
    │   ├── init.lua           # Config orchestrator
    │   ├── lsp.lua            # LSP system
    │   ├── keymap.lua         # Base keybindings
    │   ├── opt.lua            # Vim options
    │   └── ...
    ├── core/                   # Shared utilities
    │   ├── keys.lua           # Keymap helpers
    │   ├── icons.lua          # Icon definitions
    │   └── util.lua           # General utilities
    └── plugins/                # Plugin configurations
        ├── ai/                # AI assistants
        ├── completion/        # Completion engines
        ├── editing/           # Text editing
        ├── lsp/               # LSP plugins
        ├── navigation/        # Navigation tools
        ├── ui/                # UI enhancements
        ├── vcs/               # Git integrations
        └── ...

Key Bindings

Leader key: <Space>

Core

  • <Space>e - File explorer (neo-tree)
  • <C->` - Toggle terminal
  • <C-/> - Comment line/selection
  • jk / kj - Exit insert mode

Window Management (<leader>w)

  • <leader>ws - Horizontal split
  • <leader>wv - Vertical split
  • <leader>wq - Close window
  • <C-h/j/k/l> - Navigate windows

Buffer Management (<leader>b)

  • <leader>bl - Next buffer
  • <leader>bh - Previous buffer
  • <leader>bD - Close all but current
  • <leader>bn - New buffer

LSP & Diagnostics (<leader>x)

  • <leader>xh - Toggle inlay hints
  • <leader>xt - Toggle LSP on/off
  • <leader>xj - Detailed diagnostics
  • <leader>xl - Default diagnostics
  • <leader>xk - Minimal diagnostics
  • <leader>xf - Show diagnostic float

UI Toggles (<leader>u)

  • <leader>uh - Toggle cursorline
  • <leader>ur - Toggle relative numbers
  • <leader>uw - Toggle line wrap
  • <leader>ux - Toggle conceal level

Navigation

  • gs - Flash jump
  • gS - Flash treesitter
  • gl - End of line ($)
  • gh - Start of line (^)
  • gb - Matching bracket (%)

LSP System

The configuration includes a custom LSP system with:

Diagnostic Modes

Toggle between different diagnostic display styles:

  • Minimal - Only underlines and signs
  • Default - Current line virtual text
  • Detailed - All virtual text with sources
  • Detailed Lines - Uses lsp_lines for warnings/errors

Use :SetDiagnosticConfig <mode> or the <leader>x prefix keybindings.

LSP Toggle

Enable/disable LSP servers without restarting Neovim:

  • :ToggleLSP <name> - Toggle specific server
  • :ToggleLSPSelect - Interactive selection menu
  • <leader>xt - Keybinding for toggle menu

Adding LSP Servers

Create a file in lsp/<servername>.lua with:

return {
  name = 'servername',
  cmd = { 'language-server-command' },
  filetypes = { 'filetype' },
  root_markers = { '.git' },
  settings = { ... }
}

Completion

Uses blink.cmp with:

  • LSP completions (highest priority)
  • Copilot integration
  • Path and buffer completions
  • Snippet expansion (LuaSnip)
  • Ripgrep project-wide search
  • Dictionary for markdown/norg

Keybindings:

  • <C-;> - Show all completions
  • <C-.> - Show buffer/dictionary
  • <C-,> - Show Copilot suggestions
  • <leader>kc - Toggle completion on/off

Themes

Default theme: tokyonight

Available themes:

  • tokyonight
  • kanagawa
  • rose-pine
  • catppuccin
  • everforest
  • gruvdark
  • onedark
  • nightfox

Change theme:

NVIM_THEME=kanagawa nvim

Or set in your shell profile:

export NVIM_THEME=kanagawa

Language Support

Ansible

  • ansible-vim for syntax
  • ansiblels LSP
  • Custom playbook runner: <leader>ar

Go

  • gopls LSP
  • go.nvim for Go-specific features
  • DAP debugging support

Rust

  • rustaceanvim for enhanced Rust support
  • rust-analyzer LSP
  • DAP debugging support

Python

  • basedpyright LSP
  • ruff for linting/formatting
  • DAP debugging support

TypeScript/JavaScript

  • ts_ls LSP
  • deno_ls for Deno projects

Experimental Features

Enable experimental plugins with:

NVIM_EXPERIMENTAL=1 nvim

Custom Commands

  • :SetDiagnosticConfig <mode> - Change diagnostic display
  • :ToggleLSP <name> - Toggle LSP server
  • :ToggleLSPSelect - Interactive LSP toggle

Development

Local Plugins

Place development plugins in ~/projects/nvim/ with pattern matching phaezer.

Adding Plugins

  1. Create file in lua/phaezer/plugins/<category>/<name>.lua
  2. Return a lazy.nvim spec table
  3. Configure keybindings in the keys property or lua/phaezer/config/keymap.lua

Resources