vim/vimrc.plugins.vim

513 lines
12 KiB
VimL
Raw Normal View History

2018-03-17 23:42:49 +00:00
" #plugins{{{
2018-05-21 20:31:43 +00:00
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/bundle')
2018-05-08 21:21:55 +00:00
2018-03-17 23:42:49 +00:00
"css3-syntax
2018-05-21 20:37:33 +00:00
Plug 'hail2u/vim-css3-syntax'
2018-05-08 21:21:55 +00:00
2018-03-17 23:42:49 +00:00
"scss-syntax
2018-05-21 20:31:43 +00:00
Plug 'cakebaker/scss-syntax.vim'
2018-05-08 21:21:55 +00:00
2018-03-17 23:42:49 +00:00
"tagbar
2018-05-21 20:31:43 +00:00
Plug 'majutsushi/tagbar'
2018-05-08 21:21:55 +00:00
2018-03-17 23:42:49 +00:00
"vim-surround
2018-05-21 20:31:43 +00:00
Plug 'tpope/vim-surround'
2018-05-08 21:21:55 +00:00
2018-03-17 23:42:49 +00:00
"undotree
2018-05-21 20:31:43 +00:00
Plug 'mbbill/undotree'
2018-05-08 21:21:55 +00:00
2018-03-17 23:42:49 +00:00
" Ctrlp
2018-05-21 20:31:43 +00:00
Plug 'ctrlpvim/ctrlp.vim'
2018-04-10 12:06:23 +00:00
"
2018-03-17 23:42:49 +00:00
" Obsession
2018-05-21 20:31:43 +00:00
Plug 'tpope/vim-obsession'
2018-05-08 21:21:55 +00:00
2018-03-17 23:42:49 +00:00
" vim-css-color
2018-05-21 20:31:43 +00:00
" Plug 'ap/vim-css-color'
2018-03-17 23:42:49 +00:00
" vim-javascript
2018-05-21 20:31:43 +00:00
Plug 'pangloss/vim-javascript'
2018-05-08 21:21:55 +00:00
2018-03-17 23:42:49 +00:00
" ultisnips
" https://github.com/sirver/UltiSnips
2018-05-21 20:31:43 +00:00
Plug 'SirVer/ultisnips'
2018-03-17 23:42:49 +00:00
" and some snippets
" https://github.com/honza/vim-snippets
2018-06-17 14:14:49 +00:00
" Plug 'honza/vim-snippets'
2018-05-08 21:21:55 +00:00
2018-03-17 23:42:49 +00:00
" ALE
" https://github.com/w0rp/ale
2018-05-21 20:31:43 +00:00
Plug 'w0rp/ale'
2018-05-08 21:21:55 +00:00
2018-03-17 23:42:49 +00:00
" MatchTag
" https://github.com/gregsexton/MatchTag
2018-08-29 18:36:42 +00:00
" DISABLED DUE TO KNOWN ISSUE - https://github.com/gregsexton/MatchTag/issues/40
" Plug 'gregsexton/MatchTag'
2018-05-08 21:21:55 +00:00
2018-03-17 23:42:49 +00:00
" phpcomplete.vim
" https://github.com/shawncplus/phpcomplete.vim
2018-05-21 20:31:43 +00:00
Plug 'shawncplus/phpcomplete.vim'
2018-03-17 23:42:49 +00:00
" https://github.com/dsawardekar/wordpress.vim
" For up to date Wordpress Files see:
" https://github.com/joseluis/wordpress.vim-generator
2018-05-08 21:21:55 +00:00
2018-05-21 20:31:43 +00:00
"Plug 'dsawardekar/wordpress.vim'
2018-03-17 23:42:49 +00:00
" disabled - doesn't support universal ctags?
2018-05-01 22:55:07 +00:00
2018-03-17 23:42:49 +00:00
" vim-vue
" https://github.com/posva/vim-vue
2018-05-21 20:31:43 +00:00
Plug 'posva/vim-vue'
2018-05-08 21:21:55 +00:00
2018-03-17 23:42:49 +00:00
" vim-commentary
" https://github.com/tpope/vim-commentary
2018-05-21 20:31:43 +00:00
Plug 'tpope/vim-commentary'
2018-05-08 21:21:55 +00:00
2018-03-17 23:42:49 +00:00
" vim-repeat
" https://github.com/tpope/vim-repeat
2018-05-21 20:31:43 +00:00
Plug 'tpope/vim-repeat'
2018-05-08 21:21:55 +00:00
2018-03-17 23:42:49 +00:00
" https://github.com/mattn/emmet-vim
2018-05-21 20:31:43 +00:00
Plug 'mattn/emmet-vim'
2018-05-08 21:21:55 +00:00
2018-03-17 23:42:49 +00:00
" vimwiki
" https://github.com/vimwiki/vimwiki
2018-05-21 20:31:43 +00:00
Plug 'vimwiki/vimwiki'
2018-05-08 21:21:55 +00:00
2018-03-17 23:42:49 +00:00
" gitgutter
" https://github.com/airblade/vim-gitgutter/blob/master/README.mkd
2018-05-21 20:31:43 +00:00
Plug 'airblade/vim-gitgutter'
2018-05-08 21:21:55 +00:00
2018-03-17 23:42:49 +00:00
" vim-gutentags
" https://github.com/ludovicchabant/vim-gutentags
2018-05-21 20:31:43 +00:00
Plug 'ludovicchabant/vim-gutentags'
2018-05-08 21:21:55 +00:00
2018-03-20 22:33:41 +00:00
" vim-qlist
" https://github.com/romainl/vim-qlist/
2018-05-21 20:31:43 +00:00
" Plug 'romainl/vim-qlist'
2018-04-10 12:06:23 +00:00
2018-03-28 18:40:46 +00:00
" fugitive-vim
" https://github.com/tpope/vim-fugitive/blob/master/README.markdown
2018-05-21 20:31:43 +00:00
Plug 'tpope/vim-fugitive'
2018-04-10 12:06:23 +00:00
2018-03-28 22:12:45 +00:00
" vim-dispatch
" https://github.com/tpope/vim-dispatch
2018-05-21 20:31:43 +00:00
Plug 'tpope/vim-dispatch'
2018-04-10 12:06:23 +00:00
2018-04-04 16:55:09 +00:00
" colorV
" https://github.com/gu-fan/colorv.vim
2018-05-21 20:31:43 +00:00
Plug 'gu-fan/colorv.vim'
2018-04-10 12:06:23 +00:00
2018-04-07 15:13:06 +00:00
" vim switch
"https://github.com/AndrewRadev/switch.vim
2018-05-21 20:31:43 +00:00
Plug 'AndrewRadev/switch.vim'
2018-03-17 23:42:49 +00:00
2018-04-10 12:16:53 +00:00
" gitv
" https://github.com/gregsexton/gitv
2018-05-21 20:31:43 +00:00
Plug 'gregsexton/gitv'
2018-04-10 12:06:23 +00:00
2018-04-16 21:20:50 +00:00
" wakarime
" https://wakatime.com/vim
2018-05-21 20:31:43 +00:00
Plug 'wakatime/vim-wakatime'
2018-04-16 21:20:50 +00:00
2018-05-08 21:21:55 +00:00
" vim-easy-align
" https://github.com/junegunn/vim-easy-align
2018-05-21 20:31:43 +00:00
Plug 'junegunn/vim-easy-align'
2018-05-08 21:21:55 +00:00
2018-06-19 20:37:38 +00:00
" vim-instant-markdown
" https://github.com/suan/vim-instant-markdown
Plug 'suan/vim-instant-markdown'
2018-05-21 20:31:43 +00:00
" asyncomplete.vim
" https://github.com/prabirshrestha/asyncomplete.vim
2018-06-08 11:23:53 +00:00
" Plug 'prabirshrestha/asyncomplete.vim'
" Plug 'yami-beta/asyncomplete-omni.vim'
" Plug 'prabirshrestha/asyncomplete-ultisnips.vim'
" Plug 'prabirshrestha/asyncomplete-file.vim'
" Plug 'prabirshrestha/asyncomplete-buffer.vim'
" Plug 'prabirshrestha/asyncomplete-tags.vim'
" Plug 'prabirshrestha/asyncomplete-lsp.vim'
" Plug 'Shougo/neco-vim'
" Plug 'prabirshrestha/asyncomplete-necovim.vim'
2018-04-16 21:20:50 +00:00
" vim-lsp
" https://github.com/prabirshrestha/vim-lsp
2018-05-21 20:31:43 +00:00
Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
2018-04-16 21:20:50 +00:00
2018-08-26 15:04:56 +00:00
" inline_edit.vim
" https://github.com/AndrewRadev/inline_edit.vim
Plug 'AndrewRadev/inline_edit.vim'
2018-05-21 20:31:43 +00:00
call plug#end()
2018-03-17 23:42:49 +00:00
"}}}
2018-05-13 19:39:51 +00:00
runtime macros/matchit.vim
2018-03-27 19:17:56 +00:00
2018-03-17 23:42:49 +00:00
" #plugin settings{{{
2018-08-26 15:04:56 +00:00
" inline_edit.vim
let g:inline_edit_patterns = [{
\ 'main_filetype': '*html',
\ 'sub_filetype': 'scss',
\ 'indent_adjustment': 1,
\ 'start': '<style\>[^>]*lang=.scss[^>]*>',
\ 'end': '</style>'
\ }]
2018-08-26 15:32:47 +00:00
let g:inline_edit_autowrite = 1
let g:inline_edit_proxy_type = "tempfile"
let g:inline_edit_new_buffer_command ="tabedit"
let g:inline_edit_modify_statusline = 0
nnoremap <space>ie :InlineEdit<cr>
" asyncomplete.vim
"{{{
2018-06-08 11:23:53 +00:00
" let g:asyncomplete_auto_popup = 0
" let g:asyncomplete_remove_duplicates = 1
" inoremap <silent><expr> <C-l> asyncomplete#force_refresh()
" not working why?
2018-06-08 11:23:53 +00:00
" let g:asyncomplete_min_chars = 3
" augroup User asyncomplete_setup
" autocmd!
" autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif
" augroup END
" call asyncomplete#register_source(asyncomplete#sources#file#get_source_options({
" \ 'name': 'file',
" \ 'whitelist': ['*'],
" \ 'priority': -20,
" \ 'completor': function('asyncomplete#sources#file#completor')
" \ }))
" call asyncomplete#register_source(asyncomplete#sources#ultisnips#get_source_options({
" \ 'name': 'ultisnips',
" \ 'whitelist': ['*'],
" \ 'priority': -30,
" \ 'completor': function('asyncomplete#sources#ultisnips#completor'),
" \ }))
" call asyncomplete#register_source(asyncomplete#sources#necovim#get_source_options({
" \ 'name': 'necovim',
" \ 'whitelist': ['vim'],
" \ 'priority': -40,
" \ 'completor': function('asyncomplete#sources#necovim#completor'),
" \ }))
" call asyncomplete#register_source(asyncomplete#sources#buffer#get_source_options({
" \ 'name': 'buffer',
" \ 'whitelist': ['*'],
" \ 'blacklist': ['go'],
" \ 'priority': -50,
" \ 'completor': function('asyncomplete#sources#buffer#completor'),
" \ }))
" call asyncomplete#register_source(asyncomplete#sources#omni#get_source_options({
" \ 'name': 'omni',
" \ 'whitelist': ['*'],
" \ 'blacklist': ['c', 'cpp', 'html', 'python', 'vue'],
" \ 'priority': -60,
" \ 'completor': function('asyncomplete#sources#omni#completor')
" \ }))
" call asyncomplete#register_source(asyncomplete#sources#tags#get_source_options({
" \ 'name': 'tags',
" \ 'whitelist': ['*'],
" \ 'blacklist': ['vim', 'python'],
" \ 'priority': -70,
" \ 'completor': function('asyncomplete#sources#tags#completor'),
" \ 'config': {
" \ 'max_file_size': 50000000,
" \ },
" \ }))
"}}}
" vim-lsp
"{{{
2018-06-08 11:23:53 +00:00
let g:lsp_signs_enabled = 1
let g:lsp_signs_error = {'text': '>>'}
2018-08-22 09:24:24 +00:00
let g:lsp_signs_warning = {'text': '>'}
2018-06-08 11:23:53 +00:00
let g:lsp_signs_information = {'text': '--'}
let g:lsp_signs_hint = {'text': '--'}
let g:lsp_diagnostics_echo_cursor = 1
2018-06-08 12:29:27 +00:00
let g:lsp_diagnostics_echo_delay = 0
2018-06-08 11:23:53 +00:00
nnoremap \l :LspDocumentDiagnostics<cr>
nnoremap \h :LspHover<cr>
nnoremap \d :LspDefinition<cr>
nnoremap \r :LspReferences<cr>
2018-06-08 15:53:31 +00:00
nnoremap \n :LspRename<cr>
2018-06-08 11:23:53 +00:00
nnoremap \s :LspDocumentSymbol<cr>
nnoremap \w :LspWorkspaceSymbol<cr>
nnoremap \ff :LspDocumentFormat<cr>
nnoremap \fr :LspDocumentRangeFormat<cr>
augroup User lsp_setup
autocmd!
if executable('vls')
2018-05-06 21:23:17 +00:00
autocmd User lsp_setup call lsp#register_server({
\ 'name': 'vue',
\ 'cmd': {server_info->['vls']},
\ 'whitelist': ['vue'],
\ })
endif
2018-05-06 21:23:17 +00:00
if executable('pyls')
autocmd User lsp_setup call lsp#register_server({
\ 'name': 'pyls',
\ 'cmd': {server_info->['pyls']},
\ 'whitelist': ['python'],
\ })
endif
2018-08-22 09:24:24 +00:00
if executable('typescript-language-server')
au User lsp_setup call lsp#register_server({
\ 'name': 'typescript-language-server',
\ 'cmd': { server_info->[&shell, &shellcmdflag, 'typescript-language-server --stdio']},
\ 'root_uri': { server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_directory(lsp#utils#get_buffer_path(), '.git/..'))},
\ 'whitelist': ['typescript', 'javascript', 'javascript.jsx']
\ })
endif
augroup END
2018-05-06 21:23:17 +00:00
"}}}
2018-08-22 09:24:24 +00:00
" ALE
"{{{
nnoremap <space>ne :lnext<cr>
nnoremap <space>pe :lprev<cr>
let g:ale_sign_error = '>>'
let g:ale_sign_warning = '>'
let g:ale_sign_column_always = 1
" let g:ale_linters = {'scss': ['stylelint'], 'javascript': ['eslint'], 'php':['php'], 'html':['htmlhint'], 'python': [], 'vue': []}
let g:ale_linters = {'scss': ['stylelint'], 'javascript': [], 'php':['php'], 'html':['htmlhint'], 'python': [], 'vue': []}
" let g:ale_linters_explicit = 1
let g:ale_html_htmlhint_options = '-c ~/.htmlhintrc --format=unix'
let g:ale_fixers = {'javascript': ['eslint']}
"}}}
2018-05-08 21:21:55 +00:00
" vim-easy-align
"{{{
xmap ga <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign)
"}}}
2018-04-07 15:13:06 +00:00
" switch.vim
2018-04-07 18:20:03 +00:00
"{{{
2018-04-07 15:13:06 +00:00
let g:switch_mapping = '<space>-'
2018-04-07 18:11:45 +00:00
let g:switch_custom_definitions = [
\ ['0', '1'],
\ ['ease-in', 'ease-out'],
2018-06-10 14:47:52 +00:00
\ ['auto', 'none'],
\ ['left', 'right'],
\ ['top', 'bottom'],
\ ['relative', 'absolute', 'fixed']
2018-04-07 18:11:45 +00:00
\ ]
2018-04-07 18:20:03 +00:00
"}}}
2018-04-07 15:13:06 +00:00
2018-03-17 23:42:49 +00:00
" gitgutter
2018-04-07 18:20:03 +00:00
"{{{
2018-03-17 23:42:49 +00:00
nmap ]h <Plug>GitGutterNextHunk
nmap [h <Plug>GitGutterPrevHunk
omap ih <Plug>GitGutterTextObjectInnerPending
omap ah <Plug>GitGutterTextObjectOuterPending
xmap ih <Plug>GitGutterTextObjectInnerVisual
xmap ah <Plug>GitGutterTextObjectOuterVisual
2018-04-07 18:20:03 +00:00
"}}}
2018-03-17 23:42:49 +00:00
" Use the silver searcher ag command instead of grep
2018-04-07 18:20:03 +00:00
"{{{
2018-03-17 23:42:49 +00:00
if executable('ag')
" Use ag over grep
set grepprg=ag\ --nogroup\ --nocolor
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
endif
"vim-wiki
let g:vimwiki_list = [{'path': '~/vimwiki/', 'path_html': '~/vimwiki_html/'}]
" emmet
2018-03-27 20:39:33 +00:00
let g:user_emmet_leader_key=',,'
let g:user_emmet_settings = {
\ 'indentation': ' ',
\ 'html': {
\ 'indentation': ' ',
\ }
\}
2018-04-07 18:20:03 +00:00
"}}}
2018-03-17 23:42:49 +00:00
" vue-vim
2018-04-07 18:20:03 +00:00
"{{{
2018-03-17 23:42:49 +00:00
" disable preprocessor checking for vue files - increases speed
2018-03-27 20:43:16 +00:00
let g:vue_disable_pre_processors=0
2018-03-17 23:42:49 +00:00
" set custom syntax highlighting
augroup fixhighlighting
2018-03-21 22:51:16 +00:00
autocmd!
2018-03-17 23:42:49 +00:00
autocmd BufNewFile,BufRead *.vue syntax sync fromstart
augroup END
2018-04-07 18:20:03 +00:00
"}}}
2018-03-17 23:42:49 +00:00
" ultisnips
2018-04-07 18:20:03 +00:00
"{{{
2018-06-17 14:14:49 +00:00
nnoremap <space>ul :call ListUltisnips()<cr>
inoremap jkul <c-o>:call ListUltisnips()<cr>
2018-03-20 22:33:41 +00:00
let g:UltiSnipsSnippetsDir='~/.vim/UltiSnips'
2018-03-17 23:42:49 +00:00
" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
let g:UltiSnipsExpandTrigger='<c-j>'
2018-05-07 11:53:47 +00:00
let g:UltiSnipsJumpForwardTrigger='<c-f>'
let g:UltiSnipsJumpBackwardTrigger='<c-d>'
2018-03-17 23:42:49 +00:00
let g:UltiSnipsEditSplit='horizontal'
2018-06-17 14:14:49 +00:00
function! ListUltisnips() abort
let l:snips = UltiSnips#SnippetsInCurrentScope(1)
let l:keylist = sort(keys(l:snips))
2018-06-17 15:27:53 +00:00
echo ' --------------------------------------------------'
2018-06-17 14:14:49 +00:00
for l:key in l:keylist
2018-06-17 15:27:53 +00:00
echo printf(" %-10s\t%s", l:key, l:snips[l:key])
2018-06-17 14:14:49 +00:00
endfor
2018-06-17 15:27:53 +00:00
echo '---------------------------------------------------'
2018-06-17 14:14:49 +00:00
endfunction
2018-06-17 16:22:39 +00:00
function! CompleteSnippets(findstart, base)
if a:findstart
let l:line = getline('.')
let l:start = col('.') - 1
while l:start > 0 && l:line[l:start - 1] =~ '\a'
let l:start -= 1
endwhile
return l:start
else
let l:res = []
let l:snips = UltiSnips#SnippetsInCurrentScope(1)
let l:keylist = sort(keys(l:snips))
for l:key in l:keylist
if l:key =~ '^' . a:base
let l:item = {'word': l:key, 'menu': l:snips[l:key]}
call add(l:res, l:item)
endif
endfor
return l:res
endif
endfunction
set completefunc=CompleteSnippets
2018-04-07 18:20:03 +00:00
"}}}
2018-03-17 23:42:49 +00:00
" Netrw
2018-04-07 18:20:03 +00:00
"{{{
2018-03-17 23:42:49 +00:00
let g:netrw_liststyle=3
let g:netrw_list_hide='^\..*'
2018-03-27 10:16:56 +00:00
let g:netrw_preview = 0
2018-04-07 18:20:03 +00:00
"}}}
2018-03-17 23:42:49 +00:00
" undotree
2018-04-07 18:20:03 +00:00
"{{{
2018-03-17 23:50:54 +00:00
nnoremap <space>ut :UndotreeToggle<cr>
2018-04-07 18:20:03 +00:00
"}}}
2018-03-17 23:42:49 +00:00
" TagBar
2018-04-07 18:20:03 +00:00
"{{{
2018-03-17 23:50:54 +00:00
nnoremap <space>tb :TagbarOpen fj<CR>
nnoremap <space>] :tag /[.#@]<c-r>=expand('<cword>')<cr><cr>
2018-03-17 23:42:49 +00:00
let g:tagbar_autoclose = 1
" let g:tagbar_autopreview = 1
" let g:tagbar_previewwin_pos = ''
let g:tagbar_type_css = {
\ 'ctagstype' : 'css',
\ 'kinds' : [
\ 'c:classes',
\ 'i:ids',
\ 't:tags',
\ 'm:medias'
\ ]
\}
let g:tagbar_type_scss = {
\ 'ctagstype' : 'scss',
\ 'kinds' : [
\ 'v:variables',
\ 'c:classes',
\ 'i:ids',
\ 't:tags',
\ 'd:medias',
\ 'm:mixins',
\ 'f:functions'
\ ]
\}
let g:tagbar_type_vue = {
\ 'ctagstype' : 'vue',
\ 'kinds' : [
\ 'o:objects',
\ 'f:functions',
\ 'a:array',
\ 's:string',
\ 'b:boolean',
\ 'n:number',
\ 'v:variable'
\ ]
\ }
2018-04-07 18:20:03 +00:00
"}}}
2018-03-17 23:42:49 +00:00
" gutentags
2018-04-07 18:20:03 +00:00
"{{{
2018-03-17 23:42:49 +00:00
let g:gutentags_ctags_tagfile = '.tags'
2018-04-04 21:28:27 +00:00
let g:gutentags_ctags_exclude = ['package.json', 'Session.vim', 'package-lock.json', 'TODO.txt']
2018-03-17 23:42:49 +00:00
"}}}
2018-04-04 16:55:09 +00:00
" colorV
2018-04-07 18:20:03 +00:00
"{{{
2018-04-04 17:49:09 +00:00
let g:colorv_no_global_map = 1
2018-04-04 16:55:09 +00:00
let g:colorv_win_pos = 'top'
let g:colorv_preview_area = 0
2018-03-17 23:42:49 +00:00
2018-04-04 17:49:09 +00:00
nnoremap <space>cv :ColorV<CR>
nnoremap <space>ce :ColorVEdit<CR>
nnoremap <space>cc :call ToggleColorPreview()<CR>
nnoremap <space>ci :ColorVInsert<CR>
nnoremap <space>cp :ColorVPicker<CR>
2018-04-04 18:09:41 +00:00
function! ToggleColorPreview() abort
if !exists('w:colorv_is_previewing')
let w:colorv_is_previewing = 0
endif
if w:colorv_is_previewing == 0
2018-04-07 18:20:03 +00:00
execute 'ColorVPreview'
let w:colorv_is_previewing = 1
2018-04-04 17:49:09 +00:00
else
2018-04-07 18:20:03 +00:00
execute 'ColorVClear'
let w:colorv_is_previewing = 0
2018-04-04 17:49:09 +00:00
endif
endfunction
2018-04-07 18:20:03 +00:00
"}}}
2018-06-19 20:37:38 +00:00
" vim-instant-markdown
" this doesn't work - issue is open in guthub
let g:instant_markdown_open_to_the_world = 1
2018-04-07 18:20:03 +00:00
"}}}
2018-04-04 17:49:09 +00:00
2018-03-17 23:42:49 +00:00
" vim: foldmethod=marker