备份一下自己用的vimrc

" All system-wide defaults are set in $VIMRUNTIME/archlinux.vim (usually just
" /usr/share/vim/vimfiles/archlinux.vim) and sourced by the call to :runtime
" you can find below.  If you wish to change any of those settings, you should
" do it in this file (/etc/vimrc), since archlinux.vim will be overwritten
" everytime an upgrade of the vim packages is performed.  It is recommended to
" make changes after sourcing archlinux.vim since it alters the value of the
" 'compatible' option.

" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages.
runtime! archlinux.vim

" If you prefer the old-style vim functionalty, add 'runtime! vimrc_example.vim'
" Or better yet, read /usr/share/vim/vim74/vimrc_example.vim or the vim manual
" and configure vim to your own liking!
"让vim在不兼容模式下工作
set nocp
"突出显示行
set cursorline
"突出显示列
set cursorcolumn
"语法高亮
if has("syntax")
    syntax on
endif
"配色方案/usr/share/vim/vim74/colors目录下
colorscheme desert 
"检测文件类型
filetype on
filetype plugin indent on
"if using a dark background within the editing area and syntax highlighting
"turn on this option as well
set background=dark
set autoindent "设置自动对齐(缩进):既每行的缩进值与上一行相等,使用noautoindent取消设置
set smartindent "智能对齐方式
set tabstop=4 "设置制表符(tab键)的宽度
set softtabstop=4 "设置软制表符的宽度
set shiftwidth=4 "(自动)缩进使用4个空格
set cindent "使用c/c++ 语言的自动缩进方式
set cinoptions={0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s "设置c/c++语言的具体缩进方式
"set backspace=2 "设置退格键可用
set showmatch "设置匹配模式,显示匹配的括号
set linebreak "整词换行
set whichwrap=b,s,<,>,[,] "光标从行首和行末时可以跳到另一行去
"set hidden "隐藏缓冲区就被抛弃时
"set mouse=a "Enable mouse usage (all modes) 使用鼠标
set number "显示行号
set previewwindow "标识预览窗口
set history=50 "历史记录50条

"状态行设置
set laststatus=2 " 总显示最后一个窗口的状态行;设为1则窗口数多于一个的时候显示最后一个窗口的状态行;0不显示最后一个窗口的状态行
set ruler  " 标尺,用于显示光标位置的行号和列号,逗号分隔。每个窗口都有自己的标尺。如果窗口有状态行,标尺在那里显示。否则,它显示在屏幕的最后一行上。

"--命令行设置--
set showcmd            " 命令行显示输入的命令
set showmode        " 命令行显示vim当前模式

"查找设置
set incsearch        " 输入字符串就显示匹配点
set hlsearch
"--ctags setting--
"按下F5重新生成tag文件,并更新taglist
map <F5> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR><CR> :TlistUpdate<CR>
imap <F5> <ESC>:!ctags -R --c++-kinds=+p --fields=+iaS--extra=+q .<CR><CR> :TlistUpdate<CR>
set tags=tags
set tags+=./tags "add current directory's generated tags file 
"set tags+=~/arm/linux-2.6.24.7/tags "add new tags file(刚刚生成tags的路径,在ctags -R 生成tags文件后,不要将tags移动到别的目录,否则ctrl+]时,会提示找不到源码文件)

"--Taglist--
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
"--winmanager--
let g:winManagerWindowLayout='FileExplorer|TagList'
let g:persistentBehaviour=0 "如果所有编辑文件都关闭了,退出vim
"设置组合键w+m
nmap <silent>wm :WMToggle<CR>
"--cscope--
set cscopequickfix=s-,c-,d-,i-,t-,e-
"--bufexplorer--
noremap <silent> <F11> :BufExplorer<CR>
"--supertab--
let g:SuperTabDefaultCompletionType="context" 
"--omnicppcomplete--
" 按下F3自动补全代码,注意该映射语句后不能有其他字符,包括tab;否则按下F3会自动补全一些乱码
imap <F3> <C-X><C-O>
" 按下F2根据头文件内关键字补全
imap <F2> <C-X><C-I>
"set completeopt=menu,menuone " 关掉智能补全时的预览窗口
set completeopt=longest,menu
let OmniCpp_MayCompleteDot = 1 " autocomplete with .
let OmniCpp_MayCompleteArrow = 1 " autocomplete with ->
let OmniCpp_MayCompleteScope = 1 " autocomplete with ::
let OmniCpp_SelectFirstItem = 2 " select first item (but don't insert)
let OmniCpp_NamespaceSearch = 2 " search namespaces in this and included files
let OmniCpp_ShowPrototypeInAbbr = 1 "show function prototype in popup window
let OmniCpp_GlobalScopeSearch=1 " enable the global scope search
let OmniCpp_DisplayMode=1 "Class scope completion mode:always show all members
let OmniCpp_DefaultNamespaces=["std"]
let OmniCpp_ShowScopeInAbbr=1 " show scope in abbreviation and remove the last column
let OmniCpp_ShowAccess=1