Map .ino Extension in Ubuntu?

I installed Ubuntu on one of my old computers and then installed the Arduino IDE for Ubuntu. The only problem is I don’t know how to map the .ino file extension to open into the Arduino IDE instead of the Ubuntu text editor program.

I have tried to the “Open with…” right click option to point it to the Arduino IDE, but the Arduino IDE doesn’t come up in the list of options. So, given all that, how do I map the .ino file extension to the Arduino IDE?

I don't know how to do it. On my Ubuntu when I open the properties for a file and then the OpenWith the Arduino IDE is not listed.

HOWEVER ... I'm not sure that it would work anyway because the Arduino IDE only recognizes a .ino file if it is in a directory of the same name.

Simple (and better) solution is to use an external editor - this is an option in the Arduino IDE preferences. I had been using Gedit but I recently switched to Geany.

...R

I didn't know the Arduino IDE only recognizes an .ino file if it is in a directory of the same name.

I'm also a little confused by that. What does it mean? If my .ino file has a name like "sketch.ino", then the directory that contains that file should be called "sketch"?

zenthoef:
I'm also a little confused by that. What does it mean? If my .ino file has a name like "sketch.ino", then the directory that contains that file should be called "sketch"?

Yes

And if you use an external editor you must also follow that convention. Bit of a PITA - especially if you want to throw together a quick test. I have a few directory/files called scratchPad1 scratchPad2 that I can use for quick tests.

...R

One more question, if I use an external editor, then I can map the .ino files to open with that editor? Then, I could avoid this mess entirely, correct?

zenthoef:
One more question, if I use an external editor, then I can map the .ino files to open with that editor? Then, I could avoid this mess entirely, correct?

Yes. That's what I do.

...R