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

Reference

  • Status Line

Take a look at the rest of the features here

Github Repository

NVChad Documentation


Installation

Reference

Pre-requisites

There are several required aspects such as →

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 →

nvim
:MasonInstallAll

Remove the ~/.config/nvim/.git

rm -rf ~/.config/nvim/.git
Theme Selection

To select any NVChad Theme, inside Neovim → Space-t-h

Nvchad Update
nvim
:lazy sync

Configuration Files

Init.lua
Relative Numbers

Reference

~/.config/nvim/init.lua
vim.wo.relativenumber = true
$ at each EOL

To disable $ char at the end of each line →

~/.config/nvim/init.lua
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

Reference

To disable autocommenting from a commented line →

~/.config/nvim/init.lua
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)

~/.config/nvim/lua/mappings.lua
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

~/.config/nvim/lua/mappings.lua
vim.keymap.set('i', '<C-h>', '<BS>', { noremap = true, silent = true })
Disable Short Tabulations

To adjust the tabulation size in Insert and Normal mode →

~/.config/nvim/lua/mappings.lua
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


Shortcuts

As with TMUX, in NVChad all shortcuts are preceded by a certain prefix

Default Prefix → Space

Terminology

Reference

Elements
Buffer (Item/File)File opened in Memory
WindowBuffer Visualization/Viewport
TabGroup or Set of Windows
Shorcuts’ Meaning
KeyMeaning
<leader>Space<leader> + a → Space+a
CControlC-c → Control+c
MAltM-a → Alt+a
SShiftS-o → Shift+o
SuperWindowsSuper-s → Windows+s
ReturnEnterC-S-Return → Control+Shift+Enter
-+C-z → Control+z
{a,b,c,d}a b c dC-{a,b,c,d} → C-a C-b C-c C-d
Treesitter → Syntax Highlighting

Reference    •    Supported Languages

ActionsCommands
Install a Language:TSInstall <LANGUAGE_TO_INSTALL>
Check Installed Languages:TSInstallInfo
NVimTree → File Tree

Reference

ActionShortcut
Open/Close FileTree WindowC-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/FileReturn r
Create/Delete a Filea d
Copy/Paste a Filec p
Search a File (Filter Mode)f
Select a File (Mark Mode)m
Telescope → Fuzzy Finder

Reference I    •    Reference II

Finders
ActionShortcut
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
ActionShortcut
Confirm Item Selection (Open Item - Current Window)Return
Open Item - Horizontal/Vertical SplitC-x C-v
Open Item - New TabC-t
Select Item and Go Forward/BackwardTAB 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

Reference

ActionShortcut
List Buffers<leader> + fb → Telescope
:ls → OG
Next/Previous BufferTAB 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
TermMeaning
%Current Buffer
#Alternate Buffer
aBuffer Loaded and Displayed
hBuffer Loaded but Hidden
=Buffer is Read-Only
-Buffer is not modifiable
+Buffer modified
Windows

Reference

ActionShortcut
Vertical SplitC-w-v
:vsp
Horizontal SplitC-w-s
:sp
Windows Split by opening an Empty BufferC-w-n
Windows ClosingC-w-q
ZQ :q
Close All Windows (Except the Active one)C-w-o
Windows Detach into a New TabC-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 - ResetC-w-=
Windows ExchangeC-w-x
Max Out Windows Height/WidthC-w-_ C-w-|
Terminal
ActionShortcut
Vertical Split<leader> + v
Horizontal Split<leader> + h
Toogle Floating TermM-i
Toogeable Horizontal/Vertical TermM-h M-v
Quit Terminal ModeC-x
Misc
ActionShortcut
Toogle Line Number<leader> + n
:set nu
Toogle Relative Number<leader> + rn
:set rnu
NVChad Cheatsheet<leader> + ch
Clear HighlightEsc
:noh
List All Registers (Normal Mode)" → NVChad
:reg → OG
List All Registers (Insert Mode)C-r

NVChad Cheatsheet