A modular Neovim configuration built on lazy.nvim, with flexible switching between multiple optional implementations.
init.lua: Entry point for loading core modules. Loadsoptions,keymaps,autocmds,filetype,neovide, andcustomin order.options.lua: Base editor option configuration, including UI display, line numbers, indentation, editing experience, search, and completion.keymaps.lua: Global key mappings, including basic editing, window management, LSP actions, and quick file access.config.lua: User configuration center. Defines selectable options for themes, search tools, completion engines, autocommands, and more.autocmds.lua: Autocommand configuration, including autosave, cursor restore, yank highlighting, and automatic window resizing.filetype.lua: Filetype-related configuration.neovide.lua: Configuration specific to the Neovide GUI client.custom.lua: Extension point for user custom configuration.
init.lua: Plugin manager initialization and lazy.nvim setup.ai.lua: AI-related tools, including GitHub Copilot integration.cmp.lua: Completion engine configuration, supporting bothcmpandblink.colorscheme.lua: Theme configuration, supportingtokyonight,evergarden, andcatppuccin.dashboard.lua: Startup screen configuration.find.lua: Search tool configuration, supporting bothtelescopeandfzf-lua.indent.lua: Indentation visualization plugin configuration.lang.lua: Language-specific plugin configuration.lsp.lua: LSP configuration, includingmason,lspconfig, andconformformatting tools.move.lua: Cursor movement enhancement plugins.quickfix.lua: Quickfix list enhancements.snippets.lua: Snippet configuration.tools.lua: Utility plugins, includingwakatime, session management,yanky,surround,dial,neogen,ufo, andcodesnap.treesitter.lua: Treesitter parsers and related plugins such asautotag,autopairs, andcomment.ui.lua: UI enhancement plugins, includinggitsigns,lualine,grug-far,toggleterm,aerial, andyazi.
Main entry file. Loads the core and plugins modules.
Important
Before performing any operation such as adding plugins or modifying configuration, you must check the plugin's official documentation instead of guessing. You may use any web search tools for this, such as jina or Google.
- Choose or create the appropriate category file under
lua/plugins/. - Define the plugin configuration following lazy.nvim conventions:
local plugin_name = { "author/plugin-name", event = "VeryLazy", opts = {}, }
- Add the plugin to the
returnstatement at the end of the file.
- Find the file that contains the target plugin, usually under
lua/plugins/. - Modify the plugin's
optstable orconfigfunction.
If the key mapping is specific to a plugin, usually add it in the plugin's configuration file using the keys field so it can participate in lazy loading.
If it is a global key mapping, follow this process:
- Open
lua/core/keymaps.lua. - Add a new mapping with the
mapfunction:map("n", "<leader>xx", "<cmd>YourCommand<cr>", { desc = "Description" })
- Parameters: mode (
n/i/v/etc.), key, command, and options (descis used by which-key for display).
- Open
lua/plugins/lsp.lua. - Add the server name to
mason_lspconfig.opts.ensure_installed. - If special configuration is needed, add it in
lspconfig.config:vim.lsp.config("server_name", { settings = {}, })
- Add the formatter under
conform.opts.formatters_by_ftinlua/plugins/lsp.lua:filetype = { "formatter_name" },
- If you need a custom formatter, define it under
conform.opts.formatters.
- Open
lua/core/config.lua. - Modify the relevant configuration fields:
M.colorscheme: switch theme (tokyonight/evergarden/catppuccin)M.find: switch search tool (telescope/fzf-lua)M.cmp: switch completion engine (cmp/blink)M.lsp_tools: switch LSP tool integration (fzf/trouble/telescope/native)M.indent: switch indentation visualization (hlchunk/indent-blankline/snack/indentmini)M.dashboard: switch startup screen (dashboard/snack)