runtime(doc): clarify the effect of 'smarttab'

closes: #17426

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Damien Lejay
2025-06-04 21:19:18 +02:00
committed by Christian Brabandt
parent 0ca5966196
commit d6c9ac97a0
3 changed files with 20 additions and 25 deletions

View File

@ -1,4 +1,4 @@
*options.txt* For Vim version 9.1. Last change: 2025 Jun 02
*options.txt* For Vim version 9.1. Last change: 2025 Jun 04
VIM REFERENCE MANUAL by Bram Moolenaar
@ -7803,19 +7803,14 @@ A jump table for the options with a short description can be found at |Q_op|.
*'smarttab'* *'sta'* *'nosmarttab'* *'nosta'*
'smarttab' 'sta' boolean (default off)
global
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.
This option is reset when 'paste' is set and restored when 'paste' is
reset.
NOTE: This option is reset when 'compatible' is set.
When enabled, the <Tab> key will indent by 'shiftwidth' if the cursor
is in leading whitespace. The <BS> key has the opposite effect.
This behaves as if 'softtabstop' is set to the value of 'shiftwidth'.
This option is reset when 'compatible' is set; it is temporarily
disabled when 'paste' is enabled, and restored when 'paste' is turned
off.
Have a look at section |30.5| of the user guide for detailed
explanations on how Vim works with tabs and spaces.
*'smoothscroll'* *'sms'* *'nosmoothscroll'* *'nosms'*
'smoothscroll' 'sms' boolean (default off)