function! Cond(cond, ...) let opts=get(a:000, 0, {}) return a:cond ? opts : extend(opts, { 'on': [], 'for': [] }) endfunction call plug#begin('~/.vim/plugged') " colorschemes Plug 'lifepillar/vim-solarized8' " editorconfig support Plug 'editorconfig/editorconfig-vim' " (un)comment Plug 'tpope/vim-commentary' " handle surroundings Plug 'tpope/vim-surround' " make plugin commands repeatable Plug 'tpope/vim-repeat' " autodetect tabwidth Plug 'tpope/vim-sleuth' " dispatch into tmux panes Plug 'tpope/vim-dispatch', Cond(!empty($TMUX)) " awesome git plugin Plug 'tpope/vim-fugitive' " create gist from within vim Plug 'mattn/gist-vim' | Plug 'mattn/webapi-vim' " autoclose quotes and brackets Plug 'Raimondi/delimitMate' let delimitMate_expand_cr=1 " async linting and making Plug 'neomake/neomake' " tmux support if inside tmux " run cargo in tmux using vimux Plug 'benmills/vimux', Cond(!empty($TMUX)) | Plug 'jtdowney/vimux-cargo', { 'for': 'rust' } " vimux mappings " Prompt for a command map vp :VimuxPromptCommand " Prompt for a make command map vm :VimuxPromptCommand("make ") " Inspect runner pane map vi :VimuxInspectRunner " Close runner map vq :VimuxCloseRunner " Rerun last command map vv :VimuxRunLastCommand " Stop running command map vs :VimuxInterruptRunner " distraction free writing Plug 'junegunn/goyo.vim' " close Goyo *and* vim with :q function! s:goyo_enter() let b:quitting=0 let b:quitting_bang=0 autocmd QuitPre let b:quitting=1 cabbrev q! let b:quitting_bang=1 q! endfunction function! s:goyo_leave() " Quit Vim if this is the only remaining buffer if b:quitting && len(filter(range(1, bufnr('$')), 'buflisted(v:val)')) == 1 if b:quitting_bang qa! else qa endif endif endfunction autocmd! User GoyoEnter call goyo_enter() autocmd! User GoyoLeave call goyo_leave() " highlight unwanted whitespace Plug 'bronson/vim-trailing-whitespace' " fuzzy file finder Plug 'ctrlpvim/ctrlp.vim' " replace text with the content of a register Plug 'vim-scripts/ReplaceWithRegister' " paste with indent adjusted to context Plug 'sickill/vim-pasta' " rust support Plug 'rust-lang/rust.vim', { 'for': 'rust' } " run rustfmt when saving a file let g:rustfmt_autosave=1 " " deoplete for auto completion " if has('nvim') " Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } " else " Plug 'Shougo/deoplete.nvim' " Plug 'roxma/nvim-yarp' " Plug 'roxma/vim-hug-neovim-rpc' " endif " let g:deoplete#enable_at_startup=1 " " deoplete completion for rust " Plug 'sebastianmarkow/deoplete-rust' " let g:deoplete#sources#rust#racer_binary='/usr/bin/racer' " " let g:deoplete#sources#rust#rust_source_path = '$(rustc --print sysroot)/lib/rustlib/src/rust/src' " if executable('rustc') " " if src installed via rustup, we can get it by running " " rustc --print sysroot then appending the rest of the path " let rustc_root = systemlist('rustc --print sysroot')[0] " let rustc_src_dir = rustc_root . '/lib/rustlib/src/rust/src' " if isdirectory(rustc_src_dir) " let g:deoplete#sources#rust#rust_source_path = rustc_src_dir " endif " endif Plug 'neoclide/coc.nvim', {'branch': 'release'} " Plug 'racer-rust/vim-racer', { 'for': 'rust' } " rust autocomplete " let g:racer_cmd = "/usr/bin/racer" " syntax support for many languages Plug 'sheerun/vim-polyglot' " disable latex in polyglot to use vimtex let g:polyglot_disabled=['latex'] " latex support Plug 'lervag/vimtex' " Vimwiki Plug 'vimwiki/vimwiki' let g:vimwiki_list=[{'path': '~/Dokumente/notes', \ 'syntax': 'markdown', \ 'ext': '.md'}] Plug 'antoyo/vim-licenses' let g:licenses_copyright_holders_name='Brandl, Valentin ' let g:licenses_authors_name='Brandl, Valentin ' " haskell support Plug 'neovimhaskell/haskell-vim' " elm support " Plug 'elmcast/elm-vim' " clojure support Plug 'tpope/vim-fireplace' " purescript Plug 'frigoeu/psc-ide-vim' " racket " Plug 'wlangstroth/vim-racket' " Plug 'luochen1990/rainbow' " let g:rainbow_active = 1 " Plug 'vim-scripts/scribble.vim' "" nerdtree file manager "Plug 'scrooloose/nerdtree', { 'on': ['NERDTreeToggle', 'NERDTreeFind'] } "Plug 'Xuyuanp/nerdtree-git-plugin', { 'on': ['NERDTreeToggle', 'NERDTreeFind'] } "" Toggle NERDTree "nmap k :NERDTreeToggle "" expand to the path of the file in the current buffer "nmap y :NERDTreeFind ""autocmd BufWinEnter * NERDTreeMirror "let NERDTreeShowHidden=1 ""let NERDTreeDirArrowExpandable = '▷' ""let NERDTreeDirArrowCollapsible = '▼' "Plug 'ervandew/supertab' " simple autocomplete "Plug 'SirVer/ultisnips' "Plug 'honza/vim-snippets' " Python "Plug 'davidhalter/jedi-vim', { 'for': 'python' } " python autocomplete " Plug 'artur-shaik/vim-javacomplete2' call plug#end()