mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-24 02:37:06 +08:00
20 lines
618 B
VimL
20 lines
618 B
VimL
function! neoformat#formatters#r#enabled() abort
|
|
return ['styler', 'formatR']
|
|
endfunction
|
|
|
|
function! neoformat#formatters#r#styler() abort
|
|
return {
|
|
\ 'exe': 'R',
|
|
\ 'args': ['--slave', '--no-restore', '--no-save', '-e "styler::style_text(readr::read_file(file(\"stdin\")))"', '2>/dev/null'],
|
|
\ 'stdin': 1,
|
|
\}
|
|
endfunction
|
|
|
|
function! neoformat#formatters#r#formatR() abort
|
|
return {
|
|
\ 'exe': 'R',
|
|
\ 'args': ['--slave', '--no-restore', '--no-save', '-e "formatR::tidy_source(\"stdin\", arrow=FALSE)"', '2>/dev/null'],
|
|
\ 'stdin': 1,
|
|
\}
|
|
endfunction
|