DEV Community

Discussion on: Show and tell: Show off your vim setup 🚀

Collapse
 
reobin profile image
Robin Gagnon

Nice setup!

Is ALE displaying the warnings and errors in the gutter? I've always wanted to integrate ALE to my setup.

Collapse
 
jamescarr profile image
James Carr

Yep! Here's my config for it:

let g:ale_fixers = {
      \   'python': [
      \       'black',
      \       'isort'
      \   ],
      \}
let g:ale_fix_on_save = 1

let g:ale_sign_error = '❌'
let g:ale_sign_warning = '⚠️'

function! LinterStatus() abort
  let l:counts = ale#statusline#Count(bufnr(''))

  let l:all_errors = l:counts.error + l:counts.style_error
  let l:all_non_errors = l:counts.total - l:all_errors

  return l:counts.total == 0 ? '? all good ?' : printf(
        \   '?? %dW %dE',
        \   all_non_errors,
        \   all_errors
        \)
endfunction

set statusline=
set statusline+=%m
set statusline+=\ %f
set statusline+=%=
set statusline+=\ %{LinterStatus()}