Replacing VS Code
VS Code is heavy and slow. If you are using it on an high end PC you would not notice its slowness. If you are using it, with Chrome as the other opened application you would not realize how much of a memory hog it is.
I don’t fit into any of the above scenarios.
I work on a Dell Latitude E5430. I run Ubuntu instead of Windows, not only for its development advantages but also for its memory management.
I also have at least four applications on every good working day: Editor (usually VS Code), Docker, Postman and Chrome. So my PC’s memory is almost nearly completely consumed at the start of each work day and I have become accustomed to hearing the fan whirl while I work. It provides background noise though and that is great.
You’ve probably gottent the whole picture at this point. I have a tight memory constraint and I can actually feel the memory chipping away with every application I open so when there is a less memory intensive alternative to a tool in my workflow, I immediately want to try it out.
And that is the story of my editor.
Finding a VS Code replacement
Since late last year I have been hearing a lot about Neovim, which is a flavor of Vim. It runs on the terminal and it is fast. Those are the pros. Then there are the cons:
-
You have to know Vim to use Neovim. It runs on the terminal and it does not give a lot of buttons for you to click, so you have to familiarize yourself with keybindings before you can start using it. The great news though is that there are a lot of resources with which you can learn the basic keybindings.
-
The base installation of Neovim is quite useless, unless you want to edit a simple txt file. If you tried to use it for anything bigger than that, you would get frustrated fast, so you either have to learn how to configure it to suit your existing development style. You can do that on your own or using one of the numerous community configs available.
But like I said earlier I have a really tight memory constraint so learning how to use a new kind of editor in return for a some gigs of memory wasn’t really a bad deal besides if I learnt it well, I could join the “I use Vim btw” side of the internet so yeah I went head first into Vim land.
Learning and configuring Vim
I typed “How to learn Vim” into the Google search bar and I was greeted with a lot of varying responses. It was dizzying so I asked people that I knew were using Vim for their advice.
Remember when I said that Vim runs on the terminal, well it is not recommended to use just any terminal. They said a lot of things about terminals and in the end Wezterm was recommended as a terminal and Primeagen’s Neovim RC From Scratch and off I went.
Time to learn how to configure Neovim.
On January 1 of this year, I spent nine hours crafting out a Vim config. I was lost. I did not understand a lot of the things I was doing. The longer I worked on that config the more I appreciated the builders of VS Code. I remember installing plugins (the Vim equivalent of VS Code extensions) and asking myself whether I would remember the keybindings for activating them.
By the end of the day though, I felt fulfilled. I was finally having a shot at replacing VS Code with a lighter alternative.
How did Vim go?
By the way, Wezterm also has a bit of configuration but the default is great and unless you are terminal dweller you would not need to use anything outside what is provided.
I mostly work with Go so I quickly opened a project in the new config, and I wasn’t really feeling it. The editor itself was fast but I did not know all the keybindings necessary for moving around so the entire experience ended been quite slow. That was a skill issue, but it was enough to make me close my laptop and call it a day.
The next day I tried again. I tried to install the Go LSP and let’s just say it didn’t go well. So I decided to check out the other configs available to the community. That was when I landed on LazyVim.
LazyVim solved all my problems in on swipe. It was a Vim miracle. It felt like yesterday I was struggling with Vim and today I can build anything with Vim. The experience was beautiful.
At this point in the story you are probably expecting me to say: I have a Vimmer ever since.
Sorry to disappoint you. I left Vim. I got tired of the editor. It was unfamiliar, I didn’t have time to learn it. All I wanted to do was return to Go in the safety of VS Code regardless of how my PC would fare. So I went back.
These are my configs for both vim and wezterm.
From Vim to Zed.
I was okay with VS Code till this post from Zed’s blog. Finally another editor. This time it ticked both the boxes of memory management (it is written with Rust instead of Electron) and it had nothing to do with Vim (unlike Helix) so I was eager to try it out.
And I wasn’t disappointed.
I have never felt an editor so fast and usable out of the box before. It provided a lot of language support, even for Go, without becoming a memory hog.
I did not need to learn new keybindings to start using it. It came with VS Code keybindings, which I have gotten used to, already set up.
Needless to say, I have been using Zed ever since then. I have only opened VS Code once and I closed it almost immediately.
Zed has not been a bed of roses. It is under very active development so I did not and still do not expect to completely match the VS Code experience band for band but there are some things that I wish Zed had:
- A terminal that scrolls: I currently open an instance of Wezterm on the side to handle any command line activity. I’m not complaining but I wish it was better.
- Project wide search: The current search bar works on a file level so you can’t find matches on a project level and I wish I could. It would make things go smoother
But that’s pretty much the core wishes at this point.
Conclusion
If you had told me in 2021 that things like OS and Editor would be bottlenecks in my workflow I would not have believed you but right now they have been, I have solved them and I am loving the current tools in my workflow.
My current aim is to replace all Electron based applications in my workflow with lightweight alternatives. I think I would get there soon.