install_vim_plugins.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash
  2. base_dir=$( dirname "${BASH_SOURCE[0]}" )
  3. source "${base_dir}/functions.sh"
  4. work_dir=~
  5. tmp_dir=/tmp
  6. printf "\nThis script helps to install vim plugins"
  7. execution_premission "install pathogen plugin (required)? " && {
  8. try mkdir -p ${work_dir}/.vim/autoload ${work_dir}/.vim/bundle
  9. try download https://tpo.pe/pathogen.vim ${work_dir}/.vim/autoload
  10. #curl -LSso ${work_dir}/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim #&& \
  11. #sed -n '/execute pathogen#infect()/p' ${work_dir}/.vimrc || echo -e "execute pathogen#infect()" >> ${work_dir}/.vimrc
  12. } || die
  13. execution_premission "install vinegar plugin? " && {
  14. git clone https://github.com/tpope/vim-vinegar.git ${work_dir}/.vim/bundle/vim-vinegar
  15. }
  16. execution_premission "install netrw plugin? " && {
  17. git clone https://github.com/eiginn/netrw.git ${work_dir}/.vim/bundle/netrw
  18. }
  19. execution_premission "install airline plugin? " && {
  20. git clone https://github.com/vim-airline/vim-airline ${work_dir}/.vim/bundle/vim-airline
  21. }
  22. execution_premission "install onedark colorscheme? " && {
  23. try mkdir -p ${tmp_dir}/onedark
  24. git clone https://github.com/joshdick/onedark.vim.git ${tmp_dir}/onedark
  25. try mkdir -p ${work_dir}/.vim/colors/
  26. cp ${tmp_dir}/colors/onedark.vim ${work_dir}/.vim/colors/
  27. try rm -r ${tmp_dir}/onedark
  28. }
  29. execution_premission "install molokai colorscheme? " && {
  30. try mkdir -p ${tmp_dir}/molokai
  31. git clone https://github.com/tomasr/molokai.git ${tmp_dir}/molokai
  32. try mkdir -p ${work_dir}/.vim/colors/
  33. cp ${tmp_dir}/colors/molokai.vim ${work_dir}/.vim/colors/
  34. try rm -r ${tmp_dir}/molokai
  35. }