Here is a simple script that will show all the vim mappings from the tex file (help file that comes with the vim scripts).
This will prove to be very useful in usin gthe mappings 🙂
#!/bin/bash –
#===============================================================================
#
#Â Â Â Â Â Â Â Â Â FILE:Â get_mappings_from_tex_for_vim.sh
#
#Â Â Â Â Â Â Â Â USAGE:Â ./get_mappings_from_tex_for_vim.sh
#
#Â Â DESCRIPTION:Â Get the mappings from tex file
#
#Â Â Â Â Â Â OPTIONS:Â —
#Â REQUIREMENTS:Â —
#Â Â Â Â Â Â Â Â Â BUGS:Â —
#Â Â Â Â Â Â Â Â NOTES:Â —
#Â Â Â Â Â Â Â AUTHOR:Â Amit Agarwal (AKA), amit.agarwal@amit-agarwal.co.in
#Â Â Â Â Â Â COMPANY:Â Individual
#Â Â Â Â Â Â VERSION:Â 1.0
#Â Â Â Â Â Â CREATED:Â 09/06/2009 09:19:19 PM IST
#Â Â Â Â Â REVISION:Â —
#===============================================================================
file=$1
IFS=$(echo -e \’\\n\’)
for i in $(cat $file |grep \”^..line\”)
do
#echo $i |awk -F\”\’\” \'{print $2\” \” $3\” \”$4}\’|awk -F\”&\” \'{print $1\” \”$2}\’
echo $i |awk -F\”\’\” \'{
if ( NF >= 4 )
{
print ($2\”\\t ->\”$4\”\\t==>>\”$NF);
}
else
{
print($2\”\\t–>\”$3);
}
fi
}\’Â |sed \’s/\\h.*(/(/\’ |sed \’s/>.*&/>/\’ |sed \’s/\\t*-.>$//\’ |sed \’s/\\//\’done
Related articles by Zemanta
- Get the mappings from tex file for vim plugins (amit-agarwal.co.in)
- bash script to change the vim colorscheme from the list of locally available schemes (amit-agarwal.co.in)
- bash script to change vim colorscheme based on the available themes (amit-agarwal.co.in)
- Mod and hack the GNome main menu with automated scripts to create a menu of the directory. (amit-agarwal.co.in)
- Find out why a program can\’t seem to access to a file (amit-agarwal.co.in)
- sed vs awk (almirkaric.com)