How tycharlie99/my-neovim works
Project type and purpose
• This is *not* a web service or microservice–based system. It’s a *Neovim configuration* written in Lua, structured around a plugin manager (Lazy.nvim), modular config files, plugin‐specific config modules, and one custom plugin (perforce.nvim).
• Purpose: Bootstraps Neovim v0.11+, sets up core editor options, keymaps, and loads/configures a suite of community plugins (LSP, treesitter, telescope, etc.), plus a custom Perforce integration.
File structure
• Top‐level:
• init.lua – entry point for Neovim.
• lua/config/ – core editor settings (options, keymaps, lazy setup).
• lua/plugins/ – individual plugin config modules.
• lua/perforce.nvim/ – custom plugin source.
• lazy-lock.json & .luarc.json – lockfile & Lua language server config.
• Configuration files set options and register plugins via Lazy.nvim.
• Each file under lua/plugins/*.lua configures one plugin.
• The custom plugin lives in its own subtree and is registered by name.
README for additional insights
• External dependencies: ripgrep for Telescope live_grep; mason.nvim for LSP installs; win32yank for Windows clipboard.
a. Main components
1. Neovim Core (nvim binary + runtime API)
2. Entry‐point: init.lua
3. Plugin Manager: Lazy.nvim (configured in lua/config/lazy.lua)
4. Core config modules under lua/config/
– keymaps, options, lazy setup
5. Plugin config modules under lua/plugins/
– e.g. nvim-cmp, lualine, treesitter, telescope, copilot-chat, etc.
6. Custom Plugin: perforce.nvim
7. External Tools
– ripgrep
– mason.nvim (and its installed LSP servers)
– win32yank (on Windows/WSL)
b. Relationships & data flow
– Neovim core loads init.lua on startup.
– init.lua sources lua/config/lazy.lua, which initializes Lazy.nvim.
– Lazy.nvim reads plugin list (from lua/plugins/init.lua), installs & loads each plugin.
– Each plugin module configures its respective plugin via Neovim’s Lua API.
– Custom plugin perforce.nvim is loaded alongside community plugins.
– Plugins like telescope call out to ripgrep; LSP plugins communicate with language servers installed by mason.
– Keymaps dispatch user input into plugin commands or Neovim API calls.
c. Architectural patterns & principles
– Modular configuration: split by concern (core vs plugins).
– Dependency injection via Lazy.nvim (declarative plugin listing).
– Plugin isolation: each plugin config is self-contained.
d. Key technologies/frameworks
– Neovim v0.11+ and Lua API
– Lazy.nvim (plugin manager)
– nvim-lspconfig, mason.nvim (LSP management)
– telescope.nvim + ripgrep
– nvim-treesitter
– Custom Lua plugin: perforce.nvim
Essential details
• That lua/config/lazy.lua is the pivot point for plugin loading.
• Flow for LSP requests (Neovim → nvim-lspconfig → mason-installed server → language server).
• External commands (ripgrep invoked by telescope).