R-nvim / R.nvim

Neovim plugin to edit R files
GNU General Public License v3.0
128 stars 15 forks source link

Add a new module to replace all the '$' subsetting operators with '[[' in the current buffer #157

Closed PMassicotte closed 1 week ago

PMassicotte commented 1 week ago

This PR add a new module to replace all the $ subsetting operators with [[ in the current buffer. The new keybinding is <localleader>cs (change subsetting).

This works with any number of nested subset:

x$a

x$a$b$c$d

Will become:

x[["a"]]

x[["a"]][["b"]][["c"]][["d"]]

I also created a new folder named format that includes all the new lua modules dedicated to format R code to comply with the lintr package.

jalvesaq commented 1 week ago

Great job! The only thing missing is the documentation.

PMassicotte commented 1 week ago

oups! will do that!

PMassicotte commented 1 week ago

To make sure I do things correctly for the documentation. Should I modify directly the R.nvim.txt by adding a new section?

jalvesaq commented 1 week ago

To make sure I do things correctly for the documentation. Should I modify directly the R.nvim.txt by adding a new section?

Yes, we have no other similar feature. So, its documentation would be in a new section.

jalvesaq commented 1 week ago

Opss. I thought that this was about installing packages...

PMassicotte commented 1 week ago

Was asking because I was wondering if this file was automatically generated based on function headers (likr using roxygen).

jalvesaq commented 1 week ago

I think that section 6.36. can have a general title to accommodate both "Converting numbers to explicit integers" and "Replace subsetting operators".

PMassicotte commented 1 week ago

I modified the help section. Let me know if you think it needs more improvement.

jalvesaq commented 1 week ago

It's good! Thanks!