diff options
author | Guangxiong Lin <[email protected]> | 2023-08-31 00:46:15 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2023-08-31 00:46:15 +0800 |
commit | 3e808594923495103aa38a7ff2b6b6d1f24d8104 (patch) | |
tree | 9c1b91f4e8a71b5b00688b80341c348c71f436a7 | |
parent | eb09180f592fa82f6a606b9706910dc65f1fbfdc (diff) | |
download | dotfiles-3e808594923495103aa38a7ff2b6b6d1f24d8104.tar.gz dotfiles-3e808594923495103aa38a7ff2b6b6d1f24d8104.tar.bz2 dotfiles-3e808594923495103aa38a7ff2b6b6d1f24d8104.zip |
Try mucomplete with jedi-vim
-rw-r--r-- | .vim/after/plugin/asyncomplete.vim | 2 | ||||
-rw-r--r-- | .vim/after/plugin/jedi.vim | 19 | ||||
-rw-r--r-- | .vim/after/plugin/minpac.vim | 1 | ||||
-rw-r--r-- | .vim/after/plugin/mucomplete.vim | 2 |
4 files changed, 22 insertions, 2 deletions
diff --git a/.vim/after/plugin/asyncomplete.vim b/.vim/after/plugin/asyncomplete.vim index 7eda153..7a2d7ed 100644 --- a/.vim/after/plugin/asyncomplete.vim +++ b/.vim/after/plugin/asyncomplete.vim @@ -2,6 +2,8 @@ if has('nvim') finish endif +finish + inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" inoremap <expr> <cr> pumvisible() ? "\<c-y>" : "\<cr>" diff --git a/.vim/after/plugin/jedi.vim b/.vim/after/plugin/jedi.vim new file mode 100644 index 0000000..4e0f062 --- /dev/null +++ b/.vim/after/plugin/jedi.vim @@ -0,0 +1,19 @@ +let g:jedi#auto_initialization = 0 +let g:jedi#auto_vim_configuration = 0 +let g:jedi#show_call_signatures = 1 + +function! s:on_python_filetype() abort + packadd jedi-vim + + setlocal omnifunc=jedi#completions + + nnoremap <silent> <buffer> <localleader>rn :call jedi#rename()<cr> + nnoremap <silent> <buffer> gd :call jedi#goto()<cr> + nnoremap <silent> <buffer> gr :call jedi#usages()<cr> + nnoremap <silent> <buffer> gy :call jedi#goto_stubs()<cr> + nnoremap <silent> <buffer> K :call jedi#show_documentation()<cr> + + call jedi#configure_call_signatures() +endfunction + +autocmd FileType python call s:on_python_filetype() diff --git a/.vim/after/plugin/minpac.vim b/.vim/after/plugin/minpac.vim index 2d807a3..61728b6 100644 --- a/.vim/after/plugin/minpac.vim +++ b/.vim/after/plugin/minpac.vim @@ -121,6 +121,7 @@ function! InitMinpac() abort call minpac#add('https://github.com/iamcco/markdown-preview.nvim', { \ 'type': 'start', \ 'do': 'packloadall! | call mkdp#util#install()'}) + call minpac#add('https://github.com/davidhalter/jedi-vim', {'type': 'opt'}) " misc call minpac#add('https://github.com/freitass/todo.txt-vim.git', {'type': 'opt'}) diff --git a/.vim/after/plugin/mucomplete.vim b/.vim/after/plugin/mucomplete.vim index 5a756f4..81751ba 100644 --- a/.vim/after/plugin/mucomplete.vim +++ b/.vim/after/plugin/mucomplete.vim @@ -2,8 +2,6 @@ if has('nvim') finish endif -finish " Try using deoplete - let g:mucomplete#enable_auto_at_startup = 1 let g:mucomplete#minimum_prefix_length = 1 let g:mucomplete#empty_text_auto = 1 |