Created
April 18, 2014 20:08
-
-
Save alonisser/11062168 to your computer and use it in GitHub Desktop.
Generate a list of current vim plugins including path and git repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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