Windows下vim配置

Java代码   收藏代码
  1. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  2. " Vim: windows config(c:\Program Files\Vim\_vimrc)  
  3. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  4. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""    
  5. " Use Vim defaults (much better!)    
  6. " This should the priority setting, otherwise problems can appear    
  7. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""    
  8. set nocompatible        
  9. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  10.   
  11. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  12. " 编码设置  
  13. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  14. set fileencodings=utf-8,gb2312,gbk,gb18030    
  15. set termencoding=utf-8    
  16. "set fileformats=unix    
  17. set fileformat=unix    
  18. set encoding=prc    
  19. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  20.   
  21.   
  22. source $VIMRUNTIME/vimrc_example.vim  
  23. source $VIMRUNTIME/mswin.vim  
  24. behave mswin  
  25.   
  26. set diffexpr=MyDiff()  
  27. function MyDiff()  
  28.   let opt = '-a --binary '  
  29.   if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif  
  30.   if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif  
  31.   let arg1 = v:fname_in  
  32.   if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif  
  33.   let arg2 = v:fname_new  
  34.   if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif  
  35.   let arg3 = v:fname_out  
  36.   if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif  
  37.   let eq = ''  
  38.   if $VIMRUNTIME =~ ' '  
  39.     if &sh =~ '\<cmd'  
  40.       let cmd = '""' . $VIMRUNTIME . '\diff"'  
  41.       let eq = '"'  
  42.     else  
  43.       let cmd = substitute($VIMRUNTIME, ' ''" ''') . '\diff"'  
  44.     endif  
  45.   else  
  46.     let cmd = $VIMRUNTIME . '\diff'  
  47.   endif  
  48.   silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq  
  49. endfunction  
  50.   
  51.   
  52. set number                      " 显示行号  
  53. set tabstop=4                   " 设定tab长度为4  
  54. set shiftwidth=4                " 缩进的空格数  
  55. set expandtab                   " 是否在缩进和遇到Tab键时使用空格代替;  
  56.                                 " 使用noexpandtab取消设置  
  57. set autoindent                  " 自动缩进  
  58. set smartindent  
  59. set cindent       
  60.   
  61. set showmatch                   " 显示括号配对情况  
  62. set paste                       " 支持外部复制(好像不管用)  
  63. set clipboard+=unnamed          " 与windows共享剪贴板  
  64.   
  65. set history=50                  " keep 50 lines of command history  
  66. set scrolloff=3                 " 光标移动到buffer的顶部和底部时保持3行距离  
  67. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  68. " color set  
  69. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  70. colorscheme desert              " windows下深色主题  
  71.   
  72. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  73. " windows下gui去掉显示,如果需要显示,只需要将-改为+即可  
  74. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  75. set guioptions-=T               " windows下隐藏工具栏  
  76. set guioptions-=r               " 把gui右边的滑动条去掉  
  77. set guioptions-=L               " 把gui左边的滑动条去掉  
  78. set guioptions-=m               " 把gui的菜单栏去掉  
  79. set shortmess=atI               " 启动的时候不显示援助索马里儿童的提示(是I而不是L)  
  80. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  81.   
  82. " windows下启动vim最大化  
  83. autocmd GUIEnter * simalt ~x  
  84.   
  85. set gcr=a:block-blinkon0        " windows下去掉光标闪动  
  86.   
  87. set nobackup                    " 关闭自动备份功能,backup自动备份  
  88.   
  89.   
  90.   
  91. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  92. " windows下python配置  
  93. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  94. " 自动补全:  
  95. " 配置说明  
  96. 1. 下载pydiction, pydiction包括了complete-dict和python_pydiction.vim  
  97. 2. cp complete-dict to C:\Program Files\Vim\vimfiles\ftplugin\pydiction  
  98. "    cp python_pydiction to C:\Program Files\Vim\vimfiles\ftplugin  
  99. 3. modify _vimrc  
  100. "    add:  
  101. "       filetype plugin on  
  102. "       let g:pydiction_location='C:\Program Files\Vim\vimfiles\ftplugin\pydiction\complete-dict'  
  103. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  104. " 快捷键说明  
  105. " 需要补全的时候,按住tab键,便可以看到补全的内容  
  106. " 然后通过ctrl-n, ctrl-p可以上下选择  
  107. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  108. "filetype plugin on  
  109. "let g:pydiction_location='C:\Program Files\Vim\vimfiles\ftplugin\pydiction\complete-dict'  
  110. " 自动编译python,  
  111. " python需要加入path路径,以后只要编写python的时候,按住f12,便可直接编译  
  112. " %代表的就是当前的文件  
  113. "map <F12> :!python.exe %  
  114. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  115.   
  116.   
  117. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  118. " Tag list(ctags)  
  119. " 配置说明:  
  120. 1. 下载ctags, 解压缩,会发现里面有一个ctags.exe  
  121. 1. cp ctags.exe to c:\windows\system32\, 这之后,cmd下便有了ctags命令  
  122. 3. 下载taglist, 解压缩, 里面有doc/taglist.txt和plugin/taglist.vim  
  123. 4. cp taglist.vim to C:\Program Files\Vim\vimfiles\plugin\  
  124. "    cp taglist.txt to C:\Program Files\Vim\vimfiles\doc\  
  125. 5. 使用:  
  126. "    同linux类似。  
  127. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  128. "let Tlist_Show_One_file=1                  " 不同时显示多个的tag,只显示当前文件的    
  129. "let Tlist_Exit_OnlyWindow=1                " 如果taglist窗口是最后一个窗口,则退出vim   
  130. "nmap  tl :TlistToggle  
  131. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  132.   
  133.   
  134. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  135. " winmanager config   
  136. " 配置说明:  
  137. 1. 下载winmanager, 解压缩  
  138. 2. 操作同taglist类似  
  139. " let g:winManagerWindowLayout='TagList|FileExplorer' 显示顺序,TagList在上,  
  140. " FileExplorer在下  
  141. " let g:winManagerWidth=30  30像素的宽度  
  142. " nmap  wm :WMToggle        自定义快捷键                   
  143. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  144. "let g:winManagerWindowLayout='TagList|FileExplorer'  
  145. "let g:winManagerWidth=30  
  146. "nmap  wm :WMToggle                           
  147. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值