vim-patch:91af4c4: runtime(doc): improve the wording of 'sts', 'varts' and 'varsts' values (#34480)

closes: vim/vim#17522

91af4c4180

Co-authored-by: Damien Lejay <damien@lejay.be>
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2025-06-13 08:53:48 +08:00
committed by GitHub
parent 82d0883c2d
commit 90b682891d
4 changed files with 120 additions and 91 deletions

View File

@@ -5816,18 +5816,24 @@ A jump table for the options with a short description can be found at |Q_op|.
*'softtabstop'* *'sts'* *'softtabstop'* *'sts'*
'softtabstop' 'sts' number (default 0) 'softtabstop' 'sts' number (default 0)
local to buffer local to buffer
Number of spaces that a <Tab> counts for while performing editing Create soft tab stops, separated by 'softtabstop' number of columns.
operations, like inserting a <Tab> or using <BS>. It "feels" like In Insert mode, pressing the <Tab> key will move the cursor to the
<Tab>s are being inserted, while in fact a mix of spaces and <Tab>s is next soft tab stop, instead of inserting a literal tab. <BS> behaves
used. This is useful to keep the 'ts' setting at its standard value similarly in reverse. Vim inserts a minimal mix of tab and space
of 8, while being able to edit like it is set to 'sts'. However, characters to produce the visual effect.
commands like "x" still work on the actual characters.
When 'sts' is zero, this feature is off. This setting does not affect the display of existing tab characters.
When 'sts' is negative, the value of 'shiftwidth' is used.
See also |ins-expandtab|. When 'expandtab' is not set, the number of A value of 0 disables this behaviour. A negative value makes Vim use
spaces is minimized by using <Tab>s. 'shiftwidth'. If you plan to use 'sts' and 'shiftwidth' with
The 'L' flag in 'cpoptions' changes how tabs are used when 'list' is different values, you might consider setting 'smarttab'.
set.
'softtabstop' is temporarily set to 0 when 'paste' is on and reset
when it is turned off. It is also reset when 'compatible' is set.
The 'L' flag in 'cpoptions' alters tab behavior when 'list' is
enabled. See also |ins-expandtab| ans user manual section |30.5| for
in-depth explanations.
The value of 'softtabstop' will be ignored if |'varsofttabstop'| is set The value of 'softtabstop' will be ignored if |'varsofttabstop'| is set
to anything other than an empty string. to anything other than an empty string.
@@ -6888,34 +6894,38 @@ A jump table for the options with a short description can be found at |Q_op|.
*'varsofttabstop'* *'vsts'* *'varsofttabstop'* *'vsts'*
'varsofttabstop' 'vsts' string (default "") 'varsofttabstop' 'vsts' string (default "")
local to buffer local to buffer
A list of the number of spaces that a <Tab> counts for while editing, Defines variable-width soft tab stops. The value is a comma-separated
such as inserting a <Tab> or using <BS>. It "feels" like variable- list of widths in columns. Each width defines the number of columns
width <Tab>s are being inserted, while in fact a mixture of spaces before the next soft tab stop. The last value repeats indefinitely.
and <Tab>s is used. Tab widths are separated with commas, with the
final value applying to all subsequent tabs.
For example, when editing assembly language files where statements For example, when editing assembly language files where statements
start in the 9th column and comments in the 41st, it may be useful start in the 9th column and comments in the 41st, it may be useful
to use the following: >vim to use the following: >vim
set varsofttabstop=8,32,8 set varsofttabstop=8,32,8
< This will set soft tabstops with 8 and 8 + 32 spaces, and 8 more < This sets soft tab stops at column 8, then at column 40 (8 + 32), and
for every column thereafter. every 8 columns thereafter.
Note that the value of |'softtabstop'| will be ignored while Note: this setting overrides 'softtabstop'.
'varsofttabstop' is set. See section |30.5| of the user manual for detailed explanations on how
Vim works with tabs and spaces.
*'vartabstop'* *'vts'* *'vartabstop'* *'vts'*
'vartabstop' 'vts' string (default "") 'vartabstop' 'vts' string (default "")
local to buffer local to buffer
A list of the number of spaces that a <Tab> in the file counts for, Defines variable-width tab stops. The value is a comma-separated list
separated by commas. Each value corresponds to one tab, with the of widths in columns. Each width defines the number of columns
final value applying to all subsequent tabs. For example: >vim before the next tab stop; the last value repeats indefinitely.
set vartabstop=4,20,10,8
< This will make the first tab 4 spaces wide, the second 20 spaces,
the third 10 spaces, and all following tabs 8 spaces.
Note that the value of |'tabstop'| will be ignored while 'vartabstop' For example: >
is set. :set vartabstop=4,8
< This places the first tab stop 4 columns from the start of the line
and each subsequent tab stop 8 columns apart.
Note: this setting overrides 'tabstop'.
On UNIX, it is recommended to keep the default tabstop value of 8.
Consider setting 'varsofttabstop' instead.
See section |30.5| of the user manual for detailed explanations on how
Vim works with tabs and spaces.
*'verbose'* *'vbs'* *'verbose'* *'vbs'*
'verbose' 'vbs' number (default 0) 'verbose' 'vbs' number (default 0)

View File

@@ -871,7 +871,7 @@ Short explanation of each option: *option-list*
'smartindent' 'si' smart autoindenting for C programs 'smartindent' 'si' smart autoindenting for C programs
'smarttab' 'sta' <Tab> in leading whitespace indents by 'shiftwidth' 'smarttab' 'sta' <Tab> in leading whitespace indents by 'shiftwidth'
'smoothscroll' 'sms' scroll by screen lines when 'wrap' is set 'smoothscroll' 'sms' scroll by screen lines when 'wrap' is set
'softtabstop' 'sts' number of spaces that <Tab> uses while editing 'softtabstop' 'sts' number of columns between two soft tab stops
'spell' enable spell checking 'spell' enable spell checking
'spellcapcheck' 'spc' pattern to locate end of a sentence 'spellcapcheck' 'spc' pattern to locate end of a sentence
'spellfile' 'spf' files where |zg| and |zw| store words 'spellfile' 'spf' files where |zg| and |zw| store words
@@ -923,8 +923,8 @@ Short explanation of each option: *option-list*
'undoreload' 'ur' max nr of lines to save for undo on a buffer reload 'undoreload' 'ur' max nr of lines to save for undo on a buffer reload
'updatecount' 'uc' after this many characters flush swap file 'updatecount' 'uc' after this many characters flush swap file
'updatetime' 'ut' after this many milliseconds flush swap file 'updatetime' 'ut' after this many milliseconds flush swap file
'varsofttabstop' 'vsts' a list of number of spaces when typing <Tab> 'varsofttabstop' 'vsts' a list of number of columns between soft tab stops
'vartabstop' 'vts' a list of number of spaces for <Tab>s 'vartabstop' 'vts' a list of number of columns between tab stops
'verbose' 'vbs' give informative messages 'verbose' 'vbs' give informative messages
'verbosefile' 'vfile' file to write messages in 'verbosefile' 'vfile' file to write messages in
'viewdir' 'vdir' directory where to store files with :mkview 'viewdir' 'vdir' directory where to store files with :mkview

View File

@@ -6199,18 +6199,24 @@ vim.o.sms = vim.o.smoothscroll
vim.wo.smoothscroll = vim.o.smoothscroll vim.wo.smoothscroll = vim.o.smoothscroll
vim.wo.sms = vim.wo.smoothscroll vim.wo.sms = vim.wo.smoothscroll
--- Number of spaces that a <Tab> counts for while performing editing --- Create soft tab stops, separated by 'softtabstop' number of columns.
--- operations, like inserting a <Tab> or using <BS>. It "feels" like --- In Insert mode, pressing the <Tab> key will move the cursor to the
--- <Tab>s are being inserted, while in fact a mix of spaces and <Tab>s is --- next soft tab stop, instead of inserting a literal tab. <BS> behaves
--- used. This is useful to keep the 'ts' setting at its standard value --- similarly in reverse. Vim inserts a minimal mix of tab and space
--- of 8, while being able to edit like it is set to 'sts'. However, --- characters to produce the visual effect.
--- commands like "x" still work on the actual characters. ---
--- When 'sts' is zero, this feature is off. --- This setting does not affect the display of existing tab characters.
--- When 'sts' is negative, the value of 'shiftwidth' is used. ---
--- See also `ins-expandtab`. When 'expandtab' is not set, the number of --- A value of 0 disables this behaviour. A negative value makes Vim use
--- spaces is minimized by using <Tab>s. --- 'shiftwidth'. If you plan to use 'sts' and 'shiftwidth' with
--- The 'L' flag in 'cpoptions' changes how tabs are used when 'list' is --- different values, you might consider setting 'smarttab'.
--- set. ---
--- 'softtabstop' is temporarily set to 0 when 'paste' is on and reset
--- when it is turned off. It is also reset when 'compatible' is set.
---
--- The 'L' flag in 'cpoptions' alters tab behavior when 'list' is
--- enabled. See also `ins-expandtab` ans user manual section `30.5` for
--- in-depth explanations.
--- ---
--- The value of 'softtabstop' will be ignored if `'varsofttabstop'` is set --- The value of 'softtabstop' will be ignored if `'varsofttabstop'` is set
--- to anything other than an empty string. --- to anything other than an empty string.
@@ -7491,11 +7497,9 @@ vim.o.ut = vim.o.updatetime
vim.go.updatetime = vim.o.updatetime vim.go.updatetime = vim.o.updatetime
vim.go.ut = vim.go.updatetime vim.go.ut = vim.go.updatetime
--- A list of the number of spaces that a <Tab> counts for while editing, --- Defines variable-width soft tab stops. The value is a comma-separated
--- such as inserting a <Tab> or using <BS>. It "feels" like variable- --- list of widths in columns. Each width defines the number of columns
--- width <Tab>s are being inserted, while in fact a mixture of spaces --- before the next soft tab stop. The last value repeats indefinitely.
--- and <Tab>s is used. Tab widths are separated with commas, with the
--- final value applying to all subsequent tabs.
--- ---
--- For example, when editing assembly language files where statements --- For example, when editing assembly language files where statements
--- start in the 9th column and comments in the 41st, it may be useful --- start in the 9th column and comments in the 41st, it may be useful
@@ -7504,11 +7508,12 @@ vim.go.ut = vim.go.updatetime
--- ```vim --- ```vim
--- set varsofttabstop=8,32,8 --- set varsofttabstop=8,32,8
--- ``` --- ```
--- This will set soft tabstops with 8 and 8 + 32 spaces, and 8 more --- This sets soft tab stops at column 8, then at column 40 (8 + 32), and
--- for every column thereafter. --- every 8 columns thereafter.
--- ---
--- Note that the value of `'softtabstop'` will be ignored while --- Note: this setting overrides 'softtabstop'.
--- 'varsofttabstop' is set. --- See section `30.5` of the user manual for detailed explanations on how
--- Vim works with tabs and spaces.
--- ---
--- @type string --- @type string
vim.o.varsofttabstop = "" vim.o.varsofttabstop = ""
@@ -7516,18 +7521,22 @@ vim.o.vsts = vim.o.varsofttabstop
vim.bo.varsofttabstop = vim.o.varsofttabstop vim.bo.varsofttabstop = vim.o.varsofttabstop
vim.bo.vsts = vim.bo.varsofttabstop vim.bo.vsts = vim.bo.varsofttabstop
--- A list of the number of spaces that a <Tab> in the file counts for, --- Defines variable-width tab stops. The value is a comma-separated list
--- separated by commas. Each value corresponds to one tab, with the --- of widths in columns. Each width defines the number of columns
--- final value applying to all subsequent tabs. For example: --- before the next tab stop; the last value repeats indefinitely.
--- ---
--- ```vim --- For example:
--- set vartabstop=4,20,10,8
--- ``` --- ```
--- This will make the first tab 4 spaces wide, the second 20 spaces, --- :set vartabstop=4,8
--- the third 10 spaces, and all following tabs 8 spaces. --- ```
--- This places the first tab stop 4 columns from the start of the line
--- and each subsequent tab stop 8 columns apart.
--- ---
--- Note that the value of `'tabstop'` will be ignored while 'vartabstop' --- Note: this setting overrides 'tabstop'.
--- is set. --- On UNIX, it is recommended to keep the default tabstop value of 8.
--- Consider setting 'varsofttabstop' instead.
--- See section `30.5` of the user manual for detailed explanations on how
--- Vim works with tabs and spaces.
--- ---
--- @type string --- @type string
vim.o.vartabstop = "" vim.o.vartabstop = ""

View File

@@ -8222,18 +8222,24 @@ local options = {
abbreviation = 'sts', abbreviation = 'sts',
defaults = 0, defaults = 0,
desc = [=[ desc = [=[
Number of spaces that a <Tab> counts for while performing editing Create soft tab stops, separated by 'softtabstop' number of columns.
operations, like inserting a <Tab> or using <BS>. It "feels" like In Insert mode, pressing the <Tab> key will move the cursor to the
<Tab>s are being inserted, while in fact a mix of spaces and <Tab>s is next soft tab stop, instead of inserting a literal tab. <BS> behaves
used. This is useful to keep the 'ts' setting at its standard value similarly in reverse. Vim inserts a minimal mix of tab and space
of 8, while being able to edit like it is set to 'sts'. However, characters to produce the visual effect.
commands like "x" still work on the actual characters.
When 'sts' is zero, this feature is off. This setting does not affect the display of existing tab characters.
When 'sts' is negative, the value of 'shiftwidth' is used.
See also |ins-expandtab|. When 'expandtab' is not set, the number of A value of 0 disables this behaviour. A negative value makes Vim use
spaces is minimized by using <Tab>s. 'shiftwidth'. If you plan to use 'sts' and 'shiftwidth' with
The 'L' flag in 'cpoptions' changes how tabs are used when 'list' is different values, you might consider setting 'smarttab'.
set.
'softtabstop' is temporarily set to 0 when 'paste' is on and reset
when it is turned off. It is also reset when 'compatible' is set.
The 'L' flag in 'cpoptions' alters tab behavior when 'list' is
enabled. See also |ins-expandtab| ans user manual section |30.5| for
in-depth explanations.
The value of 'softtabstop' will be ignored if |'varsofttabstop'| is set The value of 'softtabstop' will be ignored if |'varsofttabstop'| is set
to anything other than an empty string. to anything other than an empty string.
@@ -9787,21 +9793,20 @@ local options = {
cb = 'did_set_varsofttabstop', cb = 'did_set_varsofttabstop',
defaults = '', defaults = '',
desc = [=[ desc = [=[
A list of the number of spaces that a <Tab> counts for while editing, Defines variable-width soft tab stops. The value is a comma-separated
such as inserting a <Tab> or using <BS>. It "feels" like variable- list of widths in columns. Each width defines the number of columns
width <Tab>s are being inserted, while in fact a mixture of spaces before the next soft tab stop. The last value repeats indefinitely.
and <Tab>s is used. Tab widths are separated with commas, with the
final value applying to all subsequent tabs.
For example, when editing assembly language files where statements For example, when editing assembly language files where statements
start in the 9th column and comments in the 41st, it may be useful start in the 9th column and comments in the 41st, it may be useful
to use the following: >vim to use the following: >vim
set varsofttabstop=8,32,8 set varsofttabstop=8,32,8
< This will set soft tabstops with 8 and 8 + 32 spaces, and 8 more < This sets soft tab stops at column 8, then at column 40 (8 + 32), and
for every column thereafter. every 8 columns thereafter.
Note that the value of |'softtabstop'| will be ignored while Note: this setting overrides 'softtabstop'.
'varsofttabstop' is set. See section |30.5| of the user manual for detailed explanations on how
Vim works with tabs and spaces.
]=], ]=],
full_name = 'varsofttabstop', full_name = 'varsofttabstop',
list = 'comma', list = 'comma',
@@ -9815,15 +9820,20 @@ local options = {
cb = 'did_set_vartabstop', cb = 'did_set_vartabstop',
defaults = '', defaults = '',
desc = [=[ desc = [=[
A list of the number of spaces that a <Tab> in the file counts for, Defines variable-width tab stops. The value is a comma-separated list
separated by commas. Each value corresponds to one tab, with the of widths in columns. Each width defines the number of columns
final value applying to all subsequent tabs. For example: >vim before the next tab stop; the last value repeats indefinitely.
set vartabstop=4,20,10,8
< This will make the first tab 4 spaces wide, the second 20 spaces,
the third 10 spaces, and all following tabs 8 spaces.
Note that the value of |'tabstop'| will be ignored while 'vartabstop' For example: >
is set. :set vartabstop=4,8
< This places the first tab stop 4 columns from the start of the line
and each subsequent tab stop 8 columns apart.
Note: this setting overrides 'tabstop'.
On UNIX, it is recommended to keep the default tabstop value of 8.
Consider setting 'varsofttabstop' instead.
See section |30.5| of the user manual for detailed explanations on how
Vim works with tabs and spaces.
]=], ]=],
full_name = 'vartabstop', full_name = 'vartabstop',
list = 'comma', list = 'comma',