SpaceVim / SpaceVim

A modular Vim/Neovim configuration
https://spacevim.org/
GNU General Public License v3.0
20.31k stars 1.42k forks source link

SpaceVim R layer doesn't function properly #2505

Closed kayfay closed 5 years ago

kayfay commented 5 years ago

My apologies for the informatlity of the ticket.

Using SpaceVim with R layer doesn't work anymore.

Disabling it and using the vim plugins also do not work.

Don't have anything else that I can do for you here, sorry Wang, you'll have to either rework the entire functionality of the language yourself or disable it completely because using R in SpaceVim isn't working.

kayfay commented 5 years ago

Maybe this might help? (config dein plugin manager specficially from docs based on plugins in milestone guides)

.vimrc

"dein Scripts-----------------------------
if &compatible
  set nocompatible               " Be iMproved
endif

" Required:
set runtimepath+=/home/atools/.cache/dein/repos/github.com/Shougo/dein.vim

" Required:
if dein#load_state('/home/atools/.cache/dein')

  call dein#begin('/home/atools/.cache/dein')

  " Let dein manage dein
  " Required:
  call dein#add('/home/atools/.cache/dein/repos/github.com/Shougo/dein.vim')

  " Add or remove your plugins here like this:

  " ----Nvim-R plugin----
   " Note let R_nvimpager = 'no' requires 
   " options(help_type = "html") in '~/.Rprofile' 
   call dein#add('jalvesaq/Nvim-R', {
   \ 'hook_source': function('AutoOpenREPL'),
   \ 'on_ft': 'r',
   \ })

   call dein#source('jalvesaq/Nvim-R', {
   \ 'hook_source': function('AutoCloseREPL')
   \ })

   " Send to REPL custom key bindings
   call dein#config('Nvim-R', {
   \ 'hook_add': "
   \ nmap <LocalLeader>: :Rsend \n
   \ vmap <Space> <Plug>RDSendSelection\n
   \ nmap <Space> <Plug>RDSendLine\n "})

   " Nvim-R plugin config settings
   call dein#config('Nvim-R', {
   \ 'hook_add': "
   \ let R_nvimpager = 'no'\n
   \ let maplocalleader = ','\n
   \  "})

   " Calls to functions for open/close R REPL on startup/exit
   function! AutoOpenREPL() abort
      autocmd FileType r if string(g:SendCmdToR) == "function('SendCmdToR_fake')" | call StartR("R") | endif
   endfunction

   function! AutoCloseREPL() abort
      autocmd VimLeave * if exists("g:SendCmdToR") && string(g:SendCmdToR) != "function('SendCmdToR fake')" | call RQuit("nosave") | endif
   endfunction

   " mappings (open/close REPL \rf \rq) 
   " (view documentation/examples under cusr \rh \re)
   " (open/close object browser \ro)
   " (insert output for code block \o)
   " (summary stats \rs, plot \rg, args \ra, setwd \rd, print \rp, names \rn)
   " ----Nvim-R Plugin----

   " ----vim-signature---- (Nvim-R recommended)
   call dein#add('kshenoy/vim-signature', {
   \ 'on_ft': 'r',
   \ })

   " mappings (toggle / remove: mx, dmx), 
   " (place, if/then place, delete on line m, m., m-),
   " (move, ]`, [`, ]', ]' ,..., '`[])
   " ----vim-signature----

   " ----csv.vim---- (Nvim-R recommended)
   call dein#add('chrisbra/csv.vim', {
   \ 'on_ft': 'r',
   \ }) 

   " ----csv.vim----

   " ----SnipMate---- (Nvim-R recommended)
   call dein#add('garbas/vim-snipmate', {
   \ 'on_ft': 'r',
   \ })   

   " ----SnipMate----

   " ----vim-addon-mw-utils---- (SnipMate dependencies)
   call dein#add('MarcWeber/vim-addon-mw-utils', {
   \ 'on_ft': 'r',
   \ })   

   " ----vim-addon-mw-utils----

   " ----tlib---- (SnipMate dependencies)
   call dein#add('tomtom/tlib_vim', {
   \ 'on_ft': 'r',
   \ })   

   " ----tlib----

   " ----vim-snippets---- (SnipMate optional)
   call dein#add('honza/vim-snippets', {
   \ 'on_ft': 'r',
   \ })   

   " Options
   call dein#config('vim-snippets', {
   \ 'hook_add': "
   \ imap <C-J> <Plug>snipMateNextOrTrigger\n
   \ smap <C-J> <Plug>snipMateNextOrTrigger\n
   \ "})

   " mappings (trigger, jump to next tab stop <C-J>)
   " (show menu <C-R><Tab>)
   " ----vim-snippets----

   " ----ale---- (linting, Nvim-R recommended)
   " requires library(lintr) in .Rprofile
   " requires install.packages("lintr")
   call dein#add('w0rp/ale', {
   \ 'on_ft': 'r',
   \ })

   call dein#config('ale', {
   \ 'hook_add': "
   \ let g:ale_fixers = ['lintr']\n
   \ let g:ale_fix_on_save = 1\n
   \ let g:ale_completion_enable = 1\n
   \ "})
   " ----ale---- 

   " ----lintr---- (ale required)
   call dein#add('jimhester/lintr', {
   \ 'on_ft': 'r',
   \ }) 
   " ----lintr---- 

   " ----ncm-R---- (Nvim-R recommended)
   call dein#add('gaalcaras/ncm-R', {
   \ 'on_ft': 'r',
   \ })
   " ----ncm-R----

   " ----nvim-yarp---- (ncm-R required)
   call dein#add('roxma/nvim-yarp', {
   \ 'on_ft': 'r',
   \ }) 
   " ----nvim-yarp----

    " ----ncm2---- (Nvim-R recommended)
   call dein#add('ncm2/ncm2', {
   \ 'on_ft': 'r',
   \ })
   " ----ncm2----

   " ----ncm2-bufword---- (nvim-yarp required)
   call dein#add('ncm2/ncm2-bufword', {
   \ 'on_ft': 'r',
   \ })
   " ----nvm2-bufword----

   " ----ncm2-path---- (nvim-yarp required)
   call dein#add('ncm2/ncm2-path', {
   \ 'on_ft': 'r',
   \ })
   " ----ncm2-path----

  set completeopt=noinsert,menuone,noselect

  if !has('nvim')
      call dein#add('roxma/vim-hug-neovim-rpc', {
      \ 'on_ft': 'r',
      \ })
  endif

  " Required:
  call dein#end()
  call dein#call_hook('source')
  call dein#save_state()
endif

" Required:
filetype plugin indent on
syntax enable

" If you want to install not installed plugins on startup.
if dein#check_install()
  call dein#install()
endif

"End dein Scripts-------------------------

.Rprofile

library(colorout)
library(lintr)
options(help_type = "html")
wsdjeg commented 5 years ago

I will look into it.


Shidong Wang

-------- 原始邮件 -------- 主题:Re: [SpaceVim/SpaceVim] SpaceVim R layer doesn't function properly (#2505) 发件人:kayfay 收件人:SpaceVim/SpaceVim 抄送:Subscribed

Maybe this might help?

`"dein Scripts----------------------------- if &compatible set nocompatible " Be iMproved endif

" Required: set runtimepath+=/home/atools/.cache/dein/repos/github.com/Shougo/dein.vim

" Required: if dein#load_state('/home/atools/.cache/dein')

call dein#begin('/home/atools/.cache/dein')

" Let dein manage dein " Required: call dein#add('/home/atools/.cache/dein/repos/github.com/Shougo/dein.vim')

" Add or remove your plugins here like this: "call dein#add('Shougo/neosnippet.vim') "call dein#add('Shougo/neosnippet-snippets')

" ----Nvim-R plugin---- " Note let R_nvimpager = 'no' requires " options(help_type = "html") in '~/.Rprofile' call dein#add('jalvesaq/Nvim-R', { \ 'on_ft': 'r', \ })

" Send to REPL custom key bindings call dein#config('Nvim-R', { \ 'hook_add': " \ nmap : :Rsend \n \ vmap RDSendSelection\n \ nmap RDSendLine\n "})

" Nvim-R plugin config settings call dein#config('Nvim-R', { \ 'hook_add': " \ let R_nvimpager = 'no'\n \ let maplocalleader = ','\n \ "})

" Calls to functions for open/close R REPL on startup/exit function! AutoOpenREPL() abort autocmd FileType r if string(g:SendCmdToR) == "function('SendCmdToR_fake')" | call StartR("R") | endif endfunction

function! AutoCloseREPL() abort autocmd VimLeave * if exists("g:SendCmdToR") && string(g:SendCmdToR) != "function('SendCmdToR fake')" | call RQuit("nosave") | endif endfunction

call dein#source('jalvesaq/Nvim-R', { \ 'hook_source': function('AutoOpenREPL'), \ })

call dein#source('jalvesaq/Nvim-R', { \ 'hook_source': function('AutoCloseREPL') \ })

" ----Nvim-R Plugin----

" ----vim-signature---- (Nvim-R recommended) call dein#add('kshenoy/vim-signature', { \ 'on_ft': 'r', \ })

" mappings (toggle / remove: mx, dmx), " (place, if/then place, delete on line m, m., m-), " (move, ], [, ]', ]' ,..., '`[]) " ----vim-signature----

" ----csv.vim---- (Nvim-R recommended) call dein#add('chrisbra/csv.vim', { \ 'on_ft': 'r', \ })

" ----csv.vim----

" ----SnipMate---- (Nvim-R recommended) call dein#add('garbas/vim-snipmate', { \ 'on_ft': 'r', \ })

" ----snipMate----

" ----vim-addon-mw-utils---- (SnipMate dependencies) call dein#add('MarcWeber/vim-addon-mw-utils', { \ 'on_ft': 'r', \ })

" ----vim-addon-mw-utils----

" ----tlib---- (SnipMate dependencies) call dein#add('tomtom/tlib_vim', { \ 'on_ft': 'r', \ })

" ----tlib----

" ----vim-snippets---- (SnipMate optional) call dein#add('honza/vim-snippets', { \ 'on_ft': 'r', \ })

" Options call dein#config('vim-snippets', { \ 'hook_add': " \ imap snipMateNextOrTrigger\n \ smap snipMateNextOrTrigger\n \ "})

" mappings (trigger, jump to next tab stop ) " (show menu ) " ----vim-snippets----

" ----w0rp/ale---- (linting, Nvim-R recommended) " requires library(lintr) in .Rprofile " requires install.packages("lintr") call dein#add('w0rp/ale', { \ 'on_ft': 'r', \ })

call dein#config('ale', { \ 'hook_add': " \ let g:ale_fixers = ['lintr']\n \ let g:ale_fix_on_save = 1\n \ let g:ale_completion_enable = 1\n \ "}) " ----w0rp/ale----

" ----lintr---- (ale required) call dein#add('jimhester/lintr', { \ 'on_ft': 'r', \ }) " ----lintr----

" ----gaalcaras/ncm-R---- (Nvim-R recommended) call dein#add('ncm2/ncm2', { \ 'on_ft': 'r', \ }) " ----gaalcaras/ncm-R----

" ----roxma/nvim-yarp---- (ncm-R required) call dein#add('roxma/nvim-yarp', { \ 'on_ft': 'r', \ }) " ----roxma/nvim-yarp----

" ----ncm2/ncm2-bufword---- (nvim-yarp required) call dein#add('ncm2/ncm2-bufword', { \ 'on_ft': 'r', \ }) " ----ncm2/nvm2-bufword----

" ----ncm2/ncm2-path---- (nvim-yarp required) call dein#add('ncm2/ncm2-path', { \ 'on_ft': 'r', \ }) " ----ncm2/ncm2-path----

set completeopt=noinsert,menuone,noselect

if !has('nvim') call dein#add('roxma/vim-hug-neovim-rpc', { \ 'on_ft': 'r', \ }) endif

" Required: call dein#end() call dein#call_hook('source') call dein#save_state() endif

" Required: filetype plugin indent on syntax enable

" If you want to install not installed plugins on startup. if dein#check_install() call dein#install() endif

"End dein Scripts-------------------------`

― You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/SpaceVim/SpaceVim/issues/2505#issuecomment-457860932, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMiJkqsqPyQ-JCmRKl8-ev2svPMngKF9ks5vHLMBgaJpZM4aTwNl.

kayfay commented 5 years ago

You're awesome Wang.

vnijs commented 5 years ago

Any updates on this? I'm very interested to try out the functionality in nvim-r with spacevim

wsdjeg commented 5 years ago

In SpaceVim the lang#r layer is using wsdjeg/Nvim-R, and I want to make some change with this plugins.