Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/denops_std/option/nvim/mod.ts>statuscolumn

📚 Standard module for denops.vim
Latest
variable statuscolumn
import { statuscolumn } from "https://deno.land/x/denops_std@v6.5.0/option/nvim/mod.ts";

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

NOTE: To draw the sign and fold columns, their items must be included in 'statuscolumn'. Even when they are not included, the status column width will adapt to the 'signcolumn' and 'foldcolumn' width.

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:virtnum variable is negative when drawing virtual lines, zero when drawing the actual buffer line, and positive when drawing the wrapped part of a buffer line.

NOTE: The %@ click execute function item is supported as well but the specified function will be the same for each row in the same column. It cannot be switched out through a dynamic 'statuscolumn' format, the handler should be written with this in mind.

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:virtnum>0?"":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.

(default: empty)