Back to photostream

2009MAR051715

Black Saturday +day26

 

update latest news

 

Anyone know of Objective-J syntax highlighting in vi?

 

"... the source on github now include a vim highlight module ..."

 

I've found just doing what is suggested here is not enough:

- download the file as Francisco suggests

- unzip, "cd Tools/" dir

- run the shell, "sh install-tools"

- copy the objj.vim file to vim dir, "cp Tools/Editors/objj.vim /usr/share/vim/vim71/syntax/"

 

Problem

I found no syntax highlighting worked for ".j" files. So the problem here is no file extension recognition. If you are using gvim as I am there is also no menu item.

 

Add Objective-J to gvim menu

To add a menu-item in gvim for Syntax->Ne-MO->Objective J:

 

- "sudo vim /usr/share/vim/vim71/synmenu.vim"

 

add the following line.

 

- "an 50.70.465 &Syntax.Me-NO.Objective\ J :cal SetSyn("objj")<CR>" below the objective-C entry.

 

save and quit

 

- ":wq!"

 

then reload a ".j" file in gvim. If you then go:

 

- Syntax->Ne-MO->Objective J

 

highlighting for your selected Objective-J file should occur.

 

Objective-J auto-highlighting?

But what about auto-highlighting when you load the file? There appears to be no file associations. So:

 

- "sudo vim /usr/share/vim/vim7.1/filetype.vim"

 

In the file you will find a list of filetype associations. If you want an idea where to add the line, search for "setf ocaml" in filetype.vim. Add the line below above (alphabetical):

 

- """ Objective J au BufNewFile,BufRead *.j setf objj"

 

Save the result. You should now be able to load a file with a ".j" extension and syntax highlighting for Objective-J files works.

 

Result

Now you should get automatic recognition of the Objective-J files by file type ".j" and a way to set this filetype in gvim. This probably should be added by Bram or whoever does the official release of vim but for the moment this hack works for me. (Ubuntu 8.10, Vim 7.1)

 

before I answered the question

Mucking around with Objective-J and Cappuccino today. There's a good reason for it. Just testing at the moment. Doing so I had to find out how to get Objective-J to work with vim and in the process did a small writeup on stackoverflow for syntax highlighting in objective-j and vim. There are a few other hacks on getting Objective-J and Vim syntax highlight to work.

 

next day

Have my old account back with new questions ~ stackoverflow.com/users/2092/bootload thanks Jeff.

 

next >>>

774 views
0 faves
0 comments
Uploaded on March 5, 2009
Taken on March 5, 2009