vim格式化命令
今天,当光标位于很长的行上时,我无意中输入了一些内容,这通过将其分成几行有限长度的行来格式化我的行。这行看起来像:
Foo("This is very long line (left '%s' right '%s) and it will never never never end", pNode->left.c_str(), pNode->right.c_str());
格式化之前和行后:
Foo("This is very long line (left '%s' right '%s) and it "
"will never never never end", pNode->left.c_str(),
pNode->right.c_str());
我按了什么?
Today unintentionally I typed something when the cursor was on very long line and this formatted my line, by braking it several lines of limited length. This line looks something like:
Foo("This is very long line (left '%s' right '%s) and it will never never never end", pNode->left.c_str(), pNode->right.c_str());
before formatting and after line this:
Foo("This is very long line (left '%s' right '%s) and it "
"will never never never end", pNode->left.c_str(),
pNode->right.c_str());
What I pressed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Vgq(同时设置 tw=60)或
设置换行
(也许)?Vgq (while having
set tw=60
) orset wrap
(maybe) ?致 Idigas: 我不这么认为 - 引号 (
"
) 让我感到困惑。vim 是否知道该行中有一个字符串,因此应该添加额外的引号?我尝试了一下,我的 vim 没有在格式化行中添加额外的引号。
to Idigas: I don't think so - the quotes (
"
) confuses me. Does vim know that there is a string on the line so it should add extra quotes?I tryed it and my vim did not put extra quotes to formated lines.