removed LSP support in favor of deoplete native plugins. Syntastic is no more annoying

This commit is contained in:
Claudio Maggioni 2019-11-01 17:45:16 +01:00
parent 588308d889
commit 5fc063622c
3 changed files with 160 additions and 83 deletions

View File

@ -19,82 +19,18 @@ set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
" LanguageClient-neoviM
let g:LanguageClient_serverCommands = {
\ 'scala': ['metals-vim'],
\ 'sbt': ['metals-vim'],
\ 'python': ['pyls'],
\ 'c': ['ccls'],
\ 'go': ['go-langserver'],
\ 'bash': ['bash-language-server']
\ }
" Disable auto-opening of location list
let g:syntastic_auto_loc_list = 0
let g:LanguageClient_useVirtualText = 0
" Check on file open
let g:syntastic_check_on_open = 0
function! LC_maps()
if has_key(g:LanguageClient_serverCommands, &filetype)
nnoremap <buffer> <silent> <localleader>d
\ :call LanguageClient#textDocument_definition()<CR>
nnoremap <buffer> <silent> <localleader>t
\ :call LanguageClient#textDocument_typeDefinition()<CR>
nnoremap <buffer> <silent> <localleader>s
\ :call LanguageClient#textDocument_documentSymbol()<CR>
nnoremap <buffer> <silent> <localleader>u
\ :call LanguageClient#textDocument_references()<CR>
nnoremap <buffer> <silent> <localleader>r
\ :call LanguageClient#textDocument_rename()<CR>
nnoremap <buffer> <silent> <localleader>i
\ :call LanguageClient#textDocument_implementation()<CR>
nnoremap <buffer> <silent> <localleader>f
\ :call LanguageClient#textDocument_formatting()<CR>
nnoremap <buffer> <silent> <localleader>h
\ :call LanguageClient#textDocument_documentHighlight()<CR>
nnoremap <buffer> <silent> <localleader>H
\ :call LanguageClient#textDocument_clearDocumentHighlight()<CR>
endif
endfunction
" Force python3 when using systastic
let g:syntastic_python_checkers=['pylint']
autocmd FileType * call LC_maps()
" NCM2
" enable ncm2 for all buffers
autocmd BufEnter * call ncm2#enable_for_buffer()
" IMPORTANT: :help Ncm2PopupOpen for more information
set completeopt=noinsert,menuone,noselect
" suppress the annoying 'match x of y', 'The only match' and 'Pattern not
" found' messages
set shortmess+=c
" CTRL-C doesn't trigger the InsertLeave autocmd . map to <ESC> instead.
inoremap <c-c> <ESC>
" Use <TAB> to select the popup menu:
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
" wrap existing omnifunc
" Note that omnifunc does not run in background and may probably block the
" editor. If you don't want to be blocked by omnifunc too often, you could
" add 180ms delay before the omni wrapper:
" 'on_complete': ['ncm2#on_complete#delay', 180,
" \ 'ncm2#on_complete#omni', 'csscomplete#CompleteCSS'],
au User Ncm2Plugin call ncm2#register_source({
\ 'name' : 'css',
\ 'priority': 9,
\ 'subscope_enable': 1,
\ 'scope': ['css','scss'],
\ 'mark': 'css',
\ 'word_pattern': '[\w\-]+',
\ 'complete_pattern': ':\s*',
\ 'on_complete': ['ncm2#on_complete#omni', 'csscomplete#CompleteCSS'],
\ })
nnoremap <silent> <Leader>c :SyntasticCheck<CR>
" FILE MANAGER
@ -106,6 +42,20 @@ command! -nargs=? -complete=dir Vexplore leftabove vsplit | silent Dirvish <args
let g:dirvish_mode = ':sort ,^.*[\/],'
" DEOPLETE
let g:deoplete#enable_at_startup = 1
let g:deoplete#omni#functions = {}
let g:deoplete#omni#functions.javascript = [
\ 'tern#Complete',
\ 'jspc#omni'
\]
set completeopt=longest,menuone,preview
let g:deoplete#sources = {}
let g:deoplete#sources['javascript.jsx'] = ['file', 'ultisnips', 'ternjs']
" SETTINGS
if !has('nvim')
@ -226,7 +176,7 @@ let g:lt_location_list_toggle_map = '<leader>l'
let g:lt_quickfix_list_toggle_map = '<leader>q'
" Insert in the end of file with Leader c
nnoremap <Leader>c GA
nnoremap <Leader>a GA
" COLORSCHEME

View File

@ -29,17 +29,29 @@ Plug 'wlangstroth/vim-racket', { 'for': 'scheme' }
Plug 'leafgarland/typescript-vim', { 'for': 'typescript' }
Plug 'mboughaba/i3config.vim', { 'for': 'i3config' }
" LanguageClient support
Plug 'Shougo/vimproc.vim', { 'do': 'make' }
Plug 'roxma/nvim-yarp'
Plug 'ncm2/ncm2'
Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next',
\ 'do': 'bash install.sh',
\ }
Plug 'junegunn/fzf.vim', { 'do': 'yes \| ./install' }
" Syntax checking for C
" Syntax checking
Plug 'vim-syntastic/syntastic'
" Dustjs highlight
Plug 'jimmyhchan/dustjs.vim'
" Completion engine
if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
endif
" Competion language support
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'carlitux/deoplete-ternjs', { 'for': ['javascript', 'javascript.jsx'] }
Plug 'othree/jspc.vim', { 'for': ['javascript', 'javascript.jsx'] }
Plug 'deoplete-plugins/deoplete-jedi' " Python (pip install jedi)
call plug#end()

View File

@ -0,0 +1,115 @@
let s:so_save = &so | let s:siso_save = &siso | set so=0 siso=0
argglobal
setlocal autoindent
setlocal backupcopy=
setlocal nobinary
setlocal nobreakindent
setlocal breakindentopt=
setlocal bufhidden=
setlocal buflisted
setlocal buftype=
setlocal nocindent
setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e
setlocal cinoptions=
setlocal cinwords=if,else,while,do,for,switch
setlocal colorcolumn=+1
setlocal comments=:#
setlocal commentstring=#\ %s
setlocal complete=.,w,b,u,t,i
setlocal completefunc=
setlocal nocopyindent
setlocal cryptmethod=blowfish2
setlocal nocursorbind
setlocal nocursorcolumn
setlocal nocursorline
setlocal define=
setlocal dictionary=
setlocal nodiff
setlocal equalprg=
setlocal errorformat=
setlocal noexpandtab
if &filetype != 'conf'
setlocal filetype=conf
endif
setlocal fixendofline
setlocal foldcolumn=0
setlocal foldenable
setlocal foldexpr=0
setlocal foldignore=#
setlocal foldlevel=0
setlocal foldmarker={{{,}}}
setlocal foldmethod=manual
setlocal foldminlines=1
setlocal foldnestmax=20
setlocal foldtext=foldtext()
setlocal formatexpr=
setlocal formatoptions=croql
setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s*
setlocal formatprg=
setlocal grepprg=
setlocal iminsert=0
setlocal imsearch=-1
setlocal include=
setlocal includeexpr=
setlocal indentexpr=
setlocal indentkeys=0{,0},:,0#,!^F,o,O,e
setlocal noinfercase
setlocal iskeyword=@,48-57,_,192-255
setlocal keywordprg=
setlocal nolinebreak
setlocal nolisp
setlocal lispwords=
setlocal nolist
setlocal makeencoding=
setlocal makeprg=
setlocal matchpairs=(:),{:},[:]
setlocal nomodeline
setlocal modifiable
setlocal nrformats=bin,octal,hex
setlocal number
setlocal numberwidth=4
setlocal omnifunc=
setlocal path=
setlocal nopreserveindent
setlocal nopreviewwindow
setlocal quoteescape=\\
setlocal noreadonly
setlocal relativenumber
setlocal noscrollbind
setlocal shiftwidth=8
setlocal noshortname
setlocal signcolumn=auto
setlocal nosmartindent
setlocal softtabstop=0
setlocal nospell
setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+
setlocal spellfile=
setlocal spelllang=en
setlocal statusline=%!airline#statusline(1)
setlocal suffixesadd=
setlocal swapfile
setlocal synmaxcol=3000
if &syntax != 'conf'
setlocal syntax=conf
endif
setlocal tabstop=8
setlocal tagcase=
setlocal tags=
setlocal textwidth=0
setlocal thesaurus=
setlocal undofile
setlocal undolevels=-123456
setlocal nowinfixheight
setlocal nowinfixwidth
setlocal wrap
setlocal wrapmargin=0
silent! normal! zE
let s:l = 12 - ((11 * winheight(0) + 11) / 23)
if s:l < 1 | let s:l = 1 | endif
exe s:l
normal! zt
12
normal! 019|
let &so = s:so_save | let &siso = s:siso_save
doautoall SessionLoadPost
" vim: set ft=vim :