Ability to save/recall board/com settings in sketch...

I work on several vastly different projects on different hardware, and every time i open up a different source file, i have to re-select the board, cpu and port for that project...

Perhaps it would be nice to have a method where a specifically formatted block,of text/xml could be used to automagically preset the environment when the file is loaded into a blank instance of the IDE. (i say this because i also use Notepad++, and may have several source c,h,cpp files open, but the first that is opened with the IDE should puck up the platform details...

Even if it was an extract of the boards.txt data...? or a similarly named project.ino / project.cfg file...? Just a thought

I have a system something like that. I use the Geany text editor and I have a short Python program to call the Arduino IDE for compiling and uploading.

At the top of my program file I have comments like the following which are used by the Python program to give instructions to the Arduino IDE.

// python-build-start
// action, verify
// board, arduino:avr:uno
// port, /dev/ttyACM0
// ide, 1.6.3
// python-build-end


Nice idea... you should shop it to the Arduino team !

...had the same issue, my solution (IDE 1.8.2):