bash script to change vim colorscheme based on the available themes

Image via Wikipedia

Here\’s one script that you may find useful. A little variation or wrapper for this script can make your life colorful 🙂

You can write a wrapper to this to take one of the inputs randomly and then use it in alias to start vim.

#!/bin/bash –
#          FILE:
#         USAGE:  ./
#   DESCRIPTION: Change the vim colorscheme from command prompt
#       OPTIONS:  —
#          BUGS:  —
#         NOTES:  —
#        AUTHOR:  Amit Agarwal (AKA), [email protected]
#       COMPANY:  Individual
#       VERSION:  1.0
#       CREATED:  02/02/2010 10:30:07 PM IST
#      REVISION:  —

#Change the directory to where we will find all colors and then print them 🙂
cd ~/.vim/colors
for i in *.vim
echo \”${i%.vim}\”
#Read the choice of the user

read -p \”Enter one of the colorschemes :: \” choice
if [ ! -f $file ]
echo \”Colorscheme file \”$file\” does not exist\”
exit -1

#Do the susbstitution in new file in /tmp
sed \’s#\\(^ *colorscheme\\).*#\\1 \’$choice\’#\’ ~/.vimrc > /tmp/vimrc
diff ~/.vimrc /tmp/vimrc
read -p \”Do you want to make the changes (y/n) :: \” yn
if [ $yn = \”y\” ]
echo {/tmp/,~/.}vimrc
cp {/tmp/,~/.}vimrc
echo \”Modified changes are available in /tmp/vimrc\”


Blog once and educate 40,000 underprivileged children of India

Here\’s one of the mail that I received from the IndiBlogger team.

Dear Amit Agarwal,

Here is a unique opportunity to reach out and impact thousands of lives through your blog. Yes, sitting at your desk and writing a blog post can help educate 40,000 young Indians all over our country!

One of India’s most trusted and credible NGOs, GiveIndia is taking part in a competition on Facebook to win a US$1 million grant. The winner will be the NGO that gets the highest number of votes from Facebook users. The prize of $1 million will help put or keep 40,000 children across India in school for one year!

Imagine the IndiBlogger community coming together to spread the word and help the underprivileged children of India. The impact would be tremendous and together, IndiBloggers and GiveIndia would be able to gather the votes we need to win.

Voting in the competition is for one week only, from Friday, January 15 – Friday, January 22, 2010. Can we make a difference in the next 5 days? We sure hope so!

The link for voting, where you can also see more details of the competition is

There’s been lots of talk about how social media can bring change and make an impact on the world we live in. Well, here is one tangible way for us to take a small action that could have a HUGE outcome.

In case you have more questions about this, please write to [email protected] and a GiveIndia team member would be happy to reply.

The IndiBlogger Team & The GiveIndia Team


Click here to manage your email alerts.


3/10 results in first page of bing for my site for search term \”amit agarwal\”.

I was not planning on writing another blog on bing. But then bing lists my website 3/10 so  here is the link to the search. Worth braggin when there is Amit Agarwal from labnol.