diff --git a/.zshrc2 b/.zshrc2 index ee48c2f..5870919 100644 --- a/.zshrc2 +++ b/.zshrc2 @@ -61,33 +61,6 @@ antigen theme ${ZSH_THEME:-ys} antigen apply # end of antigen config -# install tmux tpm -TMUX_TPM="$HOME/.tmux/plugins/tpm" -command -v tmux > /dev/null 2>&1 -if [[ $? == 0 && ! -d "$TMUX_TPM" ]]; then - echo "installing tmux tpm ..." - git clone https://hub.fastgit.xyz/tmux-plugins/tpm "$TMUX_TPM" - command -v g++ - if [[ $? == 0 ]]; then - echo "initializing tmux plugins ..." - ~/.tmux/plugins/tpm/bin/install_plugins - else - echo "pls install g++ and init tmux plugins by " - fi -fi -# end of tpm - -# install vundle -VIM_VUNDLE="$HOME/.vim/bundle/Vundle.vim" -command -v vim > /dev/null 2>&1 -if [[ $? == 0 && ! -d "$VIM_VUNDLE" ]]; then - echo "installing vim vundle ..." - git clone https://hub.fastgit.xyz/gmarik/Vundle.vim.git "$VIM_VUNDLE" - echo "initializing vim plugins ..." - vim +PluginInstall +qall -fi -# end of vundle - # functions export DOTFILES=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd ) dfs() diff --git a/install.sh b/install.sh index 57dea67..2904d03 100755 --- a/install.sh +++ b/install.sh @@ -173,7 +173,6 @@ delete_link_if_match() fi } - install_crontab(){ fmt_note "installing \"$crontab_job\" to crontab ..." ( crontab -l | grep -vxF "${crontab_job}" | grep -v "no crontab for"; echo "$crontab_job" ) | crontab - @@ -184,12 +183,42 @@ uninstall_crontab(){ ( crontab -l | grep -vxF "$crontab_job" ) | crontab - } +install_tmux_tpm(){ + TMUX_TPM="$HOME/.tmux/plugins/tpm" + command -v tmux > /dev/null 2>&1 + if [[ $? == 0 && ! -d "$TMUX_TPM" ]]; then + echo "installing tmux tpm ..." + git clone https://hub.fastgit.xyz/tmux-plugins/tpm "$TMUX_TPM" + command -v g++ > /dev/null 2>&1 + if [[ $? == 0 ]]; then + echo "initializing tmux plugins ..." + ~/.tmux/plugins/tpm/bin/install_plugins + else + echo "pls install g++ and init tmux plugins by " + fi + fi +} + +install_vim_vundle(){ + VIM_VUNDLE="$HOME/.vim/bundle/Vundle.vim" + command -v vim > /dev/null 2>&1 + if [[ $? == 0 && ! -d "$VIM_VUNDLE" ]]; then + echo "installing vim vundle ..." + git clone https://hub.fastgit.xyz/gmarik/Vundle.vim.git "$VIM_VUNDLE" + echo "initializing vim plugins ..." + vim +PluginInstall +qall + fi +} + install(){ install_crontab insert_if_not_exist "${HOME}/.zshrc" "source ${dotfile_home_path}/.zshrc2" insert_if_not_exist "${HOME}/.tmux.conf" "source-file ${dotfile_home_path}/.tmux.conf2" insert_if_not_exist "${HOME}/.vimrc" "source ${dotfile_home_path}/.vimrc2" create_symlink "${dotfile_path}/.ssh/authorized_keys2" "${HOME}/.ssh/authorized_keys2" + # those that won't be uninstalled in the future + install_tmux_tpm + install_vim_vundle fmt_note "done installing!" }