How to successfully fail with Nvim IDE

Michael Lev
Israeli Tech Radar
Published in
6 min readJul 30, 2024

So why write about my failures?

Basically, I always like to try and learn new things.
But the secret is that I am REALLY bad with it.
Generally speaking, I mostly fail a lot (most of the things, particularly the new ones).

Either way, I actually enjoy it and I must say that everyone should try learning new things all the time, no matter how hard those might look.

I will share how I’ve started and what I’ve discovered along the way, what went wrong and what went right.
First, this was a very interesting experience for me and it gave me a chance to learn from my mistakes.
Secondly, I now love using it and enjoy my time working as most of the time this is what we DevOps engineers like myself do (edit text!).

My hopes for you are A) You will decide to try it and B) Have a new perspective on how to learn new things, failing successfully.

Sharing my paths to failures

Failing to successfully learn to use Nvim is a must. The learning curve is steep, there is much to learn, even much more to break BUT once you get past it, you will see that it’s an awesome IDE frame.

Nvim is designed as an API that enables users to interact with it in a highly modular way, offering the freedom to customize nearly every aspect to suit personal preferences. This is especially helpful to keep in mind if you struggle to understand the config scripting.

From its appearance to how you interact with it, it will offer unparalleled flexibility.
You will fail so much with exploring it with an incredible array of ways to break and fail… wretchedly.

  • I’ve found AstroVim and it’s a very nice AstroCommunity, so RTFM there and you can get your setup rocking. Checking their plugin templating is a must.

So how to start my/your own failing? What have I learned from _my_ failures?

Are you eager to hear about my failures? Will you be ready to learn from them so you can succeed in your own endeavors?

  • You will break your setup.
    When you will start playing with Nvim configuration you will break it and it won’t load. It‘s part of the process, so be patient. It will be a good opportunity to learn how to do it properly.
  • Learn to use Nvim’s plugin manager (see GitHub — folke/lazy.nvim: 💤) and keep your setup in a git repository, committing before major changes.
  • Once in doubt — backup.
cp -r ~/.config/nvim{,.`date +%Y_%m_%d`.backup}
cp -r ~/.local/share/nvim{,.`date +%Y_%m_%d`.backup}
cp -r ~/.local/state/nvim{,.`date +%Y_%m_%d`.backup}
cp -r ~/.cache/nvim{,.`date +%Y_%m_%d`.backup}
  • Keep separate files for each plugin setup to mitigate risks. At first, I hadn’t and it was a pity.
  • Use :checkhelath command if things go south, as Nvim will try to show you your mistakes and how to fix them.
  • Learning keymaps can be challenging.
    Better to use a key-mapper plugin that allows search for specific mappings and add descriptions, buffeline-nvim.lua here, at the mapping section adds a nice <Leader><x>shortcuts to the buffers.
{
{ import = "astrocommunity.recipes.disable-tabline" },
{
"akinsho/bufferline.nvim",
dependencies = {
{
"AstroNvim/astrocore",
opts = {
mappings = {
n = {
["]b"] = { function() require("bufferline.commands").cycle(vim.v.count1) end, desc = "Next buffer" },
["[b"] = { function() require("bufferline.commands").cycle(-vim.v.count1) end, desc = "Previous buffer" },
["<Leader>1"] = { function() require("bufferline").go_to(1, true) end, desc = "Go to buffer 1" },
["<Leader>2"] = { function() require("bufferline").go_to(2, true) end, desc = "Go to buffer 2" },
["<Leader>3"] = { function() require("bufferline").go_to(3, true) end, desc = "Go to buffer 3" },
["<Leader>4"] = { function() require("bufferline").go_to(4, true) end, desc = "Go to buffer 4" },
["<Leader>5"] = { function() require("bufferline").go_to(5, true) end, desc = "Go to buffer 5" },
["<Leader>6"] = { function() require("bufferline").go_to(6, true) end, desc = "Go to buffer 6" },
["<Leader>7"] = { function() require("bufferline").go_to(7, true) end, desc = "Go to buffer 7" },
["<Leader>8"] = { function() require("bufferline").go_to(8, true) end, desc = "Go to buffer 8" },
["<Leader>9"] = { function() require("bufferline").go_to(9, true) end, desc = "Go to buffer 9" },
["<Leader>$"] = { function() require("bufferline").go_to(-1, true) end, desc = "Go to buffer $" },
},
},
},
},
},
event = "VeryLazy",
opts = {
options = {
mode = "buffers", -- set to "tabs" to only show tabpages instead
always_show_bufferline = true,
show_buffer_icons = true,
show_buffer_close_icons = true,
show_close_icon = true,
-- modified_icon = "",
indicator = {
icon = "▎", -- this should be omitted if indicator style is not 'icon'
style = "icon",
},
color_icons = true,
buffer_close_icon = "󰅖",
modified_icon = "●",
close_icon = "",
left_trunc_marker = "",
right_trunc_marker = "",
show_tab_indicators = true,
-- tab_size = 5,
separator_style = "thin",
numbers = function(opts) return string.format("%s", opts.raise(opts.ordinal)) end,
offsets = {
{
filetype = "neo-tree",
text = "Neo-tree",
highlight = "Directory",
text_align = "left",
},
},
},
},
},
}

Which will get you:

And you will might be saying “Gosh, I’m so lost!”

  • Again, it's better to have a search mechanism within your Vim for each element. Take a look at AstroVim and their fantastic work.
    See <leader>f:

Fail successfully and grow, don’t get lost

I’ve also learned that if you feel overwhelmed, try new approaches.

  • Use Nvim +tutor. and learn your basics.
  • Use :h <topic> and RTFM. So much work has been invested in the help docs. Read it! :)
  • So many YT videos are out there, watch them!
  • See power tips, tutorials, and so much more.
  • Use cheat Sheets! they are amazing. Vi was built with actual thinking behind it. Use combos wisely.
  • Once you will get past the tutor and read some man pages, you will start getting the idea, just keep focusing on the success part.
  • Visit This Github repo of neovim-cheatsheet
  • Have a new friend at Lazygit: simple terminal UI for git is awesome and got great documentation (Custom Commands as well!)
  • Don’t forget, RTFM
  • If something doesn’t work then it’s a great opportunity to understand how it should work.
  • Don’t forget to abuse memes.

Learn the difference between a fiasco and a failure: Run a Workshop!

I did it and that failed as well.

I failed to provide my participants with actual work to do, mostly showing examples instead.
I was excited to learn Nvim, but practicing is essential! You can’t teach Nvim without actual practice. Open the lid, give it a try, break it, and then fix it.

I repeated the workshop and had a great experience. I’ve learned that instead of avoiding your goals, take time to understand what went wrong and improve to achieve them.

  • This I’ve learned also.

Conclude

Failure is a journey, Not a quest!

Don’t be afraid to try new things, many times some of them might not work right from the start but it’s a process! Start using Nvim and get used to it, it will be awesome.

And also I want to thank TJ DeVries, the awosome videos :)
TJ DeVries — YouTube

--

--