[go: up one dir, main page]

0% found this document useful (0 votes)
79 views3 pages

How To Install Neovim

This document is a beginner's guide for setting up Neovim, detailing installation instructions for Arch Linux and Ubuntu/Debian. It includes configuration folder locations, a minimal init.lua example for basic settings and plugin management, and instructions for enabling LSP and autocomplete. Additionally, it provides useful commands, optional plugins to try, and a quick installation guide for Tree-sitter.

Uploaded by

Spring After
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views3 pages

How To Install Neovim

This document is a beginner's guide for setting up Neovim, detailing installation instructions for Arch Linux and Ubuntu/Debian. It includes configuration folder locations, a minimal init.lua example for basic settings and plugin management, and instructions for enabling LSP and autocomplete. Additionally, it provides useful commands, optional plugins to try, and a quick installation guide for Tree-sitter.

Uploaded by

Spring After
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

==============================

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!

You might also like