A minimal, single-file init.lua setup for Neovim 0.12+, leveraging native package management (vim.pack) and a curated suite of modern plugins.
- Neovim 0.12 or newer (required for
vim.packAPI) gitinstalled and available in yourPATH- Nerd Font β for icons in
lualine,oil.nvim,telescope ripgrep(rg) β fortelescope live_grepfunctionality- Node.js β for installing formatters (
prettier,eslint) via Mason
| Feature | Description |
|---|---|
Native vim.pack |
No external plugin managers (lazy/packer). Plugins registered via vim.pack.add() and auto-loaded |
| Single-file setup | Entire config lives in init.lua β easy to copy, version, and port |
| Deferred initialization | Heavy plugins (LSP, UI) initialize on VimEnter event for faster startup |
| Safe loading | pcall() guards for optional plugins (e.g., conform.nvim) |
| TypeScript/JS-first | Priority support for TS/JS/React via treesitter, LSP, and Prettier |
-- Leader key: space
-- Arrow keys disabled in normal mode (encourages hjkl navigation)
-- relative number + cursorline for better navigation
-- Auto-write on focus loss (autowrite)
-- Color column at 80 characters
-- Tabs = 2 spaces, always expanded to spaces
-- True color support in terminal (termguicolors)- Gruvbox theme with transparent background (
transparent_mode = true) - Indent-blankline with
βcharacter for visual indentation guides - NoNeckPain β centers the editor (width: 160), reduces eye strain
- Lualine β minimal statusline showing current file path
- Treesitter-context β displays function/class context in top line
| Plugin | Purpose | Keybinding / Note |
|---|---|---|
nvim-web-devicons |
Filetype icons | Dependency for lualine/oil |
lualine.nvim |
Statusline | Auto-loaded after VimEnter |
oil.nvim |
File explorer (vim-style) | - β open current directory |
no-neck-pain.nvim |
Editor centering | <c-_> β toggle |
indent-blankline.nvim |
Indentation guides | Auto-configured via ibl |
undotree |
Undo history visualization | <leader>u β toggle |
trouble.nvim |
Diagnostics/errors list | <leader>d β show float diagnostic |
| Plugin | Purpose |
|---|---|
vim-fugitive |
Full Git integration: :G, :Git, :Gdiff, etc. |
| Plugin | Purpose |
|---|---|
nvim-cmp |
Completion engine |
cmp-nvim-lsp |
LSP source for cmp |
mason.nvim |
Package manager for LSP servers & tools |
mason-lspconfig.nvim |
Bridge between Mason and nvim-lspconfig |
nvim-lspconfig |
LSP client configurations |
conform.nvim |
Code formatting (Prettier, stylua) |
Supported LSP servers (auto-installed via Mason):
lua_ls, basedpyright, rust_analyzer, emmet_ls,
eslint, ts_ls, tailwindcss, gopls
Formatting rules (conform.nvim):
-- Auto-format on save + manual via <space>f
javascript, typescript, jsx, tsx β prettier
css, html, json, yaml, markdown β prettier
lua β stylua (if installed)| Plugin | Purpose | Keybindings |
|---|---|---|
telescope.nvim + plenary |
Fuzzy finder for files, text, help | <Space><Space> β recent files<Space>ff β find files<Space>fg β live grep<Space>fh β help tags |
harpoon (v2) |
Quick bookmarks for 4 files | <leader>a β add file<C-e> β toggle menu<C-h/j/k/l> β jump to slot 1/2/3/4<C-S-P>/<C-S-N> β prev/next |
| Plugin | Purpose |
|---|---|
nvim-treesitter |
Syntax highlighting, auto-install parsers |
nvim-treesitter-context |
Show function/class context in top line |
Auto-installed language parsers:
javascript, typescript, python, c, lua, vim, vimdoc, query, go
<C-h/j/k/l> β navigate between windows (splits)
<leader>a β add file to Harpoon
<C-e> β open Harpoon menu
<C-h/j/k/l> β jump to Harpoon slot 1/2/3/4
<Space><Space> β recent files (Telescope)
<Space>ff β find file
<Space>fg β live grep content
- β open oil.nvim (file explorer)<leader>h β clear search highlight
n/N β next/prev search result (centered)
<C-d>/<C-u> β half-page down/up (centered)
<leader>s β substitute word under cursor in file
<leader>x β make file executable (!chmod +x %)
<Space>f β format file (conform + lsp fallback)gd β go to definition
gr β find references
<leader>y β show diagnostic in float window<C-c> (insert) β exit to normal mode
<leader>p (visual) β paste without yanking to register
<leader>d (n/v) β delete to black hole (don't pollute register)
<space>y - copy selection to system clipboard (middle mouse button to paste)
<space>Y - copy whole file to system clipboard (middle mouse button to paste)<leader>u β toggle Undotree
<Space>fh β search help tags-
Clone or create config:
mkdir -p ~/.config/nvim cp init.lua ~/.config/nvim/
-
Launch Neovim:
nvim
-
Wait for auto-install: Plugins clone to
~/.local/share/nvim/site/pack/on first run -
Install LSP servers & formatters via Mason:
:MasonInstall lua_ls basedpyright gopls prettier stylua
-
Install Treesitter parsers:
:TSInstall javascript typescript lua go python
π‘ Tip: If plugins fail to load, verify
gitis in PATH and you have internet access on first launch.
vim.pack.add({
{ src = "https://github.com/username/plugin.nvim", main = "plugin" },
})Find the mason-lspconfig block inside VimEnter and extend:
gopls = function()
vim.lsp.config("gopls", {
capabilities = capabilities,
settings = {
gopls = {
analyses = { unusedparams = true },
},
},
})
end,format_on_save = false, -- in conform.setup()Replace gruvbox with any other theme:
require("other_theme").setup()
vim.cmd("colorscheme other_theme")| Issue | Solution |
|---|---|
| Plugins not loading | Check git --version and internet connectivity |
| Missing icons in statusline | Install & configure a Nerd Font in your terminal |
| LSP not working | Run :MasonInstall <server> and restart Neovim |
| Prettier not formatting | Ensure Prettier is globally installed: npm install -g prettier |
| Telescope can't find files | Install ripgrep: brew install ripgrep / sudo apt install ripgrep |
| Slow startup | Consider lazy-loading heavy plugins or reducing ensure_installed lists |
~/.local/share/nvim/site/pack/
βββ opt/ β plugins installed via vim.pack
βββ start/ β auto-loaded plugins (if any)
~/.cache/nvim/ β treesitter cache, lsp logs
~/.state/nvim/ β session state, harpoon markers
Minimalism. Control. Speed.
No heavy frameworks β only what you need, loaded only when you need it.
Found a bug? Have a suggestion? Feel free to open an issue or PR.
MIT β feel free to use, modify, and distribute.
π‘ Pro tip: Run
:checkhealthand:messagesfor debugging.
This config requires Neovim 0.12+ βvim.packis not available in earlier versions.