Check all vim colorschemes for minor issues

Here is script that checks all the colorschemes in the current directory and corrects them if possible (Processing of the file is done with simple commands like sed, grep)

Checks that the color_name is same as Filename

Here is the script:

#!/bin/bash -
#===============================================================================
#
#          FILE: check_colors.sh
#
#         USAGE: ./check_colors.sh
#
#   DESCRIPTION:
#
#       OPTIONS: ---
#  REQUIREMENTS: ---
#          BUGS: ---
#         NOTES: ---
#        AUTHOR: Amit Agarwal (aka), 
#      REVISION:  ---
#===============================================================================
cd ~/.vim/colors
for i in *vim
do
    #echo "Processing $i"
    if [[ $(grep -c g:colors_name $i ) -eq 0 ]]; then
        if [[ $(grep -c colors_name $i ) -eq 0 ]]; then
            echo "File $i does not have colorname";
            missing=$missing" $i"
        else
            sed -i.bak '/colors_name/ s/.*/let g:colors_name="'${i//.vim}'"/g' $i
        fi
    else
        if [[ $(grep -c colors_name $i|grep let ) -gt 1 ]]; then
            echo "WARN ----->> File $i has more than one colorsname"
        fi
        colorname=$(grep g:colors_name $i|grep let| sed -e 's/"//g' -e 's/.*=//' |tr -d ' ')
        if [[ ${colorname}.vim != $i ]]; then
            echo "Filename $i does not match colorname $colorname .. correcting "
            sed -i.bak '/colors_name/ s/.*/let g:colors_name="'${i//.vim}'"/g' $i
            #sed -i.bak 's/(.*g:colors_name.*=)/1'${i//.vim}'/g' $i
        fi
    fi
done

if [[ x$missing != x ]] ; then
    echo "Missing colornames in $missing"
fi

 

Enhanced by Zemanta

cream bash ide – vim with bash support

 

English: Screenshot of graphical vim (gvim) sh...
Image via Wikipedia

Here you can find the cream editor. This is basically vim editor with lots of customizations thus making it simpler for the users to use the editor directly.

This version already has the bash and perl support plugins and thus you can start using them as IDE without the need to add any plugins. It has a simple and advanced mode. In the simple mode you need not worry about all the modes of the vi/vim editor. How cool is that 🙂

Enhanced by Zemanta

Get yourself som new themes for vim

Well, you would already have some themes for your vim, by default. And if you did not like them then you would have added some of your own too (downloaded from vim.org). But, those are something, that you might not still like and want to make some changes.

Here’s, a new way to do it. Just go to the link mentioned below and click on Generate Dark or Generate Light. You can generate as many as you like and once you like the theme, simply click on vim in the bottom and download 🙂 BTW, you can generate textmate and Emacs theme as well.

Generate some themes here.

Enhanced by Zemanta