Frage

I want to be able to send entire files and selections to the SublimeREPL and eval them, but it doesn't work. CoffeeScript REPL will only read one line at a time.

Coffee will only take single lines, until you use ctrl+v to switch CoffeeScript to multiline (which works in Terminal), but is blocked by sublime's interface... I'd really like to be able to eval more than one line using SublimeREPL's "ctrl+, s", "ctrl+, f" key bindings. There seems to be no direct way to open coffee with multiline mode automatically.

Maybe I'm going about this wrong, but it's only reasonable that I could use multiline JS Object notation in a CoffeeScript file, for example, and then test it in the REPL. I do it in Python and straight up Node all the time.

You need to be able to switch multi-line on then off again, so ideally if I could edit Sublime REPL to run that key shortcut ( ctrl+v ) before and after running a snippet of code that would be the best.

War es hilfreich?

Lösung

SublimeREPL v2.0.9 will fix your problem using multiline hack in repl.coffee. [Ctrl+, s] and [ctrl+, f] should work as expected now :)

Andere Tipps

I made a plugin: https://github.com/billymoon/Sublime-Pipe-Dream/ which aims to do this - and much much more. It needs patching up a bit - so any help appreciated. I use it on my mac with sublime text 2 to pass arbitrary selected text, or whole buffers (not saved files) to shell commands and either display the result in the console, or replace the selected text with the console output.

This is very handy for converting coffee to js, js to coffee, executing js/coffee/sql, beautifying and uglifying code and anything else where you want to pass text through a command line script.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top