I am switching from VS Code to Vim

Osama (Oisee) Ishtiaq
4 min readDec 14, 2022

Ever since I started programming professionally in 2015, I’ve heard a lot of nice things about VIM. People who use it swear by it’s efficiency and the productivity boost it provides. I too always thought Vim was cool but what prevented me from trying it was the learning curve. Aand with VS Code doing everything and then some for me, it felt like I never will.

First off, I do not have any doubt that when it comes to the “raw” efficiency and speed of writing/editing code, Vim would make me much faster. However, I believe when it comes to programming, speed of typing is never the bottleneck but the speed of thinking is. Despite my personal opinion, I do want to try it for the next 30 days and see if I was missing out. But before doing that I do want to mention what kind of work I do and what I consider to be crucial for me in an editor.

What I do?

Well my work mostly consists of working with backend-services written in TypeScript. I usually have to open and work on multiple projects at once along with opening multiple terminal windows in different paths. There’s also lots of Tests and GraphQL code generation involved.

What is crucial for me in an editor?

Some of the things that I really appreciate in an editor are following.

  • It should show me linting errors and warnings
  • I should be able to easily track what buffers/files are open and switch between them quickly
  • It should not get in my way when working so I can focus on the work
  • Good integration with git are welcome
  • It should support language server for typescript and features like ‘go to defination’, ‘find all references’
  • Should support code formatting
  • And finally it should be fast so I can keep multiple instances open without slowing down

Honestly, VS Code checks all these boxes for me. And it also has nice features that can really change one’s way of working like

  • It enables you to directly work in docker containers using Dev Container extension or WSL Extension to work in linux environment if you are on windows and Remote Explorer extension for Ssh
  • live share for pair programming
  • Lots and lots of extension for almost all the languages
  • Emmet and support for snippet extensions
  • GitHub CoPilot extension
  • Extensions that have RestClients
  • And much more which I don’t use but I can if I want with minimal setup required.

I’ve heard that using Vim makes you a better developer because with Vim, you have to work in the command line and you have to tweak the configurations and set it up yourself. You have to read the docs, you have to install plugins and make sure mappings are not conflicting. You get to learn how files and buffers work and how to use command line tools like grep to search your way through thousand of lines of code. Cool stuff for me indeed. So here starts my journey on December 8, 2022.

Initial Setup:

So I installed NeoVim, followed some tutorials to enable some basic settings like relative line numbers, installed VimPlug for managing plugins, installed coc for language servers, some other extensions and NERDTree to make it similiar to VSCode. Here’s my init.vim for anyone interested: https://github.com/osamaishtiaq/dev-settings/blob/main/init.vim

Below is what my current setup looks like

Language server for typescript works nicely, almost as nice as VS code (almost). I’m happy to report that ‘go-to-defination’ and ‘find all references’ work nicely. Linting also appears to work as I can see errors count on bottom right corner of the status bar however it is not perfect because I rarely see information popup message on hover. For that I have to use messages command. I am also using Tmux for working with multiple terminal windows and I installed Iterm terminal because I heard it has better color support than macos default terminal. I’ve deleted VS Code and if all goes well, I might never have to install it again. 🤞🏽

Update (December 14, 2022):

I had to reinstall VS Code… Reason being how the buffers work in vim and not being able to find a fix at the moment. NERDTree doesn’t highlight what buffers are currently open and I couldn’t find a nice way to see what files have been modified just by looking at NERDTree or any other place. So instead of fully using Vim, I have now installed Vim extension for VS Code as a backup. I will try to use Vim but in case something just doesn’t work and I don’t have the time to fix it, I will temporarily revert to VS Code with Vim extension. More updates to follow.🤞🏽

--

--

Osama (Oisee) Ishtiaq

Started programming when I was a kid and never looked back. I write about really specific things that I encounter in my daily dev life.