Comments (32)
But we could try to change the value of vim.o.iskeywords
temporarily. It will be much simpler than the complicated algorithm that I have written.
from r.nvim.
nvimcom
and rnvimserver
now send Lua tables to R.nvim. You have to update cmp-nvim-r
.
There are some bugs when completing functions from .GlobalEnv
, but I will fix them later.
from r.nvim.
I moved the check for radian to the config. It's working there.
from r.nvim.
I rewrote get_first_obj()
and now it is as good and as bad as Nvim-R's version. I don't want to improve it any further because perhaps it will be possible (and better) to rewrite it using tree-sitter in the future. To quickly test the function, I have put this in my init.lua
:
vim.keymap.set("n", "T", function ()
vim.api.nvim_echo({
{"{"},
{require("r.run").get_keyword(), "Function"},
{"} {"},
{require("r.cursor").get_first_obj(), "Type"},
{"}"}}, false, {})
end, { expr = true})
from r.nvim.
With this option, I receive a warning message:
Invalid nvimpager
value: "horizontal". Valid values are: "tab", "split", "float", and "no".
And nothing more happens. Hence, we have to investigate why you are not receiving this warning.
from r.nvim.
The warning should be wrapped by vim.schedule()
. This is fixed now.
from r.nvim.
Yes, please, do git pull
to get the warnings. I didn't see the warn bug because I had this in my lazy.nvim config:
{
'rcarriga/nvim-notify',
config = function ()
-- Overriding vim.notify with fancy notify
local notify = require("notify")
vim.notify = notify
notify.setup()
vim.keymap.set('', '<Esc>', "<ESC>:noh<CR>:lua require('notify').dismiss()<CR>", {silent = true})
end
},
from r.nvim.
But you can also send lines from the Example section to R. The rdoc is modifiable to allow you to edit the examples. There was a bug that I fixed just now.
from r.nvim.
An option to send the current object to the terminal:
if rcmd == "print" then
send.cmd(vim.fn.expand("<cword>"))
return
end
from r.nvim.
An option to send the current object to the terminal:
The problem is that vim.fn.expand("<cword>")
will not catch strings such as listname$element
.
from r.nvim.
The problem while running <LocalLeader>rp
is the function get_first_obj()
. It has to be rewritten from scratch.
from r.nvim.
Has something about terminal color changed this recently? Looks like a new config is coloring my terminal. Nevermind, I just set hl_term = false
and it is all good.
from r.nvim.
Yes, hl_term
is being defined as true
, but nvimcom/R/nvimcom.R
should detect radian
:
if (length(find.package("colorout", quiet = TRUE, verbose = FALSE)) > 0 || Sys.getenv("RADIAN_VERSION") != "")
hascolor <- TRUE
from r.nvim.
It was opening radian, but my console was all green-ish.
from r.nvim.
I did a minor improvement in get_first_obj
. With the following code:
x <- rnorm(100)
y <- rnorm(100)
m <- lm(y ~ x)
summary(x)
summary(m)
If you press <LocalLeader>rp
over summary
, you should get different results for each summary()
from r.nvim.
I did a minor improvement in
get_first_obj
. With the following code:x <- rnorm(100) y <- rnorm(100) m <- lm(y ~ x) summary(x) summary(m)If you press
<LocalLeader>rp
oversummary
, you should get different results for eachsummary()
Is it works if my cursor is either on x
or m
!
from r.nvim.
rh
(for help) is not working for a namespaced function. For examplepack::fun()
I can't replicate this. It works for me, for example doing <LocalLeader>rh
over the word vi
:
vi
nvimcom::vi
utils::vi
from r.nvim.
Placing my cursor on library
and hitting <LocalLeader>rh
does nothing. With the older nrim-r, it opens the help file for the library()
function.
Now, placing my cursor on vi
indeed brings me a topic menu. Then, If I select either 1 for nvimcom or 2 for utils, nothing happens.
from r.nvim.
Maybe you have set options("pager")
in your ~/.Rprofile
... I couldn't think of another explanation.
from r.nvim.
Also: \rh
only works if R is running, but, if not, R.nvim displays a warning message.
from r.nvim.
No option about pager in my rprofile.
Even typing ?lm
in the console does nothing.
So it looks like that tmp-R-Nvim
is not opening a new window properly.
from r.nvim.
The only pager option I have is this config:
opts = {
...
nvimpager = "horizontal",
...
}
from r.nvim.
You are right, it works as before when using 'split'. I probably missed the change of the parameter (i.e. using an old value that was working with nvim-r).
from r.nvim.
What is supposed to be the file type of rdoc?
For me, :set filetype?
returns nothing
Hence, sending example code in the terminal is not working because not recognized as r code.
from r.nvim.
The filetype rdoc
no longer exists; only the syntax is being used.
from r.nvim.
It was a filetype that I created to display R documentation. Its functions are now in lua/r/rdoc.lua
.
from r.nvim.
The filetype
rdoc
no longer exists; only the syntax is being used.
Do you have a good strategy to send example code to the console? I found it was a nice thing to do while browsing code example and have the ability to send it to the console.
from r.nvim.
\re
to get the "Examples" section in an R buffer.
from r.nvim.
Another thing I am just facing is that sending above code does not always work. In this example, moving the cursor 2 lines below give me an error cannot open the connection. Moving back the cursor up, make it works again.
Maybe we can just grab all the lines above and send them directly to the console instead of writing a tmp file.
from r.nvim.
But you can also send lines from the Example section to R. The rdoc is modifiable to allow you to edit the examples. There was a bug that I fixed just now.
You are on fire :)
from r.nvim.
Another thing I am just facing is that sending above code does not always work. In this example, moving the cursor 2 lines below give me an error cannot open the connection. Moving back the cursor up, make it works again.
Two lines above you were below the threshold of 20 lines to source lines and the lines were sent directly. I introduced the bug yesterday when fixing user config variables not being recognized. It should be fixed now.
from r.nvim.
All perfect now!
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.