<repo_name>jxunix/utility<file_sep>/Makefile
# Makefile

.PHONY: pull push config install

ROOT = $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))

all: push

pull:
	git pull origin master

push:
	git add -A
	git commit -m "update"
	git push origin master

config: pull
	ln -sf  ${ROOT}/.bash_aliases  ~/.bash_aliases
	ln -sf  ${ROOT}/.vimrc         ~/.vimrc
	ln -sf  ${ROOT}/.gitconfig     ~/.gitconfig
	ln -sfn ${ROOT}/ftplugin       ~/.vim/ftplugin
	ln -sfn ${ROOT}/colors         ~/.vim/colors

install:
	./install.sh
<file_sep>/README.md
# utility

1. Set up `Vundle` </br>
$ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim

2. Install plugin `YouCompleteMe` </br>
$ git clone https://github.com/Valloric/YouCompleteMe ~/.vim/bundle/YouCompleteMe </br>
$ cd ~/.vim/bundle/YouCompleteMe </br>
$ ./install.py --clang-completer </br>
For more information, please visit https://github.com/valloric/youcompleteme.

3. Install plugins </br>
Launch vim and run :PluginInstall
<file_sep>/install.sh
#!/bin/bash

sudo -i

apt install -y build-essential
apt install -y cmake
apt install -y ctags
apt install -y default-jdk
apt install -y git
apt install -y python3-dev

apt update -y
apt dist-upgrade -y

exit
<file_sep>/.bash_aliases
#----------------------------------------------------------------------
# Renaming
#----------------------------------------------------------------------
alias ls="ls --color=always"
alias grep="grep --color=always"
alias vi="vim"

#----------------------------------------------------------------------
# Variables
#----------------------------------------------------------------------
export vimrc=~/.vimrc
export profile=~/.bash_aliases

#----------------------------------------------------------------------
# Functions
#----------------------------------------------------------------------
v_aux() {
    if [ "${1: -1}" == "." ]; then
        vim -O $1{h,cpp}
    elif [ "${1: -4}" == ".cpp" ]; then
        vim "$1"
    elif [ "${1: -2}" == ".h" ]; then
        vim "$1"
    else
        vim -O $1.{h,cpp}
    fi
}

cd_aux() {
    if [ -d ../"$1" ]; then
        cd ../"$1"
    else
        cd "$1"
    fi
}

parse_git_branch() {
    git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}

#----------------------------------------------------------------------
# Alias
#----------------------------------------------------------------------
for dir in "$HOME"/*; do
    [ -d "$dir" ] && alias $(basename "$dir")="cd $dir"
done

for dir in "$HOME"/*; do
    [ -d "$dir" ] && export $(basename "$dir")="$dir"
done

alias src="cd_aux src"
alias tst="cd_aux test"
alias build="cd_aux build"

alias ll="ls -l"
alias lla="ll -A"
alias llt="ll -t"

alias v="v_aux"
alias sp="source $profile"
alias vp="vim $profile"
alias vv="vim $vimrc"

alias gs="clear; grep --include=\*.{cpp,h,cc,hh} --exclude=\*.t.{h,cpp} -nr"
alias f="find * -name"
alias tag="ctags -R *"
alias update="sudo apt update -y; sudo apt dist-upgrade -y"

alias nb='jupyter notebook'

#----------------------------------------------------------------------
# Settings
#----------------------------------------------------------------------
set -o vi
