<commit_before>" ############################################################################
"
"                               denite Setttings
"
"                                     -`
"                     ...            .o+`
"                  .+++s+   .h`.    `ooo/
"                 `+++%++  .h+++   `+oooo:
"                 +++o+++ .hhs++. `+oooooo:
"                 +s%%so%.hohhoo'  'oooooo+:
"                 `+ooohs+h+sh++`/:  ++oooo+:
"                  hh+o+hoso+h+`/++++.+++++++:
"                   `+h+++h.+ `/++++++++++++++:
"                            `/+++ooooooooooooo/`
"                           ./ooosssso++osssssso+`
"                          .oossssso-````/osssss::`
"                         -osssssso.      :ssss``to.
"                        :osssssss/  Mike  osssl   +
"                       /ossssssss/   8a   +sssslb
"                     `/ossssso+/:-        -:/+ossss'.-
"                    `+sso+:-`                 `.-/+oso:
"                   `++:.  github.com/mike325/.vim  `-/+/
"                   .`                                 `/
"
" ############################################################################

if !exists('g:plugs["denite.nvim"]')
    finish
endif

if executable('rg') || executable('ag')
    let s:tool = executable('rg') ? 'rg' : 'ag'
    call denite#custom#var('file/rec', 'command', split(FileListTool(s:tool)))

    call denite#custom#var('grep', 'command', split(GrepTool(s:tool, 'grepprg'))[0:0])
    call denite#custom#var('grep', 'default_opts', split(GrepTool(s:tool, 'grepprg'))[1:])
    call denite#custom#var('grep', 'recursive_opts', [])
    call denite#custom#var('grep', 'pattern_opt', [])
    call denite#custom#var('grep', 'separator', ['--'])
    call denite#custom#var('grep', 'final_opts', [])

    unlet s:tool

elseif has('unix')
    call denite#custom#var('file/rec', 'command', ['find', '.', '-type', 'f', '-iname', '*', g:ignore_patterns.find])

    call denite#custom#var('grep', 'command', split(GrepTool('grep', 'grepprg'))[0:0])
    call denite#custom#var('grep', 'default_opts', split(GrepTool('grep', 'grepprg'))[1:])
    call denite#custom#var('grep', 'recursive_opts', ['-r'])
    call denite#custom#var('grep', 'pattern_opt', ['-e'])
    call denite#custom#var('grep', 'separator', ['--'])
    call denite#custom#var('grep', 'final_opts', [])
elseif WINDOWS()
    let s:ignore = &wildignore . ',.git,.hg,.svn'
    call denite#custom#var('file/rec', 'command', ['scantree.py', '--ignore', s:ignore])
    unlet s:ignore

    if !executable('grep')
        call denite#custom#var('grep', 'command', ['findstr'])
        call denite#custom#var('grep', 'default_opts', ['/p', '/n'])
        call denite#custom#var('grep', 'recursive_opts', ['/s'])
        call denite#custom#var('grep', 'pattern_opt', [])
        call denite#custom#var('grep', 'separator', [])
        call denite#custom#var('grep', 'final_opts', ['*'])
    endif

endif

function! DeniteBuffer(prefix)
    let l:name = fnamemodify(fnamemodify(getcwd(), ':r'), ':t')
    return (empty(a:prefix) ? l:name : a:prefix . l:name)
endfunction

if executable('git')
    call denite#custom#alias('source', 'file/rec/git', 'file/rec')
    call denite#custom#var('file/rec/git', 'command', split(FileListTool('git')))

    call denite#custom#source('git/file/rec', 'sorters', ['sorter/sublime'])

    call denite#custom#alias('source', 'grep/git', 'grep')
    call denite#custom#var('grep/git', 'command', split(GrepTool('git', 'grepprg'))[0:2])
    call denite#custom#var('grep/git', 'default_opts', split(GrepTool('git',  'grepprg'))[3:])
    call denite#custom#var('grep/git', 'recursive_opts', [])
    call denite#custom#var('grep/git', 'pattern_opt', [])
    call denite#custom#var('grep/git', 'separator', [])
    call denite#custom#var('grep/git', 'final_opts', [])

    call denite#custom#source('git/grep', 'sorters', ['sorter/sublime'])

    nnoremap <silent> <C-p>  :<C-u>Denite -prompt='Files >' -buffer-name=<C-r>=DeniteBuffer('files_')<CR> <C-r>=finddir('.git', ';') != '' ? '-resume file/rec/git' : '-resume file/rec'<CR><CR>
    nnoremap <silent> g<C-p> :<C-u>Denite -prompt='Files >' -buffer-name=<C-r>=DeniteBuffer('files_')<CR> <C-r>=finddir('.git', ';') != '' ? 'file/rec/git' : 'file/rec'<CR><CR>

    nnoremap <silent> <C-g>  :<C-u>Denite -mode=normal -no-empty -prompt='Grep >' -buffer-name=<C-r>=DeniteBuffer('grep_')<CR> <C-r>=finddir('.git', ';') != '' ? 'grep/git' : 'grep'<CR><CR>
    nnoremap <silent> g<C-g> :<C-u>Denite -mode=normal -no-empty -prompt='Grep >' -buffer-name=<C-r>=DeniteBuffer('grep_')<CR> <C-r>=finddir('.git', ';') != '' ? 'grep/git' : 'grep'<CR>:::<C-r>=expand('<cword>')<CR><CR>
else
    nnoremap <silent> g<C-p> :<C-u>Denite -prompt='Files >' -buffer-name=<C-r>=DeniteBuffer('files_')<CR> file/rec<CR>
    nnoremap <silent> <C-p>  :<C-u>Denite -prompt='Files >' -buffer-name=<C-r>=DeniteBuffer('files_')<CR> -resume file/rec<CR>

    nnoremap <silent> <C-g>  :<C-u>Denite -mode=normal -prompt='Grep >' -buffer-name=<C-r>=DeniteBuffer('grep_')<CR> -no-empty grep<CR>
    nnoremap <silent> g<C-g> :<C-u>Denite -mode=normal -prompt='Grep >' -buffer-name=<C-r>=DeniteBuffer('grep_')<CR> -no-empty grep:::<C-r>=expand('<cword>')<CR><CR>
endif

" Default mappigns search for macros, but tags are already faster and more accurate
nnoremap ]d :<C-u>Denite -buffer-name=<C-r>=DeniteBuffer('grep_')<CR> -resume -cursor-pos=+1 -immediately<CR>
nnoremap [d :<C-u>Denite -buffer-name=<C-r>=DeniteBuffer('grep_')<CR> -resume -cursor-pos=-1 -immediately<CR>

nnoremap [D :<C-u>Denite -buffer-name=<C-r>=DeniteBuffer('grep_')<CR> -resume -cursor-pos=0 -immediately<CR>
nnoremap ]D :<C-u>Denite -buffer-name=<C-r>=DeniteBuffer('grep_')<CR> -resume -cursor-pos=$ -immediately<CR>

<commit_msg>Removed -resume for git file listing in denite<commit_after>" ############################################################################
"
"                               denite Setttings
"
"                                     -`
"                     ...            .o+`
"                  .+++s+   .h`.    `ooo/
"                 `+++%++  .h+++   `+oooo:
"                 +++o+++ .hhs++. `+oooooo:
"                 +s%%so%.hohhoo'  'oooooo+:
"                 `+ooohs+h+sh++`/:  ++oooo+:
"                  hh+o+hoso+h+`/++++.+++++++:
"                   `+h+++h.+ `/++++++++++++++:
"                            `/+++ooooooooooooo/`
"                           ./ooosssso++osssssso+`
"                          .oossssso-````/osssss::`
"                         -osssssso.      :ssss``to.
"                        :osssssss/  Mike  osssl   +
"                       /ossssssss/   8a   +sssslb
"                     `/ossssso+/:-        -:/+ossss'.-
"                    `+sso+:-`                 `.-/+oso:
"                   `++:.  github.com/mike325/.vim  `-/+/
"                   .`                                 `/
"
" ############################################################################

if !exists('g:plugs["denite.nvim"]')
    finish
endif

if executable('rg') || executable('ag')
    let s:tool = executable('rg') ? 'rg' : 'ag'
    call denite#custom#var('file/rec', 'command', split(FileListTool(s:tool)))

    call denite#custom#var('grep', 'command', split(GrepTool(s:tool, 'grepprg'))[0:0])
    call denite#custom#var('grep', 'default_opts', split(GrepTool(s:tool, 'grepprg'))[1:])
    call denite#custom#var('grep', 'recursive_opts', [])
    call denite#custom#var('grep', 'pattern_opt', [])
    call denite#custom#var('grep', 'separator', ['--'])
    call denite#custom#var('grep', 'final_opts', [])

    unlet s:tool

elseif has('unix')
    call denite#custom#var('file/rec', 'command', ['find', '.', '-type', 'f', '-iname', '*', g:ignore_patterns.find])

    call denite#custom#var('grep', 'command', split(GrepTool('grep', 'grepprg'))[0:0])
    call denite#custom#var('grep', 'default_opts', split(GrepTool('grep', 'grepprg'))[1:])
    call denite#custom#var('grep', 'recursive_opts', ['-r'])
    call denite#custom#var('grep', 'pattern_opt', ['-e'])
    call denite#custom#var('grep', 'separator', ['--'])
    call denite#custom#var('grep', 'final_opts', [])
elseif WINDOWS()
    let s:ignore = &wildignore . ',.git,.hg,.svn'
    call denite#custom#var('file/rec', 'command', ['scantree.py', '--ignore', s:ignore])
    unlet s:ignore

    if !executable('grep')
        call denite#custom#var('grep', 'command', ['findstr'])
        call denite#custom#var('grep', 'default_opts', ['/p', '/n'])
        call denite#custom#var('grep', 'recursive_opts', ['/s'])
        call denite#custom#var('grep', 'pattern_opt', [])
        call denite#custom#var('grep', 'separator', [])
        call denite#custom#var('grep', 'final_opts', ['*'])
    endif

endif

function! DeniteBuffer(prefix)
    let l:name = fnamemodify(fnamemodify(getcwd(), ':r'), ':t')
    return (empty(a:prefix) ? l:name : a:prefix . l:name)
endfunction

if executable('git')
    call denite#custom#alias('source', 'file/rec/git', 'file/rec')
    call denite#custom#var('file/rec/git', 'command', split(FileListTool('git')))

    call denite#custom#source('git/file/rec', 'sorters', ['sorter/sublime'])

    call denite#custom#alias('source', 'grep/git', 'grep')
    call denite#custom#var('grep/git', 'command', split(GrepTool('git', 'grepprg'))[0:2])
    call denite#custom#var('grep/git', 'default_opts', split(GrepTool('git',  'grepprg'))[3:])
    call denite#custom#var('grep/git', 'recursive_opts', [])
    call denite#custom#var('grep/git', 'pattern_opt', [])
    call denite#custom#var('grep/git', 'separator', [])
    call denite#custom#var('grep/git', 'final_opts', [])

    call denite#custom#source('git/grep', 'sorters', ['sorter/sublime'])

    nnoremap <silent> <C-p>  :<C-u>Denite -prompt='Files >' -buffer-name=<C-r>=DeniteBuffer('files_')<CR> <C-r>=finddir('.git', ';') != '' ? 'file/rec/git' : '-resume file/rec'<CR><CR>
    nnoremap <silent> g<C-p> :<C-u>Denite -prompt='Files >' -buffer-name=<C-r>=DeniteBuffer('files_')<CR> <C-r>=finddir('.git', ';') != '' ? 'file/rec/git' : 'file/rec'<CR><CR>

    nnoremap <silent> <C-g>  :<C-u>Denite -mode=normal -no-empty -prompt='Grep >' -buffer-name=<C-r>=DeniteBuffer('grep_')<CR> <C-r>=finddir('.git', ';') != '' ? 'grep/git' : 'grep'<CR><CR>
    nnoremap <silent> g<C-g> :<C-u>Denite -mode=normal -no-empty -prompt='Grep >' -buffer-name=<C-r>=DeniteBuffer('grep_')<CR> <C-r>=finddir('.git', ';') != '' ? 'grep/git' : 'grep'<CR>:::<C-r>=expand('<cword>')<CR><CR>
else
    nnoremap <silent> g<C-p> :<C-u>Denite -prompt='Files >' -buffer-name=<C-r>=DeniteBuffer('files_')<CR> file/rec<CR>
    nnoremap <silent> <C-p>  :<C-u>Denite -prompt='Files >' -buffer-name=<C-r>=DeniteBuffer('files_')<CR> -resume file/rec<CR>

    nnoremap <silent> <C-g>  :<C-u>Denite -mode=normal -prompt='Grep >' -buffer-name=<C-r>=DeniteBuffer('grep_')<CR> -no-empty grep<CR>
    nnoremap <silent> g<C-g> :<C-u>Denite -mode=normal -prompt='Grep >' -buffer-name=<C-r>=DeniteBuffer('grep_')<CR> -no-empty grep:::<C-r>=expand('<cword>')<CR><CR>
endif

" Default mappigns search for macros, but tags are already faster and more accurate
nnoremap ]d :<C-u>Denite -buffer-name=<C-r>=DeniteBuffer('grep_')<CR> -resume -cursor-pos=+1 -immediately<CR>
nnoremap [d :<C-u>Denite -buffer-name=<C-r>=DeniteBuffer('grep_')<CR> -resume -cursor-pos=-1 -immediately<CR>

nnoremap [D :<C-u>Denite -buffer-name=<C-r>=DeniteBuffer('grep_')<CR> -resume -cursor-pos=0 -immediately<CR>
nnoremap ]D :<C-u>Denite -buffer-name=<C-r>=DeniteBuffer('grep_')<CR> -resume -cursor-pos=$ -immediately<CR>


{'fraction_non_alphanumeric': 0.25730792446322326, 'fraction_numerical': 0.0027593343105975685, 'mean_word_length': 3.1885157096424703, 'pattern_counts': {'":': 0, '<': 159, '<?xml version=': 0, '>': 175, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 6, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4763657', 'n_tokens_mistral': 4556, 'n_tokens_neox': 4426, 'n_words': 652}