Nvim-R icon indicating copy to clipboard operation
Nvim-R copied to clipboard

custom `R_assign_output`-operator and additional `R_pipe`-operator

Open n0542344 opened this issue 5 years ago • 1 comments

Thanks a lot for the great plugin! Thanks to it I was able to switch from RStudio to nvim for my development. But there is a thing I wasn't able to do and I'm unsure if I just didn't understand the documentation or if this functionality isn't implemented.

I'd like to be able to switch the output when using the 'R_assign'-option (I just named this R_assign_output, but that name is obviously up to you). I normally try to have a separate line for (almost) everything, that's why most of my scripts use something similar to the following:

varname <-
  something

Therefore I'd like to change the output of the R_assign-operator from <- to <-<CR> . Is that possible?

In addition I'd like to ask if it is possible to also create an R_pipe-operator which would work in a similar way.

n0542344 avatar Jan 08 '21 10:01 n0542344

I have tried to include a new line in the output of R_assign, but the new line doesn't get indented. So, instead of

varname <-
    something

the result was

varname <-
something

If I added a single space after the \n, it did get indented, but the result was:

varname <-
     something

That is, it was wrongly indented too (5 spaces instead of 4). So, it seems that a simple R_assign_output option would not work.

jalvesaq avatar Jan 24 '21 12:01 jalvesaq