Alternative IDE? Platformio? directory structure compatibility?

I'm spending enough time hacking my duino code that I'm really missing my favourite editor (vim). no flame wars please, I know emacs is also wonderful :slight_smile: but I grew up with vi and then vim, and those keystrokes are hardcoded into my motor homunculus after 40 years so that's what I want. Using the mouse for text editing just makes me crazy.

I've been looking around for an alternative IDE using vim as the editor, and stumbled across Atom with the Platformio plugin and the vim plugin. It looks pretty nice on first glance, but... the folder structure is quite different (github oriented) and it seems like a lot of work to migrate all my projects.

Does anyone know of a magic formula (how-to?) for making Platformio transparently compatible with the original Arduino IDE directory hierarchy (Projects dir full of subdirs whose name must match the rootname of the .ino .cpp and .h files found in the subdir?)

Alternatively does anyone have other options for a vim-centric multiwindow smart IDE system that runs under OSX and Linux and is compatible with Arduino IDE structure if I should ever want to switch back?

Or should I just bite the bullet and set up a whole new source tree?

In what way is it different from the "Arduino IDE structure" ?

I use the Geany editor all the time and I have no "structure" problems. (I do realize that Geany is not the same as Vim - I could never get my head around Vim)

...R

In what way different? well I am so completely new to it that I can't answer that question definitively; all I can say is that the project directory structure for a platformio project looks more like a github project, i.e. contains subdirs src and lib and so on. Whereas my Arduino IDE project directories often contain only one file (.ino).

example: Platformio test project dir:

ls -lR blink
total 8
drwxr-xr-x  3 de  staff  102 24 Mar 20:18 lib
-rw-r--r--  1 de  staff  590 24 Mar 20:18 platformio.ini
drwxr-xr-x  3 de  staff  102 24 Mar 20:19 src

blink/lib:
total 8
-rw-r--r--  1 de  staff  868 24 Mar 20:18 readme.txt

blink/src:
total 8
-rw-r--r--  1 de  staff  529 24 Mar 20:19 main.cpp

vs typical Arduino IDE project dir:

ls -lR Blink_SOS/
total 8
-rw-r--r--  1 de  staff  1601 24 Feb 22:21 Blink_SOS.ino

where the .ino file is the equiv of main.cpp, and the parent folder must match the rootname of the .ino file

and all this makes me think that it may not be easy to switch back and forth from Platformio to Arduino IDE -- that there's a conversion effort.

You can use an external editor with the Arduino IDE: File Preferences > Use external editor. That way you can use vim to write your code and use the Arduino IDE to compile, upload, install boards, and install libraries. No need to mess with a different folder structure. I've looked a platformio a couple times but what I could see from just reading the documentation without actually jumping in and using the thing didn't really impress me.

If you want to make use of the Arduino "system" what @pert says is probably the simplest next step.

I have partly freed myself from the constraints of the Arduino directory structure by using a short Python program that copies the files into the correct Arduino style in a temporary directory and then calls the Arduino IDE to compile and upload the program.

...R

That's a good point. You always have the option of using the Arduino IDE command line interface:

That allows you to benefit from all the functions of the IDE without ever having to see the GUI.

@pert wow! what a simple and elegant solution :slight_smile: I wasn’t even aware of that option (note to self: explore all the menus before looking for alternative UI).

I thought platformio (plus Atom) was kind of slick, particularly the ability to work with 2 boards at once without switching back n forth (iirc it can remember which sketch goes with which board)… this would have saved me a few moments of embarrassment along the way. Otoh, Atom’s vim emulation plugin goes only so far, and omits one of the most important muscle-memory sequences ( s/foo/bar/?g?)

I think I can live happily with the devil I know, i.e. Arduino IDE (Arduideo?) if I can just use my favourite editor, so pert’s solution sounds great to me.

[an hour or so later] after getting sucked into the black hole of vim colour schemes (wow!) I managed to find one I really like (despacio) and I’m very happy now editing ino files with vim. many thanks all.