Vim for JavaScript and React in 2019


In this article, I’d like to share some of the Vim plugins that will transform your Vim into an IDE for JavaScript and React (step back, VS Code!).

Note: I will only talk about JavaScript-specific plugins here. For must-have general-purpose plugins see my other article.

Syntax highlighting

Many of the old syntax plugins for JavaScript have troubles with some modern features like arrow functions or async/await. But YAJS which simply stands for “Yet Another JavaScript Syntax” with over 600 ⭐on Github, can handle it flawlessly.

For proper JSX support you will also want to install the vim-jsx plugin.

I would like to also recommend this color theme called OceanicNext. It is a little bit like Sublime. You can see it on the first screenshot for this article.

Linting and formatting

Since the release of Vim 8 many people swapped the old Syntastic plugin with the new ALE plugin which is fast, easily customizable and asynchronous. The last thing means that your editor won’t freeze anymore as the linting happening. It also supports so many different languages, linters and fixers that you won’t need to think about it anymore.

Here’s how I have it customized to associate specific linters with the file types:

Many of the linters (like eslint) can also fix your code, which is very handy.

The last option will make ALE auto-fix your file every time you save it.

Another useful feature is navigating to the next / previous error with ]r / [r.


For the autocomplete in Vim there are multiple options. I use Deoplete, mostly because it just works with my current setup (I use NeoVim on a daily basis).

Then it depends on how you like your JavaScript. If you use Flow or TypeScript, both of these tools are capable to provide some autocomplete suggestions but you will need to install some plugins first.

This is it. for now!

If you know any other useful plugins I need to include in this article, please let me know!

Vim From Scratch

If you’re willing learn Vim to upgrade your productivity to the next level, you might be interested in this little video course I’m working on called “Vim From Scratch”.

The idea is to walk you through starting from absolute no knowledge to a Vim Guru and making Vim Into a full-featured IDE along the way (for JavaScript, React and TypeScript).

To get the latest news about it subscribe here.

Recent Posts