Revealed by sykora within programming on October 21st, 2008
While I was just generally looking through vim-related links at digg and the like, I came across a site with a number of text-related tools that can be used as text filters in vim (and elsewhere, of course). A filter is a program which takes lines of text, performs some operation and returns more lines of text, which are substituted in place of the original text. One of these which I could find a really good use for, was a filter which converted misaligned table data into an aligned table. However, the link for this program was broken, and I never found it anywhere.
Because of this, and the fact that I had nothing better to do, I wrote one myself.
Enter tablefmt, a simple text filter which does exactly what I said in the last paragraph. It’s written in python, and till date supports a few features such as input delimiters and output delimiters. More is planned, though.
Here is an example of tablefmt in action :
The code is available on my github site, namely http://github.com/sykora/tablefmt/, but only the .py file is required.
Try it out, and tell me if you like it :)
Tags: code, editing, filter, git, github, programming, python, vim