Skip to content

Instantly share code, notes, and snippets.

@kouphax
Last active August 29, 2015 13:56
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 kouphax/9342491 to your computer and use it in GitHub Desktop.
Save kouphax/9342491 to your computer and use it in GitHub Desktop.
some linuxy codez for JVM based development
#! /bin/bash
# lite weight vundle thing for vim bundles. requires pathogen
bundles=(
kien/ctrlp.vim
emezeske/paredit.vim
tpope/vim-classpath
tpope/vim-fireplace
cschlueter/vim-wombat
scrooloose/nerdtree
kien/rainbow_parentheses.vim
guns/vim-clojure-static
tpope/vim-sensible
lokaltog/vim-powerline)
rm .gitignore && touch .gitignore
for bundle in ${bundles[*]}; do
bundle_parts=(${bundle//\// })
repo_name=${bundle_parts[1]}
if [ -d $repo_name ]; then
echo "Updating $bundle"
cd $repo_name
git pull origin master
cd -
else
echo "Adding $bundle"
git clone http://github.com/$bundle.git
fi
echo "$repo_name/" >> .gitignore
done
#! /bin/bash
# Switch the javas based on whats in /opt/java
# use symlinks to make typing less.
# it sets env variables so source it when you run it like `. j 1.5`
if [ -n "$1" ]; then
JAVA_PATH=/opt/java/$1
echo "Switching to Java $1 at $JAVA_PATH"
export JAVA_HOME=$JAVA_PATH
export JRE_HOME=$JAVA_PATH
export PATH="$JAVA_PATH/bin:$PATH"
else
echo "JAVA_HOME: $JAVA_HOME"
echo "JRE_HOME: $JRE_HOME"
fi
#! /bin/bash
# Swith the mavens
# it sets env variables so source it when you run it like `. m 3.2.2`
MAVEN_PATH=/opt/apache-maven-$1
if [ -d "$MAVEN_PATH" ]; then
echo "Switching to Maven $1 at $MAVEN_PATH"
export MAVEN_HOME=$MAVEN_PATH
export M2_HOME=$MAVEN_PATH
export PATH="$MAVEN_PATH/bin:$PATH"
else
echo "Maven version $1 not installed or not at $MAVEN_PATH"
fi

A collection of scripts that make some of my development easier

  • j - used to set the current java version (assumes that all JVMs are in the /opt/java folder
  • m - used to set the current maven version
  • bundles clones or updates the listed vim bundles. Place this in the ~/.vim/bundle folder after you install pathogen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment