Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/vim/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用scala过滤vim中的文本_Scala_Vim_Intellij Idea - Fatal编程技术网

使用scala过滤vim中的文本

使用scala过滤vim中的文本,scala,vim,intellij-idea,Scala,Vim,Intellij Idea,假设您在vim编辑器中有以下文本内容: a b c d e f a b c d e f a b c d e f a b c d e f a b c d e f 您可以直观地选择all并执行!tail-n1,则文本通过tail命令传输,只剩下最后一行 现在假设我在scala中有这样一个片段: object HelloWorld extends App { println("Hello") } HelloWor

假设您在vim编辑器中有以下文本内容:

a   b   c
d   e   f
a   b   c
d   e   f
a   b   c
d   e   f
a   b   c
d   e   f
a   b   c
d   e   f
您可以直观地选择all并执行
!tail-n1
,则文本通过
tail
命令传输,只剩下最后一行

现在假设我在scala中有这样一个片段:

object HelloWorld extends App {
    println("Hello")
}
HelloWorld.main(Array(""))
我如何过滤它,使它成为“你好”

启用ideavim后,同样的技术也可以应用于intellij

我试过
!scala
但结果当然是一团糟:

Welcome to Scala version 2.11.7 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_51).
Type in expressions to have them evaluated.
Type :help for more information.

scala> object HelloWorld extends App {
     |     println("Hello")
     | }
defined object HelloWorld

scala> HelloWorld.main(Array(""))
Hello

scala> :quit
scala-e
将其参数作为scala代码执行,并且
xargs-0
将管道输入转换为给定命令的参数


scala-e
将其参数作为scala代码执行,并且
xargs-0
将管道输入转换为给定命令的参数。

Cool。这在vim中起作用,但在intellij和ideavim.Cool中不起作用。这在vim中起作用,但在intellij和ideavim中不起作用。
! xargs -0 scala -e