<commit_before>" Plugin:      https://github.com/mhinz/vim-startify
" Description: Start screen displaying recently used stuff.
" Maintainer:  <NAME> <http://github.com/mhinz>
" Version:     1.4

if exists('g:autoloaded_startify') || &cp
  finish
endif
let g:autoloaded_startify = 1

function! startify#get_session_names(lead, ...) abort
  return map(split(globpath(g:startify_session_dir, '*'.a:lead.'*', '\n')), 'fnamemodify(v:val, ":t")')
endfunction

function! startify#get_session_names_as_string(lead, ...) abort
  return join(map(split(globpath(g:startify_session_dir, '*'.a:lead.'*', '\n')), 'fnamemodify(v:val, ":t")'), "\n")
endfunction

function! startify#escape(path) abort
  return !exists('+shellslash') || &shellslash ? fnameescape(a:path) : escape(a:path, '\')
endfunction

function! startify#get_separator() abort
  return !exists('+shellslash') || &shellslash ? '/' : '\'
endfunction

function! startify#is_in_skiplist(arg) abort
  for regexp in g:startify_skiplist
    if (a:arg =~# regexp)
      return 1
    endif
  endfor
endfunction

function! startify#delete_session(...) abort
  if !isdirectory(g:startify_session_dir)
    echo 'The session directory does not exist: '. g:startify_session_dir
    return
  endif
  if strlen(startify#get_session_names_as_string('')) == 0
    echo 'There are no sessions...'
    return
  endif
  let spath = g:startify_session_dir . startify#get_separator() . (exists('a:1')
        \ ? a:1
        \ : input('Delete this session: ', '', 'custom,startify#get_session_names_as_string'))
        \ | redraw
  echo 'Really delete '. spath .'? [y/n]' | redraw
  if (nr2char(getchar()) == 'y')
    if delete(spath) == 0
      echo 'Deleted session '. spath .'!'
    else
      echo 'Deletion failed!'
    endif
  else
    echo 'Deletion aborted!'
  endif
endfunction

function! startify#save_session(...) abort
  if !isdirectory(g:startify_session_dir)
    if exists('*mkdir')
      echo 'The session directory does not exist: '. g:startify_session_dir .'. Create it?  [y/n]' | redraw
      if (nr2char(getchar()) == 'y')
        call mkdir(g:startify_session_dir, 'p')
      else
        echo
        return
      endif
    else
      echo 'The session directory does not exist: '. g:startify_session_dir
      return
    endif
  endif
  let spath = g:startify_session_dir . startify#get_separator() . (exists('a:1')
        \ ? a:1
        \ : input('Save under this session name: ', '', 'custom,startify#get_session_names_as_string'))
        \ | redraw
  if !filereadable(spath)
    execute 'mksession '. spath | echo 'Session saved under: '. spath
    return
  endif
  echo 'Session already exists. Overwrite?  [y/n]' | redraw
  if nr2char(getchar()) == 'y'
    execute 'mksession! '. spath | echo 'Session saved under: '. spath
  else
    echo 'Did NOT save the session!'
  endif
endfunction

function! startify#load_session(...) abort
  if !isdirectory(g:startify_session_dir)
    echo 'The session directory does not exist: '. g:startify_session_dir
    return
  endif
  let spath = g:startify_session_dir . startify#get_separator() . (exists('a:1')
        \ ? a:1
        \ : input('Load this session: ', '', 'custom,startify#get_session_names_as_string'))
        \ | redraw
  if filereadable(spath)
    execute 'source '. spath
  else
    echo 'No such file: '. spath
  endif
endfunction

" vim: et sw=2 sts=2<commit_msg>check if session dir contains files pt2<commit_after>" Plugin:      https://github.com/mhinz/vim-startify
" Description: Start screen displaying recently used stuff.
" Maintainer:  <NAME> <http://github.com/mhinz>
" Version:     1.4

if exists('g:autoloaded_startify') || &cp
  finish
endif
let g:autoloaded_startify = 1

function! startify#get_session_names(lead, ...) abort
  return map(split(globpath(g:startify_session_dir, '*'.a:lead.'*', '\n')), 'fnamemodify(v:val, ":t")')
endfunction

function! startify#get_session_names_as_string(lead, ...) abort
  return join(map(split(globpath(g:startify_session_dir, '*'.a:lead.'*', '\n')), 'fnamemodify(v:val, ":t")'), "\n")
endfunction

function! startify#escape(path) abort
  return !exists('+shellslash') || &shellslash ? fnameescape(a:path) : escape(a:path, '\')
endfunction

function! startify#get_separator() abort
  return !exists('+shellslash') || &shellslash ? '/' : '\'
endfunction

function! startify#is_in_skiplist(arg) abort
  for regexp in g:startify_skiplist
    if (a:arg =~# regexp)
      return 1
    endif
  endfor
endfunction

function! startify#delete_session(...) abort
  if !isdirectory(g:startify_session_dir)
    echo 'The session directory does not exist: '. g:startify_session_dir
    return
  elseif empty(startify#get_session_names_as_string(''))
    echo 'There are no sessions...'
    return
  endif
  let spath = g:startify_session_dir . startify#get_separator() . (exists('a:1')
        \ ? a:1
        \ : input('Delete this session: ', '', 'custom,startify#get_session_names_as_string'))
        \ | redraw
  echo 'Really delete '. spath .'? [y/n]' | redraw
  if (nr2char(getchar()) == 'y')
    if delete(spath) == 0
      echo 'Deleted session '. spath .'!'
    else
      echo 'Deletion failed!'
    endif
  else
    echo 'Deletion aborted!'
  endif
endfunction

function! startify#save_session(...) abort
  if !isdirectory(g:startify_session_dir)
    if exists('*mkdir')
      echo 'The session directory does not exist: '. g:startify_session_dir .'. Create it?  [y/n]' | redraw
      if (nr2char(getchar()) == 'y')
        call mkdir(g:startify_session_dir, 'p')
      else
        echo
        return
      endif
    else
      echo 'The session directory does not exist: '. g:startify_session_dir
      return
    endif
  endif
  let spath = g:startify_session_dir . startify#get_separator() . (exists('a:1')
        \ ? a:1
        \ : input('Save under this session name: ', '', 'custom,startify#get_session_names_as_string'))
        \ | redraw
  if !filereadable(spath)
    execute 'mksession '. spath | echo 'Session saved under: '. spath
    return
  endif
  echo 'Session already exists. Overwrite?  [y/n]' | redraw
  if nr2char(getchar()) == 'y'
    execute 'mksession! '. spath | echo 'Session saved under: '. spath
  else
    echo 'Did NOT save the session!'
  endif
endfunction

function! startify#load_session(...) abort
  if !isdirectory(g:startify_session_dir)
    echo 'The session directory does not exist: '. g:startify_session_dir
    return
  elseif empty(startify#get_session_names_as_string(''))
    echo 'There are no sessions...'
    return
  endif
  let spath = g:startify_session_dir . startify#get_separator() . (exists('a:1')
        \ ? a:1
        \ : input('Load this session: ', '', 'custom,startify#get_session_names_as_string'))
        \ | redraw
  if filereadable(spath)
    execute 'source '. spath
  else
    echo 'No such file: '. spath
  endif
endfunction

" vim: et sw=2 sts=2
{'fraction_non_alphanumeric': 0.13759071117561683, 'fraction_numerical': 0.0049346879535558785, 'mean_word_length': 3.572660915726609, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '3787698', 'n_tokens_mistral': 2400, 'n_tokens_neox': 2319, 'n_words': 559}