Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.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
是否存在vim或gVim命令来复制括号之间的文本?_Vim - Fatal编程技术网

是否存在vim或gVim命令来复制括号之间的文本?

是否存在vim或gVim命令来复制括号之间的文本?,vim,Vim,在下面的代码段中,如果我转到以(spit (defn missing-accts "Prints accounts found in one report but not the other." [report-header mapped-data out-file] (spit out-file (str "\n\n " (count mapped-data) " " report-header

在下面的代码段中,如果我转到以
(spit

(defn missing-accts 
    "Prints accounts found in one report but not the other."

    [report-header mapped-data out-file]
    (spit out-file (str "\n\n    " 
          (count mapped-data) 
          "   " report-header 
          "\n\n") :append true)
          .
          .
          .
vim突出显示第一个
和结束
括号

有没有,如果有,什么是vim命令,可以拉整个spit命令

谢谢。

顺序

va(
将从开始括号到结束括号(包括)高亮显示,然后一个
y
将拖动它。注意,与
%
命令不同,您不必位于括号上-只需位于子句内部即可

注意

vi(
将突出显示括号内的所有内容,但不突出括号


您也可以对大括号(
{
而不是
)和XML标记(
t
-大概是标记)执行此操作。

将%与y一起使用。按下“y”一次,然后按“%”,光标应该在”()上(当您键入命令时。

Vim确实有这样一个命令,幸运的是它非常简单。只需键入
y%


之所以这样做,是因为
%
是Vim调用的移动命令。它从一个分隔符移动到匹配的分隔符——在本例中是从开始的括号移动到结束的括号。
y
命令在作为
yy
调用时将一行拖动到Vim的缓冲区中,但第二行
y
不是必需的。相反,你可以发出一个类似
%
的移动,Vim将拉动移动的文本。因此,
y%

或更简单的,
ya(
),而不使用视觉模式。更改为
yi(
如果您只希望内容不带外圆括号。此外,它可以从括号内的任何位置工作;您不需要将光标精确地放在括号中。@Amadan-谢谢您。我不知道您也可以这样做