#!/usr/bin/perl #add this line to your .bashrc: #alias vt='~/bin/updatevimrc.pl' #adjust accordingly, then use 'vt' #whenever you want to set the pwd #as your base directory for ctags. #satebackire -f "tags" || system("ctags -R *"); open(RC, "< /home/" . $ENV{USER} . "/.vimrc") or die("can not open vimrc"); @arr = ; close(RC); open(RC, "> /home/" . $ENV{USER} . "/.vimrc") or die("can not open vimrc"); if($arr[scalar(@arr)-1] =~ /tags/){pop(@arr);} foreach(@arr){ print RC $_; } chomp($dir=`pwd`); print RC "set tags=" . $dir . "/tags\n"; close(RC);