Hello! I have been using gVim for a while on my PC's, but I am new to
scripting/customization of it. I am trying to get the folding to work with
my VBScripts, and searches for VBScript specific folding scripts have
turned up nothing. There was a VB.NET one that included folding, but the
syntax highlighting was markedly diffent than the standard vb.vim, which I
wish to keep. So, I decided to try myself.

When I create a .vim file with just these two lines in it, place it in the
vimfiles/syntax directory, and use the "set syntax" command, the folding
works:

syn region myFoldSub start="Sub" end="\<End\s\+Sub\>" fold
syn region myFoldFunction start="Function" end="\<End\s\+Function\>" fold
syn sync fromstart

But of course I lose the vb.vim syntax. I then added this line to include
the vb.vim file:

so C:/Program Files/Vim/vim70/syntax/vb.vim

And I get the vb syntax back, but the folding is gone again!

I have tried naming it vb.vim and placing it in the vimfiles/after/syntax
directory, hoping it would just add it to the existing vb syntax as the
documentation says, but it does not seem to work. I have even tried
inserting those lines into the default b.vim file, but that doesn't seem to
work either.

Any idea what I might be doing wrong? Or is there something out there
already that I can use? Thanks!





Reply via email to