Created
September 17, 2021 06:24
-
-
Save SamLiu79/7b02a7cebd28a79e5d7c7f59182d3c5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local formatter = require('formatter') | |
formatter.setup({ | |
filetype = { | |
lua = { | |
-- luafmt | |
function() | |
return { | |
exe = 'stylua', | |
args = { | |
'--column-width', | |
'80', | |
'--color', | |
'Never', | |
'--indent-type', | |
'Spaces', | |
'--line-endings', | |
'Unix', | |
'--quote-style', | |
'AutoPreferSingle', | |
'-', | |
}, | |
stdin = true, | |
} | |
end, | |
}, | |
yaml = { | |
function() | |
return { | |
exe = 'prettier', | |
args = {"--stdin-filepath", '--tab-width=2', vim.fn.fnameescape(vim.api.nvim_buf_get_name(0)) }, | |
stdin = true, | |
} | |
end, | |
}, | |
--[[ python = { | |
-- prettier | |
function() | |
return { | |
exe = 'black', | |
args = { '-', '-l', '88' }, | |
stdin = true, | |
} | |
end, | |
}, ]] | |
sh = { | |
-- Shell Script Formatter | |
function() | |
return { | |
exe = 'shfmt', | |
args = { '-i', 2 }, | |
stdin = true, | |
} | |
end, | |
}, | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment