Member-only story

How to enable syntax highlighting for Vagrantfile files in IntelliJ IDEA

Three approaches to fix a weird problem in IntelliJ

Saeed Zarinfam
5 min readJul 3, 2023

Official Vagrant plugin from JetBrains
·
(Approach 1) The simplest way to have syntax highlighting for Vagrantfile files
·
(Approach 2) Use the Ruby TextMate bundles
·
(Approach 3) Install Ruby plugin for IntelliJ IDEA
·
Final Word

After more than ten years of migrating from NetBeans to IntelliJ IDEA as a Java developer, I feel addicted to this great IDE (and I like this addiction). Even though I like VS Code and find it much better for some usages like Scala development (Scala 3 using metals) or remote development these days. Still, I am happier when IntelliJ runs on my laptop and enjoy coding in it.

On the other hand, I have another lovely friend called Vagrant, and I use it a lot for creating infrastructure locally on my laptop or in my home lab. Vagrant is very simple, and you can put all configurations into a file called Vagrantfile, whose syntax is Ruby. Although JetBrains has a dedicated IDE for the Ruby programming language (called RubyMine), and you can also enable it by Ruby — IntelliJ IDEA Plugin in the IntelliJ, in a bizarre way, when you open Vagrantfile files in the IntelliJ, there is no syntax highlighting for this kind of files.

IntelliJ IDEA does not syntax highlighting Vagrantfile files

--

--

Saeed Zarinfam
Saeed Zarinfam

Written by Saeed Zarinfam

✍️ I write about Software Development, including Java, Go, Spring, Containers, K8s, AI, Observability, and more ⋈

No responses yet