<commit_before>set -e

echo -e "\033[32m➤ Installing!   \033[0m"

hash vim >/dev/null 2>&1 \
  && echo -e "\033[32m  ✔ Found         ❰ Vim ❱   \033[0m" \
  || {
    echo -e "\033[31m  ✘ Missing       ❰ Vim ❱   \033[0m"
    echo -e "\033[31m✘ Install failed!"
    exit 1
  }

hash git >/dev/null 2>&1 \
  && echo -e "\033[32m  ✔ Found         ❰ Git ❱   \033[0m" \
  || {
    echo -e "\033[31m  ✘ Missing       ❰ Git ❱   \033[0m"
    echo -e "\033[31m✘ Install failed!"
    exit 1
  }

if [ -d ~/.vim ]; then
  echo -e "\033[32m  ✔ Exists        ❰ ~/.vim ❱   \033[0m"
else
  echo -e "  ➤ Creating      ❰ ~/.vim ❱   \033[0m"

  mkdir -p ~/.vim

  echo -e "\033[32m    ✔ Created     ❰ ~/.vim ❱   \033[0m"
fi

if [ -d ~/.vim/backup ]; then
  echo -e "\033[32m  ✔ Exists        ❰ ~/.vim/backup ❱   \033[0m"
else
  echo -e "  ➤ Creating      ❰ ~/.vim/backup ❱   \033[0m"

  mkdir -p ~/.vim/backup

  echo -e "\033[32m    ✔ Created     ❰ ~/.vim/backup ❱   \033[0m"
fi

if [ -d ~/.vim/bundle/neobundle.vim ]; then
  echo -e "\033[32m  ✔ Found         ❰ NeoBundle ❱   \033[0m"
else
  echo -e "  ➤ Installing    ❰ NeoBundle ❱   \033[0m"

  hash git >/dev/null 2>&1 && \
    env git clone https://github.com/shougo/neobundle.vim ~/.vim/bundle/neobundle.vim >/dev/null 2>&1

  echo -e "\033[32m    ✔ Installed   ❰ NeoBundle ❱   \033[0m"
fi

if [ -f ~/.vimrc ] || [ -h ~/.vimrc ]; then
  VIMRC_LINE=$(head -n 1 ~/.vimrc);
  if [ "$VIMRC_LINE" != '" razor-x/vimrc' ]; then
    echo -e "  ➤  Exists       ❰ ~/.vimrc ❱   \033[0m"

    mv ~/.vimrc ~/.vimrc.preinstall

    echo -e "\033[32m    ✔ Moved to    ❰ ~/.vimrc.preinstall ❱   \033[0m"
  else
    rm ~/.vimrc
  fi
fi

echo -e "  ➤ Installing    ❰ ~/.vimrc ❱   \033[0m"

tee ~/.vimrc >/dev/null <<EOF
" razor-x/vimrc

" Disable powerline by default.
let g:powerline_loaded = 1

" Skip initialization for vim-tiny or vim-small.
if !1 | finish | endif

if has('vim_starting')
 if &compatible
   set nocompatible
 endif

 set runtimepath+=~/.vim/bundle/neobundle.vim/
endif

call neobundle#begin(expand('~/.vim/bundle/'))

NeoBundleFetch 'shougo/neobundle.vim'

NeoBundle 'shougo/vimproc.vim', {
\ 'build' : {
\     'windows' : 'tools\\update-dll-mingw',
\     'cygwin' : 'make -f make_cygwin.mak',
\     'mac' : 'make -f make_mac.mak',
\     'linux' : 'make',
\     'unix' : 'gmake',
\   },
\ }

if filereadable(expand('~/.vim/bundle/vimrc/plugins.vim'))
  source ~/.vim/bundle/vimrc/plugins.vim
endif

NeoBundle 'razor-x/vimrc'

call neobundle#end()
EOF

echo -e "\033[32m    ✔ Installed   ❰ ~/.vimrc ❱   \033[0m"

echo -e "  ➤ Run           ❰ neoinstall ❱   \033[0m"

~/.vim/bundle/neobundle.vim/bin/neoinstall >/dev/null 2>&1
~/.vim/bundle/neobundle.vim/bin/neoinstall >/dev/null 2>&1

echo -e "\033[32m    ✔ Completed   ❰ neoinstall ❱   \033[0m"

echo -e "\033[32m✔ Install complete!   \033[0m"

exit 0
<commit_msg>Use command over hash in install.sh.<commit_after>set -e

echo -e "\033[32m➤ Installing!   \033[0m"

command -v vim >/dev/null 2>&1 \
  && echo -e "\033[32m  ✔ Found         ❰ Vim ❱   \033[0m" \
  || {
    echo -e "\033[31m  ✘ Missing       ❰ Vim ❱   \033[0m"
    echo -e "\033[31m✘ Install failed!"
    exit 1
  }

command -v git >/dev/null 2>&1 \
  && echo -e "\033[32m  ✔ Found         ❰ Git ❱   \033[0m" \
  || {
    echo -e "\033[31m  ✘ Missing       ❰ Git ❱   \033[0m"
    echo -e "\033[31m✘ Install failed!"
    exit 1
  }

if [ -d ~/.vim ]; then
  echo -e "\033[32m  ✔ Exists        ❰ ~/.vim ❱   \033[0m"
else
  echo -e "  ➤ Creating      ❰ ~/.vim ❱   \033[0m"

  mkdir -p ~/.vim

  echo -e "\033[32m    ✔ Created     ❰ ~/.vim ❱   \033[0m"
fi

if [ -d ~/.vim/backup ]; then
  echo -e "\033[32m  ✔ Exists        ❰ ~/.vim/backup ❱   \033[0m"
else
  echo -e "  ➤ Creating      ❰ ~/.vim/backup ❱   \033[0m"

  mkdir -p ~/.vim/backup

  echo -e "\033[32m    ✔ Created     ❰ ~/.vim/backup ❱   \033[0m"
fi

if [ -d ~/.vim/bundle/neobundle.vim ]; then
  echo -e "\033[32m  ✔ Found         ❰ NeoBundle ❱   \033[0m"
else
  echo -e "  ➤ Installing    ❰ NeoBundle ❱   \033[0m"

  command -v git >/dev/null 2>&1 && \
    env git clone https://github.com/shougo/neobundle.vim ~/.vim/bundle/neobundle.vim >/dev/null 2>&1

  echo -e "\033[32m    ✔ Installed   ❰ NeoBundle ❱   \033[0m"
fi

if [ -f ~/.vimrc ] || [ -h ~/.vimrc ]; then
  VIMRC_LINE=$(head -n 1 ~/.vimrc);
  if [ "$VIMRC_LINE" != '" razor-x/vimrc' ]; then
    echo -e "  ➤  Exists       ❰ ~/.vimrc ❱   \033[0m"

    mv ~/.vimrc ~/.vimrc.preinstall

    echo -e "\033[32m    ✔ Moved to    ❰ ~/.vimrc.preinstall ❱   \033[0m"
  else
    rm ~/.vimrc
  fi
fi

echo -e "  ➤ Installing    ❰ ~/.vimrc ❱   \033[0m"

tee ~/.vimrc >/dev/null <<EOF
" razor-x/vimrc

" Disable powerline by default.
let g:powerline_loaded = 1

" Skip initialization for vim-tiny or vim-small.
if !1 | finish | endif

if has('vim_starting')
 if &compatible
   set nocompatible
 endif

 set runtimepath+=~/.vim/bundle/neobundle.vim/
endif

call neobundle#begin(expand('~/.vim/bundle/'))

NeoBundleFetch 'shougo/neobundle.vim'

NeoBundle 'shougo/vimproc.vim', {
\ 'build' : {
\     'windows' : 'tools\\update-dll-mingw',
\     'cygwin' : 'make -f make_cygwin.mak',
\     'mac' : 'make -f make_mac.mak',
\     'linux' : 'make',
\     'unix' : 'gmake',
\   },
\ }

if filereadable(expand('~/.vim/bundle/vimrc/plugins.vim'))
  source ~/.vim/bundle/vimrc/plugins.vim
endif

NeoBundle 'razor-x/vimrc'

call neobundle#end()
EOF

echo -e "\033[32m    ✔ Installed   ❰ ~/.vimrc ❱   \033[0m"

echo -e "  ➤ Run           ❰ neoinstall ❱   \033[0m"

~/.vim/bundle/neobundle.vim/bin/neoinstall >/dev/null 2>&1
~/.vim/bundle/neobundle.vim/bin/neoinstall >/dev/null 2>&1

echo -e "\033[32m    ✔ Completed   ❰ neoinstall ❱   \033[0m"

echo -e "\033[32m✔ Install complete!   \033[0m"

exit 0

{'fraction_non_alphanumeric': 0.1904016692749087, 'fraction_numerical': 0.0650321683185533, 'mean_word_length': 2.0628328008519703, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 29, 'https://': 2, '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': '1909267', 'n_tokens_mistral': 2994, 'n_tokens_neox': 2653, 'n_words': 666}