在下面的vim宏从这篇文章中,作者给出了解释.我理解一些但不是一切.
:qccwcommand:w jj q
此宏(包括记录开始/停止,如果您想知道)将把当前的'path_to_command'字改为'command',将文件写入磁盘,将窗口分割更改为grep搜索结果,向下移动一行在结果中导航到该结果的位置.
Q1.这是ccw
做什么的?是否与cw
(改变词语)有关但我不确定.
Q2.:w一定要写,对吗?
Q3.这是
做什么的?以下是:h CTRL-W_J
关于什么,但我不确定我是否正在寻找正确的帮助,也不确定在这种情况下帮助的含义.
*CTRL-W_J* CTRL-W J Move the current window to be at the very bottom, using the full width of the screen. This works like closing the current window and then creating another one with ":botright split", except that the current window contents is used for the new window.
David Lam.. 5
你感到很困惑,因为ccw
在字面上按照命令序列进行操作并不是很有意义!
初始qc
意味着"在寄存器c中开始宏记录"
然后下一个cw
意思是改变单词(例如删除下一个单词并在插入模式下离开编辑器)
还要注意最后的命令是q
:这意味着完成宏录制.在做需要大量重复的事情时,宏非常有用!1 - > http://vim.wikia.com/wiki/Macros
然后,他在博客文章中的解释包含Q2和Q3的答案
This macro (which includes the record start / stop, if you’re wondering) will change the current ‘path_to_command’ word to ‘command’, write the file out to disk, change window splits to the grep search results, move down one line in the results and navigate to that result’s location. I ran the macro by hitting @c and then verifying the line selected was one that I wanted to change. For a few instances where I did not want to change the line, I manually navigated to the next search result and then re-ran the @c macro.
Q2 - 是的,保存文件:" write the file out to disk
"
Q3 - 这
是一系列Vim键命令,用于从vimgrep 移动到quickfix窗口中的下一个条目,因为他指出:" write the file
out to disk, change window splits to the grep search results, move down one
line in the results and navigate to that result’s location.
"
你感到很困惑,因为ccw
在字面上按照命令序列进行操作并不是很有意义!
初始qc
意味着"在寄存器c中开始宏记录"
然后下一个cw
意思是改变单词(例如删除下一个单词并在插入模式下离开编辑器)
还要注意最后的命令是q
:这意味着完成宏录制.在做需要大量重复的事情时,宏非常有用!1 - > http://vim.wikia.com/wiki/Macros
然后,他在博客文章中的解释包含Q2和Q3的答案
This macro (which includes the record start / stop, if you’re wondering) will change the current ‘path_to_command’ word to ‘command’, write the file out to disk, change window splits to the grep search results, move down one line in the results and navigate to that result’s location. I ran the macro by hitting @c and then verifying the line selected was one that I wanted to change. For a few instances where I did not want to change the line, I manually navigated to the next search result and then re-ran the @c macro.
Q2 - 是的,保存文件:" write the file out to disk
"
Q3 - 这<Ctl-W>jj<Enter>
是一系列Vim键命令,用于从vimgrep 移动到quickfix窗口中的下一个条目,因为他指出:" write the file
out to disk, change window splits to the grep search results, move down one
line in the results and navigate to that result’s location.
"