PuTTY Tango colors

Posted in customization, putty by pavlo on 31st 2008f July, 2008

For some time I was looking for a color theme for a famous Windows SSH client PuTTY, that would be readable. The problem with the default color theme is, that some colors are too intensive, so they are hard to read on some displays.

I decided to change the colors and for the template I took the color palette from the Tango Desktop Project. I also added some good looking monospace fonts – Bitstream Vera Sans. I am rather pleased with the result and now want to share it with you.

For better preview I’ve done some screenshots.
I captured ruby on rails validation example, opened in VIM via PuTTY (SSH) on my development server.

Default PuTTY Color Theme
default PuTTY Colour Scheme

PuTTY Tango Color Theme

Download the PuTTY tango colors theme.

It is a registry file, which describes a session named “Tango Theme” + directory with four fonts. Everything is packed with 7zip.

And at the end one little advice: if one puts PuTTY Tango Theme with VIM Tango theme, which can be found on Michele Campeotto blog together, one can get really good Tango experience.

The PuTTY Tango Theme comes with BSD License, whereas the fonts come with GPL. So you are free to use it. If you have found something interesting, please write it in the comments. I will appreciate all notices…

Here are the links to the Tools, mentioned in this post:

Vim. How to replace a word (string) in several files.

Posted in apps, howto, vim by pavlo on 15th 2008f May, 2008

I Write this post, because I sometimes search for this functionality by myself. Today happened such a case and after I have read again a little bit of online manuals, I decided to post a snippet.

This is taken from the VIM online help (http://vimdoc.sourceforge.net/htmldoc/usr_12.html)

*12.1*	Replace a word

The substitute command can be used to replace all occurrences of a word with
another word:


The "%" range means to replace in all lines.  The "g" flag at the end causes
all words in a line to be replaced.
   This will not do the right thing if your file also contains "thirtyfour".
It would be replaced with "thirty4".  To avoid this, use the "\<" item to
match the start of a word:


Obviously, this still goes wrong on "fourty".  Use "\>" to match the end of a


If you are programming, you might want to replace "four" in comments, but not
in the code.  Since this is difficult to specify, add the "c" flag to have the
substitute command prompt you for each replacement:



Suppose you want to replace a word in more than one file.  You could edit each
file and type the command manually.  It's a lot faster to use record and
   Let's assume you have a directory with C++ files, all ending in ".cpp".
There is a function called "GetResp" that you want to rename to "GetAnswer".

	vim *.cpp		Start Vim, defining the argument list to
				contain all the C++ files.  You are now in the
				first file.
	qq			Start recording into the q register
				Do the replacements in the first file.
	:wnext			Write this file and move to the next one.
	q			Stop recording.
	@q			Execute the q register.  This will replay the
				substitution and ":wnext".  You can verify
				that this doesn't produce an error message.
	999@q 			Execute the q register on the remaining files. 

At the last file you will get an error message, because ":wnext" cannot move
to the next file.  This stops the execution, and everything is done.

	When playing back a recorded sequence, an error stops the execution.
	Therefore, make sure you don't get an error message when recording.

There is one catch: If one of the .cpp files does not contain the word
"GetResp", you will get an error and replacing will stop.  To avoid this, add
the "e" flag to the substitute command:


The "e" flag tells ":substitute" that not finding a match is not an error.