免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: lovesaka
打印 上一主题 下一主题

[共享交流]请交出你的vimrc [复制链接]

论坛徽章:
0
1 [报告]
发表于 2006-09-12 09:13 |显示全部楼层
set nocompatible
set nobackup
set nu
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set autoindent
set ai

set foldmethod=syntax "按照语法折叠代码,indent为按照缩进折叠代码,zi命令打开/关闭所有折叠
set foldcolumn=3  "设置折叠区域的宽度
set foldclose=all "设置为自动关闭折叠

''对于安装了中文help有效
        if version >= 603
                set helplang=cn
        endif

source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
source $vimruntime/colors/darkblue.vim  ''设置配色方案
behave mswin

''默认配置
set diffexpr=MyDiff()
function MyDiff()
  let opt = '-a --binary '
  if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  let arg1 = v:fname_in
  if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  let arg2 = v:fname_new
  if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  let arg3 = v:fname_out
  if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  if &sh =~ '\<cmd'
    silent execute '!""C:\Program Files\Vim\vim64\diff" ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . '"'
  else
    silent execute '!C:\Program" Files\Vim\vim64\diff" ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3
  endif
endfunction

"设置F5为不同文件类型添加注释
filetype plugin indent on
autocmd FileType cpp,java  map <F5> 0i//<Esc>
autocmd FileType c  map! <F5> /* */<Esc>
autocmd FileType sh        map! <F5> 0i#<Esc>

''设置F12为运行python程序,运行前需要保存
map <F12> :!c:\python24\python.exe % <CR>

[ 本帖最后由 lowmer 于 2006-9-12 17:25 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2006-09-12 17:18 |显示全部楼层
原帖由 lovesaka 于 2006-9-12 11:30 发表
to: slay78,lowmer
谢谢两位大侠能把自己的东西拿来共享从两位贴出来的脚本中自己也偷学了不少东西以前有点不怎么会的也给弄明白了,而且找从中找到了更加简洁的方法来实现自己想要的功能,其实是不是自己亲手写 ...


不是谦虚,真算不上大虾。我只是把7.0的中文help详细地看了一遍,然后又看了“超级长贴”而已。有些选项一眼就看明白的就没加注释。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP