More Useful ViM Tags
March 04, 2009 at 08:35 PM | categories: tips, vim | View CommentsFrequently, I find myself writing C code that requires the use of struct
ifreq. There are plenty of fields there and of course there are other
structures that I never remember. I could always look in the headers, but it
ends up being a good amount of digging before I find the real definition and
all its accompanying pieces. So, I decided to let ctags and ViM do the work
for me. I created ~/bin/update_local_tags with the following contents:
#!/bin/sh [ -d ~/.localtags ] || mkdir ~/.localtags ctags -f ~/.localtags/usrinclude.ctags --exclude=vector\*.hpp -R /usr/include >/dev/null 2>&1
Then I created ~/.vim/ftplugin/c.vim with the following contents:
setlocal tags+=$HOME/.localtags/usrinclude.ctags
For good measure I copied c.vim to cpp.vim so it would be loaded for C++
file types also.
Now I just have to run update_local_tags to generate a tag file for
everything in /usr/include and ViM automatically includes that list whenever
I edit a C or C++ file. Updating the tags file is still a manual process, I
should probably attempt to hook it into apt. Observant readers will have
noticed that I exclude vector*.hpp when generating the tags. Boost includes
a few generated header files that match this pattern and swell the tag file to
almost 750 MiB.
application/vnd.fdf and pdftk
October 06, 2008 at 08:40 PM | categories: tips | View CommentsSo, if a webserver ever serves you a fdf file, you can view the resulting form with evince or your favorite pdf viewer. Just check the beginning of the fdf file to see which form the fields should be applied to and then run
pdftk form.pdf fill_form my.fdf output filledform.pdf
Mercurial Presentation
August 14, 2008 at 06:24 PM | categories: presentations | View CommentsI'm presenting on Mercurial at the Utah Python Users Group tonight. Probably not as useful without the demos, but here are my slides: mercurial.pdf. Sadly, the slides really just seem to be my notes on a pretty background.
Using the verbatim Environment and listings Package with Beamer
August 13, 2008 at 10:11 PM | categories: LaTeX, tips | View CommentsI finally figured out how to make the verbatim environment work with Beamer. Beamer can't handle the following code:
\begin{frame}{A Title} \begin{verbatim} Don't mess with my text. \end{verbatim} \end{frame}
To make it work, you need to include the fragile option for the frame. Example:
\begin{frame}[fragile]{A Title} \begin{verbatim} Don't mess with my text. \end{verbatim} \end{frame}
If you use the listings package, the same trick works for the lstlistings environment.
VirtualBox OSE Additions 1.6.2
July 04, 2008 at 03:21 PM | categories: projects | View CommentsBetter late than never, right? I finally updated the VirtualBox OSE Guest Additions for Windows to the 1.6.2 release last night. Nothing too exciting, although the installer actually supports upgrades now and the tray icon shipped with VirtualBox looks better.
« Previous Page -- Next Page »
