~/neovim-zen


# info

This page contains info about my neovim config, called neovim-zen. You can find the repo for my config at neovim-zen



neovim-zen is my first attempt at doing neovim from scratch


I wanted to have a minimal text editor that I actually understood how it worked. I tried community setups like LazyVim but disliked them becuase they had a bunch of keymaps that I didn't make so I didn't understand what was actually happening and often had to search how to do something.


This is why I wanted to neovim from scratch, so I could customize everything the way I wanted to and only have plugins I wanted. Creating my own neovim config would mean I wouldn't have to search how do something in it since I'm the person who made it.


Here are the plugins in my neovim setup as of right now. (from my lazy-lock.json)


=> fetched from https://github.com/maxhu08/neovim-zen/blob/master/lazy-lock.json
in 0.000ms 

I used this video as a rough guide to do neovim from scratch:



This video was very useful for setting up lsp and it used lazy.nvim which is what I was looking for.


While following the video, I customized things such as the keymaps and how plugins are configured. I also added plugins I wanted like noice.nvim and flash.nvim. I also replaced alpha.nvim with dashboard.nvim


In the next section, I will go over how to install my setup, neovim-zen



# quick-start

To setup neovim-zen you need to have these programs installed


requirements:

- neovim

- a true color terminal (e.g. kitty)

- a nerd font like (ttf-firacode-nerd)

- nodejs and npm

- ripgrep



$ pacman -S neovim

First install a true color like kitty, I prefer kitty over alacritty because it supports ligatures like this -> => >= <= == !=


$ pacman -S kitty

Next install a nerd font to display icons properly. I use ttf-firacode-nerd. I'll also install ttf-apple-emoji for displaying emojis.


$ pacman -S ttf-fira-code ttf-firacode-nerd

ttf-apple-emoji is from the aur


$ paru -S ttf-apple-emoji

Install nodejs and npm which will be needed for some plugins. I also installed pnpm since it's faster than npm


$ pacman -S nodejs npm pnpm

Lastly, install ripgrep which is needed for telescope


$ pacman -S ripgrep

I'll also install eslint and biome which will be using for linting. Use (npm/yarn/pnpm/bun)


$ bun i -g eslint biome

After that just follow these commands to copy my config into your ~/.config/nvim


# backup old neovim config
mv ~/.config/nvim{,.bak}

# optional backup
mv ~/.local/share/nvim{,.bak}
mv ~/.local/state/nvim{,.bak}
mv ~/.cache/nvim{,.bak}

# copy neovim-zen config
git clone https://github.com/maxhu08/neovim-zen ~/.config/nvim

# remove .git folder so you can add your own repo later
rm -rf ~/.config/nvim/.git

# start nvim !
nvim

That's it!

# using-neovim-zen


For using neovim, the keymappings are the most important thing, which applies to all neovim configs. So I'll talk about how I set up my keymappings first.

I tried to keep all the keymaps easy to remember. I follow a pattern, keymaps starting with <leader>s are for managing splits, <leader>t is for managing tabs, and so on.

I also made it so the most common actions are done by pressing the key twice. Like pressing <leader><leader> opens telescope, <leader>ss creates a new vertical split,<leader>tt creates a tab. So pressing a key twice is usually for creating or opening something new. Except for the file tree, nvim-tree which is opened with <leader>e

Next, I made it so pressing a key then l closes it. For example closing the current focused split is just <leader>sl and closing a tab is just <leader>tl. I usually remember it as l stands for `lose` and l is also easier to press than x for me.

Here are some other important keybinds:


other important keybinds

- <leader>ca - code actions

- <leader>srn - smart rename

- <C-space> - cmp

- g? - show documentation

- J & K - move current line up and down

- H & L - move to prev or next tab

- <leader>nh - clear highlight after search

Lastly, for using the terminal I use tmux. I know there are plugins that allow a terminal in neovim, but I went with tmux because it's more flexible and it also has sessions which are pretty useful. To check out my tmux workflow see tmux-zen