假设我有一个像这样的文本文件:
this is some test `more test`
this is some test (more test)
如果我在第一行的开头并输入 ci`,光标将跳到反引号中,替换其中的内容并让我进行编辑。
但是,如果我在第二行的开头输入 ci( 什么都不会发生。
这种行为的原因是什么?是否有可能会改变它的设置?
最佳答案
关于 vim 7.4 的内部行为:
- 对于 block
()
,{}
,[]
,<>
:
Vim 向后搜索,然后从当前位置开始向前搜索以匹配开始和结束字符。
- 报价
""
,''
,``:
Vim 跨越光标所在的整行,直到找到引号。
这是最后一种情况,光标下没有 quotechar:
/* Search backward for a starting quote. */
col_start = find_prev_quote(line, col_start, quotechar, curbuf->b_p_qe);
if (line[col_start] != quotechar)
{
/* No quote before the cursor, look after the cursor. */
col_start = find_next_quote(line, col_start, quotechar, NULL);
if (col_start < 0)
return FALSE;
}
/* Find close quote character. */
col_end = find_next_quote(line, col_start + 1, quotechar,curbuf->b_p_qe);
关于vim - 为什么 ci` 跳到反引号中而 ci( 不跳到大括号中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41844277/