<commit_before>" Enable spell checking.
set spell spelllang=en_us

" Use local spellfile if available.
let b:spellfile = expand('%:p:h').'/.spellfile.utf-8.add'
if filereadable(b:spellfile)
  let &l:spellfile = b:spellfile
  setlocal spell
  setlocal spelllang=en_us
else
  setlocal spellfile=
endif<commit_msg>Load local spellfile using autocmd<commit_after>" Enable spell checking.
set spell spelllang=en_us

" Use local spellfile if available.
function! s:spell_auto_local_spellfile() abort
  let b:spellfile = expand('%:p:h').'/.spellfile.utf-8.add'
  if filereadable(b:spellfile)
    let &l:spellfile = b:spellfile
    setlocal spell
    setlocal spelllang=en_us
  else
    setlocal spellfile=
  endif
endfunction

augroup vim-spellfile-local-augroup
  autocmd! *
  autocmd FileType * call s:spell_auto_local_spellfile()
augroup END
{'fraction_non_alphanumeric': 0.0967741935483871, 'fraction_numerical': 0.0023894862604540022, 'mean_word_length': 5.072463768115942, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4071116', 'n_tokens_mistral': 292, 'n_tokens_neox': 300, 'n_words': 72}