mirror of
https://github.com/DictXiong/dotfiles.git
synced 2025-07-30 19:20:29 +08:00
move tpm&vundle install to install.sh
This commit is contained in:
parent
ceddd5f113
commit
7205c55180
27
.zshrc2
27
.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 <prefix + I>"
|
||||
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()
|
||||
|
31
install.sh
31
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 <prefix + I>"
|
||||
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!"
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user