2021-03-18 05:24:49 +01:00
|
|
|
-- Example configuations here: https://github.com/mattn/efm-langserver
|
2021-03-17 19:15:20 +01:00
|
|
|
require"lspconfig".efm.setup {
|
|
|
|
init_options = {documentFormatting = true},
|
2021-03-18 05:24:49 +01:00
|
|
|
filetypes = {"lua", "python"},
|
2021-03-17 19:15:20 +01:00
|
|
|
settings = {
|
|
|
|
rootMarkers = {".git/"},
|
|
|
|
languages = {
|
|
|
|
lua = {
|
|
|
|
{
|
2021-03-17 20:48:52 +01:00
|
|
|
formatCommand = "lua-format -i --no-keep-simple-function-one-line --column-limit=100",
|
2021-03-17 19:15:20 +01:00
|
|
|
formatStdin = true
|
|
|
|
}
|
2021-03-18 05:24:49 +01:00
|
|
|
},
|
|
|
|
python = {
|
|
|
|
{
|
|
|
|
LintCommand = "flake8 --ignore=E501 --stdin-display-name ${INPUT} -",
|
|
|
|
lintStdin = true,
|
|
|
|
lintFormats = {"%f:%l:%c: %m"},
|
|
|
|
formatCommand = "yapf --quiet",
|
|
|
|
formatStdin = true
|
|
|
|
}
|
2021-03-17 19:15:20 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-03-17 20:48:52 +01:00
|
|
|
|
2021-03-18 05:24:49 +01:00
|
|
|
-- TODO turn these eslint and prettier examples into something good
|
|
|
|
-- TODO also shellcheck and shell formatting
|
|
|
|
-- Also find way to toggle format on save
|
|
|
|
-- maybe this will help: https://superuser.com/questions/439078/how-to-disable-autocmd-or-augroup-in-vim
|
|
|
|
-- {
|
|
|
|
-- lintCommand = "eslint_d -f unix --stdin --stdin-filename ${INPUT}",
|
|
|
|
-- lintIgnoreExitCode = true,
|
|
|
|
-- lintStdin = true,
|
|
|
|
-- lintFormats = {"%f:%l:%c: %m"},
|
|
|
|
-- }
|
|
|
|
|
|
|
|
|
|
|
|
-- local eslint = {
|
|
|
|
-- lintCommand = './node_modules/.bin/eslint -f compact --stdin',
|
|
|
|
-- lintStdin = true,
|
|
|
|
-- lintFormats = {'%f: line %l, col %c, %trror - %m', '%f: line %l, col %c, %tarning - %m'},
|
|
|
|
-- lintIgnoreExitCode = true,
|
|
|
|
-- formatCommand = './node_modules/.bin/prettier-eslint --stdin --single-quote --print-width 120',
|
|
|
|
-- formatStdin = true,
|
|
|
|
-- }
|
|
|
|
--
|
|
|
|
-- nvim_lsp.efm.setup({
|
|
|
|
-- init_options = { documentFormatting = true },
|
|
|
|
-- root_dir = nvim_lsp.util.root_pattern('.git/'),
|
|
|
|
-- filetypes = {'javascript', 'javascriptreact'},
|
|
|
|
-- settings = {
|
|
|
|
-- rootMarkers = {'.git/'},
|
|
|
|
-- languages = {
|
|
|
|
-- javascript = {eslint},
|
|
|
|
-- javascriptreact = {eslint},
|
|
|
|
-- }
|
|
|
|
-- }
|
|
|
|
-- })
|