Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/denops_std/option/vim/mod.ts>compatible

📚 Standard module for denops.vim
Go to Latest
variable compatible
import { compatible } from "https://deno.land/x/denops_std@v5.0.2/option/vim/mod.ts";

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

This is a special kind of option, because when it's set or reset, other options are also changed as a side effect. NOTE: Setting or resetting this option can have a lot of unexpected effects: Mappings are interpreted in another way, undo behaves differently, etc. If you set this option in your vimrc file, you should probably put it at the very start.

By default this option is on and the Vi defaults are used for the options. This default was chosen for those people who want to use Vim just like Vi, and don't even (want to) know about the 'compatible' option. When a vimrc or gvimrc file is found while Vim is starting up, this option is switched off, and all options that have not been modified will be set to the Vim defaults. Effectively, this means that when a vimrc or gvimrc file exists, Vim will use the Vim defaults, otherwise it will use the Vi defaults. (Note: This doesn't happen for the system-wide vimrc or gvimrc file, nor for a file given with the -u argument). Also see compatible-default and posix-compliance. You can also set this option with the "-C" argument, and reset it with "-N". See -C and -N. See 'cpoptions' for more fine tuning of Vi compatibility.

When this option is set, numerous other options are set to make Vim as Vi-compatible as possible. When this option is unset, various options are set to make Vim more useful. The table below lists all the options affected. The {?} column indicates when the options are affected:

  • Means that the option is set to the value given in {set value} when 'compatible' is set. & Means that the option is set to the value given in {set value} when 'compatible' is set AND is set to its Vim default value when 'compatible' is unset.
  • Means the option is NOT changed when setting 'compatible' but IS set to its Vim default when 'compatible' is unset. The {effect} column summarises the change when 'compatible' is set.

option ? set value effect

'allowrevins' + off no CTRL-_ command 'antialias' + off don't use antialiased fonts 'arabic' + off reset arabic-related options 'arabicshape' + on correct character shapes 'backspace' + "" normal backspace 'backup' + off no backup file 'backupcopy' & Unix: "yes" backup file is a copy else: "auto" copy or rename backup file 'balloonexpr' + "" text to show in evaluation balloon 'breakindent' + off don't indent when wrapping lines 'cedit' - {unchanged} {set vim default only on resetting 'cp'} 'cdhome' + off ":cd" don't chdir to home on non-Unix 'cindent' + off no C code indentation 'compatible' - {unchanged} {set vim default only on resetting 'cp'} 'copyindent' + off don't copy indent structure 'cpoptions' & (all flags) Vi-compatible flags 'cscopepathcomp'+ 0 don't show directories in tags list 'cscoperelative'+ off don't use basename of path as prefix 'cscopetag' + off don't use cscope for ":tag" 'cscopetagorder'+ 0 see cscopetagorder 'cscopeverbose' + off see cscopeverbose 'delcombine' + off unicode: delete whole char combination 'digraph' + off no digraphs 'esckeys' & off no -keys in Insert mode 'expandtab' + off tabs not expanded to spaces 'fileformats' & "" no automatic file format detection, "dos,unix" except for MS-Windows 'formatexpr' + "" use 'formatprg' for auto-formatting 'formatoptions' & "vt" Vi compatible formatting 'gdefault' + off no default 'g' flag for ":s" 'history' & 0 no commandline history 'hkmap' + off no Hebrew keyboard mapping 'hkmapp' + off no phonetic Hebrew keyboard mapping 'hlsearch' + off no highlighting of search matches 'incsearch' + off no incremental searching 'indentexpr' + "" no indenting by expression 'insertmode' + off do not start in Insert mode 'iskeyword' & "@,48-57," keywords contain alphanumeric characters and '' 'joinspaces' + on insert 2 spaces after period 'modeline' & off no modelines 'more' & off no pauses in listings 'mzquantum' - {unchanged} {set vim default only on resetting 'cp'} 'numberwidth' & 8 min number of columns for line number 'preserveindent'+ off don't preserve current indent structure when changing it 'revins' + off no reverse insert 'ruler' + off no ruler 'scrolljump' + 1 no jump scroll 'scrolloff' + 0 no scroll offset 'shelltemp' - {unchanged} {set vim default only on resetting 'cp'} 'shiftround' + off indent not rounded to shiftwidth 'shortmess' & "S" no shortening of messages 'showcmd' & off command characters not shown 'showmode' & off current mode not shown 'sidescrolloff' + 0 cursor moves to edge of screen in scroll 'smartcase' + off no automatic ignore case switch 'smartindent' + off no smart indentation 'smarttab' + off no smart tab size 'softtabstop' + 0 tabs are always 'tabstop' positions 'startofline' + on goto startofline with some commands 'tagcase' & "followic" 'ignorecase' when searching tags file 'tagrelative' & off tag file names are not relative 'termguicolors' + off don't use highlight-(guifg|guibg) 'textauto' & off no automatic textmode detection 'textwidth' + 0 no automatic line wrap 'tildeop' + off tilde is not an operator 'ttimeout' + off no terminal timeout 'undofile' + off don't use an undo file 'viminfo' - {unchanged} {set Vim default only on resetting 'cp'} 'virtualedit' + "" cursor can only be placed on characters 'whichwrap' & "" left-right movements don't wrap 'wildchar' & CTRL-E only when the current value is <Tab> use CTRL-E for cmdline completion 'writebackup' + on or off depends on the +writebackup feature

(default on, off when a vimrc or gvimrc file is found, reset in defaults.vim)