keywords.txt files for libraries

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

keywords.txt (70 Bytes)

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.

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

1 Like

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

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

it is the little triangle on the right - sorry, I worked too much with ascii terminals :wink:

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.

@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||. 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)