1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 17:40:06 +08:00

feat(neoformat): add formatters

This commit is contained in:
wsdjeg 2022-10-26 15:32:50 +08:00
parent e22871492f
commit 4ad5da84a3
7 changed files with 78 additions and 0 deletions

View File

@ -0,0 +1,11 @@
function! neoformat#formatters#blade#enabled() abort
return ['blade_formatter']
endfunction
function! neoformat#formatters#blade#blade_formatter() abort
return {
\ 'exe': 'blade-formatter',
\ 'args': ['--stdin', '-q'],
\ 'stdin': 1
\ }
endfunction

View File

@ -0,0 +1,11 @@
function! neoformat#formatters#gn#enabled() abort
return ['gn']
endfunction
function! neoformat#formatters#gn#gn() abort
return {
\ 'exe': 'gn',
\ 'args': ['format', '--stdin'],
\ 'stdin': 1,
\ }
endfunction

View File

@ -0,0 +1,11 @@
function! neoformat#formatters#htmldjango#enabled() abort
return ['djlint']
endfunction
function! neoformat#formatters#htmldjango#djlint() abort
return {
\ 'exe': 'djlint',
\ 'args': ['-', '--reformat'],
\ 'stdin': 1,
\ }
endfunction

View File

@ -0,0 +1,7 @@
function! neoformat#formatters#opencl#enabled() abort
return ['clangformat']
endfunction
function! neoformat#formatters#opencl#clangformat() abort
return neoformat#formatters#c#clangformat()
endfunction

View File

@ -0,0 +1,11 @@
function! neoformat#formatters#prisma#enabled() abort
return ['prettier']
endfunction
function! neoformat#formatters#prisma#prettier() abort
return {
\ 'exe': 'prettier',
\ 'args': ['--stdin-filepath', '"%:p"'],
\ 'stdin': 1,
\ }
endfunction

View File

@ -0,0 +1,20 @@
function! neoformat#formatters#solidity#enabled() abort
return ['prettierd', 'prettier']
endfunction
function! neoformat#formatters#solidity#prettier() abort
return {
\ 'exe': 'prettier',
\ 'args': ['--stdin-filepath', '"%:p"'],
\ 'stdin': 1,
\ 'try_node_exe': 1,
\ }
endfunction
function! neoformat#formatters#solidity#prettierd() abort
return {
\ 'exe': 'prettierd',
\ 'args': ['"%:p"'],
\ 'stdin': 1,
\ }
endfunction

View File

@ -0,0 +1,7 @@
function! neoformat#formatters#sugarss#enabled() abort
return ['stylelint']
endfunction
function! neoformat#formatters#sugarss#stylelint() abort
return neoformat#formatters#css#stylelint()
endfunction