In this article we are going to install 6 new plugins including:
If you haven’t seen the previous episodes, follow the links:
Before anything else make sure you have the Terminal Root icons installed, the repository address is: https://github.com/terroo/fonts, use the fonts
branch.
Once we have the fonts we will install the icons to use when installing the Status Bar. We will use Nvim-web-devicons.
To do this, just add the line below to your lua/plugins/plugins.lua
:
Then just run:
:PackerInstall
Now create a file inside the directory and name: ~/.config/nvim/lua/plugins/utils.lua
and insert this content:
We won’t see the effect of this yet, only when installing the next step plugin!
The status bar that I use and find it very cool is staline.nvim it is very light and written in Lua, besides having several cool themes . To install, we already know in plugins.lua
:
And then: :PackerInstall
.
Let’s use that function concept we saw, so add this to the end of the settings.lua
file:
I use this variable for a code I created for my Status Bar.
Now let’s go back to the utils.lua
file and add this code which is in keeping with its theme that I use:
Note that I’m using
require("lfs")
, I use it because it’s easier to check if a directory exists, it’s Lua File System , a module that requires installation if you don’t have it, use your system’s package manager or LuaRocks to install it, but try first if there isn’t one critical is because it is already installed.
Colors are in
mode_colors
, change to the colors you want (n for Normal mode, i for Insert and so on).
If you want your distro icon to appear, download this file run it with lua systems-icons.lua
and see if your distro/system icon appears on the terminal. Copy and replace the Gentoo(cool_symbol
) icon with what you want!
Another thing is that I only use LSP for C++, however later we’ll detail LSP, then you can change it as you wish, rest assured!
The result of the Status Bar should look similar to this:
If you want a different theme see the procedure in the repository
A really cool feature in an IDE is the fact that it has lines that determine where code indentation starts and ends. And a plugin that does this extraordinarily is indent-blankline.nvim
We added to plugins.lua
and installed:
After installing and using :PackerCompile
(which in our case is automatic, as we did) it already works! Open any file and note that the indentation lines already exist.
You can create new files for each plugin with the same name as the plugin (that’s how I do it), but here we’ll add the settings to lua/plugins/utils.lua
to centralize the information.
If you want the indented lines to be colored, add this to your utils.lua
The result will be this:
For more information see the repository .
When working with colors, it is interesting to type the name or code of the hexadecimal or RGB color and then display it so that we know what color it is and how it will be displayed. For example: #554477 .
For this we will use nvim-colorizer.lua
And in utils.lua
just import it and call the setup
function to load it:
Add this line:
Now the colors typed into your Neovim will appear like this:
To finish this episode I recommend two plugins that we talk about them in this video .
Which is Vim Surround, to create or replace characters around a word, very useful for those who frequently write in Markdown and Nvim Autopairs , it is superior to Vim Autopairs, because if there is a character in front it does not add.
Just install them.
Surround is automatically available after installing, Nvim Autopairs needs to add this code to its utils.lua
:
– FOR AUTOPAIRS
For more information about these plugins see their repository.