-filetype off
-set runtimepath& " reset rtp
-" remove all autocommands
-autocmd!
-
-set runtimepath+=$XDG_DATA_HOME/vim/vundle
-call vundle#rc('$XDG_DATA_HOME/vim')
-
-Plugin 'gmarik/vundle'
-
-Plugin 'airblade/vim-gitgutter'
-Plugin 'bling/vim-airline'
-Plugin 'derekwyatt/vim-fswitch'
-Plugin 'elzr/vim-json'
-Plugin 'firef0x/pkgbuild.vim'
-Plugin 'flazz/vim-colorschemes'
-Plugin 'junegunn/vim-easy-align'
-Plugin 'justinmk/vim-sneak'
-Plugin 'klen/python-mode'
-Plugin 'kshenoy/vim-signature'
-Plugin 'majutsushi/tagbar'
-Plugin 'octol/vim-cpp-enhanced-highlight'
-Plugin 'raimondi/delimitmate'
-Plugin 'scrooloose/syntastic'
-Plugin 'shougo/unite.vim'
-Plugin 'shougo/vimproc.vim'
-Plugin 'sjl/gundo.vim'
-Plugin 'tomtom/tcomment_vim'
-Plugin 'tpope/vim-abolish'
-Plugin 'tpope/vim-endwise'
-Plugin 'tpope/vim-fugitive'
-Plugin 'tpope/vim-repeat'
-Plugin 'tpope/vim-surround'
-Plugin 'tpope/vim-unimpaired'
-Plugin 'valloric/youcompleteme'
-Plugin 'vim-scripts/replacewithregister'
-Plugin 'vim-scripts/yankring.vim'
-
-" snippets
-Plugin 'sirver/ultisnips'
-Plugin 'honza/vim-snippets'
+call plug#begin('$XDG_DATA_HOME/vim')
+" This does not update vim-plug, use PlugUpgrade instead
+Plug 'junegunn/vim-plug'
+
+if !has("nvim")
+ Plug 'bling/vim-airline' " {{{2
+ let g:airline#extensions#whitespace#enabled = 1
+ let g:airline#extensions#tabline#enabled = 1
+ let g:airline#extensions#searchcount#enabled = 0
+ let g:airline_powerline_fonts = 1
+
+ let g:asyncrun_status = "stopped"
+ " let g:airline_section_error = airline#section#create_right(['%{g:asyncrun_status}'])
+ "}}}
+ Plug 'raimondi/delimitmate' " {{{2
+ let delimitMate_expand_cr = 2
+ let g:delimitMate_expand_space = 1
+ "}}}
+ Plug 'tpope/vim-surround' "{{{2
+ "}}}
+ " Plug 'valloric/youcompleteme' {{{2
+ Plug 'valloric/youcompleteme',
+ \{ 'do': './install.py --clangd-completer --clang-completer' }
+ let g:ycm_clangd_binary_path = 'clangd' " use clangd in path
+ let g:ycm_clangd_args = ['--clang-tidy']
+ let g:ycm_extra_conf_vim_data = ['getcwd()']
+ let g:ycm_add_preview_to_completeopt = 1
+ let g:ycm_complete_in_comments = 1
+ let g:ycm_complete_in_strings = 1
+ let g:ycm_autoclose_preview_window_after_insertion = 0
+
+ let g:ycm_language_server =
+ \ [
+ \ {
+ \ 'name': 'haskell',
+ \ 'cmdline': [ 'haskell-language-server-wrapper', '--lsp' ],
+ \ 'filetypes': [ 'haskell', 'lhaskell' ]
+ \ },
+ \ ]
+ " }}}
+ Plug 'svermeulen/vim-yoink' " {{{2
+ ""}}}
+ Plug 'arcticicestudio/nord-vim' " {{{2
+ let g:nord_bold = 1
+ let g:nord_italic = 1
+ let g:nord_italic_comments = 1
+ let g:nord_underline = 1
+ let g:nord_uniform_status_lines = 0
+ let g:nord_uniform_diff_background = 0
+ let g:nord_cursor_line_number_background = 0
+ let g:nord_bold_vertical_split_line = 0
+ "}}}
+ Plug 'sirver/ultisnips' " replaced by lua-snip {{{2
+ Plug 'honza/vim-snippets'
+ let g:UltiSnipsEditSplit = 'vertical'
+ let g:UltiSnipsSnippetDirectories = [ expand("$XDG_CONFIG_HOME/vim/ultisnips") ]
+ if has('fname_case')
+ let g:UltiSnipsSnippetDirectories = ["UltiSnips", "ultisnips"]
+ endif
+ let g:UltiSnipsExpandTrigger = "<tab>"
+ let g:UltiSnipsJumpForwardTrigger = "<tab>"
+ let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"
+
+ " UltiSnips completion function that tries to expand a snippet. If there's no
+ " snippet for expanding, it checks for completion window and if it's shown,
+ " selects first element. If there's no completion window it tries to jump to
+ " next placeholder. If there's no placeholder it just returns TAB key
+ " https://github.com/Valloric/YouCompleteMe/issues/36#issuecomment-15451411
+ function! g:UltiSnips_Complete()
+ call UltiSnips#ExpandSnippet()
+ if g:ulti_expand_res == 0
+ if pumvisible()
+ return "\<C-n>"
+ else
+ call UltiSnips#JumpForwards()
+ if g:ulti_jump_forwards_res == 0
+ return "\<TAB>"
+ endif
+ endif
+ endif
+ return ""
+ endfunction
+ au InsertEnter * exec "inoremap <silent> " . g:UltiSnipsExpandTrigger . " <C-R>=g:UltiSnips_Complete()<cr>"
+ let g:UltiSnipsListSnippets="<c-e>"
+ "}}}
+ Plug 'vim-utils/vim-man' " replaced by builtin {{{2
+ let g:man_width = 80
+ "}}}
+ Plug 'airblade/vim-gitgutter' " replaced by gitsigns {{{
+ " prefer other signs such as ycm diags
+ let g:gitgutter_sign_priority = 1
+ " don't clobber other signs
+ let g:gitgutter_sign_allow_clobber = 0
+ "}}}
+ Plug 'justinmk/vim-sneak' " replaced by leap {{{2
+ let g:sneak#streak = 1
+ let g:sneak#target_labels = "aoeuisnthdpylrcgfqjkxzmwvz" " dvorak
+ let g:sneak#use_ic_scs = 1 " follow 'ignorecase' and 'smartcase'
+
+ " sneaky f and t
+ nmap f <Plug>Sneak_f
+ nmap F <Plug>Sneak_F
+ xmap f <Plug>Sneak_f
+ xmap F <Plug>Sneak_F
+ omap f <Plug>Sneak_f
+ omap F <Plug>Sneak_F
+ nmap t <Plug>Sneak_t
+ nmap T <Plug>Sneak_T
+ xmap t <Plug>Sneak_t
+ xmap T <Plug>Sneak_T
+ omap t <Plug>Sneak_t
+ omap T <Plug>Sneak_T
+ "}}}
+ Plug 'shougo/unite.vim' " replaced by telescope {{{2
+ function! UniteSetup()
+ call unite#filters#matcher_default#use(['matcher_fuzzy'])
+ call unite#custom#profile('default', 'context', {
+ \ 'winheight': 20,
+ \ 'direction': 'botright'
+ \ })