<commit_before>" plugin/plugin.investigate.vim

" Use dash if available on the current system
let g:investigate_use_dash = has('mac')

" Custom keybinding to open documentation pages
nnoremap <leader>K :call investigate#Investigate('n')<CR>
vnoremap <leader>K :call investigate#Investigate('v')<CR><commit_msg>Use macOS dictionary as keywordprg in markdown/gitcommits<commit_after>" plugin/plugin.investigate.vim

" Open macOS specific application using vim investigate
if has('mac')

  " Use dash on macOS
  let g:investigate_use_dash = 1

  " Look up word in macOS dictionary when editing markdown files
  let g:investigate_use_url_for_markdown = 1
  let g:investigate_url_for_markdown = 'dict://^x'

  " Look up word in macOS dictionary when editing markdown files
  let g:investigate_use_url_for_gitcommit = 1
  let g:investigate_url_for_gitcommit = 'dict://^x'

endif

" Custom keybinding to open documentation pages
nnoremap <leader>K :call investigate#Investigate('n')<CR>
vnoremap <leader>K :call investigate#Investigate('v')<CR>

" Rebind normal mode `K` only if `&keywordprg` is different to
" its default value `man -s`
function! s:RunExprIfDefault(cmd)
  if &keywordprg =~# '^man'
    return a:cmd
  endif
  return 'K'
endfunction

nnoremap <expr> K <SID>RunExprIfDefault(':call investigate#Investigate("n")<CR>')
{'fraction_non_alphanumeric': 0.10113207547169811, 'fraction_numerical': 0.0022641509433962265, 'mean_word_length': 5.90625, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, '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': '1060131', 'n_tokens_mistral': 456, 'n_tokens_neox': 424, 'n_words': 128}