Skip to main content
Module

x/denops_std/function/mod.ts>winwidth

📚 Standard module for denops.vim
Go to Latest
function winwidth
import { winwidth } from "https://deno.land/x/denops_std@v4.1.4/function/mod.ts";

The result is a Number, which is the width of window {nr}. {nr} can be the window number or the |window-ID|. When {nr} is zero, the width of the current window is returned. When window {nr} doesn't exist, -1 is returned. An existing window always has a width of zero or more. Examples: :echo "The current window has " .. winwidth(0) .. " columns." :if winwidth(0) <= 50 : 50 wincmd | :endif For getting the terminal or screen size, see the 'columns' option. Can also be used as a |method|: GetWinid()->winwidth()

Parameters

denops: Denops
nr: unknown

Returns

Promise<unknown>