<commit_before>" The only option of this script
" This command is expected to return clipboard-contents on stdout.
let g:FelixClipCommand = 'xsel --clipboard'

" paste
function! s:handle_clipboard_error()
  if &paste
    set nopaste
    echo 'paste disabled'
  else
    set paste
    echo 'paste enabled'
  endif
endfunction

function! FelixClip()
  " try to put clipboard contents into the register C
  " on error: toggle paste
  let cmd = 'xsel --clipboard'
  if exists('g:FelixClipCommand')
    let cmd = g:FelixClipCommand
  endif
  try
    let @c = system(g:FelixClipCommand)
    if v:shell_error != 0
      " echo 'v:shell_error:' v:shell_error
      call s:handle_clipboard_error()
    else
      execute 'put c'
    endif
  catch
    call s:handle_clipboard_error()
  endtry
endfunction<commit_msg>vim FelixClip paste on current line if empty<commit_after>" The only option of this script
" This command is expected to return clipboard-contents on stdout.
let g:FelixClipCommand = 'xsel --clipboard'

" paste
function! s:handle_clipboard_error()
  if &paste
    set nopaste
    echo 'paste disabled'
  else
    set paste
    echo 'paste enabled'
  endif
endfunction

function! FelixClip()
  " try to put clipboard contents into the register C
  " on error: toggle paste
  let cmd = 'xsel --clipboard'
  if exists('g:FelixClipCommand')
    let cmd = g:FelixClipCommand
  endif
  try
    let @c = system(g:FelixClipCommand)
    if v:shell_error != 0
      " echo 'v:shell_error:' v:shell_error
      call s:handle_clipboard_error()
    else
      " begin *on* the current line if it is empty, else append
      if getline('.') =~ '^$'
        execute 'put! c'
      else
        execute 'put c'
      endif
    endif
  catch
    call s:handle_clipboard_error()
  endtry
endfunction
{'fraction_non_alphanumeric': 0.08058198097369894, 'fraction_numerical': 0.001119194180190263, 'mean_word_length': 3.177570093457944, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '647609', 'n_tokens_mistral': 591, 'n_tokens_neox': 567, 'n_words': 194}