Switch to pyright instead of Ycm
This commit is contained in:
parent
8f3f1a1a58
commit
f5fcdec8af
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"python.linting.enabled": false
|
||||||
|
}
|
68
.vimrc
68
.vimrc
|
@ -6,11 +6,15 @@ let $VIMHOME = VIMHOME
|
||||||
" vim-plug
|
" vim-plug
|
||||||
call plug#begin(VIMHOME."/plugs")
|
call plug#begin(VIMHOME."/plugs")
|
||||||
" Plug 'OmniSharp/omnisharp-vim'
|
" Plug 'OmniSharp/omnisharp-vim'
|
||||||
|
Plug 'prabirshrestha/asyncomplete.vim'
|
||||||
|
Plug 'prabirshrestha/vim-lsp'
|
||||||
|
Plug 'prabirshrestha/asyncomplete-lsp.vim'
|
||||||
|
Plug 'ervandew/supertab'
|
||||||
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||||
Plug 'ConradIrwin/vim-bracketed-paste'
|
Plug 'ConradIrwin/vim-bracketed-paste'
|
||||||
Plug 'NLKNguyen/papercolor-theme'
|
Plug 'NLKNguyen/papercolor-theme'
|
||||||
Plug 'Shougo/deoplete.nvim'
|
Plug 'Shougo/deoplete.nvim'
|
||||||
Plug 'Valloric/YouCompleteMe'
|
" Plug 'Valloric/YouCompleteMe'
|
||||||
Plug 'christoomey/vim-tmux-navigator'
|
Plug 'christoomey/vim-tmux-navigator'
|
||||||
Plug 'cohama/lexima.vim', {'do': 'sed -i \"s/has(.nvim.) && //\" autoload/lexima/insmode.vim'}
|
Plug 'cohama/lexima.vim', {'do': 'sed -i \"s/has(.nvim.) && //\" autoload/lexima/insmode.vim'}
|
||||||
Plug 'editorconfig/editorconfig-vim'
|
Plug 'editorconfig/editorconfig-vim'
|
||||||
|
@ -54,8 +58,8 @@ nnoremap <C-E> <C-U>
|
||||||
|
|
||||||
" don't store .swp files in the file's own directory
|
" don't store .swp files in the file's own directory
|
||||||
" neither for .ext~ files
|
" neither for .ext~ files
|
||||||
set directory=/home/user/.vim/tmp/
|
set directory=/home/server/.vim/tmp/
|
||||||
set backupdir=/home/user/.vim/tmp/
|
set backupdir=/home/server/.vim/tmp/
|
||||||
|
|
||||||
" VimWiki
|
" VimWiki
|
||||||
let g:vimwiki_key_mappings = { 'table_mappings': 0 }
|
let g:vimwiki_key_mappings = { 'table_mappings': 0 }
|
||||||
|
@ -200,22 +204,56 @@ Ext 'coc-snippets'
|
||||||
Ext 'coc-emoji'
|
Ext 'coc-emoji'
|
||||||
Ext 'coc-highlight'
|
Ext 'coc-highlight'
|
||||||
Ext 'coc-emmet'
|
Ext 'coc-emmet'
|
||||||
Ext 'coc-omnisharp'
|
" Ext 'coc-omnisharp'
|
||||||
Ext 'coc-vimtex'
|
Ext 'coc-vimtex'
|
||||||
Ext 'coc-json'
|
Ext 'coc-json'
|
||||||
Ext 'coc-java'
|
Ext 'coc-java'
|
||||||
|
Ext 'coc-pyright'
|
||||||
|
|
||||||
delc Ext
|
delc Ext
|
||||||
|
|
||||||
" Tab for completion
|
" Language Server
|
||||||
|
|
||||||
" use <tab> for trigger completion and navigate to the next complete item
|
if executable('pyls')
|
||||||
" function! s:check_back_space() abort
|
" pip install python-language-server
|
||||||
" let col = col('.') - 1
|
au User lsp_setup call lsp#register_server({
|
||||||
" return !col || getline('.')[col - 1] =~ '\s'
|
\ 'name': 'pyls',
|
||||||
" endfunction
|
\ 'cmd': {server_info->['pyls']},
|
||||||
"
|
\ 'allowlist': ['python'],
|
||||||
" inoremap <silent><expr> <Tab>
|
\ })
|
||||||
" \ pumvisible() ? "\<C-n>" :
|
endif
|
||||||
" \ <SID>check_back_space() ? "\<Tab>" :
|
|
||||||
" \ coc#refresh()
|
function! s:on_lsp_buffer_enabled() abort
|
||||||
|
setlocal omnifunc=lsp#complete
|
||||||
|
setlocal signcolumn=yes
|
||||||
|
if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif
|
||||||
|
nmap <buffer> gd <plug>(lsp-definition)
|
||||||
|
nmap <buffer> gs <plug>(lsp-document-symbol-search)
|
||||||
|
nmap <buffer> gS <plug>(lsp-workspace-symbol-search)
|
||||||
|
nmap <buffer> gr <plug>(lsp-references)
|
||||||
|
nmap <buffer> gi <plug>(lsp-implementation)
|
||||||
|
nmap <buffer> gt <plug>(lsp-type-definition)
|
||||||
|
nmap <buffer> <leader>rn <plug>(lsp-rename)
|
||||||
|
nmap <buffer> [g <plug>(lsp-previous-diagnostic)
|
||||||
|
nmap <buffer> ]g <plug>(lsp-next-diagnostic)
|
||||||
|
nmap <buffer> K <plug>(lsp-hover)
|
||||||
|
nnoremap <buffer> <expr><c-f> lsp#scroll(+4)
|
||||||
|
nnoremap <buffer> <expr><c-d> lsp#scroll(-4)
|
||||||
|
|
||||||
|
let g:lsp_format_sync_timeout = 1000
|
||||||
|
autocmd! BufWritePre *.rs,*.go call execute('LspDocumentFormatSync')
|
||||||
|
|
||||||
|
" refer to doc to add more commands
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
augroup lsp_install
|
||||||
|
au!
|
||||||
|
" call s:on_lsp_buffer_enabled only for languages that has the server registered.
|
||||||
|
autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
|
||||||
|
augroup END
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
" Tab for completion
|
||||||
|
let g:SuperTabContextDefaultCompletionType = "<c-n>"
|
||||||
|
let g:SuperTabDefaultCompletionType = "<c-n>"
|
||||||
|
|
Loading…
Reference in New Issue