免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1865 | 回复: 0
打印 上一主题 下一主题

[系统管理] 自己写的一个配置vim的脚本 [复制链接]

论坛徽章:
1
IT运维版块每日发帖之星
日期:2015-12-20 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-09-29 23:29 |只看该作者 |倒序浏览
最进,学习shell,就写了配置vim的脚本,虽然达到了自己的要求,但是感觉很烂,希望大神们指导一下
  1. #!/bin/bash

  2. echo "Improving to VIM(need root privileges)"
  3. sudo apt-get install vim >& /dev/null

  4. echo "Base Configuring"
  5. echo "\" Enable syntax and filetype check
  6. syntax enable
  7. syntax on
  8. \" Color Scheme
  9. colorscheme murphy

  10. \" Enable filetype plugins
  11. filetype plugin on
  12. filetype indent on

  13. \" Highlight search results
  14. set hlsearch

  15. \" Enable realtime search
  16. set incsearch

  17. \" Show matching brackets when text indicator is over them
  18. set showmatch

  19. \" Enable no wrap
  20. set nowrap

  21. \" Show command in status bar
  22. set showcmd

  23. \" Display line number
  24. set number

  25. \" 1 tab == 4 spaces
  26. set shiftwidth=4
  27. set tabstop=4

  28. \" Enable mouse
  29. set mouse=a

  30. \" Disable compatible mode
  31. set nocompatible" > $HOME/.vimrc
  32. echo "Base Configuring done"

  33. save_path=$HOME/temp
  34. echo "install Ctags..."
  35. if [ -e $save_path/ctags-5.8.tar.gz ]
  36. then
  37.         :
  38. else
  39.         echo "Downloading Ctags..."
  40.         wget -P $save_path http://sourceforge.net/projects/ctags/files/ctags/5.8/ctags-5.8.tar.gz >& /dev/null
  41.         echo "Downloading done"
  42. fi
  43. cd $save_path
  44. target=$(tar -xzvf ctags-5.8.tar.gz | sed -n '1p')
  45. cd $target
  46. ./configure >& /dev/null
  47. make >& /dev/null
  48. make install >& /dev/null
  49. echo "Done"

  50. echo "install Taglist..."
  51. cd $save_path
  52. if [ -e $save_path/taglist.zip ]
  53. then
  54.         :
  55. else
  56.         echo "Downloading taglist..."
  57.         wget -O taglist.zip http://www.vim.org/scripts/download_script.php?src_id=7701 >& /dev/null
  58.         echo "Download done"
  59. fi
  60. 7z e $save_path/taglist.zip
  61. if [ -e $HOME/.vim/doc/taglist.txt -a -e $HOME/.vim/plugin/taglist.vim ]
  62. then
  63.         :
  64. else
  65.         mv taglist.txt $HOME/.vim/doc/
  66.         mv taglist.vim $HOME/.vim/plugin
  67. fi

  68. if  grep "let Tlist_show_One_File=1" $HOME/.vimrc >& /dev/null
  69. then
  70. :
  71. else
  72.         echo "let Tlist_show_One_File=1" >> $HOME/.vimrc
  73. fi
  74. if grep "let Tlist_Exit_OnlyWindow=1" $HOME/.vimrc >& /dev/null
  75. then
  76. :
  77. else
  78.         echo "let Tlist_Exit_OnlyWindow=1" >> $HOME/.vimrc
  79. fi
  80. echo "Done"

  81. echo "install a.vim..."
  82. cd $save_path
  83. if [ -e $save_path/a.vim ]
  84. then
  85.         :
  86. else
  87.         echo "Downloading a.vim..."
  88.         wget -O a.vim http://www.vim.org/scripts/down_script.php?src_id=7218 >& /dev/null
  89.         echo "Download done"
  90. fi
  91. if [ -e $HOME/.vim/plugin/a.vim ]
  92. then
  93.         :
  94. else
  95.         mv a.vim $HOME/.vim/plugin
  96. fi
  97. if grep "nnoremap <leader> <F12>:A<cr>" $HOME/.vimrc
  98. then
  99.         :
  100. else
  101.         echo "\"Map F12\\nnnoremap <leader> <F12>:A<cr>" >> $HOME/.vimrc

  102. fi
  103. echo "Done"
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP