Source viewing and vim shortcuts
While not strictly relevant to QP, I thought I’d share my editing environment
and a few customizations. I use “vim“ for most work, writing, and email, so
naturally I’ve got a few customizations to help with everyday tasks.
For all the relevant packages I copy or move the extracted tarball sources
into “/www/lib“ and have shortcuts in “vim“ that let me quickly find and
open the source. I’ve also got a collection of vim shortcuts which help speed
up the write and test cycle, including toggling back and forth between the
current module and its corresponding test suite which lives in
“./test/utest_module.py“.
Tag support in vim is handy, so after any upgrade to sources I generate tags
against python packages of interest with a simple script “mktags.sh“::
#!/bin/sh
echo “updating site-packages…”
cd /usr/local/lib/python2.5/site-packages
rm tags
/usr/local/bin/exctags -R—langmap=python:.py.ptl.qpy—languages=python qp qpy durus dulcinea
Sources that I work on have their tag files updated whenever a file is saved
via a ftype hook that calls::
function WritePythonTags()
let foo = system(”/usr/local/bin/exctags—langmap=python:.py.ptl.qpy *.py *.ptl *.qpy”)
endfunction