TheUsualAlex Posted March 3, 2005 Share Posted March 3, 2005 I am curious, does anyone already have their version of the vim syntax script for vfl that they can share? Although I have started to hack up my own a few nights ago, but it's still very primitive. Alex Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted March 3, 2005 Share Posted March 3, 2005 Hi Alex, I just use the C++ syntax since they're close enough (for my taste anyway) -- plus I'm too lazy to actually write a syntax file . It won't support the extended data types (like 'vector' and 'matrix'), but overall it's good enough (and I'm used to it). A quick and hacky way to get it to auto-detect .vfl files and assign them a C++ syntax, would be to add a file to your ~/.vim directory called "filetype.vim". In that file you can add something like the following: " my filetype file if exists("did_load_filetypes") finish endif augroup filetypedetect au! BufRead,BufNewFile *.vfl setfiletype cpp au! BufRead,BufNewFile *.sl setfiletype cpp augroup END ... which would give C++ syntax highlighting to both .vfl and .sl (RMan Shading Language) files. Cheers! Quote Link to comment Share on other sites More sharing options...
TheUsualAlex Posted March 3, 2005 Author Share Posted March 3, 2005 (edited) Hi Alex,I just use the C++ syntax since they're close enough (for my taste anyway) -- plus I'm too lazy to actually write a syntax file . It won't support the extended data types (like 'vector' and 'matrix'), but overall it's good enough (and I'm used to it). Aaah. Hadn't thought about that one for some reason. That ought to save me some time to sleep. Thanks as usual, Mario! Heh. Just tried it. I guess I probably should just add a couple of things in conjunction to the cpp syntax. Shouldn't be too difficult to get all the VEX keywords highlighted. Edited March 3, 2005 by TheUsualAlex Quote Link to comment Share on other sites More sharing options...
Alanw Posted February 1, 2009 Share Posted February 1, 2009 Decided to necro this thread incase anyone happens upon it like myself. I've put together a VEX syntax mode for VIM. I borrowed stuff from a SL.vim file I found on google and c.vim. Cheers Alan vfl.vim.tar.gz Quote Link to comment Share on other sites More sharing options...
oldiesgoodies Posted January 8, 2010 Share Posted January 8, 2010 Decided to necro this thread incase anyone happens upon it like myself. I've put together a VEX syntax mode for VIM. I borrowed stuff from a SL.vim file I found on google and c.vim. Cheers Alan vfl.vim.tar.gz Alanw, that is great. Thank you so much. Quote Link to comment Share on other sites More sharing options...
woodenduck Posted January 4, 2014 Share Posted January 4, 2014 This is an old post, but I'm hoping someone can still help. I've downloaded the above vfl.vim file. Now what to do with it??? I've tried putting it in the Vim home directory also the Syntax directory. Nothing seems to work. Any ideas??? Many thanks, WD Quote Link to comment Share on other sites More sharing options...
edward Posted January 4, 2014 Share Posted January 4, 2014 See the fully worked on example here: http://vim.wikia.com/wiki/Creating_your_own_syntax_files You're most likely missing the "Make Vim recognize the filetype" step at the bottom. Note also that Houdini itself comes with $HFS/houdini/public/syntax/vfl.vim these days. Quote Link to comment Share on other sites More sharing options...
woodenduck Posted January 5, 2014 Share Posted January 5, 2014 Thanks Edward! I must still be missing something though! I created a file, vfl.vim, in the ftdetect directory and added this line to it - au BufRead,BufNewFile *.stc set filetype=vfl I then edited the filtype.vim file to contain the line - au BufRead,BufNewFile *.stc setfiletype .vfl When I load a VEX script in to Vim and select 'syntax hilghliting' it responds with 'filetype unknown'. I'm quite new to the whole scripting area so forgive my ignorance. Many thanks, WD Quote Link to comment Share on other sites More sharing options...
edward Posted January 9, 2014 Share Posted January 9, 2014 I think you want: au BufRead,BufNewFile *.vfl setfiletype=vfl Quote Link to comment Share on other sites More sharing options...
woodenduck Posted January 9, 2014 Share Posted January 9, 2014 Ah, I see! Makes sense now you point it out. Thank you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.