kickstart.nvim/cline_docs/systemPatterns.md

1.6 KiB

System Patterns: Neovim Configuration

System Architecture

  1. Core Configuration Structure

    • init.lua as main configuration file
    • Lazy plugin management system
    • LSP integration through nvim-lspconfig
    • Custom keymaps and settings
  2. Key Components

    • Plugin Management (lazy.nvim)
    • LSP Configuration
    • Treesitter Integration
    • Diagnostic System
    • Custom Keybindings

Key Technical Decisions

Plugin Management

  • Using lazy.nvim for plugin management
  • Lazy loading enabled for better startup performance
  • Plugin-specific configurations contained within setup blocks

LSP Implementation

  • Mason for LSP server management
  • nvim-lspconfig for LSP configuration
  • Custom LSP attach events and keymaps
  • Diagnostic configuration through vim.diagnostic

Editor Features

  • Treesitter for syntax highlighting
  • Telescope for fuzzy finding
  • Which-key for keymap discovery
  • Mini.nvim for various utilities

Component Relationships

  1. Plugin Dependencies

    • LSP plugins depend on nvim-lspconfig
    • UI elements depend on having Nerd Font
    • Telescope depends on plenary.nvim
  2. Configuration Flow

    • Leader key set before plugins
    • Basic options configured early
    • Plugins loaded through lazy.nvim
    • LSP servers configured after plugins
    • Keymaps set after all configurations

Design Patterns

  1. Modularity

    • Separate plugin configurations
    • Isolated LSP server settings
    • Independent keymap definitions
  2. Event-Driven

    • LSP attach events
    • Autocommands for specific behaviors
    • Lazy loading based on events