Created
April 2, 2020 05:32
-
-
Save tsuyoshicho/7882722ea4a1cc6c706b9d82c3997be4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " 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-emoji.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>" | |
| au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#emoji#get_source_options({ | |
| \ 'name': 'emoji', | |
| \ 'whitelist': ['*'], | |
| \ 'completor': function('asyncomplete#sources#emoji#completor'), | |
| \ })) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment