The lua/user/plugins.lua file manages all Neovim plugins using Packer.nvim , a plugin manager for Neovim.
Overview
This configuration uses Packer for plugin management with automatic installation, commit pinning for stability, and automatic syncing on configuration changes.
Automatic Installation
Packer will automatically install itself if it’s not already present on your system.
local install_path = fn . stdpath ( "data" ) .. "/site/pack/packer/start/packer.nvim"
if fn . empty ( fn . glob ( install_path )) > 0 then
PACKER_BOOTSTRAP = fn . system ({
"git" ,
"clone" ,
"--depth" ,
"1" ,
"https://github.com/wbthomason/packer.nvim" ,
install_path ,
})
print ( "Installing packer close and reopen Neovim..." )
vim . cmd ( [[packadd packer.nvim]] )
end
When you first launch Neovim with this configuration, Packer will be automatically cloned and installed.
Auto-Sync Configuration
vim . cmd ( [[
augroup packer_user_config
autocmd!
autocmd BufWritePost plugins.lua source <afile> | PackerSync
augroup end
]] )
Whenever you save the plugins.lua file, Packer will automatically sync your plugins, installing new ones and updating as needed.
Packer Display Configuration
packer . init ({
display = {
open_fn = function ()
return require ( "packer.util" ). float ({ border = "rounded" })
end ,
},
})
Configures Packer to display its output in a floating window with rounded borders.
Installed Plugins
Core Plugins
use { "wbthomason/packer.nvim" , commit = "6afb67460283f0e990d35d229fd38fdc04063e0a" }
Packer manages itself, allowing it to be updated like any other plugin.
use { "nvim-lua/plenary.nvim" , commit = "4b7e52044bbb84242158d977a50c4cbcd85070c7" }
A library of Lua functions used by many other plugins. Essential dependency for the ecosystem.
use { "folke/which-key.nvim" }
Displays available keybindings in a popup when you start typing a command.
use { "lewis6991/impatient.nvim" , commit = "b842e16ecc1a700f62adb9802f8355b99b52a5a6" }
Improves startup time by caching Lua modules.
Editing Enhancement
Autopairs use { "windwp/nvim-autopairs" ,
commit = "4fc96c8f3df89b6d23e5092d31c866c53a346347" }
Automatically closes brackets, quotes, and other pairs.
Comment use { "numToStr/Comment.nvim" ,
commit = "97a188a98b5a3a6f9b1b850799ac078faa17ab67" }
Smart and powerful commenting plugin.
use { "JoosepAlviste/nvim-ts-context-commentstring" ,
commit = "4d3a68c41a53add8804f471fcc49bb398fe8de08" }
Context-aware comment strings using Treesitter (e.g., JSX/TSX support).
UI Components
File Explorer
Buffer Management
Status Line
Dashboard
use { "kyazdani42/nvim-tree.lua" ,
commit = "7282f7de8aedf861fe0162a559fc2b214383c51c" }
use { "kyazdani42/nvim-web-devicons" ,
commit = "563f3635c2d8a7be7933b9e547f7c178ba0d4352" }
File explorer tree with icons for file types. use { "akinsho/bufferline.nvim" ,
commit = "83bf4dc7bff642e145c8b4547aa596803a8b4dc4" }
use { "moll/vim-bbye" ,
commit = "25ef93ac5a87526111f43e5110675032dbcacf56" }
Buffer line (tabs) at the top and better buffer deletion commands. use { "nvim-lualine/lualine.nvim" ,
commit = "a52f078026b27694d2290e34efa61a6e4a690621" }
Fast and customizable status line. use { "goolord/alpha-nvim" ,
commit = "0bb6fc0646bcd1cdb4639737a1cee8d6e08bcc31" }
Fast and fully customizable greeter/dashboard.
Terminal Integration
use { "akinsho/toggleterm.nvim" ,
commit = "2a787c426ef00cb3488c11b14f5dcf892bbd0bda" }
Toggleable terminal integration with advanced features.
Project Management
use { "ahmedkhalf/project.nvim" ,
commit = "628de7e433dd503e782831fe150bb750e56e55d6" }
Project management and automatic project root detection.
Visual Enhancements
use { "lukas-reineke/indent-blankline.nvim" ,
commit = "db7cbcb40cc00fc5d6074d7569fb37197705e7f6" }
Indentation guides with blank line support.
Colorschemes
Tokyo Night use { "folke/tokyonight.nvim" ,
commit = "66bfc2e8f754869c7b651f3f47a2ee56ae557764" }
Clean, dark colorscheme inspired by Tokyo Night theme.
DarkPlus use { "lunarvim/darkplus.nvim" ,
commit = "13ef9daad28d3cf6c5e793acfc16ddbf456e1c83" }
VS Code’s Dark+ theme for Neovim.
Completion (nvim-cmp)
All completion plugins work together to provide a comprehensive autocompletion experience.
-- Core completion plugin
use { "hrsh7th/nvim-cmp" ,
commit = "b0dff0ec4f2748626aae13f011d1a47071fe9abc" }
-- Completion sources
use { "hrsh7th/cmp-buffer" ,
commit = "3022dbc9166796b644a841a02de8dd1cc1d311fa" } -- Buffer completions
use { "hrsh7th/cmp-path" ,
commit = "447c87cdd6e6d6a1d2488b1d43108bfa217f56e1" } -- Path completions
use { "saadparwaiz1/cmp_luasnip" ,
commit = "a9de941bcbda508d0a45d28ae366bb3f08db2e36" } -- Snippet completions
use { "hrsh7th/cmp-nvim-lsp" ,
commit = "3cf38d9c957e95c397b66f91967758b31be4abe6" } -- LSP completions
use { "hrsh7th/cmp-nvim-lua" ,
commit = "d276254e7198ab7d00f117e88e223b4bd8c02d21" } -- Neovim Lua API completions
Snippets
use { "L3MON4D3/LuaSnip" ,
commit = "8f8d493e7836f2697df878ef9c128337cbf2bb84" } -- Snippet engine
use { "rafamadriz/friendly-snippets" ,
commit = "2be79d8a9b03d4175ba6b3d14b082680de1b31b1" } -- Collection of snippets
LSP (Language Server Protocol)
LSP Configuration
use { "neovim/nvim-lspconfig" ,
commit = "f11fdff7e8b5b415e5ef1837bdcdd37ea6764dda" }
Configurations for built-in LSP client.
LSP Installer
use { "williamboman/mason.nvim" ,
commit = "c2002d7a6b5a72ba02388548cfaf420b864fbc12" }
use { "williamboman/mason-lspconfig.nvim" ,
commit = "0051870dd728f4988110a1b2d47f4a4510213e31" }
Easy language server installation and management.
Formatters & Linters
use { "jose-elias-alvarez/null-ls.nvim" ,
commit = "c0c19f32b614b3921e17886c541c13a72748d450" }
Inject LSP diagnostics, formatting, and code actions.
Reference Highlighting
use { "RRethy/vim-illuminate" ,
commit = "d6ca7f77eeaf61b3e6ce9f0e5a978d606df44298" }
Automatically highlight other uses of the word under cursor.
Telescope (Fuzzy Finder)
use { "nvim-telescope/telescope.nvim" ,
commit = "76ea9a898d3307244dce3573392dcf2cc38f340f" }
Highly extendable fuzzy finder for files, buffers, LSP symbols, and more.
Treesitter (Syntax Highlighting)
use {
"nvim-treesitter/nvim-treesitter" ,
commit = "226c1475a46a2ef6d840af9caa0117a439465500" ,
}
Advanced syntax highlighting, indentation, and text objects using tree-sitter.
Git Integration
use { "lewis6991/gitsigns.nvim" ,
commit = "2c6f96dda47e55fa07052ce2e2141e8367cbaaf2" }
Git decorations and inline blame information.
Plugin Management Commands
Install Plugins Install all configured plugins.
Update Plugins Update all installed plugins.
Sync Plugins Clean, update, and install plugins.
Adding New Plugins
Find the plugin
Locate the plugin repository on GitHub (e.g., username/plugin-name).
Add to plugins.lua
Add a new use statement in the packer.startup function: use { "username/plugin-name" }
Optional: Pin commit
For stability, pin to a specific commit: use { "username/plugin-name" , commit = "abc123..." }
Save and sync
Save the file. Packer will automatically run :PackerSync.
Configure the plugin
Create a configuration file in lua/user/ for the new plugin.
Commit Pinning
All plugins in this configuration are pinned to specific commits for stability and reproducibility.
Benefits:
Prevents unexpected breaking changes
Ensures consistent behavior across installations
Allows controlled updates
Updating pinned commits:
Check the plugin’s changelog for new features/fixes
Update the commit hash in plugins.lua
Test thoroughly after updating
Bootstrap Process
if PACKER_BOOTSTRAP then
require ( "packer" ). sync ()
end
On first installation, this automatically syncs all plugins after Packer is installed.
Troubleshooting
Try manually running :PackerSync and check for error messages.
Configuration not taking effect
Ensure you’ve saved plugins.lua and restarted Neovim. You may need to run :PackerCompile.
Remove the commit specification and let Packer use the latest version, then pin to a new commit.
Delete ~/.local/share/nvim and ~/.cache/nvim, then restart Neovim to reinstall everything.
See Also
Colorschemes Configure your color theme
LSP Configuration Set up language servers