Directory Structure
This page explains the directory structure of the Neovim configuration and the role of each directory.
Overall Structure
nvim/
├── init.lua # Entry point
├── lua/
│ └── alex/ # Main configuration module
│ ├── init.lua # Main initialization file
│ ├── environments/ # Environment-specific settings
│ ├── keymaps/ # Keymap definitions
│ ├── loader/ # Plugin loader
│ ├── native/ # Neovim native features
│ ├── plugins/ # Plugin settings
│ └── utils/ # Utility functions
├── after/ # Filetype-specific settings
└── docs/ # DocumentationDirectory Details
init.lua
Neovim entry point. Loads the lua/peinan module.
File: init.lua
require("peinan")lua/peinan/
Main configuration module. All settings are organized under this directory.
lua/peinan/init.lua
Main initialization file. Loads modules in the following order:
- Environment check (
peinan.environments) - Native option settings (
peinan.native.options) - Plugin loader (
peinan.loader) - Native features (
peinan.native) - Keymaps (
peinan.keymaps)
File: lua/peinan/init.lua
lua/peinan/environments/
Manages environment-specific settings. Applies settings based on the execution environment such as Neovide, WezTerm, and VSCode.
Main files:
init.lua- Environment detection and initializationneovide.lua- Neovide-specific settingswezterm.lua- WezTerm-specific settingsvscode.lua- Settings for VSCode extension
Role:
- Setting environment variables
- Environment-specific option settings
- Control initialization based on environment
lua/peinan/keymaps/
Manages all keymap definitions. Centralized to prevent key binding conflicts.
Main files:
init.lua- Keymap initialization and definitionsutils.lua- Utility functions for keymaps
Role:
- Definition of all key bindings
- Mode-specific (normal, insert, visual, terminal, command) keymaps
- Plugin-specific keymaps
lua/peinan/loader/
Manages plugin loading. Uses Lazy.nvim for lazy loading plugins.
Main files:
bootstrap.lua- Lazy.nvim bootstrapinit.lua- Lazy.nvim initializationplugins.lua- Plugin definition list
Role:
- Plugin installation and updates
- Lazy loading configuration
- Plugin dependency management
lua/peinan/native/
Manages Neovim native feature settings. Implements features that don't depend on plugins.
Main files:
init.lua- Native features initializationoptions.lua- Neovim option settingslsp/- LSP settingsinit.lua- LSP initialization and diagnosticsdefaults.lua- Default LSP settingstsn.lua- TypeScript/Node.js specific settings
statuscolumn.lua- Status column settingsterminal.lua- Terminal settingswinbar.lua- Window bar settings
Role:
- Basic Neovim option settings
- LSP setup and diagnostics
- UI element customization
lua/peinan/plugins/
Manages individual plugin configuration files. Each plugin has its own configuration file.
Main files:
dashboard.lua- Dashboard settingstelescope.lua- Telescope settingstreesitter.lua- Tree-sitter settingscompletion.lua- Completion settingslualine.lua- Status line settings- Many other plugin configurations
Role:
- Plugin-specific settings
- Plugin integration settings
lua/peinan/utils/
Provides utility functions.
Main files:
init.lua- Utility aggregationchars.lua- Character constantsgit.lua- Git-related utilitieslua.lua- Lua-related utilitiesneovim.lua- Neovim-related utilities
Role:
- Providing common functions
- Aggregating helper functions
after/
Manages filetype-specific settings. Applies additional settings for specific file types.
Main files:
ftplugin/*.lua- Filetype-specific settings
Role:
- Filetype-specific option settings
- Filetype-specific keymaps
Module Dependencies
For detailed dependency relationships, see Dependencies.