R-nvim / R.nvim

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

feat(R.nvim): add roxygen2 support #227

Closed PMassicotte closed 1 month ago

PMassicotte commented 1 month ago

This PR introduces the ability to add a roxygen2 documentation skeleton above the current function when the cursor is positioned within it. The default key mapping for this feature is <localleader>ir. If you have suggestions for a more suitable keymap, I'm open to feedback.

feat(R.nvim): add roxygen2 support for inserting documentation skeletons docs(R.nvim): update documentation to include roxygen2 support fix(maps.lua): correct descriptions for RFormatNumbers and RFormatSubsetting

Demo:

Peek 2024-08-28 13-55

jalvesaq commented 1 month ago

I use Neogen for this when editing Lua and C, but it doesn't support R yet. It has instructions on how to add support for new languages: https://github.com/danymat/neogen/blob/main/docs/adding-languages.md I didn't read the instructions and don't plan to contribute to Neogen due to lack of time.

I prefer key bindings for frequently used commands. For the infrequent ones, it's easier to remember user commands. With neogen, the command is :Neogen.

PMassicotte commented 1 month ago

I added it as a command now. Would be nice to add that to neogen one day. I might check that when I have some time.

jalvesaq commented 1 month ago

It's great!

akthe-at commented 1 month ago

This is awesome, thanks for this @PMassicotte (I also was sad in the past that it was not supported by Neogen)

PMassicotte commented 1 month ago

I think I forgot to update documentation. I will push that.

PMassicotte commented 1 month ago

See 795d07cf33971b9ad9a358e0fb71573df7f71ef0