Skip to content

Instantly share code, notes, and snippets.

@alonisser
Created April 18, 2014 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alonisser/11062168 to your computer and use it in GitHub Desktop.
Save alonisser/11062168 to your computer and use it in GitHub Desktop.
Generate a list of current vim plugins including path and git repo
set -e
trim() {
#http://stackoverflow.com/questions/369758/how-to-trim-whitespace-from-bash-variable
local var=$@
var="${var#"${var%%[![:space:]]*}"}" # remove leading whitespace characters
var="${var%"${var##*[![:space:]]}"}" # remove trailing whitespace characters
echo -n "$var"
}
CURRENT=$PWD
if [ -f ~/vim_plugins ];then
rm ~/vim_plugins
fi
for folder in $(find ~/.vim/bundle -maxdepth 1 -mindepth 1 -type d)
do
cd $folder
echo "\n---------------------\n$folder" >> ~/vim_plugins
trim $(git remote --verbose | grep origin | grep push | sed s/\(push\)/''/ | sed s/origin/''/ ) >> ~/vim_plugins
done;
cd $CURRENT;
unset folder CURRENT REPO;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment