Vim and Arduino

24 September 2015

The Arduino IDE is, honestly, pretty good. It's easy to set up, and it works reliably. After years of Eclipse, I can't ask for much more. But I really, really like vim, and I figured it would be easy to find some command-line build tools and maybe a vim plugin.

Spoiler alert: nothing is as easy as it should be.

If you choose to search for command-line arduino build tools, you will first encounter inotool. Unfortunately, it's abandoned; the last release was in 2013.

But you aren't deterred! You keep hunting, googling for the truth that you know is out there. And lo! You discover Arturo! It's a fork of ino that tried to keep it moving forward. Sadly, it doesn't work with Arduino 1.6.2 and newer.

The simplest solution isn't well-documented. It's hard to even find, but the magic bullet lives inside the Arduino IDE itself. As of Arduino 1.5.2 you can actually build and upload projects on the command-line using the arduino command.

arduino --upload --board arduino:avr:uno myfile.ino

This is a perfect solution. Now you're guaranteed that anything you can build and upload with the IDE, you can also build and upload from the command-line. It's the same toolchain! I couldn't find any vim plugins that used this, so I had to write one.

Fancy-dancy features include:

  • Board selection (CPU too, for boards that need it)
  • Programmer selection
  • Simple commands for building/uploading/serial port debugging

Give it a go and file issues if you find bugs or want more features.

comments powered by Disqus
© 2015 Steven Arcangeli - Hosted by Github Pages