chopsticks/modules/lint.vim
m1ngsama 6044fc5fcb refactor: modular architecture — split .vimrc into 12 self-contained modules
Replace the monolithic 1268-line .vimrc with a thin loader that sources
12 modules under modules/ (env, plugins, core, ui, editing, navigation,
lsp, lint, git, writing, languages, tools). Each module is independently
readable and can be toggled by commenting one line.

Add interactive tutorial (tutor/chopsticks.tutor) with 10 lessons covering
all features. Users can run :ChopsticksLearn to start.
2026-04-22 00:05:10 +08:00

51 lines
1.5 KiB
VimL

" lint.vim — ALE async linting and format-on-save
let g:ale_disable_lsp = 1
let g:ale_linters = {
\ 'python': ['flake8', 'pylint'],
\ 'javascript': ['eslint'],
\ 'typescript': ['eslint'],
\ 'go': ['staticcheck'],
\ 'rust': ['cargo'],
\ 'c': ['cc'],
\ 'sh': ['shellcheck'],
\ 'yaml': ['yamllint'],
\ 'dockerfile': ['hadolint'],
\ 'css': ['stylelint'],
\ 'scss': ['stylelint'],
\ 'markdown': ['markdownlint'],
\ 'sql': ['sqlfluff'],
\}
let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'python': ['black', 'isort'],
\ 'javascript': ['prettier', 'eslint'],
\ 'typescript': ['prettier', 'eslint'],
\ 'go': ['goimports'],
\ 'rust': ['rustfmt'],
\ 'c': ['clang-format'],
\ 'json': ['prettier'],
\ 'yaml': ['prettier'],
\ 'html': ['prettier'],
\ 'css': ['prettier'],
\ 'scss': ['prettier'],
\ 'less': ['prettier'],
\ 'markdown': ['prettier'],
\ 'sql': ['sqlfluff'],
\}
let g:ale_fix_on_save = 1
let g:ale_python_isort_options = '--profile black'
let g:ale_sign_error = 'X'
let g:ale_sign_warning = '!'
let g:ale_lint_on_text_changed = 'normal'
let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_enter = 1
if exists('g:plugs["ale"]')
nnoremap <silent> [e :ALEPrevious<cr>
nnoremap <silent> ]e :ALENext<cr>
nnoremap <silent> <leader>aD :ALEDetail<cr>
endif