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
" https://github.com/prabirshrestha/asyncomplete.vim
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'
" 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'
" vim-lsp
" https://github.com/prabirshrestha/vim-lsp
@ -147,71 +147,85 @@ runtime macros/matchit.vim
" asyncomplete.vim
"{{{
let g:asyncomplete_auto_popup = 0
let g:asyncomplete_remove_duplicates = 1
inoremap <silent><expr> <C-l> asyncomplete#force_refresh()
" let g:asyncomplete_auto_popup = 0
" let g:asyncomplete_remove_duplicates = 1
" inoremap <silent><expr> <C-l> asyncomplete#force_refresh()
" not working why?
let g:asyncomplete_min_chars = 3
" let g:asyncomplete_min_chars = 3
augroup User asyncomplete_setup
autocmd!
" augroup User asyncomplete_setup
" autocmd!
autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif
augroup END
" 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#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#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#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#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#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,
\ },
\ }))
" 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
"{{{
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
autocmd!
if executable('vls')
@ -313,10 +327,11 @@ nnoremap <space>ne :lnext<cr>
nnoremap <space>pe :lprev<cr>
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_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_fixers = {'javascript': ['eslint']}
"}}}