Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't know about the console, but this is possible with <a href="https://github.com/wuub/SublimeREPL" rel="noreferrer">SublimeREPL</a>.</p> <p>As long as you have a REPL and a file of the same language open at the same time, you can send a line (or a selection or file) to your open REPL via the SublimeREPL <a href="http://sublimerepl.readthedocs.org/en/latest/#source-buffer-keys" rel="noreferrer">Source Buffer Keys</a>. By default, <code>Ctrl+,</code> followed by <code>l</code> sends the current line to the REPL, but you can change the hotkey to <code>Ctrl+Enter</code> (in Python only, to protect other languages' default <code>Ctrl+Enter</code> functionality) by adding these lines to the top of your <code>Preferences -&gt; Key Bindings – User</code> file:</p> <pre><code>{ "keys": ["ctrl+enter"], "command": "repl_transfer_current", "args": {"scope": "lines"}, "context": [ { "key": "selector", "operator": "equal", "operand": "source.python", "match_all": true } ] }, </code></pre> <p>Other available scopes (from <code>Preferences -&gt; Browse Packages -&gt; SublimeREPL/Default (Windows).sublime-keymap</code>) are <code>selection</code>, <code>file</code>, and <code>block</code> (Clojure only). If you want to send a line to your REPL but <strong>not</strong> parse it immediately, you can add <code>"action":"view_write"</code> to the <code>args</code> object, like so:</p> <pre><code>{ "keys": ["ctrl+enter"], "command": "repl_transfer_current", "args": {"scope": "lines", "action": "view_write"}, "context": [ { "key": "selector", "operator": "equal", "operand": "source.python", "match_all": true } ] }, </code></pre> <p>See the <a href="https://sublime-text-unofficial-documentation.readthedocs.org/en/latest/reference/key_bindings.html" rel="noreferrer">Unofficial Sublime Text 2 Docs</a> for more information on key bindings. </p> <p>In the case that the REPL is open in a different tab than your source (rather than a separate view), the source buffer hotkeys will <strong>not</strong> focus the REPL. I'm sure it's possible to implement some sort of tab-swapping toggle key, but that sounds like a problem for another question.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload