Setting up Vim for Arduino

syntax highlighting, in-editor compile/deploy, & serial port monitoring

The Requisites

 $ brew install python

Handling Syntax Highlighting

 $ git clone https://github.com/sudar/vim-arduino-syntax.git
$ cd vim-arduino-syntax
$ cp -r ftdetect/ ~/.vim/ftdetect
$ cp -r syntax/ ~/.vim/syntax
$ cp -r indent/ ~/.vim/indent

Compile and upload your sketches from within VIM

 $ easy_install ino

Serial Monitor Support

$ brew install picocom

Stitching it all together

$ mkdir -p ~/.vim/autoload ~/.vim/bundle$ curl https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim > ~/.vim/autoload/pathogen.vim
$ cd ~/.vim/bundle$ git clone https://github.com/jplaut/vim-arduino-ino.git

Wrapping up

$ mkdir ~/my_project
$ cd ~/my_project
$ ino init
<Leader>ac — Compile the current sketch.<Leader>ad — Compile and deploy the current sketch.<Leader>as — Open the serial monitor in screen
$ ino serial
:!ino serial

--

--

we’re a software development lab for intelligent applications, data driven platforms, and the internet of things.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store