From e76ae88dfb6225fdc6d64149a538b118df9f4a42 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Sat, 15 Apr 2017 14:41:41 +0200 Subject: [PATCH] Update vim config --- editors/vim/plugins.vim | 15 +++++++++++++-- editors/vim/vimrc | 26 ++++++++++++++++++++++++-- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/editors/vim/plugins.vim b/editors/vim/plugins.vim index a005f7a..671f60d 100644 --- a/editors/vim/plugins.vim +++ b/editors/vim/plugins.vim @@ -28,14 +28,15 @@ Plug 'vim-scripts/ReplaceWithRegister' Plug 'mattn/gist-vim' | Plug 'mattn/webapi-vim' " create gist from within vim Plug 'Raimondi/delimitMate' " autoclose quotes and brackets Plug 'tpope/vim-fugitive' " awesome git plugin -Plug 'scrooloose/nerdtree', { 'on': ['NERDTreeToggle', 'NERDTreeFind'] } -Plug 'Xuyuanp/nerdtree-git-plugin', { 'on': ['NERDTreeToggle', 'NERDTreeFind'] } +Plug 'scrooloose/nerdtree', { 'on': ['NERDTreeToggle', 'NERDTreeFind'] } +Plug 'Xuyuanp/nerdtree-git-plugin', { 'on': ['NERDTreeToggle', 'NERDTreeFind'] } Plug 'ryanoasis/vim-devicons' " icons Plug 'ctrlpvim/ctrlp.vim' " fuzzy file finder Plug 'neomake/neomake' " async linting and making Plug 'benmills/vimux', Cond(!empty($TMUX)) " tmux support Plug 'sickill/vim-pasta' " context aware pasting Plug 'junegunn/goyo.vim' " distraction free writing +Plug 'bronson/vim-trailing-whitespace' " highlight unwanted whitespaces " Python Plug 'davidhalter/jedi-vim', { 'for': 'python' } " python autocomplete @@ -48,6 +49,16 @@ endif Plug 'sheerun/vim-polyglot' " syntax support for many languages +function! BuildYCM(info) + if a:info.status = 'installed' || a:info.force + !./install.py --clang-completer --racer-completer + endif +endfunction + +Plug 'Valloric/YouCompleteMe', { 'do': function('BuildYCM') } + +" Plug 'artur-shaik/vim-javacomplete2' + Plug 'lervag/vimtex' call plug#end() diff --git a/editors/vim/vimrc b/editors/vim/vimrc index 424512f..deee1fb 100644 --- a/editors/vim/vimrc +++ b/editors/vim/vimrc @@ -42,7 +42,9 @@ if has("autocmd") au! " For all text files set 'textwidth' to 78 characters. - autocmd FileType text setlocal textwidth=78 + autocmd FileType text setlocal textwidth=120 + + autocmd FileType tex setlocal foldtext< augroup END @@ -76,7 +78,8 @@ set nolazyredraw set backspace=indent,eol,start set ruler " always show curser position set history=1000 " keep 1000 lines of history -" set textwidth=120 +set textwidth=120 +set colorcolumn=+1 set number " display absolute number of current line set relativenumber " display relative line numbers set cursorline " highlight current line @@ -382,4 +385,23 @@ let g:notes_directories = ['~/Dokumente/Notes'] let g:polyglot_disabled = ['latex'] " disable latex in polyglot to use vimtex +" you complete me +let g:ycm_rust_src_path = '/usr/src/rust/src' +let g:ycm_python_binary_path = 'python' + +" " javacomplete2 +" autocmd FileType java setlocal omnifunc=javacomplete#Complete +" " enable smart (trying to guess import option) inserting class imports with F4 +" nmap (JavaComplete-Imports-AddSmart) +" imap (JavaComplete-Imports-AddSmart) +" " enable smart (trying to guess import option) inserting class imports with F4 +" nmap (JavaComplete-Imports-Add) +" imap (JavaComplete-Imports-Add) +" " add all missing imports with F6 +" nmap (JavaComplete-Imports-AddMissing) +" imap (JavaComplete-Imports-AddMissing) +" " add all missing imports with F6 +" nmap (JavaComplete-Imports-RemoveUnused) +" imap (JavaComplete-Imports-RemoveUnused) + " vim: set filetype=vim ts=8 sw=2 tw=120 noet :