class Utils::Editor

def vim

def vim
  @vim ||=
    case `uname -s`
    when /\Adarwin/i
      if File.directory?(path = File.expand_path('~/Applications/MacVim.app')) or
        File.directory?(path = File.expand_path('/Applications/MacVim.app'))
      then
        File.join(path, 'Contents/MacOS/Vim')
      else
        'vim'
      end
    else
      'vim'
    end
end