ver 2010.02 → 2010.08

Sign up to get free protection for your applications and to get access to all the features.
Files changed (651) hide show
  1. data/.gitignore +1 -0
  2. data/.yardopts +1 -1
  3. data/AUTHORS +2 -2
  4. data/CHANGELOG +1160 -0
  5. data/MANIFEST +212 -62
  6. data/README.textile +68 -9
  7. data/Rakefile +2 -2
  8. data/bin/ver +33 -8
  9. data/config/commands/ANTLR.rb +11 -0
  10. data/config/commands/ActionScript.rb +102 -0
  11. data/config/commands/Active4D.rb +30 -0
  12. data/config/commands/Ada.rb +11 -0
  13. data/config/commands/Ant.rb +90 -0
  14. data/config/commands/Apache.rb +98 -0
  15. data/config/commands/AppleScript.rb +169 -0
  16. data/config/commands/Blogging.rb +72 -0
  17. data/config/commands/Bulletin Board.rb +10 -0
  18. data/config/commands/Bundle Development.rb +83 -0
  19. data/config/commands/C++ Qt.rb +158 -0
  20. data/config/commands/C.rb +82 -0
  21. data/config/commands/CMake.rb +32 -0
  22. data/config/commands/CSS.rb +76 -0
  23. data/config/commands/CTags.rb +29 -0
  24. data/config/commands/CVS.rb +114 -0
  25. data/config/commands/CoffeeScript.rb +58 -0
  26. data/config/commands/Context Free.rb +20 -0
  27. data/config/commands/Cucumber.rb +94 -0
  28. data/config/commands/D.rb +47 -0
  29. data/config/commands/Darcs.rb +72 -0
  30. data/config/commands/Diff.rb +76 -0
  31. data/config/commands/Doxygen.rb +9 -0
  32. data/config/commands/Experimental Wiki.rb +9 -0
  33. data/config/commands/Experimental.rb +172 -0
  34. data/config/commands/F-Script.rb +13 -0
  35. data/config/commands/FXScript.rb +11 -0
  36. data/config/commands/FileMerge.rb +42 -0
  37. data/config/commands/Fortran.rb +58 -0
  38. data/config/commands/GTD2.rb +134 -0
  39. data/config/commands/GTDAlt.rb +225 -0
  40. data/config/commands/GetBundle.rb +41 -0
  41. data/config/commands/Go.rb +29 -0
  42. data/config/commands/Graphviz.rb +11 -0
  43. data/config/commands/Greasemonkey.rb +158 -0
  44. data/config/commands/Gri.rb +11 -0
  45. data/config/commands/Groovy Grails.rb +174 -0
  46. data/config/commands/Groovy.rb +66 -0
  47. data/config/commands/HTML.rb +206 -0
  48. data/config/commands/Haskell.rb +48 -0
  49. data/config/commands/Hotkey.rb +50 -0
  50. data/config/commands/Hyperlink Helper.rb +81 -0
  51. data/config/commands/ImageBrowser.rb +10 -0
  52. data/config/commands/Io.rb +11 -0
  53. data/config/commands/JSFL.rb +29 -0
  54. data/config/commands/JSON.rb +11 -0
  55. data/config/commands/Java.rb +45 -0
  56. data/config/commands/JavaDoc.rb +12 -0
  57. data/config/commands/JavaScript Prototype & Script.aculo.us.rb +51 -0
  58. data/config/commands/JavaScript YUI.rb +12 -0
  59. data/config/commands/JavaScript jQuery.rb +12 -0
  60. data/config/commands/JavaScript.rb +50 -0
  61. data/config/commands/LaTeX.rb +423 -0
  62. data/config/commands/Lisp.rb +20 -0
  63. data/config/commands/Logo.rb +10 -0
  64. data/config/commands/Logtalk.rb +34 -0
  65. data/config/commands/Lua.rb +29 -0
  66. data/config/commands/MEL.rb +20 -0
  67. data/config/commands/Mail.rb +73 -0
  68. data/config/commands/Make.rb +20 -0
  69. data/config/commands/Man Pages.rb +20 -0
  70. data/config/commands/Markdown.rb +194 -0
  71. data/config/commands/Math.rb +79 -0
  72. data/config/commands/Matlab.rb +188 -0
  73. data/config/commands/Maven.rb +162 -0
  74. data/config/commands/Mediawiki.rb +12 -0
  75. data/config/commands/Mercurial.rb +185 -0
  76. data/config/commands/MoinMoin.rb +74 -0
  77. data/config/commands/Movable Type.rb +68 -0
  78. data/config/commands/Nemerle.rb +29 -0
  79. data/config/commands/OCaml Experimental Completions.rb +22 -0
  80. data/config/commands/OCaml.rb +99 -0
  81. data/config/commands/Objective-C.rb +181 -0
  82. data/config/commands/Outlines.rb +54 -0
  83. data/config/commands/PHP Smarty.rb +10 -0
  84. data/config/commands/Pascal.rb +11 -0
  85. data/config/commands/Perforce.rb +102 -0
  86. data/config/commands/Perl.rb +78 -0
  87. data/config/commands/Processing.rb +11 -0
  88. data/config/commands/Prolog.rb +11 -0
  89. data/config/commands/Property List.rb +38 -0
  90. data/config/commands/Python Django.rb +11 -0
  91. data/config/commands/Python.rb +131 -0
  92. data/config/commands/R Console (R.app).rb +80 -0
  93. data/config/commands/R Console (Rdaemon).rb +414 -0
  94. data/config/commands/R.rb +337 -0
  95. data/config/commands/Ragel.rb +10 -0
  96. data/config/commands/Regular Expressions.rb +18 -0
  97. data/config/commands/Remind.rb +44 -0
  98. data/config/commands/Ruby RSpec.rb +40 -0
  99. data/config/commands/Ruby on Rails.rb +331 -0
  100. data/config/commands/Ruby.rb +220 -0
  101. data/config/commands/S5 Slide Show.rb +37 -0
  102. data/config/commands/SCons.rb +24 -0
  103. data/config/commands/SQL.rb +60 -0
  104. data/config/commands/SVK.rb +83 -0
  105. data/config/commands/SWeave.rb +63 -0
  106. data/config/commands/Scheme.rb +30 -0
  107. data/config/commands/Scilab.rb +28 -0
  108. data/config/commands/Setext.rb +20 -0
  109. data/config/commands/Shell Script.rb +59 -0
  110. data/config/commands/Slate.rb +9 -0
  111. data/config/commands/Source.rb +84 -0
  112. data/config/commands/Standard ML.rb +38 -0
  113. data/config/commands/Subversion.rb +181 -0
  114. data/config/commands/TODO.rb +32 -0
  115. data/config/commands/Tcl.rb +21 -0
  116. data/config/commands/TerminalMate.rb +30 -0
  117. data/config/commands/Text.rb +137 -0
  118. data/config/commands/TextMate.rb +100 -0
  119. data/config/commands/Textile.rb +58 -0
  120. data/config/commands/Thrift.rb +20 -0
  121. data/config/commands/Transmit.rb +34 -0
  122. data/config/commands/Txt2tags.rb +213 -0
  123. data/config/commands/Vectorscript.rb +19 -0
  124. data/config/commands/Widget Creator.rb +23 -0
  125. data/config/commands/XML.rb +29 -0
  126. data/config/commands/Xcode.rb +106 -0
  127. data/config/commands/YAML.rb +39 -0
  128. data/config/commands/YARD.rb +12 -0
  129. data/config/commands/iTerm.rb +26 -0
  130. data/config/commands/reStructuredText.rb +126 -0
  131. data/config/detect.rb +13 -1
  132. data/config/keymap/diakonos.rb +113 -115
  133. data/config/keymap/emacs.rb +6 -2
  134. data/config/keymap/nano.rb +104 -112
  135. data/config/keymap/vim.rb +329 -258
  136. data/config/plugin/autosave.rb +3 -6
  137. data/config/plugin/git.rb +18 -12
  138. data/config/plugin/soma.rb +1 -1
  139. data/config/preferences/Apache.rb +17 -17
  140. data/config/preferences/AppleScript.rb +5 -5
  141. data/config/preferences/Bundle Development.rb +10 -10
  142. data/config/preferences/C.rb +38 -30
  143. data/config/preferences/CoffeeScript.rb +28 -0
  144. data/config/preferences/ColdFusion.rb +6 -6
  145. data/config/preferences/Cucumber.rb +40 -0
  146. data/config/preferences/Diff.rb +4 -4
  147. data/config/preferences/Eiffel.rb +6 -6
  148. data/config/preferences/Erlang.rb +16 -16
  149. data/config/preferences/F-Script.rb +12 -12
  150. data/config/preferences/FXScript.rb +5 -5
  151. data/config/preferences/Fortran.rb +17 -17
  152. data/config/preferences/Go.rb +23 -0
  153. data/config/preferences/Groovy.rb +29 -0
  154. data/config/preferences/HTML.rb +44 -44
  155. data/config/preferences/Haskell.rb +14 -14
  156. data/config/preferences/Io.rb +11 -11
  157. data/config/preferences/Java.rb +8 -8
  158. data/config/preferences/LaTeX.rb +24 -24
  159. data/config/preferences/Logo.rb +6 -6
  160. data/config/preferences/Logtalk.rb +5 -5
  161. data/config/preferences/Markdown.rb +43 -0
  162. data/config/preferences/Maven.rb +42 -42
  163. data/config/preferences/Mediawiki.rb +8 -8
  164. data/config/preferences/Movable Type.rb +14 -14
  165. data/config/preferences/OCaml.rb +15 -15
  166. data/config/preferences/Objective-C.rb +5 -5
  167. data/config/preferences/PHP.rb +2564 -0
  168. data/config/preferences/Property List.rb +8 -8
  169. data/config/preferences/R.rb +5 -5
  170. data/config/preferences/Ruby.rb +24 -24
  171. data/config/preferences/Source.rb +13 -13
  172. data/config/preferences/Standard ML.rb +9 -9
  173. data/config/preferences/Tcl.rb +5 -5
  174. data/config/preferences/Text.rb +14 -14
  175. data/config/preferences/TextMate.rb +5 -5
  176. data/config/preferences/Textile.rb +8 -8
  177. data/config/preferences/YARD.rb +9 -0
  178. data/config/preferences/iTerm.rb +9 -9
  179. data/config/rc.rb +5 -2
  180. data/config/snippets/ASP vb.NET.rb +203 -54
  181. data/config/snippets/ASP.rb +51 -36
  182. data/config/snippets/ActionScript.rb +332 -205
  183. data/config/snippets/Active4D.rb +325 -256
  184. data/config/snippets/Ada.rb +106 -60
  185. data/config/snippets/Ant.rb +7 -5
  186. data/config/snippets/Apache.rb +24 -20
  187. data/config/snippets/AppleScript.rb +213 -82
  188. data/config/snippets/Blogging.rb +41 -18
  189. data/config/snippets/Bulletin Board.rb +56 -21
  190. data/config/snippets/Bundle Development.rb +108 -63
  191. data/config/snippets/C++ Qt.rb +72 -57
  192. data/config/snippets/C.rb +128 -100
  193. data/config/snippets/CMake.rb +42 -32
  194. data/config/snippets/CSS.rb +515 -115
  195. data/config/snippets/CoffeeScript.rb +85 -0
  196. data/config/snippets/ColdFusion.rb +2228 -1547
  197. data/config/snippets/Context Free.rb +35 -28
  198. data/config/snippets/Cucumber.rb +55 -0
  199. data/config/snippets/D.rb +164 -111
  200. data/config/snippets/DokuWiki.rb +103 -54
  201. data/config/snippets/Doxygen.rb +87 -40
  202. data/config/snippets/Eiffel.rb +121 -18
  203. data/config/snippets/Erlang.rb +109 -68
  204. data/config/snippets/F-Script.rb +30 -24
  205. data/config/snippets/FXScript.rb +364 -210
  206. data/config/snippets/Fortran.rb +462 -280
  207. data/config/snippets/GTDAlt.rb +10 -4
  208. data/config/snippets/Gettext.rb +10 -8
  209. data/config/snippets/Go.rb +52 -0
  210. data/config/snippets/Greasemonkey.rb +52 -42
  211. data/config/snippets/Gri.rb +12 -10
  212. data/config/snippets/Groovy Grails.rb +313 -0
  213. data/config/snippets/Groovy.rb +685 -0
  214. data/config/snippets/HTML.rb +325 -126
  215. data/config/snippets/Haskell.rb +32 -24
  216. data/config/snippets/Io.rb +53 -42
  217. data/config/snippets/Java.rb +204 -92
  218. data/config/snippets/JavaDoc.rb +105 -56
  219. data/config/snippets/JavaScript MooTools.rb +208 -13
  220. data/config/snippets/JavaScript Objective-J.rb +18 -15
  221. data/config/snippets/JavaScript Prototype & Script.aculo.us.rb +362 -107
  222. data/config/snippets/JavaScript YUI.rb +1245 -186
  223. data/config/snippets/JavaScript jQuery.rb +693 -375
  224. data/config/snippets/JavaScript.rb +71 -53
  225. data/config/snippets/LaTeX.rb +188 -0
  226. data/config/snippets/Lisp.rb +59 -40
  227. data/config/snippets/Logo.rb +12 -6
  228. data/config/snippets/Logtalk.rb +131 -60
  229. data/config/snippets/Lua.rb +43 -33
  230. data/config/snippets/MIPS Assembler.rb +7 -5
  231. data/config/snippets/Mail.rb +10 -1
  232. data/config/snippets/Markdown.rb +7 -0
  233. data/config/snippets/Matlab.rb +232 -178
  234. data/config/snippets/Maven.rb +6 -5
  235. data/config/snippets/Mediawiki.rb +43 -12
  236. data/config/snippets/MoinMoin.rb +50 -10
  237. data/config/snippets/Movable Type.rb +368 -53
  238. data/config/snippets/Nemerle.rb +127 -79
  239. data/config/snippets/OCaml Code Completion Misc.rb +1716 -72
  240. data/config/snippets/OCaml Code Completion Unix.rb +2128 -203
  241. data/config/snippets/OCaml.rb +107 -73
  242. data/config/snippets/ODCompletion.rb +169 -118
  243. data/config/snippets/Objective-C.rb +281 -193
  244. data/config/snippets/PHP Smarty.rb +149 -79
  245. data/config/snippets/PHP.rb +186 -0
  246. data/config/snippets/Pascal.rb +47 -33
  247. data/config/snippets/Perl HTML-Template.rb +33 -0
  248. data/config/snippets/Perl Mason.rb +50 -30
  249. data/config/snippets/Perl Template Toolkit.rb +25 -20
  250. data/config/snippets/Perl.rb +91 -72
  251. data/config/snippets/Processing.rb +55 -33
  252. data/config/snippets/Propel.rb +36 -30
  253. data/config/snippets/Property List.rb +57 -24
  254. data/config/snippets/Python Django Templates.rb +381 -95
  255. data/config/snippets/Python Django.rb +159 -132
  256. data/config/snippets/Python.rb +88 -0
  257. data/config/snippets/R Console (Rdaemon).rb +11 -9
  258. data/config/snippets/R.rb +96 -77
  259. data/config/snippets/Remind.rb +18 -15
  260. data/config/snippets/Ruby RSpec.rb +343 -238
  261. data/config/snippets/Ruby on Rails.rb +1116 -765
  262. data/config/snippets/Ruby.rb +770 -545
  263. data/config/snippets/S5 Slide Show.rb +32 -24
  264. data/config/snippets/SSH Config.rb +21 -17
  265. data/config/snippets/SWIG.rb +30 -18
  266. data/config/snippets/Scilab.rb +98 -79
  267. data/config/snippets/Setext.rb +10 -8
  268. data/config/snippets/Shell Script.rb +52 -42
  269. data/config/snippets/Slate.rb +62 -48
  270. data/config/snippets/Source.rb +24 -1
  271. data/config/snippets/Standard ML.rb +37 -27
  272. data/config/snippets/Tcl.rb +32 -26
  273. data/config/snippets/Text.rb +28 -15
  274. data/config/snippets/Textile.rb +130 -45
  275. data/config/snippets/Thrift.rb +22 -18
  276. data/config/snippets/Twiki.rb +158 -105
  277. data/config/snippets/Txt2tags.rb +166 -79
  278. data/config/snippets/Vectorscript.rb +47 -38
  279. data/config/snippets/Widget Creator.rb +5 -5
  280. data/config/snippets/XML.rb +30 -18
  281. data/config/snippets/YAML.rb +5 -4
  282. data/config/snippets/YARD.rb +93 -0
  283. data/config/snippets/reStructuredText.rb +25 -20
  284. data/config/syntax/ANTLR.rb +17 -15
  285. data/config/syntax/ASP vb.NET.rb +27 -24
  286. data/config/syntax/ASP.rb +21 -19
  287. data/config/syntax/ActionScript.rb +16 -16
  288. data/config/syntax/Active4D Config.rb +5 -5
  289. data/config/syntax/Active4D Library.rb +2 -2
  290. data/config/syntax/Active4D.rb +32 -30
  291. data/config/syntax/Ada.rb +13 -10
  292. data/config/syntax/Ant.rb +9 -7
  293. data/config/syntax/Apache.rb +22 -18
  294. data/config/syntax/AppleScript.rb +486 -192
  295. data/config/syntax/AsciiDoc.rb +21 -0
  296. data/config/syntax/BibTeX.rb +7 -7
  297. data/config/syntax/Blog - HTML.rb +7 -7
  298. data/config/syntax/Blog - Markdown.rb +6 -6
  299. data/config/syntax/Blog - Text.rb +2 -2
  300. data/config/syntax/Blog - Textile.rb +2 -2
  301. data/config/syntax/Bulletin Board.rb +33 -32
  302. data/config/syntax/C++ Qt.rb +7 -6
  303. data/config/syntax/C++.rb +31 -28
  304. data/config/syntax/C.rb +55 -51
  305. data/config/syntax/CMake Listfile.rb +12 -11
  306. data/config/syntax/CSS.rb +24 -23
  307. data/config/syntax/CSV.rb +3 -3
  308. data/config/syntax/CoffeeScript.rb +161 -0
  309. data/config/syntax/ColdFusion.rb +8 -8
  310. data/config/syntax/Context Free.rb +18 -16
  311. data/config/syntax/Cucumber Steps.rb +108 -0
  312. data/config/syntax/D.rb +70 -69
  313. data/config/syntax/Diff.rb +13 -10
  314. data/config/syntax/DokuWiki.rb +22 -18
  315. data/config/syntax/Doxygen.rb +1 -1
  316. data/config/syntax/Dylan.rb +8 -8
  317. data/config/syntax/Eiffel.rb +12 -12
  318. data/config/syntax/Erlang.rb +96 -89
  319. data/config/syntax/F-Script.rb +11 -9
  320. data/config/syntax/FXScript.rb +16 -14
  321. data/config/syntax/Fortran - Modern.rb +25 -24
  322. data/config/syntax/Fortran - Punchcard.rb +43 -40
  323. data/config/syntax/GTD.rb +1 -1
  324. data/config/syntax/GTDalt.rb +14 -11
  325. data/config/syntax/Gettext.rb +10 -9
  326. data/config/syntax/Gherkin.rb +65 -0
  327. data/config/syntax/Go.rb +256 -0
  328. data/config/syntax/Grails Server Page.rb +108 -0
  329. data/config/syntax/Graphviz (DOT).rb +6 -6
  330. data/config/syntax/Greasemonkey.rb +3 -3
  331. data/config/syntax/Gri.rb +12 -12
  332. data/config/syntax/Groovy.rb +502 -0
  333. data/config/syntax/HTML (ASP).rb +3 -3
  334. data/config/syntax/HTML (ASP.net).rb +31 -31
  335. data/config/syntax/HTML (Active4D).rb +19 -19
  336. data/config/syntax/HTML (Django).rb +6 -6
  337. data/config/syntax/HTML (Erlang).rb +4 -4
  338. data/config/syntax/HTML (Mason).rb +13 -13
  339. data/config/syntax/HTML (Rails).rb +5 -5
  340. data/config/syntax/HTML (Tcl).rb +3 -3
  341. data/config/syntax/HTML (Template Toolkit).rb +9 -9
  342. data/config/syntax/HTML.rb +27 -27
  343. data/config/syntax/Haskell.rb +31 -28
  344. data/config/syntax/Inform.rb +5 -5
  345. data/config/syntax/Ini.rb +4 -4
  346. data/config/syntax/Installer Distribution Script.rb +19 -18
  347. data/config/syntax/Io.rb +17 -15
  348. data/config/syntax/JSFL.rb +7 -6
  349. data/config/syntax/Java Properties.rb +3 -3
  350. data/config/syntax/Java Server Page (JSP).rb +5 -4
  351. data/config/syntax/Java.rb +40 -33
  352. data/config/syntax/JavaDoc.rb +24 -22
  353. data/config/syntax/JavaScript (Rails).rb +1 -1
  354. data/config/syntax/JavaScript.rb +41 -34
  355. data/config/syntax/Javascript YUI.rb +109 -101
  356. data/config/syntax/LaTeX Beamer.rb +3 -3
  357. data/config/syntax/LaTeX Log.rb +3 -3
  358. data/config/syntax/LaTeX Memoir.rb +7 -5
  359. data/config/syntax/LaTeX Rdaemon.rb +1 -1
  360. data/config/syntax/LaTeX.rb +52 -47
  361. data/config/syntax/Language Grammar.rb +58 -55
  362. data/config/syntax/Lex-Flex.rb +13 -13
  363. data/config/syntax/Lighttpd.rb +7 -7
  364. data/config/syntax/Lisp.rb +6 -5
  365. data/config/syntax/Literate Haskell.rb +2 -2
  366. data/config/syntax/Logo.rb +4 -4
  367. data/config/syntax/Logtalk.rb +64 -49
  368. data/config/syntax/Lua.rb +12 -12
  369. data/config/syntax/MATLAB.rb +71 -70
  370. data/config/syntax/MEL.rb +16 -15
  371. data/config/syntax/MIPS Assembler.rb +11 -11
  372. data/config/syntax/MacPorts Portfile.rb +16 -15
  373. data/config/syntax/Mail.rb +5 -4
  374. data/config/syntax/Makefile.rb +3 -3
  375. data/config/syntax/Man.rb +2 -2
  376. data/config/syntax/Markdown.rb +440 -0
  377. data/config/syntax/Maven POM.rb +17 -16
  378. data/config/syntax/Mediawiki.rb +46 -46
  379. data/config/syntax/Modula-3.rb +7 -6
  380. data/config/syntax/MoinMoin.rb +16 -16
  381. data/config/syntax/MooTools.rb +75 -65
  382. data/config/syntax/Movable Type (MT only).rb +18 -18
  383. data/config/syntax/Movable Type.rb +20 -20
  384. data/config/syntax/MultiMarkdown.rb +35 -0
  385. data/config/syntax/Nemerle.rb +12 -12
  386. data/config/syntax/OCaml.rb +79 -71
  387. data/config/syntax/OCamllex.rb +14 -14
  388. data/config/syntax/OCamlyacc.rb +14 -12
  389. data/config/syntax/Objective-C++.rb +2 -2
  390. data/config/syntax/Objective-C.rb +76 -70
  391. data/config/syntax/Objective-J.rb +30 -29
  392. data/config/syntax/Octave.rb +27 -27
  393. data/config/syntax/OpenGL.rb +4 -4
  394. data/config/syntax/PHP.rb +1154 -0
  395. data/config/syntax/Pascal.rb +8 -8
  396. data/config/syntax/Perl HTML-Template.rb +5 -5
  397. data/config/syntax/Perl.rb +80 -76
  398. data/config/syntax/Plain Text.rb +5 -5
  399. data/config/syntax/Postscript.rb +6 -6
  400. data/config/syntax/Processing.rb +20 -20
  401. data/config/syntax/Prolog.rb +2 -2
  402. data/config/syntax/Property List.rb +50 -47
  403. data/config/syntax/Prototype & Script.aculo.us (JavaScript) Bracketed.rb +15 -13
  404. data/config/syntax/Prototype & Script.aculo.us (JavaScript).rb +9 -8
  405. data/config/syntax/Python Django.rb +6 -6
  406. data/config/syntax/Python.rb +94 -87
  407. data/config/syntax/Quake Style .cfg.rb +4 -4
  408. data/config/syntax/R Console (Rdaemon) Plain.rb +2 -2
  409. data/config/syntax/R Console (Rdaemon).rb +2 -2
  410. data/config/syntax/R.rb +21 -20
  411. data/config/syntax/RSpec.rb +15 -15
  412. data/config/syntax/Ragel.rb +14 -13
  413. data/config/syntax/Rd (R Documentation).rb +4 -4
  414. data/config/syntax/Regular Expressions (Oniguruma).rb +11 -10
  415. data/config/syntax/Regular Expressions (Python).rb +9 -9
  416. data/config/syntax/Release Notes.rb +7 -6
  417. data/config/syntax/Remind.rb +19 -17
  418. data/config/syntax/Rez.rb +10 -9
  419. data/config/syntax/Ruby Haml.rb +11 -11
  420. data/config/syntax/Ruby on Rails.rb +26 -24
  421. data/config/syntax/Ruby.rb +73 -71
  422. data/config/syntax/S5 Slide Show.rb +9 -9
  423. data/config/syntax/SQL.rb +29 -27
  424. data/config/syntax/SSH Config.rb +4 -4
  425. data/config/syntax/SWIG.rb +12 -11
  426. data/config/syntax/SWeave.rb +8 -7
  427. data/config/syntax/Scheme.rb +56 -54
  428. data/config/syntax/Scilab.rb +7 -6
  429. data/config/syntax/Setext.rb +14 -13
  430. data/config/syntax/Shell Script (Bash).rb +42 -42
  431. data/config/syntax/Slate.rb +24 -19
  432. data/config/syntax/Smarty.rb +11 -10
  433. data/config/syntax/Standard ML - CM.rb +2 -2
  434. data/config/syntax/Standard ML.rb +26 -23
  435. data/config/syntax/Strings File.rb +6 -6
  436. data/config/syntax/TSV.rb +2 -2
  437. data/config/syntax/Tcl.rb +10 -9
  438. data/config/syntax/TeX Math.rb +7 -6
  439. data/config/syntax/TeX.rb +7 -7
  440. data/config/syntax/Textile.rb +33 -27
  441. data/config/syntax/Thrift.rb +37 -29
  442. data/config/syntax/Twiki.rb +19 -18
  443. data/config/syntax/Txt2tags.rb +26 -23
  444. data/config/syntax/Vectorscript.rb +9 -7
  445. data/config/syntax/XML strict.rb +6 -4
  446. data/config/syntax/XML.rb +55 -30
  447. data/config/syntax/XSL.rb +5 -5
  448. data/config/syntax/YAML.rb +14 -12
  449. data/config/syntax/camlp4.rb +5 -5
  450. data/config/syntax/iCalendar.rb +3 -3
  451. data/config/syntax/jQuery (JavaScript).rb +9 -9
  452. data/config/syntax/mod_perl.rb +6 -6
  453. data/config/syntax/qmake Project file.rb +16 -15
  454. data/config/syntax/reStructuredText.rb +23 -21
  455. data/config/syntax/svn-commit.tmp.rb +5 -5
  456. data/lib/ver.rb +169 -85
  457. data/lib/ver/action.rb +39 -30
  458. data/lib/ver/buffer.rb +962 -144
  459. data/lib/ver/buffer/frame.rb +23 -0
  460. data/lib/ver/buffer/invalid_trailing_whitespace.rb +17 -0
  461. data/lib/ver/buffer/markup_underline_link.rb +30 -0
  462. data/lib/ver/buffer/matching_brace.rb +22 -0
  463. data/lib/ver/buffer/term.rb +1 -1
  464. data/lib/ver/clipboard.rb +107 -0
  465. data/lib/ver/digraphs.rb +1373 -0
  466. data/lib/ver/entry.rb +54 -43
  467. data/lib/ver/event.rb +335 -0
  468. data/lib/ver/exception_view.rb +3 -1
  469. data/lib/ver/executor.rb +7 -7
  470. data/lib/ver/executor/buffer.rb +4 -4
  471. data/lib/ver/executor/encoding.rb +19 -0
  472. data/lib/ver/executor/entry.rb +9 -9
  473. data/lib/ver/executor/fuzzy_file_finder.rb +1 -1
  474. data/lib/ver/executor/label.rb +2 -0
  475. data/lib/ver/executor/method.rb +2 -3
  476. data/lib/ver/help/describe_key.rb +44 -44
  477. data/lib/ver/hover_completion.rb +11 -6
  478. data/lib/ver/keymap.rb +68 -39
  479. data/lib/ver/layout/paned.rb +56 -44
  480. data/lib/ver/layout/toplevel.rb +68 -0
  481. data/lib/ver/layout/vim.rb +919 -0
  482. data/lib/ver/major_mode.rb +49 -49
  483. data/lib/ver/methods.rb +22 -25
  484. data/lib/ver/methods/basic.rb +49 -20
  485. data/lib/ver/methods/bookmark.rb +33 -33
  486. data/lib/ver/methods/clipboard.rb +186 -49
  487. data/lib/ver/methods/completion.rb +5 -5
  488. data/lib/ver/methods/control.rb +47 -66
  489. data/lib/ver/methods/delete.rb +5 -122
  490. data/lib/ver/methods/help.rb +2 -2
  491. data/lib/ver/methods/insert.rb +101 -29
  492. data/lib/ver/methods/layout.rb +62 -64
  493. data/lib/ver/methods/macro.rb +45 -0
  494. data/lib/ver/methods/move.rb +63 -349
  495. data/lib/ver/methods/nano.rb +99 -71
  496. data/lib/ver/methods/open.rb +8 -7
  497. data/lib/ver/methods/preview.rb +34 -14
  498. data/lib/ver/methods/save.rb +194 -163
  499. data/lib/ver/methods/search.rb +169 -81
  500. data/lib/ver/methods/search_and_replace.rb +62 -49
  501. data/lib/ver/methods/selection.rb +26 -54
  502. data/lib/ver/methods/snippet.rb +79 -54
  503. data/lib/ver/methods/undo.rb +12 -16
  504. data/lib/ver/minibuffer.rb +283 -134
  505. data/lib/ver/minor_mode.rb +36 -47
  506. data/lib/ver/mode_resolving.rb +71 -0
  507. data/lib/ver/platform.rb +41 -0
  508. data/lib/ver/plist.rb +16 -4
  509. data/lib/ver/register.rb +86 -0
  510. data/lib/ver/status.rb +44 -6
  511. data/lib/ver/status/battery.rb +1 -1
  512. data/lib/ver/status/buffer_position.rb +2 -2
  513. data/lib/ver/status/diakonos_position.rb +3 -3
  514. data/lib/ver/status/encoding.rb +1 -1
  515. data/lib/ver/status/filename.rb +1 -1
  516. data/lib/ver/status/label.rb +20 -20
  517. data/lib/ver/status/mode.rb +1 -1
  518. data/lib/ver/status/nano_help.rb +3 -14
  519. data/lib/ver/status/nano_position.rb +6 -6
  520. data/lib/ver/status/percent.rb +2 -2
  521. data/lib/ver/status/position.rb +2 -2
  522. data/lib/ver/status/short_filename.rb +1 -1
  523. data/lib/ver/status/syntax.rb +1 -1
  524. data/lib/ver/struct.rb +28 -0
  525. data/lib/ver/syntax/processor.rb +2 -1
  526. data/lib/ver/text.rb +48 -520
  527. data/lib/ver/text/end.rb +14 -0
  528. data/lib/ver/text/index.rb +16 -101
  529. data/lib/ver/text/insert.rb +138 -0
  530. data/lib/ver/text/mark.rb +559 -0
  531. data/lib/ver/text/position.rb +240 -0
  532. data/lib/ver/text/range.rb +74 -0
  533. data/lib/ver/text/selection.rb +402 -0
  534. data/lib/ver/text/selection/block.rb +69 -0
  535. data/lib/ver/text/selection/char.rb +93 -0
  536. data/lib/ver/text/selection/line.rb +64 -0
  537. data/lib/ver/text/tag.rb +322 -0
  538. data/lib/ver/undo.rb +109 -34
  539. data/lib/ver/vendor/eval_completer.rb +184 -0
  540. data/lib/ver/vendor/json_store.rb +23 -0
  541. data/lib/ver/vendor/open3.rb +729 -0
  542. data/lib/ver/vendor/pathname.rb +73 -0
  543. data/lib/ver/vendor/textpow.rb +1 -1
  544. data/lib/ver/version.rb +1 -1
  545. data/lib/ver/widget_event.rb +9 -5
  546. data/lib/ver/widget_major_mode.rb +69 -23
  547. data/spec/helper.rb +124 -8
  548. data/spec/ver/action.rb +160 -46
  549. data/spec/ver/buffer.rb +23 -0
  550. data/spec/ver/clipboard.rb +92 -0
  551. data/spec/ver/keymap.rb +63 -61
  552. data/spec/ver/keymap/diakonos.rb +88 -0
  553. data/spec/ver/keymap/emacs.rb +65 -0
  554. data/spec/ver/keymap/general.rb +98 -0
  555. data/spec/ver/keymap/nano.rb +84 -0
  556. data/spec/ver/keymap/vim.rb +205 -0
  557. data/spec/ver/keymap/vim/changing_text.rb +489 -0
  558. data/spec/ver/keymap/vim/complex_changes.rb +53 -0
  559. data/spec/ver/keymap/vim/copying_and_moving_text.rb +258 -0
  560. data/spec/ver/keymap/vim/deleting_text.rb +188 -0
  561. data/spec/ver/keymap/vim/digraphs.rb +52 -0
  562. data/spec/ver/keymap/vim/external_commands.rb +21 -0
  563. data/spec/ver/keymap/vim/inserting_mode_keys.rb +115 -0
  564. data/spec/ver/keymap/vim/inserting_mode_special.rb +168 -0
  565. data/spec/ver/keymap/vim/inserting_text.rb +108 -0
  566. data/spec/ver/keymap/vim/left_right_motion.rb +120 -0
  567. data/spec/ver/keymap/vim/mark_motion.rb +73 -0
  568. data/spec/ver/keymap/vim/repeating_commands.rb +64 -0
  569. data/spec/ver/keymap/vim/text_object_motion.rb +137 -0
  570. data/spec/ver/keymap/vim/text_objects.rb +101 -0
  571. data/spec/ver/keymap/vim/undo_redo.rb +21 -0
  572. data/spec/ver/keymap/vim/up_down_motion.rb +94 -0
  573. data/spec/ver/keymap/vim/various_motion.rb +33 -0
  574. data/spec/ver/keysyms.rb +13 -0
  575. data/spec/ver/major_mode.rb +37 -37
  576. data/spec/ver/minor_mode.rb +21 -20
  577. data/spec/ver/plugin/smart_autoindent.rb +2 -2
  578. data/spec/ver/text/index.rb +122 -0
  579. data/spec/ver/text/insert.rb +299 -0
  580. data/spec/ver/text/mark.rb +94 -0
  581. data/spec/ver/text/range.rb +71 -0
  582. data/spec/ver/text/selection.rb +315 -0
  583. data/spec/ver/text/tag.rb +93 -0
  584. data/spec/ver/undo.rb +133 -0
  585. data/spec/ver/undo/record_sanitize.rb +85 -0
  586. data/spec/ver/vendor/eval_completer.rb +91 -0
  587. data/spec/ver/widget_major_mode.rb +4 -3
  588. data/ver.gemspec +8 -8
  589. metadata +234 -72
  590. data/.todo +0 -102
  591. data/ROADMAP.textile +0 -187
  592. data/config/snippets/ANTLR.rb +0 -3
  593. data/config/snippets/Bison.rb +0 -3
  594. data/config/snippets/CTags.rb +0 -3
  595. data/config/snippets/CVS.rb +0 -3
  596. data/config/snippets/Darcs.rb +0 -3
  597. data/config/snippets/Diff.rb +0 -3
  598. data/config/snippets/Dylan.rb +0 -3
  599. data/config/snippets/Experimental Wiki.rb +0 -3
  600. data/config/snippets/Experimental.rb +0 -3
  601. data/config/snippets/FileMerge.rb +0 -3
  602. data/config/snippets/GTD2.rb +0 -3
  603. data/config/snippets/GetBundle.rb +0 -3
  604. data/config/snippets/Graphviz.rb +0 -3
  605. data/config/snippets/Hotkey.rb +0 -3
  606. data/config/snippets/Hyperlink Helper.rb +0 -3
  607. data/config/snippets/ImageBrowser.rb +0 -3
  608. data/config/snippets/Inform.rb +0 -3
  609. data/config/snippets/Ini.rb +0 -3
  610. data/config/snippets/Installer.rb +0 -3
  611. data/config/snippets/JSFL.rb +0 -3
  612. data/config/snippets/JSON.rb +0 -3
  613. data/config/snippets/Lex-Flex.rb +0 -3
  614. data/config/snippets/Lighttpd.rb +0 -3
  615. data/config/snippets/MEL.rb +0 -3
  616. data/config/snippets/MacPorts.rb +0 -3
  617. data/config/snippets/Make.rb +0 -3
  618. data/config/snippets/Man Pages.rb +0 -3
  619. data/config/snippets/Math.rb +0 -3
  620. data/config/snippets/Mercurial.rb +0 -3
  621. data/config/snippets/Modula.rb +0 -3
  622. data/config/snippets/Navigation.rb +0 -3
  623. data/config/snippets/OCaml Experimental Completions.rb +0 -3
  624. data/config/snippets/OpenGL.rb +0 -3
  625. data/config/snippets/Outlines.rb +0 -3
  626. data/config/snippets/Perforce.rb +0 -3
  627. data/config/snippets/Perl HTML::Template.rb +0 -27
  628. data/config/snippets/Postscript.rb +0 -3
  629. data/config/snippets/Prolog.rb +0 -3
  630. data/config/snippets/Quake.rb +0 -3
  631. data/config/snippets/R Console (R.app).rb +0 -3
  632. data/config/snippets/Ragel.rb +0 -3
  633. data/config/snippets/Regular Expressions.rb +0 -3
  634. data/config/snippets/Rez.rb +0 -3
  635. data/config/snippets/Ruby Haml.rb +0 -3
  636. data/config/snippets/SCons.rb +0 -3
  637. data/config/snippets/SQL.rb +0 -3
  638. data/config/snippets/SVK.rb +0 -3
  639. data/config/snippets/SWeave.rb +0 -3
  640. data/config/snippets/Scheme.rb +0 -3
  641. data/config/snippets/Subversion.rb +0 -3
  642. data/config/snippets/TODO.rb +0 -3
  643. data/config/snippets/Tabular.rb +0 -3
  644. data/config/snippets/TerminalMate.rb +0 -3
  645. data/config/snippets/TextMate.rb +0 -3
  646. data/config/snippets/Transmit.rb +0 -3
  647. data/config/snippets/Xcode.rb +0 -3
  648. data/config/snippets/iCalendar.rb +0 -3
  649. data/config/snippets/iTerm.rb +0 -3
  650. data/lib/ver/keysyms.rb +0 -104
  651. data/spec/ver/methods/move.rb +0 -150
@@ -0,0 +1,337 @@
1
+ # Encoding: UTF-8
2
+
3
+ [{beforeRunningCommand: "nop",
4
+ command:
5
+ "CRAN=\"http://cran.cnr.berkeley.edu\"\nSOFILE=\"$HOME/Library/Application Support/Rdaemon/startOptions.R\"\nif [ -f \"$SOFILE\" ]; then\n\tRES=$(cat \"$SOFILE\" | egrep 'options.*?repos.*?list' | perl -pe 's/^\\s*options\\s*.*?repos\\s*=\\s*.*?[\\x{27}\"](.*?)[\\x{27}\"].*/$1/g' | tail -n 1)\n\t[[ ! -z \"$RES\" ]] && [[ \"${RES:0:4}\" == \"http\" ]] && CRAN=\"$RES\"\nfi\nopen \"$CRAN/web/packages/\"",
6
+ input: "none",
7
+ name: "CRAN Packages",
8
+ output: "showAsTooltip",
9
+ scope: "source.r",
10
+ uuid: "2A3C3EF9-2043-4304-81EC-EA3309286F98"},
11
+ {beforeRunningCommand: "nop",
12
+ command:
13
+ "\nexport WORD=$(ruby -- <<-SCR1 \n\trequire File.join(ENV[\"TM_SUPPORT_PATH\"], \"lib/current_word.rb\")\n\tword = Word.current_word('\\w\\.')\n\tprint word\nSCR1\n)\n\n#check whether WORD is defined otherwise quit\n[[ -z \"$WORD\" ]] && echo \"No keyword found\" && exit_show_tool_tip\n\nRhelperAnswer=\"/tmp/textmate_Rhelper_out\"\n\nWORDORG=\"$WORD\"\nRD=$(echo -n \"$TM_SCOPE\" | grep -c -F 'source.rd.console')\n\nif [ $RD -gt 0 ]; then\n\tRDHOME=\"$HOME/Library/Application Support/Rdaemon\"\n\tif [ \"$TM_RdaemonRAMDRIVE\" == \"1\" ]; then\n\t\tRDRAMDISK=\"/tmp/TMRramdisk1\"\n\telse\n\t\tRDRAMDISK=\"$RDHOME\"\n\tfi\n\n\t#get R's PID\n\tRPID=$(ps aw | grep '[0-9] /.*TMRdaemon' | awk '{print $1;}' )\n\n\t#check whether Rdaemon runs\n\tif [ -z $RPID ]; then\n\t\tRDTEXT=\"Rdaemon is not running.\"\n\telse\n\t\t[[ -e \"$RDRAMDISK\"/r_tmp ]] && rm \"$RDRAMDISK\"/r_tmp\n\t\tTASK=\"@|sink('$RDRAMDISK/r_tmp')\"\n\t\techo -e \"$TASK\" > \"$RDHOME\"/r_in\n\t\tTASK=\"@|cat(paste(apropos('^${WORD}'),'|OK',sep='',collapse='\\\\\\n'))\"\n\t\techo -e \"$TASK\" > \"$RDHOME\"/r_in\n\t\tTASK=\"@|sink(file=NULL)\"\n\t\techo -e \"$TASK\" > \"$RDHOME\"/r_in\n\n\t\t#get R's PID\n\t\tRPID=$(ps aw | grep '[0-9] /.*TMRdaemon' | awk '{print $1;}' )\n\t\t#check whether Rdaemon runs\n\t\ttest -z $RPID && echo -en \"Rdaemon is not running.\" && exit 206\n\n\t\twhile [ 1 ]\n\t\tdo\n\t\t\tRES=$(tail -c 2 \"$RDRAMDISK\"/r_out)\n\t\t\t#expect these things from R\n\t\t\t[[ \"$RES\" == \"> \" ]] && break\n\t\t\t[[ \"$RES\" == \"+ \" ]] && break\n\t\t\t[[ \"$RES\" == \": \" ]] && break\n\t\t\tsleep 0.05\n\t\tdone\n\t\tsleep 0.001\n\t\tLOCAL=$(cat \"$RDRAMDISK\"/r_tmp | sort)\n\tfi\nfi\n\n[[ $RD -eq 0 ]] && LOCAL=$(cat | grep '<\\- *function' | perl -pe 's/\\t//g;s/ *(.*?) *<\\-.*/$1|OK/' | sort | egrep -i \"^${WORD//./\\\\.}\")\n\n#get suggestions\n\"$TM_BUNDLE_SUPPORT\"/bin/askRhelperDaemon.sh \"@getCompletionList('$WORD',T)\"\nRES=$(cat \"$RhelperAnswer\")\nRES=$(echo -e \"$LOCAL\"; echo -en \"$RES\")\n\nruby -- <<-SCRIPT 2> /dev/null\nrequire File.join(ENV[\"TM_SUPPORT_PATH\"], \"lib/exit_codes.rb\")\nrequire \"\#{ENV[\"TM_SUPPORT_PATH\"]}/lib/ui\"\nword = \"$WORD\"\nwordorg = \"$WORDORG\"\ntext = \"$RES\"\nfuns = text.gsub(/\\n{2,}/,\"\\n\").split(\"\\n\")\n\nrdfuns = funs.select {|x| x =~ /\\|OK$/ }\nrdfuns.collect! {|x| x.gsub(/\\|OK$/, \"\") }\nfuns.delete_if {|x| x.match('\\|OK$') }\nf1 = funs.collect{|item| item.gsub(/\\t.*/, \"\")}\nrdfuns.sort! {|x,y| y <=> x }\nrdfuns.each_index do |i|\n\tif ! f1.include?(rdfuns[i]) && rdfuns[i].length > 0\n\t\tfuns.unshift(rdfuns[i] + \"\tlocal\" )\n\tend\nend\n\nfuns.delete_if {|x| x.match('[,\\- ]') }\nfuns.delete_if {|x| x.match('matrices.*rgl') }\nfuns.delete_if {|x| x.match('^\\s*$') }\nif \"$RD\" == \"1\"\n\tfuns.collect! do |x|\n\t\tif rdfuns.include?(x.gsub(/\\t.*/,\"\"))\n\t\t\tx= \"%s   …%s…\" % x.split(\"\\t\")\n\t\telse\n\t\t\tx= \"%s   {%s}\" % x.split(\"\\t\")\n\t\tend\n\tend\nelse\n\tfuns.collect! do |x|\n\t\tif rdfuns.include?(x.gsub(/\\t.*/,\"\"))\n\t\t\tx= \"%s   …%s…\" % x.split(\"\\t\")\n\t\telse\n\t\t\tx= \"%s   [%s]\" % x.split(\"\\t\")\n\t\tend\n\tend\nend\n\nfunctions = funs.select{|item| item =~ /^\#{word.gsub(\".\",\"\\\\.\")}/}\nfunc = funs.select{|item| item !~ /^\#{word.gsub(\".\",\"\\\\.\")}/}\nfp = func.join(\"\\n\")\nif (functions.size < 1 && (ENV['TM_SELECTED_TEXT'].nil? || ENV['TM_SELECTED_TEXT'].empty?)) then\n\tif fp.size > 0\n\t\tTextMate.exit_show_tool_tip(\"Only found :\\n\#{fp}\")\n\telse\n\t\tTextMate.exit_show_tool_tip(\"Nothing found\")\n\tend\nend\n\nif (! ENV['TM_SELECTED_TEXT'].nil? && ! ENV['TM_SELECTED_TEXT'].empty?) then\n\tfunctions.replace(funs)\nend\n\nif (functions.size == 1 && (ENV['R_AUTOCOMPLETE'].to_i == 1 || ENV['TM_R_AUTOCOMPLETE'].to_i == 1))\n\tfunction = functions.first\nelse\n\tisDIALOG2 = ! ENV[\"DIALOG\"].match(/2$/).nil?\n\tif isDIALOG2\n\t\tfn = []\n\t\tfunctions.each do |f|\n\t\t\tfn << {'insert' => \"\\${1:(\\${2:})}\", 'display' => f, 'match' => f.gsub(/\\s.*/,\"\")}\n\t\tend\n\t\tTextMate::UI.complete(fn, :extra_chars => '.')\n\t\tTextMate.exit_discard\n\telse\n\t\tidx = TextMate::UI.menu(functions)\n\t\tTextMate.exit_discard if idx.nil?\n\t\tfunction = functions[idx]\n\tend\nend\n# TextMate.exit_discard if function.empty?\nif ENV['TM_SELECTED_TEXT'].nil? or ENV['TM_SELECTED_TEXT'].empty?\n print function.gsub!(/\\s.*/,\"\")[wordorg.length..-1]\nelse\n print function.gsub!(/\\s.*/,\"\")\nend\nSCRIPT\n",
14
+ fallbackInput: "none",
15
+ input: "document",
16
+ keyEquivalent: "^.",
17
+ name: "Completion…",
18
+ output: "insertAsSnippet",
19
+ scope: "source.r, source.rd.console",
20
+ uuid: "8A17F5A3-7E52-4C6D-AA70-99476FB82625"},
21
+ {beforeRunningCommand: "nop",
22
+ command: "cat | R --vanilla --slave --no-readline --encoding=UTF-8 | pbcopy",
23
+ input: "selection",
24
+ keyEquivalent: "^@r",
25
+ name: "Copy Result into Pasteboard",
26
+ output: "showAsTooltip",
27
+ scope: "source.r",
28
+ uuid: "C666D732-9E4D-49C7-BEEC-BC20590414BF"},
29
+ {beforeRunningCommand: "nop",
30
+ command:
31
+ "#!/usr/bin/env ruby\nrequire ENV['TM_SUPPORT_PATH'] + \"/lib/escape.rb\";\ntext = STDIN.read\ntext = `export __CF_USER_TEXT_ENCODING=0x1F5:0x8000100:0x8000100; pbpaste` if text.empty?\ntext << \"\\n\" if ! text.match(/\\n$/)\nrcnt = text.count \"\\n\"\n\ntext.gsub!(/(^\\s+|\\s+$)/,\"\")\ntext.gsub!(/\\s{1,}/,\" \")\nprint \"${1:${2:x} <- }matrix(c(\"\nout = Array.new\n$LFlag = ''\ntext.split.each{|b|\n\t$LFlag = ''\n\tif b.match(/^\\d+L$/)\n\t\t$LFlag = 'L'\n\t\tb.gsub!(/L$/, '')\n\tend\n\tif (b.to_f == 0 && ! b.match(/-?\\.?0\\.?0*/) && ! b.match(/^[\"'].*[\"']$/)) || b.match(/^\\d+[^\\d\\-\\.eE]+/)\n\t\tout << '\"' + e_sn(b) + '\"'\n\telse\n\t\tout << e_sn(b) + $LFlag\n\tend\n}\nprint out.join(', ')\nprint \"), nrow=\#{rcnt}, byrow=TRUE)\"\n\n\n\n#print \"${1:${2:x} <- }matrix(c(\"+e_sn(text).sub(/\\s+$/,\"\").gsub(/([a-zA-Z]+)/, '\"\\1\"').gsub(/\\s+/,\", \") + \"), nrow=\#{rcnt}, byrow=TRUE)\"",
32
+ fallbackInput: "none",
33
+ input: "selection",
34
+ keyEquivalent: "^~c",
35
+ name: "Create Matrix from Selection",
36
+ output: "insertAsSnippet",
37
+ scope: "source.r, source.rd.console",
38
+ uuid: "BC6C2055-67E1-4902-98B0-AACDFEE031BB"},
39
+ {beforeRunningCommand: "nop",
40
+ command:
41
+ "#!/usr/bin/env ruby -wKU\nrequire ENV['TM_SUPPORT_PATH'] + \"/lib/escape.rb\";\ntext = STDIN.read\ntext = `export __CF_USER_TEXT_ENCODING=0x1F5:0x8000100:0x8000100; pbpaste` if text.empty?\ntext.gsub!(/(^\\s+|\\s+$)/,\"\")\ntext.gsub!(/\\s{1,}/,\" \")\nprint \"${1:${2:x} <- }c(\"\nout = Array.new\n$LFlag = ''\ntext.split.each{|b|\n\t$LFlag = ''\n\tif b.match(/^\\d+L$/)\n\t\t$LFlag = 'L'\n\t\tb.gsub!(/L$/, '')\n\tend\n\tif (b.to_f == 0 && ! b.match(/-?\\.?0\\.?0*/) && ! b.match(/^[\"'].*[\"']$/)) || b.match(/^\\d+[^\\d\\-\\.eE]+/ )\n\t\tout << '\"' + e_sn(b) + '\"'\n\telse\n\t\tout << e_sn(b) + $LFlag\n\tend\n}\nprint out.join(', ')\nprint \")\"\n",
42
+ fallbackInput: "none",
43
+ input: "selection",
44
+ keyEquivalent: "^~c",
45
+ name: "Create Vector from Selection",
46
+ output: "insertAsSnippet",
47
+ scope: "source.r, source.rd.console",
48
+ uuid: "F61688AA-C298-4D58-A9DE-87891797B2F9"},
49
+ {beforeRunningCommand: "nop",
50
+ command:
51
+ "#!/usr/bin/env ruby\n# print \"Got:\" + STDIN.read\n\nrequire ENV['TM_SUPPORT_PATH'] +'/lib/ui.rb'\nrequire ENV['TM_SUPPORT_PATH'] +'/lib/exit_codes.rb'\nopts = { \"Mean\" => \"mean(${1:x})\", \n \"Variance\" => \"var(${1:x})\",\n \"Std. Dev.\" => \"sd(${1:x})\",\n \"Correlation\" => \"cor(${1:x})\",\n \"Five Num Sum\" => \"fivenum(${1:x})\",\n \"Quantiles\" => \"quantile(${1:x},${2:quantiles})\",\n \"Median\" => \"median(${1:x})\",\n\t\t\"Max\" => \"max(${1:x}${2:, na.rm=TRUE})\",\n\t\t\"Min\" => \"min(${1:x}${2:, na.rm=TRUE})\",\n\t\t\"Range\" => \"range(${1:x}${2:, na.rm=TRUE})\"\n}\nkeys = opts.keys.sort\nans = TextMate::UI.menu(keys)\nTextMate.exit_discard unless ans\nprint opts[keys[ans]]",
52
+ fallbackInput: "word",
53
+ input: "none",
54
+ keyEquivalent: "~@D",
55
+ name: "Descriptives…",
56
+ output: "insertAsSnippet",
57
+ scope: "source.r, source.rd.console",
58
+ uuid: "6BC03260-79E4-47B6-87CE-020BD066E0FB"},
59
+ {beforeRunningCommand: "nop",
60
+ command:
61
+ "WDIR=\"$HOME/Library/Application Support/TextMate/R/help/command_args\"\n\n\"$TM_BUNDLE_SUPPORT\"/bin/initCommandArgsDir.sh\n\nmate \"$WDIR\"",
62
+ input: "none",
63
+ name: "Edit user-defined Function Parameter",
64
+ output: "showAsTooltip",
65
+ scope: "source.r, source.rd.console",
66
+ uuid: "BED22435-E025-4C52-9CC5-08B4296F524F"},
67
+ {beforeRunningCommand: "nop",
68
+ command:
69
+ "#!/usr/bin/env ruby\nrequire ENV['TM_SUPPORT_PATH'] +'/lib/escape.rb'\nrequire File.join(ENV[\"TM_SUPPORT_PATH\"], \"lib/current_word.rb\")\nif ENV['TM_SELECTED_TEXT'].nil? or ENV['TM_SELECTED_TEXT'].empty?\n\tword = Word.current_word('\\w\\.')\nelse\n\tword = ENV['TM_SELECTED_TEXT']\nend\nline, col = ENV['TM_CURRENT_LINE'], ENV['TM_LINE_INDEX'].to_i\nleft = line[0...(col - word.length)].to_s\nright = line[col..-1].to_s\nif ENV['TM_SELECTED_TEXT'].nil? or ENV['TM_SELECTED_TEXT'].empty?\n\tprint \"\#{e_sn(left)}${1:sum}(\#{e_sn(word)})\#{e_sn(right)}\"\nelse\n\tprint \"${1:\#{ENV['TM_R_WRAP_DEFAULT_FUNCTION']?ENV['TM_R_WRAP_DEFAULT_FUNCTION']:'sum'}}(\#{e_sn(word)})\"\nend",
70
+ fallbackInput: "line",
71
+ input: "selection",
72
+ keyEquivalent: "^W",
73
+ name: "Function Call",
74
+ output: "insertAsSnippet",
75
+ scope: "source.r, source.rd.console",
76
+ uuid: "769AC12C-9EDF-4089-8834-062A301907ED"},
77
+ {beforeRunningCommand: "nop",
78
+ command:
79
+ "#!/usr/bin/env ruby\n#require ENV['TM_SUPPORT_PATH'] +'/lib/escape.rb'\n#print \"${1:${2:x} <- }function(${3:var}) {\\n\#{if s = ENV['TM_SELECTED_TEXT'] then e_sn(s.chomp.gsub(/(\\A|\\n)/,\"\\\\1\\t\")) else \"\\t\\$4\" end}\\n}\"\n\nrequire ENV['TM_SUPPORT_PATH'] +'/lib/escape.rb'\nrequire File.join(ENV[\"TM_SUPPORT_PATH\"], \"lib/current_word.rb\")\nif ENV['TM_SELECTED_TEXT'].nil? or ENV['TM_SELECTED_TEXT'].empty?\n\tword = Word.current_word('\\w\\.')\nelse\n\tword = ENV['TM_SELECTED_TEXT']\nend\nline, col = ENV['TM_CURRENT_LINE'], ENV['TM_LINE_INDEX'].to_i\nleft = line[0...(col - word.length)].to_s\nright = line[col..-1].to_s\nif ENV['TM_SELECTED_TEXT'].nil? or ENV['TM_SELECTED_TEXT'].empty?\n\tprint \"\#{e_sn(left)}${1:${2:x} <- }function(${3:var}) {\\n\\t\#{e_sn(word)}\\$4\\n}\#{e_sn(right)}\"\nelse\n\tprint \"${1:${2:x} <- }function(${3:var}) {\\n\\t\#{e_sn(word)}\\$4\\n}\"\nend",
80
+ fallbackInput: "line",
81
+ input: "selection",
82
+ keyEquivalent: "^@W",
83
+ name: "Function Definition",
84
+ output: "insertAsSnippet",
85
+ scope: "source.r, source.rd.console",
86
+ uuid: "4C1A1536-31FF-4FF5-B0C5-CD47D21CFD52"},
87
+ {beforeRunningCommand: "nop",
88
+ command:
89
+ "\n# clean unused file\nrm -f \"$TM_BUNDLE_SUPPORT/help.index\"\nrm -f \"$TM_BUNDLE_SUPPORT/helpshort.index\"\nrm -f \"$TM_BUNDLE_SUPPORT/help.pkgs\"\nrm -f \"$TM_BUNDLE_SUPPORT/libpaths\"\nrm -f \"$TM_BUNDLE_SUPPORT/httpPort\"\nrm -f \"$TM_BUNDLE_SUPPORT/isHelpServer\"\nrm -f \"$TM_BUNDLE_SUPPORT/lib/data.html\"\nrm -f \"$TM_BUNDLE_SUPPORT/lib/head.html\"\nrm -f \"$TM_BUNDLE_SUPPORT/lib/search.html\"\n\n. \"$TM_SUPPORT_PATH/lib/webpreview.sh\"\nhtml_header \"R Bundle Help\" \"R\"\n\"$TM_SUPPORT_PATH/lib/markdown_to_help.rb\" \"$TM_BUNDLE_SUPPORT/lib/help.markdown\"\nhtml_footer\n",
90
+ input: "none",
91
+ name: "Help",
92
+ output: "showAsHTML",
93
+ scope: "source.r -source.rd.console -source.rapp-console",
94
+ uuid: "8A8B6803-AF20-47EC-9382-62E1EBA76B4A"},
95
+ {beforeRunningCommand: "nop",
96
+ command:
97
+ "if [ -z \"$TM_SELECTED_TEXT\" ]; then\n\techo\n\tcat | R --vanilla --slave --no-readline --encoding=UTF-8\nelse\n\tcat | R --vanilla --slave --no-readline --encoding=UTF-8\n\texit_replace_text\nfi",
98
+ input: "selection",
99
+ keyEquivalent: "^@r",
100
+ name: "Insert Result",
101
+ output: "afterSelectedText",
102
+ scope: "source.r",
103
+ uuid: "99E59A8E-A7DC-4CB0-AA51-6305921D3411"},
104
+ {beforeRunningCommand: "nop",
105
+ command:
106
+ "echo -en 'library(${1:\"${2:`\"$TM_BUNDLE_SUPPORT\"/bin/insert_package_name.sh`}\"})${0:}'",
107
+ input: "none",
108
+ name: "Load Library using “library”",
109
+ output: "insertAsSnippet",
110
+ scope: "source.r, source.rd.console",
111
+ tabTrigger: "lib",
112
+ uuid: "2EBC36A2-A927-4AEC-99A1-9F06C88B6844"},
113
+ {beforeRunningCommand: "nop",
114
+ command:
115
+ "echo -en 'require(${1:\"${2:`\"$TM_BUNDLE_SUPPORT\"/bin/insert_package_name.sh`}\"})${0:}'",
116
+ input: "none",
117
+ name: "Load Library using “require”",
118
+ output: "insertAsSnippet",
119
+ scope: "source.r, source.rd.console",
120
+ tabTrigger: "req",
121
+ uuid: "C2ADF348-D6FE-45B5-8BCC-A62B912A881B"},
122
+ {beforeRunningCommand: "nop",
123
+ command:
124
+ "LIST=$(cat)\n[[ -z \"$LIST\" ]] && exit_discard\necho -en \"$LIST\" | ruby -e '\n\trequire File.join(ENV[\"TM_SUPPORT_PATH\"], \"lib/ui.rb\")\n\trequire File.join(ENV[\"TM_SUPPORT_PATH\"], \"lib/exit_codes.rb\")\n\twords = STDIN.read().split(\"|\")\n\tif words.size == 1\n\t\tif words[0] == \"TRUE\" || words[0] == \"FALSE\" || words[0] == \"T\" || words[0] == \"F\"\n\t\t\tprint \"FALSE\" if words[0] == \"TRUE\"\n\t\t\tprint \"TRUE\" if words[0] == \"FALSE\"\n\t\t\tprint \"F\" if words[0] == \"T\"\n\t\t\tprint \"T\" if words[0] == \"F\"\n\t\telse\n\t\t\tTextMate.exit_discard()\n\t\tend\n\telse\n\t\tindex=TextMate::UI.menu(words)\n\t\tif index != nil\n\t\t\tif words[index].match(\"\\-\")\n\t\t\t\tprint words[index].gsub!(/\\-.*/,\"\")\n\t\t\telse\n\t\t\t\tprint words[index]\n\t\t\tend\n\t\telse\n\t\t\tTextMate.exit_discard()\n\t\tend\n\tend\n'\n\n",
125
+ fallbackInput: "word",
126
+ input: "selection",
127
+ keyEquivalent: "^",
128
+ name: "Option List as Pull Down… / BoolToggler",
129
+ output: "replaceSelectedText",
130
+ scope: "source.r, source.rd.console",
131
+ uuid: "B2612EB0-22A3-4D09-A851-721EA294DF13"},
132
+ {beforeRunningCommand: "nop",
133
+ command: "\"$TM_BUNDLE_SUPPORT\"/bin/insert_package_name.sh",
134
+ input: "none",
135
+ keyEquivalent: "~@L",
136
+ name: "Package Name…",
137
+ output: "discard",
138
+ scope: "source.r, source.rd.console",
139
+ uuid: "18B3BAF5-A2E0-43A6-9017-56E1D365A055"},
140
+ {beforeRunningCommand: "nop",
141
+ command:
142
+ "#!/usr/bin/env ruby\n# print \"Got:\" + STDIN.read\n\nrequire ENV['TM_SUPPORT_PATH'] +'/lib/ui.rb'\nrequire ENV['TM_SUPPORT_PATH'] +'/lib/exit_codes.rb'\nopts = { \"Formula\" => \"plot(${1:y~x}${2:, data=${3:frame})\",\n \"Bar Graph\" => \"barplot(${1:table(${2:x})})\",\n\t\t\"Pie Chart\" => \"pie(${1:x}${2:, col=c(${3:colors})})\",\n\t\t\"Histogram\" => \"hist(${1:x}${2:, breaks = ${3:8}})\",\n\t\t\"Box Plot\" => \"boxplot(${1:x}${2:, horizontal = TRUE})\",\n\t\t\"Scatterplot\" => \"plot(${1:x})\"}\nkeys = opts.keys.sort\nans = TextMate::UI.menu(keys)\nTextMate.exit_discard unless ans\nprint opts[keys[ans]]",
143
+ fallbackInput: "word",
144
+ input: "none",
145
+ keyEquivalent: "~@P",
146
+ name: "Plots…",
147
+ output: "insertAsSnippet",
148
+ scope: "source.r, source.rd.console",
149
+ uuid: "90EA3ACF-121E-4BBA-B1EB-3F461BCBDC8D"},
150
+ {beforeRunningCommand: "nop",
151
+ command: "\"$TM_BUNDLE_SUPPORT\"/bin/prefix_package_name.sh",
152
+ fallbackInput: "line",
153
+ input: "selection",
154
+ keyEquivalent: "^~L",
155
+ name: "Prefix Package Name to current Function",
156
+ output: "insertAsSnippet",
157
+ scope: "source.r, source.rd.console",
158
+ uuid: "7657BD74-1736-49B9-9AB1-4A10E256D484"},
159
+ {beforeRunningCommand: "nop",
160
+ command:
161
+ "# input is selection or document\nrawText=\"`cat`\"\n\ncurDir=''\nif [[ ${#TM_DIRECTORY} -gt 0 ]]; then\n\tcurDir=\"$TM_DIRECTORY\"\nfi\n\nosascript -e 'on run(theCode)' \\\n\t\t -e 'tell application \"R\" to activate' \\\n\t\t -e 'if (item 2 of theCode) is not \"\" then tell application \"R\" to cmd \"setwd('\\''\" & (item 2 of theCode) & \"'\\'')\"' \\\n\t\t -e 'tell application \"R\" to cmd (item 1 of theCode)' \\\n\t\t -e 'end run' -- \"$rawText\" \"$curDir\"\n",
162
+ input: "selection",
163
+ keyEquivalent: "~@R",
164
+ name: "R.app",
165
+ output: "showAsTooltip",
166
+ scope: "source.r",
167
+ uuid: "15FF2003-99F5-464C-A0C2-BAFED7AD73EB"},
168
+ {beforeRunningCommand: "nop",
169
+ command:
170
+ "# input is selection or document\nrawText=\"`cat`\"\n\ncurDir=''\nif [[ ${#TM_DIRECTORY} -gt 0 ]]; then\n\tcurDir=\"$TM_DIRECTORY\"\nfi\n\nosascript -e 'on run(theCode)' \\\n\t\t -e 'tell application \"R\" to activate' \\\n\t\t -e 'if (item 2 of theCode) is not \"\" then tell application \"R\" to cmd \"setwd('\\''\" & (item 2 of theCode) & \"'\\'')\"' \\\n\t\t -e 'tell application \"R\" to cmd (item 1 of theCode)' \\\n\t\t -e 'end run' -- \"$rawText\" \"$curDir\"\n\nopen \"txmt://open?line=$(($TM_LINE_NUMBER+1))&column=1000000\" &",
171
+ fallbackInput: "line",
172
+ input: "selection",
173
+ keyEquivalent: "~$\n",
174
+ name: "R.app & Step",
175
+ output: "discard",
176
+ scope: "source.r",
177
+ uuid: "ED52D514-DDB8-4D8C-BE0C-F791C70F530A"},
178
+ {beforeRunningCommand: "nop",
179
+ command:
180
+ "\nif [ -z \"$TM_SELECTED_TEXT\" ]; then\n\tWORD=$(ruby -- <<-SCR1 \n\t\trequire File.join(ENV[\"TM_SUPPORT_PATH\"], \"lib/current_word.rb\")\n\t\tword = Word.current_word('\\w\\.')\n\t\tword.gsub!(/^[\\d\\.\\-]+$/,\"\")\n\t\tprint word\n\tSCR1\n\t)\nelse\n\tWORD=$TM_SELECTED_TEXT\nfi\n\nif [ -z \"$WORD\" ]; then\n\topen \"http://www.rseek.org\"\nelse\n\topen \"http://www.rseek.org/?cx=010923144343702598753%3Aboaz1reyxd4&q=$WORD&sa=Search+functions%2C+lists%2C+and+more&cof=FORID%3A11\"\nfi\n",
181
+ fallbackInput: "word",
182
+ input: "selection",
183
+ keyEquivalent: "^~@h",
184
+ name: "RSeek Search for Word / Selection",
185
+ output: "showAsTooltip",
186
+ scope: "source.r, source.rd.console",
187
+ uuid: "4DCF1FF7-D104-43C3-B0E3-8333A50CA5AA"},
188
+ {beforeRunningCommand: "nop",
189
+ command:
190
+ "\nif [ -z \"$TM_SELECTED_TEXT\" ]; then\n\tWORD=$(ruby -- <<-SCR1 \n\t\trequire File.join(ENV[\"TM_SUPPORT_PATH\"], \"lib/current_word.rb\")\n\t\tword = Word.current_word('\\w\\.')\n\t\tword.gsub!(/^[\\d\\.\\-]+$/,\"\")\n\t\tprint word\n\tSCR1\n\t)\nelse\n\tWORD=$TM_SELECTED_TEXT\nfi\n\nif [ -z \"$WORD\" ]; then\n\topen \"http://search.r-project.org/\"\nelse\n\tW=`echo -en \"$WORD\" | sed 's/ {1,}/+/g'`\n\topen \"http://search.r-project.org/cgi-bin/namazu.cgi?query=$W&max=20&result=normal&sort=score&idxname=Rhelp02a&idxname=functions&idxname=docs\"\nfi\n",
191
+ fallbackInput: "word",
192
+ input: "selection",
193
+ keyEquivalent: "^~@h",
194
+ name: "RSite Search for Word / Selection",
195
+ output: "showAsTooltip",
196
+ scope: "source.r, source.rd.console",
197
+ uuid: "B26AF49E-C737-41D4-990F-5BBB138B3FCD"},
198
+ {beforeRunningCommand: "nop",
199
+ command:
200
+ "#!/usr/bin/env ruby -wKU\n\nrd=STDIN.read()\nif rd =~ /(?m).*?\\\\usage\\{.*?\\((.*?)\\).*/m\n\trd.gsub!(/(?m).*?\\\\usage\\{.*?\\((.*?)\\).*/m, '\\1')\n\tputs \"\\\\arguments{\"\n\tcounter=1\n\trd.scan(/([\\w\\._]+)\\s*=/) do |arg|\n\t\tputs \"\\t\\\\item{\#{arg}}{${\#{counter}:}}\"\n\t\tcounter = counter+1\n\tend\n\tputs \"}\"\nelse\n\tputs \"\\\\arguments{\"\n\t\tputs \"\\t\\\\item{${1:}}{${2:}}${0:}\"\n\tputs \"}\"\nend\n",
201
+ input: "document",
202
+ name: "Rd Insert arguments tag",
203
+ output: "insertAsSnippet",
204
+ scope: "text.tex.latex.rd",
205
+ tabTrigger: "arg",
206
+ uuid: "EB595EE3-9439-4AC6-8352-1EC7CAC9B05E"},
207
+ {beforeRunningCommand: "saveActiveFile",
208
+ command: "R CMD Rdconv -t html \"$TM_FILEPATH\"",
209
+ input: "none",
210
+ keyEquivalent: "^~@p",
211
+ name: "Rd Preview as HTML",
212
+ output: "showAsHTML",
213
+ scope: "text.tex.latex.rd",
214
+ uuid: "AE350C40-DA76-4BDD-AAD0-27F7247511EB"},
215
+ {beforeRunningCommand: "nop",
216
+ bundleUUID: "B5A22967-2E6A-4B66-9C71-DA8762C01E27",
217
+ command:
218
+ "######### global variables #########\n\nRDHOME=\"$HOME/Library/Application Support/Rdaemon\"\nif [ \"$TM_RdaemonRAMDRIVE\" == \"1\" ]; then\n\tRDRAMDISK=\"/tmp/TMRramdisk1\"\nelse\n\tRDRAMDISK=\"$RDHOME\"\nfi\n\n[[ ! -d \"$RDHOME\" ]] && echo \"Please install Rdaemon first.\" && exit 206\n\n######### begin script #########\n\n#get R's PID\nRPID=$(ps aw | grep '[0-9] /.*TMRdaemon' | awk '{print $1;}' )\nRdaemonWASrunning=1\n#check whether Rdaemon runs - if not start it\nif [ -z $RPID ]; then\n\t[[ -e \"$RDHOME\"/daemon/x11runs ]] && rm \"$RDHOME\"/daemon/x11runs\n\tX=$(ps -ax | grep X11 | wc -l)\n\tif [ \"$X\" -gt \"1\" ]; then\n\t\ttouch \"$RDHOME\"/daemon/x11runs\n\tfi\n\tif [ -f \"$RDHOME\"/daemon/startScript.sh ]; then\n\t\t\"$RDHOME\"/daemon/startScript.sh\n\telse\n\t\techo \"You have to install Rdaemon first!\"\n\t\texit_show_tool_tip\n\tfi\n\tRdaemonWASrunning=0\nfi\n\n#check free space on ram drive\nif [ \"$TM_RdaemonRAMDRIVE\" == \"1\" ]; then\nRES=$(df -H | grep TMRramdisk1 | awk '{ print $5 }' | perl -e 'print <>+0;')\nif [ $RES -gt 96 ]; then\n\t\"$DIALOG\" -e -p '{messageTitle=\"Rdaemon – RAM drive – Security Alert\"; alertStyle=\"critical\"; informativeText=\"Free disk space is less than 3%!\\nFor safety reasons save your data image and restart the Rdaemon!\";}' >/dev/null\n\techo \"RAM drive on '/tmp/TMRramdrive1':\"\n\tRES=$(df -H | grep TMRramdisk1 | awk '{ print $5 }')\n\techo -n \" $RES are used of\"\n\tRES=$(df -H | grep TMRramdisk1 | awk '{ print $2 }')\n\techo -n \" $RES.\"\n\texit_show_tool_tip\nfi\nfi\n\n#get the task from TM and delete beginning >+: SPACE TAB\nTASK=$(cat | sed -e 's/Browse\\[.*\\]//;s/^[>+:]//;s/^[ \t]*//;s/\\\\/\\\\\\\\/g;/^#/d')\n\n#check named input pipe for safety reasons\nif [ ! -p \"$RDHOME\"/r_in ]; then\n\techo -en \"Rdaemon Error:\\nThe pipe /tmp/r_in is not found!\\n\\nYou have to kill Rdaemon manually!\"\n\texit 206\nfi\n\n#set history counter to 0\necho -n 0 > \"$RDHOME/history\"/Rhistcounter.txt\n\n#get current position of r_out\nPOS=$(stat \"$RDRAMDISK\"/r_out | awk '{ print $8 }')\nPROMPT=$(tail -n 1 \"$RDRAMDISK\"/r_out | sed 's/> $//')\n\n#if [ ! -z \"$TM_DIRECTORY\" ]; then\n#\techo -e \"@|setwd('$TM_DIRECTORY')\" > \"$RDHOME\"/r_in\n#fi\n\n#send task to Rdaemon and give Rdaemon the chance to read from the pipe\nexport token=$(\"$DIALOG\" -a ProgressDialog -p \"{title=Rdaemon;isIndeterminate=1;summary='Sending task to Rdaemon…';}\")\necho \"$TASK\" | sed 's/\\\\/\\\\\\\\/g' | while read LINE\ndo\n\techo -e \"@|$LINE\" > \"$RDHOME\"/r_in\n\tsleep 0.002\n\t\"$DIALOG\" -t $token -p \"{details='$LINE';}\" 2&>/dev/null\ndone\n\"$DIALOG\" -x $token 2&>/dev/null\n\n#wait for R's response by expecting >, +, or : plus SPACE!\nPOSNEW=$(stat \"$RDRAMDISK\"/r_out | awk '{ print $8 }')\nOFF=$(($POSNEW - $POS + 2))\n\nPROGRESS_INIT=0 # to start the progress dialog after 100ms only\nwhile [ 1 ]\ndo\n\tRES=$(tail -c 2 \"$RDRAMDISK\"/r_out)\n\t#expect these things from R\n\t[[ \"$RES\" == \"> \" ]] && break\n\t[[ \"$RES\" == \"+ \" ]] && break\n\t[[ \"$RES\" == \": \" ]] && break\n\t#monitoring of the CPU coverage as progress bar\n\tcpu=$(ps o pcpu -p \"$RPID\" | tail -n 1)\n\t[[ \"${cpu:0:1}\" == \"%\" ]] && break\n\tCP=$(echo -n \"$cpu\" | perl -e 'print 100-<>')\n\tsleep 0.1\n\tif [ $PROGRESS_INIT -eq 0 ]; then\n\t\texport token=$(\"$DIALOG\" -a ProgressDialog -p \"{title=Rdaemon;progressValue=50;summary='Rdaemon is busy…';}\")\n\t\tPROGRESS_INIT=1\n\tfi\n\t\"$DIALOG\" -t $token -p \"{details='`tail -n 1 \"$RDRAMDISK\"/r_out`';progressValue=$CP;}\" 2&>/dev/null\ndone\n\"$DIALOG\" -x $token 2&>/dev/null\n\n#read only the current response from Rdaemon\nPOSNEW=$(stat \"$RDRAMDISK\"/r_out | awk '{ print $8 }')\nOFF=$(($POSNEW - $POS + 2))\n#clean/escape the response\necho -en \"$PROMPT\"\nRES=$(tail -c $OFF \"$RDRAMDISK\"/r_out | perl -e '\n\tundef($/); $a=<>;\n\t$a=~s/\\x0D{1,}/\\x0D/sg;\n\twhile($a=~m/(.*?)\\x0D<.{50}(.) +\\x08+(.*)/) { $a=~s/(.*?)\\x0D<.{50}(.) +\\x08+(.*)/$1$2$3/sg; }\n\t$a=~s/\\\\/\\\\\\\\/g;$a=~s/\\`/\\\\\\`/sg;$a=~s/\\$/\\\\\\$/sg;$a=~s/_\\x08//sg;\n\t$a=~s/\\x07//sg;\n\t$a .= \"\\n> \" if ($a!~/> $/ && $a!~/\\+ $/);\n\tprint \"$a\";\n')\nERR=$(echo -en \"$RES\" | egrep -i '^\\s*err' | wc -l)\nif [ $ERR -gt 0 ]; then\n\techo -en \"$RES\" > /tmp/TMRdaemon_error.rCon\n\tmate /tmp/TMRdaemon_error.Rcon\n\texit\n# else\n # echo -en \"$RES\" >> \"$RDHOME\"/console.Rcon\nfi\n\n\nif [ \"$RdaemonWASrunning\" == \"0\" ]; then\n#read only the current response from Rdaemon\nPOSNEW=$(stat \"$RDRAMDISK\"/r_out | awk '{ print $8 }')\nOFF=$(($POSNEW - $POS + 2))\n#clean/escape the response\n#echo -en \"$PROMPT\"\n# tail -c $OFF \"$RDRAMDISK\"/r_out | perl -e '\n# undef($/); $a=<>;\n# $a=~s/\\x0D{1,}/\\x0D/sg;\n# while($a=~m/(.*?)\\x0D<.{50}(.) +\\x08+(.*)/) { $a=~s/(.*?)\\x0D<.{50}(.) +\\x08+(.*)/$1$2$3/sg; }\n# $a=~s/_\\x08//sg;\n# $a=~s/_\\x07//sg;\n# \#$a=~s/\\`/\\\\\\`/sg;$a=~s/\\$/\\\\\\$/sg;\n# $a .= \"\\n> \" if ($a!~/> $/ && $a!~/\\+ $/);\n# print \"$a\";\n# ' >> \"$RDHOME\"/console.Rcon\n\nosascript &>/dev/null \\\n\t -e 'tell app \"SystemUIServer\" to activate' \\\n\t -e 'tell app \"TextMate\" to activate' &\n\nopen \"$RDHOME/Rsession.tmproj\"\nmate \"$RDHOME\"/console.Rcon\nsleep 0.3\nopen \"txmt://open?line=1000000&column=10000000\"\nfi\n\n",
219
+ fallbackInput: "document",
220
+ input: "selection",
221
+ keyEquivalent: "@R",
222
+ name: "Rdaemon",
223
+ output: "showAsTooltip",
224
+ scope: "source.r",
225
+ uuid: "DC1EC8A4-BC20-4D1C-91B6-328CEC2CA228"},
226
+ {autoScrollOutput: true,
227
+ beforeRunningCommand: "nop",
228
+ command:
229
+ "\n#only for Mac OSX 10.4 X11\nOS=$(uname -r | perl -pe 's/(\\d+)\\..*/$1/')\n[[ $OS -eq 8 ]] && export DISPLAY=:0.0\n\nCRAN=\"http://cran.cnr.berkeley.edu\"\nSOFILE=\"$HOME/Library/Application Support/Rdaemon/startOptions.R\"\nif [ -f \"$SOFILE\" ]; then\n\tRES=$(cat \"$SOFILE\" | egrep 'options.*?repos.*?list' | perl -pe 's/^\\s*options\\s*.*?repos\\s*=\\s*.*?[\\x{27}\"](.*?)[\\x{27}\"].*/$1/g' | tail -n 1)\n\t[[ ! -z \"$RES\" ]] && [[ \"${RES:0:4}\" == \"http\" ]] && CRAN=\"$RES\"\nfi\n\nif [ ! -z \"$TM_INPUT_START_LINE\" ]; then\n\tif [ `echo -en \"$TM_SELECTED_TEXT\" | egrep -cv '^[\t ]*#'` -gt 0 ]; then\n\t\techo -en \"$TM_SELECTED_TEXT\" | \"$TM_BUNDLE_SUPPORT/tmR.rb\" \"$CRAN\" 1\n\telse\n\t\tcat | \"$TM_BUNDLE_SUPPORT/tmR.rb\" \"$CRAN\" 0\n\tfi\nelse\n\tcat | \"$TM_BUNDLE_SUPPORT/tmR.rb\" \"$CRAN\" 0\nfi\n",
230
+ fallbackInput: "document",
231
+ input: "document",
232
+ keyEquivalent: "@r",
233
+ name: "Run Document / Selection in R",
234
+ output: "showAsHTML",
235
+ scope: "source.r",
236
+ uuid: "F5D7F00C-6DEE-469E-AFEE-6E4B7CDD4148"},
237
+ {beforeRunningCommand: "nop",
238
+ command: "head -n 3 \"$TM_SELECTED_TEXT\"",
239
+ fallbackInput: "none",
240
+ input: "selection",
241
+ name: "Show File Header",
242
+ output: "showAsTooltip",
243
+ scope: "source.r, source.rd.console",
244
+ uuid: "381D1464-6F33-41E3-A938-C10FAB619C24"},
245
+ {beforeRunningCommand: "nop",
246
+ command:
247
+ "\nexport WORD=$(ruby -- <<-SCR1\nprint ENV['TM_CURRENT_LINE'][0...ENV['TM_LINE_INDEX'].to_i].gsub!(/ *$/, \"\").match(/[\\w.:]*$/).to_s\nSCR1\n)\n\nif [ -z \"$TM_SELECTED_TEXT\" ]; then\n\texport WORD=$(ruby -- <<-SCR1 \n\t\trequire File.join(ENV[\"TM_SUPPORT_PATH\"], \"lib/current_word.rb\")\n\t\tword = Word.current_word('\\w\\.:')\n\t\tword.gsub!(/^[\\d\\.\\-]+$/,\"\")\n\t\tprint word\n\tSCR1\n\t) \n\tif [ -z \"$WORD\" ]; then\n\t\t#look for nested commands\n\t\texport WORD=$(perl -e '\n\t\t$line=$ENV{\"TM_CURRENT_LINE\"};$col=$ENV{\"TM_LINE_INDEX\"};\n\t\t$line=substr($line,0,$col);\n\t\t\#$line=~s/ //g;\n\t\t@arr=split(//,$line);$c=0;\n\t\tfor($i=$#arr;$i>-1;$i--){$c-- if($arr[$i] eq \")\");$c++ if($arr[$i] eq \"(\");last if $c>0;}\n\t\tif($i==-1) {\n\t\t\tprint \"\";\n\t\t} else {\n\t\t\tsubstr($line,0,$i)=~m/([\\w\\.:]+)$/;\n\t\t\tprint $1 if defined($1);\n\t\t}\n\t\t')\n\tfi\nelse\n\t#take the selected text\n\texport WORD=$(echo -en \"$TM_SELECTED_TEXT\" | perl -e '$_=<>;chomp;s/^[\\t ]*//;s/([\\w\\.]+)[ \\(\\{].*/$1/g;print')\nfi\n\nWORDORG=\"$WORD\"\nPKG=\"\"\nif [ `echo \"$WORD\" | grep -Fc ':'` -gt 0 ]; then\n\tPKG=\",package='${WORD%%:*}'\"\nfi\nWORD=\"${WORD##*:}\"\n\n#check whether WORD is defined otherwise quit\n[[ -z \"$WORD\" ]] && exit 200\n\nTEXT=$(cat)\n\nRhelperAnswer=\"/tmp/textmate_Rhelper_out\"\n\n# Rdaemon\nRPID=$(ps aw | grep '[0-9] /.*TMRdaemon' | awk '{print $1;}' )\nRD=$(echo -n \"$TM_SCOPE\" | grep -c -F 'source.rd.console')\nif [ ! -z \"$RPID\" -a \"$RD\" -gt 0 ]; then\n\tRDHOME=\"$HOME/Library/Application Support/Rdaemon\"\n\tif [ \"$TM_RdaemonRAMDRIVE\" == \"1\" ]; then\n\t\tRDRAMDISK=\"/tmp/TMRramdisk1\"\n\telse\n\t\tRDRAMDISK=\"$RDHOME\"\n\tfi\n\t[[ -e \"$RDRAMDISK\"/r_tmp ]] && rm \"$RDRAMDISK\"/r_tmp\n\n\t# execute \"args()\" in Rdaemon\n\tTASK=\"@|sink('$RDRAMDISK/r_tmp');args($WORDORG)\"\n\techo \"$TASK\" > \"$RDHOME\"/r_in\n\techo \"@|sink(file=NULL)\" > \"$RDHOME\"/r_in\n\twhile [ 1 ]\n\tdo\n\t\tRES=$(tail -c 2 \"$RDRAMDISK\"/r_out)\n\t\t[[ \"$RES\" == \"> \" ]] && break\n\t\t[[ \"$RES\" == \": \" ]] && break\n\t\t[[ \"$RES\" == \"+ \" ]] && break\n\t\tsleep 0.03\n\tdone\n\tsleep 0.001\n\tRES=$(cat \"$RDRAMDISK\"/r_tmp | sed 's/NULL$//;')\n\t[[ \"$RES\" == \"NULL\" ]] && RES=\"\"\n\t# \"args()\" did find something\n\tif [ ! -z \"$RES\" ]; then\n\t\tOUT=$(echo -en \"$WORD${RES:9}\" | perl -e 'undef($/);$a=<>;$a=~s/\"\\t\"/\"\\\\t\"/sg;$a=~s/\"\\n\"/\"\\\\n\"/sg;print $a')\n\t\trm -f \"$RDRAMDISK\"/r_tmp\n\t\tTASK=\"@|sink('$RDRAMDISK/r_tmp');cat(gsub('.*?/library/(.*?)/.*','\\\\\\\\1',as.vector(help('$WORD',try.all.packages=F)),perl=T),sep='\\n')\"\n\t\techo \"$TASK\" > \"$RDHOME\"/r_in\n\t\tTASK=\"@|sink(file=NULL)\"\n\t\techo \"$TASK\" > \"$RDHOME\"/r_in\n\t\twhile [ 1 ]\n\t\tdo\n\t\t\tRES=$(tail -c 2 \"$RDRAMDISK\"/r_out)\n\t\t\t[[ \"$RES\" == \"> \" ]] && break\n\t\t\t[[ \"$RES\" == \": \" ]] && break\n\t\t\t[[ \"$RES\" == \"+ \" ]] && break\n\t\t\tsleep 0.03\n\t\tdone\n\t\tsleep 0.001\n\t\tLIB=$(cat \"$RDRAMDISK\"/r_tmp)\n\t\tif [ -z \"$LIB\" ]; then\n\t\t\techo -n \"$OUT\"\n\t\t\techo -en \"\\n• local\"\n\t\t\texit 206\n\t\tfi\n\t\tCNT=$(echo \"$LIB\" | wc -l)\n\t\tif [ $CNT -eq 1 ]; then\n\t\t\techo -n \"$OUT\"\n\t\t\techo -en \"\\n•• library: $LIB\"\n\t\t\texit 206\n\t\tfi\n\t# \"args()\" didn't find anything ergo library isn't yet loaded\n\telse\n\t\t\"$TM_BUNDLE_SUPPORT\"/bin/askRhelperDaemon.sh \"@getHelpURL('$WORD'$PKG)\"\n\t\tFILE=$(cat \"$RhelperAnswer\")\n\t\tif [ ! -z \"$FILE\" -a \"$FILE\" != \"NA\" ]; then\n\t\t\texec<\"$RhelperAnswer\"\n\t\t\twhile read i\n\t\t\tdo\n\t\t\tif [ \"${i:0:1}\" = \"/\" ]; then\n\t\t\t\tRES=$(cat \"$i\")\n\t\t\telse\n\t\t\t\tRES=$(curl -gsS \"$i\")\n\t\t\tfi\n\t\t\techo -n \"$RES\" | \"$TM_BUNDLE_SUPPORT/bin/parseHTMLForUsage.sh\" \"$WORD\" 0\n\t\t\tLIB=$(echo \"$i\" | perl -pe 's!.*?/library/(.*?)/.*!$1!')\n\t\t\tTASK=\"@|sink('$RDRAMDISK/r_tmp')\"\n\t\t\techo \"$TASK\" > \"$RDHOME\"/r_in\n\t\t\tTASK=\"@|cat(sum((.packages()) %in% \\\"$LIB\\\"),sep='')\"\n\t\t\techo \"$TASK\" > \"$RDHOME\"/r_in\n\t\t\tTASK=\"@|sink(file=NULL)\"\n\t\t\techo \"$TASK\" > \"$RDHOME\"/r_in\n\t\t\twhile [ 1 ]\n\t\t\tdo\n\t\t\t\tRES=$(tail -c 2 \"$RDRAMDISK\"/r_out)\n\t\t\t\t[[ \"$RES\" == \"> \" ]] && break\n\t\t\t\t[[ \"$RES\" == \": \" ]] && break\n\t\t\t\t[[ \"$RES\" == \"+ \" ]] && break\n\t\t\t\tsleep 0.02\n\t\t\tdone\n\t\t\tsleep 0.001\n\t\t\tRES=$(cat \"$RDRAMDISK\"/r_tmp)\n\t\t\tif [ ! -z \"$RES\" -a \"$RES\" == \"1\" ]; then\n\t\t\t\techo -en \"\\n•• library: $LIB\"\n\t\t\telse\n\t\t\t\techo -en \"\\n• library “${LIB}” not loaded [press CTRL+SHIFT+L]\"\n\t\t\tfi\n\t\t\techo\n\t\t\tdone\n\t\t\texit 206\n\t\telse\n\t\t\texit 200\n\t\tfi\n\tfi\nfi\n\n# R script\n\"$TM_BUNDLE_SUPPORT\"/bin/askRhelperDaemon.sh \"@getHelpURL('$WORD'$PKG)\"\nFILE=$(cat \"$RhelperAnswer\")\nif [ ! -z \"$FILE\" -a \"$FILE\" != \"NA\" ]; then\n\texec<\"$RhelperAnswer\"\n\twhile read i\n\tdo\n\t\tif [ \"${i:0:1}\" = \"/\" ]; then\n\t\t\tRES=$(cat \"$i\")\n\t\telse\n\t\t\tRES=$(curl -gsS \"$i\")\n\t\tfi\n\t\t# \"$TM_BUNDLE_SUPPORT\"/bin/askRhelperDaemon.sh \"@getPackageFor('$WORD')\"\n\t\t# LIB=$(cat \"$RhelperAnswer\")\n\t\tLIB=$(echo \"$i\" | perl -pe 's!.*?/library/(.*?)/.*!$1!')\n\t\tRES=$(echo -en \"$RES\" | \"$TM_BUNDLE_SUPPORT/bin/parseHTMLForUsage.sh\" \"$WORD\" 0)\n\t\tif [ ! -z \"$RES\" -a \"${RES:0:1}\" == \"${WORD:0:1}\" ]; then\n\t\t\techo -n \"$RES\"\n\t\t\techo -en \"\\n•• library: $LIB\\n\"\n\t\tfi\n\tdone\n\texit 206\nelse\n\t[[ `echo -n \"$TM_SCOPE\" | grep -c -F 'text.tex.latex.rdaemon'` -gt 0 ]] && exit 200\n\t# Parse R script for functions\n\tOUT=$(echo -en \"$TEXT\" | \"$TM_BUNDLE_SUPPORT/bin/parseDocForFunctions.sh\" \"$WORD\")\n\t[[ -z \"$OUT\" ]] && exit 200\n\techo -n \"$WORD$OUT\n• local\"\n\texit 206\nfi\n",
248
+ fallbackInput: "none",
249
+ input: "document",
250
+ keyEquivalent: "~H",
251
+ name: "Show Function Usage",
252
+ output: "showAsTooltip",
253
+ scope: "source.r, source.rd.console",
254
+ uuid: "797A6B84-49BB-4BBD-8F51-9A225433CA9C"},
255
+ {beforeRunningCommand: "nop",
256
+ command:
257
+ "\n\n\"$TM_BUNDLE_SUPPORT\"/bin/askRhelperDaemon.sh \"@getHttpPort()\"\nsleep 0.05\nPORT=$(cat /tmp/textmate_Rhelper_out)\n\n\nif [ $PORT -gt 0 ]; then\n\techo \"<base href='http://127.0.0.1:$PORT/doc/html/index.html'>\"\n\tcurl -sS \"http://127.0.0.1:$PORT/doc/html/index.html\"\n\nelse\n\tRHOME=${R_HOME:=/Library/Frameworks/R.framework/Versions/Current/Resources}\n\techo \"<base href='tm-file://${RHOME// /%20}/doc/html/index.html'>\"\n\tcat \"${RHOME// /%20}\"/doc/html/index.html\n\nfi",
258
+ input: "none",
259
+ name: "Show R Documentation",
260
+ output: "showAsHTML",
261
+ scope: "source.r",
262
+ uuid: "F6F4215A-5543-42B3-8EBD-C8C7C9F190C9"},
263
+ {beforeRunningCommand: "nop",
264
+ command:
265
+ "#dispose all frozen ProgressDialogs\n{\nwhile [ 1 ]\ndo\n\tres=$(\"$DIALOG\" -x `\"$DIALOG\" -l 2>/dev/null| grep Rdaemon | cut -d \" \" -f 1` 2>/dev/null)\n\t[[ ${#res} -eq 0 ]] && break\ndone\n} &\n\nRhelperAnswer=\"/tmp/textmate_Rhelper_out\"\n\nif [ -z \"$TM_SELECTED_TEXT\" ]; then\n\tWORD=$(ruby -- <<-SCR1 \n\t\trequire File.join(ENV[\"TM_SUPPORT_PATH\"], \"lib/current_word.rb\")\n\t\tword = Word.current_word('\\w\\.:')\n\t\tword.gsub!(/^[\\d\\.\\-]+$/,\"\")\n\t\tprint word\n\tSCR1\n\t)\n\n\tif [ -z \"$WORD\" ]; then\n\t\t#look for nested commands\n\t\tWORD=$(perl -e '\n\t\t$line=$ENV{\"TM_CURRENT_LINE\"};$col=$ENV{\"TM_LINE_INDEX\"};\n\t\t$line=substr($line,0,$col);\n\t\t\#$line=~s/ //g;\n\t\t@arr=split(//,$line);$c=0;\n\t\tfor($i=$#arr;$i>-1;$i--){$c-- if($arr[$i] eq \")\");$c++ if($arr[$i] eq \"(\");last if $c>0;}\n\t\tif($i==-1) {\n\t\t\tprint \"\";\n\t\t} else {\n\t\t\tsubstr($line,0,$i)=~m/([\\w\\.:]+)$/;\n\t\t\tprint $1 if defined($1);\n\t\t}\n\t\t')\n\tfi\nelse\n\t#take the selected text\n\tWORD=$(echo -en \"$TM_SELECTED_TEXT\" | perl -e '$_=<>;chomp;s/^[\\t ]*//;s/([\\w\\.:]+)[ \\(\\{].*/$1/g;print')\nfi\n\nif [ -z \"$WORD\" ]; then\n\tWORD=$(\"$DIALOG\" -m -p 'prompt=\"Search for:\";title=\"Look up in R Documentation\";' RequestString | perl -e 'undef($/);$a=<>;$a=~s/\\n|\\t//mg;$a=~m/.*?<key>returnArgument<\\/key><string>(.*?)<\\/string>.*/; print $1 if (length($1))')\n\t[[ -z \"$WORD\" ]] && exit_discard\nfi\n\n\n# LIB=\nif [ ! -z \"${WORD//:/}\" ]; then\n\tif [ `echo \"$WORD\" | grep -Fc ':'` -gt 0 ]; then\n\t\tLIB=\",package='${WORD%%:*}'\"\n\tfi\n\tWORD=\"${WORD##*:}\"\nfi\n\n#check whether WORD is defined otherwise quit\n[[ -z \"$WORD\" ]] && echo \"No keyword found.\" && exit_show_tool_tip\n\n# Check if it is a Rdaemon doc\nRD=$(echo -n \"$TM_SCOPE\" | grep -c -F 'source.rd.console')\nif [ $RD -gt 0 -a \"$TM_R_SHOW_ALWAYS_HELPSEARCH\" != \"1\" ]; then\n\t#get R's PID\n\tRPID=$(ps aw | grep '[0-9] /.*TMRdaemon' | awk '{print $1;}' )\n\t#check whether Rdaemon runs\n\tif [ ! -z $RPID ]; then\n\t\tRDHOME=\"$HOME/Library/Application Support/Rdaemon\"\n\t\tif [ \"$TM_RdaemonRAMDRIVE\" == \"1\" ]; then\n\t\t\tRDRAMDISK=\"/tmp/TMRramdisk1\"\n\t\telse\n\t\t\tRDRAMDISK=\"$RDHOME\"\n\t\tfi\n\t\t[[ -e \"$RDRAMDISK\"/r_tmp ]] && rm \"$RDRAMDISK\"/r_tmp\n\t\tTASK=\"@|sink('$RDRAMDISK/r_tmp')\"\n\t\techo \"$TASK\" > \"$RDHOME\"/r_in\n\t\techo \"@|if(getRversion()>='2.10.0'){cat(gsub('.*/library/(.*?)/.*?/(.*?)(\\\\\\\\.html|$)',paste('http://127.0.0.1:',ifelse(tools:::httpdPort<1,tools::startDynamicHelp(T),tools:::httpdPort),'/library/\\\\\\\\1/html/\\\\\\\\2.html',sep=''),as.vector(help('$WORD'$LIB)),perl=T),sep='\\n')}else{cat(gsub('(.*?)/library/(.*?)/.*?/(.*?)(\\\\\\\\.html|$)','\\\\\\\\1/library/\\\\\\\\2/html/\\\\\\\\3.html',as.vector(help('$WORD'$LIB)),perl=T),sep='\\n')}\" > \"$RDHOME\"/r_in\n\t\tsleep 0.001\n\t\twhile [ 1 ]\n\t\tdo\n\t\t\tRES=$(tail -c 2 \"$RDRAMDISK\"/r_out)\n\t\t\t[[ \"$RES\" == \"> \" ]] && break\n\t\t\t[[ \"$RES\" == \": \" ]] && break\n\t\t\t[[ \"$RES\" == \"+ \" ]] && break\n\t\t\tsleep 0.005\n\t\tdone\n\t\tsleep 0.001\n\t\tFILE=$(cat \"$RDRAMDISK\"/r_tmp)\n\t\tTASK=\"@|sink(NULL)\"\n\t\techo \"$TASK\" > \"$RDHOME\"/r_in\n\t\tsleep 0.001\n\t\tif [ ! -z \"$FILE\" -a \"$FILE\" != \"NA\" ]; then\n\t\t\tif [ \"${FILE:0:1}\" = \"/\" ]; then\n\t\t\t\techo -en \"<meta http-equiv='REFRESH' content='0;url=tm-file://$FILE'></head>\"\n\t\t\telse\n\t\t\t\techo -en \"<meta http-equiv='REFRESH' content='0;url=$FILE'></head>\"\n\t\t\tfi\n\t\t\texit_show_html\n\t\tfi\n\tfi\nfi\n\nFILE=\"\"\nCNT=0\nif [ \"$TM_R_SHOW_ALWAYS_HELPSEARCH\" != \"1\" ]; then\n\t\"$TM_BUNDLE_SUPPORT\"/bin/askRhelperDaemon.sh \"@getHelpURL('$WORD'$LIB)\"\n\tFILE=$(cat \"$RhelperAnswer\")\n\tCNT=`echo -e \"$FILE\" | wc -l`\n\tif [ ! -z \"$FILE\" -a \"$FILE\" != \"NA\" -a $CNT -eq 1 ]; then\n\t\tif [ \"${FILE:0:1}\" = \"/\" ]; then\n\t\t\techo -en \"<meta http-equiv='REFRESH' content='0;url=tm-file://$FILE'></head>\"\n\t\telse\n\t\t\techo -en \"<meta http-equiv='REFRESH' content='0;url=$FILE'></head>\"\n\t\tfi\n\t\texit_show_html\n\telse\n\t\tFILE=\"\"\n\t\tCNT=0\n\tfi\nfi\n\n# Function to output the HTML frame set\nprintframe() {\n\tROWSIZE=$1\n\tcat <<-HF\n\t<HTML>\n\t<HEAD>\n\t<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n\t<TITLE>TextMate&apos;s R Help</TITLE>\n\t</HEAD>\n\t<FRAMESET COLS=\"$ROWSIZE,*\" FRAMEBORDER=\"5\" FRAMESPACING=\"5\" BORDER=\"7\" FRAMEBORDER=\"YES\" onload='parent.search.sform.search.value=\"$WORD\";parent.search.sform.search.select();parent.search.sform.search.focus()'>\n\t\t<FRAMESET ROWS=\"*,90\" FRAMEBORDER=\"1\" FRAMESPACING=\"0\" BORDER=\"1\" FRAMEBORDER=\"NO\">\n\t\t\t<FRAME SRC=\"tm-file:///tmp/textmate_Rhelper_head.html\" NAME=\"head\" MARGINWIDTH=\"30\" MARGINHEIGHT=\"0\" SCROLLING=\"YES\">\n\t\t\t<FRAME SRC=\"tm-file:///tmp/textmate_Rhelper_search.html\" NAME=\"search\" MARGINWIDTH=\"30\" MARGINHEIGHT=\"0\" SCROLLING=\"NO\">\n\t\t</FRAMESET>\n\t\t<FRAME SRC=\"tm-file:///tmp/textmate_Rhelper_data.html\" NAME=\"data\" MARGINWIDTH=\"30\" MARGINHEIGHT=\"0\" SCROLLING=\"YES\">\n\t</FRAMESET>\n\t</HTML>\nHF\n\n}\n\nHEAD=\"/tmp/textmate_Rhelper_head.html\"\nDATA=\"/tmp/textmate_Rhelper_data.html\"\nSEARCH=\"/tmp/textmate_Rhelper_search.html\"\nRHOME=${R_HOME:=/Library/Frameworks/R.framework/Versions/Current/Resources}\n\necho \"<html></html>\" > \"$DATA\"\n\n\"$TM_BUNDLE_SUPPORT\"/bin/askRhelperDaemon.sh \"cat(getRversion()>='2.10.0',sep='')\"\nIS_HELPSERVER=$(cat \"$RhelperAnswer\")\n\"$TM_BUNDLE_SUPPORT\"/bin/askRhelperDaemon.sh \"@getHttpPort()\"\nPORT=$(cat \"$RhelperAnswer\")\n\n\ncat <<-\"HFS\" > \"$SEARCH\"\n<html>\n\t<head>\n\t<script type='text/javascript' charset='utf-8'>\n\t\tfunction SearchServer(term) {\n\t\t\tif (term.length > 0) {\n\t\t\t\tTextMate.isBusy = true;\n\t\t\t\tif(document.sform.where.checked == true) {\n\t\t\t\t\tTextMate.system('\"$TM_BUNDLE_SUPPORT/bin/Rsearch.sh\" \"' + term + '\" 1', null);\n\t\t\t\t} else {\n\t\t\t\t\tTextMate.system('\"$TM_BUNDLE_SUPPORT/bin/Rsearch.sh\" \"' + term + '\" 0', null);\n\t\t\t\t}\n\t\t\t\tTextMate.system('sleep 0.3', null);\n\t\t\t\tparent.head.location.reload();\n\t\t\t\tparent.data.location.reload();\n\t\t\t\tTextMate.isBusy = false;\n\t\t\t\tparent.search.sform.search.value = term;\n\t\t\t}\n\t\t}\n\t\tfunction Rdoc() {\nHFS\n\nif [ \"$IS_HELPSERVER\" != \"TRUE\" ]; then\n\t\t\techo \"TextMate.system('open \\\"${R_HOME:=/Library/Frameworks/R.framework/Versions/Current/Resources}/doc/html/index.html\\\"', null);\" >> \"$SEARCH\"\nelse\n\t\t\techo \"TextMate.system('open \\\"http://127.0.0.1:$PORT/doc/html/index.html\\\"', null);\" >> \"$SEARCH\"\nfi\n\n\nif [ \"$TM_R_SHOW_ALWAYS_HELPSEARCH\" == \"1\" ]; then\n\t\"$TM_BUNDLE_SUPPORT\"/bin/askRhelperDaemon.sh \"@getHelpURL('$WORD'$LIB)\"\n\tFILE=$(cat \"$RhelperAnswer\")\n\tif [ -z \"$FILE\" -o \"$FILE\" == \"NA\" ]; then\n\t\tCNT=0\n\t\tFILE=\"\"\n\telse\n\t\tCNT=`echo -e \"$FILE\" | wc -l`\n\t\tif [ $CNT -eq 1 ]; then\n\t\t\ttheLib=$(echo \"$FILE\" | perl -pe 's!.*?/library/(.*?)/.*!$1!')\n\t\t\tFILE=\"$theLib\t$WORD\t$FILE\"\n\t\telse\n\t\t\t\"$TM_BUNDLE_SUPPORT\"/bin/askRhelperDaemon.sh \"@getSearchHelp('^$WORD$')\"\n\t\t\tFILE=$(cat \"$RhelperAnswer\")\n\t\t\tCNT=`echo -e \"$FILE\" | wc -l`\n\t\tfi\n\tfi\n\tBEGINSEARCH=\"\"\nfi\nif [ $CNT -eq 0 ]; then\n\t\"$TM_BUNDLE_SUPPORT\"/bin/askRhelperDaemon.sh \"@getSearchHelp('^$WORD')\"\n\tsleep 0.01\n\tFILE=$(cat \"$RhelperAnswer\")\n\tif [ -z \"$FILE\" -o \"$FILE\" == \"NA\" ]; then\n\t\tCNT=0\n\t\tFILE=\"\"\n\telse\n\t\tCNT=`echo -e \"$FILE\" | wc -l`\n\tfi\n\tBEGINSEARCH=\"checked\"\n\tif [ $CNT -eq 0 ]; then\n\t\t\"$TM_BUNDLE_SUPPORT\"/bin/askRhelperDaemon.sh \"@getSearchHelp('$WORD')\"\n\t\tFILE=$(cat \"$RhelperAnswer\")\n\t\tif [ -z \"$FILE\" -o \"$FILE\" == \"NA\" ]; then\n\t\t\tCNT=0\n\t\t\tFILE=\"\"\n\t\telse\n\t\t\tCNT=`echo -e \"$FILE\" | wc -l`\n\t\tfi\n\t\tBEGINSEARCH=\"\"\n\tfi\nfi\n\ncat <<-HFS01 >> \"$SEARCH\"\n\t\t}\n\t</script>\n\t</head>\n\t<body bgcolor='#ECECEC''>\n\t<table>\n\t\t<tr>\n\t\t\t<td>\n\t\t\t<form name='sform' onsubmit='SearchServer(document.sform.search.value)'>\n\t\t\t<small><small><i>Search for</i><br /></small></small>\n\t\t\t<input tabindex='0' id='search' type='search' placeholder='regexp' results='20' onsearch='SearchServer(this.value)'>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t<font style='font-size:7pt'>\n\t\t\t<br /><button onclick='SearchServer(document.sform.search.value)'>Search</button><br /><input type='checkbox' name='where' value='key' $BEGINSEARCH><i> begins with</i>\n\t\t\t</font>\n\t\t\t</td>\n\t\t\t</form>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align=center colspan=3>\n\t\t\t<input onclick='Rdoc()' type=button value='R documentation'><br/>\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n\t</body>\n</html>\nHFS01\n\necho \"<html><body style='margin-top:5mm'>\" > \"$HEAD\"\necho \"<table style='border-collapse:collapse'><tr><td style='padding-right:1cm;border-bottom:1px solid black'><b>Package</b></td><td style='border-bottom:1px solid black'><b>Topic</b></td></tr>\" >> \"$HEAD\"\n\nif [ $CNT -gt 10 ]; then\n\texport token=$(\"$DIALOG\" -c -a ProgressDialog -p \"{title=Rdaemon;isIndeterminate=1;summary='R Documentation';details='Please wait. Building Help Page… $CNT items found';}\")\nfi\n\nif [ $CNT -gt 500 ]; then\n\techo \"<tr colspan=2><td><i>too much matches...</i></td></tr>\" >> \"$HEAD\"\nelse\n\t\toifs=\"$IFS\"\n\t\tIFS=\"\n\"\n\n\tif [ \"$IS_HELPSERVER\" == \"TRUE\" ]; then\n\t\tfor i in $FILE\n\t\tdo\n\t\t\tlib=$(echo -e \"$i\" | cut -d '\t' -f1)\n\t\t\tfun=$(echo -e \"$i\" | cut -d '\t' -f2)\n\t\t\tlink=$(echo -e \"$i\" | cut -d '\t' -f3)\n\t\t\techo \"<tr><td>$lib</td><td><a href='$link' target='data'>$fun</a></td></tr>\" >> \"$HEAD\"\n\t\tdone\n\t\tif [ $CNT -eq 1 ]; then\n\t\t\techo \"<base href=\\\"$link\\\">\" > \"$DATA\"\n\t\t\tcurl -gsS \"$link\" >> \"$DATA\"\n\t\tfi\n\telse\n\t\tfor i in $FILE\n\t\tdo\n\t\t\tlib=$(echo -e \"$i\" | cut -d '\t' -f1)\n\t\t\tfun=$(echo -e \"$i\" | cut -d '\t' -f2)\n\t\t\tlink=$(echo -e \"$i\" | cut -d '\t' -f3)\n\t\t\techo \"<tr><td>$lib</td><td><a href='tm-file://$link' target='data'>$fun</a></td></tr>\" >> \"$HEAD\"\n\t\tdone\n\t\tif [ $CNT -eq 1 ]; then\n\t\t\techo \"<base href=\\\"tm-file://$link\\\">\" > \"$DATA\"\n\t\t\tcat \"$link\" | iconv -s -f ISO8859-1 -t UTF-8 >> \"$DATA\"\n\t\tfi\n\tfi\nfi\necho \"</table></body></html>\" >> \"$HEAD\"\n\nprintframe 340\n\n\"$DIALOG\" -x $token 2&>/dev/null\nexit_show_html\n\n",
266
+ fallbackInput: "none",
267
+ input: "selection",
268
+ keyEquivalent: "^h",
269
+ name: "Show R Help for actual Word / Selection",
270
+ output: "showAsTooltip",
271
+ scope: "source.r, source.rd.console",
272
+ uuid: "3F849C03-8BFC-4A54-B985-09BB453AF679"},
273
+ {beforeRunningCommand: "nop",
274
+ command: "cat | R --vanilla --slave --no-readline --encoding=UTF-8",
275
+ input: "selection",
276
+ keyEquivalent: "^@r",
277
+ name: "Show Result as Tooltip",
278
+ output: "showAsTooltip",
279
+ scope: "source.r",
280
+ uuid: "E3EAFF15-1B8D-4E74-8649-2A3CADC0A119"},
281
+ {beforeRunningCommand: "nop",
282
+ command:
283
+ "#!/usr/bin/env ruby\n# print \"Got:\" + STDIN.read\n\nrequire ENV['TM_SUPPORT_PATH'] +'/lib/ui.rb'\nrequire ENV['TM_SUPPORT_PATH'] +'/lib/exit_codes.rb'\nopts = { \"Summary\" => \"summary(${1:x})\", \n \"Table\" => \"table(${1:x})\"}\nkeys = opts.keys.sort\nans = TextMate::UI.menu(keys)\nTextMate.exit_discard unless ans\nprint opts[keys[ans]]",
284
+ fallbackInput: "word",
285
+ input: "none",
286
+ keyEquivalent: "~@S",
287
+ name: "Summaries…",
288
+ output: "insertAsSnippet",
289
+ scope: "source.r, source.rd.console",
290
+ uuid: "6A931F29-5A2B-4CCB-A958-0A0A9A3F2BEF"},
291
+ {beforeRunningCommand: "nop",
292
+ command:
293
+ "RPID=$(ps aw | grep '[0-9] /.*TMRHelperDaemon' | awk '{print $1}' )\nif [ ! -z $RPID ]; then\n\tout=$(kill $RPID)\n\tif [ -z \"$out\" ]; then\n\t\trm -f /tmp/textmate_Rhelper_console\n\t\trm -f /tmp/textmate_Rhelper_data.html\n\t\trm -f /tmp/textmate_Rhelper_head.html\n\t\trm -f /tmp/textmate_Rhelper_in\n\t\trm -f /tmp/textmate_Rhelper_out\n\t\trm -f /tmp/textmate_Rhelper_search.html\n\t\trm -f /tmp/textmate_Rhelper_status\n\t\techo \"Helper Daemon was terminated.\"\n\telse\n\t\techo \"Error while terminating Helper Daemon running as PID $RPID.\"\n\tfi\nelse\n\techo \"No Helper Daemon found.\"\nfi",
294
+ input: "none",
295
+ name: "Terminate Helper Daemon",
296
+ output: "showAsTooltip",
297
+ scope: "source.r, source.rd.console",
298
+ uuid: "90C73568-B9B1-4D3D-BAC5-5C2999BE39BC"},
299
+ {beforeRunningCommand: "nop",
300
+ command:
301
+ "#[[ -z \"$TM_SELECTED_TEXT\" ]] && echo \"Please select a function definition\" && #exit_show_tool_tip\n\necho \"dummy <- function() {\" > /tmp/TM_Rtidy_func.R\ncat >> /tmp/TM_Rtidy_func.R\necho \"}\" >> /tmp/TM_Rtidy_func.R\n\nif [ $TM_SOFT_TABS == \"YES\" ]; then\n\texport TAB=$(perl -e 'print \" \" x $ENV{\"TM_TAB_SIZE\"}')\nelse\n\texport TAB=\"\t\"\nfi\n\nexport TABLEVEL=$(head -n 2 /tmp/TM_Rtidy_func.R | tail -n 1 | perl -pe 's/^([ \\t]*).*/$1/')\n\ncat <<-HFS > /tmp/TM_Rtidy.R\noptions(keep.source = FALSE)\noptions(warn = -1)\noptions(show.error.messages = TRUE)\nsource(\"/tmp/TM_Rtidy_func.R\")\ndump(ls(all = TRUE), file = \"/tmp/TM_Rtidy_func_new.R\", control = c(\"keepInteger\", \"keepNA\", \"quoteExpressions\"))\nHFS\n\nR --vanilla --slave < /tmp/TM_Rtidy.R 2> /tmp/TM_Rtidy.err\n\nERR=$(cat /tmp/TM_Rtidy.err | sed '1,3d' | sed '$d')\nif [ ! -z \"$ERR\" ]; then\n\t[[ -e /tmp/TM_Rtidy_func.R ]] && rm /tmp/TM_Rtidy_func.R\n\t[[ -e /tmp/TM_Rtidy.R ]] && rm /tmp/TM_Rtidy.R\n\t[[ -e /tmp/TM_Rtidy_func_new.R ]] && rm /tmp/TM_Rtidy_func_new.R\n\t[[ -e /tmp/TM_Rtidy.err ]] && rm /tmp/TM_Rtidy.err\n\techo \"Syntax Error at:\"\n\tif [ -z \"$TM_SELECTED_TEXT\" ]; then\n\t\tERR=$(echo -en \"$ERR\" | perl -e '$_=<>;chomp;m/^(\\d+):(.*)/;print \"line \" . ($1-1) . \": $2\"')\n\t\tLINE=$(echo -en \"$ERR\" | perl -pe 's/^line (\\d+):.*/$1/')\n\t\topen \"txmt://open?line=$LINE\"\n\telse\n\t\tERR=$(echo -en \"$ERR\" | perl -e '$_=<>;chomp;m/^(\\d+):(.*)/;print \"line \" . ($1-2+$ENV{\"TM_INPUT_START_LINE\"}) . \": $2\"')\n\t\tLINE=$(echo -en \"$ERR\" | perl -pe 's/^line (\\d+):.*/$1/')\n\t\t#LINE=$(($LINE + $TM_INPUT_START_LINE - 1))\n\t\topen \"txmt://open?line=$LINE\"\n\tfi\n\techo -en \"$ERR\"\n\texit_show_tool_tip\nfi\n\nif [ -e /tmp/TM_Rtidy_func_new.R ]; then\n\tcat /tmp/TM_Rtidy_func_new.R | sed '1,3d;$d' | perl -pe 's/^ /$ENV{\"TABLEVEL\"}/;s/^\\`(.*?)\\` <\\-\\n/$1 <\\- /;s/ {4}/$ENV{\"TAB\"}/g;s/function \\(/function(/;s/(.*?<\\- function\\()/\\n$1/'\nelse\n\techo \"Unknown error occured\"\n\texit_show_tool_tip\nfi\n\n[[ -e /tmp/TM_Rtidy_func.R ]] && rm /tmp/TM_Rtidy_func.R\n[[ -e /tmp/TM_Rtidy.R ]] && rm /tmp/TM_Rtidy.R\n[[ -e /tmp/TM_Rtidy_func_new.R ]] && rm /tmp/TM_Rtidy_func_new.R\n[[ -e /tmp/TM_Rtidy.err ]] && rm /tmp/TM_Rtidy.err\n\n\n\n",
302
+ fallbackInput: "document",
303
+ input: "selection",
304
+ keyEquivalent: "^H",
305
+ name: "Tidy (removes all comments!)",
306
+ output: "replaceSelectedText",
307
+ scope: "source.r -source.r.rd.console",
308
+ uuid: "3A526F78-B82D-41BD-9799-CA5F846401DC"},
309
+ {beforeRunningCommand: "nop",
310
+ command:
311
+ "FLAG=$(echo -en \"$TM_CURRENT_LINE\" | perl -e '$_=<>;m/.*?( $)/;print 1 if defined($1)')\nif [ -z \"$FLAG\" ]; then\n\techo -n \" <- \"\nelse\n\techo -n \"<- \"\nfi",
312
+ input: "none",
313
+ keyEquivalent: "^-",
314
+ name: "“ <- ”",
315
+ output: "afterSelectedText",
316
+ scope: "source.r, source.rd.console",
317
+ uuid: "06BD4251-25D5-4BA0-99BC-5D3061E64128"},
318
+ {beforeRunningCommand: "nop",
319
+ command:
320
+ "export WORD=\"par\"\n\n\"$TM_BUNDLE_SUPPORT\"/bin/initCommandArgsDir.sh\nif [ -e \"$TM_BUNDLE_SUPPORT\"/lib/command_args/$WORD ]; then\n\texport RES=$(cat \"$TM_BUNDLE_SUPPORT\"/lib/command_args/$WORD | perl -pe 's/\\|/:/g;s/,/\\|/g;s/\\n/,/g;s/ //g;')\nfi\n\n#if no parameter quit\n[[ -z \"$RES\" ]] && exit_discard\n\n#show all parameters as inline menu and insert the parameter as snippet (if '=' is found only the value)\nruby -- <<-SCRIPT\n# 2> /dev/null\nrequire File.join(ENV[\"TM_SUPPORT_PATH\"], \"lib/exit_codes.rb\")\nrequire \"\#{ENV[\"TM_SUPPORT_PATH\"]}/lib/ui\"\nword = \"$WORD\"\ntext = ENV[\"RES\"]\nfuns = text.split(\",\")\nfuns.collect! {|x| x.gsub(/\\|/, \", \").gsub(/=/, \" = \").gsub(/:/, \"|\")}\n\nTextMate.exit_discard if funs.size < 1\n\nif funs.size == 1\n function = funs.first\nelse\n\tidx = TextMate::UI.menu(funs)\n\tTextMate.exit_discard if idx.nil?\n\tfunction = funs[idx]\nend\nTextMate.exit_discard if function.empty?\ncurword = ENV['TM_CURRENT_WORD']\ncomma=\"\"\nif ! curword.match(\",\") && ! curword.match('\\( *\\)+$')\n\tcomma = \"\\${200:, }\"\nend\n\nif function.match(\"=\")\n\tarr = function.gsub(/ = /, \"=\").split('=')\n\tif arr[1].match(\"\\\"\")\n\t\tprint \"\#{comma}\#{arr[0]} = \\\"\\${1:\#{arr[1].gsub(/\\\"/, \"\")}}\\\"\\${300:}\"\n\telse\n\t\tif arr[1].match(\"^c\\(.*?\\)$\")\n\t\t\tsubarr = arr[1].gsub(/^c\\(/, \"\").gsub(/\\)$/,\"\").gsub(/ /,\"\").split(\",\")\n\t\t\tfor i in (0..(subarr.size - 1))\n\t\t\t\tsubarr[i] = \"\\${\#{i+2}:\#{subarr[i]}}\"\n\t\t\tend\n\t\t\tprint \"\#{comma}\#{arr[0]} = \\${1:c(\#{subarr.join(\", \")})}\\${300:}\"\n\t\telse\n\t\t\tprint \"\#{comma}\#{arr[0]} = \\${1:\#{arr[1]}}\\${30:}\"\n\t\tend\n\tend\nelse\n\tprint \"\#{comma}\\${1:\#{function}}\\${3:}\"\nend\nSCRIPT\n",
321
+ fallbackInput: "none",
322
+ input: "none",
323
+ keyEquivalent: "^;",
324
+ name: "“par()” Parameters…",
325
+ output: "insertAsSnippet",
326
+ scope: "source.r, source.rd.console",
327
+ uuid: "38BD6CA7-0916-43BD-88C9-CBFC4ED17FDE"},
328
+ {beforeRunningCommand: "nop",
329
+ command:
330
+ "[[ -n \"$TM_SELECTED_TEXT\" ]] && echo \"Please unselect first.\" && exit_show_tool_tip\n\nLINE=$(cat | perl -e '\n\t$line=$ENV{\"TM_CURRENT_LINE\"};$col=$ENV{\"TM_LINE_INDEX\"};\n\t$lineL=substr($line,0,$col);\n\t$lineR=substr($line,$col);\n\t$lineL=~s/(?=[\\$`\\\\])/\\\\/g;\n\t$lineR=~s/(?=[\\$`\\\\])/\\\\/g;\n\tprint \"$lineL\\${0:}$lineR\";\n')\nWORD=$(ruby -- <<-SCR1 \n\trequire File.join(ENV[\"TM_SUPPORT_PATH\"], \"lib/current_word.rb\")\n\tword = Word.current_word('\\w._\\(')\n\tprint word\nSCR1\n)\n\nWORD=$(echo -en \"$WORD\" | perl -pe 's/\\([^\\(]*$//')\n\n[[ -z \"$WORD\" ]] && echo \"No keyword found\" && exit_show_tool_tip\n\n\"$TM_BUNDLE_SUPPORT\"/bin/askRhelperDaemon.sh \"@getPackageFor('$WORD')\"\nLIB=$(cat /tmp/textmate_Rhelper_out)\nif [ -z \"$LIB\" ]; then\n\techo -en \"No package found.\"\n\texit 206\nfi\n\nif [ `echo \"$LIB\" | wc -l` -gt 1 ]; then\n\tLIB=$(echo \"$LIB\" | sort -f | ruby -e '\n\t\trequire File.join(ENV[\"TM_SUPPORT_PATH\"], \"lib/ui.rb\")\n\t\trequire File.join(ENV[\"TM_SUPPORT_PATH\"], \"lib/exit_codes.rb\")\n\t\twords = STDIN.read().split(\"\\n\")\n\t\tindex=TextMate::UI.menu(words)\n\t\tif index != nil\n\t\t\tprint words[index]\n\t\tend\n\t')\nfi\n\nif [ `echo -n \"$TM_SCOPE\" | grep -c -F 'source.rd.console'` -gt 0 ]; then\n\techo -en \"> require($LIB); \"\n\techo -n \"$LINE\" | sed 's/^> //'\nelse\n\tTABS=$(echo -en \"$LINE\" | perl -e '$a=<>;$a=~m/^([\\t ]+)/;print $1 if defined($1)')\n\techo -en \"$TABS\"\n\techo -e \"require($LIB)\"\n\techo -n \"$LINE\"\nfi\n\n",
331
+ fallbackInput: "line",
332
+ input: "selection",
333
+ keyEquivalent: "^L",
334
+ name: "“require(xxx)” for current Function",
335
+ output: "insertAsSnippet",
336
+ scope: "source.r, source.rd.console",
337
+ uuid: "8D7F64A5-B2C5-4BF1-B7C5-352CF6AAEF28"}]
@@ -0,0 +1,10 @@
1
+ # Encoding: UTF-8
2
+
3
+ [{beforeRunningCommand: "saveActiveFile",
4
+ command: "require_cmd ragel\nragel \"$TM_FILEPATH\" -o /dev/stdout\n",
5
+ input: "none",
6
+ keyEquivalent: "^H",
7
+ name: "Create Source",
8
+ output: "openAsNewDocument",
9
+ scope: "source.c.ragel",
10
+ uuid: "5475E069-12C9-4723-BF6E-15555F3B4238"}]
@@ -0,0 +1,18 @@
1
+ # Encoding: UTF-8
2
+
3
+ [{beforeRunningCommand: "nop",
4
+ command:
5
+ "# put a regular expression on the clipboard and select text to be searched. Output is your document with all matches highlighted.\n# add a -x before the -c to omit nonmatching lines.\n# Replace `pbpaste` with a regexp string if you don't like copying first.\n# You can replace or reorder the color list with any html-okay colors or #ffffff values.\n\necho \"<html><head></head><body>\"\necho \"<h3>Results for /`pbpaste`/</h3><tt>\"\n\n\"$TM_BUNDLE_SUPPORT/bin/hl.pl\" -c \"Red\",\"Dark Blue\",\"Dark Purple\",\"Brown\",\"Burgundy\",\"Forest Green\",\"Yellow\",\"Pastel Green\",\"Light Purple\",\"Pink\",\"Turquoise\",\"Light Blue\",\"Dark Grey\",\"Orange\",\"Grass Green\" \"`pbpaste`\"\n\necho \"</tt></body></html>\"",
6
+ input: "selection",
7
+ keyEquivalent: "^~@x",
8
+ name: "Test RegExp in Clipboard",
9
+ output: "showAsHTML",
10
+ uuid: "8FDBC987-A543-11D9-B374-000D9332809C"},
11
+ {beforeRunningCommand: "nop",
12
+ command:
13
+ "# Select a regular expression in your text; this command will show you matches in the rest of your text.\n# First line of input is expected to be a regular\n# expression. If we're doing matching, leave out the /slashes/, eg:\n# (.+)z\n# If we're doing substitution, use slashes to identify the expression as such:\n# /old/new/ \n# Every line after the first is match fodder, used to test the regexp.\n\nruby \"$TM_BUNDLE_SUPPORT/bin/rx_helper.rb\"|pre",
14
+ input: "selection",
15
+ keyEquivalent: "^~@x",
16
+ name: "Test RegExp in First Line",
17
+ output: "showAsHTML",
18
+ uuid: "7EB957A4-A531-11D9-917B-000D9332809C"}]
@@ -0,0 +1,44 @@
1
+ # Encoding: UTF-8
2
+
3
+ [{beforeRunningCommand: "nop",
4
+ command: "mate ~/.reminders\n",
5
+ input: "none",
6
+ name: "Edit Reminders",
7
+ output: "showAsTooltip",
8
+ uuid: "C958CCC3-109D-40E0-ADB5-DFAA1A9DE8AF"},
9
+ {beforeRunningCommand: "nop",
10
+ command:
11
+ "# show this month's calendar\n. \"$TM_SUPPORT_PATH/lib/webpreview.sh\"\nhtml_header \"Remind bundle Help\" \"Remind\"\n\nMarkdown.pl <<'MARKDOWN'\n\n## Intro\n\n[Remind][] is a calendar/reminder shell command which takes as input your calendar file (which is written in a simple plain text format) and outputs upcoming events.\n\nOn Mac OS X Remind is useful with something like [GeekTool][] (get the [unofficial branch][GTBranch]) which allows you to setup a shell command to run periodically and have its output shown nicely on your desktop.\n\n[Remind]: http://www.roaringpenguin.com/penguin/open_source_remind.php\n[GeekTool]: http://projects.tynsoe.org/en/geektool/\n[GTBranch]: http://www.jaw.it/pages/en/x_misc.html\n\n## Installing `remind`\n\nYou can download Remind from [MacPorts](http://macports.org/) by using:\n \n sudo port install remind\n\n## This Bundle\n\nThis bundle offers a language grammar for your `~/.reminders` file, a few useful snippets, and commands to show upcoming events or a calender for this week/month.\n\nMARKDOWN\n\nhtml_footer\n",
12
+ input: "none",
13
+ name: "Help",
14
+ output: "showAsHTML",
15
+ scope: "source.remind",
16
+ uuid: "A72C1A66-38B4-4DB5-8C82-0F4E522E31A7"},
17
+ {beforeRunningCommand: "nop",
18
+ command:
19
+ "# show this month's calendar\n. \"$TM_SUPPORT_PATH/lib/webpreview.sh\"\nhtml_header \"Calendar for this Month\" \"Remind\"\nrequire_cmd rem\n\nrem ${REMIND_FLAGS:--mb1} -pl|rem2html --tableonly --nomini|perl -pe 's/<table class=\"caltable\" border=1 bgcolor=\"#FFFFFF\" width=100%>/<table class=\"pro_table remind_table\" cellspacing=\"0\" cellpadding=\"5\" width=\"100%\">/'\n\nhtml_footer\n",
20
+ fallbackInput: "none",
21
+ input: "none",
22
+ keyEquivalent: "^~@p",
23
+ name: "This Month",
24
+ output: "showAsHTML",
25
+ scope: "source.remind",
26
+ uuid: "95F8AD0C-B0B5-4A3E-ACD2-4786F2E02318"},
27
+ {beforeRunningCommand: "nop",
28
+ command:
29
+ "# show this weeks calendar in a tooltip\nrequire_cmd rem\n\nrem ${REMIND_FLAGS:--mb1} -c+\n",
30
+ input: "none",
31
+ keyEquivalent: "^~@p",
32
+ name: "This Week",
33
+ output: "showAsTooltip",
34
+ scope: "source.remind",
35
+ uuid: "851259CB-28FD-4B01-A23C-1DB5F46F92BF"},
36
+ {beforeRunningCommand: "nop",
37
+ command:
38
+ "# show current reminders in a tooltip\nrequire_cmd rem\n\nrem ${REMIND_FLAGS:--mb1} -g\n",
39
+ input: "none",
40
+ keyEquivalent: "^~@p",
41
+ name: "Upcoming Events",
42
+ output: "showAsTooltip",
43
+ scope: "source.remind",
44
+ uuid: "EE6760B3-1869-44F9-A050-CB407CCDB94B"}]
@@ -0,0 +1,40 @@
1
+ # Encoding: UTF-8
2
+
3
+ [{beforeRunningCommand: "nop",
4
+ command:
5
+ "#!/usr/bin/env ruby\n\nrequire ENV['TM_BUNDLE_SUPPORT'] + \"/lib/spec/mate/switch_command\"\nSpec::Mate::SwitchCommand.new.go_to_twin(ENV['TM_PROJECT_DIRECTORY'], ENV['TM_FILEPATH'])",
6
+ input: "none",
7
+ keyEquivalent: "^$",
8
+ name: "Alternate File",
9
+ output: "showAsTooltip",
10
+ scope: "source.ruby, text.html.ruby",
11
+ uuid: "0C96C910-0A83-4AFE-AEF7-1F4882A00232"},
12
+ {beforeRunningCommand: "saveActiveFile",
13
+ command:
14
+ "#!/usr/bin/env ruby\n\nrequire ENV['TM_BUNDLE_SUPPORT'] + \"/lib/spec_mate\"\nSpecMate.new.run_file STDOUT",
15
+ fallbackInput: "document",
16
+ input: "document",
17
+ keyEquivalent: "@r",
18
+ name: "Run Behaviour Description",
19
+ output: "showAsHTML",
20
+ scope: "source.ruby.rspec",
21
+ uuid: "B5906021-8E54-4863-A13B-EA46333DB5F1"},
22
+ {beforeRunningCommand: "saveModifiedFiles",
23
+ command:
24
+ "#!/usr/bin/env ruby\n\nrequire ENV['TM_BUNDLE_SUPPORT'] + \"/lib/spec_mate\"\nSpecMate.new.run_files STDOUT\n",
25
+ input: "none",
26
+ keyEquivalent: "~@r",
27
+ name: "Run Behaviour Descriptions in selected files/directories",
28
+ output: "showAsHTML",
29
+ scope: "source.ruby.rspec",
30
+ uuid: "67E726E0-63E2-4840-B8BB-37F665CD34B8"},
31
+ {beforeRunningCommand: "saveActiveFile",
32
+ command:
33
+ "#!/usr/bin/env ruby\n\nrequire ENV['TM_BUNDLE_SUPPORT'] + \"/lib/spec_mate\"\nSpecMate.new.run_focussed STDOUT\n",
34
+ fallbackInput: "line",
35
+ input: "document",
36
+ keyEquivalent: "@R",
37
+ name: "Run Focused Example",
38
+ output: "showAsHTML",
39
+ scope: "source.ruby.rspec",
40
+ uuid: "240FDD9D-CD49-4917-9003-80A3E1DADFBA"}]