Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/devOpifex/r.nvim
Formatter for R
https://github.com/devOpifex/r.nvim
Last synced: about 1 month ago
JSON representation
Formatter for R
- Host: GitHub
- URL: https://github.com/devOpifex/r.nvim
- Owner: devOpifex
- License: other
- Created: 2023-11-06T20:41:14.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2023-11-10T16:34:29.000Z (11 months ago)
- Last Synced: 2024-06-04T23:02:36.981Z (4 months ago)
- Language: R
- Homepage:
- Size: 11.7 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - devOpifex/r.nvim - Formatter for R (R)
README
# r.nvim
Formatter for R.
## Installation
``` r
# install.packages("remotes")
remotes::install_github("devOpifex/r.nvim")
```## Styles
Two styles available:
- `tidy`: [tidyverse](https://github.com/r-lib/styler)
- `grk`: [grkstyle](https://github.com/gadenbuie/grkstyle)These can be defined with the `.rnvim` config file like so:
```
style=tidy
```If this file is fount at the root of your project it is used,
otherwise it looks for the file in your home directory (`~/.rnvim`),
if that is not found it takes the function argument default (`tidy`).## Setup
You can setup for a project with `setup("tidy")` or `setup("grk")`.
See the previous section to create a system-wide config.## Formatter
To use with [conform.nvim](https://github.com/stevearc/conform.nvim).
Use it
```lua
local formatters = {
typescript = {"eslint_d", "prettier", },
go = { "gofmt", },
r = { "styler", },
}require("conform").setup({
formatters_by_ft = formatters,
})
```> {styler} is slow, increase the timeout of your format on save, e.g.:
```lua
require("conform").setup({
format_on_save = {
-- These options will be passed to conform.format()
timeout_ms = 2000,
lsp_fallback = true,
},
})
```