efm-general-ls.lua 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. -- Example configuations here: https://github.com/mattn/efm-langserver
  2. require"lspconfig".efm.setup {
  3. init_options = {documentFormatting = true},
  4. filetypes = {"lua", "python"},
  5. settings = {
  6. rootMarkers = {".git/"},
  7. languages = {
  8. lua = {
  9. {
  10. formatCommand = "lua-format -i --no-keep-simple-function-one-line --column-limit=100",
  11. formatStdin = true
  12. }
  13. },
  14. python = {
  15. {
  16. LintCommand = "flake8 --ignore=E501 --stdin-display-name ${INPUT} -",
  17. lintStdin = true,
  18. lintFormats = {"%f:%l:%c: %m"},
  19. formatCommand = "yapf --quiet",
  20. formatStdin = true
  21. }
  22. }
  23. }
  24. }
  25. }
  26. -- TODO turn these eslint and prettier examples into something good
  27. -- TODO also shellcheck and shell formatting
  28. -- Also find way to toggle format on save
  29. -- maybe this will help: https://superuser.com/questions/439078/how-to-disable-autocmd-or-augroup-in-vim
  30. -- {
  31. -- lintCommand = "eslint_d -f unix --stdin --stdin-filename ${INPUT}",
  32. -- lintIgnoreExitCode = true,
  33. -- lintStdin = true,
  34. -- lintFormats = {"%f:%l:%c: %m"},
  35. -- }
  36. -- local eslint = {
  37. -- lintCommand = './node_modules/.bin/eslint -f compact --stdin',
  38. -- lintStdin = true,
  39. -- lintFormats = {'%f: line %l, col %c, %trror - %m', '%f: line %l, col %c, %tarning - %m'},
  40. -- lintIgnoreExitCode = true,
  41. -- formatCommand = './node_modules/.bin/prettier-eslint --stdin --single-quote --print-width 120',
  42. -- formatStdin = true,
  43. -- }
  44. --
  45. -- nvim_lsp.efm.setup({
  46. -- init_options = { documentFormatting = true },
  47. -- root_dir = nvim_lsp.util.root_pattern('.git/'),
  48. -- filetypes = {'javascript', 'javascriptreact'},
  49. -- settings = {
  50. -- rootMarkers = {'.git/'},
  51. -- languages = {
  52. -- javascript = {eslint},
  53. -- javascriptreact = {eslint},
  54. -- }
  55. -- }
  56. -- })