aspvbs.vim : indenting for asp vbs files
| script karma
Downloaded by 1278
Comments, bugs, improvements
script versions (upload new version)
|Having to write active server pages with visual basic script included is pain enough. Vim eases this and with this automatic indenter even more.
This script tries to be very smart and will probably fail horribly. Since version 0.4 (there is no 0.3) aspvbs.vim will do indenting based on the context. That means when you are in an html context, the html indenter will be used, otherwise the ASPVBS indenter.
But wait, there is even more! The script tries to pick up the previous indent of each block, so when you open a new ASP block with <% the indent of the last ASP block will be resumed.
The script works best when an opening <% and a closing %> are placed on a line on their own. You can most definitely break the script by writing code like '%><html></html><% ...'
Here is an example of its indenting sprinkled with comments:
if asd then
<% If myPage = 1 Then %>
<table> <!-- the indent of body is continued -->
<% End If %> <!-- the indent of < % if mypage = 1 is picked up -->
</body> <!-- the indent of </table> is continued
' the indent of line 4 is continued (inside if)
end if ' if asd then is closed
' normal asp indent here
if foo then
select case blah
' for the previous line, the html indenter wins
end function ' close function baz
|Copy the script into your $VIMRUNTIME/indent/ folder and make sure you use the filetype feature. You should at least have "filetype indent on" in your vimrc|
Click on the package to download.
ip used for rating: 220.127.116.11