vim-lsp mappings

This commit is contained in:
ManjaroOne666 2018-06-08 12:23:53 +01:00
parent b445166a83
commit aab1f234a1
1 changed files with 76 additions and 61 deletions

View File

@ -122,15 +122,15 @@ Plug 'junegunn/vim-easy-align'
" asyncomplete.vim " asyncomplete.vim
" https://github.com/prabirshrestha/asyncomplete.vim " https://github.com/prabirshrestha/asyncomplete.vim
Plug 'prabirshrestha/asyncomplete.vim' " Plug 'prabirshrestha/asyncomplete.vim'
Plug 'yami-beta/asyncomplete-omni.vim' " Plug 'yami-beta/asyncomplete-omni.vim'
Plug 'prabirshrestha/asyncomplete-ultisnips.vim' " Plug 'prabirshrestha/asyncomplete-ultisnips.vim'
Plug 'prabirshrestha/asyncomplete-file.vim' " Plug 'prabirshrestha/asyncomplete-file.vim'
Plug 'prabirshrestha/asyncomplete-buffer.vim' " Plug 'prabirshrestha/asyncomplete-buffer.vim'
Plug 'prabirshrestha/asyncomplete-tags.vim' " Plug 'prabirshrestha/asyncomplete-tags.vim'
Plug 'prabirshrestha/asyncomplete-lsp.vim' " Plug 'prabirshrestha/asyncomplete-lsp.vim'
Plug 'Shougo/neco-vim' " Plug 'Shougo/neco-vim'
Plug 'prabirshrestha/asyncomplete-necovim.vim' " Plug 'prabirshrestha/asyncomplete-necovim.vim'
" vim-lsp " vim-lsp
" https://github.com/prabirshrestha/vim-lsp " https://github.com/prabirshrestha/vim-lsp
@ -147,71 +147,85 @@ runtime macros/matchit.vim
" asyncomplete.vim " asyncomplete.vim
"{{{ "{{{
let g:asyncomplete_auto_popup = 0 " let g:asyncomplete_auto_popup = 0
let g:asyncomplete_remove_duplicates = 1 " let g:asyncomplete_remove_duplicates = 1
inoremap <silent><expr> <C-l> asyncomplete#force_refresh() " inoremap <silent><expr> <C-l> asyncomplete#force_refresh()
" not working why? " not working why?
let g:asyncomplete_min_chars = 3 " let g:asyncomplete_min_chars = 3
augroup User asyncomplete_setup " augroup User asyncomplete_setup
autocmd! " autocmd!
autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif " autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif
augroup END " augroup END
call asyncomplete#register_source(asyncomplete#sources#file#get_source_options({ " call asyncomplete#register_source(asyncomplete#sources#file#get_source_options({
\ 'name': 'file', " \ 'name': 'file',
\ 'whitelist': ['*'], " \ 'whitelist': ['*'],
\ 'priority': -20, " \ 'priority': -20,
\ 'completor': function('asyncomplete#sources#file#completor') " \ 'completor': function('asyncomplete#sources#file#completor')
\ })) " \ }))
call asyncomplete#register_source(asyncomplete#sources#ultisnips#get_source_options({ " call asyncomplete#register_source(asyncomplete#sources#ultisnips#get_source_options({
\ 'name': 'ultisnips', " \ 'name': 'ultisnips',
\ 'whitelist': ['*'], " \ 'whitelist': ['*'],
\ 'priority': -30, " \ 'priority': -30,
\ 'completor': function('asyncomplete#sources#ultisnips#completor'), " \ 'completor': function('asyncomplete#sources#ultisnips#completor'),
\ })) " \ }))
call asyncomplete#register_source(asyncomplete#sources#necovim#get_source_options({ " call asyncomplete#register_source(asyncomplete#sources#necovim#get_source_options({
\ 'name': 'necovim', " \ 'name': 'necovim',
\ 'whitelist': ['vim'], " \ 'whitelist': ['vim'],
\ 'priority': -40, " \ 'priority': -40,
\ 'completor': function('asyncomplete#sources#necovim#completor'), " \ 'completor': function('asyncomplete#sources#necovim#completor'),
\ })) " \ }))
call asyncomplete#register_source(asyncomplete#sources#buffer#get_source_options({ " call asyncomplete#register_source(asyncomplete#sources#buffer#get_source_options({
\ 'name': 'buffer', " \ 'name': 'buffer',
\ 'whitelist': ['*'], " \ 'whitelist': ['*'],
\ 'blacklist': ['go'], " \ 'blacklist': ['go'],
\ 'priority': -50, " \ 'priority': -50,
\ 'completor': function('asyncomplete#sources#buffer#completor'), " \ 'completor': function('asyncomplete#sources#buffer#completor'),
\ })) " \ }))
call asyncomplete#register_source(asyncomplete#sources#omni#get_source_options({ " call asyncomplete#register_source(asyncomplete#sources#omni#get_source_options({
\ 'name': 'omni', " \ 'name': 'omni',
\ 'whitelist': ['*'], " \ 'whitelist': ['*'],
\ 'blacklist': ['c', 'cpp', 'html', 'python', 'vue'], " \ 'blacklist': ['c', 'cpp', 'html', 'python', 'vue'],
\ 'priority': -60, " \ 'priority': -60,
\ 'completor': function('asyncomplete#sources#omni#completor') " \ 'completor': function('asyncomplete#sources#omni#completor')
\ })) " \ }))
call asyncomplete#register_source(asyncomplete#sources#tags#get_source_options({ " call asyncomplete#register_source(asyncomplete#sources#tags#get_source_options({
\ 'name': 'tags', " \ 'name': 'tags',
\ 'whitelist': ['*'], " \ 'whitelist': ['*'],
\ 'blacklist': ['vim', 'python'], " \ 'blacklist': ['vim', 'python'],
\ 'priority': -70, " \ 'priority': -70,
\ 'completor': function('asyncomplete#sources#tags#completor'), " \ 'completor': function('asyncomplete#sources#tags#completor'),
\ 'config': { " \ 'config': {
\ 'max_file_size': 50000000, " \ 'max_file_size': 50000000,
\ }, " \ },
\ })) " \ }))
"}}} "}}}
" vim-lsp " vim-lsp
"{{{ "{{{
let g:lsp_signs_enabled = 1
let g:lsp_signs_error = {'text': '>>'}
let g:lsp_signs_warning = {'text': '>>'}
let g:lsp_signs_information = {'text': '--'}
let g:lsp_signs_hint = {'text': '--'}
let g:lsp_diagnostics_echo_cursor = 1
nnoremap \l :LspDocumentDiagnostics<cr>
nnoremap \h :LspHover<cr>
nnoremap \d :LspDefinition<cr>
nnoremap \r :LspReferences<cr>
nnoremap \s :LspDocumentSymbol<cr>
nnoremap \w :LspWorkspaceSymbol<cr>
nnoremap \ff :LspDocumentFormat<cr>
nnoremap \fr :LspDocumentRangeFormat<cr>
augroup User lsp_setup augroup User lsp_setup
autocmd! autocmd!
if executable('vls') if executable('vls')
@ -313,10 +327,11 @@ nnoremap <space>ne :lnext<cr>
nnoremap <space>pe :lprev<cr> nnoremap <space>pe :lprev<cr>
let g:ale_sign_error = '>>' let g:ale_sign_error = '>>'
let g:ale_sign_warning = '--' let g:ale_sign_warning = '>'
let g:ale_sign_column_always = 1 let g:ale_sign_column_always = 1
let g:ale_linters = {'scss': ['stylelint'], 'javascript': ['eslint'], 'php':['php'], 'html':['htmlhint']} let g:ale_linters = {'scss': ['stylelint'], 'javascript': ['eslint'], '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_html_htmlhint_options = '-c ~/.htmlhintrc --format=unix'
let g:ale_fixers = {'javascript': ['eslint']} let g:ale_fixers = {'javascript': ['eslint']}
"}}} "}}}