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.
 
 
 
 
 
 

47 lines
1.6 KiB

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