My Two Biggest Gripes With Neovim
Let me state upfront that Neovim is my editor of choice. I made the switch from VSCode about 6–8 months ago and now Neovim really is my goto editor (I’m not just saying that, I actually use it). However, it does come with some issues and that is what I want to share in this article.
I am by no means an expert in Neovim and I am sure that the two items that I list can be resolved or worked around with a little more knowledge or knowhow. I just haven’t had the time of the energy to go and find these answers so if you know any better ways please feel free to share.
Find And Replace All
I find that when I am working on code I invariably want to find and replace certain words quite a bit. This could be due to renaming a variable, swapping out a function with a more appropriate one or something else. The point is, it’s something I find myself doing a few times everyday.
In VSCode there were various ways to do this and the most common for me was to do the old cmd + shift + f
which would bring up find and replace across the whole code base you have currently open in VSCode. There would be an input field for you to type the word you are looking for and then an input field below for you to type the word you want to replace it with. In the UI of VSCode it would show you all the files where this word existed and where the changes will occur. It is pretty neat.
In Neovim it’s not so neat. I have this keymap for the Telescope plugin which I use in my Neovim setup:
keymap.set("n", "<leader>r", "<cmd>Telescope live_grep<cr>", { desc = "Find string in cwd" })
This invokes the live_grep
function from the Telescope plugin, which allows you to search for a string in the current working directory by typing it in. Which is essentially the same thing as the VSCode ‘find and replace’ but I have found it just doesn’t work as well. There have definitely been times when I know a certain file exists with a certain string but it just doesn’t appear in the live_grep search.
It’s the same for find and replace in a file also. VSCode is just better. cmd + f
and you are able to search for a string and then easily replace all instances of it. In Neovim you can use the /
to at least find all instances of a string and use n
to cycle through them. But to replace all instances you have to do:
:%s/old_string/new_string/g
This is not something easy to remember and it always takes me a minute to remember what the characters and order are. Even then I get it wrong half the time. For me something like cmd + f
is much more intuitive and easy to remember.
Moving Files
I work mostly in React so it’s fairly common for me to want to move around files. You start off with one idea of how the components will be laid out and then as you start working things evolve or requirements change and before you know it you are refactoring components and having to move around files so your file structure makes more sense.
In VSCode this is very easy. You just drag and drop the file in the new location and in some development environments it even updates the ‘import’ paths in the files that are using that particular component. It’s a very good DX.
However, in Neovim I really struggle with this. I am using the plugin neo-tree which is really nice. It even has a shortcut key to move files. The problem I find though is it’s not obvious how to use it. It seems to be based on relative paths but I seem to get this ‘relativeness’ wrong about half the time which has caused me some pretty unpleasant experiences.
There also doesn’t seem to be any way to easily undo something you just did if you do make a mistake. Therefore, due to the number of unpleasant experiences I am now scared to even use the move feature. It’s embarrassing to admit but if I have to move around any files then I open VSCode and move the files in there. Then I close it back up and continue editing the file in Neovim.
Conclusion
Like everything in life, Neovim is not perfect. It gives you so much but it does come with some caveats. I live in hope that these gripes I have mentioned above are solvable and with a little time and patience I will work out how to improve these particular experiences.
For anyone thinking of trying out Neovim, please don’t let these gripes put you off. I still think that Neovim has much more positives than negatives and I plan on continuing to use it. Just bear in mind that the learning curve is steep and it takes time to get familiar with the way it works. But in this day and age where every company is trying to make our lives easier, it’s nice and refreshing to have a little struggle.
Subscribe to My Weekly Updates!
Enjoyed This Post?
If you found this blog post helpful, why not stay updated with my latest content? Subscribe to receive email notifications every time I publish. New posts go live every Monday at 8:30 AM Central European Time.
What You’ll Get
By subscribing, you’ll get:
- Exciting Discoveries: Be the first to know about the latest tools and libraries.
- How-To Guides: Step-by-step articles to enhance your development skills.
- Opinion Pieces: Thought-provoking insights into the world of frontend development.
Join Our Community
I live in the vibrant city of Prague, Czech Republic, with my family. My blog is more than just articles; it’s a community of like-minded developers who share a love for innovation and learning.
About me
I’m a passionate Frontend Developer specialising in React and TypeScript. My professional journey revolves around exploring and mastering new tools and libraries within the JavaScript ecosystem.
Check out the original blog post on my blog.