<commit_before>" vim: tw=80

let s:options = {
      \ 'dispatch':  0,
      \ 'quickfix':  1,
      \ 'open':      0,
      \ 'switch':    0,
      \ 'jump':      1,
      \ 'cword':     0,
      \ 'next_tool': '<tab>',
      \ 'tools':     ['git', 'ag', 'pt', 'ack', 'grep', 'findstr'],
      \ 'git':       { 'grepprg': 'git grep -nI',
      \                'grepformat': '%f:%l:%m',
      \                'escape': '\$.*%#[]' },
      \ 'ag':        { 'grepprg': 'ag --vimgrep',
      \                'grepformat': '%f:%l:%c:%m,%f:%l:%m',
      \                'escape': '\^$.*+?()[]' },
      \ 'pt':        { 'grepprg': 'pt --nogroup',
      \                'grepformat': '%f:%l:%m' },
      \ 'ack':       { 'grepprg': 'ack --noheading --column',
      \                'grepformat': '%f:%l:%c:%m',
      \                'escape': '\^$.*+?()[]' },
      \ 'grep':      { 'grepprg': 'grep -Rn $* .',
      \                'grepformat': '%f:%l:%m',
      \                'escape': '\$.*[]' },
      \ 'findstr':   { 'grepprg': 'findstr -rspnc:"$*" *',
      \                'grepformat': '%f:%l:%m' },
      \ }

" Escape test line:
" .. ad\\f 40+  $ # @ ! % ^ & &*()_{}4304\ '  "" ? `9$343 %  $ ^ adfadf [ ad )  [  (

if exists('g:grepper')
  for key in keys(g:grepper)
    if type(s:options[key]) == type({})
      call extend(s:options[key], g:grepper[key])
    else
      let s:options[key] = g:grepper[key]
    endif
  endfor
endif

call filter(s:options.tools, 'executable(v:val)')

let ack     = index(s:options.tools, 'ack')
let ackgrep = index(s:options.tools, 'ack-grep')

if (ack >= 0) && (ackgrep >= 0)
  call remove(s:options.tools, ackgrep)
endif

let s:cmdline = ''
let s:id      = 0
let s:slash   = exists('+shellslash') && !&shellslash ? '\' : '/'

let s:magic_string = '$$$mAgIc###'<commit_msg>Properly extend s:options from g:grepper<commit_after>" vim: tw=80

let s:options = {
      \ 'dispatch':  0,
      \ 'quickfix':  1,
      \ 'open':      0,
      \ 'switch':    0,
      \ 'jump':      1,
      \ 'cword':     0,
      \ 'next_tool': '<tab>',
      \ 'tools':     ['git', 'ag', 'pt', 'ack', 'grep', 'findstr'],
      \ 'git':       { 'grepprg': 'git grep -nI',
      \                'grepformat': '%f:%l:%m',
      \                'escape': '\$.*%#[]' },
      \ 'ag':        { 'grepprg': 'ag --vimgrep',
      \                'grepformat': '%f:%l:%c:%m,%f:%l:%m',
      \                'escape': '\^$.*+?()[]' },
      \ 'pt':        { 'grepprg': 'pt --nogroup',
      \                'grepformat': '%f:%l:%m' },
      \ 'ack':       { 'grepprg': 'ack --noheading --column',
      \                'grepformat': '%f:%l:%c:%m',
      \                'escape': '\^$.*+?()[]' },
      \ 'grep':      { 'grepprg': 'grep -Rn $* .',
      \                'grepformat': '%f:%l:%m',
      \                'escape': '\$.*[]' },
      \ 'findstr':   { 'grepprg': 'findstr -rspnc:"$*" *',
      \                'grepformat': '%f:%l:%m' },
      \ }

" Escape test line:
" .. ad\\f 40+  $ # @ ! % ^ & &*()_{}4304\ '  "" ? `9$343 %  $ ^ adfadf [ ad )  [  (

if exists('g:grepper')
  for key in keys(g:grepper)
    if type(g:grepper[key]) == type({})
      if !has_key(s:options, key)
        let s:options[key] = {}
      endif
      call extend(s:options[key], g:grepper[key])
    else
      let s:options[key] = g:grepper[key]
    endif
  endfor
endif

call filter(s:options.tools, 'executable(v:val)')

let ack     = index(s:options.tools, 'ack')
let ackgrep = index(s:options.tools, 'ack-grep')

if (ack >= 0) && (ackgrep >= 0)
  call remove(s:options.tools, ackgrep)
endif

let s:cmdline = ''
let s:id      = 0
let s:slash   = exists('+shellslash') && !&shellslash ? '\' : '/'

let s:magic_string = '$$$mAgIc###'
{'fraction_non_alphanumeric': 0.24780409901517167, 'fraction_numerical': 0.011179132286398722, 'mean_word_length': 1.7055435565154788, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '311026', 'n_tokens_mistral': 1522, 'n_tokens_neox': 1462, 'n_words': 265}