aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/eval.txt17
-rw-r--r--runtime/doc/news.txt5
-rw-r--r--runtime/doc/options.txt46
-rw-r--r--runtime/doc/quickref.txt1
-rw-r--r--runtime/optwin.vim3
5 files changed, 68 insertions, 4 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 151036529d..6feb5cbb49 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2001,10 +2001,10 @@ v:lc_time The current locale setting for time messages of the runtime
command. See |multi-lang|.
*v:lnum* *lnum-variable*
-v:lnum Line number for the 'foldexpr' |fold-expr|, 'formatexpr' and
- 'indentexpr' expressions, tab page number for 'guitablabel'
- and 'guitabtooltip'. Only valid while one of these
- expressions is being evaluated. Read-only when in the
+v:lnum Line number for the 'foldexpr' |fold-expr|, 'formatexpr',
+ 'indentexpr' and 'statuscolumn' expressions, tab page number
+ for 'guitablabel' and 'guitabtooltip'. Only valid while one of
+ these expressions is being evaluated. Read-only when in the
|sandbox|.
*v:lua* *lua-variable*
@@ -2138,6 +2138,10 @@ v:register The name of the register in effect for the current normal mode
'*' or '+'.
Also see |getreg()| and |setreg()|
+ *v:relnum* *relnum-variable*
+v:relnum Relative line number for the 'statuscolumn' expression.
+ Read-only.
+
*v:scrollstart* *scrollstart-variable*
v:scrollstart String describing the script or function that caused the
screen to scroll up. It's only set when it is empty, thus the
@@ -2295,6 +2299,11 @@ v:version Vim version number: major version times 100 plus minor
v:vim_did_enter 0 during startup, 1 just before |VimEnter|.
Read-only.
+ *v:wrap* *wrap-variable*
+v:wrap Boolean indicating whether 'statuscolumn' is being evaluated
+ for the wrapped part of a line.
+ Read-only.
+
*v:warningmsg* *warningmsg-variable*
v:warningmsg Last given warning message.
Modifiable (can be set).
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 33ac9ddd20..88bad1b7df 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -118,6 +118,11 @@ The following new APIs or features were added.
• |'splitkeep'| option to control the scroll behavior of horizontal splits.
+• |'statuscolumn'| option to customize the area to the side of a window,
+ normally containing the fold, sign and number columns. This new option follows
+ the 'statusline' syntax and can be used to transform the line numbers, create
+ mouse click callbacks for |signs|, introduce a custom margin or separator etc.
+
• |nvim_select_popupmenu_item()| now supports |cmdline-completion| popup menu.
• |'diffopt'| now includes a `linematch` option to enable a second-stage diff
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index ee6c14e73f..aa2f528d1b 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -6001,6 +6001,52 @@ A jump table for the options with a short description can be found at |Q_op|.
In case of buffer changing commands the cursor is placed at the column
where it was the last time the buffer was edited.
+ *'statuscolumn'* *'stc'*
+'statuscolumn' 'stc' string (default: empty)
+ local to window
+ EXPERIMENTAL
+ When non-empty, this option determines the content of the area to the
+ side of a window, normally containing the fold, sign and number columns.
+ The format of this option is like that of 'statusline'.
+
+ Some of the items from the 'statusline' format are different for
+ 'statuscolumn':
+
+ %l line number of currently drawn line
+ %r relative line number of currently drawn line
+ %s sign column for currently drawn line
+ %C fold column for currently drawn line
+
+ To draw the sign and fold columns, they must be included in
+ 'statuscolumn'.
+
+ The |v:lnum| variable holds the line number to be drawn.
+ The |v:relnum| variable holds the relative line number to be drawn.
+ The |v:wrap| variable holds true for the wrapped part of a line.
+
+ Examples: >vim
+ " Relative number with bar separator and click handlers:
+ :set statuscolumn=%@SignCb@%s%=%T%@NumCb@%r│%T
+
+ " Right aligned relative cursor line number:
+ :let &stc='%=%{v:relnum?v:relnum:v:lnum} '
+
+ " Line numbers in hexadecimal for non wrapped part of lines:
+ :let &stc='%=%{v:wrap?"":printf("%x",v:lnum)} '
+
+ " Human readable line numbers with thousands separator:
+ :let &stc='%{substitute(v:lnum,"\\d\\zs\\ze\\'
+ . '%(\\d\\d\\d\\)\\+$",",","g")}'
+
+ " Both relative and absolute line numbers with different
+ " highlighting for odd and even relative numbers:
+ :let &stc='%#NonText#%{&nu?v:lnum:""}' .
+ '%=%{&rnu&&(v:lnum%2)?"\ ".v:relnum:""}' .
+ '%#LineNr#%{&rnu&&!(v:lnum%2)?"\ ".v:relnum:""}'
+
+< WARNING: this expression is evaluated for each screen line so defining
+ an expensive expression can negatively affect render performance.
+
*'statusline'* *'stl'* *E540* *E542*
'statusline' 'stl' string (default empty)
global or local to window |global-local|
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index d0088f5b9b..d17df3cd61 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -883,6 +883,7 @@ Short explanation of each option: *option-list*
'splitkeep' 'spk' determines scroll behavior for split windows
'splitright' 'spr' new window is put right of the current one
'startofline' 'sol' commands move cursor to first non-blank in line
+'statuscolumn' 'stc' custom format for the status column
'statusline' 'stl' custom format for the status line
'suffixes' 'su' suffixes that are ignored with multiple match
'suffixesadd' 'sua' suffixes added when searching for a file
diff --git a/runtime/optwin.vim b/runtime/optwin.vim
index b29b60e145..200254321e 100644
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -452,6 +452,9 @@ call <SID>Header(gettext("multiple windows"))
call <SID>AddOption("laststatus", gettext("0, 1, 2 or 3; when to use a status line for the last window"))
call append("$", " \tset ls=" . &ls)
if has("statusline")
+ call <SID>AddOption("statuscolumn", gettext("custom format for the status column"))
+ call append("$", "\t" .. s:local_to_window)
+ call <SID>OptionG("stc", &stc)
call <SID>AddOption("statusline", gettext("alternate format to be used for a status line"))
call <SID>OptionG("stl", &stl)
endif