update vim ocnf
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
" set the runtime path to include Vundle and initialize
|
||||
set rtp+=~/.fzf/
|
||||
set nocompatible
|
||||
filetype off
|
||||
set rtp+=~/.vim/bundle/Vundle.vim
|
||||
call vundle#begin()
|
||||
|
||||
@@ -7,8 +9,8 @@ Plugin 'VundleVim/Vundle.vim'
|
||||
|
||||
|
||||
Plugin 'junegunn/fzf.vim'
|
||||
nmap <Leader>l :BLines
|
||||
nmap <Leader>L :Lines
|
||||
nmap <Leader>l :BLines
|
||||
nmap <Leader>L :Lines
|
||||
|
||||
Plugin 'rking/ag.vim'
|
||||
|
||||
@@ -66,8 +68,8 @@ Plugin 'https://github.com/tpope/vim-fugitive.git'
|
||||
Plugin 'airblade/vim-gitgutter'
|
||||
set updatetime=100
|
||||
|
||||
Plugin 'https://github.com/plytophogy/vim-virtualenv.git'
|
||||
let g:virtualenv_directory = '~/.virtualenv'
|
||||
"Plugin 'https://github.com/plytophogy/vim-virtualenv.git'
|
||||
"let g:virtualenv_directory = '~/.virtualenv'
|
||||
|
||||
Plugin 'godlygeek/tabular'
|
||||
Plugin 'plasticboy/vim-markdown'
|
||||
@@ -78,22 +80,20 @@ Plugin 'Valloric/YouCompleteMe'
|
||||
set runtimepath+=~/.vim/bundle/YouCompleteMe
|
||||
autocmd InsertLeave * if pumvisible() == 0|pclose|endif "离开插入模式后自动关闭预览窗口"
|
||||
let g:ycm_collect_identifiers_from_tags_files = 1 " 开启 YCM基于标签引擎
|
||||
let g:ycm_collect_identifiers_from_comments_and_strings = 1 " 注释与字符串中的内容也用于补全
|
||||
"let g:syntastic_ignore_files=[".*\.py$"]
|
||||
let g:ycm_seed_identifiers_with_syntax = 1 " 语法关键字补全
|
||||
let g:ycm_complete_in_comments = 1
|
||||
let g:ycm_confirm_extra_conf = 0 " 关闭加载.ycm_extra_conf.py提示
|
||||
let g:ycm_key_list_select_completion = ['<c-n>', '<Down>'] " 映射按键,没有这个会拦截掉tab, 导致其他插件的tab不能用.
|
||||
let g:ycm_key_list_previous_completion = ['<c-p>', '<Up>']
|
||||
let g:ycm_complete_in_comments = 1 " 在注释输入中也能补全
|
||||
let g:ycm_complete_in_strings = 1 " 在字符串输入中也能补全
|
||||
let g:ycm_collect_identifiers_from_comments_and_strings = 1 " 注释和字符串中的文字也会被收入补全
|
||||
"let g:ycm_global_ycm_extra_conf='~/.vim/bundle/YouCompleteMe/third_party/ycmd/.ycm_extra_conf.py'
|
||||
let g:ycm_global_ycm_extra_conf='~/.vim/.ycm_extra_conf.py'
|
||||
let g:ycm_global_ycm_extra_conf='~/.vim/bundle/YouCompleteMe/third_party/ycmd/.ycm_extra_conf.py'
|
||||
"let g:ycm_global_ycm_extra_conf='~/.vim/.ycm_extra_conf.py'
|
||||
let g:ycm_show_diagnostics_ui = 0 " 禁用语法检查
|
||||
"inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>" " 回车即选中当前项
|
||||
nnoremap <c-d> :YcmCompleter GoToDefinitionElseDeclaration<CR> " 跳转到定义处
|
||||
let g:ycm_min_num_of_chars_for_completion=2
|
||||
let g:ycm_min_num_of_chars_for_completion=2
|
||||
|
||||
"python auto complete plugin
|
||||
Bundle 'davidhalter/jedi-vim'
|
||||
@@ -109,6 +109,12 @@ let g:closetag_filenames = '*.html,*.xhtml,*.phtml,*.launch'
|
||||
Plugin 'jiangmiao/auto-pairs'
|
||||
|
||||
|
||||
Plugin 'Chiel92/vim-autoformat'
|
||||
noremap <F6> :Autoformat<CR>:w<CR>
|
||||
let g:autoformat_verbosemode=1
|
||||
|
||||
|
||||
|
||||
Plugin 'vim-airline/vim-airline'
|
||||
Plugin 'vim-airline-themes'
|
||||
let g:airline_theme='bubblegum'
|
||||
@@ -143,26 +149,26 @@ map <leader>8 :b 8<CR>
|
||||
map <leader>9 :b 9<CR>
|
||||
map q :bwipeout<CR>
|
||||
|
||||
nmap J 5j
|
||||
nmap K 5k
|
||||
nmap H 5h
|
||||
nmap L 5l
|
||||
nmap J 5j
|
||||
nmap K 5k
|
||||
nmap H 5h
|
||||
nmap L 5l
|
||||
|
||||
nnoremap <c-h> <c-w>h
|
||||
nnoremap <c-l> <c-w>l
|
||||
nnoremap <c-j> <c-w>j
|
||||
nnoremap <c-k> <c-w>k
|
||||
nnoremap <c-h> <c-w>h
|
||||
nnoremap <c-l> <c-w>l
|
||||
nnoremap <c-j> <c-w>j
|
||||
nnoremap <c-k> <c-w>k
|
||||
|
||||
|
||||
|
||||
" ctags 配置
|
||||
" ctags 配置
|
||||
map <F4> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --languages=Python,C++ -f .tags .<CR><CR>
|
||||
imap <F4> <ESC>:!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --languages=Python,C++ -f .tags .<CR><CR>
|
||||
set tags=tags
|
||||
set tags+=.tags
|
||||
set tags+=./.tags
|
||||
"set tags+=~/.vim/systags
|
||||
"set tags =
|
||||
"set tags =
|
||||
|
||||
Plugin 'https://github.com/majutsushi/tagbar.git'
|
||||
"ctags 配置:F3快捷键显示程序中的各种tags,包括变量和函数等。
|
||||
@@ -173,7 +179,7 @@ Plugin 'The-NERD-tree'
|
||||
let NERDTreeIgnore=['\.pyc','\~$','\.swp']
|
||||
"NERDTree 配置:F2快捷键显示当前目录树
|
||||
map <F2> :NERDTreeToggle<CR>
|
||||
let NERDTreeWinSize=25
|
||||
let NERDTreeWinSize=25
|
||||
Plugin 'tiagofumo/vim-nerdtree-syntax-highlight'
|
||||
Plugin 'Xuyuanp/nerdtree-git-plugin'
|
||||
"Plugin 'ryanoasis/vim-devicons'
|
||||
@@ -221,7 +227,7 @@ func! CompileRunGcc()
|
||||
exec '!g++ % -o %<'
|
||||
exec '!time ./%<'
|
||||
elseif &filetype == 'cpp'
|
||||
exec '!g++ % -o %<'
|
||||
exec '!g++ % -o %< -lboost_system'
|
||||
exec '!time ./%<'
|
||||
elseif &filetype == 'python'
|
||||
exec '!time python %'
|
||||
@@ -276,9 +282,9 @@ set nobackup
|
||||
set noswapfile
|
||||
"搜索忽略大小写
|
||||
set ignorecase
|
||||
" 搜索时忽略大小写,但在有一个或以上大写字母时仍大小写敏感
|
||||
set ignorecase
|
||||
set smartcase
|
||||
" 搜索时忽略大小写,但在有一个或以上大写字母时仍大小写敏感
|
||||
set ignorecase
|
||||
set smartcase
|
||||
|
||||
|
||||
"搜索逐字符高亮
|
||||
@@ -324,9 +330,9 @@ map <space>mc :set mouse=c<CR>:set nu!<CR>:set paste<CR>
|
||||
set mouse=a
|
||||
|
||||
" 选中状态下 Ctrl+c 复制
|
||||
vnoremap <c-c> "+y
|
||||
|
||||
" Ctrl+v
|
||||
vnoremap <c-c> "+y
|
||||
|
||||
" Ctrl+v
|
||||
"nmap <silent> <C-v> "+p
|
||||
|
||||
|
||||
@@ -345,7 +351,7 @@ set scrolloff=3
|
||||
" 为C程序提供自动缩进
|
||||
set smartindent
|
||||
" 高亮显示普通txt文件(需要txt.vim脚本)
|
||||
au BufRead,BufNewFile * setfiletype txt
|
||||
au BufRead,BufNewFile * setfiletype txt
|
||||
filetype plugin indent on
|
||||
"打开文件类型检测, 加了这句才可以用智能补全
|
||||
set completeopt=longest,menu
|
||||
@@ -364,7 +370,7 @@ fun! CleanExtraSpaces()
|
||||
silent! %s/\s\+$//e
|
||||
call setpos('.', save_cursor)
|
||||
call setreg('/', old_query)
|
||||
endfun
|
||||
endfun
|
||||
|
||||
if has("autocmd")
|
||||
autocmd BufWritePre *.txt,*.js,*.py,*.wiki,*.sh,*.coffee,*.vue :call CleanExtraSpaces()
|
||||
|
||||
Reference in New Issue
Block a user