I have tried to use Neovim but it was not working well with my vim configurations. And now I try it again with no configs.

TLDR Link to heading

I get bored of using VS Code and want to try Neovim and I love it.

Installing Neovim Link to heading

I have tried to use Neovim but it was not working well with my vim configurations. And now I try it again with no configs.

First of all, even though I like using vim, but during development I still use VSCode more as main IDE. Setting up debuggers with VSCode is much easier and I need it to work for my daily job so I keep sticking with it.

At this point, I am familiar with some vim movements. What I’m looking for is an editor can help me write code fast and also debug different languages like Javascripts and Python, whose I often use. And I have to admit I use VSCode just because it do the job, but I don’t like it at all :)

Okay, here’s how I do it. First of all, I need to install Neovim on my computer so I use brew option.

brew install neovim

When I run nvim, there are some errors because Neovim reads my .vimrc file and tries to load some plugins and fails. So I just get rid of the old vim configurations (I have the backup file so not a big deal). And then start neovim again.

At this point is is nothing much to talk about neovim, it feels the same as vim without any key mappings and plugins. But I’m completely new to this, I need to find a high rated initial configurations for beginner like me, something like oh-my-vim. Luckily I found this youtube video

An official kickstart repository of neovim. Can’t be better. So I just watch the whole video, skim through the document and install the repo into my ~/.config/nvim.

git clone https://github.com/nvim-lua/kickstart.nvim ~/.config/nvim

After restarting, the init.lua script start downloading default plugins. But my neovim background turn blue, like the Windows' blue screen 😱

I quickly found an issue https://github.com/nvim-lua/kickstart.nvim/issues/68, because I’m using Mac default terminal, it does not support true colors which I have no idea why a terminal editor need anyway. So I just follow the instruction and disable the theme that causing issue. And then I restart neovim again and it start working as I expected.

Time to try out some features.

Some features come with kickstart Link to heading

  • File searching. I have to say the file searching is awesome. Switching between files is one of the mostly used command. It is similar as fzf vim. But the key map configured out of the box and easy to remember makes me so happy. In normal mode, just press SPACE s f and then type the file name you need in search box. You can press enter to open it in current buffer or Ctr t to open in a new tab.
  • Symbol searching. An other frequently used task is searching for code that we don’t remember where it is defined. In normal mode, just press SPACE d s or SPACE w s and continue typing the symbol.
  • Tree explorer. To use tree explorer, I copy the instruction from README file in kickstart.nvim and start using neo-tree. And I also need to change my terminal font to Hack Nerd font to display icons correctly. To display dot files like .gitignore, I need to add some options to neo-tree. And it just work as how I need it to.
return {
  "nvim-neo-tree/neo-tree.nvim",
  version = "*",
  dependencies = {
    "nvim-lua/plenary.nvim",
    "nvim-tree/nvim-web-devicons",
    "MunifTanjim/nui.nvim",
  },
  config = function ()
    require('neo-tree').setup {
       filesystem = {
        filtered_items = {
          visible = true,
          hide_dotfiles = false,
          hide_gitignored = true,
        },
      },
    }
  end,
}

Debugging Link to heading

I want to try debugging real complex project, it would require more configuration than running debugger on a single file. So I will let it for the next post.

Bye bye!