1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
| "显示行号 set nu
"启动时隐去援助提示 set shortmess=atI
"语法高亮 syntax on
"不需要备份 set nobackup
set nocompatible
"没有保存或文件只读时弹出确认 set confirm
"鼠标可用 set mouse=a
"tab缩进 set tabstop=4 set shiftwidth=4 set expandtab set smarttab
"文件自动检测外部更改 set autoread
"c文件自动缩进 set cindent
"自动对齐 set autoindent
"智能缩进 set smartindent
"高亮查找匹配 set hlsearch
"显示匹配 set showmatch
"显示标尺,就是在右下角显示光标位置 set ruler
"去除vi的一致性 set nocompatible
"设置键盘映射,通过空格设置折叠 nnoremap <space> @=((foldclosed(line('.')<0)?'zc':'zo'))<CR> """""""""""""""""""""""""""""""""""""""""""""" "不要闪烁 set novisualbell
"启动显示状态行 set laststatus=2
"浅色显示当前行 autocmd InsertLeave * se nocul
"用浅色高亮当前行 autocmd InsertEnter * se cul
"显示输入的命令 set showcmd
"被分割窗口之间显示空白 set fillchars=vert:/ set fillchars=stl:/ set fillchars=stlnc:/
" vundle 环境设置 filetype off set rtp+=~/.vim/bundle/Vundle.vim "vundle管理的插件列表必须位于 vundle call vundle Plugin 'VundleVim/Vundle.vim' Plugin 'altercation/vim-colors-solarized' Plugin 'tomasr/molokai' Plugin 'vim-scripts/phd' Plugin 'Lokaltog/vim-powerline' Plugin 'octol/vim-cpp-enhanced-highlight' Plugin 'Raimondi/delimitMate' " 插件列表结束 call vundle#end() filetype plugin indent on
" 配色方案 set background=dark colorscheme torte "colorscheme molokai "colorscheme phd
" 禁止显示菜单和工具条 set guioptions-=m set guioptions-=T
" 总是显示状态栏 set laststatus=2
" 禁止折行 set nowrap
" 设置状态栏主题风格 let g:Powerline_colorscheme='solarized256'
syntax keyword cppSTLtype initializer_list
" 基于缩进或语法进行代码折叠 "set foldmethod=indent set foldmethod=syntax " 启动 vim 时关闭折叠代码 set nofoldenable
"允许用退格键删除字符 set backspace=indent,eol,start
"编码设置 set encoding=utf-8
"共享剪切板 set clipboard=unnamed
" Don't write backup file if vim is being called by "crontab -e" au BufWrite /private/tmp/crontab.* set nowritebackup nobackup " Don't write backup file if vim is being called by "chpass" au BufWrite /private/etc/pw.* set nowritebackup nobackup
|