<commit_before>" Setup mappings
if exists('g:MagicMapAll') && g:MagicMapAll == 1
    " Close quickfix if async job returned success
    fun! s:AsyncDone(onsuccess)
        if g:asyncrun_code == 0
            cclose
            if a:onsuccess != ""
                exec a:onsuccess
            endif
        else
            cwindow
        endif
    endfun
    command! -nargs=0 AsyncRunDone call s:AsyncDone("")
    command! -nargs=0 AsyncRunPost call s:AsyncDone("MCRun")

    fun! s:AsyncRunAutoClose(bang, cmd, post)
        if a:post != ""
            silent exe "AsyncRun".a:bang." -post=AsyncRunPost ".a:cmd
        else
            silent exe "AsyncRun".a:bang." -post=AsyncRunDone ".a:cmd
        endif
    endfun
    command! -nargs=1 -bang AsyncRunAutoClose call s:AsyncRunAutoClose('<bang>', <q-args>, "")
    command! -nargs=1 -bang AsyncRunAutoPost call s:AsyncRunAutoClose('<bang>', <q-args>, "MCRun")

    " Magicified grep commands my common use cases
    fun! s:AsyncGrep(searchy)
        " echom a:searchy
        let l:pgm = '-program=grep '
        let l:ignore_prefix = '--ignore '
        let l:ignore_list = ['build', 'vs2013', 'vs2015', 'lib']
        let l:ignore_string = join(map(l:ignore_list, '"--ignore ".v:val'))
        silent exe "AsyncRun! ".l:pgm . l:ignore_string . " " . a:searchy
    endfun
    command! -nargs=1 -bang AsyncGrep call s:AsyncGrep(<q-args>)

    command! -nargs=1 VGall silent exe "AsyncGrep " .<q-args>
    command! -nargs=1 VGsrc silent exe "AsyncGrep --cpp " .<q-args>. " ./src"
    command! -nargs=1 VGlay silent exe "AsyncGrep " .<q-args>. " ./data"
    command! -nargs=1 VGset silent exe "AsyncGrep " .<q-args>. " ./settings"
    command! -nargs=1 VGcin silent exe "AsyncGrep --cpp " .<q-args>. " ". expand('$DS_PLATFORM_090')

    " Git
    nmap <leader>gp :AsyncRun git push<cr>
    nmap <leader>gu :AsyncRun git pull<cr>

    nmap <leader>av :AV<cr>
    nmap <leader>as :A<cr>
    nmap <leader>ah :AS<cr>

    " Compile for OSX & Windows using MagicJob()
    nmap <silent> <leader>bb :MCompile DEBUG<cr>
    nmap <silent> <leader>br :MCompile RELEASE<cr>
    nmap <silent> <leader>bt :MCompile! TEST<cr>
    nmap <silent> <leader>bd :MCompile DOC<cr>
    nmap <silent> <leader>B :MCompile! RELEASE<cr>
    nmap <silent> <leader>r :MCRun<cr>
    nmap <silent> <leader>bk :AsyncStop!<cr>

    nnoremap <silent> <leader>ep :e ~/.vim/bundle/personal-magic.vim/<cr>

    " Alternate files (from LucHermitte/alternate-lite)
    nmap <silent> <leader>av :AV<cr>
    nmap <silent> <leader>ah :AS<cr>
    nmap <silent> <leader>as :A<cr>

    " Quickfix / MagicJob output
    nmap <leader>z :cclose<cr>
    nmap <leader>Z :copen<cr>
    nnoremap <silent> <leader>o :MagicOpen<cr>
    nnoremap <silent> <leader>O :MagicOpen!<cr>
    nmap <leader>gx <Plug>(DevOpen)

    " Custom operator-pending mappings & pairings
    map s <Plug>(MagicStamp)
    nmap S v$h<Plug>(MagicStamp)
    nmap ss V<Plug>(MagicStamp)

    map <leader>y <Plug>(MagicClip)
    nmap <leader>Y v$h<Plug>(MagicClip)
<commit_msg>Post-merge cleanup<commit_after>" Setup mappings
if exists('g:MagicMapAll') && g:MagicMapAll == 1
    " Close quickfix if async job returned success
    fun! s:AsyncDone(onsuccess)
        if g:asyncrun_code == 0
            cclose
            if a:onsuccess != ""
                exec a:onsuccess
            endif
        else
            cwindow
        endif
    endfun
    command! -nargs=0 AsyncRunDone call s:AsyncDone("")
    command! -nargs=0 AsyncRunPost call s:AsyncDone("MCRun")

    fun! s:AsyncRunAutoClose(bang, cmd, post)
        if a:post != ""
            silent exe "AsyncRun".a:bang." -post=AsyncRunPost ".a:cmd
        else
            silent exe "AsyncRun".a:bang." -post=AsyncRunDone ".a:cmd
        endif
    endfun
    command! -nargs=1 -bang AsyncRunAutoClose call s:AsyncRunAutoClose('<bang>', <q-args>, "")
    command! -nargs=1 -bang AsyncRunAutoPost call s:AsyncRunAutoClose('<bang>', <q-args>, "MCRun")

    " Magicified grep commands my common use cases
    fun! s:AsyncGrep(searchy)
        " echom a:searchy
        let l:pgm = '-program=grep '
        let l:ignore_prefix = '--ignore '
        let l:ignore_list = ['build', 'vs2013', 'vs2015', 'lib']
        let l:ignore_string = join(map(l:ignore_list, '"--ignore ".v:val'))
        silent exe "AsyncRun! ".l:pgm . l:ignore_string . " " . a:searchy
    endfun
    command! -nargs=1 -bang AsyncGrep call s:AsyncGrep(<q-args>)

    command! -nargs=1 VGall silent exe "AsyncGrep " .<q-args>
    command! -nargs=1 VGsrc silent exe "AsyncGrep --cpp " .<q-args>. " ./src"
    command! -nargs=1 VGlay silent exe "AsyncGrep " .<q-args>. " ./data"
    command! -nargs=1 VGset silent exe "AsyncGrep " .<q-args>. " ./settings"
    command! -nargs=1 VGcin silent exe "AsyncGrep --cpp " .<q-args>. " ". expand('$DS_PLATFORM_090')

    " Git
    nmap <leader>gp :AsyncRun git push<cr>
    nmap <leader>gu :AsyncRun git pull<cr>

    " Compile for OSX & Windows using MagicJob()
    nnoremap <silent> <leader>bb :MCompile DEBUG<cr>
    nnoremap <silent> <leader>br :MCompile RELEASE<cr>
    nnoremap <silent> <leader>bt :MCompile! TEST<cr>
    nnoremap <silent> <leader>bd :MCompile DOC<cr>
    nnoremap <silent> <leader>B :MCompile! RELEASE<cr>
    nnoremap <silent> <leader>r :MCRun<cr>
    nnoremap <silent> <leader>bk :AsyncStop!<cr>

    nnoremap <silent> <leader>ep :e ~/.vim/bundle/personal-magic.vim/<cr>

    " Alternate files (from LucHermitte/alternate-lite)
    nnoremap <silent> <leader>av :AV<cr>
    nnoremap <silent> <leader>ah :AS<cr>
    nnoremap <silent> <leader>as :A<cr>

    " Quickfix / MagicJob output
    nnoremap <leader>z :cclose<cr>
    nnoremap <leader>Z :copen<cr>
    nnoremap <silent> <leader>o :MagicOpen<cr>
    nnoremap <silent> <leader>O :MagicOpen!<cr>
    nmap <leader>gx <Plug>(DevOpen)

    " Custom operator-pending mappings & pairings
    map s <Plug>(MagicStamp)
    nmap S v$h<Plug>(MagicStamp)
    nmap ss V<Plug>(MagicStamp)

    map <leader>y <Plug>(MagicClip)
    nmap <leader>Y v$h<Plug>(MagicClip)

{'fraction_non_alphanumeric': 0.14363366825893592, 'fraction_numerical': 0.007577005435677813, 'mean_word_length': 2.966035271064664, 'pattern_counts': {'":': 0, '<': 141, '<?xml version=': 0, '>': 141, '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': '1328182', 'n_tokens_mistral': 2367, 'n_tokens_neox': 2226, 'n_words': 540}