Skip to main content
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@v6.4.0/option/vim/mod.ts";

A module to provide accessors of Vim native options.

import type { Denops } from "https://deno.land/x/denops_std@v6.4.0/mod.ts";
import * as vimOp from "https://deno.land/x/denops_std@v6.4.0/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

The ASCII code for the first letter of the Hebrew alphabet. The routine that maps the keyboard in Hebrew mode, both in Insert mode (when hkmap is set) and on the command-line (when hitting CTRL-_) outputs the Hebrew characters in the range [aleph..aleph+26]. aleph=128 applies to PC code, and aleph=224 applies to ISO 8859-8. See rileft.txt.

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:

Determines how many components of the path to show in a list of tags. See cscopepathcomp. NOTE: This option is set to 0 when 'compatible' is set.

Specifies the command to execute cscope. See cscopeprg. This option cannot be set from a modeline or in the sandbox, for security reasons.

Specifies whether to use quickfix window to show cscope results. See cscopequickfix.

In the absence of a prefix (-P) for cscope. setting this option enables to use the basename of cscope.out path as the prefix. See cscoperelative. NOTE: This option is reset when 'compatible' is set.

Use cscope for tag commands. See cscope-options. NOTE: This option is reset when 'compatible' is set.

Determines the order in which ":cstag" performs a search. See cscopetagorder. NOTE: This option is set to 0 when 'compatible' is set.

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.

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 and xterm-bracketed-paste functionality is disabled while in Insert mode to avoid ending Insert mode with any key that has a modifier.

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 "extra" normal line hl-PmenuExtraSel } popup menu "extra" selected line hl-PmenuSbar x popup menu scrollbar hl-PmenuThumb X popup menu scrollbar thumb

When on, the keyboard is mapped for the Hebrew character set. Normally you would set 'allowrevins' and use CTRL-_ in insert mode to toggle this option. See rileft.txt. NOTE: This option is reset when 'compatible' is set.

When on, phonetic keyboard mapping is used. 'hkmap' must also be on. This is useful if you have a non-Hebrew keyboard. See rileft.txt. NOTE: This option is reset when 'compatible' is set.

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.

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.

Put Vim in Paste mode. This is useful if you want to cut or copy some text from one window and paste it in Vim. This will avoid unexpected effects. Setting this option is useful when using Vim in a terminal, where Vim cannot distinguish between typed text and pasted text. In the GUI, Vim knows about pasting and will mostly do the right thing without 'paste' being set. The same is true for a terminal where Vim handles the mouse clicks itself. This option is reset when starting the GUI. Thus if you set it in your .vimrc it will work in a terminal, but not in the GUI. Setting 'paste' in the GUI has side effects: e.g., the Paste toolbar button will no longer work in Insert mode, because it uses a mapping. When the 'paste' option is switched on (also when it was already on): - mapping in Insert mode and Command-line mode is disabled - abbreviations are disabled - 'autoindent' is reset - 'expandtab' is reset - 'hkmap' is reset - 'revins' is reset - 'ruler' is reset - 'showmatch' is reset - 'smarttab' is reset - 'softtabstop' is set to 0 - 'textwidth' is set to 0 - 'wrapmargin' is set to 0 - 'varsofttabstop' is made empty These options keep their value, but their effect is disabled: - 'cindent' - 'formatoptions' is used like it is empty - 'indentexpr' - 'lisp' - 'smartindent' NOTE: When you start editing another file while the 'paste' option is on, settings from the modelines or autocommands may change the settings again, causing trouble when pasting text. You might want to set the 'paste' option again. When the 'paste' option is reset the mentioned options are restored to the value before the moment 'paste' was switched from off to on. Resetting 'paste' before ever setting it does not have any effect. Since mapping doesn't work while 'paste' is active, you need to use the 'pastetoggle' option to toggle the 'paste' option with some key.

When non-empty, specifies the key sequence that toggles the 'paste' option. This is like specifying a mapping:

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.

The name of the printer to be used for :hardcopy. See pdev-option. This option cannot be set from a modeline or in the sandbox, for security reasons.

Sets the character encoding used when printing. See penc-option.

Expression used to print the PostScript produced with :hardcopy. See pexpr-option. This option cannot be set from a modeline or in the sandbox, for security reasons.

The name of the font that will be used for :hardcopy. See pfn-option.

The format of the header produced in :hardcopy output. See pheader-option.

The CJK character set to be used for CJK output from :hardcopy. See pmbcs-option.

List of font names to be used for CJK output from :hardcopy. See pmbfn-option.

List of items that control the format of the output of :hardcopy. See popt-option.

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.

When on, ":autocmd", shell and write commands are not allowed in ".vimrc" and ".exrc" in the current directory and map commands are displayed. Switch it off only if you know that you will not run into problems, or when the 'exrc' option is off. On Unix this option is only used if the ".vimrc" or ".exrc" is not owned by you. This can be dangerous if the systems allows users to do a "chown". You better set 'secure' at the end of your ~/.vimrc then. This option cannot be set from a modeline or in the sandbox, for security reasons.

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.

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. You may also want to add "lastline" to the 'display' option to show as much of the last line as possible. NOTE: only partly implemented, currently works with CTRL-E, CTRL-Y and scrolling with the mouse.

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.