Skip to main content
Module

x/denops_std/function/mod.ts>visualmode

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

The result is a String, which describes the last Visual mode used in the current buffer. Initially it returns an empty string, but once Visual mode has been used, it returns "v", "V", or "<CTRL-V>" (a single CTRL-V character) for character-wise, line-wise, or block-wise Visual mode respectively. Example:

:exe "normal " .. visualmode()

This enters the same Visual mode as before. It is also useful in scripts if you wish to act differently depending on the Visual mode that was used. If Visual mode is active, use mode() to get the Visual mode (e.g., in a :vmap). If {expr} is supplied and it evaluates to a non-zero Number or a non-empty String, then the Visual mode will be cleared and the old value is returned. See non-zero-arg.

Parameters

denops: Denops
optional
expr: unknown

Returns

Promise<string>