Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/denops_std/option/vim/mod.ts

๐Ÿ“š Standard module for denops.vim
Go to Latest
import * as denopsStd from "https://deno.land/x/denops_std@v5.0.1/option/vim/mod.ts";

A module to provide accessors of Vim native options.

import { Denops } from "../../mod.ts";
import * as vimOp from "../../option/vim/mod.ts";

export async function main(denops: Denops): Promise<void> {
  // vimOp has options only exist in Vim
  console.log(await vimOp.compatible.get(denops));
}

Variables

This option was for using Farsi, which has been removed. See farsi.txt.

This option only has an effect in the GUI version of Vim on macOS v10.2 or later. When on, Vim will use smooth ("antialiased") fonts, which can be easier to read at certain sizes on certain displays. Setting this option can sometimes cause problems if 'guifont' is set to its default (empty string). NOTE: This option is reset when 'compatible' is set.

When on, Vim will change the current working directory whenever you change the directory of the shell running in a terminal window. You need proper setting-up, so whenever the shell's pwd changes an OSC 7 escape sequence will be emitted. For example, on Linux, you can source /etc/profile.d/vte.sh in your shell profile if you use bash or zsh. For bash this should work (put it in a bash init file):

Delay in milliseconds before a balloon may pop up. See balloon-eval.

Switch on the balloon-eval functionality for the GUI.

Switch on the balloon-eval functionality for the terminal.

Expression for text to show in evaluation balloon. It is only used when 'ballooneval' or 'balloonevalterm' is on. These variables can be used:

This was for MS-DOS and is no longer supported.

This option has the effect of making Vim either more Vi-compatible, or make Vim behave in a more useful way.

When 'completeopt' contains "popup" then this option is used for the properties of the info popup when it is created. If an info popup window already exists it is closed, so that the option value is applied when it is created again. You can also use popup_findinfo() and then set properties for an existing info popup with popup_setoptions(). See complete-popup.

This was for MS-DOS and is no longer supported.

Method used for encryption when the buffer is written to a file:

Give messages when adding a cscope database. See cscopeverbose. NOTE: This option is reset when 'compatible' is set.

Makes the 'g' and 'c' flags of the ":substitute" command to be toggled each time the flag is given. See complex-change. See also 'gdefault' option. Switching this option on may break plugins! This option is not used in Vim9 script.

Indicates that a CTRL-Z character was found at the end of the file when reading it. Normally only happens when 'fileformat' is "dos". When writing a file and this option is off and the 'binary' option is on, or 'fixeol' option is off, no CTRL-Z will be written at the end of the file. See eol-and-eof for example settings.

Function keys that start with an <Esc> are recognized in Insert mode. When this option is off, the cursor and function keys cannot be used in Insert mode if they start with an <Esc>. The advantage of this is that the single <Esc> is recognized immediately, instead of after one second. Instead of resetting this option, you might want to try changing the values for 'timeoutlen' and 'ttimeoutlen'. Note that when 'esckeys' is off, you can still map anything, but the cursor keys won't work by default. NOTE: This option is set to the Vi default value when 'compatible' is set and to the Vim default value when 'compatible' is reset. NOTE: when this option is off then the modifyOtherKeys functionality is disabled while in Insert mode to avoid ending Insert mode with any key that has a modifier.

Enables the reading of .vimrc, .exrc and .gvimrc in the current directory.

This option was for using Farsi, which has been removed. See farsi.txt.

not available in the GTK+ GUI When not empty, specifies two (or more) fonts to be used. The first one for normal English, the second one for your special language. See xfontset.

The number of pixels subtracted from the screen height when fitting the GUI window on the screen. Set this before the GUI is started, e.g., in your gvimrc file. When zero, the whole screen height will be used by the window. When positive, the specified number of pixel lines will be left for window decorations and other items on the screen. Set it to a negative value to allow windows taller than the screen.

List of ASCII characters that, when combined together, can create more complex shapes. Each character must be a printable ASCII character with a value in the 32-127 range. Example:

Only in the GUI: If on, an attempt is made to open a pseudo-tty for I/O to/from shell commands. See gui-pty.

This option can be used to set highlighting mode for various occasions. It is a comma-separated list of character pairs. The first character in a pair gives the occasion, the second the mode to use for that occasion. The occasions are: hl-SpecialKey 8 Meta and special keys listed with ":map" hl-EndOfBuffer ~ lines after the last line in the buffer hl-NonText @ '@' at the end of the window and characters from 'showbreak' hl-Directory d directories in CTRL-D listing and other special things in listings hl-ErrorMsg e error messages h (obsolete, ignored) hl-IncSearch i 'incsearch' highlighting hl-CurSearch y current instance of last search pattern hl-Search l last search pattern highlighting (see 'hlsearch') hl-MoreMsg m more-prompt hl-ModeMsg M Mode (e.g., "-- INSERT --") hl-LineNr n line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set. hl-LineNrAbove a line number above the cursor for when the 'relativenumber' option is set. hl-LineNrBelow b line number below the cursor for when the 'relativenumber' option is set. hl-CursorLineNr N like n for when 'cursorline' or 'relativenumber' is set. hl-Question r hit-enter prompt and yes/no questions hl-StatusLine s status line of current window status-line hl-StatusLineNC S status lines of not-current windows hl-Title t Titles for output from ":set all", ":autocmd" etc. hl-VertSplit c column used to separate vertically split windows hl-Visual v Visual mode hl-VisualNOS V Visual mode when Vim does is "Not Owning the Selection" Only X11 Gui's gui-x11 and xterm-clipboard. hl-WarningMsg w warning messages hl-WildMenu W wildcard matches displayed for 'wildmenu' hl-Folded f line used for closed folds hl-FoldColumn F 'foldcolumn' hl-DiffAdd A added line in diff mode hl-DiffChange C changed line in diff mode hl-DiffDelete D deleted line in diff mode hl-DiffText T inserted text in diff mode hl-SignColumn > column used for signs hl-Conceal - the placeholders used for concealed characters (see 'conceallevel') hl-SpellBad B misspelled word spell hl-SpellCap P word that should start with capital spell hl-SpellRare R rare word spell hl-SpellLocal L word from other region spell hl-Pmenu + popup menu normal line hl-PmenuSel = popup menu selected line hl-PmenuKind [ popup menu "kind" normal line hl-PmenuKindSel ] popup menu "kind" selected line hl-PmenuExtra { popup menu "kind" normal line hl-PmenuExtraSel } popup menu "kind" selected line hl-PmenuSbar x popup menu scrollbar hl-PmenuThumb X popup menu scrollbar thumb

This option specifies a function that will be called to activate or deactivate the Input Method. The value can be the name of a function, a lambda or a Funcref. See option-value-function for more information. It is not used in the MS-Windows GUI version. The expression will be evaluated in the sandbox when set from a modeline, see sandbox-option.

only available when compiled with +xim and +GUI_GTK Specifies the key that your Input Method in X-Windows uses for activation. When this is specified correctly, vim can fully control IM with 'imcmdline', 'iminsert' and 'imsearch'. You can't use this option to change the activation key, the option tells Vim what the key is. Format: [MODIFIER_FLAG-]KEY_STRING

This option specifies a function that is called to obtain the status of Input Method. It must return a positive number when IME is active. The value can be the name of a function, a lambda or a Funcref. See option-value-function for more information. It is not used in the MS-Windows GUI version.

This option specifies the input style of Input Method: 0 use on-the-spot style 1 over-the-spot style See: xim-input-style

Makes Vim work in a way that Insert mode is the default mode. Useful if you want to use Vim as a modeless editor. Used for evim. These Insert mode commands will be useful:

  • Use the cursor keys to move around.
  • Use CTRL-O to execute one Normal mode command i_CTRL-O. When this is a mapping, it is executed as if 'insertmode' was off. Normal mode remains active until the mapping is finished.
  • Use CTRL-L to execute a number of Normal mode commands, then use <Esc> to get back to Insert mode. Note that CTRL-L moves the cursor left, like <Esc> does when 'insertmode' isn't set. i_CTRL-L

The key that is used for encrypting and decrypting the current buffer. See encryption and 'cryptmethod'. Careful: Do not set the key value by hand, someone might see the typed key. Use the :X command. But you can make 'key' empty:

Specifies what keyboard protocol to use depending on the value of 'term'. The supported keyboard protocols names are: none whatever the terminal uses mok2 modifyOtherKeys level 2, as supported by xterm kitty Kitty keyboard protocol, as supported by Kitty

This is just like 'langremap' but with the value inverted. It only exists for backwards compatibility. When setting 'langremap' then 'langnoremap' is set to the inverted value, and the other way around.

Comma-separated list of items that influence the Lisp indenting when enabled with the 'lisp' option. Currently only one item is supported: expr:1 use 'indentexpr' for Lisp indenting when it is set expr:0 do not use 'indentexpr' for Lisp indenting (default) Note that when using 'indentexpr' the = operator indents all the lines, otherwise the first line is not indented (Vi-compatible).

Specifies the name of the Lua shared library. The default is DYNAMIC_LUA_DLL, which was specified at compile time. Environment variables are expanded :set_env. This option cannot be set from a modeline or in the sandbox, for security reasons.

No longer supported, as the Mac OS X GUI code was removed.

The maximum number of combining characters supported for displaying. Only used when 'encoding' is "utf-8". The default is OK for most languages. Hebrew may require 4. Maximum value is 6. Even when this option is set to 2 you can still edit text with more combining characters, you just can't see them. Use g8 or ga. See mbyte-combining.

Maximum amount of memory (in Kbyte) to use for one buffer. When this limit is reached allocating extra memory for a buffer will cause other memory to be freed. The maximum usable value is about 2000000. Use this to work without a limit. The value is ignored when 'swapfile' is off. Also see 'maxmemtot'.

Maximum amount of memory in Kbyte to use for all buffers together. The maximum usable value is about 2000000 (2 Gbyte). Use this to work without a limit. On 64 bit machines higher values might work. But hey, do you really need more than 2 Gbyte for text editing? Keep in mind that text is stored in the swap file, one can edit files > 2 Gbyte anyway. We do need the memory to store undo info. Buffers with 'swapfile' off still count to the total amount of memory used. Also see 'maxmem'.

The number of milliseconds between polls for MzScheme threads. Negative or zero value means no thread scheduling. NOTE: This option is set to the Vim default value when 'compatible' is reset.

Specifies the name of the MzScheme shared library. The default is DYNAMIC_MZSCH_DLL which was specified at compile time. Environment variables are expanded :set_env. The value must be set in the vimrc script or earlier. In the startup, before the load-plugins step. This option cannot be set from a modeline or in the sandbox, for security reasons.

Specifies the name of the MzScheme GC shared library. The default is DYNAMIC_MZGC_DLL which was specified at compile time. The value can be equal to 'mzschemedll' if it includes the GC code. Environment variables are expanded :set_env. This option cannot be set from a modeline or in the sandbox, for security reasons.

This option was supported on RISC OS, which has been removed.

Specifies the name of the Perl shared library. The default is DYNAMIC_PERL_DLL, which was specified at compile time. Environment variables are expanded :set_env. This option cannot be set from a modeline or in the sandbox, for security reasons.

When not empty a popup window is used for commands that would open a preview window. See preview-popup. Not used for the insert completion info, add "popup" to 'completeopt' for that.

When on a ":" prompt is used in Ex mode.

Specifies the name of the Python 2.x shared library. The default is DYNAMIC_PYTHON_DLL, which was specified at compile time. Environment variables are expanded :set_env. This option cannot be set from a modeline or in the sandbox, for security reasons.

Specifies the name of the Python 2.x home directory. When 'pythonhome' and the PYTHONHOME environment variable are not set, PYTHON_HOME, which was specified at compile time, will be used for the Python 2.x home directory. Environment variables are expanded :set_env. This option cannot be set from a modeline or in the sandbox, for security reasons.

Specifies the name of the Python 3 shared library. The default is DYNAMIC_PYTHON3_DLL, which was specified at compile time. Environment variables are expanded :set_env. This option cannot be set from a modeline or in the sandbox, for security reasons.

Specifies the name of the Python 3 home directory. When 'pythonthreehome' and the PYTHONHOME environment variable are not set, PYTHON3_HOME, which was specified at compile time, will be used for the Python 3 home directory. Environment variables are expanded :set_env. This option cannot be set from a modeline or in the sandbox, for security reasons.

Allows for mappings to work recursively. If you do not want this for a single entry, use the :noremap[!] command. NOTE: To avoid portability problems with Vim scripts, always keep this option at the default "on". Only switch it off when working with old Vi scripts.

Select a text renderer and set its options. The options depend on the renderer.

When set, the screen contents is restored when exiting Vim. This also happens when executing external commands.

Specifies the name of the Ruby shared library. The default is DYNAMIC_RUBY_DLL, which was specified at compile time. Environment variables are expanded :set_env. This option cannot be set from a modeline or in the sandbox, for security reasons.

When using the scroll wheel and this option is set, the window under the mouse pointer is scrolled. With this option off the current window is scrolled. Systems other than MS-Windows always behave like this option is on.

On the Amiga this option influences the way how the commands work which use a shell. 0 and 1: always use the shell 2 and 3: use the shell only to filter lines 4 and 5: use shell only for ':sh' command When not using the shell, the command is executed directly.

Filenames are assumed to be 8 characters plus one extension of 3 characters. Multiple dots in file names are not allowed. When this option is on, dots in file names are replaced with underscores when adding an extension (".~" or ".swp"). This option is useful when editing files on an MS-DOS compatible filesystem, e.g., messydos or crossdos.

This option can be used to display the (partially) entered command in another location. Possible values are: last Last line of the screen (default). statusline Status line of the current window. tabline First line of the screen if 'showtabline' is enabled. Setting this option to "statusline" or "tabline" means that these will be redrawn whenever the command changes, which can be on every key pressed. The %S 'statusline' item can be used in 'statusline' or 'tabline' to place the text. Without a custom 'statusline' or 'tabline' it will be displayed in a convenient location.

Scrolling works with screen lines. When 'wrap' is set and the first line in the window wraps part of it may not be visible, as if it is above the window. "<<<" is displayed at the start of the first line, highlighted with hl-NonText. NOTE: only partly implemented, currently works with CTRL-E, CTRL-Y and scrolling with the mouse.

The value of this option determines the scroll behavior when opening, closing or resizing horizontal splits.

When this option is not empty a swap file is synced to disk after writing to it. This takes some time, especially on busy unix systems. When this option is empty parts of the swap file may be in memory and not written to disk. When the system crashes you may lose more work. On Unix the system does a sync now and then without Vim asking for it, so the disadvantage of setting this option off is small. On some systems the swap file will not be written at all. For a unix system setting it to "sync" will use the sync() call instead of the default fsync(), which may work better on some systems. The 'fsync' option is used for the actual file.

Specifies the name of the Tcl shared library. The default is DYNAMIC_TCL_DLL, which was specified at compile time. Environment variables are expanded :set_env. This option cannot be set from a modeline or in the sandbox, for security reasons.

Name of the terminal. Used for choosing the terminal control characters. Environment variables are expanded :set_env. For example:

Encoding used for the terminal. This specifies what character encoding the keyboard produces and the display will understand. For the GUI it only applies to the keyboard ('encoding' is used for the display).

The key that starts a CTRL-W command in a terminal window. Other keys are sent to the job running in the window. The <> notation can be used, e.g.:

Number of scrollback lines to keep. When going over this limit the first 10% of the scrollback lines are deleted. This is just to reduce the memory usage. See Terminal-Normal. Also used as a limit for text sent to the terminal in one write, multiplied by the number of columns times 3 (average number of bytes per cell).

Size used when opening the terminal window. Format: {rows}x{columns} or {rows}*{columns}.

  • When empty the terminal gets the size from the window.
  • When set with a "x" (e.g., "24x80") the terminal size is not adjusted to the window size. If the window is smaller only the top-left part is displayed.
  • When set with a "" (e.g., "1050") the terminal size follows the window size, but will not be smaller than the specified rows and/or columns.
  • When rows is zero then use the height of the window.
  • When columns is zero then use the width of the window.
  • Using "0x0" or "0*0" is the same as empty.
  • Can be overruled in the term_start() options with "term_rows" and "term_cols".

Specify the virtual console (pty) used when opening the terminal window.

When set: Add 's' flag to 'shortmess' option (this makes the message for a search that hits the start or end of the file not being displayed). When reset: Remove 's' flag from 'shortmess' option. Vi shortens a lot of messages

This option is obsolete. Use 'fileformats'. For backwards compatibility, when 'textauto' is set, 'fileformats' is set to the default value for the current system. When 'textauto' is reset, 'fileformats' is made empty. NOTE: This option is set to the Vi default value when 'compatible' is set and to the Vim default value when 'compatible' is reset.

This option is obsolete. Use 'fileformat'. For backwards compatibility, when 'textmode' is set, 'fileformat' is set to "dos". When 'textmode' is reset, 'fileformat' is set to "unix".

The contents of this option controls various toolbar settings. The possible values are: icons Toolbar buttons are shown with icons. text Toolbar buttons shown with text. horiz Icon and text of a toolbar button are horizontally arranged. only in GTK+ 2 GUI tooltips Tooltips are active for toolbar buttons. Tooltips refer to the popup help text which appears after the mouse cursor is placed over a toolbar button for a brief moment.

Controls the size of toolbar icons. The possible values are: tiny Use tiny icons. small Use small icons (default). medium Use medium-sized icons. large Use large icons. huge Use even larger icons. giant Use very big icons. The exact dimensions in pixels of the various icon sizes depend on the current theme. Common dimensions are giant=48x48, huge=32x32, large=24x24, medium=24x24, small=20x20 and tiny=16x16.

When on, the builtin termcaps are searched before the external ones. When off the builtin termcaps are searched after the external ones. When this option is changed, you should set the 'term' option next for the change to take effect, for example:

Indicates a fast terminal connection. More characters will be sent to the screen for redrawing, instead of using insert/delete line commands. Improves smoothness of redrawing when there are multiple windows and the terminal does not support a scrolling region. Also enables the extra writing of characters at the end of each screen line for lines that wrap. This helps when using copy/paste with the mouse in an xterm and other terminals.

Name of the terminal type for which mouse codes are to be recognized. Currently these strings are valid:

Maximum number of lines to scroll the screen. If there are more lines to scroll the window is redrawn. For terminals where scrolling is very slow and redrawing is not slow this can be set to a small number, e.g., 3, to speed up displaying.

Alias for 'term', see above.

When non-empty, the viminfo file is read upon startup and written when exiting Vim (see viminfo-file). Except when 'viminfofile' is "NONE". The string should be a comma-separated list of parameters, each consisting of a single character identifying the particular parameter, followed by a number or string which specifies the value of that parameter. If a particular character is left out, then the default value is used for that parameter. The following is a list of the identifying characters and the effect of their value. CHAR VALUE

When non-empty, overrides the file name used for viminfo. When equal to "NONE" no viminfo file will be read or written. This option can be set with the -i command line flag. The --clean command line flag sets it to "NONE". This option cannot be set from a modeline or in the sandbox, for security reasons.

This option has the same effect as the 't_xs' terminal option. It is provided for backwards compatibility with version 4.x. Setting 'weirdinvert' has the effect of making 't_xs' non-empty, and vice versa. Has no effect when the GUI is running.

Highlight group name to use for this window instead of the Normal color hl-Normal.

Specifies the name of the winpty shared library, used for the :terminal command. The default depends on whether Vim was built as a 32-bit or 64-bit executable. If not found, "winpty.dll" is tried as a fallback. Environment variables are expanded :set_env. This option cannot be set from a modeline or in the sandbox, for security reasons.

When detecting xterm patchlevel 141 or higher with the termresponse mechanism and this option is set, Vim will request the actual terminal key codes and number of colors from the terminal. This takes care of various configuration options of the terminal that cannot be obtained from the termlib/terminfo entry, see xterm-codes. A side effect may be that t_Co changes and Vim will redraw the display.