<commit_before># SYNOPSIS
#   subl [options] [file ...]        edit the given files
#   subl [options] [directory ...]   open the given directories
#   subl [options]                   edit stdin
#

function subl -d "Open Sublime Text"
  set -l opts
  set -l files
  set -l projects

  # we'll just ignore anything that looks like an option string...
  for file in $argv
    switch $file
      case '-*'
        set opts $opts $file

      case '.*' '*'
        set files $files $file
    end
  end

  # if there's one (and only one) *.sublime-project file in the folder listed, open that instead.
  if [ (count $files) -eq 1 ]
    set projects (find $files[1] -name "*.sublime-project" -maxdepth 1 2> /dev/null)
  end

  if [ (count $projects) -eq 1 ]
    set argv $opts $projects[1]
  end

  if begin; which subl > /dev/null; and test -x (which subl); end
    command subl $argv
  else if test -d "/Applications/Sublime Text.app"
    "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" $argv
  else if test -d "/Applications/Sublime Text 2.app"
    "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" $argv
  else if test -d "/Applications/Sublime Text 3.app"
    "/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl" $argv
  else if test -d "$HOME/Applications/Sublime Text.app"
    eval "$HOME/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl" $argv
  else if test -d "$HOME/Applications/Sublime Text 2.app"
    eval "$HOME/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl" $argv
  else if test -d "$HOME/Applications/Sublime Text 3.app"
    eval "$HOME/Applications/Sublime\ Text\ 3.app/Contents/SharedSupport/bin/subl" $argv
  else if test -x "/opt/sublime_text/sublime_text"
    "/opt/sublime_text/sublime_text" $argv
  else if test -x "/opt/sublime_text_3/sublime_text"
    "/opt/sublime_text_3/sublime_text" $argv
  else
    echo "No Sublime Text installation found" >&2<commit_msg>Fix subl detection with noisy which<commit_after># SYNOPSIS
#   subl [options] [file ...]        edit the given files
#   subl [options] [directory ...]   open the given directories
#   subl [options]                   edit stdin
#

function subl -d "Open Sublime Text"
  set -l opts
  set -l files
  set -l projects

  # we'll just ignore anything that looks like an option string...
  for file in $argv
    switch $file
      case '-*'
        set opts $opts $file

      case '.*' '*'
        set files $files $file
    end
  end

  # if there's one (and only one) *.sublime-project file in the folder listed, open that instead.
  if [ (count $files) -eq 1 ]
    set projects (find $files[1] -name "*.sublime-project" -maxdepth 1 2> /dev/null)
  end

  if [ (count $projects) -eq 1 ]
    set argv $opts $projects[1]
  end

  if begin; which subl > /dev/null 2>&1; and test -x (which subl); end
    command subl $argv
  else if test -d "/Applications/Sublime Text.app"
    "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" $argv
  else if test -d "/Applications/Sublime Text 2.app"
    "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" $argv
  else if test -d "/Applications/Sublime Text 3.app"
    "/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl" $argv
  else if test -d "$HOME/Applications/Sublime Text.app"
    eval "$HOME/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl" $argv
  else if test -d "$HOME/Applications/Sublime Text 2.app"
    eval "$HOME/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl" $argv
  else if test -d "$HOME/Applications/Sublime Text 3.app"
    eval "$HOME/Applications/Sublime\ Text\ 3.app/Contents/SharedSupport/bin/subl" $argv
  else if test -x "/opt/sublime_text/sublime_text"
    "/opt/sublime_text/sublime_text" $argv
  else if test -x "/opt/sublime_text_3/sublime_text"
    "/opt/sublime_text_3/sublime_text" $argv
  else
    echo "No Sublime Text installation found" >&2
{'fraction_non_alphanumeric': 0.12041487477864912, 'fraction_numerical': 0.009107007336200354, 'mean_word_length': 2.934328358208955, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '2908148', 'n_tokens_mistral': 1418, 'n_tokens_neox': 1336, 'n_words': 415}