Closed dryya closed 6 years ago
I tried updating my sources to the new format:
call deoplete#custom#option('sources', {
\ '_': ['file', 'buffer'],
\ 'python': ['LanguageClient', 'ultisnips'],
\ 'python3': ['LanguageClient', 'ultisnips'],
\ 'rust': ['LanguageClient', 'ultisnips'],
\ 'tex': ['ultisnips', 'omni'],
\ 'r': ['LanguageClient', 'omni', 'ultisnips']
\})
but am still running into issues specifically with R.
(suggested at https://github.com/Shougo/deoplete.nvim/blob/master/doc/deoplete.txt#L1551 - is this a typo? I was under the impression input patterns should be a var, not a source)
Yes. It is typo.
call deoplete#custom#var()
is correct.
call deoplete#custom#var('omni', 'input_patterns', {
\ 'r': '[^. *\t]\.\w*',
\})
""" Deoplete and vimtex config
call deoplete#custom#var('omni', 'input_patterns', {
\ 'tex' : g:vimtex#re#deoplete,
\})
It overwrites the previous configuration.
This is the correct pattern.
""" Deoplete and vimtex config
call deoplete#custom#var('omni', 'input_patterns', {
\ 'tex' : g:vimtex#re#deoplete,
\ 'r': '[^. *\t]\.\w*',
\})
Hi @Shougo, I'm trying to make deoplete work with nvim-r omnicompletion. I want to able to (auto)complete whenever I type .
. However when I use the following minimal vimrc:
set nocompatible
let $DOTVIM = expand('$HOME/.vim')
set runtimepath+=$DOTVIM/bundle/repos/github.com/Shougo/deoplete.nvim
set runtimepath+=$DOTVIM/bundle/repos/github.com/jalvesaq/Nvim-R
filetype plugin indent on
let g:deoplete#enable_at_startup = 1
call deoplete#custom#var('omni', 'input_patterns', {
\ 'r': '[^. *\t]\.\w*',
\ }
\)
and in a empty foo.R
file type data.
the cursor jumps back just period the period. This can be seen in the following GIF:
On the other hand I remove/comment the input_patterns lines and type C-X C-O
after data.
then the manual omnicompletion works just fine:
Also how can I modify the regex to also autocomplete immediately after the following symbols ::
, $
?
I think nvim-r plugin does not support omni source.
You should use deoplete#custom#option()
instead.
call deoplete#custom#option('omni_patterns', {
\ 'r': '[^. *\t]\.\w*',
\})
Thanks @Shougo. Indeed adding the following seems to work:
\ 'omni_patterns': {
\ 'r': ['[^. *\t]\.\w*', '\h\w*::\w*', '\h\w*\$\w*'],
\},
@jalvesaq @gaalcaras any chance of improving nvim-r/deoplete interaction?
thank goodness for this!
i was having trouble with the deoplete#custom#var, but this one seemed to work!:
call deoplete#custom#option('omni_patterns', { \ 'r': '[^. *\t]\.\w*', \})
..now to learn regex to make it work for haxe’s input patterns ;(
haha sorry, new to all this :)
i was sooo close to giving up and trying the new ddc stuff too! Google is amazing.
ddc.vim is better than deoplete.
hmmm, yeah, i might try it next...
but my server was struggling so bad with deoplete, i switched to SuperTab, which is still quite slow, lol. Maybe if i had set it up to work only after the first character, it might be tolerable. 😜
Problems
I would like to get completion working in R.
Option 1: nvim-r
I have tried using nvim-r, which populates vim omnifunc. I tried adding
let g:deoplete#sources.r = ['omni', 'ultisnips']
with a couple options:(suggested at https://github.com/Shougo/deoplete.nvim/blob/master/doc/deoplete.txt#L1551 - is this a typo? I was under the impression input patterns should be a var, not a source)
(suggested at https://github.com/Shougo/deoplete.nvim/blob/master/doc/deoplete.txt#L555)
(suggested at https://github.com/Shougo/deoplete.nvim/blob/master/doc/deoplete.txt#L189)
However, all I see in deoplete completion is ultisnips snippets. Manually calling
<C-x><C-o>
will bring up nvim-r's function completions. Do you have any suggestions?Vimrc:
Option 2: LanguageClient
I have tried using LanguageClient-neovim with the R language server to get completion. I set
let g:deoplete#sources.r = ['LanguageClient']
and configure withWhen working in python for example, setting LanguageClient as a deoplete source will populate completion. But with the same configuration for R it does not work.
Environment Information
deoplete version: 57d3f0c3cdfcfc1d91901a6d59d08f9008abd166
OS: Arch Linux on 4.16.5-1 kernel
Features: +acl +iconv +jemalloc +tui See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"
:checkhealth
or:CheckHealth
result(neovim only): all OK