I have the same need. I have done the following to accomplish this. Generally speaking, you need to combine the command with a macro:
1. modify the command in 'normal' R bundle to additionally active Textmate after it sends the R statements 2. record a macro to move the cursor: You first active the above R command, which sends the R statement to the R GUI's R console window, and let it return back to Textmate; Then move the cursor one line down and finish the macro. 3. save the macro and give it a good keystroke. Optionally, you can use the power of the search (^F) in Textmate to move the cursor. By using the proper regular expression in the search, you can move the cursor to the next non-comment R statement.
The above steps work generally for both a line and a selection.
Yaomin
On Sun, Oct 5, 2008 at 7:43 AM, textmate-request@lists.macromates.com wrote:
Send textmate mailing list submissions to textmate@lists.macromates.com
To subscribe or unsubscribe via the World Wide Web, visit http://lists.macromates.com/listinfo/textmate or, via email, send a message with subject or body 'help' to textmate-request@lists.macromates.com
You can reach the person managing the list at textmate-owner@lists.macromates.com
When replying, please edit your Subject line so it is more specific than "Re: Contents of textmate digest..."
Today's Topics:
- Re: Simple markdown to book workflow? (jiho)
- Re: Python 2.6? (Pedro Borges)
- How do I tell TextMate to move the cursor one line down? (Tobias Pyndt Steinmann)
- Re: How do I tell TextMate to move the cursor one line down? (Hans-J?rg Bibiko)
- Re: How do I tell TextMate to move the cursor one line down? (Hans-J?rg Bibiko)
- Suddenly xelatex is not found anymore (Niels Kobschaetzki)
- HTML-output-window just looks plain wrong (Niels Kobschaetzki)
Message: 1 Date: Sat, 4 Oct 2008 09:34:39 -0400 From: jiho jo.irisson@gmail.com Subject: [TxMt] Re: Simple markdown to book workflow? To: gerti-textmate@bitart.com, TextMate users textmate@lists.macromates.com Message-ID: 6646DC23-E892-47E0-B77A-C6936351061D@gmail.com Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
On 2008-October-04 , at 02:16 , Gerd Knops wrote:
Thanks everybody for the help, it is much appreciated!
Using markdown to Latex (memoir) conversion gets me most of the way.
One problem I have that I can't seem to figure out is that when I set \geometry{a5paper} the book is formatted for A5, but the physical paper size still seems to be Letter. How can I fix that?
This is actually a feature of the memoir class. The thinking behind it is that, whatever your page size is, you will probably print it on a stock paper, which has a standard size (A4, letter etc.) and them cut (trim) it (if you add the options showtrims to the document class, you should see those trim marks). This is why the stock size and the page size are separated in memoir. You can set them easily without resorting to the geometry package, with commands that are specific to the memoir class. Check the chapter "Laying out the page" (section II, p 49) of the memoir manual (meman.pdf) for the commands. It also gives more details on the dimensions of the page and how to make them harmonious (A5 is probably not the best idea because the height to width ratio might make the text look awkward). My advice: take a book with a similar purpose that you find enjoyable to read and well laid out and copy the dimensions.
This is for example what I used in a recent document, based on several published books with margin notes:
\usepackage{calc} % easy calculations
% Page size \settrimmedsize{246mm}{172mm}{*} % size of final page : h w ratio
% Stock paper size = A4 \setstocksize{297mm}{210mm} % size of paper sheet : h w
% Trims (i.e. cuts) = set interior edge of the page to be the actual edge of the stock and center vertically \settrims{0.5\stockheight-0.5\paperheight}{\stockwidth- \paperwidth} % portions to trim from : top edge
% Set margins and compute size of text block % NB: \textheight is set to an integer number of lines by \checkandfixthelayout below \settypeblocksize{197mm}{100mm}{*} % block: height width ratio \setlrmargins{32mm}{*}{*} % horiz margins : spine edge ratio \setulmargins{69pt}{*}{*} % vertical margins : upper lower ratio
% Margin notes \setmarginnotes{3.8mm}{31mm}{5mm} % margin notes: separation width push % separation: horiz space between text and note % width: max width of note % push: min space between notes
\checkandfixthelayout[nearest] % nearest = chose the integral number of lines nearest to the specified textheight and use this as the textheight
I hope that helps.
JiHO
Message: 2 Date: Sat, 4 Oct 2008 17:03:34 +0100 From: "Pedro Borges" pedro.dhb@gmail.com Subject: [TxMt] Re: Python 2.6? To: "TextMate users" textmate@lists.macromates.com Message-ID: d82a1ed0810040903q34795f72qc3d82e8bac77b423@mail.gmail.com Content-Type: text/plain; charset=ISO-8859-1
Is there a list of requested features for the bundle?
Message: 3 Date: Sat, 4 Oct 2008 18:12:13 +0200 From: Tobias Pyndt Steinmann tobii@tobii.dk Subject: [TxMt] How do I tell TextMate to move the cursor one line down? To: TextMate users textmate@lists.macromates.com Message-ID: A63860BE-556B-49BF-881D-255872FEC11D@tobii.dk Content-Type: text/plain; charset="us-ascii"
Hi, I am trying add a command to the R bundle that will send the current line to the R GUI, in the same way the ESS for Emacs "Eval line & step" command works. It is quite easy to send the line to R GUI, but I cannot find a good way to move to the cursor to the next line in TextMate. Currently I am using this Applescript to do the job: # move the cursor osascript -e 'tell application "System Events"' \ -e 'tell application "TextMate" to activate' \ -e 'tell process "TextMate"' \ -e 'keystroke (ASCII character 31)' \ -e 'end tell' \ -e 'end tell'
But the problem is that when you call the command using a keyboard shortcut ie. cmd+shift + R and keep holding cmd+shift for some time (I have this of a habit unfortunately :) ) the keystroke will be cmd +shift + (ASCII character 31) causing the text from the cursor to the end of the document to be selected.
Is there a smarter way to advance the cursor one line? -- maybe an internal TextMate command?
Thanks in advance. with best regards, Tobias Pyndt Steinmann
To be honest I don't use R GUI anymore. I do everything by using Rmate and/or Rdaemon.
But I see your point.
To avoid recording a macro you can also do this:
- duplicate "Send Selection/Document to" > "R.app" in R.tmbundle - rename it to let's say "Execute Line in R.app" - change Input: to Selection or Line - change Output: to Discard - add the following line to the command: open "txmt://open?line=$(($TM_LINE_NUMBER+1))&column=1000000"
or install the attached tmcommand. It's bound to SHIFT+RETURN. (But this is of course only a suggestion)
or wait until tomorrow. Then I'll upload it to R.tmbundle at the Review svn trunk.
Cheers,
--Hans
---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.