I'm usually a purist when it comes to vimming. I don't like remapping keys, or learning to rely on a bunch of plugins. I like to feel just as powerful on foreign boxen as I do on my own dev box. I do, however, believe in syntax files. Even though the solution may not be a syntax file (bindzone.vim is what I use), I want it bad enough to do whatever.
I regularly view or edit tab (or comma, but that would be a bonus) delimited data. I hate having to set my tabstop to some ridiculous number in order to have everything line up. Example: The BIND zone files are ~40+,6,2,5,15+. So, even though I could view them on a single screen, if I set ts=40, I cannot. I have been searching for a "dynamic tab size" solution for years, but no luck.
I hate that my only good way of editing or even visualizing tabular data is to scp it to my work station and open it in Open Office. There has to be a better way.
How about changing to spaces instead of tabs, and just using R (instead of i) to do your edits? That way you won't re-align anything (except for at first when you re-space everything).
File a feature request. VIM needs an option to display varying tab stops like is common in every word processor. So many people use vim as a word processor, I'm surprised this isn't already in there. I'm proposing that tabstop be modified to accept an array in place of an integer.
There is a dev-list patch for Vim that is said to implement variable tab stops. It's indicated{1} as being in beta stage.
Obviously this would involve compiling vim for the server(s) you want to use it on.
Another option would be to set up a custom file type that translates tabs into spaces delimited by some special character. You can set up autocommands to fire an import (ie convert to delimited columns) routine on read and an export routine (to convert back to tab-delimitation) on write, so it ends up working more or less transparently.
So for example the file
would be viewed in vim as something like
This is more or less off the top of my head; there may well be a vimscript package that implements this. If not, it wouldn't be that hard to write. You just have to make sure that the column-delimiting characters —here "»" and "«"— aren't actually used in the file. For a bind config file, I would think that anything non-ASCII would be safe. For improved robustness I guess you could give vim a few options, and have it scan the file to find a set that wasn't present in the file, or just escape any of those characters that are.
It might be better to instead pad with characters that look like spaces{2} but aren't, like '\xa0' or '\u2002'; again this would only work correctly if the padding character wasn't present in the file, or you're having the import routine escape those that are.
Also I'm assuming familiarity with c-style backquoting: in the first part of the example, "\t" represents a tab character; the \x and \u sequences are hex and unicode character representations.
If you do end up implementing or finding something like this, please let me know.
{1}: http...groups.google.com/group/vim_dev/web/vim-patches?pli=1
{2}: http...www.cs.tut.fi/~jkorpela/chars/spaces.html
NB: obfuscated old-school reference style is due to my lack of reputation on this site.
I think you may be able to accomplish what you want using the Align plugin. (Apologies if you've already tried it.)
Did you know you are able to automatically set custom properties on files by defining a custom modeline? I realize this doesn't solve your problem, but will keep you from having to enter in your custom properties every time you want to align your file.
This works in vi as well...
A bunch of answers not entirely to the point, but maybe some of this fits somehow your working patterns:
Have a :%!sed -e 'whatever' that does what you need and put it in a comment somewhere in the file so you can paste it (I used to keep a :%!sort -u in a bind file for this kind of things).
If it's the same server all the time, have a (bash|perl|awk|sed) script somewhere on it that can be called similarly from within vim.
The :make command is also useful if you can put a makefile there.
Keep all the data in SQL and generate the files from there, while you edit certain tables or views (I'm only half joking).
Use the cut(1) and paste(1) commands (from within vim or from an auxiliary shell script) to emulate SQL views.
No vertical folds in vim are possible as far as I know, but block-select (with ctrl-V) is often useful.
Macros!