Thank you very much for your suggestion. I'm still having trouble
yanking the highlighted text instead of the line the cursor was on.

I was able to do something like this in jEdit using
textArea.getSelectedText(). Is there something analogous for Vim?

My jEdit code is here:

rundolines() {
     // Copy selected text
     String text = textArea.getSelectedText();

     // Create a temp file
     File temp = File.createTempFile("dofilelines", ".do");

     // Delete temp file when program exits.
     temp.deleteOnExit();

     // Write to temp file
     BufferedWriter out = new BufferedWriter(new FileWriter(temp));
     out.write(text);
     out.close();

     // Run the temporary file in Stata
     String command="C:\\Program Files\\Scripts\\rundo.exe " + "\"" +
temp + "\"";
     exec(command);
}

rundolines();

Reply via email to