xref: /vim-8.2.3635/src/option.h (revision 843ee41e)
1 /* vi:set ts=8 sts=4 sw=4:
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 #ifndef EXTERN
14 # define EXTERN extern
15 # define INIT(x)
16 #else
17 # ifndef INIT
18 #  define INIT(x) x
19 # endif
20 #endif
21 
22 /* default values for p_efm 'errorformat' */
23 #ifdef AMIGA
24 # 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"
25 #else
26 # if defined(MSDOS) || defined(WIN3264)
27 #  define DFLT_EFM	"%f(%l) : %t%*\\D%n: %m,%*[^\"]\"%f\"%*\\D%l: %m,%f(%l) : %m,%*[^ ] %f %l: %m,%f:%l:%m"
28 # else
29 #  if defined(__EMX__)	/* put most common here (i.e. gcc format) at front */
30 #   define DFLT_EFM	"%f:%l:%m,%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%f(%l:%c) : %m"
31 #  else
32 #   if defined(__QNX__)
33 #    define DFLT_EFM	"%f(%l):%*[^WE]%t%*\\D%n:%m"
34 #   else
35 #    ifdef VMS
36 #     define DFLT_EFM	"%A%p^,%C%%CC-%t-%m,%Cat line number %l in file %f"
37 #    else /* Unix, probably */
38 #     ifdef EBCDIC
39 #define DFLT_EFM	"%*[^ ] %*[^ ] %f:%l%*[ ]%m,%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%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"
40 #     else
41 #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.),%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"
42 #     endif
43 #    endif
44 #   endif
45 #  endif
46 # endif
47 #endif
48 
49 #define DFLT_GREPFORMAT	"%f:%l:%m,%f:%l%m,%f  %l%m"
50 
51 /* default values for b_p_ff 'fileformat' and p_ffs 'fileformats' */
52 #define FF_DOS		"dos"
53 #define FF_MAC		"mac"
54 #define FF_UNIX		"unix"
55 
56 #ifdef USE_CRNL
57 # define DFLT_FF	"dos"
58 # define DFLT_FFS_VIM	"dos,unix"
59 # define DFLT_FFS_VI	"dos,unix"	/* also autodetect in compatible mode */
60 # define DFLT_TEXTAUTO	TRUE
61 #else
62 # ifdef USE_CR
63 #  define DFLT_FF	"mac"
64 #  define DFLT_FFS_VIM	"mac,unix,dos"
65 #  define DFLT_FFS_VI	"mac,unix,dos"
66 #  define DFLT_TEXTAUTO	TRUE
67 # else
68 #  define DFLT_FF	"unix"
69 #  define DFLT_FFS_VIM	"unix,dos"
70 #  ifdef __CYGWIN__
71 #   define DFLT_FFS_VI	"unix,dos"	/* Cygwin always needs file detection */
72 #   define DFLT_TEXTAUTO TRUE
73 #  else
74 #   define DFLT_FFS_VI	""
75 #   define DFLT_TEXTAUTO FALSE
76 #  endif
77 # endif
78 #endif
79 
80 
81 #ifdef FEAT_MBYTE
82 /* Possible values for 'encoding' */
83 # define ENC_UCSBOM	"ucs-bom"	/* check for BOM at start of file */
84 
85 /* default value for 'encoding' */
86 # define ENC_DFLT	"latin1"
87 #endif
88 
89 /* end-of-line style */
90 #define EOL_UNKNOWN	-1	/* not defined yet */
91 #define EOL_UNIX	0	/* NL */
92 #define EOL_DOS		1	/* CR NL */
93 #define EOL_MAC		2	/* CR */
94 
95 /* Formatting options for p_fo 'formatoptions' */
96 #define FO_WRAP		't'
97 #define FO_WRAP_COMS	'c'
98 #define FO_RET_COMS	'r'
99 #define FO_OPEN_COMS	'o'
100 #define FO_Q_COMS	'q'
101 #define FO_Q_NUMBER	'n'
102 #define FO_Q_SECOND	'2'
103 #define FO_INS_VI	'v'
104 #define FO_INS_LONG	'l'
105 #define FO_INS_BLANK	'b'
106 #define FO_MBYTE_BREAK	'm'	/* break before/after multi-byte char */
107 #define FO_MBYTE_JOIN	'M'	/* no space before/after multi-byte char */
108 #define FO_MBYTE_JOIN2	'B'	/* no space between multi-byte chars */
109 #define FO_ONE_LETTER	'1'
110 #define FO_WHITE_PAR	'w'	/* trailing white space continues paragr. */
111 #define FO_AUTO		'a'	/* automatic formatting */
112 
113 #define DFLT_FO_VI	"vt"
114 #define DFLT_FO_VIM	"tcq"
115 #define FO_ALL		"tcroq2vlb1mMBn,aw"	/* for do_set() */
116 
117 /* characters for the p_cpo option: */
118 #define CPO_ALTREAD	'a'	/* ":read" sets alternate file name */
119 #define CPO_ALTWRITE	'A'	/* ":write" sets alternate file name */
120 #define CPO_BAR		'b'	/* "\|" ends a mapping */
121 #define CPO_BSLASH	'B'	/* backslash in mapping is not special */
122 #define CPO_SEARCH	'c'
123 #define CPO_CONCAT	'C'	/* Don't concatenate sourced lines */
124 #define CPO_DOTTAG	'd'	/* "./tags" in 'tags' is in current dir */
125 #define CPO_DIGRAPH	'D'	/* No digraph after "r", "f", etc. */
126 #define CPO_EXECBUF	'e'
127 #define CPO_EMPTYREGION	'E'	/* operating on empty region is an error */
128 #define CPO_FNAMER	'f'	/* set file name for ":r file" */
129 #define CPO_FNAMEW	'F'	/* set file name for ":w file" */
130 #define CPO_GOTO1	'g'	/* goto line 1 for ":edit" */
131 #define CPO_INTMOD	'i'	/* interrupt a read makes buffer modified */
132 #define CPO_INDENT	'I'	/* remove auto-indent more often */
133 #define CPO_JOINSP	'j'	/* only use two spaces for join after '.' */
134 #define CPO_ENDOFSENT	'J'	/* need two spaces to detect end of sentence */
135 #define CPO_KEYCODE	'k'	/* don't recognize raw key code in mappings */
136 #define CPO_KOFFSET	'K'	/* don't wait for key code in mappings */
137 #define CPO_LITERAL	'l'	/* take char after backslash in [] literal */
138 #define CPO_LISTWM	'L'	/* 'list' changes wrapmargin */
139 #define CPO_SHOWMATCH	'm'
140 #define CPO_MATCHBSL	'M'	/* "%" ignores use of backslashes */
141 #define CPO_NUMCOL	'n'	/* 'number' column also used for text */
142 #define CPO_LINEOFF	'o'
143 #define CPO_OVERNEW	'O'	/* silently overwrite new file */
144 #define CPO_LISP	'p'	/* 'lisp' indenting */
145 #define CPO_REDO	'r'
146 #define CPO_REMMARK	'R'	/* remove marks when filtering */
147 #define CPO_BUFOPT	's'
148 #define CPO_BUFOPTGLOB	'S'
149 #define CPO_TAGPAT	't'
150 #define CPO_UNDO	'u'	/* "u" undoes itself */
151 #define CPO_BACKSPACE	'v'	/* "v" keep deleted text */
152 #define CPO_CW		'w'	/* "cw" only changes one blank */
153 #define CPO_FWRITE	'W'	/* "w!" doesn't overwrite readonly files */
154 #define CPO_ESC		'x'
155 #define CPO_YANK	'y'
156 #define CPO_DOLLAR	'$'
157 #define CPO_FILTER	'!'
158 #define CPO_MATCH	'%'
159 #define CPO_STAR	'*'	/* ":*" means ":@" */
160 #define CPO_SPECI	'<'	/* don't recognize <> in mappings */
161 #define CPO_DEFAULT	"aABceFs"
162 #define CPO_ALL		"aAbBcCdDeEfFgiIjJkKlLmMnoOprRsStuvwWxy$!%*<"
163 
164 /* characters for p_ww option: */
165 #define WW_ALL		"bshl<>[],~"
166 
167 /* characters for p_mouse option: */
168 #define MOUSE_NORMAL	'n'		/* use mouse in Normal mode */
169 #define MOUSE_VISUAL	'v'		/* use mouse in Visual/Select mode */
170 #define MOUSE_INSERT	'i'		/* use mouse in Insert mode */
171 #define MOUSE_COMMAND	'c'		/* use mouse in Command-line mode */
172 #define MOUSE_HELP	'h'		/* use mouse in help buffers */
173 #define MOUSE_RETURN	'r'		/* use mouse for hit-return message */
174 #define MOUSE_A		"nvich"		/* used for 'a' flag */
175 #define MOUSE_ALL	"anvichr"	/* all possible characters */
176 #define MOUSE_NONE	' '		/* don't use Visual selection */
177 #define MOUSE_NONEF	'x'		/* forced modeless selection */
178 
179 /* characters for p_shm option: */
180 #define SHM_RO		'r'		/* readonly */
181 #define SHM_MOD		'm'		/* modified */
182 #define SHM_FILE	'f'		/* (file 1 of 2) */
183 #define SHM_LAST	'i'		/* last line incomplete */
184 #define SHM_TEXT	'x'		/* tx instead of textmode */
185 #define SHM_LINES	'l'		/* "L" instead of "lines" */
186 #define SHM_NEW		'n'		/* "[New]" instead of "[New file]" */
187 #define SHM_WRI		'w'		/* "[w]" instead of "written" */
188 #define SHM_A		"rmfixlnw"	/* represented by 'a' flag */
189 #define SHM_WRITE	'W'		/* don't use "written" at all */
190 #define SHM_TRUNC	't'		/* trunctate file messages */
191 #define SHM_TRUNCALL	'T'		/* trunctate all messages */
192 #define SHM_OVER	'o'		/* overwrite file messages */
193 #define SHM_OVERALL	'O'		/* overwrite more messages */
194 #define SHM_SEARCH	's'		/* no search hit bottom messages */
195 #define SHM_ATTENTION	'A'		/* no ATTENTION messages */
196 #define SHM_INTRO	'I'		/* intro messages */
197 #define SHM_ALL		"rmfixlnwaWtToOsAI" /* all possible flags for 'shm' */
198 
199 /* characters for p_go: */
200 #define GO_ASEL		'a'		/* autoselect */
201 #define GO_ASELML	'A'		/* autoselect modeless selection */
202 #define GO_BOT		'b'		/* use bottom scrollbar */
203 #define GO_CONDIALOG	'c'		/* use console dialog */
204 #define GO_FORG		'f'		/* start GUI in foreground */
205 #define GO_GREY		'g'		/* use grey menu items */
206 #define GO_HORSCROLL	'h'		/* flexible horizontal scrolling */
207 #define GO_ICON		'i'		/* use Vim icon */
208 #define GO_LEFT		'l'		/* use left scrollbar */
209 #define GO_VLEFT	'L'		/* left scrollbar with vert split */
210 #define GO_MENUS	'm'		/* use menu bar */
211 #define GO_NOSYSMENU	'M'		/* don't source system menu */
212 #define GO_POINTER	'p'		/* pointer enter/leave callbacks */
213 #define GO_RIGHT	'r'		/* use right scrollbar */
214 #define GO_VRIGHT	'R'		/* right scrollbar with vert split */
215 #define GO_TEAROFF	't'		/* add tear-off menu items */
216 #define GO_TOOLBAR	'T'		/* add toolbar */
217 #define GO_FOOTER	'F'		/* add footer */
218 #define GO_VERTICAL	'v'		/* arrange dialog buttons vertically */
219 #define GO_ALL		"aAbcfFghilmMprtTv" /* all possible flags for 'go' */
220 
221 /* flags for 'comments' option */
222 #define COM_NEST	'n'		/* comments strings nest */
223 #define COM_BLANK	'b'		/* needs blank after string */
224 #define COM_START	's'		/* start of comment */
225 #define COM_MIDDLE	'm'		/* middle of comment */
226 #define COM_END		'e'		/* end of comment */
227 #define COM_AUTO_END	'x'		/* last char of end closes comment */
228 #define COM_FIRST	'f'		/* first line comment only */
229 #define COM_LEFT	'l'		/* left adjusted */
230 #define COM_RIGHT	'r'		/* right adjusted */
231 #define COM_NOBACK	'O'		/* don't use for "O" command */
232 #define COM_ALL		"nbsmexflrO"	/* all flags for 'comments' option */
233 #define COM_MAX_LEN	50		/* maximum length of a part */
234 
235 /* flags for 'statusline' option */
236 #define STL_FILEPATH	'f'		/* path of file in buffer */
237 #define STL_FULLPATH	'F'		/* full path of file in buffer */
238 #define STL_FILENAME	't'		/* last part (tail) of file path */
239 #define STL_COLUMN	'c'		/* column og cursor*/
240 #define STL_VIRTCOL	'v'		/* virtual column */
241 #define STL_VIRTCOL_ALT	'V'		/* - with 'if different' display */
242 #define STL_LINE	'l'		/* line number of cursor */
243 #define STL_NUMLINES	'L'		/* number of lines in buffer */
244 #define STL_BUFNO	'n'		/* current buffer number */
245 #define STL_KEYMAP	'k'		/* 'keymap' when active */
246 #define STL_OFFSET	'o'		/* offset of character under cursor*/
247 #define STL_OFFSET_X	'O'		/* - in hexadecimal */
248 #define STL_BYTEVAL	'b'		/* byte value of character */
249 #define STL_BYTEVAL_X	'B'		/* - in hexadecimal */
250 #define STL_ROFLAG	'r'		/* readonly flag */
251 #define STL_ROFLAG_ALT	'R'		/* - other display */
252 #define STL_HELPFLAG	'h'		/* window is showing a help file */
253 #define STL_HELPFLAG_ALT 'H'		/* - other display */
254 #define STL_FILETYPE	'y'		/* 'filetype' */
255 #define STL_FILETYPE_ALT 'Y'		/* - other display */
256 #define STL_PREVIEWFLAG	'w'		/* window is showing the preview buf */
257 #define STL_PREVIEWFLAG_ALT 'W'		/* - other display */
258 #define STL_MODIFIED	'm'		/* modified flag */
259 #define STL_MODIFIED_ALT 'M'		/* - other display */
260 #define STL_PERCENTAGE	'p'		/* percentage through file */
261 #define STL_ALTPERCENT	'P'		/* percentage as TOP BOT ALL or NN% */
262 #define STL_ARGLISTSTAT	'a'		/* argument list status as (x of y) */
263 #define STL_PAGENUM	'N'		/* page number (when printing)*/
264 #define STL_VIM_EXPR	'{'		/* start of expression to substitute */
265 #define STL_MIDDLEMARK	'='		/* separation between left and right */
266 #define STL_TRUNCMARK	'<'		/* truncation mark if line is too long*/
267 #define STL_HIGHLIGHT	'*'		/* highlight from (User)1..9 or 0 */
268 #define STL_ALL		((char_u *) "fFtcvVlLknoObBrRhHmYyWwMpPaN{")
269 
270 /* flags used for parsed 'wildmode' */
271 #define WIM_FULL	1
272 #define WIM_LONGEST	2
273 #define WIM_LIST	4
274 
275 /* arguments for can_bs() */
276 #define BS_INDENT	'i'	/* "Indent" */
277 #define BS_EOL		'o'	/* "eOl" */
278 #define BS_START	's'	/* "Start" */
279 
280 #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"
281 
282 /*
283  * The following are actual variabables for the options
284  */
285 
286 #ifdef FEAT_RIGHTLEFT
287 EXTERN long	p_aleph;	/* 'aleph' */
288 #endif
289 #if defined(FEAT_NETBEANS_INTG) || defined(FEAT_SUN_WORKSHOP)
290 EXTERN int	p_acd;		/* 'autochdir' */
291 #endif
292 #ifdef FEAT_MBYTE
293 EXTERN char_u	*p_ambw;	/* 'ambiwidth' */
294 #endif
295 #if defined(FEAT_GUI) && defined(MACOS_X)
296 EXTERN int	*p_antialias;	/* 'antialias' */
297 #endif
298 EXTERN int	p_ar;		/* 'autoread' */
299 EXTERN int	p_aw;		/* 'autowrite' */
300 EXTERN int	p_awa;		/* 'autowriteall' */
301 EXTERN char_u	*p_bs;		/* 'backspace' */
302 EXTERN char_u	*p_bg;		/* 'background' */
303 EXTERN int	p_bk;		/* 'backup' */
304 EXTERN char_u	*p_bkc;		/* 'backupcopy' */
305 EXTERN unsigned	bkc_flags;
306 #ifdef IN_OPTION_C
307 static char *(p_bkc_values[]) = {"yes", "auto", "no", "breaksymlink", "breakhardlink", NULL};
308 #endif
309 # define BKC_YES		0x001
310 # define BKC_AUTO		0x002
311 # define BKC_NO			0x004
312 # define BKC_BREAKSYMLINK	0x008
313 # define BKC_BREAKHARDLINK	0x010
314 EXTERN char_u	*p_bdir;	/* 'backupdir' */
315 EXTERN char_u	*p_bex;		/* 'backupext' */
316 #ifdef FEAT_WILDIGN
317 EXTERN char_u	*p_bsk;		/* 'backupskip' */
318 #endif
319 #ifdef FEAT_BEVAL
320 EXTERN long	p_bdlay;	/* 'balloondelay' */
321 # if defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG)
322 EXTERN int	p_beval;	/* 'ballooneval' */
323 # endif
324 #endif
325 #ifdef FEAT_BROWSE
326 EXTERN char_u	*p_bsdir;	/* 'browsedir' */
327 #endif
328 #ifdef MSDOS
329 EXTERN int	p_biosk;	/* 'bioskey' */
330 EXTERN int	p_consk;	/* 'conskey' */
331 #endif
332 #ifdef FEAT_LINEBREAK
333 EXTERN char_u	*p_breakat;	/* 'breakat' */
334 #endif
335 EXTERN char_u	*p_cmp;		/* 'casemap' */
336 EXTERN unsigned	cmp_flags;
337 #ifdef IN_OPTION_C
338 static char *(p_cmp_values[]) = {"internal", "keepascii", NULL};
339 #endif
340 #define CMP_INTERNAL		0x001
341 #define CMP_KEEPASCII		0x002
342 #ifdef FEAT_MBYTE
343 EXTERN char_u	*p_enc;		/* 'encoding' */
344 EXTERN int	p_deco;		/* 'delcombine' */
345 # ifdef FEAT_EVAL
346 EXTERN char_u	*p_ccv;		/* 'charconvert' */
347 # endif
348 #endif
349 #ifdef FEAT_CMDWIN
350 EXTERN char_u	*p_cedit;	/* 'cedit' */
351 EXTERN long	p_cwh;		/* 'cmdwinheight' */
352 #endif
353 #ifdef FEAT_CLIPBOARD
354 EXTERN char_u	*p_cb;		/* 'clipboard' */
355 EXTERN int	clip_unnamed INIT(= FALSE);
356 EXTERN int	clip_autoselect INIT(= FALSE);
357 EXTERN int	clip_autoselectml INIT(= FALSE);
358 EXTERN regprog_T *clip_exclude_prog INIT(= NULL);
359 #endif
360 EXTERN long	p_ch;		/* 'cmdheight' */
361 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
362 EXTERN int	p_confirm;	/* 'confirm' */
363 #endif
364 EXTERN int	p_cp;		/* 'compatible' */
365 EXTERN char_u	*p_cpo;		/* 'cpoptions' */
366 #ifdef FEAT_CSCOPE
367 EXTERN char_u	*p_csprg;	/* 'cscopeprg' */
368 # ifdef FEAT_QUICKFIX
369 EXTERN char_u	*p_csqf;	/* 'cscopequickfix' */
370 #  define	CSQF_CMDS   "sgdctefi"
371 #  define	CSQF_FLAGS  "+-0"
372 # endif
373 EXTERN int	p_cst;		/* 'cscopetag' */
374 EXTERN long	p_csto;		/* 'cscopetagorder' */
375 EXTERN long	p_cspc;		/* 'cscopepathcomp' */
376 EXTERN int	p_csverbose;	/* 'cscopeverbose' */
377 #endif
378 EXTERN char_u	*p_debug;	/* 'debug' */
379 #ifdef FEAT_FIND_ID
380 EXTERN char_u	*p_def;		/* 'define' */
381 EXTERN char_u	*p_inc;
382 #endif
383 #ifdef FEAT_DIFF
384 EXTERN char_u	*p_dip;		/* 'diffopt' */
385 # ifdef FEAT_EVAL
386 EXTERN char_u	*p_dex;		/* 'diffexpr' */
387 # endif
388 #endif
389 #ifdef FEAT_INS_EXPAND
390 EXTERN char_u	*p_dict;	/* 'dictionary' */
391 #endif
392 #ifdef FEAT_DIGRAPHS
393 EXTERN int	p_dg;		/* 'digraph' */
394 #endif
395 EXTERN char_u	*p_dir;		/* 'directory' */
396 EXTERN char_u	*p_dy;		/* 'display' */
397 EXTERN unsigned	dy_flags;
398 #ifdef IN_OPTION_C
399 static char *(p_dy_values[]) = {"lastline", "uhex", NULL};
400 #endif
401 #define DY_LASTLINE		0x001
402 #define DY_UHEX			0x002
403 EXTERN int	p_ed;		/* 'edcompatible' */
404 #ifdef FEAT_VERTSPLIT
405 EXTERN char_u	*p_ead;		/* 'eadirection' */
406 #endif
407 EXTERN int	p_ea;		/* 'equalalways' */
408 EXTERN char_u	*p_ep;		/* 'equalprg' */
409 EXTERN int	p_eb;		/* 'errorbells' */
410 #ifdef FEAT_QUICKFIX
411 EXTERN char_u	*p_ef;		/* 'errorfile' */
412 EXTERN char_u	*p_efm;		/* 'errorformat' */
413 EXTERN char_u	*p_gefm;	/* 'grepformat' */
414 EXTERN char_u	*p_gp;		/* 'grepprg' */
415 #endif
416 #ifdef FEAT_AUTOCMD
417 EXTERN char_u	*p_ei;		/* 'eventignore' */
418 #endif
419 EXTERN int	p_ek;		/* 'esckeys' */
420 EXTERN int	p_exrc;		/* 'exrc' */
421 #ifdef FEAT_MBYTE
422 EXTERN char_u	*p_fencs;	/* 'fileencodings' */
423 #endif
424 EXTERN char_u	*p_ffs;		/* 'fileformats' */
425 #ifdef FEAT_FOLDING
426 EXTERN char_u	*p_fcl;		/* 'foldclose' */
427 EXTERN long	p_fdls;		/* 'foldlevelstart' */
428 EXTERN char_u	*p_fdo;		/* 'foldopen' */
429 EXTERN unsigned	fdo_flags;
430 # ifdef IN_OPTION_C
431 static char *(p_fdo_values[]) = {"all", "block", "hor", "mark", "percent",
432 				 "quickfix", "search", "tag", "insert",
433 				 "undo", "jump", NULL};
434 # endif
435 # define FDO_ALL		0x001
436 # define FDO_BLOCK		0x002
437 # define FDO_HOR		0x004
438 # define FDO_MARK		0x008
439 # define FDO_PERCENT		0x010
440 # define FDO_QUICKFIX		0x020
441 # define FDO_SEARCH		0x040
442 # define FDO_TAG		0x080
443 # define FDO_INSERT		0x100
444 # define FDO_UNDO		0x200
445 # define FDO_JUMP		0x400
446 #endif
447 EXTERN char_u	*p_fp;		/* 'formatprg' */
448 EXTERN int	p_gd;		/* 'gdefault' */
449 #ifdef FEAT_PRINTER
450 EXTERN char_u	*p_pdev;	/* 'printdevice' */
451 # ifdef FEAT_POSTSCRIPT
452 EXTERN char_u	*p_penc;	/* 'printencoding' */
453 EXTERN char_u	*p_pexpr;	/* 'printexpr' */
454 # endif
455 EXTERN char_u	*p_pfn;		/* 'printfont' */
456 EXTERN char_u	*p_popt;	/* 'printoptions' */
457 EXTERN char_u	*p_header;	/* 'printheader' */
458 #endif
459 #ifdef FEAT_GUI
460 EXTERN char_u	*p_guifont;	/* 'guifont' */
461 # ifdef FEAT_XFONTSET
462 EXTERN char_u	*p_guifontset;	/* 'guifontset' */
463 # endif
464 # ifdef FEAT_MBYTE
465 EXTERN char_u	*p_guifontwide;	/* 'guifontwide' */
466 # endif
467 EXTERN int	p_guipty;	/* 'guipty' */
468 #endif
469 #if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11) || defined(FEAT_GUI_KDE)
470 EXTERN long	p_ghr;		/* 'guiheadroom' */
471 #endif
472 #ifdef CURSOR_SHAPE
473 EXTERN char_u	*p_guicursor;	/* 'guicursor' */
474 #endif
475 #ifdef FEAT_MOUSESHAPE
476 EXTERN char_u	*p_mouseshape;	/* 'mouseshape' */
477 #endif
478 #if defined(FEAT_GUI)
479 EXTERN char_u	*p_go;		/* 'guioptions' */
480 #endif
481 EXTERN char_u	*p_hf;		/* 'helpfile' */
482 #ifdef FEAT_WINDOWS
483 EXTERN long	p_hh;		/* 'helpheight' */
484 #endif
485 #ifdef FEAT_MULTI_LANG
486 EXTERN char_u	*p_hlg;		/* 'helplang' */
487 #endif
488 EXTERN int	p_hid;		/* 'hidden' */
489 /* Use P_HID to check if a buffer is to be hidden when it is no longer
490  * visible in a window. */
491 #ifndef FEAT_QUICKFIX
492 # define P_HID(dummy) (p_hid || cmdmod.hide)
493 #else
494 # define P_HID(buf) (buf_hide(buf))
495 #endif
496 EXTERN char_u	*p_hl;		/* 'highlight' */
497 EXTERN int	p_hls;		/* 'hlsearch' */
498 EXTERN long	p_hi;		/* 'history' */
499 #ifdef FEAT_RIGHTLEFT
500 EXTERN int	p_hkmap;	/* 'hkmap' */
501 EXTERN int	p_hkmapp;	/* 'hkmapp' */
502 # ifdef FEAT_FKMAP
503 EXTERN int	p_fkmap;	/* 'fkmap' */
504 EXTERN int	p_altkeymap;	/* 'altkeymap' */
505 # endif
506 # ifdef FEAT_ARABIC
507 EXTERN int	p_arshape;	/* 'arabicshape' */
508 # endif
509 #endif
510 #ifdef FEAT_TITLE
511 EXTERN int	p_icon;		/* 'icon' */
512 EXTERN char_u	*p_iconstring;	/* 'iconstring' */
513 #endif
514 EXTERN int	p_ic;		/* 'ignorecase' */
515 #if defined(FEAT_XIM) && (defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE))
516 EXTERN char_u	*p_imak;	/* 'imactivatekey' */
517 #endif
518 #ifdef USE_IM_CONTROL
519 EXTERN int	p_imcmdline;	/* 'imcmdline' */
520 EXTERN int	p_imdisable;	/* 'imdisable' */
521 #endif
522 EXTERN int	p_is;		/* 'incsearch' */
523 EXTERN int	p_im;		/* 'insertmode' */
524 EXTERN char_u	*p_isf;		/* 'isfname' */
525 EXTERN char_u	*p_isi;		/* 'isident' */
526 EXTERN char_u	*p_isp;		/* 'isprint' */
527 EXTERN int	p_js;		/* 'joinspaces' */
528 EXTERN char_u	*p_kp;		/* 'keywordprg' */
529 #ifdef FEAT_VISUAL
530 EXTERN char_u	*p_km;		/* 'keymodel' */
531 #endif
532 #ifdef FEAT_LANGMAP
533 EXTERN char_u	*p_langmap;	/* 'langmap'*/
534 #endif
535 #if defined(FEAT_MENU) && defined(FEAT_MULTI_LANG)
536 EXTERN char_u	*p_lm;		/* 'langmenu' */
537 #endif
538 #ifdef FEAT_GUI
539 EXTERN long	p_linespace;	/* 'linespace' */
540 #endif
541 #ifdef FEAT_LISP
542 EXTERN char_u	*p_lispwords;	/* 'lispwords' */
543 #endif
544 #ifdef FEAT_WINDOWS
545 EXTERN long	p_ls;		/* 'laststatus' */
546 #endif
547 EXTERN char_u	*p_lcs;		/* 'listchars' */
548 
549 EXTERN int	p_lz;		/* 'lazyredraw' */
550 EXTERN int	p_lpl;		/* 'loadplugins' */
551 EXTERN int	p_magic;	/* 'magic' */
552 #ifdef FEAT_QUICKFIX
553 EXTERN char_u	*p_mef;		/* 'makeef' */
554 EXTERN char_u	*p_mp;		/* 'makeprg' */
555 #endif
556 EXTERN long	p_mat;		/* 'matchtime' */
557 #ifdef FEAT_EVAL
558 EXTERN long	p_mfd;		/* 'maxfuncdepth' */
559 #endif
560 EXTERN long	p_mmd;		/* 'maxmapdepth' */
561 EXTERN long	p_mm;		/* 'maxmem' */
562 EXTERN long	p_mmt;		/* 'maxmemtot' */
563 #ifdef FEAT_MENU
564 EXTERN long	p_mis;		/* 'menuitems' */
565 #endif
566 EXTERN long	p_mls;		/* 'modelines' */
567 EXTERN char_u	*p_mouse;	/* 'mouse' */
568 #ifdef FEAT_GUI
569 EXTERN int	p_mousef;	/* 'mousefocus' */
570 EXTERN int	p_mh;		/* 'mousehide' */
571 #endif
572 EXTERN char_u	*p_mousem;	/* 'mousemodel' */
573 EXTERN long	p_mouset;	/* 'mousetime' */
574 EXTERN int	p_more;		/* 'more' */
575 EXTERN char_u	*p_para;	/* 'paragraphs' */
576 EXTERN int	p_paste;	/* 'paste' */
577 EXTERN char_u	*p_pt;		/* 'pastetoggle' */
578 #if defined(FEAT_EVAL) && defined(FEAT_DIFF)
579 EXTERN char_u	*p_pex;		/* 'patchexpr' */
580 #endif
581 EXTERN char_u	*p_pm;		/* 'patchmode' */
582 EXTERN char_u	*p_path;	/* 'path' */
583 #ifdef FEAT_SEARCHPATH
584 EXTERN char_u	*p_cdpath;	/* 'cdpath' */
585 #endif
586 EXTERN int	p_remap;	/* 'remap' */
587 EXTERN long	p_report;	/* 'report' */
588 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
589 EXTERN long	p_pvh;		/* 'previewheight' */
590 #endif
591 #ifdef WIN3264
592 EXTERN int	p_rs;		/* 'restorescreen' */
593 #endif
594 #ifdef FEAT_RIGHTLEFT
595 EXTERN int	p_ari;		/* 'allowrevins' */
596 EXTERN int	p_ri;		/* 'revins' */
597 #endif
598 #ifdef FEAT_CMDL_INFO
599 EXTERN int	p_ru;		/* 'ruler' */
600 #endif
601 #ifdef FEAT_STL_OPT
602 EXTERN char_u	*p_ruf;		/* 'rulerformat' */
603 #endif
604 EXTERN char_u	*p_rtp;		/* 'runtimepath' */
605 EXTERN long	p_sj;		/* 'scrolljump' */
606 EXTERN long	p_so;		/* 'scrolloff' */
607 #ifdef FEAT_SCROLLBIND
608 EXTERN char_u	*p_sbo;		/* 'scrollopt' */
609 #endif
610 EXTERN char_u	*p_sections;	/* 'sections' */
611 EXTERN int	p_secure;	/* 'secure' */
612 #ifdef FEAT_VISUAL
613 EXTERN char_u	*p_sel;		/* 'selection' */
614 EXTERN char_u	*p_slm;		/* 'selectmode' */
615 #endif
616 #ifdef FEAT_SESSION
617 EXTERN char_u	*p_ssop;	/* 'sessionoptions' */
618 EXTERN unsigned	ssop_flags;
619 # ifdef IN_OPTION_C
620 /* Also used for 'viewoptions'! */
621 static char *(p_ssop_values[]) = {"buffers", "winpos", "resize", "winsize",
622     "localoptions", "options", "help", "blank", "globals", "slash", "unix",
623     "sesdir", "curdir", "folds", "cursor", NULL};
624 # endif
625 # define SSOP_BUFFERS		0x001
626 # define SSOP_WINPOS		0x002
627 # define SSOP_RESIZE		0x004
628 # define SSOP_WINSIZE		0x008
629 # define SSOP_LOCALOPTIONS	0x010
630 # define SSOP_OPTIONS		0x020
631 # define SSOP_HELP		0x040
632 # define SSOP_BLANK		0x080
633 # define SSOP_GLOBALS		0x100
634 # define SSOP_SLASH		0x200
635 # define SSOP_UNIX		0x400
636 # define SSOP_SESDIR		0x800
637 # define SSOP_CURDIR		0x1000
638 # define SSOP_FOLDS		0x2000
639 # define SSOP_CURSOR		0x4000
640 #endif
641 EXTERN char_u	*p_sh;		/* 'shell' */
642 EXTERN char_u	*p_shcf;	/* 'shellcmdflag' */
643 #ifdef FEAT_QUICKFIX
644 EXTERN char_u	*p_sp;		/* 'shellpipe' */
645 #endif
646 EXTERN char_u	*p_shq;		/* 'shellquote' */
647 EXTERN char_u	*p_sxq;		/* 'shellxquote' */
648 EXTERN char_u	*p_srr;		/* 'shellredir' */
649 #ifdef AMIGA
650 EXTERN long	p_st;		/* 'shelltype' */
651 #endif
652 #ifdef BACKSLASH_IN_FILENAME
653 EXTERN int	p_ssl;		/* 'shellslash' */
654 #endif
655 #ifdef FEAT_STL_OPT
656 EXTERN char_u	*p_stl;		/* 'statusline' */
657 #endif
658 EXTERN int	p_sr;		/* 'shiftround' */
659 EXTERN char_u	*p_shm;		/* 'shortmess' */
660 #ifdef FEAT_LINEBREAK
661 EXTERN char_u	*p_sbr;		/* 'showbreak' */
662 #endif
663 #ifdef FEAT_CMDL_INFO
664 EXTERN int	p_sc;		/* 'showcmd' */
665 #endif
666 EXTERN int	p_sft;		/* 'showfulltag' */
667 EXTERN int	p_sm;		/* 'showmatch' */
668 EXTERN int	p_smd;		/* 'showmode' */
669 EXTERN long	p_ss;		/* 'sidescroll' */
670 EXTERN long	p_siso;		/* 'sidescrolloff' */
671 EXTERN int	p_scs;		/* 'smartcase' */
672 EXTERN int	p_sta;		/* 'smarttab' */
673 #ifdef FEAT_WINDOWS
674 EXTERN int	p_sb;		/* 'splitbelow' */
675 #endif
676 #ifdef FEAT_VERTSPLIT
677 EXTERN int	p_spr;		/* 'splitright' */
678 #endif
679 EXTERN int	p_sol;		/* 'startofline' */
680 EXTERN char_u	*p_su;		/* 'suffixes' */
681 EXTERN char_u	*p_sws;		/* 'swapsync' */
682 EXTERN char_u	*p_swb;		/* 'switchbuf' */
683 EXTERN int	p_tbs;		/* 'tagbsearch' */
684 EXTERN long	p_tl;		/* 'taglength' */
685 EXTERN int	p_tr;		/* 'tagrelative' */
686 EXTERN char_u	*p_tags;	/* 'tags' */
687 EXTERN int	p_tgst;		/* 'tagstack' */
688 #ifdef FEAT_ARABIC
689 EXTERN int	p_tbidi;	/* 'termbidi' */
690 #endif
691 #ifdef FEAT_MBYTE
692 EXTERN char_u	*p_tenc;	/* 'termencoding' */
693 #endif
694 EXTERN int	p_terse;	/* 'terse' */
695 EXTERN int	p_ta;		/* 'textauto' */
696 EXTERN int	p_to;		/* 'tildeop' */
697 EXTERN int	p_timeout;	/* 'timeout' */
698 EXTERN long	p_tm;		/* 'timeoutlen' */
699 #ifdef FEAT_TITLE
700 EXTERN int	p_title;	/* 'title' */
701 EXTERN long	p_titlelen;	/* 'titlelen' */
702 EXTERN char_u	*p_titleold;	/* 'titleold' */
703 EXTERN char_u	*p_titlestring;	/* 'titlestring' */
704 #endif
705 #ifdef FEAT_INS_EXPAND
706 EXTERN char_u	*p_tsr;		/* 'thesaurus' */
707 #endif
708 EXTERN int	p_ttimeout;	/* 'ttimeout' */
709 EXTERN long	p_ttm;		/* 'ttimeoutlen' */
710 EXTERN int	p_tbi;		/* 'ttybuiltin' */
711 EXTERN int	p_tf;		/* 'ttyfast' */
712 #if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
713 EXTERN char_u	*p_toolbar;	/* 'toolbar' */
714 EXTERN unsigned toolbar_flags;
715 # ifdef IN_OPTION_C
716 static char *(p_toolbar_values[]) = {"text", "icons", "tooltips", "horiz", NULL};
717 # endif
718 # define TOOLBAR_TEXT		0x01
719 # define TOOLBAR_ICONS		0x02
720 # define TOOLBAR_TOOLTIPS	0x04
721 # define TOOLBAR_HORIZ		0x08
722 #endif
723 #if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK) && defined(HAVE_GTK2)
724 EXTERN char_u	*p_tbis;	/* 'toolbariconsize' */
725 EXTERN unsigned tbis_flags;
726 # ifdef IN_OPTION_C
727 static char *(p_tbis_values[]) = {"tiny", "small", "medium", "large", NULL};
728 # endif
729 # define TBIS_TINY		0x01
730 # define TBIS_SMALL		0x02
731 # define TBIS_MEDIUM		0x04
732 # define TBIS_LARGE		0x08
733 #endif
734 EXTERN long	p_ttyscroll;	/* 'ttyscroll' */
735 #if defined(FEAT_MOUSE) && (defined(UNIX) || defined(VMS))
736 EXTERN char_u	*p_ttym;	/* 'ttymouse' */
737 EXTERN unsigned ttym_flags;
738 # ifdef IN_OPTION_C
739 static char *(p_ttym_values[]) = {"xterm", "xterm2", "dec", "netterm", "jsbterm", "pterm", NULL};
740 # endif
741 # define TTYM_XTERM		0x01
742 # define TTYM_XTERM2		0x02
743 # define TTYM_DEC		0x04
744 # define TTYM_NETTERM		0x08
745 # define TTYM_JSBTERM		0x10
746 # define TTYM_PTERM		0x20
747 #endif
748 EXTERN long	p_ul;		/* 'undolevels' */
749 EXTERN long	p_uc;		/* 'updatecount' */
750 EXTERN long	p_ut;		/* 'updatetime' */
751 #if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
752 EXTERN char_u	*p_fcs;		/* 'fillchar' */
753 #endif
754 #ifdef FEAT_VIMINFO
755 EXTERN char_u	*p_viminfo;	/* 'viminfo' */
756 #endif
757 #ifdef FEAT_SESSION
758 EXTERN char_u	*p_vdir;	/* 'viewdir' */
759 EXTERN char_u	*p_vop;		/* 'viewoptions' */
760 EXTERN unsigned	vop_flags;	/* uses SSOP_ flags */
761 #endif
762 EXTERN int	p_vb;		/* 'visualbell' */
763 #ifdef FEAT_VIRTUALEDIT
764 EXTERN char_u	*p_ve;		/* 'virtualedit' */
765 EXTERN unsigned ve_flags;
766 # ifdef IN_OPTION_C
767 static char *(p_ve_values[]) = {"block", "insert", "all", NULL};
768 # endif
769 # define VE_BLOCK	5	/* includes "all" */
770 # define VE_INSERT	6	/* includes "all" */
771 # define VE_ALL		4
772 #endif
773 EXTERN long	p_verbose;	/* 'verbose' */
774 EXTERN int	p_warn;		/* 'warn' */
775 #if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) || defined(LINT) \
776 	|| defined (FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_KDE)
777 #define FEAT_WAK
778 EXTERN char_u	*p_wak;		/* 'winaltkeys' */
779 #endif
780 #ifdef FEAT_WILDIGN
781 EXTERN char_u	*p_wig;		/* 'wildignore' */
782 #endif
783 EXTERN int	p_wiv;		/* 'weirdinvert' */
784 EXTERN char_u	*p_ww;		/* 'whichwrap' */
785 EXTERN long	p_wc;		/* 'wildchar' */
786 EXTERN long	p_wcm;		/* 'wildcharm' */
787 EXTERN char_u	*p_wim;		/* 'wildmode' */
788 #ifdef FEAT_WILDMENU
789 EXTERN int	p_wmnu;		/* 'wildmenu' */
790 #endif
791 #ifdef FEAT_WINDOWS
792 EXTERN long	p_wh;		/* 'winheight' */
793 EXTERN long	p_wmh;		/* 'winminheight' */
794 #endif
795 #ifdef FEAT_VERTSPLIT
796 EXTERN long	p_wmw;		/* 'winminwidth' */
797 EXTERN long	p_wiw;		/* 'winwidth' */
798 #endif
799 EXTERN int	p_ws;		/* 'wrapscan' */
800 EXTERN int	p_write;	/* 'write' */
801 EXTERN int	p_wa;		/* 'writeany' */
802 EXTERN int	p_wb;		/* 'writebackup' */
803 EXTERN long	p_wd;		/* 'writedelay' */
804