Search code examples
vimtabbing

vim smart tabbing


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?


Solution

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

    :set smarttab
    

    Also consider setting:

    :set smartindent
    :set autoindent