forked from neovim/neovim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.lua
7962 lines (7621 loc) · 321 KB
/
options.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--- @meta _
-- THIS FILE IS GENERATED
-- DO NOT EDIT
error('Cannot require a meta file')
---@class vim.bo
---@field [integer] vim.bo
vim.bo = vim.bo
---@class vim.wo
---@field [integer] vim.wo
vim.wo = vim.wo
--- Allow CTRL-_ in Insert and Command-line mode. This is default off, to
--- avoid that users that accidentally type CTRL-_ instead of SHIFT-_ get
--- into reverse Insert mode, and don't know how to get out. See
--- 'revins'.
---
--- @type boolean
vim.o.allowrevins = false
vim.o.ari = vim.o.allowrevins
vim.go.allowrevins = vim.o.allowrevins
vim.go.ari = vim.go.allowrevins
--- Tells Vim what to do with characters with East Asian Width Class
--- Ambiguous (such as Euro, Registered Sign, Copyright Sign, Greek
--- letters, Cyrillic letters).
---
--- There are currently two possible values:
--- "single": Use the same width as characters in US-ASCII. This is
--- expected by most users.
--- "double": Use twice the width of ASCII characters.
--- *E834* *E835*
--- The value "double" cannot be used if 'listchars' or 'fillchars'
--- contains a character that would be double width. These errors may
--- also be given when calling setcellwidths().
---
--- The values are overruled for characters specified with
--- `setcellwidths()`.
---
--- There are a number of CJK fonts for which the width of glyphs for
--- those characters are solely based on how many octets they take in
--- legacy/traditional CJK encodings. In those encodings, Euro,
--- Registered sign, Greek/Cyrillic letters are represented by two octets,
--- therefore those fonts have "wide" glyphs for them. This is also
--- true of some line drawing characters used to make tables in text
--- file. Therefore, when a CJK font is used for GUI Vim or
--- Vim is running inside a terminal (emulators) that uses a CJK font
--- (or Vim is run inside an xterm invoked with "-cjkwidth" option.),
--- this option should be set to "double" to match the width perceived
--- by Vim with the width of glyphs in the font. Perhaps it also has
--- to be set to "double" under CJK MS-Windows when the system locale is
--- set to one of CJK locales. See Unicode Standard Annex #11
--- (https://www.unicode.org/reports/tr11).
---
--- @type string
vim.o.ambiwidth = "single"
vim.o.ambw = vim.o.ambiwidth
vim.go.ambiwidth = vim.o.ambiwidth
vim.go.ambw = vim.go.ambiwidth
--- This option can be set to start editing Arabic text.
--- Setting this option will:
--- - Set the 'rightleft' option, unless 'termbidi' is set.
--- - Set the 'arabicshape' option, unless 'termbidi' is set.
--- - Set the 'keymap' option to "arabic"; in Insert mode CTRL-^ toggles
--- between typing English and Arabic key mapping.
--- - Set the 'delcombine' option
---
--- Resetting this option will:
--- - Reset the 'rightleft' option.
--- - Disable the use of 'keymap' (without changing its value).
--- Note that 'arabicshape' and 'delcombine' are not reset (it is a global
--- option).
--- Also see `arabic.txt`.
---
--- @type boolean
vim.o.arabic = false
vim.o.arab = vim.o.arabic
vim.wo.arabic = vim.o.arabic
vim.wo.arab = vim.wo.arabic
--- When on and 'termbidi' is off, the required visual character
--- corrections that need to take place for displaying the Arabic language
--- take effect. Shaping, in essence, gets enabled; the term is a broad
--- one which encompasses:
--- a) the changing/morphing of characters based on their location
--- within a word (initial, medial, final and stand-alone).
--- b) the enabling of the ability to compose characters
--- c) the enabling of the required combining of some characters
--- When disabled the display shows each character's true stand-alone
--- form.
--- Arabic is a complex language which requires other settings, for
--- further details see `arabic.txt`.
---
--- @type boolean
vim.o.arabicshape = true
vim.o.arshape = vim.o.arabicshape
vim.go.arabicshape = vim.o.arabicshape
vim.go.arshape = vim.go.arabicshape
--- When on, Vim will change the current working directory whenever you
--- open a file, switch buffers, delete a buffer or open/close a window.
--- It will change to the directory containing the file which was opened
--- or selected. When a buffer has no name it also has no directory, thus
--- the current directory won't change when navigating to it.
--- Note: When this option is on some plugins may not work.
---
--- @type boolean
vim.o.autochdir = false
vim.o.acd = vim.o.autochdir
vim.go.autochdir = vim.o.autochdir
vim.go.acd = vim.go.autochdir
--- Copy indent from current line when starting a new line (typing <CR>
--- in Insert mode or when using the "o" or "O" command). If you do not
--- type anything on the new line except <BS> or CTRL-D and then type
--- <Esc>, CTRL-O or <CR>, the indent is deleted again. Moving the cursor
--- to another line has the same effect, unless the 'I' flag is included
--- in 'cpoptions'.
--- When autoindent is on, formatting (with the "gq" command or when you
--- reach 'textwidth' in Insert mode) uses the indentation of the first
--- line.
--- When 'smartindent' or 'cindent' is on the indent is changed in
--- a different way.
---
--- @type boolean
vim.o.autoindent = true
vim.o.ai = vim.o.autoindent
vim.bo.autoindent = vim.o.autoindent
vim.bo.ai = vim.bo.autoindent
--- When a file has been detected to have been changed outside of Vim and
--- it has not been changed inside of Vim, automatically read it again.
--- When the file has been deleted this is not done, so you have the text
--- from before it was deleted. When it appears again then it is read.
--- `timestamp`
--- If this option has a local value, use this command to switch back to
--- using the global value:
--- ```
--- :set autoread<
--- ```
---
---
--- @type boolean
vim.o.autoread = true
vim.o.ar = vim.o.autoread
vim.bo.autoread = vim.o.autoread
vim.bo.ar = vim.bo.autoread
vim.go.autoread = vim.o.autoread
vim.go.ar = vim.go.autoread
--- Write the contents of the file, if it has been modified, on each
--- `:next`, `:rewind`, `:last`, `:first`, `:previous`, `:stop`,
--- `:suspend`, `:tag`, `:!`, `:make`, CTRL-] and CTRL-^ command; and when
--- a `:buffer`, CTRL-O, CTRL-I, '{A-Z0-9}, or `{A-Z0-9} command takes one
--- to another file.
--- A buffer is not written if it becomes hidden, e.g. when 'bufhidden' is
--- set to "hide" and `:next` is used.
--- Note that for some commands the 'autowrite' option is not used, see
--- 'autowriteall' for that.
--- Some buffers will not be written, specifically when 'buftype' is
--- "nowrite", "nofile", "terminal" or "prompt".
--- USE WITH CARE: If you make temporary changes to a buffer that you
--- don't want to be saved this option may cause it to be saved anyway.
--- Renaming the buffer with ":file {name}" may help avoid this.
---
--- @type boolean
vim.o.autowrite = false
vim.o.aw = vim.o.autowrite
vim.go.autowrite = vim.o.autowrite
vim.go.aw = vim.go.autowrite
--- Like 'autowrite', but also used for commands ":edit", ":enew", ":quit",
--- ":qall", ":exit", ":xit", ":recover" and closing the Vim window.
--- Setting this option also implies that Vim behaves like 'autowrite' has
--- been set.
---
--- @type boolean
vim.o.autowriteall = false
vim.o.awa = vim.o.autowriteall
vim.go.autowriteall = vim.o.autowriteall
vim.go.awa = vim.go.autowriteall
--- When set to "dark" or "light", adjusts the default color groups for
--- that background type. The `TUI` or other UI sets this on startup
--- (triggering `OptionSet`) if it can detect the background color.
---
--- This option does NOT change the background color, it tells Nvim what
--- the "inherited" (terminal/GUI) background looks like.
--- See `:hi-normal` if you want to set the background color explicitly.
--- *g:colors_name*
--- When a color scheme is loaded (the "g:colors_name" variable is set)
--- setting 'background' will cause the color scheme to be reloaded. If
--- the color scheme adjusts to the value of 'background' this will work.
--- However, if the color scheme sets 'background' itself the effect may
--- be undone. First delete the "g:colors_name" variable when needed.
---
--- Normally this option would be set in the vimrc file. Possibly
--- depending on the terminal name. Example:
--- ```
--- :if $TERM ==# "xterm"
--- : set background=dark
--- :endif
--- ```
--- When this option is set, the default settings for the highlight groups
--- will change. To use other settings, place ":highlight" commands AFTER
--- the setting of the 'background' option.
--- This option is also used in the "$VIMRUNTIME/syntax/syntax.vim" file
--- to select the colors for syntax highlighting. After changing this
--- option, you must load syntax.vim again to see the result. This can be
--- done with ":syntax on".
---
--- @type string
vim.o.background = "dark"
vim.o.bg = vim.o.background
vim.go.background = vim.o.background
vim.go.bg = vim.go.background
--- Influences the working of <BS>, <Del>, CTRL-W and CTRL-U in Insert
--- mode. This is a list of items, separated by commas. Each item allows
--- a way to backspace over something:
--- value effect ~
--- indent allow backspacing over autoindent
--- eol allow backspacing over line breaks (join lines)
--- start allow backspacing over the start of insert; CTRL-W and CTRL-U
--- stop once at the start of insert.
--- nostop like start, except CTRL-W and CTRL-U do not stop at the start of
--- insert.
---
--- When the value is empty, Vi compatible backspacing is used, none of
--- the ways mentioned for the items above are possible.
---
--- @type string
vim.o.backspace = "indent,eol,start"
vim.o.bs = vim.o.backspace
vim.go.backspace = vim.o.backspace
vim.go.bs = vim.go.backspace
--- Make a backup before overwriting a file. Leave it around after the
--- file has been successfully written. If you do not want to keep the
--- backup file, but you do want a backup while the file is being
--- written, reset this option and set the 'writebackup' option (this is
--- the default). If you do not want a backup file at all reset both
--- options (use this if your file system is almost full). See the
--- `backup-table` for more explanations.
--- When the 'backupskip' pattern matches, a backup is not made anyway.
--- When 'patchmode' is set, the backup may be renamed to become the
--- oldest version of a file.
---
--- @type boolean
vim.o.backup = false
vim.o.bk = vim.o.backup
vim.go.backup = vim.o.backup
vim.go.bk = vim.go.backup
--- When writing a file and a backup is made, this option tells how it's
--- done. This is a comma-separated list of words.
---
--- The main values are:
--- "yes" make a copy of the file and overwrite the original one
--- "no" rename the file and write a new one
--- "auto" one of the previous, what works best
---
--- Extra values that can be combined with the ones above are:
--- "breaksymlink" always break symlinks when writing
--- "breakhardlink" always break hardlinks when writing
---
--- Making a copy and overwriting the original file:
--- - Takes extra time to copy the file.
--- + When the file has special attributes, is a (hard/symbolic) link or
--- has a resource fork, all this is preserved.
--- - When the file is a link the backup will have the name of the link,
--- not of the real file.
---
--- Renaming the file and writing a new one:
--- + It's fast.
--- - Sometimes not all attributes of the file can be copied to the new
--- file.
--- - When the file is a link the new file will not be a link.
---
--- The "auto" value is the middle way: When Vim sees that renaming the
--- file is possible without side effects (the attributes can be passed on
--- and the file is not a link) that is used. When problems are expected,
--- a copy will be made.
---
--- The "breaksymlink" and "breakhardlink" values can be used in
--- combination with any of "yes", "no" and "auto". When included, they
--- force Vim to always break either symbolic or hard links by doing
--- exactly what the "no" option does, renaming the original file to
--- become the backup and writing a new file in its place. This can be
--- useful for example in source trees where all the files are symbolic or
--- hard links and any changes should stay in the local source tree, not
--- be propagated back to the original source.
--- *crontab*
--- One situation where "no" and "auto" will cause problems: A program
--- that opens a file, invokes Vim to edit that file, and then tests if
--- the open file was changed (through the file descriptor) will check the
--- backup file instead of the newly created file. "crontab -e" is an
--- example.
---
--- When a copy is made, the original file is truncated and then filled
--- with the new text. This means that protection bits, owner and
--- symbolic links of the original file are unmodified. The backup file,
--- however, is a new file, owned by the user who edited the file. The
--- group of the backup is set to the group of the original file. If this
--- fails, the protection bits for the group are made the same as for
--- others.
---
--- When the file is renamed, this is the other way around: The backup has
--- the same attributes of the original file, and the newly written file
--- is owned by the current user. When the file was a (hard/symbolic)
--- link, the new file will not! That's why the "auto" value doesn't
--- rename when the file is a link. The owner and group of the newly
--- written file will be set to the same ones as the original file, but
--- the system may refuse to do this. In that case the "auto" value will
--- again not rename the file.
---
--- @type string
vim.o.backupcopy = "auto"
vim.o.bkc = vim.o.backupcopy
vim.bo.backupcopy = vim.o.backupcopy
vim.bo.bkc = vim.bo.backupcopy
vim.go.backupcopy = vim.o.backupcopy
vim.go.bkc = vim.go.backupcopy
--- List of directories for the backup file, separated with commas.
--- - The backup file will be created in the first directory in the list
--- where this is possible. If none of the directories exist Nvim will
--- attempt to create the last directory in the list.
--- - Empty means that no backup file will be created ('patchmode' is
--- impossible!). Writing may fail because of this.
--- - A directory "." means to put the backup file in the same directory
--- as the edited file.
--- - A directory starting with "./" (or ".\" for MS-Windows) means to put
--- the backup file relative to where the edited file is. The leading
--- "." is replaced with the path name of the edited file.
--- ("." inside a directory name has no special meaning).
--- - Spaces after the comma are ignored, other spaces are considered part
--- of the directory name. To have a space at the start of a directory
--- name, precede it with a backslash.
--- - To include a comma in a directory name precede it with a backslash.
--- - A directory name may end in an '/'.
--- - For Unix and Win32, if a directory ends in two path separators "//",
--- the swap file name will be built from the complete path to the file
--- with all path separators changed to percent '%' signs. This will
--- ensure file name uniqueness in the backup directory.
--- On Win32, it is also possible to end with "\\". However, When a
--- separating comma is following, you must use "//", since "\\" will
--- include the comma in the file name. Therefore it is recommended to
--- use '//', instead of '\\'.
--- - Environment variables are expanded `:set_env`.
--- - Careful with '\' characters, type one before a space, type two to
--- get one in the option (see `option-backslash`), for example:
--- ```
--- :set bdir=c:\\tmp,\ dir\\,with\\,commas,\\\ dir\ with\ spaces
--- ```
---
--- See also 'backup' and 'writebackup' options.
--- If you want to hide your backup files on Unix, consider this value:
--- ```
--- :set backupdir=./.backup,~/.backup,.,/tmp
--- ```
--- You must create a ".backup" directory in each directory and in your
--- home directory for this to work properly.
--- The use of `:set+=` and `:set-=` is preferred when adding or removing
--- directories from the list. This avoids problems when a future version
--- uses another default.
--- This option cannot be set from a `modeline` or in the `sandbox`, for
--- security reasons.
---
--- @type string
vim.o.backupdir = ".,$XDG_STATE_HOME/nvim/backup//"
vim.o.bdir = vim.o.backupdir
vim.go.backupdir = vim.o.backupdir
vim.go.bdir = vim.go.backupdir
--- String which is appended to a file name to make the name of the
--- backup file. The default is quite unusual, because this avoids
--- accidentally overwriting existing files with a backup file. You might
--- prefer using ".bak", but make sure that you don't have files with
--- ".bak" that you want to keep.
--- Only normal file name characters can be used; `/\*?[|<>` are illegal.
---
--- If you like to keep a lot of backups, you could use a BufWritePre
--- autocommand to change 'backupext' just before writing the file to
--- include a timestamp.
--- ```
--- :au BufWritePre * let &bex = '-' .. strftime("%Y%b%d%X") .. '~'
--- ```
--- Use 'backupdir' to put the backup in a different directory.
---
--- @type string
vim.o.backupext = "~"
vim.o.bex = vim.o.backupext
vim.go.backupext = vim.o.backupext
vim.go.bex = vim.go.backupext
--- A list of file patterns. When one of the patterns matches with the
--- name of the file which is written, no backup file is created. Both
--- the specified file name and the full path name of the file are used.
--- The pattern is used like with `:autocmd`, see `autocmd-pattern`.
--- Watch out for special characters, see `option-backslash`.
--- When $TMPDIR, $TMP or $TEMP is not defined, it is not used for the
--- default value. "/tmp/*" is only used for Unix.
---
--- WARNING: Not having a backup file means that when Vim fails to write
--- your buffer correctly and then, for whatever reason, Vim exits, you
--- lose both the original file and what you were writing. Only disable
--- backups if you don't care about losing the file.
---
--- Note that environment variables are not expanded. If you want to use
--- $HOME you must expand it explicitly, e.g.:
---
--- ```vim
--- :let &backupskip = escape(expand('$HOME'), '\') .. '/tmp/*'
--- ```
--- Note that the default also makes sure that "crontab -e" works (when a
--- backup would be made by renaming the original file crontab won't see
--- the newly created file). Also see 'backupcopy' and `crontab`.
---
--- @type string
vim.o.backupskip = "/tmp/*"
vim.o.bsk = vim.o.backupskip
vim.go.backupskip = vim.o.backupskip
vim.go.bsk = vim.go.backupskip
--- Specifies for which events the bell will not be rung. It is a comma-
--- separated list of items. For each item that is present, the bell
--- will be silenced. This is most useful to specify specific events in
--- insert mode to be silenced.
---
--- item meaning when present ~
--- all All events.
--- backspace When hitting <BS> or <Del> and deleting results in an
--- error.
--- cursor Fail to move around using the cursor keys or
--- <PageUp>/<PageDown> in `Insert-mode`.
--- complete Error occurred when using `i_CTRL-X_CTRL-K` or
--- `i_CTRL-X_CTRL-T`.
--- copy Cannot copy char from insert mode using `i_CTRL-Y` or
--- `i_CTRL-E`.
--- ctrlg Unknown Char after <C-G> in Insert mode.
--- error Other Error occurred (e.g. try to join last line)
--- (mostly used in `Normal-mode` or `Cmdline-mode`).
--- esc hitting <Esc> in `Normal-mode`.
--- hangul Ignored.
--- lang Calling the beep module for Lua/Mzscheme/TCL.
--- mess No output available for `g<`.
--- showmatch Error occurred for 'showmatch' function.
--- operator Empty region error `cpo-E`.
--- register Unknown register after <C-R> in `Insert-mode`.
--- shell Bell from shell output `:!`.
--- spell Error happened on spell suggest.
--- wildmode More matches in `cmdline-completion` available
--- (depends on the 'wildmode' setting).
---
--- This is most useful to fine tune when in Insert mode the bell should
--- be rung. For Normal mode and Ex commands, the bell is often rung to
--- indicate that an error occurred. It can be silenced by adding the
--- "error" keyword.
---
--- @type string
vim.o.belloff = "all"
vim.o.bo = vim.o.belloff
vim.go.belloff = vim.o.belloff
vim.go.bo = vim.go.belloff
--- This option should be set before editing a binary file. You can also
--- use the `-b` Vim argument. When this option is switched on a few
--- options will be changed (also when it already was on):
--- 'textwidth' will be set to 0
--- 'wrapmargin' will be set to 0
--- 'modeline' will be off
--- 'expandtab' will be off
--- Also, 'fileformat' and 'fileformats' options will not be used, the
--- file is read and written like 'fileformat' was "unix" (a single <NL>
--- separates lines).
--- The 'fileencoding' and 'fileencodings' options will not be used, the
--- file is read without conversion.
--- NOTE: When you start editing a(nother) file while the 'bin' option is
--- on, settings from autocommands may change the settings again (e.g.,
--- 'textwidth'), causing trouble when editing. You might want to set
--- 'bin' again when the file has been loaded.
--- The previous values of these options are remembered and restored when
--- 'bin' is switched from on to off. Each buffer has its own set of
--- saved option values.
--- To edit a file with 'binary' set you can use the `++bin` argument.
--- This avoids you have to do ":set bin", which would have effect for all
--- files you edit.
--- When writing a file the <EOL> for the last line is only written if
--- there was one in the original file (normally Vim appends an <EOL> to
--- the last line if there is none; this would make the file longer). See
--- the 'endofline' option.
---
--- @type boolean
vim.o.binary = false
vim.o.bin = vim.o.binary
vim.bo.binary = vim.o.binary
vim.bo.bin = vim.bo.binary
--- When writing a file and the following conditions are met, a BOM (Byte
--- Order Mark) is prepended to the file:
--- - this option is on
--- - the 'binary' option is off
--- - 'fileencoding' is "utf-8", "ucs-2", "ucs-4" or one of the little/big
--- endian variants.
--- Some applications use the BOM to recognize the encoding of the file.
--- Often used for UCS-2 files on MS-Windows. For other applications it
--- causes trouble, for example: "cat file1 file2" makes the BOM of file2
--- appear halfway through the resulting file. Gcc doesn't accept a BOM.
--- When Vim reads a file and 'fileencodings' starts with "ucs-bom", a
--- check for the presence of the BOM is done and 'bomb' set accordingly.
--- Unless 'binary' is set, it is removed from the first line, so that you
--- don't see it when editing. When you don't change the options, the BOM
--- will be restored when writing the file.
---
--- @type boolean
vim.o.bomb = false
vim.bo.bomb = vim.o.bomb
--- This option lets you choose which characters might cause a line
--- break if 'linebreak' is on. Only works for ASCII characters.
---
--- @type string
vim.o.breakat = " \t!@*-+;:,./?"
vim.o.brk = vim.o.breakat
vim.go.breakat = vim.o.breakat
vim.go.brk = vim.go.breakat
--- Every wrapped line will continue visually indented (same amount of
--- space as the beginning of that line), thus preserving horizontal blocks
--- of text.
---
--- @type boolean
vim.o.breakindent = false
vim.o.bri = vim.o.breakindent
vim.wo.breakindent = vim.o.breakindent
vim.wo.bri = vim.wo.breakindent
--- Settings for 'breakindent'. It can consist of the following optional
--- items and must be separated by a comma:
--- min:{n} Minimum text width that will be kept after
--- applying 'breakindent', even if the resulting
--- text should normally be narrower. This prevents
--- text indented almost to the right window border
--- occupying lot of vertical space when broken.
--- (default: 20)
--- shift:{n} After applying 'breakindent', the wrapped line's
--- beginning will be shifted by the given number of
--- characters. It permits dynamic French paragraph
--- indentation (negative) or emphasizing the line
--- continuation (positive).
--- (default: 0)
--- sbr Display the 'showbreak' value before applying the
--- additional indent.
--- (default: off)
--- list:{n} Adds an additional indent for lines that match a
--- numbered or bulleted list (using the
--- 'formatlistpat' setting).
--- list:-1 Uses the length of a match with 'formatlistpat'
--- for indentation.
--- (default: 0)
--- column:{n} Indent at column {n}. Will overrule the other
--- sub-options. Note: an additional indent may be
--- added for the 'showbreak' setting.
--- (default: off)
---
--- @type string
vim.o.breakindentopt = ""
vim.o.briopt = vim.o.breakindentopt
vim.wo.breakindentopt = vim.o.breakindentopt
vim.wo.briopt = vim.wo.breakindentopt
--- Which directory to use for the file browser:
--- last Use same directory as with last file browser, where a
--- file was opened or saved.
--- buffer Use the directory of the related buffer.
--- current Use the current directory.
--- {path} Use the specified directory
---
--- @type string
vim.o.browsedir = ""
vim.o.bsdir = vim.o.browsedir
vim.go.browsedir = vim.o.browsedir
vim.go.bsdir = vim.go.browsedir
--- This option specifies what happens when a buffer is no longer
--- displayed in a window:
--- <empty> follow the global 'hidden' option
--- hide hide the buffer (don't unload it), even if 'hidden' is
--- not set
--- unload unload the buffer, even if 'hidden' is set; the
--- `:hide` command will also unload the buffer
--- delete delete the buffer from the buffer list, even if
--- 'hidden' is set; the `:hide` command will also delete
--- the buffer, making it behave like `:bdelete`
--- wipe wipe the buffer from the buffer list, even if
--- 'hidden' is set; the `:hide` command will also wipe
--- out the buffer, making it behave like `:bwipeout`
---
--- CAREFUL: when "unload", "delete" or "wipe" is used changes in a buffer
--- are lost without a warning. Also, these values may break autocommands
--- that switch between buffers temporarily.
--- This option is used together with 'buftype' and 'swapfile' to specify
--- special kinds of buffers. See `special-buffers`.
---
--- @type string
vim.o.bufhidden = ""
vim.o.bh = vim.o.bufhidden
vim.bo.bufhidden = vim.o.bufhidden
vim.bo.bh = vim.bo.bufhidden
--- When this option is set, the buffer shows up in the buffer list. If
--- it is reset it is not used for ":bnext", "ls", the Buffers menu, etc.
--- This option is reset by Vim for buffers that are only used to remember
--- a file name or marks. Vim sets it when starting to edit a buffer.
--- But not when moving to a buffer with ":buffer".
---
--- @type boolean
vim.o.buflisted = true
vim.o.bl = vim.o.buflisted
vim.bo.buflisted = vim.o.buflisted
vim.bo.bl = vim.bo.buflisted
--- The value of this option specifies the type of a buffer:
--- <empty> normal buffer
--- acwrite buffer will always be written with `BufWriteCmd`s
--- help help buffer (do not set this manually)
--- nofile buffer is not related to a file, will not be written
--- nowrite buffer will not be written
--- quickfix list of errors `:cwindow` or locations `:lwindow`
--- terminal `terminal-emulator` buffer
--- prompt buffer where only the last line can be edited, meant
--- to be used by a plugin, see `prompt-buffer`
---
--- This option is used together with 'bufhidden' and 'swapfile' to
--- specify special kinds of buffers. See `special-buffers`.
--- Also see `win_gettype()`, which returns the type of the window.
---
--- Be careful with changing this option, it can have many side effects!
--- One such effect is that Vim will not check the timestamp of the file,
--- if the file is changed by another program this will not be noticed.
---
--- A "quickfix" buffer is only used for the error list and the location
--- list. This value is set by the `:cwindow` and `:lwindow` commands and
--- you are not supposed to change it.
---
--- "nofile" and "nowrite" buffers are similar:
--- both: The buffer is not to be written to disk, ":w" doesn't
--- work (":w filename" does work though).
--- both: The buffer is never considered to be `'modified'`.
--- There is no warning when the changes will be lost, for
--- example when you quit Vim.
--- both: A swap file is only created when using too much memory
--- (when 'swapfile' has been reset there is never a swap
--- file).
--- nofile only: The buffer name is fixed, it is not handled like a
--- file name. It is not modified in response to a `:cd`
--- command.
--- both: When using ":e bufname" and already editing "bufname"
--- the buffer is made empty and autocommands are
--- triggered as usual for `:edit`.
--- *E676*
--- "acwrite" implies that the buffer name is not related to a file, like
--- "nofile", but it will be written. Thus, in contrast to "nofile" and
--- "nowrite", ":w" does work and a modified buffer can't be abandoned
--- without saving. For writing there must be matching `BufWriteCmd|,
--- |FileWriteCmd` or `FileAppendCmd` autocommands.
---
--- @type string
vim.o.buftype = ""
vim.o.bt = vim.o.buftype
vim.bo.buftype = vim.o.buftype
vim.bo.bt = vim.bo.buftype
--- Specifies details about changing the case of letters. It may contain
--- these words, separated by a comma:
--- internal Use internal case mapping functions, the current
--- locale does not change the case mapping. When
--- "internal" is omitted, the towupper() and towlower()
--- system library functions are used when available.
--- keepascii For the ASCII characters (0x00 to 0x7f) use the US
--- case mapping, the current locale is not effective.
--- This probably only matters for Turkish.
---
--- @type string
vim.o.casemap = "internal,keepascii"
vim.o.cmp = vim.o.casemap
vim.go.casemap = vim.o.casemap
vim.go.cmp = vim.go.casemap
--- When on, `:cd`, `:tcd` and `:lcd` without an argument changes the
--- current working directory to the `$HOME` directory like in Unix.
--- When off, those commands just print the current directory name.
--- On Unix this option has no effect.
--- This option cannot be set from a `modeline` or in the `sandbox`, for
--- security reasons.
---
--- @type boolean
vim.o.cdhome = false
vim.o.cdh = vim.o.cdhome
vim.go.cdhome = vim.o.cdhome
vim.go.cdh = vim.go.cdhome
--- This is a list of directories which will be searched when using the
--- `:cd`, `:tcd` and `:lcd` commands, provided that the directory being
--- searched for has a relative path, not an absolute part starting with
--- "/", "./" or "../", the 'cdpath' option is not used then.
--- The 'cdpath' option's value has the same form and semantics as
--- `'path'`. Also see `file-searching`.
--- The default value is taken from $CDPATH, with a "," prepended to look
--- in the current directory first.
--- If the default value taken from $CDPATH is not what you want, include
--- a modified version of the following command in your vimrc file to
--- override it:
--- ```
--- :let &cdpath = ',' .. substitute(substitute($CDPATH, '[, ]', '\\\0', 'g'), ':', ',', 'g')
--- ```
--- This option cannot be set from a `modeline` or in the `sandbox`, for
--- security reasons.
--- (parts of 'cdpath' can be passed to the shell to expand file names).
---
--- @type string
vim.o.cdpath = ",,"
vim.o.cd = vim.o.cdpath
vim.go.cdpath = vim.o.cdpath
vim.go.cd = vim.go.cdpath
--- The key used in Command-line Mode to open the command-line window.
--- Only non-printable keys are allowed.
--- The key can be specified as a single character, but it is difficult to
--- type. The preferred way is to use the <> notation. Examples:
--- ```
--- :exe "set cedit=\\<C-Y>"
--- :exe "set cedit=\\<Esc>"
--- ```
--- `Nvi` also has this option, but it only uses the first character.
--- See `cmdwin`.
---
--- @type string
vim.o.cedit = "\6"
vim.go.cedit = vim.o.cedit
--- `channel` connected to the buffer, or 0 if no channel is connected.
--- In a `:terminal` buffer this is the terminal channel.
--- Read-only.
---
--- @type integer
vim.o.channel = 0
vim.bo.channel = vim.o.channel
--- An expression that is used for character encoding conversion. It is
--- evaluated when a file that is to be read or has been written has a
--- different encoding from what is desired.
--- 'charconvert' is not used when the internal iconv() function is
--- supported and is able to do the conversion. Using iconv() is
--- preferred, because it is much faster.
--- 'charconvert' is not used when reading stdin `--`, because there is no
--- file to convert from. You will have to save the text in a file first.
--- The expression must return zero, false or an empty string for success,
--- non-zero or true for failure.
--- See `encoding-names` for possible encoding names.
--- Additionally, names given in 'fileencodings' and 'fileencoding' are
--- used.
--- Conversion between "latin1", "unicode", "ucs-2", "ucs-4" and "utf-8"
--- is done internally by Vim, 'charconvert' is not used for this.
--- Also used for Unicode conversion.
--- Example:
--- ```
--- set charconvert=CharConvert()
--- fun CharConvert()
--- system("recode "
--- \ .. v:charconvert_from .. ".." .. v:charconvert_to
--- \ .. " <" .. v:fname_in .. " >" .. v:fname_out)
--- return v:shell_error
--- endfun
--- ```
--- The related Vim variables are:
--- v:charconvert_from name of the current encoding
--- v:charconvert_to name of the desired encoding
--- v:fname_in name of the input file
--- v:fname_out name of the output file
--- Note that v:fname_in and v:fname_out will never be the same.
--- This option cannot be set from a `modeline` or in the `sandbox`, for
--- security reasons.
---
--- @type string
vim.o.charconvert = ""
vim.o.ccv = vim.o.charconvert
vim.go.charconvert = vim.o.charconvert
vim.go.ccv = vim.go.charconvert
--- Enables automatic C program indenting. See 'cinkeys' to set the keys
--- that trigger reindenting in insert mode and 'cinoptions' to set your
--- preferred indent style.
--- If 'indentexpr' is not empty, it overrules 'cindent'.
--- If 'lisp' is not on and both 'indentexpr' and 'equalprg' are empty,
--- the "=" operator indents using this algorithm rather than calling an
--- external program.
--- See `C-indenting`.
--- When you don't like the way 'cindent' works, try the 'smartindent'
--- option or 'indentexpr'.
---
--- @type boolean
vim.o.cindent = false
vim.o.cin = vim.o.cindent
vim.bo.cindent = vim.o.cindent
vim.bo.cin = vim.bo.cindent
--- A list of keys that, when typed in Insert mode, cause reindenting of
--- the current line. Only used if 'cindent' is on and 'indentexpr' is
--- empty.
--- For the format of this option see `cinkeys-format`.
--- See `C-indenting`.
---
--- @type string
vim.o.cinkeys = "0{,0},0),0],:,0#,!^F,o,O,e"
vim.o.cink = vim.o.cinkeys
vim.bo.cinkeys = vim.o.cinkeys
vim.bo.cink = vim.bo.cinkeys
--- The 'cinoptions' affect the way 'cindent' reindents lines in a C
--- program. See `cinoptions-values` for the values of this option, and
--- `C-indenting` for info on C indenting in general.
---
--- @type string
vim.o.cinoptions = ""
vim.o.cino = vim.o.cinoptions
vim.bo.cinoptions = vim.o.cinoptions
vim.bo.cino = vim.bo.cinoptions
--- Keywords that are interpreted as a C++ scope declaration by `cino-g`.
--- Useful e.g. for working with the Qt framework that defines additional
--- scope declarations "signals", "public slots" and "private slots":
--- ```
--- set cinscopedecls+=signals,public\ slots,private\ slots
--- ```
---
---
--- @type string
vim.o.cinscopedecls = "public,protected,private"
vim.o.cinsd = vim.o.cinscopedecls
vim.bo.cinscopedecls = vim.o.cinscopedecls
vim.bo.cinsd = vim.bo.cinscopedecls
--- These keywords start an extra indent in the next line when
--- 'smartindent' or 'cindent' is set. For 'cindent' this is only done at
--- an appropriate place (inside {}).
--- Note that 'ignorecase' isn't used for 'cinwords'. If case doesn't
--- matter, include the keyword both the uppercase and lowercase:
--- "if,If,IF".
---
--- @type string
vim.o.cinwords = "if,else,while,do,for,switch"
vim.o.cinw = vim.o.cinwords
vim.bo.cinwords = vim.o.cinwords
vim.bo.cinw = vim.bo.cinwords
--- This option is a list of comma-separated names.
--- These names are recognized:
---
--- *clipboard-unnamed*
--- unnamed When included, Vim will use the clipboard register "*"
--- for all yank, delete, change and put operations which
--- would normally go to the unnamed register. When a
--- register is explicitly specified, it will always be
--- used regardless of whether "unnamed" is in 'clipboard'
--- or not. The clipboard register can always be
--- explicitly accessed using the "* notation. Also see
--- `clipboard`.
---
--- *clipboard-unnamedplus*
--- unnamedplus A variant of the "unnamed" flag which uses the
--- clipboard register "+" (`quoteplus`) instead of
--- register "*" for all yank, delete, change and put
--- operations which would normally go to the unnamed
--- register. When "unnamed" is also included to the
--- option, yank and delete operations (but not put)
--- will additionally copy the text into register
--- "*". See `clipboard`.
---
--- @type string
vim.o.clipboard = ""
vim.o.cb = vim.o.clipboard
vim.go.clipboard = vim.o.clipboard
vim.go.cb = vim.go.clipboard
--- Number of screen lines to use for the command-line. Helps avoiding
--- `hit-enter` prompts.
--- The value of this option is stored with the tab page, so that each tab
--- page can have a different value.
---
--- When 'cmdheight' is zero, there is no command-line unless it is being
--- used. The command-line will cover the last line of the screen when
--- shown.
---
--- WARNING: `cmdheight=0` is considered experimental. Expect some
--- unwanted behaviour. Some 'shortmess' flags and similar
--- mechanism might fail to take effect, causing unwanted hit-enter
--- prompts. Some informative messages, both from Nvim itself and
--- plugins, will not be displayed.
---
--- @type integer
vim.o.cmdheight = 1
vim.o.ch = vim.o.cmdheight
vim.go.cmdheight = vim.o.cmdheight
vim.go.ch = vim.go.cmdheight
--- Number of screen lines to use for the command-line window. `cmdwin`
---
--- @type integer
vim.o.cmdwinheight = 7
vim.o.cwh = vim.o.cmdwinheight
vim.go.cmdwinheight = vim.o.cmdwinheight
vim.go.cwh = vim.go.cmdwinheight
--- 'colorcolumn' is a comma-separated list of screen columns that are
--- highlighted with ColorColumn `hl-ColorColumn`. Useful to align
--- text. Will make screen redrawing slower.
--- The screen column can be an absolute number, or a number preceded with
--- '+' or '-', which is added to or subtracted from 'textwidth'.
--- ```
--- :set cc=+1 " highlight column after 'textwidth'
--- :set cc=+1,+2,+3 " highlight three columns after 'textwidth'
--- :hi ColorColumn ctermbg=lightgrey guibg=lightgrey
--- ```
---
--- When 'textwidth' is zero then the items with '-' and '+' are not used.
--- A maximum of 256 columns are highlighted.
---
--- @type string
vim.o.colorcolumn = ""
vim.o.cc = vim.o.colorcolumn
vim.wo.colorcolumn = vim.o.colorcolumn
vim.wo.cc = vim.wo.colorcolumn
--- Number of columns of the screen. Normally this is set by the terminal
--- initialization and does not have to be set by hand.
--- When Vim is running in the GUI or in a resizable window, setting this
--- option will cause the window size to be changed. When you only want
--- to use the size for the GUI, put the command in your `ginit.vim` file.
--- When you set this option and Vim is unable to change the physical
--- number of columns of the display, the display may be messed up. For
--- the GUI it is always possible and Vim limits the number of columns to
--- what fits on the screen. You can use this command to get the widest
--- window possible:
--- ```
--- :set columns=9999
--- ```
--- Minimum value is 12, maximum value is 10000.
---
--- @type integer
vim.o.columns = 80
vim.o.co = vim.o.columns
vim.go.columns = vim.o.columns
vim.go.co = vim.go.columns
--- A comma-separated list of strings that can start a comment line. See
--- `format-comments`. See `option-backslash` about using backslashes to
--- insert a space.
---
--- @type string
vim.o.comments = "s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-,fb:•"
vim.o.com = vim.o.comments
vim.bo.comments = vim.o.comments
vim.bo.com = vim.bo.comments
--- A template for a comment. The "%s" in the value is replaced with the
--- comment text. For example, C uses "/*%s*/". Currently only used to
--- add markers for folding, see `fold-marker`.
---
--- @type string
vim.o.commentstring = ""
vim.o.cms = vim.o.commentstring
vim.bo.commentstring = vim.o.commentstring
vim.bo.cms = vim.bo.commentstring
--- This option specifies how keyword completion `ins-completion` works
--- when CTRL-P or CTRL-N are used. It is also used for whole-line
--- completion `i_CTRL-X_CTRL-L`. It indicates the type of completion
--- and the places to scan. It is a comma-separated list of flags:
--- . scan the current buffer ('wrapscan' is ignored)
--- w scan buffers from other windows
--- b scan other loaded buffers that are in the buffer list
--- u scan the unloaded buffers that are in the buffer list
--- U scan the buffers that are not in the buffer list
--- k scan the files given with the 'dictionary' option
--- kspell use the currently active spell checking `spell`
--- k{dict} scan the file {dict}. Several "k" flags can be given,
--- patterns are valid too. For example:
--- ```
--- :set cpt=k/usr/dict/*,k~/spanish
--- ```
--- s scan the files given with the 'thesaurus' option
--- s{tsr} scan the file {tsr}. Several "s" flags can be given, patterns
--- are valid too.
--- i scan current and included files
--- d scan current and included files for defined name or macro
--- `i_CTRL-X_CTRL-D`