使用VundleVim定制vim开发环境

1.建议vim版本在7.3以上,查看vim版本

点击(此处)折叠或打开

  1. (py3env) [root@mysqltest-213-2 pytonstudy]# vim --version
  2. VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Dec 21 2016 17:10:41)
  3. Included patches: 1-207, 209-629
  4. Modified by
  5. Compiled by




下载

点击(此处)折叠或打开

  1. https://github.com/VundleVim/Vundle.vim
  2. git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim


vim ~/.vimrc 添加如下内容

点击(此处)折叠或打开

  1. " show row number
  2. set nu
  3. " " color theme
  4. colorscheme desert
  5. " " 设置encoding,防止乱码
  6. set fileencodings=utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,latin1
  7. " """"""""""""""""""""""""""""""
  8. " " Vundle Setting "
  9. " """"""""""""""""""""""""""""""
  10. set nocompatible " be iMproved, required
  11. filetype on " required
  12. " " set the runtime path to include Vundle and initialize
  13. set rtp+=~/.vim/bundle/Vundle.vim
  14. call vundle#begin()
  15. " " let Vundle manage Vundle, required
  16. Plugin 'VundleVim/Vundle.vim'
  17. " "
  18. " " 插件管理核心库
  19. Bundle 'gmarik/vundle'
  20. " " 文件管理器
  21. Plugin 'scrooloose/nerdtree'
  22. map <C-n> :NERDTreeToggle<CR>
  23. " " ctrlp搜索插件
  24. Bundle 'ctrlpvim/ctrlp.vim'
  25. let g:ctrlp_map = '<c-p>'
  26. let g:ctrlp_cmd = 'CtrlP'
  27. " " 加强状态栏
  28. Plugin 'bling/vim-airline'
  29. " "代码补全
  30. Bundle 'Shougo/neocomplcache'
  31. let g:neocomplcache_enable_at_startup = 1
  32. " " Use smartcase.
  33. let g:neocomplcache_enable_smart_case = 1
  34. " " Set minimum syntax keyword length.
  35. let g:neocomplcache_min_syntax_length = 3
  36. let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'
  37. set completeopt-=preview
  38. " " EasyGrep
  39. Plugin 'dkprice/vim-easygrep'
  40. " " 自动格式化
  41. Plugin 'Chiel92/vim-autoformat'
  42. noremap <F3> :Autoformat<CR>
  43. let g:autoformat_autoindent = 1
  44. let g:autoformat_retab = 1
  45. let g:autoformat_remove_trailing_spaces = 1
  46. " " 自动补全括号,引号
  47. Plugin 'Raimondi/delimitMate'
  48. let g:delimitMate_expand_space = 1
  49. let g:delimitMate_expand_cr = 2
  50. let g:delimitMate_expand_space = 1
  51. call vundle#end() " required
  52. filetype plugin indent on " required
  53. " " size of a hard tabstop
  54. set tabstop=4
  55. " " size of an "indent"
  56. set shiftwidth=4
按esc 退出到vim命令模式输入

点击(此处)折叠或打开

  1. :BundleInstall



点击(此处)折叠或打开

  1. " Installing plugins to /root/.vim/bundle | 1
  2. . Plugin 'VundleVim/Vundle.vim' |~
  3. . Plugin 'gmarik/vundle' |~
  4. . Plugin 'scrooloose/nerdtree' |~
  5. . Plugin 'ctrlpvim/ctrlp.vim' |~
  6. . Plugin 'bling/vim-airline' |~
  7. . Plugin 'Shougo/neocomplcache' |~
  8. . Plugin 'dkprice/vim-easygrep' |~
  9. . Plugin 'Chiel92/vim-autoformat' |~
  10. . Plugin 'Raimondi/delimitMate' |~
  11. * Helptags |~
  12. |~
  13. ~ |~
  14. ~ |~
  15. ~ |~
  16. ~ |~
  17. ~ |~
  18. ~ |~
  19. ~ |~
  20. ~ |~
  21. ~ |~
  22. ~ |~
  23. ~ |~
  24. ~ |~
  25. ~ |~
  26. Preview [Vundle] Installer vun… 100% ? 12/12 ㏑ : 1 [No Name] 100% ? 0/1 ㏑ : 1
  27. Done!

安装完成
代码事例

点击(此处)折叠或打开

  1. (py3env) [root@mysqltest-213-2 pytonstudy]# vim test_su.py

  2.   1 a = 1
  3.   2 a2 = 3
  4.   3 a += a2
  5.   4 print("a2=%d"%(a2))
  6.   5 print("a=%d"%(a))





来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24486203/viewspace-2147782/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/24486203/viewspace-2147782/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值