/* vi:set ts=8 sts=4 sw=4 noet:
*
* VIM - Vi IMproved by Bram Moolenaar
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
*/
/*
* option.h: definition of global variables for settable options
*/
#ifndef _OPTION_H_
#define _OPTION_H_
//
// Option Flags
//
#define P_BOOL 0x01 // the option is boolean
#define P_NUM 0x02 // the option is numeric
#define P_STRING 0x04 // the option is a string
#define P_ALLOCED 0x08 // the string option is in allocated memory,
// must use free_string_option() when
// assigning new value. Not set if default is
// the same.
#define P_EXPAND 0x10 // environment expansion. NOTE: P_EXPAND can
// never be used for local or hidden options!
#define P_NO_CMD_EXPAND 0x20 // don't perform cmdline completions
#define P_NODEFAULT 0x40 // don't set to default value
#define P_DEF_ALLOCED 0x80 // default value is in allocated memory, must
// use vim_free() when assigning new value
#define P_WAS_SET 0x100 // option has been set/reset
#define P_NO_MKRC 0x200 // don't include in :mkvimrc output
#define P_VI_DEF 0x400 // Use Vi default for Vim
#define P_VIM 0x800 // Vim option, reset when 'cp' set
// when option changed, what to display:
#define P_RSTAT 0x1000 // redraw status lines
#define P_RWIN 0x2000 // redraw current window and recompute text
#define P_RBUF 0x4000 // redraw current buffer and recompute text
#define P_RALL 0x6000 // redraw all windows and recompute text
#define P_RCLR 0x7000 // clear and redraw all and recompute text
#define P_COMMA 0x8000 // comma separated list
#define P_ONECOMMA 0x18000L // P_COMMA and cannot have two consecutive
// commas
#define P_NODUP 0x20000L // don't allow duplicate strings
#define P_FLAGLIST 0x40000L // list of single-char flags
#define P_SECURE 0x80000L // cannot change in modeline or secure mode
#define P_GETTEXT 0x100000L // expand default value with _()
#define P_NOGLOB 0x200000L // do not use local value for global vimrc
#define P_NFNAME 0x400000L // only normal file name chars allowed
#define P_INSECURE 0x800000L // option was set from a modeline
#define P_PRI_MKRC 0x1000000L // priority for :mkvimrc (setting option has
// side effects)
#define P_NO_ML 0x2000000L // not allowed in modeline
#define P_CURSWANT 0x4000000L // update curswant required; not needed when
// there is a redraw flag
#define P_NDNAME 0x8000000L // only normal dir name chars allowed
#define P_HLONLY 0x10000000L // option only changes highlight, not text
#define P_MLE 0x20000000L // under control of 'modelineexpr'
#define P_FUNC 0x40000000L // accept a function reference or a lambda
#define P_COLON 0x80000000L // values use colons to create sublists
// Warning: Currently we have used all 32 bits for option flags. On some 32-bit
// systems, the flags are stored as a 32-bit integer, and adding more
// flags will overflow it. Adding another flag will need to change how
// it's stored first.
// Returned by get_option_value().
typedef enum {
gov_unknown,
gov_bool,
gov_number,
gov_string,
gov_hidden_bool,
gov_hidden_number,
gov_hidden_string
} getoption_T;
/*
* Default values for 'errorformat'.
* The "%f|%l| %m" one is used for when the contents of the quickfix window is
* written to a file.
*/
#ifdef AMIGA
# define DFLT_EFM "%f>%l:%c:%t:%n:%m,%f:%l: %t%*\\D%n: %m,%f %l %t%*\\D%n: %m,%*[^\"]\"%f\"%*\\D%l: %m,%f:%l:%m,%f|%l| %m"
#else
# if defined(MSWIN)
# define DFLT_EFM "%f(%l): %t%*\\D%n: %m,%f(%l\\,%c): %t%*\\D%n: %m,%f(%l) \\=: %t%*\\D%n: %m,%*[^\"]\"%f\"%*\\D%l: %m,%f(%l) \\=: %m,%*[^ ] %f %l: %m,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,%f|%l| %m"
# else
# if defined(__QNX__)
# define DFLT_EFM "%f(%l):%*[^WE]%t%*\\D%n:%m,%f|%l| %m"
# else
# ifdef VMS
# define DFLT_EFM "%A%p^,%C%%CC-%t-%m,%Cat line number %l in file %f,%f|%l| %m"
# else // Unix, probably
#define DFLT_EFM "%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%-Gg%\\?make[%*\\d]: *** [%f:%l:%m,%-Gg%\\?make: *** [%f:%l:%m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GIn file included from %f:%l:%c:,%-GIn file included from %f:%l:%c\\,,%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-G%*[ ]from %f:%l:%c,%-G%*[ ]from %f:%l:,%-G%*[ ]from %f:%l\\,,%-G%*[ ]from %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory %*[`']%f',%X%*\\a[%*\\d]: Leaving directory %*[`']%f',%D%*\\a: Entering directory %*[`']%f',%X%*\\a: Leaving directory %*[`']%f',%DMaking %*\\a in %f,%f|%l| %m"
# endif
# endif
# endif
#endif
#define DFLT_GREPFORMAT "%f:%l:%m,%f:%l%m,%f %l%m"
// default values for b_p_ff 'fileformat' and p_ffs 'fileformats'
#define FF_DOS "dos"
#define FF_MAC "mac"
#define FF_UNIX "unix"
#ifdef USE_CRNL
# define DFLT_FF "dos"
# define DFLT_FFS_VIM "dos,unix"
# define DFLT_FFS_VI "dos,unix" // also autodetect in compatible mode
# define DFLT_TEXTAUTO TRUE
#else
# define DFLT_FF "unix"
# define DFLT_FFS_VIM "unix,dos"
# ifdef __CYGWIN__
# define DFLT_FFS_VI "unix,dos" // Cygwin always needs file detection
# define DFLT_TEXTAUTO TRUE
# else
# define DFLT_FFS_VI ""
# define DFLT_TEXTAUTO FALSE
# endif
#endif
// Possible values for 'encoding'
#define ENC_UCSBOM "ucs-bom" // check for BOM at start of file
// default value for 'encoding'
#if defined(MSWIN) || defined(__MVS__)
# define ENC_DFLT "utf-8"
#else
# define ENC_DFLT "latin1"