Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ddc_vim/deps.ts>fn.visualmode

Dark deno-powered completion framework for neovim/Vim
Go to Latest
function fn.visualmode
import { fn } from "https://deno.land/x/ddc_vim@v4.1.0/deps.ts";
const { visualmode } = fn;

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>