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?
vim smart tabbing
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.
I'm sorry, I should clarify, in vim, when appending a file, whenever I hit tab, can it 'auto tab' where it should be? Like in an if/else block, after the bracket, in emacs, whenever I hit tab, it will tab over until I am under the bracket or lined up with the line under the if statement. –
Caesarism
Perhaps you just want to use ==
to auto-indent the current line.
© 2022 - 2024 — McMap. All rights reserved.
:set cindent
which, per manual, works sometimes better but is more strict. – Casar