PRIMARY CATEGORY → NEOVIM
NVChad → Fast and Beautiful Neovim Distribution
It is a Blazing Fast Neovim config which provides a Solid Defaults and a Beautiful UI
It simply enhances the Neovim’s User Experience
It has several handy features such as →
- Beautiful UI (User Interface)
- Theme Switcher
- Status Line
Take a look at the rest of the features here
Installation
Pre-requisites
There are several required aspects such as →
- Neovim v0.10 or higher
CAUTION
Note that installing Neovim through the default repositories using the
apt
Package Manager may result in a Neovim older version than the most recent ones listed hereTherefore, try to install it through the steps mentioned in the link above
- Nerd Font as the Terminal Font
- GCC
sudo apt install -y -- build-essential
NVChad
First of all, remove any previous Neovim Configuration →
rm -rf ~/.config/nvim
rm -rf ~/.local/state/nvim
rm -rf ~/.local/share/nvim
Then, proceed with the installation as follows →
git clone https://github.com/NvChad/starter ~/.config/nvim && nvim
Once the Lazy.nvim’s Plugins Installation is finished, simply run →
:MasonInstallAll
Remove the ~/.config/nvim/.git
rm -rf ~/.config/nvim/.git
IMPORTANT
Note that the following steps related to the Neovim Installation should be applied for both non-privileged and privileged users
Being in this case for Root and al3xbb
Theme Selection
To select any NVChad Theme, inside Neovim → Space-t-h
Nvchad Update
:lazy sync
Configuration Files
Init.lua
Relative Numbers
vim.wo.relativenumber = true
$ at each EOL
To disable $
char at the end of each line →
vim.opt.listchars = "tab:»·,trail:·"
# → Autocomment at each Newline
- Problem
If a line is commented using the #
character, the next line created is automatically commented in the same way
- POC
- Workaround
To disable autocommenting from a commented line →
vim.cmd([[autocmd FileType * set formatoptions-=ro]])
Mappings.lua
; → Command Mode
Disable ;
Command Mode mapping in order to allow the ;
char’s default behaviour
;
→ Command Mode
;
→ Repeat latest f
, t
, F
or T
N times (Default Behaviour)
map("n", ":", ":", { desc = "CMD enter command mode" })
C-h → Left Character Deletion in Insert Mode
Disable C-h
mapping in order to allow Character Deletion in Insert Mode as with Backspace
→
C-h
→ Cursor N Chars to the left in Insert Mode
C-h
→ Left Character Deletion in Insert Mode
vim.keymap.set('i', '<C-h>', '<BS>', { noremap = true, silent = true })
Disable Short Tabulations
To adjust the tabulation size in Insert and Normal mode →
vim.opt.shiftwidth = 4
vim.opt.tabstop = 4
Miscellaneous
Disable Neovim CMP
About the Plugin → Reference
NVChad installs the NVim CMP Plugin
To disable it, simply delete the lines below in the indicated file →
See here too
CMP Plugin Lines
~/.local/share/nvim/lazy/NvChad/lua/nvchad/plugins/init.lua -- load luasnips + cmp related in insert mode only { "hrsh7th/nvim-cmp", event = "InsertEnter", dependencies = { { -- snippet plugin "L3MON4D3/LuaSnip", dependencies = "rafamadriz/friendly-snippets", opts = { history = true, updateevents = "TextChanged,TextChangedI" }, config = function(_, opts) require("luasnip").config.set_config(opts) require "nvchad.configs.luasnip" end, }, -- autopairing of (){}[] etc { "windwp/nvim-autopairs", opts = { fast_wrap = {}, disable_filetype = { "TelescopePrompt", "vim" }, }, config = function(_, opts) require("nvim-autopairs").setup(opts) -- setup cmp for autopairs local cmp_autopairs = require "nvim-autopairs.completion.cmp" require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done()) end, }, -- cmp sources plugins { "saadparwaiz1/cmp_luasnip", "hrsh7th/cmp-nvim-lua", "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-buffer", "hrsh7th/cmp-path", }, }, opts = function() return require "nvchad.configs.cmp" end, },
Shortcuts
As with TMUX, in NVChad all shortcuts are preceded by a certain prefix
Default Prefix → Space
Terminology
Elements | |
---|---|
Buffer (Item/File) | File opened in Memory |
Window | Buffer Visualization/Viewport |
Tab | Group or Set of Windows |
Shorcuts’ Meaning
Key | Meaning | |
---|---|---|
<leader> | Space | <leader> + a → Space+a |
C | Control | C-c → Control+c |
M | Alt | M-a → Alt+a |
S | Shift | S-o → Shift+o |
Super | Windows | Super-s → Windows+s |
Return | Enter | C-S-Return → Control+Shift+Enter |
- | + | C-z → Control+z |
{a,b,c,d} | a b c d | C-{a,b,c,d} → C-a C-b C-c C-d |
Treesitter → Syntax Highlighting
Reference    •    Supported Languages
Actions | Commands |
---|---|
Install a Language | :TSInstall <LANGUAGE_TO_INSTALL> |
Check Installed Languages | :TSInstallInfo |
NVimTree → File Tree
Action | Shortcut |
---|---|
Open/Close FileTree Window | C-n |
Toogle to FileTree Window | <leader> + e |
Switch between FileTree and Editor⬅️➡️ | C-{h,l} C-w-{h,l} |
Move Cursor⬆️⬇️ | k j |
Open/Rename a Directory/File | Return r |
Create/Delete a File | a d |
Copy/Paste a File | c p |
Search a File (Filter Mode) | f |
Select a File (Mark Mode) | m |
Telescope → Fuzzy Finder
Reference I    •    Reference II
Finders
Action | Shortcut |
---|---|
NVChad Themes - Selector | <leader> + th |
Find Files | <leader> + ff |
Find All Files | <leader> + fa |
Find Old Opened Files | <leader> + fo |
Find Buffers | <leader> + fb → Telescope :ls → OG |
Find in Current Buffer | <leader> + fz → Telescope / ? → OG |
Find Git Commits | <leader> + cm |
Finder Navigation
Action | Shortcut |
---|---|
Confirm Item Selection (Open Item - Current Window) | Return |
Open Item - Horizontal/Vertical Split | C-x C-v |
Open Item - New Tab | C-t |
Select Item and Go Forward/Backward | TAB S-TAB |
Next/Previous Item (Insert Mode) | C-n C-p Down Up |
Next/Previous Item (Normal Mode) | j k Down Up |
High/Middle/Low Position (Normal Mode) | H M L |
First/Last Item (Normal Mode) | gg G |
Scroll Preview Window⬆️⬇️⬅️➡️ | C-{u,d,f,k} |
Scroll Results Window⬅️➡️ | M-{f,k} |
Close Telescope (Insert/Normal Mode) | C-c ESC |
Buffers
Action | Shortcut |
---|---|
List Buffers | <leader> + fb → Telescope :ls → OG |
Next/Previous Buffer | TAB S-TAB → NVChad :bn :bp → OG |
Open an Empty Buffer | <leader> + b → NVChad :enew → OG |
Open an Existent Buffer | :e /path/to/{file,directory} → OG |
Remove Current Buffer | <leader> + x → NVChad :bd → OG |
Remove N Buffer | :bd <BUFFER_NUMBER> |
Go to Specific Buffer | :b <BUFFER_NUMBER> → OG |
Buffers’ List Terminology
Term | Meaning |
---|---|
% | Current Buffer |
# | Alternate Buffer |
a | Buffer Loaded and Displayed |
h | Buffer Loaded but Hidden |
= | Buffer is Read-Only |
- | Buffer is not modifiable |
+ | Buffer modified |
Windows
Action | Shortcut |
---|---|
Vertical Split | C-w-v :vsp |
Horizontal Split | C-w-s :sp |
Windows Split by opening an Empty Buffer | C-w-n |
Windows Closing | C-w-q ZQ :q |
Close All Windows (Except the Active one) | C-w-o |
Windows Detach into a New Tab | C-w-T |
Windows Movement⬆️⬇️⬅️➡️ | C-w-S-{k,j,h,l} |
Windows Focus⬆️⬇️⬅️➡️ | C-{k,j,h,l} → NVChad C-w-{k,j,h,l} → OG |
Windows Rotation (Vertical/Horizontal) | C-w-t C-w-K C-w-t C-w-H |
Windows Resize⬆️⬇️⬅️➡️ | NUMBER-C-w-{plus,dash,<,>} |
Windows Resize - Reset | C-w-= |
Windows Exchange | C-w-x |
Max Out Windows Height/Width | C-w-_ C-w-| |
Terminal
Action | Shortcut |
---|---|
Vertical Split | <leader> + v |
Horizontal Split | <leader> + h |
Toogle Floating Term | M-i |
Toogeable Horizontal/Vertical Term | M-h M-v |
Quit Terminal Mode | C-x |
Misc
Action | Shortcut |
---|---|
Toogle Line Number | <leader> + n :set nu |
Toogle Relative Number | <leader> + rn :set rnu |
NVChad Cheatsheet | <leader> + ch |
Clear Highlight | Esc :noh |
List All Registers (Normal Mode) | " → NVChad :reg → OG |
List All Registers (Insert Mode) | C-r |