aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-03-28 13:40:34 -0400
committerGitHub <noreply@github.com>2021-03-28 13:40:34 -0400
commit63c2a7af2da3998167c7b1b06fb461b20b144c78 (patch)
tree77aa1b22e65a65c62fa4a062bb88945e02f5d5ca /runtime
parent6d4a922e07e857b46d882ea96decce7c7c6e2a30 (diff)
parenta70d904ad0e2037c7fb2ae10a20f840af3544496 (diff)
downloadrneovim-63c2a7af2da3998167c7b1b06fb461b20b144c78.tar.gz
rneovim-63c2a7af2da3998167c7b1b06fb461b20b144c78.tar.bz2
rneovim-63c2a7af2da3998167c7b1b06fb461b20b144c78.zip
Merge pull request #13851 from VVKot/vim-8.1.0105
vim-patch:8.1.{0105,0114,0116,0126,0138,0154,0479,0542,0936}
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/change.txt10
-rw-r--r--runtime/doc/eval.txt10
-rw-r--r--runtime/doc/options.txt38
-rw-r--r--runtime/optwin.vim8
4 files changed, 63 insertions, 3 deletions
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index f3ed086933..310d244fbc 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -445,6 +445,9 @@ SHIFTING LINES LEFT OR RIGHT *shift-left-right*
*<*
<{motion} Shift {motion} lines one 'shiftwidth' leftwards.
+ If the 'shiftwidth' option is set to zero, the amount
+ of indent is calculated at the first non-blank
+ character in the line.
*<<*
<< Shift [count] lines one 'shiftwidth' leftwards.
@@ -455,6 +458,9 @@ SHIFTING LINES LEFT OR RIGHT *shift-left-right*
*>*
>{motion} Shift {motion} lines one 'shiftwidth' rightwards.
+ If the 'shiftwidth' option is set to zero, the amount
+ of indent is calculated at the first non-blank
+ character in the line.
*>>*
>> Shift [count] lines one 'shiftwidth' rightwards.
@@ -934,6 +940,10 @@ This replaces each 'E' character with a euro sign. Read more in |<Char->|.
this (that's a good habit anyway).
`:retab!` may also change a sequence of spaces by
<Tab> characters, which can mess up a printf().
+ A list of tab widths separated by commas may be used
+ in place of a single tabstop. Each value in the list
+ represents the width of one tabstop, except the final
+ value which applies to all following tabstops.
*retab-example*
Example for using autocommands and ":retab" to edit a file which is stored
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 112958f78b..2911224de5 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2308,7 +2308,6 @@ perleval({expr}) any evaluate |perl| expression
pow({x}, {y}) Float {x} to the power of {y}
prevnonblank({lnum}) Number line nr of non-blank line <= {lnum}
printf({fmt}, {expr1}...) String format text
-prompt_addtext({buf}, {expr}) none add text to a prompt buffer
prompt_setcallback({buf}, {expr}) none set prompt callback function
prompt_setinterrupt({buf}, {text}) none set prompt interrupt function
prompt_setprompt({buf}, {text}) none set prompt text
@@ -2393,7 +2392,7 @@ sha256({string}) String SHA256 checksum of {string}
shellescape({string} [, {special}])
String escape {string} for use as shell
command argument
-shiftwidth() Number effective value of 'shiftwidth'
+shiftwidth([{col}]) Number effective value of 'shiftwidth'
sign_define({name} [, {dict}]) Number define or update a sign
sign_getdefined([{name}]) List get a list of defined signs
sign_getplaced([{expr} [, {dict}]])
@@ -7899,7 +7898,7 @@ shellescape({string} [, {special}]) *shellescape()*
< See also |::S|.
-shiftwidth() *shiftwidth()*
+shiftwidth([{col}]) *shiftwidth()*
Returns the effective value of 'shiftwidth'. This is the
'shiftwidth' value unless it is zero, in which case it is the
'tabstop' value. To be backwards compatible in indent
@@ -7915,6 +7914,11 @@ shiftwidth() *shiftwidth()*
endif
< And then use s:sw() instead of &sw.
+ When there is one argument {col} this is used as column number
+ for which to return the 'shiftwidth' value. This matters for the
+ 'vartabstop' feature. If no {col} argument is given, column 1
+ will be assumed.
+
sign_define({name} [, {dict}]) *sign_define()*
Define a new sign named {name} or modify the attributes of an
existing sign. This is similar to the |:sign-define| command.
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index c4d5df84cf..decf226b12 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -5621,6 +5621,9 @@ A jump table for the options with a short description can be found at |Q_op|.
The 'L' flag in 'cpoptions' changes how tabs are used when 'list' is
set.
+ The value of 'softtabstop' will be ignored if |'varsofttabstop'| is set
+ to anything other than an empty string.
+
*'spell'* *'nospell'*
'spell' boolean (default off)
local to window
@@ -6158,6 +6161,9 @@ A jump table for the options with a short description can be found at |Q_op|.
though. Otherwise aligned comments will be wrong when 'tabstop' is
changed.
+ The value of 'tabstop' will be ignored if |'vartabstop'| is set to
+ anything other than an empty string.
+
*'tagbsearch'* *'tbs'* *'notagbsearch'* *'notbs'*
'tagbsearch' 'tbs' boolean (default on)
global
@@ -6542,6 +6548,38 @@ A jump table for the options with a short description can be found at |Q_op|.
written to disk (see |crash-recovery|). Also used for the
|CursorHold| autocommand event.
+ *'varsofttabstop'* *'vsts'*
+'varsofttabstop' 'vsts' string (default "")
+ local to buffer
+ A list of the number of spaces that a <Tab> counts for while editing,
+ such as inserting a <Tab> or using <BS>. It "feels" like variable-
+ width <Tab>s are being inserted, while in fact a mixture of spaces
+ 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
+ start in the 8th column and comments in the 40th, it may be useful
+ to use the following: >
+ :set varsofttabstop=8,32,8
+< This will set soft tabstops at the 8th and 40th columns, and at every
+ 8th column thereafter.
+
+ Note that the value of |'softtabstop'| will be ignored while
+ 'varsofttabstop' is set.
+
+ *'vartabstop'* *'vts'*
+'vartabstop' 'vts' string (default "")
+ local to buffer
+ A list of the number of spaces that a <Tab> in the file counts for,
+ separated by commas. Each value corresponds to one tab, with the
+ final value applying to all subsequent tabs. For example: >
+ :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'
+ is set.
+
*'verbose'* *'vbs'*
'verbose' 'vbs' number (default 0)
global
diff --git a/runtime/optwin.vim b/runtime/optwin.vim
index 6b3328a5d4..60dc6fdd31 100644
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -810,6 +810,14 @@ call <SID>OptionL("ts")
call append("$", "shiftwidth\tnumber of spaces used for each step of (auto)indent")
call append("$", "\t(local to buffer)")
call <SID>OptionL("sw")
+if has("vartabs")
+ call append("$", "vartabstop\tlist of number of spaces a tab counts for")
+ call append("$", "\t(local to buffer)")
+ call <SID>OptionL("vts")
+ call append("$", "varsofttabstop\tlist of number of spaces a soft tabsstop counts for")
+ call append("$", "\t(local to buffer)")
+ call <SID>OptionL("vsts")
+endif
call append("$", "smarttab\ta <Tab> in an indent inserts 'shiftwidth' spaces")
call <SID>BinOptionG("sta", &sta)
call append("$", "softtabstop\tif non-zero, number of spaces to insert for a <Tab>")