|
Post by barryk on Mar 7, 2011 10:25:36 GMT 1
I want to use Vim because of its ability to convert code to color-highlighted HTML. I have compiled Vim and tested this with other code (ex: C), however I cannot get Vim to recognise the bacon.vim file.
The syntax files are in /usr/share/vim/syntax, and if I put bacon.vim into there, it is ignored.
I can manually choose Qbasic highlighting and conversion to HTML works nicely.
Do you know what I need to do to get Vim to recognise and use the bacon.vim file?
The menu does have a feature to list all available syntax files, and bacon is not listed.
Note that I am totally new to Vim/vi. It was daunting at first, but I managed to get it running with a nice GTK gui.
Regards, Barry Kauler
|
|
|
Post by Pjot on Mar 7, 2011 10:39:54 GMT 1
Hi Barry, Within VIM, you can use the commands: But this is tedious, of course So for VIM I also setup the file recognition configuration, and I do so in my homedirectory. As follows: In the directory ~user/.vim/ftdetect, add a file called 'bacon.vim'. It has the following contents: au BufRead,BufNewFile *.bac set filetype=bacon
Then, instead of /usr/share/vim/syntax, but in the directory ~user/.vim/syntax, you can add the BaCon syntax file. Now when you start VIM and load a BaCon program, syntax recognition should work automatically. Regards Peter
|
|
|
Post by Pjot on Mar 7, 2011 10:56:47 GMT 1
PS of course you can use system wide configuration also, by using the directories /usr/share/vim/syntax (as you did for the syntax file) and /usr/share/vim/ftdetect for the file recognition....
|
|
|
Post by barryk on Mar 7, 2011 11:03:44 GMT 1
Yippee it works, it works! Thanks again. I wanted to start work again on my BaCon web pages, with some simple tutorials. Previously I have been using Nicoedit (which uses gtksourceview) and taking snapshots of the screen to get color-highlighted-code images for my tutorials -- not very satisfactory. Now, I need to put this Vim together as a PET package so that other Puppy Linux users can do this too.
|
|
|
Post by Pjot on Mar 7, 2011 11:08:25 GMT 1
Great!
By the way, you can use the VIM command ":TOhtml" to generate syntax colored HTML file for the code which currently is loaded. This is what I am using myself for the BaCon website also.
Regards Peter
|
|
|
Post by barryk on Mar 8, 2011 10:37:09 GMT 1
Puppy Linux users, here is a PET package for Vim, which includes the bacon.vim syntax highlighting: bkhome.org/blog/?viewDetailed=02174This was compiled in Wary Puppy 5.1.1, but should work in other puppies.
|
|