def eval_riml(riml)
      require 'tempfile' unless defined?(Tempfile)
      infile, outfile = Tempfile.new('riml_in'), Tempfile.new('vim_output')
      riml = Riml::GET_SID_FUNCTION_SRC + "\n#{riml}"
      infile.write("redir! > #{outfile.path}\n#{riml}\nredir END\nq!")
      infile.close
      system(%Q(vim -c "source #{infile.path}"))
      raw = outfile.read.sub(/\A\n/, '')
      # Since we don't show the generated SID function, we have to modify the
      # error line numbers to account for it.
      raw.gsub(/line\s+(\d+):/) do
        "line #{$1.to_i - (Riml::GET_SID_FUNCTION_SRC.each_line.to_a.size + 2)}:"
      end
    rescue => e
      print_error(e)
      reload!
      nil
    ensure
      infile.close
      outfile.close
    end
def eval_riml(riml)
      require 'tempfile' unless defined?(Tempfile)
      infile, outfile = Tempfile.new('riml_in'), Tempfile.new('vim_output')
      riml = Riml::GET_SID_FUNCTION_SRC + "\n#{riml}"
      infile.write("redir! > #{outfile.path}\n#{riml}\nredir END\nq!")
      infile.close
      system(%Q(vim -c "source #{infile.path}"))
      raw = outfile.read.sub(/\A\n/, '')
      # Since we don't show the generated SID function, we have to modify the
      # error line numbers to account for it.
      raw.gsub(/line\s+(\d+):/) do
        "line #{$1.to_i - (Riml::GET_SID_FUNCTION_SRC.each_line.to_a.size + 2)}:"
      end
    rescue => e
      print_error(e)
      reload!
      nil
    ensure
      infile.close
      outfile.close
    end
TODO: Start only 1 vim process and use pipes to save time when using
 `eval <<riml` multiple times in the same repl session.