Page content

I think before I even get started I want to be clear about a few things.

Level set

First, package managers.

I am using Lazy.NVim. This is not the time or place to argue what is best and such, just know I will be writing this from that perspective. While I am not well versed in some of the other package/plugin managers, from what I have seen many are similar with concepts and the language as many will use Lua. Right now, Lazy is my manager of choice, which like everything in this ecosystem is subject to change, and probably will once I get good at things.

Sub-first…

This confused me for a long time, and I may still have this wrong, but I want to write it out.
Lazy.NVim = Plugin manager
LazyVim = Config
Folke wrote both and they are both great, but Lazy.NVim is the plugin manager for neovim, while LazyVim is the config. I have seen and heard many people use them interchangabely, and just calling it “Lazy”. I will even do that, but I am trying to make that distinction, and I am trying to only use Lazy.NVim, the plugin manager. That is what this litle side-rant is about, the plugin manager, not the config. The rest of this will be centered on making my own config.

Second, updates.

Once things are configured and you have your plugins…how do you update them? Most of the config, which this is about, will be based on what plugins you have. So it makes sense to know “how to update”.
There are some quick shortcuts for that and its really easy.

Third, config file location

I am using the .config from my home directory, which has an nvim folder.
~/.config/nvim/ This is for linux and macos, Windows will be something similar, ~AppData/Local/nvim/.
This directory can be changed in your environment settings by using the $env:XDG_CONFIG_HOME variable, but it is set to this by default.

Dive into Plugins

From here on out we are going to live in the plugins/ directory ( ~/.config/nvim/lua/plugins ).

Initially, this is going to be a “starting from scratch” session.
There are some really awesome configs out there, such as LazyVim, NVChad, Astro, and more. This is not going to be a “lets clone those and add our configs”. Instead, I want to understand what those ones are doing, each of their plugins, and how I can do things that make sense to me. This is nothing against those, as they are awesome. But, along those lines, I will be borrowing some thoughts and preferences on whcertain plugins to use from some of them.

Later, I might try to break this out into a setup for other configs.

1 - basic appearance & ui
2 - inner functionality
3 - cool addons
4 - linters
5 - personal

Lets focus on some appearance

nvim-web-devicons - this is in so many packages as an “optional” item, but it makes it look so nice when you have these UI elements. Because this is with so many other packages, we will start here.
For any NVim plugin using Lazy, you need to return a lua table. A lua table is very straightforward, its like a JSON object, where you have the curly braces, some key value pairs, can contain strings, numbers, arrays (which are also defined by having square brackets) and booleans. Alsoa lua table can also contain lua functions as a value that is being passed.
I am not a lua expert, I know more than enough, but I won’t get into too much detail here. More on the little that I do know in another post. NOTE that a comment in lua is preceeded by a double dash -- and can be inline. And unlike JSON, a lua table is still part of the programming language so it can’t be condensed down to one long line effectively.
The minimum that is needed for any plugin, is just the statement return {}. Inside those curly braces is where the table goes.
For nvim-web-devicons all we need is the following saved into a file named nvim-web-devicons.lua in the plugins/ directory ( ~/.config/nvim/lua/plugins/nvim-webdevicons.lua ).

return {
  "nvim-tree/nvim-web-devicons",
}

Here we see the return statement, followed by those curly braces, which also closes out the file as well. Then on the next line its the reference to the plugin.
I believe that Lazy, as well as other packages, inject ‘https://www.github.com/' before that string. So this means that the plugin should be found on github publicly open sourced and not bitbucket or gitlab or local. I believe if you do want to source from a local directory or another repo network you have to have the full path. This is interesting to me as I will research this more.
Going to any of these github pages is easy, and you can find the install and config options for each one there as well. Not every repo will have a ton of information and install or config options for Lazy.

What this will do is generate icons based on certain things for you. If you have “tabs” at the top to show the different buffers in NVim, it will help detect the file type and display the appropriate icon. If you have an explorer tree, it will show an icon next to all the files. If you have a status line with directories and branches and the file it will do the same thing there as well. And many more locations will this popup. I like the icons as a visual indicator, some don’t. All this will appear in those locations assuming you have the plugin and you configure the plugin to do that. You can easily have buffers displayed as “tabs” without icons and still have it look nice, if you don’t configure that options.
NOTE: tabs in Vim are different than the normal tabs we talk about with browsers and windows and such, but that is another post, but I will use the term “tabs” so a beginner knows what is implied and a more experienced person hopefully knows its not a legit Vim thing).

With this plugin, I went over more than normal, but its a very basic plugin and its a good thing to start with. Additionally, I probably explained things backwards.

Looking at the documentation we can do A TON more config with it, such as making custom icons and colors for different situations, but for now we will leave it as is.

gitsigns gitSigns is similar to nvim-web-devicons except that its specific to git and the actions associated with it.
I am curious if nvim-web-devicons has a set of git icons or not.

Lualine -

Bufferline -