Comments (9)
Thanks for the feedback, @matchbook-o! I will let @PMassicotte close the issue if he doesn't want to investigate it further.
from r.nvim.
@PMassicotte : I have figured out the issue.
In order for treesitter to work, I had to install the nodejs dependency. Once I had that I had to run :TSInstall r.
Now everything works using R.nvim!
I will close the issue, thanks for taking a look.
from r.nvim.
What do you mean with \d
or \l
?
from r.nvim.
@PMassicotte, <LocalLeader>d
is the default key binding to send the current line and go to the next line, and <LocalLeader>l
is the default key binding to send the current line and stay put.
I can't replicate the reported issue. I can send new lines with no need to save the file. However, looking at line 95 of lua/r/send.lua
it's clear that the bug is related with treesitter
. I even get a warning that "need check nil":
@matchbook-o, do you have nvim-treesitter installed?
from r.nvim.
Maybe we could use this:
Lines 694 to 700 in 4d7a966
from r.nvim.
But I wonder why it works before adding new lines
from r.nvim.
@jalvesaq : I do have treesitter installed.
For more info: I didn't have this issue until I had to reinstall Fedora 39 on my machine (but I am unsure this is related)
Edit: if it helps, I can post my init file. Let me know!
from r.nvim.
This is my init file:
(EDIT: I still get this issue with a bare-bones init file)
" General Settings
set number
set clipboard=unnamedplus
set autoindent
syntax enable
" Plugin Management
call plug#begin('~/.vim/plugged')
Plug 'R-nvim/R.nvim'
Plug 'R-nvim/cmp-r'
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/nvim-cmp'
Plug 'nvim-treesitter/nvim-treesitter'
" For vsnip users.
Plug 'hrsh7th/cmp-vsnip'
Plug 'hrsh7th/vim-vsnip'
call plug#end()
" CMP Setup
lua <<EOF
-- Set up nvim-cmp.
local cmp = require'cmp'
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
-- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
end,
},
window = {
-- completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'vsnip' }, -- For vsnip users.
-- { name = 'luasnip' }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users.
}, {
{ name = 'buffer' },
})
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
}, {
{ name = 'buffer' },
})
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
}),
matching = { disallow_symbol_nonprefix_matching = false }
})
-- Set up lspconfig.
local capabilities = require('cmp_nvim_lsp').default_capabilities()
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
require('lspconfig')['r_language_server'].setup {
capabilities = capabilities
}
EOF
" LaTeX Compilation
"au FileType tex nmap <leader>ll <Plug>Tex_Compile
"au FileType tex nmap <leader>lv <Plug>Tex_View
" Text Wrapping "
:set linebreak
" Appearance
set background=dark
" Line Numbers & Indentation
set backspace=indent,eol,start
set ma
set expandtab
set smarttab
set autoindent
set si
set wrap
" Search
set ignorecase
set smartcase
set hlsearch
set incsearch
set magic
" Brackets
set showmatch
set mat=2
" Errors
set noerrorbells
" Color & Fonts
set encoding=utf8
if $COLORTERM == 'gnome-terminal'
set t_Co=256
endif
from r.nvim.
@jalvesaq : I have managed to fix this issue by using your NvimR plug in (the old one) instead of this new one. Everything there works fine with the init file above.
Feel free to close this ticket, although I hope the bug report has some value.
from r.nvim.
Related Issues (20)
- Breaking changes introduced by the latest version of treesitter? HOT 29
- Issue from LSP? HOT 3
- Upcoming R version might break nvimcom HOT 7
- nvimcom fails to compile since 4f28bfd HOT 3
- Has function of `<Leader>l` and `<Leader>d` been changed? HOT 10
- In tmux RDSendLine does not work when opening a second buffer HOT 3
- Running R in a ToggleTerm HOT 4
- .Rnw does not highlight latex syntax until I do :e HOT 3
- renv is ignored when using external_term HOT 10
- R code lines incorrectly identified HOT 16
- Rpipe sends keymap string instead of pipe operator `|>` HOT 9
- Syntax highlighting is not enabled in the help window HOT 4
- Better capture nodes for printing the object under the cursor HOT 6
- omnifunc not set HOT 3
- What is the proper place to custom map/keybindings? HOT 3
- nvimcom:::source.and.clean inconsistently needs plot() HOT 7
- Commands in R markdown (.rmd) documents not sent when nested in HTML tags HOT 9
- Segmentation Fault in nvimcom When Opening and Closing R Files Without Starting R HOT 8
- Add pyodide and webr extensions to qmd HOT 4
- Server crashes when trying to use `spData` package HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from r.nvim.