Skip to content

Instantly share code, notes, and snippets.

@tsuyoshicho
Last active April 2, 2020 05:27
Show Gist options
  • Save tsuyoshicho/e8bc392f0c602432b9b43fa6380198d6 to your computer and use it in GitHub Desktop.
Save tsuyoshicho/e8bc392f0c602432b9b43fa6380198d6 to your computer and use it in GitHub Desktop.
" install vim-pulg
if has('vim_starting')
set rtp+=~/.vim/plugged/vim-plug
if !isdirectory(expand('~/.vim/plugged/vim-plug'))
echo 'install vim-plug...'
call mkdir(expand('~/.vim/plugged/vim-plug'), 'p')
call system('git clone https://github.com/junegunn/vim-plug.git ' . expand('~/.vim/plugged/vim-plug/autoload'))
end
endif
" setup
call plug#begin('~/.vim/plugged')
Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
Plug 'mattn/vim-lsp-settings'
call plug#end()
" plugin setting - lsp
augroup LspMappings
au!
au FileType vim,python call s:lsp_common_mappings()
augroup END
function! s:lsp_common_mappings() abort
setlocal omnifunc=lsp#complete
nmap <buffer> K <Plug>(lsp-hover)
nmap <buffer> <silent> [g <Plug>(lsp-previous-diagnostic)
nmap <buffer> <silent> ]g <Plug>(lsp-next-diagnostic)
nmap <buffer> gd <Plug>(lsp-definition)
endfunction
inoremap <expr> <C-y> pumvisible() ? asyncomplete#close_popup() : "\<C-y>"
inoremap <expr> <C-e> pumvisible() ? asyncomplete#cancel_popup() : "\<C-e>"
@tsuyoshicho
Copy link
Author

Invoke
gvim -N -u testvimrc.vim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment