PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

How can I implement the syntax highlight under the Linux OS?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
OceanCloud



Joined: 27 Nov 2012
Posts: 12

PostPosted: Tue Nov 05, 2013 7:34 pm    Post subject: How can I implement the syntax highlight under the Linux OS? Reply with quote

Does the PGI Fotran Compiler support the syntax highlight under the Linux operating system in the .cuf file?

And how should I set it up?
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6206
Location: The Portland Group Inc.

PostPosted: Wed Nov 06, 2013 12:06 pm    Post subject: Reply with quote

Hi OceanCloud,

The compilers themselves don't support syntax highlighting; that would be something a text editor or IDE would do. Are you asking about a particular editor?

I personally just use command line vi, without any sort of highlighting so may not be the best person to answer, but if you can give more information then maybe another user can help.

- Mat
Back to top
View user's profile
OceanCloud



Joined: 27 Nov 2012
Posts: 12

PostPosted: Wed Nov 06, 2013 8:09 pm    Post subject: Reply with quote

Thanks anyway, Mat

It's my fault that I didn't point out the edit.

I aslo use command line vi, when the source code has a .f90 suffix, the key words highlighting themselves, but when writing CUDA Fortran routines, the .cuf suffix is suggested and the syntax highlight become invalid.

Is there someone can recommend an edit?
Back to top
View user's profile
wiersma



Joined: 16 May 2013
Posts: 29

PostPosted: Thu Nov 07, 2013 7:32 am    Post subject: Reply with quote

You can customize emacs to treat .cuf files as Fortran files and highlight the syntax accordingly.
Back to top
View user's profile
TheMatt



Joined: 06 Jul 2009
Posts: 322
Location: Greenbelt, MD

PostPosted: Fri Nov 08, 2013 11:07 am    Post subject: Reply with quote

I have a setup on my boxes where I do syntax highlighting of CUDA Fortran files. I've even made up a syntax/cudafor.vim file so it highlights all the CUDA Fortran keywords (as of maybe a year ago, so it's possible I'm missing some...I should update those). I'll gladly share them if wanted.

That said, the way one can get vim to see a .cuf as a Fortran is to put in your .vimrc:

Code:
   au BufNewFile,BufRead *.cuf,*.CUF set ft=fortran
   au BufRead,BufNewFile *.cuf,*.CUF let b:fortran_do_enddo=1
   au BufRead,BufNewFile *.cuf,*.CUF set tw=132


The first line essentially means if it reads or creates a .cuf or .CUF file, it sets the filetype to 'fortran' and treats it as such. I also add that fortran_do_enddo one because I like my Fortran loops indented and I set the textwidth to 132 so I don't wrap my code to early.

Now, as I said, on my systems I have a set of cudafor.vim files which, essentially, are the fortran.vim ones, but with some extra syntax highlighting for CUDA words.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group