my configs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

63 lines
2.1 KiB

  1. let g:ale_fixers = {
  2. \ '*': ['remove_trailing_lines', 'trim_whitespace'],
  3. \ 'javascript': ['prettier', 'eslint'],
  4. \ 'typescript': ['prettier', 'tslint', 'eslint'],
  5. \ 'typescriptreact': ['prettier', 'tslint', 'eslint'],
  6. \ 'html': ['eslint'],
  7. \ 'json': ['prettier', 'fixjson', 'jq'],
  8. \ 'scss': ['prettier', 'stylelint'],
  9. \ 'css': ['prettier', 'stylelint'],
  10. \ 'less': ['prettier', 'stylelint'],
  11. \ 'stylus': ['stylelint',],
  12. \ 'c': ['clang-format'],
  13. \ 'cpp': ['clang-format'],
  14. \ 'rust': ['rustfmt'],
  15. \ 'python': ['yapf', 'isort', 'black'],
  16. \ 'zsh': ['shfmt'],
  17. \ 'sh': ['shfmt'],
  18. \ 'go': ['gofmt', 'goimports'],
  19. \ 'markdown': ['prettier'],
  20. \ 'vimwiki': ['prettier'],
  21. \ 'vue': ['prettier'],
  22. \ 'yaml': ['prettier'],
  23. \ 'ansible': ['prettier'],
  24. \ 'puppet': ['puppetlint'],
  25. \ 'java': ['google_java_format']}
  26. let g:ale_fix_on_save = 1
  27. let g:ale_go_gofmt_options = '-s'
  28. let g:ale_go_gometalinter_options = '--fast'
  29. let g:ale_go_golangci_lint_options = '--fast'
  30. let g:ale_go_golangci_lint_package = 1
  31. let g:ale_rust_cargo_use_clippy = 1
  32. let g:ale_rust_analyzer_config = {
  33. \'rust-analyzer': {
  34. \ 'assist': {
  35. \ 'importMergeBehavior': 'last',
  36. \ 'importPrefix': 'by_self',
  37. \ },
  38. \ 'cargo.loadOutDirsFromCheck': v:true,
  39. \ 'procMacro.enable': v:true }}
  40. let g:ale_linters = {
  41. \ 'go': ['golangci-lint', 'gobuild', 'golint'],
  42. \ 'rust': ['cargo', 'rls'],
  43. \ 'typescript': ['tslint', 'tsserver', 'typecheck']}
  44. let g:ale_completion_enabled = 1
  45. let g:ale_echo_msg_error_str = 'E'
  46. let g:ale_echo_msg_warning_str = 'W'
  47. let g:ale_echo_msg_format = '[%linter%] [%severity%] %code: %%s '
  48. " alt k & j to jump through errors
  49. nmap <silent> <M-k> <Plug>(ale_previous_wrap)
  50. nmap <silent> <M-j> <Plug>(ale_next_wrap)
  51. " Disable for minified code and enable whitespace trimming
  52. let g:ale_pattern_options = {
  53. \ '\.min\.js$': {'ale_linters': [], 'ale_fixers': []},
  54. \ '\.min\.css$': {'ale_linters': [], 'ale_fixers': []},
  55. \ '*': {'ale_fixers': ['trim_whitespace', 'remove_trailing_lines']}}
  56. let g:ale_set_loclist = 0
  57. let g:ale_set_quickfix = 1
  58. command! ALEToggleFixer execute "let g:ale_fix_on_save = get(g:, 'ale_fix_on_save', 0) ? 0 : 1"
  59. "let g:ale_open_list = 1