conform.nix 702 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. {
  2. keymaps = [
  3. {
  4. key = "<leader>f";
  5. action.__raw = ''
  6. function()
  7. require('conform').format { async = true, lsp_fallback = true }
  8. end
  9. '';
  10. options.desc = "[F]ormat buffer";
  11. }
  12. ];
  13. plugins.conform-nvim = {
  14. enable = true;
  15. settings.formatters_by_ft = {
  16. lua = [ "lua_ls" ];
  17. javascript = [
  18. [
  19. "prettierd"
  20. "prettier"
  21. ]
  22. [
  23. "eslint_d"
  24. "eslint"
  25. ]
  26. ];
  27. typescript = [
  28. [
  29. "prettierd"
  30. "prettier"
  31. ]
  32. [
  33. "eslint_d"
  34. "eslint"
  35. ]
  36. ];
  37. };
  38. settings.notify_on_error = false;
  39. };
  40. }