Imported Upstream version 8.0.586
[platform/upstream/vim.git] / src / option.h
1 /* vi:set ts=8 sts=4 sw=4 noet:
2  *
3  * VIM - Vi IMproved    by Bram Moolenaar
4  *
5  * Do ":help uganda"  in Vim to read copying and usage conditions.
6  * Do ":help credits" in Vim to see a list of people who contributed.
7  */
8
9 /*
10  * option.h: definition of global variables for settable options
11  */
12
13 /*
14  * Default values for 'errorformat'.
15  * The "%f|%l| %m" one is used for when the contents of the quickfix window is
16  * written to a file.
17  */
18 #ifdef AMIGA
19 # 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"
20 #else
21 # if defined(WIN3264)
22 #  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"
23 # else
24 #  if defined(__QNX__)
25 #   define DFLT_EFM     "%f(%l):%*[^WE]%t%*\\D%n:%m,%f|%l| %m"
26 #  else
27 #   ifdef VMS
28 #    define DFLT_EFM    "%A%p^,%C%%CC-%t-%m,%Cat line number %l in file %f,%f|%l| %m"
29 #   else /* Unix, probably */
30 #    ifdef EBCDIC
31 #define DFLT_EFM        "%*[^ ] %*[^ ] %f:%l%*[ ]%m,%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%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',%DMaking %*\\a in %f,%f|%l| %m"
32 #     else
33 #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"
34 #    endif
35 #   endif
36 #  endif
37 # endif
38 #endif
39
40 #define DFLT_GREPFORMAT "%f:%l:%m,%f:%l%m,%f  %l%m"
41
42 /* default values for b_p_ff 'fileformat' and p_ffs 'fileformats' */
43 #define FF_DOS          "dos"
44 #define FF_MAC          "mac"
45 #define FF_UNIX         "unix"
46
47 #ifdef USE_CRNL
48 # define DFLT_FF        "dos"
49 # define DFLT_FFS_VIM   "dos,unix"
50 # define DFLT_FFS_VI    "dos,unix"      /* also autodetect in compatible mode */
51 # define DFLT_TEXTAUTO  TRUE
52 #else
53 # ifdef USE_CR
54 #  define DFLT_FF       "mac"
55 #  define DFLT_FFS_VIM  "mac,unix,dos"
56 #  define DFLT_FFS_VI   "mac,unix,dos"
57 #  define DFLT_TEXTAUTO TRUE
58 # else
59 #  define DFLT_FF       "unix"
60 #  define DFLT_FFS_VIM  "unix,dos"
61 #  ifdef __CYGWIN__
62 #   define DFLT_FFS_VI  "unix,dos"      /* Cygwin always needs file detection */
63 #   define DFLT_TEXTAUTO TRUE
64 #  else
65 #   define DFLT_FFS_VI  ""
66 #   define DFLT_TEXTAUTO FALSE
67 #  endif
68 # endif
69 #endif
70
71
72 #ifdef FEAT_MBYTE
73 /* Possible values for 'encoding' */
74 # define ENC_UCSBOM     "ucs-bom"       /* check for BOM at start of file */
75
76 /* default value for 'encoding' */
77 # define ENC_DFLT       "latin1"
78 #endif
79
80 /* end-of-line style */
81 #define EOL_UNKNOWN     -1      /* not defined yet */
82 #define EOL_UNIX        0       /* NL */
83 #define EOL_DOS         1       /* CR NL */
84 #define EOL_MAC         2       /* CR */
85
86 /* Formatting options for p_fo 'formatoptions' */
87 #define FO_WRAP         't'
88 #define FO_WRAP_COMS    'c'
89 #define FO_RET_COMS     'r'
90 #define FO_OPEN_COMS    'o'
91 #define FO_Q_COMS       'q'
92 #define FO_Q_NUMBER     'n'
93 #define FO_Q_SECOND     '2'
94 #define FO_INS_VI       'v'
95 #define FO_INS_LONG     'l'
96 #define FO_INS_BLANK    'b'
97 #define FO_MBYTE_BREAK  'm'     /* break before/after multi-byte char */
98 #define FO_MBYTE_JOIN   'M'     /* no space before/after multi-byte char */
99 #define FO_MBYTE_JOIN2  'B'     /* no space between multi-byte chars */
100 #define FO_ONE_LETTER   '1'
101 #define FO_WHITE_PAR    'w'     /* trailing white space continues paragr. */
102 #define FO_AUTO         'a'     /* automatic formatting */
103 #define FO_REMOVE_COMS  'j'     /* remove comment leaders when joining lines */
104
105 #define DFLT_FO_VI      "vt"
106 #define DFLT_FO_VIM     "tcq"
107 #define FO_ALL          "tcroq2vlb1mMBn,awj"    /* for do_set() */
108
109 /* characters for the p_cpo option: */
110 #define CPO_ALTREAD     'a'     /* ":read" sets alternate file name */
111 #define CPO_ALTWRITE    'A'     /* ":write" sets alternate file name */
112 #define CPO_BAR         'b'     /* "\|" ends a mapping */
113 #define CPO_BSLASH      'B'     /* backslash in mapping is not special */
114 #define CPO_SEARCH      'c'
115 #define CPO_CONCAT      'C'     /* Don't concatenate sourced lines */
116 #define CPO_DOTTAG      'd'     /* "./tags" in 'tags' is in current dir */
117 #define CPO_DIGRAPH     'D'     /* No digraph after "r", "f", etc. */
118 #define CPO_EXECBUF     'e'
119 #define CPO_EMPTYREGION 'E'     /* operating on empty region is an error */
120 #define CPO_FNAMER      'f'     /* set file name for ":r file" */
121 #define CPO_FNAMEW      'F'     /* set file name for ":w file" */
122 #define CPO_GOTO1       'g'     /* goto line 1 for ":edit" */
123 #define CPO_INSEND      'H'     /* "I" inserts before last blank in line */
124 #define CPO_INTMOD      'i'     /* interrupt a read makes buffer modified */
125 #define CPO_INDENT      'I'     /* remove auto-indent more often */
126 #define CPO_JOINSP      'j'     /* only use two spaces for join after '.' */
127 #define CPO_ENDOFSENT   'J'     /* need two spaces to detect end of sentence */
128 #define CPO_KEYCODE     'k'     /* don't recognize raw key code in mappings */
129 #define CPO_KOFFSET     'K'     /* don't wait for key code in mappings */
130 #define CPO_LITERAL     'l'     /* take char after backslash in [] literal */
131 #define CPO_LISTWM      'L'     /* 'list' changes wrapmargin */
132 #define CPO_SHOWMATCH   'm'
133 #define CPO_MATCHBSL    'M'     /* "%" ignores use of backslashes */
134 #define CPO_NUMCOL      'n'     /* 'number' column also used for text */
135 #define CPO_LINEOFF     'o'
136 #define CPO_OVERNEW     'O'     /* silently overwrite new file */
137 #define CPO_LISP        'p'     /* 'lisp' indenting */
138 #define CPO_FNAMEAPP    'P'     /* set file name for ":w >>file" */
139 #define CPO_JOINCOL     'q'     /* with "3J" use column after first join */
140 #define CPO_REDO        'r'
141 #define CPO_REMMARK     'R'     /* remove marks when filtering */
142 #define CPO_BUFOPT      's'
143 #define CPO_BUFOPTGLOB  'S'
144 #define CPO_TAGPAT      't'
145 #define CPO_UNDO        'u'     /* "u" undoes itself */
146 #define CPO_BACKSPACE   'v'     /* "v" keep deleted text */
147 #define CPO_CW          'w'     /* "cw" only changes one blank */
148 #define CPO_FWRITE      'W'     /* "w!" doesn't overwrite readonly files */
149 #define CPO_ESC         'x'
150 #define CPO_REPLCNT     'X'     /* "R" with a count only deletes chars once */
151 #define CPO_YANK        'y'
152 #define CPO_KEEPRO      'Z'     /* don't reset 'readonly' on ":w!" */
153 #define CPO_DOLLAR      '$'
154 #define CPO_FILTER      '!'
155 #define CPO_MATCH       '%'
156 #define CPO_STAR        '*'     /* ":*" means ":@" */
157 #define CPO_PLUS        '+'     /* ":write file" resets 'modified' */
158 #define CPO_MINUS       '-'     /* "9-" fails at and before line 9 */
159 #define CPO_SPECI       '<'     /* don't recognize <> in mappings */
160 #define CPO_REGAPPEND   '>'     /* insert NL when appending to a register */
161 /* POSIX flags */
162 #define CPO_HASH        '#'     /* "D", "o" and "O" do not use a count */
163 #define CPO_PARA        '{'     /* "{" is also a paragraph boundary */
164 #define CPO_TSIZE       '|'     /* $LINES and $COLUMNS overrule term size */
165 #define CPO_PRESERVE    '&'     /* keep swap file after :preserve */
166 #define CPO_SUBPERCENT  '/'     /* % in :s string uses previous one */
167 #define CPO_BACKSL      '\\'    /* \ is not special in [] */
168 #define CPO_CHDIR       '.'     /* don't chdir if buffer is modified */
169 #define CPO_SCOLON      ';'     /* using "," and ";" will skip over char if
170                                  * cursor would not move */
171 /* default values for Vim, Vi and POSIX */
172 #define CPO_VIM         "aABceFs"
173 #define CPO_VI          "aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZ$!%*-+<>;"
174 #define CPO_ALL         "aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZ$!%*-+<>#{|&/\\.;"
175
176 /* characters for p_ww option: */
177 #define WW_ALL          "bshl<>[],~"
178
179 /* characters for p_mouse option: */
180 #define MOUSE_NORMAL    'n'             /* use mouse in Normal mode */
181 #define MOUSE_VISUAL    'v'             /* use mouse in Visual/Select mode */
182 #define MOUSE_INSERT    'i'             /* use mouse in Insert mode */
183 #define MOUSE_COMMAND   'c'             /* use mouse in Command-line mode */
184 #define MOUSE_HELP      'h'             /* use mouse in help buffers */
185 #define MOUSE_RETURN    'r'             /* use mouse for hit-return message */
186 #define MOUSE_A         "nvich"         /* used for 'a' flag */
187 #define MOUSE_ALL       "anvichr"       /* all possible characters */
188 #define MOUSE_NONE      ' '             /* don't use Visual selection */
189 #define MOUSE_NONEF     'x'             /* forced modeless selection */
190
191 #define COCU_ALL        "nvic"          /* flags for 'concealcursor' */
192
193 /* characters for p_shm option: */
194 #define SHM_RO          'r'             /* readonly */
195 #define SHM_MOD         'm'             /* modified */
196 #define SHM_FILE        'f'             /* (file 1 of 2) */
197 #define SHM_LAST        'i'             /* last line incomplete */
198 #define SHM_TEXT        'x'             /* tx instead of textmode */
199 #define SHM_LINES       'l'             /* "L" instead of "lines" */
200 #define SHM_NEW         'n'             /* "[New]" instead of "[New file]" */
201 #define SHM_WRI         'w'             /* "[w]" instead of "written" */
202 #define SHM_A           "rmfixlnw"      /* represented by 'a' flag */
203 #define SHM_WRITE       'W'             /* don't use "written" at all */
204 #define SHM_TRUNC       't'             /* trunctate file messages */
205 #define SHM_TRUNCALL    'T'             /* trunctate all messages */
206 #define SHM_OVER        'o'             /* overwrite file messages */
207 #define SHM_OVERALL     'O'             /* overwrite more messages */
208 #define SHM_SEARCH      's'             /* no search hit bottom messages */
209 #define SHM_ATTENTION   'A'             /* no ATTENTION messages */
210 #define SHM_INTRO       'I'             /* intro messages */
211 #define SHM_COMPLETIONMENU  'c'         /* completion menu messages */
212 #define SHM_RECORDING   'q'             /* short recording message */
213 #define SHM_FILEINFO    'F'             /* no file info messages */
214 #define SHM_ALL         "rmfixlnwaWtToOsAIcqF" /* all possible flags for 'shm' */
215
216 /* characters for p_go: */
217 #define GO_ASEL         'a'             /* autoselect */
218 #define GO_ASELML       'A'             /* autoselect modeless selection */
219 #define GO_BOT          'b'             /* use bottom scrollbar */
220 #define GO_CONDIALOG    'c'             /* use console dialog */
221 #define GO_TABLINE      'e'             /* may show tabline */
222 #define GO_FORG         'f'             /* start GUI in foreground */
223 #define GO_GREY         'g'             /* use grey menu items */
224 #define GO_HORSCROLL    'h'             /* flexible horizontal scrolling */
225 #define GO_ICON         'i'             /* use Vim icon */
226 #define GO_LEFT         'l'             /* use left scrollbar */
227 #define GO_VLEFT        'L'             /* left scrollbar with vert split */
228 #define GO_MENUS        'm'             /* use menu bar */
229 #define GO_NOSYSMENU    'M'             /* don't source system menu */
230 #define GO_POINTER      'p'             /* pointer enter/leave callbacks */
231 #define GO_ASELPLUS     'P'             /* autoselectPlus */
232 #define GO_RIGHT        'r'             /* use right scrollbar */
233 #define GO_VRIGHT       'R'             /* right scrollbar with vert split */
234 #define GO_TEAROFF      't'             /* add tear-off menu items */
235 #define GO_TOOLBAR      'T'             /* add toolbar */
236 #define GO_FOOTER       'F'             /* add footer */
237 #define GO_VERTICAL     'v'             /* arrange dialog buttons vertically */
238 #define GO_ALL          "aAbcefFghilmMprtTv" /* all possible flags for 'go' */
239
240 /* flags for 'comments' option */
241 #define COM_NEST        'n'             /* comments strings nest */
242 #define COM_BLANK       'b'             /* needs blank after string */
243 #define COM_START       's'             /* start of comment */
244 #define COM_MIDDLE      'm'             /* middle of comment */
245 #define COM_END         'e'             /* end of comment */
246 #define COM_AUTO_END    'x'             /* last char of end closes comment */
247 #define COM_FIRST       'f'             /* first line comment only */
248 #define COM_LEFT        'l'             /* left adjusted */
249 #define COM_RIGHT       'r'             /* right adjusted */
250 #define COM_NOBACK      'O'             /* don't use for "O" command */
251 #define COM_ALL         "nbsmexflrO"    /* all flags for 'comments' option */
252 #define COM_MAX_LEN     50              /* maximum length of a part */
253
254 /* flags for 'statusline' option */
255 #define STL_FILEPATH    'f'             /* path of file in buffer */
256 #define STL_FULLPATH    'F'             /* full path of file in buffer */
257 #define STL_FILENAME    't'             /* last part (tail) of file path */
258 #define STL_COLUMN      'c'             /* column og cursor*/
259 #define STL_VIRTCOL     'v'             /* virtual column */
260 #define STL_VIRTCOL_ALT 'V'             /* - with 'if different' display */
261 #define STL_LINE        'l'             /* line number of cursor */
262 #define STL_NUMLINES    'L'             /* number of lines in buffer */
263 #define STL_BUFNO       'n'             /* current buffer number */
264 #define STL_KEYMAP      'k'             /* 'keymap' when active */
265 #define STL_OFFSET      'o'             /* offset of character under cursor*/
266 #define STL_OFFSET_X    'O'             /* - in hexadecimal */
267 #define STL_BYTEVAL     'b'             /* byte value of character */
268 #define STL_BYTEVAL_X   'B'             /* - in hexadecimal */
269 #define STL_ROFLAG      'r'             /* readonly flag */
270 #define STL_ROFLAG_ALT  'R'             /* - other display */
271 #define STL_HELPFLAG    'h'             /* window is showing a help file */
272 #define STL_HELPFLAG_ALT 'H'            /* - other display */
273 #define STL_FILETYPE    'y'             /* 'filetype' */
274 #define STL_FILETYPE_ALT 'Y'            /* - other display */
275 #define STL_PREVIEWFLAG 'w'             /* window is showing the preview buf */
276 #define STL_PREVIEWFLAG_ALT 'W'         /* - other display */
277 #define STL_MODIFIED    'm'             /* modified flag */
278 #define STL_MODIFIED_ALT 'M'            /* - other display */
279 #define STL_QUICKFIX    'q'             /* quickfix window description */
280 #define STL_PERCENTAGE  'p'             /* percentage through file */
281 #define STL_ALTPERCENT  'P'             /* percentage as TOP BOT ALL or NN% */
282 #define STL_ARGLISTSTAT 'a'             /* argument list status as (x of y) */
283 #define STL_PAGENUM     'N'             /* page number (when printing)*/
284 #define STL_VIM_EXPR    '{'             /* start of expression to substitute */
285 #define STL_MIDDLEMARK  '='             /* separation between left and right */
286 #define STL_TRUNCMARK   '<'             /* truncation mark if line is too long*/
287 #define STL_USER_HL     '*'             /* highlight from (User)1..9 or 0 */
288 #define STL_HIGHLIGHT   '#'             /* highlight name */
289 #define STL_TABPAGENR   'T'             /* tab page label nr */
290 #define STL_TABCLOSENR  'X'             /* tab page close nr */
291 #define STL_ALL         ((char_u *) "fFtcvVlLknoObBrRhHmYyWwMqpPaN{#")
292
293 /* flags used for parsed 'wildmode' */
294 #define WIM_FULL        1
295 #define WIM_LONGEST     2
296 #define WIM_LIST        4
297
298 /* arguments for can_bs() */
299 #define BS_INDENT       'i'     /* "Indent" */
300 #define BS_EOL          'o'     /* "eOl" */
301 #define BS_START        's'     /* "Start" */
302
303 #define LISPWORD_VALUE  "defun,define,defmacro,set!,lambda,if,case,let,flet,let*,letrec,do,do*,define-syntax,let-syntax,letrec-syntax,destructuring-bind,defpackage,defparameter,defstruct,deftype,defvar,do-all-symbols,do-external-symbols,do-symbols,dolist,dotimes,ecase,etypecase,eval-when,labels,macrolet,multiple-value-bind,multiple-value-call,multiple-value-prog1,multiple-value-setq,prog1,progv,typecase,unless,unwind-protect,when,with-input-from-string,with-open-file,with-open-stream,with-output-to-string,with-package-iterator,define-condition,handler-bind,handler-case,restart-bind,restart-case,with-simple-restart,store-value,use-value,muffle-warning,abort,continue,with-slots,with-slots*,with-accessors,with-accessors*,defclass,defmethod,print-unreadable-object"
304
305 /*
306  * The following are actual variables for the options
307  */
308
309 #ifdef FEAT_RIGHTLEFT
310 EXTERN long     p_aleph;        /* 'aleph' */
311 #endif
312 #ifdef FEAT_AUTOCHDIR
313 EXTERN int      p_acd;          /* 'autochdir' */
314 #endif
315 #ifdef FEAT_MBYTE
316 EXTERN char_u   *p_ambw;        /* 'ambiwidth' */
317 EXTERN char_u   *p_emoji;       /* 'emoji' */
318 #endif
319 #if defined(FEAT_GUI) && defined(MACOS_X)
320 EXTERN int      *p_antialias;   /* 'antialias' */
321 #endif
322 EXTERN int      p_ar;           /* 'autoread' */
323 EXTERN int      p_aw;           /* 'autowrite' */
324 EXTERN int      p_awa;          /* 'autowriteall' */
325 EXTERN char_u   *p_bs;          /* 'backspace' */
326 EXTERN char_u   *p_bg;          /* 'background' */
327 EXTERN int      p_bk;           /* 'backup' */
328 EXTERN char_u   *p_bkc;         /* 'backupcopy' */
329 EXTERN unsigned bkc_flags;      /* flags from 'backupcopy' */
330 #ifdef IN_OPTION_C
331 static char *(p_bkc_values[]) = {"yes", "auto", "no", "breaksymlink", "breakhardlink", NULL};
332 #endif
333 # define BKC_YES                0x001
334 # define BKC_AUTO               0x002
335 # define BKC_NO                 0x004
336 # define BKC_BREAKSYMLINK       0x008
337 # define BKC_BREAKHARDLINK      0x010
338 EXTERN char_u   *p_bdir;        /* 'backupdir' */
339 EXTERN char_u   *p_bex;         /* 'backupext' */
340 EXTERN char_u   *p_bo;          /* 'belloff' */
341 EXTERN unsigned bo_flags;
342 # ifdef IN_OPTION_C
343 static char *(p_bo_values[]) = {"all", "backspace", "cursor", "complete",
344                                  "copy", "ctrlg", "error", "esc", "ex",
345                                  "hangul", "insertmode", "lang", "mess",
346                                  "showmatch", "operator", "register", "shell",
347                                  "spell", "wildmode", NULL};
348 # endif
349
350 /* values for the 'beepon' option */
351 #define BO_ALL          0x0001
352 #define BO_BS           0x0002
353 #define BO_CRSR         0x0004
354 #define BO_COMPL        0x0008
355 #define BO_COPY         0x0010
356 #define BO_CTRLG        0x0020
357 #define BO_ERROR        0x0040
358 #define BO_ESC          0x0080
359 #define BO_EX           0x0100
360 #define BO_HANGUL       0x0200
361 #define BO_IM           0x0400
362 #define BO_LANG         0x0800
363 #define BO_MESS         0x1000
364 #define BO_MATCH        0x2000
365 #define BO_OPER         0x4000
366 #define BO_REG          0x8000
367 #define BO_SH           0x10000
368 #define BO_SPELL        0x20000
369 #define BO_WILD         0x40000
370
371 #ifdef FEAT_WILDIGN
372 EXTERN char_u   *p_bsk;         /* 'backupskip' */
373 #endif
374 #ifdef FEAT_CRYPT
375 EXTERN char_u   *p_cm;          /* 'cryptmethod' */
376 #endif
377 #ifdef FEAT_BEVAL
378 EXTERN long     p_bdlay;        /* 'balloondelay' */
379 EXTERN int      p_beval;        /* 'ballooneval' */
380 # ifdef FEAT_EVAL
381 EXTERN char_u   *p_bexpr;
382 # endif
383 #endif
384 #ifdef FEAT_BROWSE
385 EXTERN char_u   *p_bsdir;       /* 'browsedir' */
386 #endif
387 #ifdef FEAT_LINEBREAK
388 EXTERN char_u   *p_breakat;     /* 'breakat' */
389 #endif
390 #ifdef FEAT_MBYTE
391 EXTERN char_u   *p_cmp;         /* 'casemap' */
392 EXTERN unsigned cmp_flags;
393 # ifdef IN_OPTION_C
394 static char *(p_cmp_values[]) = {"internal", "keepascii", NULL};
395 # endif
396 # define CMP_INTERNAL           0x001
397 # define CMP_KEEPASCII          0x002
398 #endif
399 #ifdef FEAT_MBYTE
400 EXTERN char_u   *p_enc;         /* 'encoding' */
401 EXTERN int      p_deco;         /* 'delcombine' */
402 # ifdef FEAT_EVAL
403 EXTERN char_u   *p_ccv;         /* 'charconvert' */
404 # endif
405 #endif
406 #ifdef FEAT_CMDWIN
407 EXTERN char_u   *p_cedit;       /* 'cedit' */
408 EXTERN long     p_cwh;          /* 'cmdwinheight' */
409 #endif
410 #ifdef FEAT_CLIPBOARD
411 EXTERN char_u   *p_cb;          /* 'clipboard' */
412 #endif
413 EXTERN long     p_ch;           /* 'cmdheight' */
414 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
415 EXTERN int      p_confirm;      /* 'confirm' */
416 #endif
417 EXTERN int      p_cp;           /* 'compatible' */
418 #ifdef FEAT_INS_EXPAND
419 EXTERN char_u   *p_cot;         /* 'completeopt' */
420 EXTERN long     p_ph;           /* 'pumheight' */
421 #endif
422 EXTERN char_u   *p_cpo;         /* 'cpoptions' */
423 #ifdef FEAT_CSCOPE
424 EXTERN char_u   *p_csprg;       /* 'cscopeprg' */
425 EXTERN int      p_csre;         /* 'cscoperelative' */
426 # ifdef FEAT_QUICKFIX
427 EXTERN char_u   *p_csqf;        /* 'cscopequickfix' */
428 #  define       CSQF_CMDS   "sgdctefia"
429 #  define       CSQF_FLAGS  "+-0"
430 # endif
431 EXTERN int      p_cst;          /* 'cscopetag' */
432 EXTERN long     p_csto;         /* 'cscopetagorder' */
433 EXTERN long     p_cspc;         /* 'cscopepathcomp' */
434 EXTERN int      p_csverbose;    /* 'cscopeverbose' */
435 #endif
436 EXTERN char_u   *p_debug;       /* 'debug' */
437 #ifdef FEAT_FIND_ID
438 EXTERN char_u   *p_def;         /* 'define' */
439 EXTERN char_u   *p_inc;
440 #endif
441 #ifdef FEAT_DIFF
442 EXTERN char_u   *p_dip;         /* 'diffopt' */
443 # ifdef FEAT_EVAL
444 EXTERN char_u   *p_dex;         /* 'diffexpr' */
445 # endif
446 #endif
447 #ifdef FEAT_INS_EXPAND
448 EXTERN char_u   *p_dict;        /* 'dictionary' */
449 #endif
450 #ifdef FEAT_DIGRAPHS
451 EXTERN int      p_dg;           /* 'digraph' */
452 #endif
453 EXTERN char_u   *p_dir;         /* 'directory' */
454 EXTERN char_u   *p_dy;          /* 'display' */
455 EXTERN unsigned dy_flags;
456 #ifdef IN_OPTION_C
457 static char *(p_dy_values[]) = {"lastline", "truncate", "uhex", NULL};
458 #endif
459 #define DY_LASTLINE             0x001
460 #define DY_TRUNCATE             0x002
461 #define DY_UHEX                 0x004
462 EXTERN int      p_ed;           /* 'edcompatible' */
463 #ifdef FEAT_WINDOWS
464 EXTERN char_u   *p_ead;         /* 'eadirection' */
465 #endif
466 EXTERN int      p_ea;           /* 'equalalways' */
467 EXTERN char_u   *p_ep;          /* 'equalprg' */
468 EXTERN int      p_eb;           /* 'errorbells' */
469 #ifdef FEAT_QUICKFIX
470 EXTERN char_u   *p_ef;          /* 'errorfile' */
471 EXTERN char_u   *p_efm;         /* 'errorformat' */
472 EXTERN char_u   *p_gefm;        /* 'grepformat' */
473 EXTERN char_u   *p_gp;          /* 'grepprg' */
474 #endif
475 #ifdef FEAT_AUTOCMD
476 EXTERN char_u   *p_ei;          /* 'eventignore' */
477 #endif
478 EXTERN int      p_ek;           /* 'esckeys' */
479 EXTERN int      p_exrc;         /* 'exrc' */
480 #ifdef FEAT_MBYTE
481 EXTERN char_u   *p_fencs;       /* 'fileencodings' */
482 #endif
483 EXTERN char_u   *p_ffs;         /* 'fileformats' */
484 EXTERN long     p_fic;          /* 'fileignorecase' */
485 #ifdef FEAT_FOLDING
486 EXTERN char_u   *p_fcl;         /* 'foldclose' */
487 EXTERN long     p_fdls;         /* 'foldlevelstart' */
488 EXTERN char_u   *p_fdo;         /* 'foldopen' */
489 EXTERN unsigned fdo_flags;
490 # ifdef IN_OPTION_C
491 static char *(p_fdo_values[]) = {"all", "block", "hor", "mark", "percent",
492                                  "quickfix", "search", "tag", "insert",
493                                  "undo", "jump", NULL};
494 # endif
495 # define FDO_ALL                0x001
496 # define FDO_BLOCK              0x002
497 # define FDO_HOR                0x004
498 # define FDO_MARK               0x008
499 # define FDO_PERCENT            0x010
500 # define FDO_QUICKFIX           0x020
501 # define FDO_SEARCH             0x040
502 # define FDO_TAG                0x080
503 # define FDO_INSERT             0x100
504 # define FDO_UNDO               0x200
505 # define FDO_JUMP               0x400
506 #endif
507 EXTERN char_u   *p_fp;          /* 'formatprg' */
508 #ifdef HAVE_FSYNC
509 EXTERN int      p_fs;           /* 'fsync' */
510 #endif
511 EXTERN int      p_gd;           /* 'gdefault' */
512 #ifdef FEAT_PRINTER
513 EXTERN char_u   *p_pdev;        /* 'printdevice' */
514 # ifdef FEAT_POSTSCRIPT
515 EXTERN char_u   *p_penc;        /* 'printencoding' */
516 EXTERN char_u   *p_pexpr;       /* 'printexpr' */
517 #   ifdef FEAT_MBYTE
518 EXTERN char_u   *p_pmfn;        /* 'printmbfont' */
519 EXTERN char_u   *p_pmcs;        /* 'printmbcharset' */
520 #   endif
521 # endif
522 EXTERN char_u   *p_pfn;         /* 'printfont' */
523 EXTERN char_u   *p_popt;        /* 'printoptions' */
524 EXTERN char_u   *p_header;      /* 'printheader' */
525 #endif
526 EXTERN int      p_prompt;       /* 'prompt' */
527 #ifdef FEAT_GUI
528 EXTERN char_u   *p_guifont;     /* 'guifont' */
529 # ifdef FEAT_XFONTSET
530 EXTERN char_u   *p_guifontset;  /* 'guifontset' */
531 # endif
532 # ifdef FEAT_MBYTE
533 EXTERN char_u   *p_guifontwide; /* 'guifontwide' */
534 # endif
535 EXTERN int      p_guipty;       /* 'guipty' */
536 #endif
537 #if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
538 EXTERN long     p_ghr;          /* 'guiheadroom' */
539 #endif
540 #ifdef CURSOR_SHAPE
541 EXTERN char_u   *p_guicursor;   /* 'guicursor' */
542 #endif
543 #ifdef FEAT_MOUSESHAPE
544 EXTERN char_u   *p_mouseshape;  /* 'mouseshape' */
545 #endif
546 #if defined(FEAT_GUI)
547 EXTERN char_u   *p_go;          /* 'guioptions' */
548 #endif
549 #if defined(FEAT_GUI_TABLINE)
550 EXTERN char_u   *p_gtl;         /* 'guitablabel' */
551 EXTERN char_u   *p_gtt;         /* 'guitabtooltip' */
552 #endif
553 EXTERN char_u   *p_hf;          /* 'helpfile' */
554 #ifdef FEAT_WINDOWS
555 EXTERN long     p_hh;           /* 'helpheight' */
556 #endif
557 #ifdef FEAT_MULTI_LANG
558 EXTERN char_u   *p_hlg;         /* 'helplang' */
559 #endif
560 EXTERN int      p_hid;          /* 'hidden' */
561 /* Use P_HID to check if a buffer is to be hidden when it is no longer
562  * visible in a window. */
563 #ifndef FEAT_QUICKFIX
564 # define P_HID(dummy) (p_hid || cmdmod.hide)
565 #else
566 # define P_HID(buf) (buf_hide(buf))
567 #endif
568 EXTERN char_u   *p_hl;          /* 'highlight' */
569 EXTERN int      p_hls;          /* 'hlsearch' */
570 EXTERN long     p_hi;           /* 'history' */
571 #ifdef FEAT_RIGHTLEFT
572 EXTERN int      p_hkmap;        /* 'hkmap' */
573 EXTERN int      p_hkmapp;       /* 'hkmapp' */
574 # ifdef FEAT_FKMAP
575 EXTERN int      p_fkmap;        /* 'fkmap' */
576 EXTERN int      p_altkeymap;    /* 'altkeymap' */
577 # endif
578 # ifdef FEAT_ARABIC
579 EXTERN int      p_arshape;      /* 'arabicshape' */
580 # endif
581 #endif
582 #ifdef FEAT_TITLE
583 EXTERN int      p_icon;         /* 'icon' */
584 EXTERN char_u   *p_iconstring;  /* 'iconstring' */
585 #endif
586 EXTERN int      p_ic;           /* 'ignorecase' */
587 #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
588 EXTERN char_u   *p_imak;        /* 'imactivatekey' */
589 EXTERN char_u   *p_imaf;        /* 'imactivatefunc' */
590 EXTERN char_u   *p_imsf;        /* 'imstatusfunc' */
591 #endif
592 #ifdef USE_IM_CONTROL
593 EXTERN int      p_imcmdline;    /* 'imcmdline' */
594 EXTERN int      p_imdisable;    /* 'imdisable' */
595 #endif
596 EXTERN int      p_is;           /* 'incsearch' */
597 EXTERN int      p_im;           /* 'insertmode' */
598 EXTERN char_u   *p_isf;         /* 'isfname' */
599 EXTERN char_u   *p_isi;         /* 'isident' */
600 EXTERN char_u   *p_isp;         /* 'isprint' */
601 EXTERN int      p_js;           /* 'joinspaces' */
602 EXTERN char_u   *p_kp;          /* 'keywordprg' */
603 EXTERN char_u   *p_km;          /* 'keymodel' */
604 #ifdef FEAT_LANGMAP
605 EXTERN char_u   *p_langmap;     /* 'langmap'*/
606 EXTERN int      p_lnr;          /* 'langnoremap' */
607 EXTERN int      p_lrm;          /* 'langremap' */
608 #endif
609 #if defined(FEAT_MENU) && defined(FEAT_MULTI_LANG)
610 EXTERN char_u   *p_lm;          /* 'langmenu' */
611 #endif
612 #ifdef FEAT_GUI
613 EXTERN long     p_linespace;    /* 'linespace' */
614 #endif
615 #ifdef FEAT_LISP
616 EXTERN char_u   *p_lispwords;   /* 'lispwords' */
617 #endif
618 #ifdef FEAT_WINDOWS
619 EXTERN long     p_ls;           /* 'laststatus' */
620 EXTERN long     p_stal;         /* 'showtabline' */
621 #endif
622 EXTERN char_u   *p_lcs;         /* 'listchars' */
623
624 EXTERN int      p_lz;           /* 'lazyredraw' */
625 EXTERN int      p_lpl;          /* 'loadplugins' */
626 #if defined(DYNAMIC_LUA)
627 EXTERN char_u   *p_luadll;      /* 'luadll' */
628 #endif
629 #ifdef FEAT_GUI_MAC
630 EXTERN int      p_macatsui;     /* 'macatsui' */
631 #endif
632 EXTERN int      p_magic;        /* 'magic' */
633 #ifdef FEAT_MBYTE
634 EXTERN char_u   *p_menc;        /* 'makeencoding' */
635 #endif
636 #ifdef FEAT_QUICKFIX
637 EXTERN char_u   *p_mef;         /* 'makeef' */
638 EXTERN char_u   *p_mp;          /* 'makeprg' */
639 #endif
640 #ifdef FEAT_SIGNS
641 EXTERN char_u  *p_scl;          /* signcolumn */
642 #endif
643 #ifdef FEAT_SYN_HL
644 EXTERN char_u   *p_cc;          /* 'colorcolumn' */
645 EXTERN int      p_cc_cols[256]; /* array for 'colorcolumn' columns */
646 #endif
647 EXTERN long     p_mat;          /* 'matchtime' */
648 #ifdef FEAT_MBYTE
649 EXTERN long     p_mco;          /* 'maxcombine' */
650 #endif
651 #ifdef FEAT_EVAL
652 EXTERN long     p_mfd;          /* 'maxfuncdepth' */
653 #endif
654 EXTERN long     p_mmd;          /* 'maxmapdepth' */
655 EXTERN long     p_mm;           /* 'maxmem' */
656 EXTERN long     p_mmp;          /* 'maxmempattern' */
657 EXTERN long     p_mmt;          /* 'maxmemtot' */
658 #ifdef FEAT_MENU
659 EXTERN long     p_mis;          /* 'menuitems' */
660 #endif
661 #ifdef FEAT_SPELL
662 EXTERN char_u   *p_msm;         /* 'mkspellmem' */
663 #endif
664 EXTERN long     p_mls;          /* 'modelines' */
665 EXTERN char_u   *p_mouse;       /* 'mouse' */
666 #ifdef FEAT_GUI
667 EXTERN int      p_mousef;       /* 'mousefocus' */
668 EXTERN int      p_mh;           /* 'mousehide' */
669 #endif
670 EXTERN char_u   *p_mousem;      /* 'mousemodel' */
671 EXTERN long     p_mouset;       /* 'mousetime' */
672 EXTERN int      p_more;         /* 'more' */
673 #ifdef FEAT_MZSCHEME
674 EXTERN long     p_mzq;          /* 'mzquantum */
675 #endif
676 #if defined(MSWIN)
677 EXTERN int      p_odev;         /* 'opendevice' */
678 #endif
679 EXTERN char_u   *p_opfunc;      /* 'operatorfunc' */
680 EXTERN char_u   *p_para;        /* 'paragraphs' */
681 EXTERN int      p_paste;        /* 'paste' */
682 EXTERN char_u   *p_pt;          /* 'pastetoggle' */
683 #if defined(FEAT_EVAL) && defined(FEAT_DIFF)
684 EXTERN char_u   *p_pex;         /* 'patchexpr' */
685 #endif
686 EXTERN char_u   *p_pm;          /* 'patchmode' */
687 EXTERN char_u   *p_path;        /* 'path' */
688 #ifdef FEAT_SEARCHPATH
689 EXTERN char_u   *p_cdpath;      /* 'cdpath' */
690 #endif
691 #if defined(DYNAMIC_PERL)
692 EXTERN char_u   *p_perldll;     /* 'perldll' */
693 #endif
694 #if defined(DYNAMIC_PYTHON3)
695 EXTERN char_u   *p_py3dll;      /* 'pythonthreedll' */
696 #endif
697 #if defined(DYNAMIC_PYTHON)
698 EXTERN char_u   *p_pydll;       /* 'pythondll' */
699 #endif
700 #if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3)
701 EXTERN long     p_pyx;          /* 'pyxversion' */
702 #endif
703 #ifdef FEAT_RELTIME
704 EXTERN long     p_rdt;          /* 'redrawtime' */
705 #endif
706 EXTERN int      p_remap;        /* 'remap' */
707 EXTERN long     p_re;           /* 'regexpengine' */
708 #ifdef FEAT_RENDER_OPTIONS
709 EXTERN char_u   *p_rop;         /* 'renderoptions' */
710 #endif
711 EXTERN long     p_report;       /* 'report' */
712 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
713 EXTERN long     p_pvh;          /* 'previewheight' */
714 #endif
715 #ifdef WIN3264
716 EXTERN int      p_rs;           /* 'restorescreen' */
717 #endif
718 #ifdef FEAT_RIGHTLEFT
719 EXTERN int      p_ari;          /* 'allowrevins' */
720 EXTERN int      p_ri;           /* 'revins' */
721 #endif
722 #if defined(DYNAMIC_RUBY)
723 EXTERN char_u   *p_rubydll;     /* 'rubydll' */
724 #endif
725 #ifdef FEAT_CMDL_INFO
726 EXTERN int      p_ru;           /* 'ruler' */
727 #endif
728 #ifdef FEAT_STL_OPT
729 EXTERN char_u   *p_ruf;         /* 'rulerformat' */
730 #endif
731 EXTERN char_u   *p_pp;          /* 'packpath' */
732 EXTERN char_u   *p_rtp;         /* 'runtimepath' */
733 EXTERN long     p_sj;           /* 'scrolljump' */
734 EXTERN long     p_so;           /* 'scrolloff' */
735 #ifdef FEAT_SCROLLBIND
736 EXTERN char_u   *p_sbo;         /* 'scrollopt' */
737 #endif
738 EXTERN char_u   *p_sections;    /* 'sections' */
739 EXTERN int      p_secure;       /* 'secure' */
740 EXTERN char_u   *p_sel;         /* 'selection' */
741 EXTERN char_u   *p_slm;         /* 'selectmode' */
742 #ifdef FEAT_SESSION
743 EXTERN char_u   *p_ssop;        /* 'sessionoptions' */
744 EXTERN unsigned ssop_flags;
745 # ifdef IN_OPTION_C
746 /* Also used for 'viewoptions'! */
747 static char *(p_ssop_values[]) = {"buffers", "winpos", "resize", "winsize",
748     "localoptions", "options", "help", "blank", "globals", "slash", "unix",
749     "sesdir", "curdir", "folds", "cursor", "tabpages", NULL};
750 # endif
751 # define SSOP_BUFFERS           0x001
752 # define SSOP_WINPOS            0x002
753 # define SSOP_RESIZE            0x004
754 # define SSOP_WINSIZE           0x008
755 # define SSOP_LOCALOPTIONS      0x010
756 # define SSOP_OPTIONS           0x020
757 # define SSOP_HELP              0x040
758 # define SSOP_BLANK             0x080
759 # define SSOP_GLOBALS           0x100
760 # define SSOP_SLASH             0x200
761 # define SSOP_UNIX              0x400
762 # define SSOP_SESDIR            0x800
763 # define SSOP_CURDIR            0x1000
764 # define SSOP_FOLDS             0x2000
765 # define SSOP_CURSOR            0x4000
766 # define SSOP_TABPAGES          0x8000
767 #endif
768 EXTERN char_u   *p_sh;          /* 'shell' */
769 EXTERN char_u   *p_shcf;        /* 'shellcmdflag' */
770 #ifdef FEAT_QUICKFIX
771 EXTERN char_u   *p_sp;          /* 'shellpipe' */
772 #endif
773 EXTERN char_u   *p_shq;         /* 'shellquote' */
774 EXTERN char_u   *p_sxq;         /* 'shellxquote' */
775 EXTERN char_u   *p_sxe;         /* 'shellxescape' */
776 EXTERN char_u   *p_srr;         /* 'shellredir' */
777 #ifdef AMIGA
778 EXTERN long     p_st;           /* 'shelltype' */
779 #endif
780 EXTERN int      p_stmp;         /* 'shelltemp' */
781 #ifdef BACKSLASH_IN_FILENAME
782 EXTERN int      p_ssl;          /* 'shellslash' */
783 #endif
784 #ifdef FEAT_STL_OPT
785 EXTERN char_u   *p_stl;         /* 'statusline' */
786 #endif
787 EXTERN int      p_sr;           /* 'shiftround' */
788 EXTERN char_u   *p_shm;         /* 'shortmess' */
789 #ifdef FEAT_LINEBREAK
790 EXTERN char_u   *p_sbr;         /* 'showbreak' */
791 #endif
792 #ifdef FEAT_CMDL_INFO
793 EXTERN int      p_sc;           /* 'showcmd' */
794 #endif
795 EXTERN int      p_sft;          /* 'showfulltag' */
796 EXTERN int      p_sm;           /* 'showmatch' */
797 EXTERN int      p_smd;          /* 'showmode' */
798 EXTERN long     p_ss;           /* 'sidescroll' */
799 EXTERN long     p_siso;         /* 'sidescrolloff' */
800 EXTERN int      p_scs;          /* 'smartcase' */
801 EXTERN int      p_sta;          /* 'smarttab' */
802 #ifdef FEAT_WINDOWS
803 EXTERN int      p_sb;           /* 'splitbelow' */
804 EXTERN long     p_tpm;          /* 'tabpagemax' */
805 # if defined(FEAT_STL_OPT)
806 EXTERN char_u   *p_tal;         /* 'tabline' */
807 # endif
808 #endif
809 #ifdef FEAT_SPELL
810 EXTERN char_u   *p_sps;         /* 'spellsuggest' */
811 #endif
812 #ifdef FEAT_WINDOWS
813 EXTERN int      p_spr;          /* 'splitright' */
814 #endif
815 EXTERN int      p_sol;          /* 'startofline' */
816 EXTERN char_u   *p_su;          /* 'suffixes' */
817 EXTERN char_u   *p_sws;         /* 'swapsync' */
818 EXTERN char_u   *p_swb;         /* 'switchbuf' */
819 EXTERN unsigned swb_flags;
820 #ifdef IN_OPTION_C
821 static char *(p_swb_values[]) = {"useopen", "usetab", "split", "newtab", "vsplit", NULL};
822 #endif
823 #define SWB_USEOPEN             0x001
824 #define SWB_USETAB              0x002
825 #define SWB_SPLIT               0x004
826 #define SWB_NEWTAB              0x008
827 #define SWB_VSPLIT              0x010
828 EXTERN int      p_tbs;          /* 'tagbsearch' */
829 EXTERN char_u   *p_tc;          /* 'tagcase' */
830 EXTERN unsigned tc_flags;       /* flags from 'tagcase' */
831 #ifdef IN_OPTION_C
832 static char *(p_tc_values[]) = {"followic", "ignore", "match", "followscs", "smart", NULL};
833 #endif
834 #define TC_FOLLOWIC             0x01
835 #define TC_IGNORE               0x02
836 #define TC_MATCH                0x04
837 #define TC_FOLLOWSCS            0x08
838 #define TC_SMART                0x10
839 EXTERN long     p_tl;           /* 'taglength' */
840 EXTERN int      p_tr;           /* 'tagrelative' */
841 EXTERN char_u   *p_tags;        /* 'tags' */
842 EXTERN int      p_tgst;         /* 'tagstack' */
843 #if defined(DYNAMIC_TCL)
844 EXTERN char_u   *p_tcldll;      /* 'tcldll' */
845 #endif
846 #ifdef FEAT_ARABIC
847 EXTERN int      p_tbidi;        /* 'termbidi' */
848 #endif
849 #ifdef FEAT_MBYTE
850 EXTERN char_u   *p_tenc;        /* 'termencoding' */
851 #endif
852 #ifdef FEAT_TERMGUICOLORS
853 EXTERN int      p_tgc;          /* 'termguicolors' */
854 #endif
855 EXTERN int      p_terse;        /* 'terse' */
856 EXTERN int      p_ta;           /* 'textauto' */
857 EXTERN int      p_to;           /* 'tildeop' */
858 EXTERN int      p_timeout;      /* 'timeout' */
859 EXTERN long     p_tm;           /* 'timeoutlen' */
860 #ifdef FEAT_TITLE
861 EXTERN int      p_title;        /* 'title' */
862 EXTERN long     p_titlelen;     /* 'titlelen' */
863 EXTERN char_u   *p_titleold;    /* 'titleold' */
864 EXTERN char_u   *p_titlestring; /* 'titlestring' */
865 #endif
866 #ifdef FEAT_INS_EXPAND
867 EXTERN char_u   *p_tsr;         /* 'thesaurus' */
868 #endif
869 EXTERN int      p_ttimeout;     /* 'ttimeout' */
870 EXTERN long     p_ttm;          /* 'ttimeoutlen' */
871 EXTERN int      p_tbi;          /* 'ttybuiltin' */
872 EXTERN int      p_tf;           /* 'ttyfast' */
873 #if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
874 EXTERN char_u   *p_toolbar;     /* 'toolbar' */
875 EXTERN unsigned toolbar_flags;
876 # ifdef IN_OPTION_C
877 static char *(p_toolbar_values[]) = {"text", "icons", "tooltips", "horiz", NULL};
878 # endif
879 # define TOOLBAR_TEXT           0x01
880 # define TOOLBAR_ICONS          0x02
881 # define TOOLBAR_TOOLTIPS       0x04
882 # define TOOLBAR_HORIZ          0x08
883 #endif
884 #if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK)
885 EXTERN char_u   *p_tbis;        /* 'toolbariconsize' */
886 EXTERN unsigned tbis_flags;
887 # ifdef IN_OPTION_C
888 static char *(p_tbis_values[]) = {"tiny", "small", "medium", "large", "huge", "giant", NULL};
889 # endif
890 # define TBIS_TINY              0x01
891 # define TBIS_SMALL             0x02
892 # define TBIS_MEDIUM            0x04
893 # define TBIS_LARGE             0x08
894 # define TBIS_HUGE              0x10
895 # define TBIS_GIANT             0x20
896 #endif
897 EXTERN long     p_ttyscroll;    /* 'ttyscroll' */
898 #if defined(FEAT_MOUSE) && (defined(UNIX) || defined(VMS))
899 EXTERN char_u   *p_ttym;        /* 'ttymouse' */
900 EXTERN unsigned ttym_flags;
901 # ifdef IN_OPTION_C
902 static char *(p_ttym_values[]) = {"xterm", "xterm2", "dec", "netterm", "jsbterm", "pterm", "urxvt", "sgr", NULL};
903 # endif
904 # define TTYM_XTERM             0x01
905 # define TTYM_XTERM2            0x02
906 # define TTYM_DEC               0x04
907 # define TTYM_NETTERM           0x08
908 # define TTYM_JSBTERM           0x10
909 # define TTYM_PTERM             0x20
910 # define TTYM_URXVT             0x40
911 # define TTYM_SGR               0x80
912 #endif
913 EXTERN char_u   *p_udir;        /* 'undodir' */
914 EXTERN long     p_ul;           /* 'undolevels' */
915 EXTERN long     p_ur;           /* 'undoreload' */
916 EXTERN long     p_uc;           /* 'updatecount' */
917 EXTERN long     p_ut;           /* 'updatetime' */
918 #if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
919 EXTERN char_u   *p_fcs;         /* 'fillchar' */
920 #endif
921 #ifdef FEAT_VIMINFO
922 EXTERN char_u   *p_viminfo;     /* 'viminfo' */
923 #endif
924 #ifdef FEAT_SESSION
925 EXTERN char_u   *p_vdir;        /* 'viewdir' */
926 EXTERN char_u   *p_vop;         /* 'viewoptions' */
927 EXTERN unsigned vop_flags;      /* uses SSOP_ flags */
928 #endif
929 EXTERN int      p_vb;           /* 'visualbell' */
930 #ifdef FEAT_VIRTUALEDIT
931 EXTERN char_u   *p_ve;          /* 'virtualedit' */
932 EXTERN unsigned ve_flags;
933 # ifdef IN_OPTION_C
934 static char *(p_ve_values[]) = {"block", "insert", "all", "onemore", NULL};
935 # endif
936 # define VE_BLOCK       5       /* includes "all" */
937 # define VE_INSERT      6       /* includes "all" */
938 # define VE_ALL         4
939 # define VE_ONEMORE     8
940 #endif
941 EXTERN long     p_verbose;      /* 'verbose' */
942 #ifdef IN_OPTION_C
943 char_u  *p_vfile = (char_u *)""; /* used before options are initialized */
944 #else
945 extern char_u   *p_vfile;       /* 'verbosefile' */
946 #endif
947 EXTERN int      p_warn;         /* 'warn' */
948 #ifdef FEAT_CMDL_COMPL
949 EXTERN char_u   *p_wop;         /* 'wildoptions' */
950 #endif
951 EXTERN long     p_window;       /* 'window' */
952 #if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) || defined(LINT) \
953         || defined (FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON)
954 #define FEAT_WAK
955 EXTERN char_u   *p_wak;         /* 'winaltkeys' */
956 #endif
957 #ifdef FEAT_WILDIGN
958 EXTERN char_u   *p_wig;         /* 'wildignore' */
959 #endif
960 EXTERN int      p_wiv;          /* 'weirdinvert' */
961 EXTERN char_u   *p_ww;          /* 'whichwrap' */
962 EXTERN long     p_wc;           /* 'wildchar' */
963 EXTERN long     p_wcm;          /* 'wildcharm' */
964 EXTERN long     p_wic;          /* 'wildignorecase' */
965 EXTERN char_u   *p_wim;         /* 'wildmode' */
966 #ifdef FEAT_WILDMENU
967 EXTERN int      p_wmnu;         /* 'wildmenu' */
968 #endif
969 #ifdef FEAT_WINDOWS
970 EXTERN long     p_wh;           /* 'winheight' */
971 EXTERN long     p_wmh;          /* 'winminheight' */
972 EXTERN long     p_wmw;          /* 'winminwidth' */
973 EXTERN long     p_wiw;          /* 'winwidth' */
974 #endif
975 EXTERN int      p_ws;           /* 'wrapscan' */
976 EXTERN int      p_write;        /* 'write' */
977 EXTERN int      p_wa;           /* 'writeany' */
978 EXTERN int      p_wb;           /* 'writebackup' */
979 EXTERN long     p_wd;           /* 'writedelay' */
980
981 /*
982  * "indir" values for buffer-local opions.
983  * These need to be defined globally, so that the BV_COUNT can be used with
984  * b_p_scriptID[].
985  */
986 enum
987 {
988     BV_AI = 0
989     , BV_AR
990 #ifdef FEAT_QUICKFIX
991     , BV_BH
992 #endif
993     , BV_BKC
994 #ifdef FEAT_QUICKFIX
995     , BV_BT
996     , BV_EFM
997     , BV_GP
998     , BV_MP
999 #endif
1000     , BV_BIN
1001     , BV_BL
1002 #ifdef FEAT_MBYTE
1003     , BV_BOMB
1004 #endif
1005     , BV_CI
1006 #ifdef FEAT_CINDENT
1007     , BV_CIN
1008     , BV_CINK
1009     , BV_CINO
1010 #endif
1011 #if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
1012     , BV_CINW
1013 #endif
1014     , BV_CM
1015 #ifdef FEAT_FOLDING
1016     , BV_CMS
1017 #endif
1018 #ifdef FEAT_COMMENTS
1019     , BV_COM
1020 #endif
1021 #ifdef FEAT_INS_EXPAND
1022     , BV_CPT
1023     , BV_DICT
1024     , BV_TSR
1025 #endif
1026 #ifdef FEAT_COMPL_FUNC
1027     , BV_CFU
1028 #endif
1029 #ifdef FEAT_FIND_ID
1030     , BV_DEF
1031     , BV_INC
1032 #endif
1033     , BV_EOL
1034     , BV_FIXEOL
1035     , BV_EP
1036     , BV_ET
1037     , BV_FENC
1038     , BV_FP
1039 #ifdef FEAT_EVAL
1040     , BV_BEXPR
1041     , BV_FEX
1042 #endif
1043     , BV_FF
1044     , BV_FLP
1045     , BV_FO
1046 #ifdef FEAT_AUTOCMD
1047     , BV_FT
1048 #endif
1049     , BV_IMI
1050     , BV_IMS
1051 #if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
1052     , BV_INDE
1053     , BV_INDK
1054 #endif
1055 #if defined(FEAT_FIND_ID) && defined(FEAT_EVAL)
1056     , BV_INEX
1057 #endif
1058     , BV_INF
1059     , BV_ISK
1060 #ifdef FEAT_CRYPT
1061     , BV_KEY
1062 #endif
1063 #ifdef FEAT_KEYMAP
1064     , BV_KMAP
1065 #endif
1066     , BV_KP
1067 #ifdef FEAT_LISP
1068     , BV_LISP
1069     , BV_LW
1070 #endif
1071 #ifdef FEAT_MBYTE
1072     , BV_MENC
1073 #endif
1074     , BV_MA
1075     , BV_ML
1076     , BV_MOD
1077     , BV_MPS
1078     , BV_NF
1079 #ifdef FEAT_COMPL_FUNC
1080     , BV_OFU
1081 #endif
1082     , BV_PATH
1083     , BV_PI
1084 #ifdef FEAT_TEXTOBJ
1085     , BV_QE
1086 #endif
1087     , BV_RO
1088 #ifdef FEAT_SMARTINDENT
1089     , BV_SI
1090 #endif
1091     , BV_SN
1092 #ifdef FEAT_SYN_HL
1093     , BV_SMC
1094     , BV_SYN
1095 #endif
1096 #ifdef FEAT_SPELL
1097     , BV_SPC
1098     , BV_SPF
1099     , BV_SPL
1100 #endif
1101     , BV_STS
1102 #ifdef FEAT_SEARCHPATH
1103     , BV_SUA
1104 #endif
1105     , BV_SW
1106     , BV_SWF
1107     , BV_TAGS
1108     , BV_TC
1109     , BV_TS
1110     , BV_TW
1111     , BV_TX
1112     , BV_UDF
1113     , BV_UL
1114     , BV_WM
1115     , BV_COUNT      /* must be the last one */
1116 };
1117
1118 /*
1119  * "indir" values for window-local options.
1120  * These need to be defined globally, so that the WV_COUNT can be used in the
1121  * window structure.
1122  */
1123 enum
1124 {
1125     WV_LIST = 0
1126 #ifdef FEAT_ARABIC
1127     , WV_ARAB
1128 #endif
1129 #ifdef FEAT_CONCEAL
1130     , WV_COCU
1131     , WV_COLE
1132 #endif
1133 #ifdef FEAT_CURSORBIND
1134     , WV_CRBIND
1135 #endif
1136 #ifdef FEAT_LINEBREAK
1137     , WV_BRI
1138     , WV_BRIOPT
1139 #endif
1140 #ifdef FEAT_DIFF
1141     , WV_DIFF
1142 #endif
1143 #ifdef FEAT_FOLDING
1144     , WV_FDC
1145     , WV_FEN
1146     , WV_FDI
1147     , WV_FDL
1148     , WV_FDM
1149     , WV_FML
1150     , WV_FDN
1151 # ifdef FEAT_EVAL
1152     , WV_FDE
1153     , WV_FDT
1154 # endif
1155     , WV_FMR
1156 #endif
1157 #ifdef FEAT_LINEBREAK
1158     , WV_LBR
1159 #endif
1160     , WV_NU
1161     , WV_RNU
1162 #ifdef FEAT_LINEBREAK
1163     , WV_NUW
1164 #endif
1165 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
1166     , WV_PVW
1167 #endif
1168 #ifdef FEAT_RIGHTLEFT
1169     , WV_RL
1170     , WV_RLC
1171 #endif
1172 #ifdef FEAT_SCROLLBIND
1173     , WV_SCBIND
1174 #endif
1175     , WV_SCROLL
1176 #ifdef FEAT_SPELL
1177     , WV_SPELL
1178 #endif
1179 #ifdef FEAT_SYN_HL
1180     , WV_CUC
1181     , WV_CUL
1182     , WV_CC
1183 #endif
1184 #ifdef FEAT_STL_OPT
1185     , WV_STL
1186 #endif
1187 #ifdef FEAT_WINDOWS
1188     , WV_WFH
1189     , WV_WFW
1190 #endif
1191     , WV_WRAP
1192 #ifdef FEAT_SIGNS
1193     , WV_SCL
1194 #endif
1195     , WV_COUNT      /* must be the last one */
1196 };
1197
1198 /* Value for b_p_ul indicating the global value must be used. */
1199 #define NO_LOCAL_UNDOLEVEL -123456