开发者

vim smart tabbing

In emacs, whene开发者_运维知识库ver 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?


I'm not exactly sure what behavior you expect, but this is probably it.

:set smarttab

Also consider setting:

:set smartindent
:set autoindent


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜