Visual Studio Code plugins for Ruby and Rails
Tags: vscode, ruby, rails, productivity
Published: 2019-10-06 13:56:08

---
title: "Visual Studio Code plugins for Ruby and Rails"
published: true
tags: [Vscode, Ruby, Rails, Productivity]
description: A quick list of all the plugins I use for Ruby on Rails development.
cover_image: https://www.mskog.com/images/minimalism@2x.jpg
canonical_url: https://www.mskog.com/posts/visual-studio-code-plugins-for-ruby/
---

A quick list of all the plugins I use for Ruby on Rails development.

<!--more-->

## Ruby/Rails specific extensions

#### [Ruby](https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby)
You will need this for syntax support and such so this is a must have.

#### [Ruby Solargraph](https://marketplace.visualstudio.com/items?itemName=castwide.solargraph)
This one is a must have. It will enable "Go to definition" in Ruby for all classes, modules and methods. It also has context-aware code completion and documentation. Extremely handy. If you only choose one of the plugins on this list(except for the Ruby one) then make it this one. It is quite something!

#### [ruby-rubocop](https://marketplace.visualstudio.com/items?itemName=misogi.ruby-rubocop)
If you use Rubocop then this extension will let your format your code using Rubocop. This is highly recommended as it will enforce a consistent style in your code. Especially if you are working in a team.

*Pro tip*: If you use Spring then you can use [spring-commands-rubocop](https://github.com/toptal/spring-commands-rubocop) to make a binstub for Rubocop and then it will run much faster. You will need to set the "ruby.rubocop.executePath" setting in VSCode to "bin/" for this to work properly.

#### [Rails Fast Nav](https://marketplace.visualstudio.com/items?itemName=jemmyw.rails-fast-nav)
If you are using the default Rails way of organizing directories and such then this plugin can make navigating your application a breeze. You can use it to quickly navigate between controller actions, model, views and even specs.

#### [Rails Open Partials](https://marketplace.visualstudio.com/items?itemName=shanehofstetter.rails-open-partial)
This will enable the use of "Go to definition" in VSCode for view partials. Very handy for quickly navigating through a complex view structure.

#### [Rails latest migration](https://marketplace.visualstudio.com/items?itemName=tmikoss.rails-latest-migration)
This is a simple extension that will open the latest migration in your application. I use it all the time so it is absolutely worth having.

#### [RSpec Focus](https://marketplace.visualstudio.com/items?itemName=asux.rspec-focus)
If you use RSpec then this is a handy extension. It will make it very easy to add `focus: true` to your specs to run only that spec.

#### [Simple Ruby ERB](https://marketplace.visualstudio.com/items?itemName=vortizhe.simple-ruby-erb) (If you use ERB)
Quickly toggle ERB tags in your views. Will save you quite a bit of typing.

#### [Ruby Haml](https://marketplace.visualstudio.com/items?itemName=vayan.haml) (If you use Haml)
Syntax support for Haml.

#### [Haml Lint] (https://marketplace.visualstudio.com/items?itemName=aki77.haml-lint) (If you use Haml)
This uses the [haml-lint](https://github.com/sds/haml-lint) gem to help you make your Haml code clean and consistent.

#### [endwise](https://marketplace.visualstudio.com/items?itemName=kaiwood.endwise)
Add `end` automatically to methods and statements.

## Generic extensions

#### [Dash](https://marketplace.visualstudio.com/items?itemName=deerawan.vscode-dash)
If you use the [Dash documentation browser](https://kapeli.com/dash) for Mac then you can use this extension to quickly jump to the documentation for any class or method.

#### [Open in Github](https://marketplace.visualstudio.com/items?itemName=fabiospampinato.vscode-open-in-github)
Quickly jump to the open file on Github.

#### [Copy Relative Path](https://marketplace.visualstudio.com/items?itemName=alexdima.copy-relative-path)
This will copy the relative path of any file as defined by the project root. Great for doing things like running a specific spec and such.

#### [IntelliSense for CSS class names in HTML](https://marketplace.visualstudio.com/items?itemName=Zignd.html-css-class-completion)
Will add intellisense for any CSS class in your project, even those defined in external style sheets like Bootstrap.

#### [ Prettier ](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
No-nonsense formatter for HTML, CSS, Javascript and more. It is opinionated and does not allow for much configuration. It is perfect if you want something simple and don't want to fiddle with configuration files.

#### [Unibeautify](https://marketplace.visualstudio.com/items?itemName=Glavin001.unibeautify-vscode)
Another formatter. This one is a "meta formatter" that uses other formatters. You can thus use Prettier for CSS and something else for HTML, all managed by Unibeautify. This is also the only formatter that I know of that does a decent job of handling ERB templates. Use the [Pretty diff](https://unibeautify.com/docs/beautifier-pretty-diff.html) formatter for ERB templates and you will have a pretty good time.

[Vim](https://marketplace.visualstudio.com/items?itemName=vscodevim.vim)
This will essentially turn VSCode into VIM for editing. I gave this a shot and didn't look back. It might take you a couple of weeks to get proficient with it but after that you'll be golden. This is in my opinion an excellent plugin and it will make you a lot more efficient. Check out [this article](https://dev.to/vintharas/boost-your-coding-fu-with-visual-studio-code-and-vimboost-your-coding-fu-with-visual-studio-code-and-vim-502h) for a very good introduction to this plugin.

## Conclusion
There you go! Those are all my plugins for Ruby on Rails development. Did I miss one? Let me know on [Twitter](https://twitter.com/magnusskog)!