Dimitriy V. Masterov wrote:
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();
In --VISUAL-- (not --SELECT-- mode), hitting y should yank the
highlighted text into the unnamed register. (In Select mode it replaces
the highlighted text by the letter y).
- To go from Normal to Visual: hit v
Then extend the selection by moving the cursor.
- To go from Select to Visual: hit Ctrl-G
Best regards,
Tony.