vim 智能标签
在 emacs 中,每当按下 Tab 时,光标就会移动到当前行上的适当位置。然而,在vim中,这种情况不会发生,制表符是给定的长度,每次我按制表符时都会走那么远。有没有办法在vim中启用“智能标签”?
In emacs, whenever tab is pressed, the cursor moves to the appropriate location on the current line. However, in vim, this does not happen, the tab is a given length and will go that far every time I press tab. Is there a way to enable "smart tabbing" in vim?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不太确定您期望什么行为,但这可能就是这样。
还可以考虑设置:
I'm not exactly sure what behavior you expect, but this is probably it.
Also consider setting:
我假设你的问题如下。你有这样的文本:
This is line 1
$ (很多空白) This is line 2 This is line
3
现在,你处于正常模式,你的光标在 $ 之后,你希望它在 T 之前。如果是这样,只需按“w”(遍历“单词”)即可实现目标。
I assume your question is the following. You have text like:
This is line 1
$ (lots of white space) This is line 2
This is line 3
Now, you are in normal mode, your cursor is after $, and you would like it get just before T. If so, just press 'w' (to traverse a 'w'ord) and you would achieve your objective.
也许您只想使用
==
自动缩进当前行。Perhaps you just want to use
==
to auto-indent the current line.