个人使用vim配置,安装YCM(YouCompleteMe,jedi, vundle等插件),具体的配置如下:
execute pathogen#infect()
syntax on
filetype plugin on "{一般设置
set fileencodings=utf-,gbk
set ambiwidth=double set smartindent
set smarttab
set expandtab
set tabstop=
set softtabstop=
set shiftwidth=
set backspace=
set nu
set hls "{折叠代码
set foldmethod=indent
set foldlevel=
nnoremap <space> za
"} "{光标重回上次退出位置
autocmd BufReadPost * if line("'\"") && line("'\"") <= line("$") | exe "normal `\"" | endif "} "{
set nocompatible " be iMproved filetype off " required! /** 从这行开始,vimrc配置 **/ set rtp+=~/.vim/bundle/vundle/ call vundle#rc() "let Vundle manage Vundle " required! Bundle 'gmarik/vundle' " My Bundles here: /* 插件配置格式 */ "BundleInstall " original repos on github (Github网站上非vim-scripts仓库的插件,按下面格式填写)
Bundle 'Valloric/YouCompleteMe'
Bundle 'honza/vim-snippets'
Bundle 'jonathanfilip/lucius'
Bundle 'tomasr/molokai' "Bundle 'tpope/vim-fugitive' "Bundle 'Lokaltog/vim-easymotion' "Bundle 'rstacruz/sparkup', {'rtp': 'vim/'} "Bundle 'tpope/vim-rails.git' " vim-scripts repos (vim-scripts仓库里的,按下面格式填写) "Bundle 'L9' "Bundle 'FuzzyFinder'
"
"" non github repos (非上面两种情况的,按下面格式填写)
"
"Bundle 'git://git.wincent.com/command-t.git'
"
"" ... filetype plugin indent on " required! /** vimrc文件配置结束 **/
"} "{taglist
"let Tlist_Auto_Highlight_Tag=1
"let Tlist_Auto_Open=1
"let Tlist_Auto_Update=1
"let Tlist_Display_Tag_Scope=1
"let Tlist_Exit_OnlyWindow=1
"let Tlist_Enable_Dold_Column=1
"let Tlist_File_Fold_Auto_Close=1
"let Tlist_Show_One_File=1
"let Tlist_Use_Right_Window=1
"let Tlist_Use_SingleClick=1
"nnoremap <silent> <F8> :TlistToggle<CR>
"} let mapleader = ","
let g:mapleader = ","
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType python setlocal completeopt-=preview
autocmd FileType javascrīpt set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete let g:pydiction_location='~/.vim/complete-dict'
set autoindent
set tabstop=
set shiftwidth=
set expandtab
set number "{jedi bundle
let g:jedi#auto_initialization =
let g:jedi#auto_vim_configuration =
let g:jedi#use_tabs_not_buffers =
let g:jedi#use_splits_not_buffers = "left"
let g:jedi#popup_on_dot =
let g:jedi#popup_select_first =
let g:jedi#show_call_signatures = ""
let g:jedi#goto_command = "<leader>d"
let g:jedi#goto_assignments_command = "<leader>g"
let g:jedi#goto_definitions_command = ""
let g:jedi#documentation_command = "K"
let g:jedi#usages_command = "<leader>n"
let g:jedi#completions_command = "<C-Space>"
let g:jedi#rename_command = "<leader>r"
let g:jedi#completions_enabled = "}
"{YouCompleteMe
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/tests/clang/testdata/client_data/' "配置默认的ycm_extra_conf.py
let g:ycm_error_symbol = '>>'
let g:ycm_warning_symbol = '>*'
nnoremap <leader>gl :YcmCompleter GoToDeclaration<CR>
nnoremap <leader>gf :YcmCompleter GoToDefinition<CR>
nnoremap <leader>gg :YcmCompleter GoToDefinitionElseDeclaration<CR>
nmap <F4> :YcmDiags<CR>
"打开vim时不再询问是否加载ycm_extra_conf.py配置
let g:ycm_confirm_extra_conf=
"使用ctags生成的tags文件
let g:ycm_collect_identifiers_from_tag_files =
"python with virtualenv support
py << EOF
import os
import sys
if 'VIRTUAL_ENV' in os.environ:
project_base_dir = os.environ['VIRTUAL_ENV']
activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
execfile(activate_this, dict(__file__=activate_this))
EOF
"}
"
"{界面设置
colorscheme desert
"colorscheme molokai "}