We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › Vim syntax highlighting
Pages: 1 2 
Vim syntax highlighting (Read 3156 times)
Vim syntax highlighting
Jan 4th, 2008, 11:31pm
 
In case there are any people here who use Processing with the Vim editor, I made a Processing syntax file for it.  Download it here.

Note that I don't know Java (and I found Processing relatively recently, but I'm quite excited about it Smiley ), so it might contain errors.  Corrections, suggestions are welcome.
Re: Vim syntax highlighting
Reply #1 - Jan 25th, 2008, 7:01am
 
Thank you so much for this! It is wonderful.

BTW, is there any way to replace the default editor in the PDE with vim?
Re: Vim syntax highlighting
Reply #2 - Jan 25th, 2008, 10:59pm
 
I'm glad you like it Smiley

AFAIK there isn't a really good way to replace PDE's editor, but there is a setting ("Use external editor") that disables the built-in editor and makes the Processing IDE play nice with external editors.
Re: Vim syntax highlighting
Reply #3 - Jan 26th, 2008, 11:56pm
 
New version. Smiley  Let me know about any problems you have with it.
Re: Vim syntax highlighting
Reply #4 - Feb 3rd, 2008, 11:42am
 
There were problems with unmatched bracket highlighting in version 2.  Version 3 is available now.  Hopefully this will be the final version.
Re: Vim syntax highlighting
Reply #5 - May 21st, 2008, 11:07pm
 
Thank you so much!  More editors need to support Processing syntax and vi is absolutely necessary.
Re: Vim syntax highlighting
Reply #6 - Jun 8th, 2008, 11:50pm
 
thank you thank you thank you vim is my ide
Re: Vim syntax highlighting
Reply #7 - Jun 9th, 2008, 10:39am
 
Glad you like it Smiley

If you find any problems with it, or have any suggestions, just post here.
Re: Vim syntax highlighting
Reply #8 - Jun 20th, 2008, 10:44am
 
Thanks a lot!

Btw. is there a way to tell processing via the commandline to process and display a certain .pde-file?

Would be nice to integrate it in vim like this Perl test-shortcut:

au BufNewFile,BufRead *.pl map ,t <Esc>:w<CR>:!chmod 777 % && ./%<CR>

Re: Vim syntax highlighting
Reply #9 - Jun 20th, 2008, 4:55pm
 
Since my introduction to Java was through Processing, I am not knowledgeable enough to figure out a way to do this.

Perhaps someone who is good with Java could use the information here to make a command line compiler:
http://dev.processing.org/bugs/show_bug.cgi?id=219

If someone gets this working, please post a note in this thread. Smiley  Most of us Vim users will be interested.

At the moment I simply run the PDE (with the 'use external editor' option checked) side by side with Vim.
Re: Vim syntax highlighting
Reply #10 - Jul 3rd, 2008, 5:20am
 
i'm new to processing, and relatively new to vim.

can someone please give me a simple step-by-step guide as to how to install this syntax file with os x?

i've been banging my head on this for hours now and i've given up.

thanks,
e
Re: Vim syntax highlighting
Reply #11 - Jul 3rd, 2008, 12:35pm
 
man vim

8)

online version for osx / vim 7 says that syntax files go here:

/usr/share/vim/vim70/syntax/*.vim
 Syntax files for various languages.

so it should just be a case of copying the new file in there. (failing that, look for another directory full of syntax files (java.vim etc) and copy it there). (it's also possible to have a local directory (~/.vim/syntax/) and put extra syntax files there if you don't have access to the main one)

do other file types get syntax highlighted?

:help syntax from within vim also has useful information
Re: Vim syntax highlighting
Reply #12 - Jul 5th, 2008, 10:48pm
 
i had already created local dir ~/.vim/
inside this folder is
- ftplugin/processing.vim
- ftdetect/processing.vim
- syntax/processing.vim

isn't this correct?
is there anything else i have to do??

i tried putting the file in vim62 (my version is 62; same idea, tho), and it didn't work.

any thoughts?

e
Re: Vim syntax highlighting
Reply #13 - Jul 5th, 2008, 10:49pm
 
by the way-
i've read all the docs for syntax highlighting and they confirm what we're both saying...

Sad
Re: Vim syntax highlighting
Reply #14 - Jul 5th, 2008, 11:35pm
 
have just done this myself using instructions from the install.txt file inside the zip. it seems to work in that text is highlighted and filetype is set correctly.

do other filetypes get highlighted? could be that it's not compiled in on your version.

have you tried :syntax on ?

vim --version | grep syntax
should print a line containing "+syntax"

vim a pde file and then :set all
and look for "filetype:processing" and "syntax:processing"
Pages: 1 2