/* 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_
//
// 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_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
#define P_RCLR 0x7000 // clear and redraw all
#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_RWINONLY 0x10000000L // only redraw current window
#define P_MLE 0x20000000L // under control of 'modelineexpr'
#define P_FUNC 0x40000000L // accept a function reference or a lambda
// 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\"%*\\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,%-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'
#ifdef MSWIN
# define ENC_DFLT "utf-8"
#else
# define ENC_DFLT "latin1"
#endif
// end-of-line style
#define EOL_UNKNOWN -1 // not defined yet
#define EOL_UNIX 0 // NL
#define EOL_DOS 1 // CR NL
#define EOL_MAC 2 // CR
// Formatting options for p_fo 'formatoptions'
#define FO_WRAP 't'
#define FO_WRAP_COMS 'c'
#define FO_RET_COMS 'r'
#define FO_OPEN_COMS 'o'
#define FO_Q_COMS 'q'
#define FO_Q_NUMBER 'n'
#define FO_Q_SECOND '2'
#define FO_INS_VI 'v'
#define FO_INS_LONG 'l'
#define FO_INS_BLANK 'b'
#define FO_MBYTE_BREAK 'm' // break before/after multi-byte c