<commit_before>" Only do this part when compiled with support for autocommands (credit vimcasts)
if has("autocmd")
  " Enable file type detection
  filetype on
   
  " Syntax of these languages is fussy over tabs Vs spaces
  autocmd FileType make setlocal ts=8 sts=8 sw=8 noexpandtab
  autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
   
  " Customisations based on house-style (arbitrary)
  autocmd FileType html setlocal ts=2 sts=2 sw=2 expandtab
  autocmd FileType css setlocal ts=2 sts=2 sw=2 expandtab
  autocmd FileType javascript setlocal ts=4 sts=4 sw=4 noexpandtab
   
  " Treat .rss files as XML
  autocmd BufNewFile,BufRead *.rss setfiletype xml
  
  " Strip trailing whitespace on save
  autocmd BufWritePre .vimrc,*.rb,*.py,*.js :call <SID>StripTrailingWhitespaces()
endif

" ********************************* Functions ********************************* 
"
" Strip Trailing Whitespace Function (credit vimcasts)
function! <SID>StripTrailingWhitespaces()
    " Preparation: save last search, and cursor position.
    let _s=@/
    let l = line(".")
    let c = col(".")
    " Do the business:
    %s/\s\+$//e
    " Clean up: restore previous search history, and cursor position
    let @/=_s
    call cursor(l, c)
endfunction
<commit_msg>Auto save .vimrc file on save.<commit_after>" Only do this part when compiled with support for autocommands (credit vimcasts)
if has("autocmd")
  " Enable file type detection
  filetype on
   
  " Syntax of these languages is fussy over tabs Vs spaces
  autocmd FileType make setlocal ts=8 sts=8 sw=8 noexpandtab
  autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
   
  " Customisations based on house-style (arbitrary)
  autocmd FileType html setlocal ts=2 sts=2 sw=2 expandtab
  autocmd FileType css setlocal ts=2 sts=2 sw=2 expandtab
  autocmd FileType javascript setlocal ts=4 sts=4 sw=4 noexpandtab
   
  " Treat .rss files as XML
  autocmd BufNewFile,BufRead *.rss setfiletype xml
  
  " Sources .vimrc file on save.
  autocmd bufwritepost .vimrc source $MYVIMRC
  
  " Strip trailing whitespace on save
  autocmd BufWritePre .vimrc,*.rb,*.py,*.js :call <SID>StripTrailingWhitespaces()
endif

" ********************************* Functions ********************************* 
"
" Strip Trailing Whitespace Function (credit vimcasts)
function! <SID>StripTrailingWhitespaces()
    " Preparation: save last search, and cursor position.
    let _s=@/
    let l = line(".")
    let c = col(".")
    " Do the business:
    %s/\s\+$//e
    " Clean up: restore previous search history, and cursor position
    let @/=_s
    call cursor(l, c)
endfunction

{'fraction_non_alphanumeric': 0.1295376385173863, 'fraction_numerical': 0.01146350783339702, 'mean_word_length': 3.9303201506591336, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '4365869', 'n_tokens_mistral': 878, 'n_tokens_neox': 834, 'n_words': 295}