neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

option_vars.h (30893B)


      1 #pragma once
      2 
      3 #include "nvim/macros_defs.h"
      4 #include "nvim/os/os_defs.h"
      5 #include "nvim/sign_defs.h"
      6 #include "nvim/statusline_defs.h"
      7 #include "nvim/types_defs.h"
      8 
      9 #include "option_vars.generated.h"  // NOLINT(build/include_defs)
     10 
     11 // option_vars.h: definition of global variables for settable options
     12 
     13 #define HIGHLIGHT_INIT \
     14  "8:SpecialKey,~:EndOfBuffer,z:TermCursor,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search," \
     15  "y:CurSearch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow,N:CursorLineNr," \
     16  "G:CursorLineSign,O:CursorLineFold,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title," \
     17  "v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange," \
     18  "D:DiffDelete,T:DiffText,E:DiffTextAdd,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap," \
     19  "R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,k:PmenuMatch,<:PmenuMatchSel,[:PmenuKind," \
     20  "]:PmenuKindSel,{:PmenuExtra,}:PmenuExtraSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel," \
     21  "_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,z:StatusLineTerm," \
     22  "Z:StatusLineTermNC,g:MsgArea,h:ComplMatchIns,0:Whitespace,I:PreInsert"
     23 
     24 // Default values for 'errorformat'.
     25 // The "%f|%l| %m" one is used for when the contents of the quickfix window is
     26 // written to a file.
     27 #ifdef MSWIN
     28 # define DFLT_EFM \
     29  "%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"
     30 #else
     31 # define DFLT_EFM \
     32  "%*[^\"]\"%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"
     33 #endif
     34 
     35 // Default values for 'guifont'
     36 #ifdef MSWIN
     37 # define DFLT_GFN "Cascadia Code,Cascadia Mono,Consolas,Courier New,monospace"
     38 #elif defined(__APPLE__)
     39 # define DFLT_GFN "SF Mono,Menlo,Monaco,Courier New,monospace"
     40 #elif defined(__linux__)
     41 # define DFLT_GFN "Source Code Pro,DejaVu Sans Mono,Courier New,monospace"
     42 #else
     43 # define DFLT_GFN "DejaVu Sans Mono,Courier New,monospace"
     44 #endif
     45 
     46 #define DFLT_GREPFORMAT "%f:%l:%m,%f:%l%m,%f  %l%m"
     47 
     48 // Possible values for 'encoding'
     49 #define ENC_UCSBOM     "ucs-bom"       // check for BOM at start of file
     50 
     51 // default value for 'encoding'
     52 #define ENC_DFLT       "utf-8"
     53 
     54 // end-of-line style
     55 #define EOL_UNKNOWN     (-1)    // not defined yet
     56 #define EOL_UNIX        0       // NL
     57 #define EOL_DOS         1       // CR NL
     58 #define EOL_MAC         2       // CR
     59 
     60 // Formatting options for p_fo 'formatoptions'
     61 #define FO_WRAP         't'
     62 #define FO_WRAP_COMS    'c'
     63 #define FO_RET_COMS     'r'
     64 #define FO_OPEN_COMS    'o'
     65 #define FO_NO_OPEN_COMS '/'
     66 #define FO_Q_COMS       'q'
     67 #define FO_Q_NUMBER     'n'
     68 #define FO_Q_SECOND     '2'
     69 #define FO_INS_VI       'v'
     70 #define FO_INS_LONG     'l'
     71 #define FO_INS_BLANK    'b'
     72 #define FO_MBYTE_BREAK  'm'     // break before/after multi-byte char
     73 #define FO_MBYTE_JOIN   'M'     // no space before/after multi-byte char
     74 #define FO_MBYTE_JOIN2  'B'     // no space between multi-byte chars
     75 #define FO_ONE_LETTER   '1'
     76 #define FO_WHITE_PAR    'w'     // trailing white space continues paragr.
     77 #define FO_AUTO         'a'     // automatic formatting
     78 #define FO_RIGOROUS_TW  ']'     // respect textwidth rigorously
     79 #define FO_REMOVE_COMS  'j'     // remove comment leaders when joining lines
     80 #define FO_PERIOD_ABBR  'p'     // don't break a single space after a period
     81 
     82 #define DFLT_FO_VI      "vt"
     83 #define DFLT_FO_VIM     "tcqj"
     84 #define FO_ALL          "tcro/q2vlb1mMBn,aw]jp"   // for do_set()
     85 
     86 #define MAX_MCO  6  // fixed value for 'maxcombine'
     87 
     88 // characters for the p_cpo option:
     89 #define CPO_ALTREAD     'a'     // ":read" sets alternate file name
     90 #define CPO_ALTWRITE    'A'     // ":write" sets alternate file name
     91 #define CPO_BAR         'b'     // "\|" ends a mapping
     92 #define CPO_BSLASH      'B'     // backslash in mapping is not special
     93 #define CPO_SEARCH      'c'
     94 #define CPO_CONCAT      'C'     // Don't concatenate sourced lines
     95 #define CPO_DOTTAG      'd'     // "./tags" in 'tags' is in current dir
     96 #define CPO_DIGRAPH     'D'     // No digraph after "r", "f", etc.
     97 #define CPO_EXECBUF     'e'
     98 #define CPO_EMPTYREGION 'E'     // operating on empty region is an error
     99 #define CPO_FNAMER      'f'     // set file name for ":r file"
    100 #define CPO_FNAMEW      'F'     // set file name for ":w file"
    101 #define CPO_INTMOD      'i'     // interrupt a read makes buffer modified
    102 #define CPO_INDENT      'I'     // remove auto-indent more often
    103 #define CPO_ENDOFSENT   'J'     // need two spaces to detect end of sentence
    104 #define CPO_KOFFSET     'K'     // don't wait for key code in mappings
    105 #define CPO_LITERAL     'l'     // take char after backslash in [] literal
    106 #define CPO_LISTWM      'L'     // 'list' changes wrapmargin
    107 #define CPO_SHOWMATCH   'm'
    108 #define CPO_MATCHBSL    'M'     // "%" ignores use of backslashes
    109 #define CPO_NUMCOL      'n'     // 'number' column also used for text
    110 #define CPO_LINEOFF     'o'
    111 #define CPO_OVERNEW     'O'     // silently overwrite new file
    112 #define CPO_FNAMEAPP    'P'     // set file name for ":w >>file"
    113 #define CPO_JOINCOL     'q'     // with "3J" use column after first join
    114 #define CPO_REDO        'r'
    115 #define CPO_REMMARK     'R'     // remove marks when filtering
    116 #define CPO_BUFOPT      's'
    117 #define CPO_BUFOPTGLOB  'S'
    118 #define CPO_TAGPAT      't'     // tag pattern is used for "n"
    119 #define CPO_UNDO        'u'     // "u" undoes itself
    120 #define CPO_BACKSPACE   'v'     // "v" keep deleted text
    121 #define CPO_FWRITE      'W'     // "w!" doesn't overwrite readonly files
    122 #define CPO_ESC         'x'
    123 #define CPO_REPLCNT     'X'     // "R" with a count only deletes chars once
    124 #define CPO_YANK        'y'
    125 #define CPO_KEEPRO      'Z'     // don't reset 'readonly' on ":w!"
    126 #define CPO_DOLLAR      '$'
    127 #define CPO_FILTER      '!'
    128 #define CPO_MATCH       '%'
    129 #define CPO_PLUS        '+'     // ":write file" resets 'modified'
    130 #define CPO_REGAPPEND   '>'     // insert NL when appending to a register
    131 #define CPO_SCOLON      ';'     // using "," and ";" will skip over char if
    132                                // cursor would not move
    133 #define CPO_NOSYMLINKS  '~'     // don't resolve symlinks when changing directory
    134 #define CPO_CHANGEW     '_'     // "cw" special-case
    135 // default values for Vim and Vi
    136 #define CPO_VIM         "aABceFs_"
    137 #define CPO_VI          "aAbBcCdDeEfFiIJKlLmMnoOpPqrRsStuvWxXyZ$!%+>;~_"
    138 
    139 // characters for p_ww option:
    140 #define WW_ALL          "bshl<>[]~"
    141 
    142 // characters for p_mouse option:
    143 #define MOUSE_NORMAL    'n'             // use mouse in Normal mode
    144 #define MOUSE_VISUAL    'v'             // use mouse in Visual/Select mode
    145 #define MOUSE_INSERT    'i'             // use mouse in Insert mode
    146 #define MOUSE_COMMAND   'c'             // use mouse in Command-line mode
    147 #define MOUSE_HELP      'h'             // use mouse in help buffers
    148 #define MOUSE_RETURN    'r'             // use mouse for hit-return message
    149 #define MOUSE_A         "nvich"         // used for 'a' flag
    150 #define MOUSE_ALL       "anvichr"       // all possible characters
    151 #define MOUSE_NONE      ' '             // don't use Visual selection
    152 #define MOUSE_NONEF     'x'             // forced modeless selection
    153 
    154 // default vertical and horizontal mouse scroll values.
    155 // Note: This should be in sync with the default mousescroll option.
    156 #define MOUSESCROLL_VERT_DFLT   3
    157 #define MOUSESCROLL_HOR_DFLT    6
    158 
    159 #define COCU_ALL        "nvic"          // flags for 'concealcursor'
    160 
    161 /// characters for p_shm option:
    162 enum {
    163  SHM_RO             = 'r',  ///< Readonly.
    164  SHM_MOD            = 'm',  ///< Modified.
    165  SHM_LINES          = 'l',  ///< "L" instead of "lines".
    166  SHM_WRI            = 'w',  ///< "[w]" instead of "written".
    167  SHM_ABBREVIATIONS  = 'a',  ///< Use abbreviations from #SHM_ALL_ABBREVIATIONS.
    168  SHM_WRITE          = 'W',  ///< Don't use "written" at all.
    169  SHM_TRUNC          = 't',  ///< Truncate file messages.
    170  SHM_TRUNCALL       = 'T',  ///< Truncate all messages.
    171  SHM_OVER           = 'o',  ///< Overwrite file messages.
    172  SHM_OVERALL        = 'O',  ///< Overwrite more messages.
    173  SHM_SEARCH         = 's',  ///< No search hit bottom messages.
    174  SHM_ATTENTION      = 'A',  ///< No ATTENTION messages.
    175  SHM_INTRO          = 'I',  ///< Intro messages.
    176  SHM_COMPLETIONMENU = 'c',  ///< Completion menu messages.
    177  SHM_COMPLETIONSCAN = 'C',  ///< Completion scanning messages.
    178  SHM_RECORDING      = 'q',  ///< No recording message.
    179  SHM_FILEINFO       = 'F',  ///< No file info messages.
    180  SHM_SEARCHCOUNT    = 'S',  ///< No search stats: '[1/10]'
    181 };
    182 /// Represented by 'a' flag.
    183 #define SHM_ALL_ABBREVIATIONS ((char[]) { \
    184    SHM_RO, SHM_MOD, SHM_LINES, SHM_WRI, \
    185    0 })
    186 
    187 // characters for p_go:
    188 #define GO_ASEL         'a'             // autoselect
    189 #define GO_ASELML       'A'             // autoselect modeless selection
    190 #define GO_BOT          'b'             // use bottom scrollbar
    191 #define GO_CONDIALOG    'c'             // use console dialog
    192 #define GO_TITLEBAR     'C'             // use 'hl-TitleBar'
    193 #define GO_DARKTHEME    'd'             // use dark theme variant
    194 #define GO_TABLINE      'e'             // may show tabline
    195 #define GO_FORG         'f'             // start GUI in foreground
    196 #define GO_GREY         'g'             // use grey menu items
    197 #define GO_HORSCROLL    'h'             // flexible horizontal scrolling
    198 #define GO_ICON         'i'             // use Vim icon
    199 #define GO_LEFT         'l'             // use left scrollbar
    200 #define GO_VLEFT        'L'             // left scrollbar with vert split
    201 #define GO_MENUS        'm'             // use menu bar
    202 #define GO_NOSYSMENU    'M'             // don't source system menu
    203 #define GO_POINTER      'p'             // pointer enter/leave callbacks
    204 #define GO_ASELPLUS     'P'             // autoselectPlus
    205 #define GO_RIGHT        'r'             // use right scrollbar
    206 #define GO_VRIGHT       'R'             // right scrollbar with vert split
    207 #define GO_TOOLBAR      'T'             // add toolbar
    208 #define GO_FOOTER       'F'             // add footer
    209 #define GO_VERTICAL     'v'             // arrange dialog buttons vertically
    210 #define GO_KEEPWINSIZE  'k'             // keep GUI window size
    211 #define GO_ALL "!aAbcCdefFghilLmMpPrRtTvk"  // all possible flags for 'go'
    212 
    213 // flags for 'comments' option
    214 #define COM_NEST        'n'             // comments strings nest
    215 #define COM_BLANK       'b'             // needs blank after string
    216 #define COM_START       's'             // start of comment
    217 #define COM_MIDDLE      'm'             // middle of comment
    218 #define COM_END         'e'             // end of comment
    219 #define COM_AUTO_END    'x'             // last char of end closes comment
    220 #define COM_FIRST       'f'             // first line comment only
    221 #define COM_LEFT        'l'             // left adjusted
    222 #define COM_RIGHT       'r'             // right adjusted
    223 #define COM_NOBACK      'O'             // don't use for "O" command
    224 #define COM_ALL         "nbsmexflrO"    // all flags for 'comments' option
    225 #define COM_MAX_LEN     50              // maximum length of a part
    226 
    227 /// C string containing all 'statusline' option flags
    228 #define STL_ALL ((char[]) { \
    229    STL_FILEPATH, STL_FULLPATH, STL_FILENAME, STL_COLUMN, STL_VIRTCOL, \
    230    STL_VIRTCOL_ALT, STL_LINE, STL_NUMLINES, STL_BUFNO, STL_KEYMAP, STL_OFFSET, \
    231    STL_OFFSET_X, STL_BYTEVAL, STL_BYTEVAL_X, STL_ROFLAG, STL_ROFLAG_ALT, \
    232    STL_HELPFLAG, STL_HELPFLAG_ALT, STL_FILETYPE, STL_FILETYPE_ALT, \
    233    STL_PREVIEWFLAG, STL_PREVIEWFLAG_ALT, STL_MODIFIED, STL_MODIFIED_ALT, \
    234    STL_QUICKFIX, STL_PERCENTAGE, STL_ALTPERCENT, STL_ARGLISTSTAT, STL_PAGENUM, \
    235    STL_SHOWCMD, STL_FOLDCOL, STL_SIGNCOL, STL_VIM_EXPR, STL_SEPARATE, \
    236    STL_TRUNCMARK, STL_USER_HL, STL_HIGHLIGHT, STL_HIGHLIGHT_COMB, STL_TABPAGENR, \
    237    STL_TABCLOSENR, STL_CLICK_FUNC, STL_TABPAGENR, STL_TABCLOSENR, STL_CLICK_FUNC, \
    238    0, })
    239 
    240 // arguments for can_bs()
    241 // each defined char should be unique over all values
    242 // except for BS_START, that intentionally also matches BS_NOSTOP
    243 // because BS_NOSTOP behaves exactly the same except it
    244 // does not stop at the start of the insert point
    245 #define BS_INDENT       'i'     // "Indent"
    246 #define BS_EOL          'l'     // "eoL"
    247 #define BS_START        's'     // "Start"
    248 #define BS_NOSTOP       'p'     // "nostoP
    249 
    250 #define LISPWORD_VALUE \
    251  "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"
    252 
    253 // When a string option is NULL, it is set to empty_string_option,
    254 // to avoid having to check for NULL everywhere.
    255 //
    256 // TODO(famiu): Remove this when refcounted strings are used for string options.
    257 EXTERN char empty_string_option[] INIT( = "");
    258 
    259 // The following are actual variables for the options
    260 
    261 EXTERN char *p_ambw;             ///< 'ambiwidth'
    262 EXTERN int p_acd;                ///< 'autochdir'
    263 EXTERN int p_ai;                 ///< 'autoindent'
    264 EXTERN int p_bin;                ///< 'binary'
    265 EXTERN int p_bomb;               ///< 'bomb'
    266 EXTERN int p_bl;                 ///< 'buflisted'
    267 EXTERN int p_cin;                ///< 'cindent'
    268 EXTERN OptInt p_channel;         ///< 'channel'
    269 EXTERN char *p_cink;             ///< 'cinkeys'
    270 EXTERN char *p_cinsd;            ///< 'cinscopedecls'
    271 EXTERN char *p_cinw;             ///< 'cinwords'
    272 EXTERN char *p_cfu;              ///< 'completefunc'
    273 EXTERN char *p_ofu;              ///< 'omnifunc'
    274 EXTERN char *p_tsrfu;            ///< 'thesaurusfunc'
    275 EXTERN int p_ci;                 ///< 'copyindent'
    276 EXTERN int p_ar;                 ///< 'autoread'
    277 EXTERN int p_aw;                 ///< 'autowrite'
    278 EXTERN int p_awa;                ///< 'autowriteall'
    279 EXTERN char *p_bs;               ///< 'backspace'
    280 EXTERN char *p_bg;               ///< 'background'
    281 EXTERN int p_bk;                 ///< 'backup'
    282 EXTERN char *p_bkc;              ///< 'backupcopy'
    283 EXTERN unsigned bkc_flags;       ///< flags from 'backupcopy'
    284 EXTERN char *p_bdir;             ///< 'backupdir'
    285 EXTERN char *p_bex;              ///< 'backupext'
    286 EXTERN char *p_bo;               ///< 'belloff'
    287 EXTERN char breakat_flags[256];  ///< which characters are in 'breakat'
    288 EXTERN unsigned bo_flags;
    289 EXTERN char *p_bsk;             ///< 'backupskip'
    290 EXTERN char *p_breakat;         ///< 'breakat'
    291 EXTERN char *p_bh;              ///< 'bufhidden'
    292 EXTERN char *p_bt;              ///< 'buftype'
    293 EXTERN OptInt p_busy;           ///< 'busy'
    294 EXTERN char *p_cmp;             ///< 'casemap'
    295 EXTERN unsigned cmp_flags;
    296 EXTERN char *p_enc;             ///< 'encoding'
    297 EXTERN int p_deco;              ///< 'delcombine'
    298 EXTERN char *p_ccv;             ///< 'charconvert'
    299 EXTERN char *p_cino;            ///< 'cinoptions'
    300 EXTERN char *p_cedit;           ///< 'cedit'
    301 EXTERN char *p_cb;              ///< 'clipboard'
    302 EXTERN unsigned cb_flags;
    303 EXTERN OptInt p_cwh;            ///< 'cmdwinheight'
    304 EXTERN OptInt p_ch;             ///< 'cmdheight'
    305 EXTERN char *p_cms;             ///< 'commentstring'
    306 EXTERN char *p_cpt;             ///< 'complete'
    307 EXTERN OptInt p_cto;            ///< 'completetimeout'
    308 EXTERN OptInt p_columns;        ///< 'columns'
    309 EXTERN int p_confirm;           ///< 'confirm'
    310 EXTERN char *p_cia;             ///< 'completeitemalign'
    311 EXTERN unsigned cia_flags;      ///< order flags of 'completeitemalign'
    312 EXTERN char *p_cot;             ///< 'completeopt'
    313 EXTERN unsigned cot_flags;      ///< flags from 'completeopt'
    314 EXTERN int p_ac;                ///< 'autocomplete'
    315 EXTERN OptInt p_act;            ///< 'autocompletetimeout'
    316 EXTERN OptInt p_acl;            ///< 'autocompletedelay'
    317 #ifdef BACKSLASH_IN_FILENAME
    318 EXTERN char *p_csl;             ///< 'completeslash'
    319 #endif
    320 EXTERN char *p_pumborder;       ///< 'pumborder'
    321 EXTERN OptInt p_pb;             ///< 'pumblend'
    322 EXTERN OptInt p_ph;             ///< 'pumheight'
    323 EXTERN OptInt p_pw;             ///< 'pumwidth'
    324 EXTERN OptInt p_pmw;            ///< 'pummaxwidth'
    325 EXTERN char *p_com;             ///< 'comments'
    326 EXTERN char *p_cpo;             ///< 'cpoptions'
    327 EXTERN char *p_debug;           ///< 'debug'
    328 EXTERN char *p_def;             ///< 'define'
    329 EXTERN char *p_inc;
    330 EXTERN char *p_dia;             ///< 'diffanchors'
    331 EXTERN char *p_dip;             ///< 'diffopt'
    332 EXTERN char *p_dex;             ///< 'diffexpr'
    333 EXTERN char *p_dict;            ///< 'dictionary'
    334 EXTERN int p_dg;                ///< 'digraph'
    335 EXTERN char *p_dir;             ///< 'directory'
    336 EXTERN char *p_dy;              ///< 'display'
    337 EXTERN unsigned dy_flags;
    338 EXTERN char *p_ead;             ///< 'eadirection'
    339 EXTERN int p_emoji;             ///< 'emoji'
    340 EXTERN int p_ea;                ///< 'equalalways'
    341 EXTERN char *p_ep;              ///< 'equalprg'
    342 EXTERN int p_eb;                ///< 'errorbells'
    343 EXTERN char *p_ef;              ///< 'errorfile'
    344 EXTERN char *p_efm;             ///< 'errorformat'
    345 EXTERN char *p_gefm;            ///< 'grepformat'
    346 EXTERN char *p_gp;              ///< 'grepprg'
    347 EXTERN int p_eof;               ///< 'endoffile'
    348 EXTERN int p_eol;               ///< 'endofline'
    349 EXTERN char *p_ei;              ///< 'eventignore'
    350 EXTERN int p_et;                ///< 'expandtab'
    351 EXTERN int p_exrc;              ///< 'exrc'
    352 EXTERN char *p_fenc;            ///< 'fileencoding'
    353 EXTERN char *p_fencs;           ///< 'fileencodings'
    354 EXTERN char *p_ff;              ///< 'fileformat'
    355 EXTERN char *p_ffs;             ///< 'fileformats'
    356 EXTERN int p_fic;               ///< 'fileignorecase'
    357 EXTERN char *p_ft;              ///< 'filetype'
    358 EXTERN char *p_fcs;             ///< 'fillchar'
    359 EXTERN char *p_ffu;             ///< 'findfunc'
    360 EXTERN int p_fixeol;            ///< 'fixendofline'
    361 EXTERN char *p_fcl;             ///< 'foldclose'
    362 EXTERN OptInt p_fdls;           ///< 'foldlevelstart'
    363 EXTERN char *p_fdo;             ///< 'foldopen'
    364 EXTERN unsigned fdo_flags;
    365 EXTERN char *p_fex;             ///< 'formatexpr'
    366 EXTERN char *p_flp;             ///< 'formatlistpat'
    367 EXTERN char *p_fo;              ///< 'formatoptions'
    368 EXTERN char *p_fp;              ///< 'formatprg'
    369 EXTERN int p_fs;                ///< 'fsync'
    370 EXTERN int p_gd;                ///< 'gdefault'
    371 EXTERN char *p_guicursor;       ///< 'guicursor'
    372 EXTERN char *p_guifont;         ///< 'guifont'
    373 EXTERN char *p_guifontwide;     ///< 'guifontwide'
    374 EXTERN char *p_hf;              ///< 'helpfile'
    375 EXTERN OptInt p_hh;             ///< 'helpheight'
    376 EXTERN char *p_hlg;             ///< 'helplang'
    377 EXTERN int p_hid;               ///< 'hidden'
    378 EXTERN char *p_hl;              ///< 'highlight'
    379 EXTERN int p_hls;               ///< 'hlsearch'
    380 EXTERN OptInt p_hi;             ///< 'history'
    381 EXTERN int p_arshape;           ///< 'arabicshape'
    382 EXTERN int p_icon;              ///< 'icon'
    383 EXTERN char *p_iconstring;      ///< 'iconstring'
    384 EXTERN int p_ic;                ///< 'ignorecase'
    385 EXTERN OptInt p_iminsert;       ///< 'iminsert'
    386 EXTERN OptInt p_imsearch;       ///< 'imsearch'
    387 EXTERN int p_inf;               ///< 'infercase'
    388 EXTERN char *p_inex;            ///< 'includeexpr'
    389 EXTERN int p_is;                ///< 'incsearch'
    390 EXTERN char *p_inde;            ///< 'indentexpr'
    391 EXTERN char *p_indk;            ///< 'indentkeys'
    392 EXTERN char *p_icm;             ///< 'inccommand'
    393 EXTERN char *p_isf;             ///< 'isfname'
    394 EXTERN char *p_isi;             ///< 'isident'
    395 EXTERN char *p_isk;             ///< 'iskeyword'
    396 EXTERN char *p_isp;             ///< 'isprint'
    397 EXTERN int p_js;                ///< 'joinspaces'
    398 EXTERN char *p_jop;             ///< 'jumpooptions'
    399 EXTERN unsigned jop_flags;
    400 EXTERN char *p_keymap;          ///< 'keymap'
    401 EXTERN char *p_kp;              ///< 'keywordprg'
    402 EXTERN char *p_km;              ///< 'keymodel'
    403 EXTERN char *p_langmap;         ///< 'langmap'
    404 EXTERN int p_lnr;               ///< 'langnoremap'
    405 EXTERN int p_lrm;               ///< 'langremap'
    406 EXTERN char *p_lm;              ///< 'langmenu'
    407 EXTERN OptInt p_lines;          ///< 'lines'
    408 EXTERN OptInt p_linespace;      ///< 'linespace'
    409 EXTERN int p_lisp;              ///< 'lisp'
    410 EXTERN char *p_lop;             ///< 'lispoptions'
    411 EXTERN char *p_lispwords;       ///< 'lispwords'
    412 EXTERN OptInt p_ls;             ///< 'laststatus'
    413 EXTERN OptInt p_stal;           ///< 'showtabline'
    414 EXTERN char *p_lcs;             ///< 'listchars'
    415 EXTERN int p_lz;                ///< 'lazyredraw'
    416 EXTERN int p_lpl;               ///< 'loadplugins'
    417 EXTERN int p_magic;             ///< 'magic'
    418 EXTERN char *p_menc;            ///< 'makeencoding'
    419 EXTERN char *p_mef;             ///< 'makeef'
    420 EXTERN char *p_mp;              ///< 'makeprg'
    421 EXTERN char *p_mps;             ///< 'matchpairs'
    422 EXTERN OptInt p_mat;            ///< 'matchtime'
    423 EXTERN OptInt p_mco;            ///< 'maxcombine'
    424 EXTERN OptInt p_mfd;            ///< 'maxfuncdepth'
    425 EXTERN OptInt p_mmd;            ///< 'maxmapdepth'
    426 EXTERN OptInt p_mmp;            ///< 'maxmempattern'
    427 EXTERN OptInt p_mis;            ///< 'menuitems'
    428 EXTERN char *p_mopt;            ///< 'messagesopt'
    429 EXTERN OptInt p_msc;            ///< 'maxsearchcount'
    430 EXTERN char *p_msm;             ///< 'mkspellmem'
    431 EXTERN int p_ml;                ///< 'modeline'
    432 EXTERN int p_mle;               ///< 'modelineexpr'
    433 EXTERN OptInt p_mls;            ///< 'modelines'
    434 EXTERN int p_ma;                ///< 'modifiable'
    435 EXTERN int p_mod;               ///< 'modified'
    436 EXTERN char *p_mouse;           ///< 'mouse'
    437 EXTERN char *p_mousem;          ///< 'mousemodel'
    438 EXTERN int p_mousemev;          ///< 'mousemoveevent'
    439 EXTERN int p_mousef;            ///< 'mousefocus'
    440 EXTERN int p_mh;                ///< 'mousehide'
    441 EXTERN char *p_mousescroll;     ///< 'mousescroll'
    442 EXTERN OptInt p_mousescroll_vert INIT( = MOUSESCROLL_VERT_DFLT);
    443 EXTERN OptInt p_mousescroll_hor INIT( = MOUSESCROLL_HOR_DFLT);
    444 EXTERN OptInt p_mouset;         ///< 'mousetime'
    445 EXTERN int p_more;              ///< 'more'
    446 EXTERN char *p_nf;              ///< 'nrformats'
    447 EXTERN char *p_opfunc;          ///< 'operatorfunc'
    448 EXTERN char *p_para;            ///< 'paragraphs'
    449 EXTERN int p_paste;             ///< 'paste'
    450 EXTERN char *p_pex;             ///< 'patchexpr'
    451 EXTERN char *p_pm;              ///< 'patchmode'
    452 EXTERN char *p_path;            ///< 'path'
    453 EXTERN char *p_cdpath;          ///< 'cdpath'
    454 EXTERN int p_pi;                ///< 'preserveindent'
    455 EXTERN OptInt p_pyx;            ///< 'pyxversion'
    456 EXTERN char *p_qe;              ///< 'quoteescape'
    457 EXTERN int p_ro;                ///< 'readonly'
    458 EXTERN char *p_rdb;             ///< 'redrawdebug'
    459 EXTERN unsigned rdb_flags;
    460 EXTERN OptInt p_rdt;            ///< 'redrawtime'
    461 EXTERN OptInt p_re;             ///< 'regexpengine'
    462 EXTERN OptInt p_report;         ///< 'report'
    463 EXTERN OptInt p_pvh;            ///< 'previewheight'
    464 EXTERN OptInt p_chi;            ///< 'chistory'
    465 EXTERN int p_ari;               ///< 'allowrevins'
    466 EXTERN int p_ri;                ///< 'revins'
    467 EXTERN int p_ru;                ///< 'ruler'
    468 EXTERN char *p_ruf;             ///< 'rulerformat'
    469 EXTERN char *p_pp;              ///< 'packpath'
    470 EXTERN char *p_qftf;            ///< 'quickfixtextfunc'
    471 EXTERN char *p_rtp;             ///< 'runtimepath'
    472 EXTERN OptInt p_scbk;           ///< 'scrollback'
    473 EXTERN OptInt p_sj;             ///< 'scrolljump'
    474 EXTERN OptInt p_so;             ///< 'scrolloff'
    475 EXTERN char *p_sbo;             ///< 'scrollopt'
    476 EXTERN char *p_sections;        ///< 'sections'
    477 EXTERN int p_secure;            ///< 'secure'
    478 EXTERN char *p_sel;             ///< 'selection'
    479 EXTERN char *p_slm;             ///< 'selectmode'
    480 EXTERN char *p_ssop;            ///< 'sessionoptions'
    481 EXTERN unsigned ssop_flags;
    482 EXTERN char *p_sh;              ///< 'shell'
    483 EXTERN char *p_shcf;            ///< 'shellcmdflag'
    484 EXTERN char *p_sp;              ///< 'shellpipe'
    485 EXTERN char *p_shq;             ///< 'shellquote'
    486 EXTERN char *p_sxq;             ///< 'shellxquote'
    487 EXTERN char *p_sxe;             ///< 'shellxescape'
    488 EXTERN char *p_srr;             ///< 'shellredir'
    489 EXTERN int p_stmp;              ///< 'shelltemp'
    490 #ifdef BACKSLASH_IN_FILENAME
    491 EXTERN int p_ssl;               ///< 'shellslash'
    492 #endif
    493 EXTERN char *p_stl;             ///< 'statusline'
    494 EXTERN char *p_wbr;             ///< 'winbar'
    495 EXTERN int p_sr;                ///< 'shiftround'
    496 EXTERN OptInt p_sw;             ///< 'shiftwidth'
    497 EXTERN char *p_shm;             ///< 'shortmess'
    498 EXTERN char *p_sbr;             ///< 'showbreak'
    499 EXTERN int p_sc;                ///< 'showcmd'
    500 EXTERN char *p_sloc;            ///< 'showcmdloc'
    501 EXTERN int p_sft;               ///< 'showfulltag'
    502 EXTERN int p_sm;                ///< 'showmatch'
    503 EXTERN int p_smd;               ///< 'showmode'
    504 EXTERN OptInt p_ss;             ///< 'sidescroll'
    505 EXTERN OptInt p_siso;           ///< 'sidescrolloff'
    506 EXTERN int p_scs;               ///< 'smartcase'
    507 EXTERN int p_si;                ///< 'smartindent'
    508 EXTERN int p_sta;               ///< 'smarttab'
    509 EXTERN OptInt p_sts;            ///< 'softtabstop'
    510 EXTERN int p_sb;                ///< 'splitbelow'
    511 EXTERN char *p_sua;             ///< 'suffixesadd'
    512 EXTERN int p_swf;               ///< 'swapfile'
    513 EXTERN OptInt p_smc;            ///< 'synmaxcol'
    514 EXTERN OptInt p_tpm;            ///< 'tabpagemax'
    515 EXTERN char *p_tal;             ///< 'tabline'
    516 EXTERN char *p_tpf;             ///< 'termpastefilter'
    517 EXTERN unsigned tpf_flags;      ///< flags from 'termpastefilter'
    518 EXTERN char *p_tfu;             ///< 'tagfunc'
    519 EXTERN char *p_spc;             ///< 'spellcapcheck'
    520 EXTERN char *p_spf;             ///< 'spellfile'
    521 EXTERN char *p_spl;             ///< 'spelllang'
    522 EXTERN char *p_spo;             ///< 'spelloptions'
    523 EXTERN unsigned spo_flags;
    524 EXTERN char *p_sps;             ///< 'spellsuggest'
    525 EXTERN int p_spr;               ///< 'splitright'
    526 EXTERN int p_sol;               ///< 'startofline'
    527 EXTERN char *p_su;              ///< 'suffixes'
    528 EXTERN char *p_swb;             ///< 'switchbuf'
    529 EXTERN unsigned swb_flags;
    530 EXTERN char *p_spk;             ///< 'splitkeep'
    531 EXTERN char *p_syn;             ///< 'syntax'
    532 EXTERN char *p_tcl;             ///< 'tabclose'
    533 EXTERN unsigned tcl_flags;      ///< flags from 'tabclose'
    534 EXTERN OptInt p_ts;             ///< 'tabstop'
    535 EXTERN int p_tbs;               ///< 'tagbsearch'
    536 EXTERN char *p_tc;              ///< 'tagcase'
    537 EXTERN unsigned tc_flags;       ///< flags from 'tagcase'
    538 EXTERN OptInt p_tl;             ///< 'taglength'
    539 EXTERN int p_tr;                ///< 'tagrelative'
    540 EXTERN char *p_tags;            ///< 'tags'
    541 EXTERN int p_tgst;              ///< 'tagstack'
    542 EXTERN int p_tbidi;             ///< 'termbidi'
    543 EXTERN OptInt p_tw;             ///< 'textwidth'
    544 EXTERN int p_to;                ///< 'tildeop'
    545 EXTERN int p_timeout;           ///< 'timeout'
    546 EXTERN OptInt p_tm;             ///< 'timeoutlen'
    547 EXTERN int p_title;             ///< 'title'
    548 EXTERN OptInt p_titlelen;       ///< 'titlelen'
    549 EXTERN char *p_titleold;        ///< 'titleold'
    550 EXTERN char *p_titlestring;     ///< 'titlestring'
    551 EXTERN char *p_tsr;             ///< 'thesaurus'
    552 EXTERN int p_tgc;               ///< 'termguicolors'
    553 EXTERN int p_ttimeout;          ///< 'ttimeout'
    554 EXTERN OptInt p_ttm;            ///< 'ttimeoutlen'
    555 EXTERN char *p_udir;            ///< 'undodir'
    556 EXTERN int p_udf;               ///< 'undofile'
    557 EXTERN OptInt p_ul;             ///< 'undolevels'
    558 EXTERN OptInt p_ur;             ///< 'undoreload'
    559 EXTERN OptInt p_uc;             ///< 'updatecount'
    560 EXTERN OptInt p_ut;             ///< 'updatetime'
    561 EXTERN char *p_shada;           ///< 'shada'
    562 EXTERN char *p_shadafile;       ///< 'shadafile'
    563 EXTERN int p_termsync;          ///< 'termsync'
    564 EXTERN char *p_vsts;            ///< 'varsofttabstop'
    565 EXTERN char *p_vts;             ///< 'vartabstop'
    566 EXTERN char *p_vdir;            ///< 'viewdir'
    567 EXTERN char *p_vop;             ///< 'viewoptions'
    568 EXTERN unsigned vop_flags;      ///< uses OptSsopFlags
    569 EXTERN int p_vb;                ///< 'visualbell'
    570 EXTERN char *p_ve;              ///< 'virtualedit'
    571 EXTERN unsigned ve_flags;
    572 EXTERN OptInt p_verbose;        ///< 'verbose'
    573 #ifdef IN_OPTION_C
    574 char *p_vfile = empty_string_option;  ///< used before options are initialized
    575 #else
    576 extern char *p_vfile;           ///< 'verbosefile'
    577 #endif
    578 EXTERN int p_warn;              ///< 'warn'
    579 EXTERN char *p_wop;             ///< 'wildoptions'
    580 EXTERN unsigned wop_flags;
    581 EXTERN OptInt p_window;         ///< 'window'
    582 EXTERN char *p_wak;             ///< 'winaltkeys'
    583 EXTERN char *p_wig;             ///< 'wildignore'
    584 EXTERN char *p_ww;              ///< 'whichwrap'
    585 EXTERN OptInt p_wc;             ///< 'wildchar'
    586 EXTERN OptInt p_wcm;            ///< 'wildcharm'
    587 EXTERN int p_wic;               ///< 'wildignorecase'
    588 EXTERN char *p_wim;             ///< 'wildmode'
    589 EXTERN int p_wmnu;              ///< 'wildmenu'
    590 EXTERN char *p_winborder;       ///< 'winborder'
    591 EXTERN OptInt p_wh;             ///< 'winheight'
    592 EXTERN OptInt p_wmh;            ///< 'winminheight'
    593 EXTERN OptInt p_wmw;            ///< 'winminwidth'
    594 EXTERN OptInt p_wiw;            ///< 'winwidth'
    595 EXTERN OptInt p_wm;             ///< 'wrapmargin'
    596 EXTERN int p_ws;                ///< 'wrapscan'
    597 EXTERN int p_write;             ///< 'write'
    598 EXTERN int p_wa;                ///< 'writeany'
    599 EXTERN int p_wb;                ///< 'writebackup'
    600 EXTERN OptInt p_wd;             ///< 'writedelay'
    601 EXTERN int p_cdh;               ///< 'cdhome'
    602 
    603 // Value for b_p_ul indicating the global value must be used.
    604 #define NO_LOCAL_UNDOLEVEL (-123456)
    605 
    606 #define ERR_BUFLEN 80
    607 
    608 #define SB_MAX 1000000  // Maximum 'scrollback' value.
    609 
    610 #define MAX_NUMBERWIDTH 20      // used for 'numberwidth'
    611 
    612 // Maximum 'statuscolumn' width: number + sign + fold columns
    613 #define MAX_STCWIDTH MAX_NUMBERWIDTH + SIGN_SHOW_MAX * SIGN_WIDTH + 9
    614 
    615 #define TABSTOP_MAX 9999
    616 
    617 #define SCL_NO  -1  // 'signcolumn' set to "no"
    618 #define SCL_NUM -2  // 'signcolumn' set to "number"