Using VSCode was causing memory issues on my system, and it often became sluggish and unresponsive, especially when working with larger codebases or running multiple instances of the editor. This motivated me to explore more lightweight and efficient alternatives, and I discovered the power and flexibility of Neovim (nvim), a modern and highly extensible modal text editor.
- Neovim (version 0.8 or later)
- Linux Distro or look for how to configure nvim on mac
- Clone the repository:
[email protected]:RichieMuga/nvim.git
- Open your Neovim configuration directory:
cd ~/.config/nvim
- Create a symbolic link to the cloned repository:
ln -s /.config/nvim
- Start Neovim and run the following command in command mode in nvum to install the plugins:
:Lazy install
NB: Remember to install Nerd font to the terminal. Instructions are:
Install Nerd Fonts: Nerd Fonts are a popular font collection that includes many glyphs and icons used by various plugins in Neovim. To install Nerd Fonts on your Linux machine, follow these steps:
-
Visit the NerdFont Website
-
Download the font of your choice
-
unzip NerdFonts.zip
-
Copy the downloaded
.otf
or.ttf
files to system fonts directory -
Copy the downloaded
.otf
or.ttf
files to system fonts directory
sudo cp *.otf /usr/share/fonts/
- After copying fonts, refresh the system's font cache with the following command
sudo fc-cache -fv
- Configure your terminal emulator to use the installed Nerd Font:
For Gnome Terminal:
- Open the Terminal preferences (Edit > Preferences)
- Navigate to the Profiles tab
- Select the profile you want to modify
- Click on the Custom Font button
- Select the installed Nerd Font from the list
For other terminal emulators, refer to their respective documentation for instructions on how to change the font.
After following the installation steps, you can start using the configured Neovim setup. The configuration includes various plugins and customizations to enhance your coding experience.
Here is a cheetsheet of the bindings in the nvim configaration
Located in plugins/git-stuff.lua
<leader>gp
go to previous hunk inNormal mode
<leader>gt
toggle current line blame inNormal mode
Located in plugins/lsp.lua
<leader>gd
go to defenition inNormal mode
<leader>gr
refrences inNormal mode
<leader>ca
code actions inNormal mode
Loacated in plugins/none-ls.lua
<leader>gf
format code in Normal mode
Loacated in plugins/completions.lua
<C-b>
scroll docs -4 inNormal mode
<C-f>
scroll docs 4 inNormal mode
<C-leader>
complete inNormal mode
<C-e>
abort inNormal mode
<C-R>
confitm inNormal mode
Located in plugins/undo-toggle.lua
<leader>u
undo tree toggle inNormal mode
z
take screenshots inVisual mode
<C-n>
, Neotree filesystem reveal left innormal mode
<leader>bf
, Neotree buffers reveal float innormal mode
Hope you enjoy nvim as much as me. Goodluck!