In the previous article I showed you how I started my journey with Vim and briefly mentioned that I personally use the LazyVim distribution. Today I would like to explain, step by step, what all of that means, show you the list of plugins I have installed, and describe how I organize my work in this environment.

What is Neovim? Link to heading

As we can read on the project’s homepage, it is a hyperextensible text editor based on Vim. When looking for more information, we can also come across the official GitHub repository, which expands on that description and points out that the goal of the project is to strongly rebuild the base Vim experience in order to make it easier and more inviting for more people to contribute, spread the work across more developers, allow advanced user interfaces to be added without too much interference in the application’s core, and improve extensibility. That last part was achieved by adding support for Lua alongside vimrc, which led to a literal explosion of the ecosystem. More and more people started writing their own plugins adding new functionality, until we reached a point where, with their help, Neovim can practically be turned into a full-fledged programming environment with syntax highlighting, suggestions, interfaces for debugging code and running tests, and even integration with AI agents.

So what are distributions? Link to heading

There are a few problems in this whole ecosystem, but the biggest one at the beginning is the entry barrier. Creating your own configuration, tailored to your needs, can be a project in itself. I tried it myself and managed to build something useful, but I often ran into cases where I was missing support for some specific syntax, and adding it again turned into hours of searching for how to do it. This is where distributions come in. They are simply polished configuration packages that provide everything you may need to get started.

There are many distributions worth mentioning, but the most popular ones include:

Which one should you choose? If these are your first steps anyway, you probably do not have strong preferences yet, so I recommend choosing the one that looks good to you visually, reading the documentation, and giving it a try. If the way it works does not suit you, move on to the next one. If you already have some preferences, then you probably know what you want.

My personal choice is LazyVim, although I also tried NvChad and LunarVim. For me, the deciding factor was the default key mappings, which felt the most intuitive.

And what is the deal with kickstart.nvim? This project is a simple configuration in a single file. It also includes helpful comments that are meant to guide the user through the whole process of creating their own configuration. It is a nice alternative for anyone who wants to dig into that process, but as I mentioned earlier, I bounced off it.

LazyVim basics, my way Link to heading

I will say right away that I am not going to describe the whole installation process here, because it is explained well enough in the documentation, and I do not like needlessly rewriting something that already exists. In this part, I only want to list which plugins I have installed, how I use them, and how I work with the whole distribution on a daily basis.

What plugins, dude? Link to heading

So let’s start with plugins and how to install them. LazyVim gives us a very nice interface for managing plugin sets grouped by selected functionality. You open this menu by using the LazyExtras command. After launching it, you get a list grouped into categories: Enabled Plugins, Enabled Languages, Recommended Plugins, Plugins, and Languages. Here you can see all extensions that have their configurations in the distribution. The list also shows all dependencies required for things to work correctly, and those dependencies will be installed as well. The most useful ones for me are:

  • coding.mini-surround
  • editor.harpoon2
  • editor.inc-rename
  • editor.snacks_explorer
  • editor.snacks_picker

And, of course, support for programming languages and syntax. In my case, these are Go, Python, JavaScript, CSS, HTML, JSON, YAML, and Markdown.

Which-key and leader - the basics that help you understand the rest Link to heading

Let’s start with the basics. When reading the LazyVim documentation, you will often come across keyboard shortcuts that start with <leader>. What key is that, and why is it not on the keyboard? This notation means the main functional key, which in LazyVim is set to space by default. The documentation also shows in which mode each shortcut is available, but most of them work in normal mode.

To avoid constantly jumping to the browser and checking which shortcuts do what, we can use the which-key plugin, which is enabled in this distribution from the very beginning. After pressing the previously mentioned leader, meaning space, a window appears with a list of shortcuts available at the current level of the key combination. It is a great tool for learning how things work or for finding less frequently used options.

Searching for files Link to heading

Now that we know the basics, we can move on to opening and searching for files. To open the side panel with a tree view, we can use <leader>e or <leader>E, which respectively open it in the root directory of the project, meaning the place where .git is located, or in the current directory from which we launched Neovim. This is a visual method, so of course it is fairly slow if you know exactly what you want to open, but it is helpful when you are not entirely sure what you are looking for. To jump straight to the file you want, you can search by name using <leader><leader> or <leader>ff. In the same way, you can also search through file contents using <leader>/. The last thing I find useful here is searching only within open files, launched with <leader>,.

Windows and buffers Link to heading

Another thing worth understanding quickly is the difference between windows and buffers, because at the beginning it can blur together a bit. A buffer is an open file, while a window is a view into such a buffer. So you can have several buffers open in the background and only one visible on the screen, or split the screen into several windows and look at a different file in each of them.

LazyVim gives us very simple shortcuts for these splits. <leader>| splits the current view vertically, and <leader>- splits it horizontally. Later, we move between windows exactly like with Vim directions, only with control pressed: <C-h> goes left, <C-j> goes down, <C-k> goes up, and <C-l> goes right. This is one of those combinations that feels strange at first, but after a while it gets into your fingers.

I usually switch buffers with <S-h> and <S-l>, meaning shift with h or l, when I just want to move to the previous or next file. Alternatively, [b and ]b also work. If I have more files open and do not remember the order, I go back to the previously mentioned <leader>,, because then I can see the list of buffers and choose a specific one. To close the current buffer, use <leader>bd. I say “buffer”, not “file”, because this does not delete anything from disk. It only closes the currently open view in Neovim.

LSP - definitions and code diagnostics Link to heading

LSP, or Language Server Protocol, is the moment when Neovim starts behaving like a proper IDE for me. Thanks to it, we get suggestions, error information, jumping to definitions, finding references, renaming symbols, and formatting code. Neovim itself is an editor, but only connecting it with language servers gives us the level of comfort we know from larger environments.

Most often I use gd to go to the definition of a function, type, or variable. If I want to see where something is used, I press gr. Under K there is quick documentation for the element under the cursor, which is very convenient when I do not remember a function signature or want to check a type description without leaving the file. For renaming a symbol I use <leader>cr, and for actions suggested by the language server I use <leader>ca. The latter is useful, for example, for automatic imports or simple fixes suggested by language tools.

Diagnostics also have a few shortcuts worth knowing. [d moves to the previous problem, ]d to the next one, and <leader>cd shows the details of an error or warning on the current line. If the project has formatting configured, <leader>cf formats the current file or the selected fragment. In practice, this set of shortcuts replaces most of the clicking around an IDE for me and lets me quickly check what is happening in the code.

Bonus: LazyGit, a new quality of working with git Link to heading

Finally, something that is not required to use LazyVim, but fits very well with working in the terminal. LazyVim obviously has its own git shortcuts. We can preview status with <leader>gs, diff with <leader>gd, blame for the current line with <leader>gb, or log with <leader>gl. This is enough for quickly checking what has changed without leaving the editor.

Still, I really like adding LazyGit to the mix. It is a terminal interface for git where staging and unstaging files, making commits, stashing, browsing history, or resolving simple conflicts is very convenient. You do not need to remember all the commands, and at the same time you still stay in a terminal workflow.

You can run it simply by installing it and then using the command in a separate terminal, or from Neovim with LazyVim installed by pressing the <leader>gg shortcut.