Go Down

Topic: keywords.txt files for libraries (Read 6806 times) previous topic - next topic

MartyL

I have written several libraries and have included keywords.txt files in the library folders.  I thought I make that file so I can see class and function names in color when I view and  edit the files. 

Unfortunately,  .cpp files cannot be viewed in the Arduino IDE.  Since I am in the Windows environment, I use Word or Notepad to create, view, and edit these files.  The only text  color I ever see is black.

What am I missing?  Do I have to be in Linux and use something like Vi or Emacs to see these colors?

I have included one of my keywords.txt files here.
Thanks


robtillaart

The file should be plain text, so do not use word but a decent editor like notepad++.  I recall that the keywords.txt files are very picky. You can only use spaces and no tabs IIRC. It makes the difference between working and not.

A .cpp file can be viewed in the IDE by placing it in the folder of the ino file (might give compile problems if it is also a library  but for viewing sec it might work.
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

MartyL

Thanks Robert, 
For the record, so as not to confuse anyone, it's tabs and not spaces in keywords.txt.

Thanks for mentioning notepad++.  I had not heard of it before.  Nice program.  I still do not see the orange and brown text of KEYWORDS1 and KEYWORDS2,  but the screen is so colorful, who cares.

It's a shame the Arduino can't edit .cpp and .h files no matter where they are..

Regards,
Martin

robtillaart

if you press the V  on the right top of the IDE  you can add additional files, which can be .cpp files
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

MartyL

I'm sorry Rob, after playing around with the IDE, I can't see where to press V.  What menu option do you have to be in?  FileSave?

Martin

robtillaart

it is the little triangle on the right  - sorry, I  worked too much with ascii terminals ;)
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

erinius

In the library directory try making a blank file called libraryname.pde. When you open it with Arduino IDE, you'll be able to see the library files and the keyword colors.

greenonline

#7
Mar 17, 2015, 06:19 pm Last Edit: Mar 17, 2015, 07:02 pm by greenonline
@Rob Tillaart - If I hit the drop down menu arrow on the top right of the IDE, I am only presented with |NewTab|Rename|Delete|Previous Tab|Next Tab|<Name of Tab>|. I don't see how to open a .cpp file.

As an aside... apart from showing their respective keyboard shortcuts, both the Previous Tab and Next Tab options seem completely pointless as you could just select the tab.

@erinius - If I create a blank file called libraryname.pde, in the Library folder, in my User directory, when I try to open it I get the option of putting it in a Sketch Folder of the same name, moving the file and continuing, or cancelling the operation. If you cancel, then obviously nothing happens. If you select OK then a folder is created, but the .pde file stays where it is (in the Library folder) and is not put in the folder (Completely pointless!). I don't see how to get to see the library files and the keyword colours. Can you explain please?

BTW, I am using version 1.6 on Windows.

Thanks.

UPDATE: After updating to 1.6.1, the .pde file is now moved into the directory. However, I am still unable to see keyword colours and library files. I just get a blank libraryname.pde file opened in the IDE (as expected really)

Go Up