Monday, October 25, 2010

Re: problem with backspace

On Oct 25, 6:48 am, rameo <rai...@gmail.com> wrote:
> I would like to have tabstop = 4 and only spaces (no tabs).
> I added this in my vimrc:
> set tabstop = 4
> set expandtab
>
> Everything works fine... however.
> The backspace key goes only 1 space back now and not 4 spaces.
>
> How can I change this?
> Is there a solution?

I'm not sure why nobody has mentioned the 'smarttab' option, which
seems to be exactly what you're looking for. It requires you to set
'shiftwidth' to same value as your 'tabstop', but otherwise is
basically dead easy. Here's help for 'smarttab':

'smarttab' 'sta' boolean (default off)
global
{not in Vi}
When on, a <Tab> in front of a line inserts blanks according to
'shiftwidth'. 'tabstop' or 'softtabstop' is used in other places. A
<BS> will delete a 'shiftwidth' worth of space at the start of the
line.
When off, a <Tab> always inserts blanks according to 'tabstop' or
'softtabstop'. 'shiftwidth' is only used for shifting text left or
right |shift-left-right|.
What gets inserted (a <Tab> or spaces) depends on the 'expandtab'
option. Also see |ins-expandtab|. When 'expandtab' is not set, the
number of spaces is minimized by using <Tab>s.
NOTE: This option is reset when 'compatible' is set.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment