Tip #252: python script to align statements
tip karma |
Rating 1/1, Viewed by 450
|
created: |
|
May 24, 2002 23:55 |
|
complexity: |
|
intermediate |
author: |
|
Demian L. Neidetcher |
|
as of Vim: |
|
5.7 |
i know there's some awk scripts out there that do the same thing, and if i were a real trooper i would have
written this in vims internal language but...
i wrote a python script to align statements.
i put this in my .vimrc:
map L :!lineUp.py<cr> " of course lineUp.py is somewhere in my path
and i have this python file somewhere in my path:
http://ophinity.com/res/dotFiles/lineUp.py
so now i can just pipe the offending lines thru my code:
:5, 10 !lineUp.py
or using the mapping above, visually select the lines and press 'L'
<<c/c++: align #endif with corresponding #if/#ifdef |
The power of | (v75|r- actually...) >>
Additional Notes
|