jalvesaq / zotcite

Neovim plugin for integration with Zotero
GNU General Public License v3.0
174 stars 15 forks source link

Nvim-R seems to disrupt omni completion in zotcite #57

Closed manumart closed 1 year ago

manumart commented 1 year ago

I want to enable vim-markdown (mainly for the folding functionnalities), Nvim-R and zotcite altogether for Rmd files. I make Rmd files being recognized by vim-markdown with a autocmd BufNewFile,BufRead *.Rmd set filetype=markdown

Then vim-markdown and zotcite work well together. When however I also install Nvim-R, the C-x C-O command to find bibliographic references with zotcite does not work anymore : -- Omni completion (^O^N^P) Pattern not found

Here is the result of :Zinfo

Information from the Python module:                                                      
  zotero.sqlite     : /home/manuel/.zotero/zotero/nlkru32t.default/zotero/zotero.sqlite
  tmpdir            : /home/manuel/.cache/zotcite
  data dir          : /home/manuel/.zotero/zotero/nlkru32t.default/zotero
  zotero.py         : /home/manuel/.local/share/nvim/plugged/zotcite/python3/zotero.py
  attachments dir   :
  references found  : 1957
  excluded fields   : []
  citation template : {Authors}_{Year}
  docs              : {}
  banned words      : a an the some from on in to of do with

Additional messages:
There is another omnifunc enabled: htmlcomplete#CompleteTags

My init.vim is :

call plug#begin()

Plug 'jalvesaq/zotcite'
Plug 'jalvesaq/Nvim-R'

" Markdown
Plug 'godlygeek/tabular'
Plug 'plasticboy/vim-markdown'

call plug#end()

autocmd BufNewFile,BufRead *.Rmd set filetype=markdown

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Files/Backups
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set undodir=~/tmp/vimtmp
set backupdir=~/tmp/vimtmp
set directory=~/tmp/vimtmp
set undofile
set backup " make backup file
set bk
set makeef=error.err " When using make, where should it dump the file

Thank you in advance for your feedback!

jalvesaq commented 1 year ago

Nvim-R integrates well with zotcite, but we have had problems with vim-markdown in the past: https://github.com/jcfaria/Vim-R-plugin/issues/186 https://github.com/jalvesaq/Nvim-R/issues/505

You will also find support for folding in vim-pandoc-syntax, but I don't use it, so I don't know if you will find any incompatibilities.

jalvesaq commented 1 year ago

Did you manage to get folding working without vim-markdown?

manumart commented 1 year ago

Thanks a lot for the feedback. I did not managed this yet. Maybe some additional comment, it is actually the
autocmd BufNewFile,BufRead *.Rmd set filetype=markdown , which I need to get Rmd files to be recognized as markdown which seems to disrupt omni completion from Zotcite. I will report if I manage to get both zotcite and markdown specific folding working. For now I just use manual folding.

jalvesaq commented 1 year ago

The omni completion issue might be fixed now. It only happened if R_set_omnifunc didn't include the file type being edited. I couldn't replicate the bug before because my R_set_omnifunc included both rmd and quarto, and I routinely use cmp-zotcite instead of omni completion.