<commit_before>" Setup windows for Git commit message editing.
" It scrolls to "Changes" in the buffer, splits the window etc.
" This allows for reviewing the diff (from `git commit -v`) while editing the
" commit message easily.
if get(b:, 'fugitive_type', '') !=# 'index'  " Skip with fugitive :Gstatus
  let b:my_auto_scrolloff=0
  setlocal foldmethod=syntax foldlevel=1 nohlsearch spell spl=de,en sw=2 scrolloff=0

  augroup vimrc_gitcommit
    autocmd BufWinEnter <buffer>
          \ exe 'g/^# \(Changes not staged\|Untracked files\)/norm! zc'
          \ | silent! exe '?^# Changes to be committed:'
          \ | exe 'norm! zt'
          \ | belowright exe max([5, min([10, (winheight(0) / 3)])]).'split'
          \ | exe 'normal! gg'<commit_msg>vim: update ftplugin/gitcommit.vim<commit_after>" Setup windows for Git commit message editing.
" It scrolls to "Changes" in the buffer, splits the window etc.
" This allows for reviewing the diff (from `git commit -v`) while editing the
" commit message easily.
if has_key(b:, 'b:fugitive_commit_arguments')
      \ || get(b:, 'fugitive_type', '') !=# 'index'  " Skip with fugitive :Gstatus
  if !(tabpagenr('$') == 1 && winnr('$') == 1)
    " Only with single windows (for Q mapping at least).
    finish
  endif
  let b:my_auto_scrolloff=0
  setlocal foldmethod=syntax foldlevel=1 nohlsearch spell spl=de,en sw=2 scrolloff=0

  augroup vimrc_gitcommit
    autocmd BufWinEnter <buffer>
          \ exe 'keeppatterns g/^# \(Changes not staged\|Untracked files\)/norm! zc'
          \ | silent! exe 'keeppatterns ?^# Changes to be committed:'
          \ | exe 'norm! zt'
          \ | belowright exe max([5, min([10, (winheight(0) / 3)])]).'split'
          \ | exe 'normal! gg'
{'fraction_non_alphanumeric': 0.13264129181084197, 'fraction_numerical': 0.011534025374855825, 'mean_word_length': 3.2839506172839505, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5908373', 'n_tokens_mistral': 602, 'n_tokens_neox': 577, 'n_words': 187}