==============================
NEOVIM SETUP GUIDE (Beginner)
==============================
-------------------
1. INSTALL NEOVIM
-------------------
# For Arch Linux:
sudo pacman -S neovim
# For Ubuntu/Debian:
sudo apt install neovim
# Optional (git required for plugins):
sudo apt install git curl unzip
--------------------------
2. CONFIGURATION FOLDERS
--------------------------
Neovim config location:
Linux:
~/.config/nvim/
Init file:
~/.config/nvim/init.lua <-- (preferred for Lua config)
or
~/.config/nvim/init.vim <-- (for Vimscript)
Create the folders:
mkdir -p ~/.config/nvim
-----------------------------
3. MINIMAL init.lua EXAMPLE
-----------------------------
-- ~/.config/nvim/init.lua
-- Basic settings
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.termguicolors = true
-- Set leader key
vim.g.mapleader = " "
-- Plugins using lazy.nvim
-- Bootstrap lazy.nvim plugin manager
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
-- Add plugins here
"nvim-treesitter/nvim-treesitter",
"nvim-lualine/lualine.nvim",
"neovim/nvim-lspconfig",
"hrsh7th/nvim-cmp",
"hrsh7th/cmp-nvim-lsp",
"L3MON4D3/LuaSnip"
})
-------------------------------
4. ENABLE LSP + AUTOCOMPLETE
-------------------------------
-- In init.lua after lazy setup:
local lspconfig = require("lspconfig")
-- Example: Enable LSP for Python
lspconfig.pyright.setup{}
-- Autocomplete setup
local cmp = require("cmp")
cmp.setup({
mapping = cmp.mapping.preset.insert({
['<C-Space>'] = cmp.mapping.complete(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
}),
sources = {
{ name = 'nvim_lsp' },
}
})
-------------------------------
5. USEFUL COMMANDS & TIPS
-------------------------------
:checkhealth -- Check for missing dependencies
:Lazy -- Plugin manager GUI (with lazy.nvim)
:TSUpdate -- Update treesitter
:LspInfo -- Show LSP status
:!python % -- Run current Python file
----------------------------
6. OPTIONAL PLUGINS TO TRY
----------------------------
- tpope/vim-surround -- Easy surround editing
- nvim-tree/nvim-tree.lua -- File explorer
- nvim-telescope/telescope.nvim-- Fuzzy finder
- catppuccin/nvim -- Pretty theme
- folke/tokyonight.nvim -- Another theme
------------------------------
7. QUICK INSTALL TREE-SITTER
------------------------------
Open Neovim and run:
:TSInstall python lua bash
----------------------
8. DONE!
----------------------
Now enjoy coding with Neovim!