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

# Check cmake, node and npm
if ! type cmake &> /dev/null || ! type node &> /dev/null || ! type npm &> /dev/null ; then
    echo 'Prerequisites are not installed. Please check the existences of cmake, node and npm.'
    exit
fi

# Check Vim and Zsh
VIM_CHECK=`echo "$(vim --version | egrep -o 'Vi IMproved [0-9]+[.][0-9]+' | cut -d' ' -f3) >= 7.4" | bc`
ZSH_CHECK=`which zsh`    
if [ ! $VIM_CHECK ]; then
    echo '[WARNING] Cannot find Vim of version >= 7.4'
elif [ ! $ZSH_CHECK ]; then
    echo '[ERROR] Cannot find Zsh.'
    exit
elif [ ! `which curl` ]; then
    echo '[ERROR] curl is required for installing vim.plug.'
    exit
fi
# Note: it doesn't check git here, the environment should have git if this script already downloaded.

# Back to home
cd ~
 
# Get FZF
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install

# Get vim.plug and oh-my-zsh
curl -fLo ~/.unix_settings/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
git clone https://github.com/robbyrussell/oh-my-zsh .unix_settings/.oh-my-zsh

# Use personalized theme
cp .unix_settings/bureau_custom.zsh-theme .unix_settings/.oh-my-zsh/themes/bureau_custom.zsh-theme

# Create symbolic links for dot-files
ln -fs .unix_settings/.zshrc
ln -fs .unix_settings/.oh-my-zsh
ln -fs .unix_settings/.vim
ln -fs .unix_settings/.vimrc
ln -fs .unix_settings/.inputrc
ln -fs .unix_settings/.jupyter
ln -fs .unix_settings/.ipython
ln -fs .unix_settings/.tmux.conf
ln -fs .unix_settings/.pylintrc

mkdir .ssh 2> /dev/null
ln -fs ~/.unix_settings/.ssh/config ~/.ssh/config

if [ "$1" = "--use-nvim" ]; then
    # Neovim
    mkdir .config 2> /dev/null
    ln -fs ~/.unix_settings/.vim ~/.config/nvim
    ln -fs ~/.unix_settings/.vimrc ~/.config/nvim/init.vim

    # Install vim plugins in nvim
    nvim +PlugInstall +qall
else
    # Install vim plugins
    vim +PlugInstall +qall
fi

## (optional)
#`ln -fs .unix_settings/.pudb-theme.py`
#`ln -fs .unix_settings/.Xmodmap`
#`ln -fs .unix_settings/.spyder2-py3`
#`ln -fs .unix_settings/.spyder2`

# Update zsh
source .zshrc

echo 'Done. Do not forget to install ctags and jsctags.'
<commit_msg>Create symbolic link for .gitconfig in installation.<commit_after>#!/usr/bin/env zsh

# Check cmake, node and npm
if ! type cmake &> /dev/null || ! type node &> /dev/null || ! type npm &> /dev/null ; then
    echo 'Prerequisites are not installed. Please check the existences of cmake, node and npm.'
    exit
fi

# Check Vim and Zsh
VIM_CHECK=`echo "$(vim --version | egrep -o 'Vi IMproved [0-9]+[.][0-9]+' | cut -d' ' -f3) >= 7.4" | bc`
ZSH_CHECK=`which zsh`    
if [ ! $VIM_CHECK ]; then
    echo '[WARNING] Cannot find Vim of version >= 7.4'
elif [ ! $ZSH_CHECK ]; then
    echo '[ERROR] Cannot find Zsh.'
    exit
elif [ ! `which curl` ]; then
    echo '[ERROR] curl is required for installing vim.plug.'
    exit
fi
# Note: it doesn't check git here, the environment should have git if this script already downloaded.

# Back to home
cd ~
 
# Get FZF
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install

# Get vim.plug and oh-my-zsh
curl -fLo ~/.unix_settings/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
git clone https://github.com/robbyrussell/oh-my-zsh .unix_settings/.oh-my-zsh

# Use personalized theme
cp .unix_settings/bureau_custom.zsh-theme .unix_settings/.oh-my-zsh/themes/bureau_custom.zsh-theme

# Create symbolic links for dot-files
ln -fs .unix_settings/.zshrc
ln -fs .unix_settings/.oh-my-zsh
ln -fs .unix_settings/.vim
ln -fs .unix_settings/.vimrc
ln -fs .unix_settings/.inputrc
ln -fs .unix_settings/.jupyter
#ln -fs .unix_settings/.ipython
ln -fs .unix_settings/.tmux.conf
ln -fs .unix_settings/.pylintrc
ln -fs .unix_settings/.gitconfig

mkdir .ssh 2> /dev/null
ln -fs ~/.unix_settings/.ssh/config ~/.ssh/config

if [ "$1" = "--use-nvim" ]; then
    # Neovim
    mkdir .config 2> /dev/null
    ln -fs ~/.unix_settings/.vim ~/.config/nvim
    ln -fs ~/.unix_settings/.vimrc ~/.config/nvim/init.vim

    # Install vim plugins in nvim
    nvim +PlugInstall +qall
else
    # Install vim plugins
    vim +PlugInstall +qall
fi

## (optional)
#`ln -fs .unix_settings/.pudb-theme.py`
#`ln -fs .unix_settings/.Xmodmap`
#`ln -fs .unix_settings/.spyder2-py3`
#`ln -fs .unix_settings/.spyder2`

# Update zsh
source .zshrc

echo 'Done. Do not forget to install ctags and jsctags.'

{'fraction_non_alphanumeric': 0.14731446400713172, 'fraction_numerical': 0.007131713839982171, 'mean_word_length': 3.1023765996343693, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3977505', 'n_tokens_mistral': 1809, 'n_tokens_neox': 1713, 'n_words': 483}