Chinaunix首页 | 论坛 | 博客
  • 博客访问: 666239
  • 博文数量: 156
  • 博客积分: 6010
  • 博客等级: 准将
  • 技术积分: 1201
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-05 20:08
文章分类

全部博文(156)

文章存档

2010年(13)

2008年(39)

2007年(104)

我的朋友

分类: LINUX

2010-05-13 10:09:22

起因是有些初学者常常问到vim,gvim要怎么配置才可以成为一个正式的开发环境。貌似这些天很多人问道这个问题。我就把基本的配置发一下,最近比较 忙。由于本人自己只是使用c/c++,ruby,Mozilla平台,所以其他语言或是开发平台倒是没有思考的很多
:em06
    插件和独立程序
    c.vim
    valgrind.vim
    taglist
    MiniBufExplorer
    Grep
    omni-completion
    SuperTab
    Slippery Snippet ( Textmate-Like )
    clewn(GDB整 合)
    colorschemes(上百中颜色配置)
    ctags
    rail.vim
常见插件下载地址

http://slipperysnippets.blogspot.com/

-----------------------------------------------------------------------------------------
大 家可以把,自己的vim配置分享出来,互相学习。
如果方便的话,最好直接把.vim文件夹打包一份。
想想放在哪儿好?回头看看我的主页方 便不,可能要翻墙 :em06
-----------------------------------------------------------------------------------------
标 有颜色的表示不是必须的插件。
加了个查字典的功能,gui和cli时候分别调用不同的字典工具。
-----------------------------------------------------------------------------------------
有 注释的我就不多说了

"2008年 09月 21日 星期日 01:11:28 CST

"
在处理未保存或只读文件的时候,弹出确认 set confirm " 带有如下符号的单词不要被换行分割
set iskeyword+=_,$,@,%,#,-

"
Tlist 和 wm的设置
" 命令模式输入wm打开Tlist和WM
set showcmd

"
Taglist插件的设置
let g:Tlist_Use_Right_Window=1
let g:Tlist_Show_One_File=1
let g:Tlist_Compact_Format=1
let Tlist_Exit_OnlyWindow=1
let g:winManagerWindowLayout='FileExplorer|TagList'

"Tree explorer的设置
let g:treeExplVertical=1
let g:treeExplWinSize=30

"
gvim打开以后最大化
"au GUIEnter * simalt ~x

"
光标在窗口上下边界时距离边界7行即开始滚屏
set so=7

" 配色
"
Avoid clearing hilight definition in plugins
if !exists("g:vimrc_loaded")

  " color scheme
  if has("
gui_running")
    set guioptions-=T "
隐藏工具栏
    set guioptions-=m
    set guioptions-=L
    set guioptions-=r
    color blackboard
    "colorscheme professional
    "
set guifont=YaHeiConsolasHybrid\ 13
    set guifont=Monaco\ 13
    "中文字体
    set guifontset=Microsoft\ YaHei\ 13
    "
对于html,xml文件,通过ctrl+_来closetag
    if has("autocmd")
      autocmd FileType text,xml,html,perl,shell,bash,python,vim,php,ruby color blackboard
      autocmd FileType xml,html vmap <C-o> <ESC>'o'>o-->
      autocmd FileType java,c,cpp,cs color desertEx
      autocmd FileType html,text,php,vim,c,java,xml,bash,shell,perl,python setlocal textwidth=100
      autocmd Filetype html,xml,xsl source ~/.vim/plugin/closetag.vim
    endif " has("autocmd")
  else
    color desert
    "
colorscheme zellner
    "对于html,xml文件,通过ctrl+_来closetag
    if has("
autocmd")
      autocmd FileType xml,html vmap 'o'>o-->
      autocmd FileType html,text,php,vim,c,java,xml,bash,shell,perl,python setlocal textwidth=100
      autocmd Filetype html,xml,xsl source ~/.vim/plugin/closetag.vim
    endif "
has("autocmd")
  endif " has
endif "
exists(...)
"这个是依赖终端的
"
set background=dark

" 显示行号
set number

"
语法高亮度显示
syntax on

"检测文件的类型 开启codesnip
filetype on
filetype plugin on
filetype indent on
set completeopt=longest,menu
set runtimepath+=~/.vim/textmateOnly
set runtimepath+=/home/hunch/.vim/after
so ~/.vim/plugin/supertab.vim
let g:SuperTabDefaultCompletionType="
<C-X><C-O>"

"
鼠标支持
if has('mouse')
  set mouse=a
endif

"缩进相关
"
继承前一行的缩进方式,特别适用于多行注释
"set autoindent

"
为C程序提供自动缩进
"set smartindent

"
使用C样式的缩进
set cindent
 GnuIndent()
  setlocal cinoptions=>4,n-2,{2,^-2,:2,=2,g0,h2,p5,t0,+2,(0,u0,w1,m1
  setlocal shiftwidth=2
  setlocal tabstop=8
endfunction

au FileType c,cpp setlocal cinoptions=:0,g0,(0,w1 shiftwidth=4 tabstop=4 softtabstop=4
au FileType diff setlocal shiftwidth=4 tabstop=4
au FileType html setlocal autoindent indentexpr=
au FileType changelog setlocal textwidth=76

" Recognize standard C++ headers
au BufEnter /usr/include/c++/* setf cpp
au BufEnter /usr/include/g++-3/* setf cpp

"
Setting for files following the GNU coding standard
au BufEnter /usr


阅读(3477) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~