Monday, 21 January 2008

vim and Perl 5.10

If you use vim and want it to highlight correctly the new keywords in Perl 5.10, you can just drop the following syntax plugin script as ~/.vim/syntax/perl.vim :

so $VIMRUNTIME/syntax/perl.vim
syn keyword perlStatementStorage state
syn keyword perlStatementFiledesc say
if exists("perl_fold") && exists("perl_fold_blocks")
syn match perlConditional "\<given\>"
syn match perlConditional "\<when\>"
syn match perlConditional "\<default\>"
syn match perlRepeat "\<break\>"
syn keyword perlConditional given when default
syn keyword perlRepeat break
if exists("perl_fold")
syn match perlControl "\<BEGIN\|CHECK\|INIT\|END\|UNITCHECK\>" contained
syn keyword perlControl BEGIN END CHECK INIT UNITCHECK

An extension, not implemented here, could be to add a new highlight class for the new regexp verbs (MARK, SKIP, COMMIT, etc.)

Wednesday, 16 January 2008

Disk usage graphical presentation

I found out by accident about this GNOME tool, the "Disk Usage Analyzer". It has a surprisingly good UI, displaying subdirectories as concentric circular arcs. It makes visually obvious the spots where all the place is wasted. Or spent.

As an illustration, here's a screenshot of it displaying the disk usage taken by a fresh checkout of Perl 5's sources.

I wouldn't have thought that Encode was taking so much space. (This is, of course, due to all the files that describes the various encodings recognized by this module.)