holgerbrandl / send2terminal

Intellij plugin to send line or selection to terminal
BSD 2-Clause "Simplified" License
17 stars 2 forks source link
intellij

Send To Terminal

Intellij plugin to send line or selection to a terminal

The following modes are supported

Supported evaluation targets are

Kotlin Support

The plugin comes with special support for Kotlin, namely

  1. Paste Mode Support:

With the stock Kotlin-REPL, one can not evaluate certain multi-line expressions such as

listOf("foo", "bar")
    .map{it+"2"}

Please vote for KT-13319 to push for a REPL paste-mode. Alternatively you could use kshell from https://github.com/khud/sparklin and enable the paste mode support in the preferences of this plugin.

  1. Automatic Import Detection

The plugin will detect imports in a kotlin document and will evaluate imports in the target terminal prior to the user selection/expression.

  1. Expression Guessing

The plugin will guess the scope of the expression under the cursor when using the shortcut ctr+alt+shift+enter. The scope barriers are named fuctions or the file itself.

Custom shortcut actions

Up to 4 custom actions can be defined to send the current selection/line to the evaluation target. Below some examples are shown for R

Those shortcut actions are exposed via the context menu and can be assigned to custom keyboard bindings:

How to build?

Clone from https://github.com/holgerbrandl/send2terminal, open project in Intellij, Import from Gradle, and click "Run".

Support & Development

Feel welcome to suggest features or improvments by submitting an issue

References