Skip to main content
Module

x/denops_std/function/mod.ts>screencol

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

The result is a Number, which is the current screen column of the cursor. The leftmost column has number 1. This function is mainly used for testing.

Note: Always returns the current screen column, thus if used in a command (e.g. ":echo screencol()") it will return the column inside the command line, which is 1 when the command is executed. To get the cursor position in the file use one of the following mappings:

nnoremap <expr> GG ":echom " .. screencol() .. "\n"
nnoremap <silent> GG :echom screencol()<CR>
nnoremap GG <Cmd>echom screencol()<CR>

Returns

Promise<number>