What is the "un-tab" sequence in (g)Vim?

Posted by OwenP on Stack Overflow See other posts from Stack Overflow or by OwenP
Published on 2010-05-20T14:01:27Z Indexed on 2010/05/20 14:20 UTC
Read the original article Hit count: 157

Filed under:
|

This is an annoyance I've had for a long time.

(Nitpicky section: I prefer 4 space characters to tab characters. It's a lot easier to type "tab" instead of explaining that. When I say "tab", I mean "the action that happens when you press the tab key" which is probably more simply stated as "increase indentation".)

I'm using smartindent while editing a document where indentation has some significance. In "dumb" windows text editors I can press Shift+Tab to remove a tab or, more appropriately, decrease the indentation level of the current line. I can't figure out how to do this from edit mode in Vim; Shift+Tab seems to count just the same as Tab.

I know in Command mode << will decrease indentation. I want the equivalent in edit mode. These are the solutions I've found so far and why I don't like them, one in particular may be the key to the answer.

  1. Use Notepad++ or some other dumb editor. I've done this for a couple of years but I really miss Vim.
  2. Exit edit mode, use <<, enter edit mode. This just puts the cursor at column 0; if I wanted this I wouldn't have tried smartindent.
  3. Stop using smartindent. I don't decrease indent as often as I need to keep the same indent level; this would be a loss of productivity.
  4. The left arrow key seems to decrease the indent by one level. I'd rather something I can do without leaving the home row. This is the most promising choice.

Maybe there's an option I can set? Maybe I can rebind left arrow to something? (If it requires rebinding please explain in detail; I've never delved into reconfiguring (g)Vim.

© Stack Overflow or respective owner

Related posts about gvim

Related posts about indentation