<commit_before>#!/usr/bin/env bash

cd "$(dirname "${BASH_SOURCE}")";

function setupHomebrew() {
  /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  /usr/local/dotfiles/brew.sh
}

function setupRVM() {
  gpg --keyserver hkp://keys.gnupg.net --recv-keys <KEY>
  \curl -sSL https://get.rvm.io | bash -s -- --autolibs=read-fail
}

function setupSettings() {
  if [[ -d ~/Library/Fonts ]]; then
    rsync --exclude ".DS_Store" -av --ignore-times --no-perms --progress fonts/ ~/Library/Fonts/
  fi
  if [[ -d /usr/local/share/hames/fortunes ]]; then
    rsync -av --ignore-times --no-perms --progress init/sadserver_tweets* /usr/local/share/games/fortunes
  fi
}

function setupBash() {
  # This copies (rsynchs) everything not specifically excluded to $HOME
  rsync -avh --ignore-times --no-perms --progress bash_dot_files/ $HOME
  rsync -avh --ignore-times --no-perms --progress bin/ $HOME/bin
  setupSettings
  source ~/.bash_profile;
}

function setupFish() {
  setupSettings
  rm -rf ~/.config/fish
  if [[ -f /usr/local/bin/fish ]]; then
    # OSX + homebrew
    echo "/usr/local/bin/fish" | sudo tee -a /etc/shells
    chsh -s /usr/local/bin/fish
  else
    chsh -s /usr/bin/fish
  fi
  curl -L http://get.oh-my.fish | fish
  omf install brew rvm
  rsync -avh --ignore-times --no-perms --progress /usr/local/dotfiles/fish/ ~/.config/fish
}

function setupVim() {
  rm -rf ~/.vim
  cp the_dot_files/.vimrc ~/
  rsync -avh --ignore-times --no-perms --progress .vim/colors ~/.vim
  rsync -avh --ignore-times --no-perms --progress .vim/syntax ~/.vim
  git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/Vundle.vim
  vim +PluginInstall +qall
}

function setupTmux() {
  rm -rf ~/.tmux/plugins
  git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
  tmux source ~/.tmux.conf
}

read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1;
echo "";
if [[ $REPLY =~ ^[Yy]$ ]]; then
  rsync -avh --ignore-times --no-perms --progress the_dot_files/ $HOME
  while getopts ":bfholtv" opt; do
    case $opt in
      b)
        echo " *** Bootstrap Bash ***"
        setupBash
        ;;
      f)
        echo " *** Bootstrap Fish shell ***"
        setupFish
        ;;
      h)
        echo " *** Bootstrap Homebrew ***"
        setupHomebrew
        ;;
      o)
        echo " *** Bootstrap macOS ***"
        ./bootstrap_macos.sh $2
        setupHomebrew
        setupRVM
        ;;
      l)
        echo " *** Bootstrap Linux ***"
        bootstrap_linux.sh
        ;;
      t)
        echo " *** Bootstrap tmux plugins ***"
        setupTmux
        ;;
      v)
        echo " *** Bootstrap vim ***"<commit_msg>Add pygment pip install<commit_after>#!/usr/bin/env bash

cd "$(dirname "${BASH_SOURCE}")";

function setupHomebrew() {
  /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  /usr/local/dotfiles/brew.sh
}

function setupRVM() {
  gpg --keyserver hkp://keys.gnupg.net --recv-keys <KEY>
  \curl -sSL https://get.rvm.io | bash -s -- --autolibs=read-fail
}

function setupSettings() {
  if [[ -d ~/Library/Fonts ]]; then
    rsync --exclude ".DS_Store" -av --ignore-times --no-perms --progress fonts/ ~/Library/Fonts/
  fi
  if [[ -d /usr/local/share/hames/fortunes ]]; then
    rsync -av --ignore-times --no-perms --progress init/sadserver_tweets* /usr/local/share/games/fortunes
  fi
}

function setupBash() {
  # This copies (rsynchs) everything not specifically excluded to $HOME
  rsync -avh --ignore-times --no-perms --progress bash_dot_files/ $HOME
  rsync -avh --ignore-times --no-perms --progress bin/ $HOME/bin
  setupSettings
  source ~/.bash_profile;
}

function setupFish() {
  setupSettings
  rm -rf ~/.config/fish
  if [[ -f /usr/local/bin/fish ]]; then
    # OSX + homebrew
    echo "/usr/local/bin/fish" | sudo tee -a /etc/shells
    chsh -s /usr/local/bin/fish
  else
    chsh -s /usr/bin/fish
  fi
  curl -L http://get.oh-my.fish | fish
  omf install brew rvm
  rsync -avh --ignore-times --no-perms --progress /usr/local/dotfiles/fish/ ~/.config/fish
}

function setupVim() {
  rm -rf ~/.vim
  cp the_dot_files/.vimrc ~/
  rsync -avh --ignore-times --no-perms --progress .vim/colors ~/.vim
  rsync -avh --ignore-times --no-perms --progress .vim/syntax ~/.vim
  git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/Vundle.vim
  vim +PluginInstall +qall
}

function setupTmux() {
  rm -rf ~/.tmux/plugins
  git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
  tmux source ~/.tmux.conf
}

read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1;
echo "";
if [[ $REPLY =~ ^[Yy]$ ]]; then
  rsync -avh --ignore-times --no-perms --progress the_dot_files/ $HOME
  sudo pip install --upgrade pip
  sudo pip install pygments
  while getopts ":bfholtv" opt; do
    case $opt in
      b)
        echo " *** Bootstrap Bash ***"
        setupBash
        ;;
      f)
        echo " *** Bootstrap Fish shell ***"
        setupFish
        ;;
      h)
        echo " *** Bootstrap Homebrew ***"
        setupHomebrew
        ;;
      o)
        echo " *** Bootstrap macOS ***"
        ./bootstrap_macos.sh $2
        setupHomebrew
        setupRVM
        ;;
      l)
        echo " *** Bootstrap Linux ***"
        bootstrap_linux.sh
        ;;
      t)
        echo " *** Bootstrap tmux plugins ***"
        setupTmux
        ;;
      v)
        echo " *** Bootstrap vim ***"
{'fraction_non_alphanumeric': 0.16002909619930897, 'fraction_numerical': 0.0007274049827241316, 'mean_word_length': 2.237198351971748, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2165659', 'n_tokens_mistral': 2017, 'n_tokens_neox': 1931, 'n_words': 490}