Sunday, September 27, 2009

Find available colour schemes in Vim

Look for color/*.vim files in your runtimepath, these are the available colour schemes. To display your runtimepath run: :se runtimepath? To load a new colour scheme use the file name without the extension, for example: :colo elflord

Tuesday, September 15, 2009

Minimise size of ImageMagick PDF output

Use the -compress option when converting an image to a PDF to reduce the size of the output, for example: convert foo.tif -compress jpeg foo.pdf

Monday, September 14, 2009

Output a file in reverse order

Use the tac command to output a file in reverse order, last line first. For example: toro@moutere:~$ echo -e "1\n2\n3\n4" | tac
4
3
2
1
toro@moutere:~$

Thursday, September 10, 2009

Better terminal for Cygwin

Run the Cygwin setup application and install MinTTY or rxvt. Both are a big improvement over the default Cygwin terminal.

Sunday, August 23, 2009

Friday, August 21, 2009

Stop Dropbox from synchronising Vim swap files

A workaround is to change the location of swap files with the directory option. For example, add the following to your .vimrc:
set directory=~/tmp//,.,/var/tmp//,/tmp// Note the trailing double slash which indicates that swap file names will include the full path, thus avoiding file name collisions.

Wednesday, August 12, 2009

Batch resize images using ImageMagick

The ImageMagick mogrify command can be used to resize images (among other things). For example: mogrify -resize 320x240 *.jpg This will replace all .jpg images with resized versions. Note that aspect ratio will be preserved so output resolution may not match exactly.