Hey guys,
does anybody here have a gedit plugin for CUDA syntax highlightning?
Thanks a lot!
Hey guys,
does anybody here have a gedit plugin for CUDA syntax highlightning?
Thanks a lot!
I second the need for good highlighters. Eclipse is pretty good with CUDA code, but it doesn’t understand the <<< >>> syntax. I don’t have the faintest idea where to begin implementing highlighting things … anyone have experience with this type of deal? Or the inner workings of IDE’s in general? (Sorry OP for stealing the focus from gedit … but any work to implement highlighting in other editors will help with gedit also.)
If you can survive with a c or C++ style,In gedit you don’t need any plugin. Just specify the highlighting style you like in view → highlight mode.
Most editors can be tuned to use C highlighting with CUDA. Kdevelop and emacs among them.
I know I use CDT on Eclipse (C/C++ IDE for Eclipse) for CUDA developing. CDT does not currently support CUDA syntax highlighting/ checking.
There seems to be a good article on extending CDT: http://www.ibm.com/developerworks/opensour…ry/os-ecl-cdt1/
also see:
jeff.over.bz/presentations/2006/eclipsecon2006-tutorial.odp
and http://webhome.cs.uvic.ca/~mstorey/etx2005…20the%20CDT.pdf
the last link seems pretty concise. A good place to start would be the editor for C or C++ (CUDA has a few features from C++ like extern “C”).
In the CVS tree for CDT(http://wiki.eclipse.org/index.php/CVS_Howto), I found the following: org.eclipse.cdt.doc.isv/reference/extension-points/org_eclipse_cdt_core_language.html
under: /cvsroot/tools and then org.eclipse.cdt/all
which talk about adding a C-based language to CDT.
vim already has one as far as I could find on www.vim.org
You can add this to .vimrc and get a pretty reasonable syntax highlighting:
[codebox]" define some additional filetypes
" CUDA
au BufRead,BufNewFile *.cu set filetype=c
au BufRead,BufNewFile *.ptx set filetype=asm[/codebox]
You may want to pick C++ instead though. This also allows plugins such as EnhancedCommentify to function properly.
On the topic of VIM and CUDA I also use exuberant-ctags with the following option:
[codebox] --langmap=c:+.cu[/codebox]
@cancan - thanks for that, it feels good to have a better handle on how to get into the Eclipse engine bay
i have written a cuda lang file and it is added into gtksorceview-2.0 . gedit will highlight CUDA automatically.