码迷,mamicode.com
首页 > 其他好文 > 详细

vi 配置文件

时间:2014-10-11 21:38:26      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   io   os   使用   ar   for   文件   

  1 "************************************
  2 "          一般性配置                *
  3 "************************************
  4 
  5 "关闭vim一致性原则
  6 set nocompatible
  7 
  8 "显示行号
  9 set number
 10 
 11 "设置在编辑过程中右下角显示光标的行列信息
 12 set ruler
 13 
 14 "在状态栏显示正在输入的命令
 15 set showcmd
 16 
 17 "设置历史记录条数
 18 set history=1000
 19 
 20 "设置取消备份 禁止临时文件的生成
 21 set nobackup
 22 set noswapfile
 23 
 24 "设置匹配模式
 25 set showmatch
 26 
 27 "设置C/C++方式自动对齐
 28 set autoindent
 29 set cindent
 30 
 31 "开启语法高亮功能
 32 syntax enable
 33 syntax on
 34 
 35 "指定配色方案为256色
 36 set t_Co=256
 37 
 38 "设置搜索时忽略大小写
 39 set ignorecase
 40 
 41 "配置backspace的工作方式
 42 set backspace=indent,eol,start
 43 
 44 "设置在vim中可以使用鼠标
 45 set mouse=a
 46 
 47 "设置tab宽度
 48 set tabstop=4
 49 
 50 "设置自动对齐空格数
 51 set shiftwidth=4
 52 
 53 "设置退格键时可以删除4个空格
 54 set smarttab
 55 set softtabstop=4
 56 
 57 "将tab键自动转换为空格
 58 set expandtab
 59 
 60 "设置编码方式
 61 set encoding=utf-8
 62 
 63 "自动判断编码时 依次尝试以下编码
 64 set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
 65 
 66 "检测文件类型
 67 filetype on
 68 
 69 "针对不同的文件采取不同的缩进方式
 70 filetype indent on
 71 
 72 "允许插件
 73 filetype plugin on
 74 
 75 "启动智能补全
 76 filetype plugin indent on
 77 
 78 
 79 "*********************************************************
 80 "                  vundle 配置                           *
 81 "*********************************************************
 82 
 83 set rtp+=~/.vim/bundle/vundle/
 84 call vundle#rc()
 85  
 86 " let Vundle manage Vundle
 87 Bundle gmarik/vundle
 88   
 89 " My Bundles here:
 90 
 91 Bundle tpope/vim-fugitive
 92 Bundle Lokaltog/vim-easymotion
 93 Bundle rstacruz/sparkup, {rtp: vim/}
 94 Bundle tpope/vim-rails.git
 95 Bundle taglist.vim
 96 Bundle The-NERD-tree
 97 Bundle Syntastic
 98 Bundle L9
 99 Bundle FuzzyFinder
100 Bundle Lokaltog/vim-powerline
101 Bundle Valloric/YouCompleteMe 
102    
103 
104 "*****************************************************
105 "                   taglist配置                      *
106 "*****************************************************
107 
108 "不显示"press F1 to display help"
109 let Tlist_Compact_Format=1
110 
111 "窗口在左侧显示
112 let Tlist_Use_Right_Window=1
113 
114 "只显示当前文件的tags
115 let Tlist_Show_One_File=1  
116 
117 "高亮显示
118 let Tlist_Auto_Highlight_tag=1
119 
120 "随文件自动更新
121 let Tlist_Auto_Update=1
122 
123 "设置宽度
124 let Tlist_WinWidth=30       
125 
126 "taglist窗口是最后一个窗口,则退出vim
127 let Tlist_Exit_OnlyWindow=1 
128 
129 "单击跳转
130 let Tlist_Use_SingClick=1
131 
132 "打开关闭快捷键
133 nnoremap <silent> <F8> :TlistToggle<CR>
134 
135 
136 
137 
138 "********************************************************
139 "                      NERD_Tree 配置                   *
140 "********************************************************
141 
142 "显示增强
143 let NERDChristmasTree=1
144 
145 "自动调整焦点
146 let NERDTreeAutoCenter=1
147 
148 "鼠标模式:目录单击,文件双击
149 let NERDTreeMouseMode=2
150 
151 "打开文件后自动关闭
152 let NERDTreeQuitOnOpen=1
153 
154 "显示文件
155 let NERDTreeShowFiles=1
156 
157 "显示隐藏文件
158 let NERDTreeShowHidden=1
159 
160 "高亮显示当前文件或目录
161 let NERDTreeHightCursorline=1
162 
163 "显示行号
164 let NERDTreeShowLineNumbers=1
165 
166 "窗口位置
167 let NERDTreeWinPos=left
168 
169 "窗口宽度
170 let NERDTreeWinSize=31
171 
172 "不显示‘Bookmarks‘ label ‘Press ? for help‘
173 let NERDTreeMinimalUI=1
174 
175 "快捷键
176 nnoremap <silent> <F4> :NERDTreeToggle<CR>
177 
178 
179 
180 "*****************************************************
181 "           YouCompleteMe配置                        *
182 "*****************************************************
183 
184 "leader映射为逗号“,”
185 let mapleader = ","  
186 
187 "配置默认的ycm_extra_conf.py
188 let g:ycm_global_ycm_extra_conf = ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py 
189  
190 "按,jd 会跳转到定义
191 nnoremap <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR>   
192 
193 "打开vim时不再询问是否加载ycm_extra_conf.py配置
194 let g:ycm_confirm_extra_conf=0   
195 
196 "使用ctags生成的tags文件
197 let g:ycm_collect_identifiers_from_tag_files = 1 
198 
199 
200 "*****************************************************
201 "           Syntastic配置                            *
202 "*****************************************************
203 
204 
205 let g:Syntastic_check_on_open=1

 

vi 配置文件

标签:style   blog   color   io   os   使用   ar   for   文件   

原文地址:http://www.cnblogs.com/lingduwangjue/p/4019657.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!