<commit_before>augroup UniteAutoCmd
  autocmd!
augroup END

function! s:unite_tabs_and_windows()
  nmap <buffer> <C-h> <C-w>h
  nmap <buffer> <C-j> <C-w>j
  nmap <buffer> <C-k> <C-w>k
  nmap <buffer> <C-l> <C-w>l
  imap <buffer> <C-h> <Esc><C-w>h
  imap <buffer> <C-j> <Esc><C-w>j
  imap <buffer> <C-k> <Esc><C-w>k
  imap <buffer> <C-l> <Esc><C-w>l
  nmap <buffer> H gT
  nmap <buffer> L gt
  nmap <buffer> <leader>x :bd!<CR>
endfunction

let g:unite_data_directory = '~/.vim/tmp/unite/'
let g:unite_source_process_enable_confirm = 1
let g:unite_source_history_yank_enable = 1
let g:unite_enable_split_vertically = 0
let g:unite_winheight = 20

let g:unite_source_directory_mru_limit = 300
let g:unite_source_file_mru_limit = 300
let g:unite_source_file_mru_filename_format = ':~:.'

let g:unite_source_grep_command = 'ag'
let g:unite_source_grep_default_opts = '--column --nocolor --nogroup'
let g:unite_source_grep_recursive_opt = ''

nno <leader>g :<C-u>Unite grep -default-action=above<CR>
nno <leader>G :<C-u>execute 'Unite grep:.::' . expand("<cword>") . ' -default-action=above -auto-preview'<CR>
nno <leader>b :<C-u>Unite buffer -buffer-name=buffers -start-insert<CR>
" nno <leader><leader> :<C-u>UniteWithCurrentDir buffer file -buffer-name=united -start-insert<CR>
nno <leader>ps :<C-u>:Unite process -buffer-name=processes -start-insert<CR>
nno <leader>u :<C-u>Unite<space>
nno <C-p> :<C-u>:Unite history/yank -buffer-name=yanks<CR>
nno // :<C-u>:Unite line -buffer-name=lines -start-insert -direction=botright -winheight=10<CR>

function! s:unite_settings()
  imap <buffer> jj <Plug>(unite_insert_leave)
  imap <buffer> <C-w> <Plug>(unite_delete_backward_path)
  imap <buffer> <leader> <Esc><leader>
  call s:unite_tabs_and_windows()
endfunction

autocmd UniteAutoCmd FileType unite call s:unite_settings()

" Open files quickly {{{
  map <leader>f :<C-u>execute 'Unite file_rec file/new -buffer-name=files ' .
        \ '-start-insert -toggle -profile-name=files'<CR>
" }}}

" Open Vim configs quickly {{{
  map <leader>vc :<C-u>execute 'Unite file:' . expand('~/.vim/config') .
        \ ' -buffer-name=configs ' .
        \ '-start-insert -toggle -profile-name=files'<CR>
" }}}

" VimWiki {{{
  map <leader>W :<C-u>execute 'Unite file:' . expand('~/Dropbox/Wiki') . ' ' .
        \ 'file/new -buffer-name=notes ' .
        \ '-start-insert -toggle -default-action=split -profile-name=files'<CR>
" }}}<commit_msg>Add support for quickly moving to a ~/Code folder<commit_after>augroup UniteAutoCmd
  autocmd!
augroup END

function! s:unite_tabs_and_windows()
  nmap <buffer> <C-h> <C-w>h
  nmap <buffer> <C-j> <C-w>j
  nmap <buffer> <C-k> <C-w>k
  nmap <buffer> <C-l> <C-w>l
  imap <buffer> <C-h> <Esc><C-w>h
  imap <buffer> <C-j> <Esc><C-w>j
  imap <buffer> <C-k> <Esc><C-w>k
  imap <buffer> <C-l> <Esc><C-w>l
  nmap <buffer> H gT
  nmap <buffer> L gt
  nmap <buffer> <leader>x :bd!<CR>
endfunction

let g:unite_data_directory = '~/.vim/tmp/unite/'
let g:unite_source_process_enable_confirm = 1
let g:unite_source_history_yank_enable = 1
let g:unite_enable_split_vertically = 0
let g:unite_winheight = 20

let g:unite_source_directory_mru_limit = 300
let g:unite_source_file_mru_limit = 300
let g:unite_source_file_mru_filename_format = ':~:.'

if executable('ag')
  " Use ag as unite grep source.
  let g:unite_source_grep_command = 'ag'
  let g:unite_source_grep_default_opts = '--nocolor --nogroup --hidden'
  let g:unite_source_grep_recursive_opt = ''
elseif executable('ack')
  " Use ack as unite grep source.
  let g:unite_source_grep_command = 'ack-grep'
  let g:unite_source_grep_default_opts = '--no-heading --no-color -a'
  let g:unite_source_grep_recursive_opt = ''
endif

nno <leader>s :<C-u>Unite grep:. -default-action=above<CR>
nno <leader>S :<C-u>execute 'Unite grep:.::' . expand("<cword>") . ' -default-action=above -auto-preview'<CR>
nno <leader>b :<C-u>Unite buffer -buffer-name=buffers -start-insert<CR>
" nno <leader><leader> :<C-u>UniteWithCurrentDir buffer file -buffer-name=united -start-insert<CR>
nno <leader>ps :<C-u>:Unite process -buffer-name=processes -start-insert<CR>
nno <leader>u :<C-u>Unite<space>
nno <C-p> :<C-u>:Unite history/yank -buffer-name=yanks<CR>
nno // :<C-u>:Unite line -buffer-name=lines -start-insert -direction=botright -winheight=10<CR>

function! s:unite_settings()
  imap <buffer> jj <Plug>(unite_insert_leave)
  imap <buffer> <C-w> <Plug>(unite_delete_backward_path)
  imap <buffer> <leader> <Esc><leader>
  call s:unite_tabs_and_windows()
endfunction

autocmd UniteAutoCmd FileType unite call s:unite_settings()

" Open files quickly {{{
  map <leader>f :<C-u>execute 'Unite file_rec/async file/new -buffer-name=files ' .
        \ '-start-insert -toggle'<CR>
" }}}

" Jump to a project {{{
  map <leader>P :<C-u>execute 'Unite directory:' . expand('~/Code') .
        \ ' -buffer-name=directories ' .
        \ '-start-insert -toggle -default-action=cd'<CR>
" }}}

" Open Vim configs quickly {{{
  map <leader>vc :<C-u>execute 'Unite file:' . expand('~/.vim/config') .
        \ ' -buffer-name=configs ' .
        \ '-start-insert -toggle -profile-name=files'<CR>
" }}}

" VimWiki {{{
  map <leader>W :<C-u>execute 'Unite file:' . expand('~/Dropbox/Wiki') . ' ' .
        \ 'file/new -buffer-name=notes ' .
        \ '-start-insert -toggle -default-action=split -profile-name=files'<CR>
" }}}
{'fraction_non_alphanumeric': 0.17247809062092112, 'fraction_numerical': 0.004848032817452918, 'mean_word_length': 4.258823529411765, 'pattern_counts': {'":': 0, '<': 158, '<?xml version=': 0, '>': 158, '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': '230895', 'n_tokens_mistral': 2307, 'n_tokens_neox': 2212, 'n_words': 438}