Vimrc配置(个人)

"设置新文件的编码为UTF-8,自动判断编码时,依次尝试以下编码:
set fileencoding=utf-8 fileencodings=ucs-bom,utf-9,cp936,GBK,GB18030,GB2312


"显示行号,设定tab长度为4:
set tabstop=4
set number
syntax enable 
syntax on
"由于本身的模板生成器产生一些头文件,comment.vim用于覆盖它们或是连接它们
"具体模板生成器调用那些文件,仍需要查找
let g:enable_template = 1
let g:template_dir = $HOME.'/.vim/template'


let g:C_SourceCodeExtensions  = '' "取消c.vim插件的文件头功能,将由自定义模板代替
"由自定义的template.vim插件代替
"设置复制为ctrl+c,并处于系统剪贴板


"窗口操作的快捷键
nmap wv <c-w>v      " 垂直分割当前窗口
nmap wc <c-w>c		"关闭当前窗口
nmap ws <c-w>s		"水平分割当前窗口


set autochdir "自动设置目录为正在编辑的文件所在的目录
filetype plugin indent on "使用智能补全
filetype indent on  "针对不同的文件采用不同的缩进方式
filetype plugin on  "允许插件
set smartindent


map <F12> gg=G  "将内容进行indent
map <F2>  :tabnew<CR>
map <F3> :tabnew .<CR>  "列出当前目录文件
map <c-k> :%s/\s*/ /<CR>  "删除空行,为了不删除变量之间的空行,留一个空行
"我们将自己写的comment.vim放到.vim的plugin目录下,因为它需要开启filetype模式,而
"vundle需要关闭它,为了不引起冲突,虽然它很短,我们只好把它当插件一样使用。
"以下直接从Vundle的git项目拷贝。
set nocompatible  " be iMproved
filetype off  " required!


set rtp+=~/.vim/bundle/vundle/
call vundle#rc()


" let Vundle manage Vundle
" required! 
Bundle 'gmarik/vundle'


" My bundles here:
"
" original repos on GitHub
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
Bundle 'tpope/vim-rails.git'
" vim-scripts repos
Bundle 'L9'
Bundle 'FuzzyFinder'
Bundle 'Valloric/YouCompleteMe'
Bundle 'Valloric/ListToggle'
Bundle 'scrooloose/syntastic'
Bundle 'scrooloose/nerdcommenter'
filetype plugin indent on     " required!不可以注释,注释后自己写的的comment插件不可以用。
"
" Brief help
" :BundleList          - list configured bundles
" :BundleInstall(!)    - install (update) bundles
" :BundleSearch(!) foo - search (or refresh cache first) for foo
" :BundleClean(!)      - confirm (or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle commands are not allowed.
"
"
" YouCompleteMe
nnoremap <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR>
nnoremap <F5> :YcmForceCompileAndDiagnostics<CR>
let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'
" "Do not ask when starting vim
let g:ycm_confirm_extra_conf = 0 "关闭工程目录加载ycm_extra_conf.py的提示
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_ignore_files=[".*\.py$"] "禁用syntastic来对python检查


" key-mappings for comment line in normal mode
noremap  <silent> <C-C> :call CommentLine()<CR>
" " key-mappings for range comment lines in visual <Shift-V> mode
vnoremap <silent> <A-C> :call RangeCommentLine()<CR>
"
" " key-mappings for un-comment line in normal mode
noremap  <silent> <C-U> :call UnCommentLine()<CR>
" " key-mappings for range un-comment lines in visual <Shift-V> mode
vnoremap <silent> <C-U> :call RangeUnCommentLine()<CR>


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值