vim/plugins.vim

   1 call mkdir(expand('~/.vim/autoload'), 'p')
   2 
   3 if !filereadable(expand('~/.vim/autoload/plug.vim')) " {{{
   4     silent !curl -sfo ~/.vim/autoload/plug.vim
   5     \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
   6 endif " }}}
   7 if !filereadable(expand('~/.vim/autoload/plug.vim')) " {{{
   8     silent !wget -qO ~/.vim/autoload/plug.vim
   9     \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  10 endif " }}}
  11 
  12 call plug#begin('~/.vim/plugins')
  13 
  14 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  15 
  16 Plug 'https://github.com/ctrlpvim/ctrlp.vim'
  17 Plug 'https://github.com/adelarsq/vim-matchit'
  18 Plug 'https://github.com/tpope/vim-commentary'
  19 Plug 'https://github.com/junegunn/vim-peekaboo'
  20 Plug 'https://github.com/nelstrom/vim-visual-star-search'
  21 
  22 let ctrlp_prompt_mappings = {
  23     \ 'AcceptSelection("e")': ['<2-LeftMouse>'],
  24     \ 'AcceptSelection("t")': ['<Cr>', '<C-t>'],
  25 \ }
  26 
  27 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  28 
  29 Plug 'https://github.com/junegunn/gv.vim'
  30 Plug 'https://github.com/jreybert/vimagit'
  31 Plug 'https://github.com/mhinz/vim-signify'
  32 Plug 'https://github.com/tpope/vim-fugitive'
  33 
  34 let signify_sign_show_text = 0
  35 au FileType *git* setl sw=2 fdl=9 nocul
  36 
  37 nnoremap <Leader>G :GV!<Cr>
  38 nnoremap <Leader>g :up \| MagitOnly<Cr>
  39 nnoremap <C-r> :redraw! \| SignifyRefresh<Cr>
  40 
  41 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  42 
  43 Plug 'https://github.com/w0rp/ale'
  44 Plug 'https://github.com/lifepillar/vim-mucomplete'
  45 
  46 let ale_sign_error   = '>'
  47 let ale_sign_warning = '>'
  48 let ale_completion_autoimport = 1
  49 let ale_linters = { 'c': ['gcc'] }
  50 let ale_c_parse_makefile = 1
  51 
  52 let mucomplete#cycle_with_trigger = 1
  53 let mucomplete#enable_auto_at_startup = 1
  54 let mucomplete#minimum_prefix_length  = 1
  55 let mucomplete#always_use_completeopt = 1
  56 let mucomplete#spel#regex = '[a-zA-Zа-яА-Я]'
  57 let mucomplete#chains = { 'default': {
  58     \   'default'  : ['path', 'uspl', 'c-n', 'omni'],
  59     \ '.*string.*' : ['path', 'uspl', 'c-n'],
  60     \ '.*comment.*': ['path', 'uspl', 'c-n'],
  61 \ }}
  62 let mucomplete#can_complete = { 'default': {
  63     \ 'omni': { s -> s =~# '\m\S\%(\k\|\.\|->\|::\)$' },
  64 \ }}
  65 
  66 aut FileType ale-pr* setl wrap
  67 set omnifunc=ale#completion#OmniFunc
  68 
  69 nnoremap <Leader>K :ALEHover<Cr>
  70 nnoremap <Leader>a :ALEToggleBuffer<Cr>
  71 
  72 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  73 
  74 Plug 'https://github.com/ap/vim-css-color'
  75 Plug 'https://github.com/tpope/vim-endwise'
  76 Plug 'https://github.com/habamax/vim-godot'
  77 Plug 'https://github.com/jamessan/vim-gnupg'
  78 Plug 'https://github.com/sheerun/vim-polyglot'
  79 
  80 au FileType gdscript nnoremap <buffer> <F5> :up \| GodotRun<Cr>
  81 au FileType gdscript nnoremap <buffer> <F6> :up \| GodotRunFZF<Cr>
  82 au FileType gdscript nnoremap <buffer> K    :ALEHover<Cr>
  83 
  84 nnoremap <Leader>c :call css_color#toggle()<Cr>
  85 
  86 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  87 
  88 call plug#end()
  89 call ale#linter#Define('gdscript', {
  90     \ 'name': 'godot',  'project_root': 'project.godot',
  91     \ 'lsp' : 'socket', 'address': '127.0.0.1:6008',
  92 \ })
  93