作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如您所知,TextMate 的第 2 版即将推出,目前的开发版本非常有前途:https://github.com/textmate/textmate/blob/master/README.md
就我而言,我在终端(MacOSX Mountain Lion)中使用 R 并使用 TextMate2 开发我的代码。在之前版本的 TextMate (1.5.11) 中,我使用以下技巧将选定的文本或行发送到我的终端窗口:
-> 见 How can I send selected text (or a line) in TextMate to R running on Terminal
这个技巧对我来说非常有效,但我不知道如何使用 TextMate2 获得类似的行为。
任何的想法?我预先感谢您的宝贵帮助。
最佳答案
实际上基于之前的答案( How can I send selected text (or a line) in TextMate to R running on Terminal ),我使用以下代码在 TextMate 2 中创建了自己的 Bundle:
#!/bin/bash
source "$TM_SUPPORT_PATH/lib/bash_init.sh" # might not be necessary
# input is selection or document
rawText="$(cat | sed 's/ / /g;')"
osascript -e 'on run(theCode)' \
-e ' tell application "Terminal"' \
-e ' do script theCode in window 1' \
-e ' end tell' \
-e 'end run' -- "$rawText"
open "txmt://open?line=$(($TM_LINE_NUMBER+1))&column=1000000" &
关于r - 如何将 TextMate2 中选定的文本(或一行)发送到在终端上运行的 R,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13684920/
我是一名优秀的程序员,十分优秀!