Set Up Neovim with kickstart.nvim on Mac as a Vimginner
Tags: beginners, editor, productivity, vim
Published: 2024-02-17 23:07:40


![5 stage vim the prime video thumbnail](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c8d5duozvik4e1jst14m.png)

https://www.youtube.com/watch?v=uYXlgZKdsFM&t=412s

---

Recently, I have been watching a lot of videos on ThePrimeTime channel. He sometimes mentioned `vim` in his videos. It may have developed my curiosity about `vim`. Actually, I gave `vim` a try and it completely failed. I just turned on syntax highlighting and number lines and gave up. Today, I watched a video titled `The 5 Stages of Vim` where he reviewed an article [The 5 Stages of Vim: A Humbling Experience](https://scottmckendry.tech/posts/vim-humbling/). I decided to give it a try once more, but `Neovim` not `vim`, in the video, he mentioned `kickstart`, which comes with useful plugins. I thought it might be working this time.

I set it up quite successfully, and I'm going to share the process in this article, which I have done.

> FYI, my laptop is MacBook Air M1, 2020 and the version of macOS is Sonoma 14.2.1. 

I'm going to share in this order:

- [Install Neovim](#install-neovim)
- [Set up Kickstart](#set-up-kickstart)
- [Install a new terminal WezTerm](#install-a-new-terminal-wezterm)
- [Open Neovim through vi or vim commands](#open-neovim-through-vi-or-vim-commands)
- [Some Neovim Tips](#some-neovim-tips)
  - [1. File Browsing](#1-file-browsing)
  - [2. Move Between Split Screens and Tabs](#2-move-between-split-screens-and-tabs)
  - [3. Comment Multiple Lines](#3-comment-multiple-lines)
- [Conclusion](#conclusion)

---

# Install Neovim

1\. Open [https://github.com/neovim/neovim/blob/master/INSTALL.md](https://github.com/neovim/neovim/blob/master/INSTALL.md)

2\. Unzip the zip file where you want to unzip in

I just unzipped it in the home directory.

![nvim folder in home directory](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/igsasyhk8el0s78qv4id.png)

---

# Set up Kickstart

1\. Open [https://github.com/nvim-lua/kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim)

2\. Clone git with the command shown in the README

![guide in the github](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4wiy6bbq0nhd9vplb61e.png)

If `XDG_CONFIG_HOME` is not set, the project will be cloned in `$HOME/.config/nvim`.

3\. Execute nvim

![execute nivm](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tvgf0enzvwl2ya220z6c.png)

Everything will be set up automatically.

---

# Install a new terminal WezTerm

![reddit article](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5md9nbbyd288v8288zsr.png)

https://www.reddit.com/r/neovim/comments/154280j/fresh_install_of_kickstartnvim_why_are_my_colors/

This is the problem I encountered. Nvim Color is broken. It turns out that using `nvim` in the default terminal of Mac has this issue. There are many options out there but I decided to install `WezTerm` terminal, there is no specific reason for choosing this one. I'm a newbie, choosing the best one is not what I have to do right now. I will figure out which terminal will fit me.

You can install a terminal you prefer to use or you may have one already.

1\. Open [https://wezfurlong.org/wezterm/install/macos.html](https://wezfurlong.org/wezterm/install/macos.html)

2\. Install WezTerm. There is a step-by-step guide on the website.

Now, you must open the new terminal app instead of the default terminal on macOS to use `nvim`.

---

# Open Neovim through vi or vim commands

I think there are other ways for this but I will explain what I've done.

1\. Create a folder `bin` under the home directory.

```properties
mkdir ~/bin
```

2\. Create a soft link file

```properties
ln -s ~/nvim-macos/bin/nvim ~/bin/nvim
```

![nvim softlink](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6czi2n8l65l3swn1zmjo.png)

3\. Add the custom bin folder in `$Path` env and aliases for `vi` and `vim`.

In the `.zprofile`,  add the following lines. If you don't have the `.zprofile` under the home directory, you should create the file.

```
export PATH="$HOME/bin:${PATH}"

# open neovim with vi command
alias vim="nvim"
alias vi="nvim"
```

![zprofile](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ikkcqjwlihfptll4rl1n.png)

4\. Load `zprofile`

```properties
source ~/.zprofile
```

If you reopen the terminal, you don't need to load `zprofile` manually, it will be applied when you open a terminal.

I created a custom bin directory, considering that I may get some more executable files in the future.

---

# Some Neovim Tips

Now, we're ready to use `nvim`. There are lots of commands and features. They are what we have to put some time into to get used to it. It's not what we can be good at right away just because we know them. To replace `vscode` with `nvim`, I wanted to know three things that I think it is necessary.

---

## 1. File Browsing

`Telescope` is a plugin included in `kickstart`.

Press `Space` then, `s`. You will get to see options once you press `Space`.
Also, you can use it `:Telescope [command | you can find a command using tab]`. 

---

## 2. Move between split screens and tabs

If you open a file in `Telescope` with a key `Ctrl + T` or `Ctrl + V`, you will open the file in a vertical tab(Ctrl + V) or a new tab(Ctrl + T).

It is really cool how it works in the terminal, anyway, I needed to know how to move between tabs and screens without a mouse. As I decide to use `vim`, I don't want to use a mouse.

Move to the left screen: `Ctrl + W`, then `h`.
Move to the right screen: `Ctrl + W`, then `l`.

In fact, the `h` and `l` keys are the same when you move a cursor.

Move to the next tab: `gt`.
Move to the previous tab: `gT`.
Move to the `N`th tab: `[number]` + `gt`.

---

## 3. Comment Multiple Lines

1\. Enter `VISUAL BLOCK` mode (Ctrl + V) and move a cursor up and down where you want to make comments

![visual block](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/saibq15acnuc4wofpymw.png)

2\. Enter `INSERT` mode (Shift + I) and write comment signs

![insert mode](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4q6aie6zyipxkmxl9dht.png)

3\. Break `INSERT` mode (ESC)

![multiple comments](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qlpv1hcw5zgsd8iot9qz.png)

---

# Conclusion

I just made one step for the vim world. `vim` was an editor that I always wanted to try because it looks so cool, of course, it's light and fast, you can even use it in the terminal. But after a couple of failures, I stopped giving it a try and when I saw people using `vim`, I gave them a weird look. I can't reach them, then I make it bad.

Now, with `nvim` and `kickstart`, I could start it easier than ever. I saw some videos talking about `vim` and they say once you get used to it, you can be way more productive. Also, it comes with a bunch of useful plugins. There is one thing more, it's just what I imagine though, it could be good for brain exercise, you know, all the commands and key combinations, most importantly, you can enjoy coming from learning new things. When you learn a new programming language and its concept and philosophy, you realize that what you have known can be different and there are so many ways out there. For example, it's what ThePrimeTime said though, placing file explorer on the side of an editor is what it has to be as I thought, When I realized it doesn't have to be, it was kind of shocking and an amazing experience. You know, breaking stereotypes. I'm very looking forward to using it.

I hope I settle down well in **the stage 4: Embracing the Suck.** 

Happy Coding!