<commit_before>nnoremap <silent> <leader>f :FZF<CR>

function! s:buf_list()
  redir => ls
  silent ls
  redir END
  return split(ls, '\n')
endfunction

function! s:buf_open(e)
  execute 'buffer '. matchstr(a:e, '^[ 0-9]*')
endfunction

function! s:buf_fzf()
  call fzf#run({
  \ 'source': reverse(<SID>buf_list()),
  \ 'sink': function('<SID>buf_open'),
  \ 'options': '+m',
  \ 'tmux_height': '40%'
  \})
endfunction

nnoremap <silent> <leader>bf :call <SID>buf_fzf()<CR><commit_msg>Vim FZF now uses Ag like bash UI.<commit_after>function! s:buf_list()
  redir => ls
  silent ls
  redir END
  return split(ls, '\n')
endfunction

function! s:buf_open(e)
  execute 'buffer '. matchstr(a:e, '^[ 0-9]*')
endfunction

function! s:buf_fzf()
  call fzf#run({
  \ 'source': reverse(<SID>buf_list()),
  \ 'sink': function('<SID>buf_open'),
  \ 'tmux_height': '40%'
  \})
endfunction

function! s:ag_fzf()
  call fzf#run({
  \ 'source': 'ag -l -g ""',
  \ 'sink': 'edit',
  \ 'tmux_height': '40%'
  \})
endfunction

nnoremap <silent> <leader>bf :call <SID>buf_fzf()<CR>
nnoremap <silent> <leader>f :call <SID>ag_fzf()<CR>
{'fraction_non_alphanumeric': 0.20503597122302158, 'fraction_numerical': 0.008992805755395683, 'mean_word_length': 4.50990099009901, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 24, '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': '4597650', 'n_tokens_mistral': 508, 'n_tokens_neox': 483, 'n_words': 100}