/ src / config-schema.js
config-schema.js
  1  // This is loaded by atom-environment.coffee. See
  2  // https://atom.io/docs/api/latest/Config for more information about config
  3  // schemas.
  4  const configSchema = {
  5    core: {
  6      type: 'object',
  7      properties: {
  8        ignoredNames: {
  9          type: 'array',
 10          default: [
 11            '.git',
 12            '.hg',
 13            '.svn',
 14            '.DS_Store',
 15            '._*',
 16            'Thumbs.db',
 17            'desktop.ini'
 18          ],
 19          items: {
 20            type: 'string'
 21          },
 22          description:
 23            'List of [glob patterns](https://en.wikipedia.org/wiki/Glob_%28programming%29). Files and directories matching these patterns will be ignored by some packages, such as the fuzzy finder and tree view. Individual packages might have additional config settings for ignoring names.'
 24        },
 25        excludeVcsIgnoredPaths: {
 26          type: 'boolean',
 27          default: true,
 28          title: 'Exclude VCS Ignored Paths',
 29          description:
 30            "Files and directories ignored by the current project's VCS will be ignored by some packages, such as the fuzzy finder and find and replace. For example, projects using Git have these paths defined in the .gitignore file. Individual packages might have additional config settings for ignoring VCS ignored files and folders."
 31        },
 32        followSymlinks: {
 33          type: 'boolean',
 34          default: true,
 35          description:
 36            'Follow symbolic links when searching files and when opening files with the fuzzy finder.'
 37        },
 38        disabledPackages: {
 39          type: 'array',
 40          default: [],
 41  
 42          items: {
 43            type: 'string'
 44          },
 45  
 46          description:
 47            'List of names of installed packages which are not loaded at startup.'
 48        },
 49        versionPinnedPackages: {
 50          type: 'array',
 51          default: [],
 52  
 53          items: {
 54            type: 'string'
 55          },
 56  
 57          description:
 58            'List of names of installed packages which are not automatically updated.'
 59        },
 60        customFileTypes: {
 61          type: 'object',
 62          default: {},
 63          description:
 64            'Associates scope names (e.g. `"source.js"`) with arrays of file extensions and file names (e.g. `["Somefile", ".js2"]`)',
 65          additionalProperties: {
 66            type: 'array',
 67            items: {
 68              type: 'string'
 69            }
 70          }
 71        },
 72        uriHandlerRegistration: {
 73          type: 'string',
 74          default: 'prompt',
 75          description:
 76            'When should Atom register itself as the default handler for atom:// URIs',
 77          enum: [
 78            {
 79              value: 'prompt',
 80              description:
 81                'Prompt to register Atom as the default atom:// URI handler'
 82            },
 83            {
 84              value: 'always',
 85              description:
 86                'Always become the default atom:// URI handler automatically'
 87            },
 88            {
 89              value: 'never',
 90              description: 'Never become the default atom:// URI handler'
 91            }
 92          ]
 93        },
 94        themes: {
 95          type: 'array',
 96          default: ['one-dark-ui', 'one-dark-syntax'],
 97          items: {
 98            type: 'string'
 99          },
100          description:
101            'Names of UI and syntax themes which will be used when Atom starts.'
102        },
103        audioBeep: {
104          type: 'boolean',
105          default: true,
106          description:
107            "Trigger the system's beep sound when certain actions cannot be executed or there are no results."
108        },
109        closeDeletedFileTabs: {
110          type: 'boolean',
111          default: false,
112          title: 'Close Deleted File Tabs',
113          description:
114            'Close corresponding editors when a file is deleted outside Atom.'
115        },
116        destroyEmptyPanes: {
117          type: 'boolean',
118          default: true,
119          title: 'Remove Empty Panes',
120          description:
121            'When the last tab of a pane is closed, remove that pane as well.'
122        },
123        closeEmptyWindows: {
124          type: 'boolean',
125          default: true,
126          description:
127            "When a window with no open tabs or panes is given the 'Close Tab' command, close that window."
128        },
129        fileEncoding: {
130          description:
131            'Default character set encoding to use when reading and writing files.',
132          type: 'string',
133          default: 'utf8',
134          enum: [
135            {
136              value: 'iso88596',
137              description: 'Arabic (ISO 8859-6)'
138            },
139            {
140              value: 'windows1256',
141              description: 'Arabic (Windows 1256)'
142            },
143            {
144              value: 'iso88594',
145              description: 'Baltic (ISO 8859-4)'
146            },
147            {
148              value: 'windows1257',
149              description: 'Baltic (Windows 1257)'
150            },
151            {
152              value: 'iso885914',
153              description: 'Celtic (ISO 8859-14)'
154            },
155            {
156              value: 'iso88592',
157              description: 'Central European (ISO 8859-2)'
158            },
159            {
160              value: 'windows1250',
161              description: 'Central European (Windows 1250)'
162            },
163            {
164              value: 'gb18030',
165              description: 'Chinese (GB18030)'
166            },
167            {
168              value: 'gbk',
169              description: 'Chinese (GBK)'
170            },
171            {
172              value: 'cp950',
173              description: 'Traditional Chinese (Big5)'
174            },
175            {
176              value: 'big5hkscs',
177              description: 'Traditional Chinese (Big5-HKSCS)'
178            },
179            {
180              value: 'cp866',
181              description: 'Cyrillic (CP 866)'
182            },
183            {
184              value: 'iso88595',
185              description: 'Cyrillic (ISO 8859-5)'
186            },
187            {
188              value: 'koi8r',
189              description: 'Cyrillic (KOI8-R)'
190            },
191            {
192              value: 'koi8u',
193              description: 'Cyrillic (KOI8-U)'
194            },
195            {
196              value: 'windows1251',
197              description: 'Cyrillic (Windows 1251)'
198            },
199            {
200              value: 'cp437',
201              description: 'DOS (CP 437)'
202            },
203            {
204              value: 'cp850',
205              description: 'DOS (CP 850)'
206            },
207            {
208              value: 'iso885913',
209              description: 'Estonian (ISO 8859-13)'
210            },
211            {
212              value: 'iso88597',
213              description: 'Greek (ISO 8859-7)'
214            },
215            {
216              value: 'windows1253',
217              description: 'Greek (Windows 1253)'
218            },
219            {
220              value: 'iso88598',
221              description: 'Hebrew (ISO 8859-8)'
222            },
223            {
224              value: 'windows1255',
225              description: 'Hebrew (Windows 1255)'
226            },
227            {
228              value: 'cp932',
229              description: 'Japanese (CP 932)'
230            },
231            {
232              value: 'eucjp',
233              description: 'Japanese (EUC-JP)'
234            },
235            {
236              value: 'shiftjis',
237              description: 'Japanese (Shift JIS)'
238            },
239            {
240              value: 'euckr',
241              description: 'Korean (EUC-KR)'
242            },
243            {
244              value: 'iso885910',
245              description: 'Nordic (ISO 8859-10)'
246            },
247            {
248              value: 'iso885916',
249              description: 'Romanian (ISO 8859-16)'
250            },
251            {
252              value: 'iso88599',
253              description: 'Turkish (ISO 8859-9)'
254            },
255            {
256              value: 'windows1254',
257              description: 'Turkish (Windows 1254)'
258            },
259            {
260              value: 'utf8',
261              description: 'Unicode (UTF-8)'
262            },
263            {
264              value: 'utf16le',
265              description: 'Unicode (UTF-16 LE)'
266            },
267            {
268              value: 'utf16be',
269              description: 'Unicode (UTF-16 BE)'
270            },
271            {
272              value: 'windows1258',
273              description: 'Vietnamese (Windows 1258)'
274            },
275            {
276              value: 'iso88591',
277              description: 'Western (ISO 8859-1)'
278            },
279            {
280              value: 'iso88593',
281              description: 'Western (ISO 8859-3)'
282            },
283            {
284              value: 'iso885915',
285              description: 'Western (ISO 8859-15)'
286            },
287            {
288              value: 'macroman',
289              description: 'Western (Mac Roman)'
290            },
291            {
292              value: 'windows1252',
293              description: 'Western (Windows 1252)'
294            }
295          ]
296        },
297        openEmptyEditorOnStart: {
298          description:
299            'When checked opens an untitled editor when loading a blank environment (such as with _File > New Window_ or when "Restore Previous Windows On Start" is unchecked); otherwise no editor is opened when loading a blank environment. This setting has no effect when restoring a previous state.',
300          type: 'boolean',
301          default: true
302        },
303        restorePreviousWindowsOnStart: {
304          type: 'string',
305          enum: ['no', 'yes', 'always'],
306          default: 'yes',
307          description:
308            "When selected 'no', a blank environment is loaded. When selected 'yes' and Atom is started from the icon or `atom` by itself from the command line, restores the last state of all Atom windows; otherwise a blank environment is loaded. When selected 'always', restores the last state of all Atom windows always, no matter how Atom is started."
309        },
310        reopenProjectMenuCount: {
311          description:
312            'How many recent projects to show in the Reopen Project menu.',
313          type: 'integer',
314          default: 15
315        },
316        automaticallyUpdate: {
317          description:
318            'Automatically update Atom when a new release is available.',
319          type: 'boolean',
320          default: true
321        },
322        useProxySettingsWhenCallingApm: {
323          title: 'Use Proxy Settings When Calling APM',
324          description:
325            'Use detected proxy settings when calling the `apm` command-line tool.',
326          type: 'boolean',
327          default: true
328        },
329        allowPendingPaneItems: {
330          description:
331            'Allow items to be previewed without adding them to a pane permanently, such as when single clicking files in the tree view.',
332          type: 'boolean',
333          default: true
334        },
335        telemetryConsent: {
336          description:
337            'Allow usage statistics and exception reports to be sent to the Atom team to help improve the product.',
338          title: 'Send Telemetry to the Atom Team',
339          type: 'string',
340          default: 'undecided',
341          enum: [
342            {
343              value: 'limited',
344              description:
345                'Allow limited anonymous usage stats, exception and crash reporting'
346            },
347            {
348              value: 'no',
349              description: 'Do not send any telemetry data'
350            },
351            {
352              value: 'undecided',
353              description:
354                'Undecided (Atom will ask again next time it is launched)'
355            }
356          ]
357        },
358        warnOnLargeFileLimit: {
359          description:
360            'Warn before opening files larger than this number of megabytes.',
361          type: 'number',
362          default: 40
363        },
364        fileSystemWatcher: {
365          description:
366            'Choose the underlying implementation used to watch for filesystem changes. Emulating changes will miss any events caused by applications other than Atom, but may help prevent crashes or freezes.',
367          type: 'string',
368          default: 'native',
369          enum: [
370            {
371              value: 'native',
372              description: 'Native operating system APIs'
373            },
374            {
375              value: 'experimental',
376              description: 'Experimental filesystem watching library'
377            },
378            {
379              value: 'poll',
380              description: 'Polling'
381            },
382            {
383              value: 'atom',
384              description: 'Emulated with Atom events'
385            }
386          ]
387        },
388        useTreeSitterParsers: {
389          type: 'boolean',
390          default: true,
391          description: 'Use Tree-sitter parsers for supported languages.'
392        },
393        colorProfile: {
394          description:
395            "Specify whether Atom should use the operating system's color profile (recommended) or an alternative color profile.<br>Changing this setting will require a relaunch of Atom to take effect.",
396          type: 'string',
397          default: 'default',
398          enum: [
399            {
400              value: 'default',
401              description: 'Use color profile configured in the operating system'
402            },
403            {
404              value: 'srgb',
405              description: 'Use sRGB color profile'
406            }
407          ]
408        }
409      }
410    },
411    editor: {
412      type: 'object',
413      // These settings are used in scoped fashion only. No defaults.
414      properties: {
415        commentStart: {
416          type: ['string', 'null']
417        },
418        commentEnd: {
419          type: ['string', 'null']
420        },
421        increaseIndentPattern: {
422          type: ['string', 'null']
423        },
424        decreaseIndentPattern: {
425          type: ['string', 'null']
426        },
427        foldEndPattern: {
428          type: ['string', 'null']
429        },
430        // These can be used as globals or scoped, thus defaults.
431        fontFamily: {
432          type: 'string',
433          default: 'Menlo, Consolas, DejaVu Sans Mono, monospace',
434          description: 'The name of the font family used for editor text.'
435        },
436        fontSize: {
437          type: 'integer',
438          default: 14,
439          minimum: 1,
440          maximum: 100,
441          description: 'Height in pixels of editor text.'
442        },
443        lineHeight: {
444          type: ['string', 'number'],
445          default: 1.5,
446          description: 'Height of editor lines, as a multiplier of font size.'
447        },
448        showCursorOnSelection: {
449          type: 'boolean',
450          default: true,
451          description: 'Show cursor while there is a selection.'
452        },
453        showInvisibles: {
454          type: 'boolean',
455          default: false,
456          description:
457            'Render placeholders for invisible characters, such as tabs, spaces and newlines.'
458        },
459        showIndentGuide: {
460          type: 'boolean',
461          default: false,
462          description: 'Show indentation indicators in the editor.'
463        },
464        showLineNumbers: {
465          type: 'boolean',
466          default: true,
467          description: "Show line numbers in the editor's gutter."
468        },
469        atomicSoftTabs: {
470          type: 'boolean',
471          default: true,
472          description:
473            'Skip over tab-length runs of leading whitespace when moving the cursor.'
474        },
475        autoIndent: {
476          type: 'boolean',
477          default: true,
478          description: 'Automatically indent the cursor when inserting a newline.'
479        },
480        autoIndentOnPaste: {
481          type: 'boolean',
482          default: true,
483          description:
484            'Automatically indent pasted text based on the indentation of the previous line.'
485        },
486        nonWordCharacters: {
487          type: 'string',
488          default: '/\\()"\':,.;<>~!@#$%^&*|+=[]{}`?-…',
489          description:
490            'A string of non-word characters to define word boundaries.'
491        },
492        preferredLineLength: {
493          type: 'integer',
494          default: 80,
495          minimum: 1,
496          description:
497            'Identifies the length of a line which is used when wrapping text with the `Soft Wrap At Preferred Line Length` setting enabled, in number of characters.'
498        },
499        maxScreenLineLength: {
500          type: 'integer',
501          default: 500,
502          minimum: 500,
503          description:
504            'Defines the maximum width of the editor window before soft wrapping is enforced, in number of characters.'
505        },
506        tabLength: {
507          type: 'integer',
508          default: 2,
509          minimum: 1,
510          description: 'Number of spaces used to represent a tab.'
511        },
512        softWrap: {
513          type: 'boolean',
514          default: false,
515          description:
516            'Wraps lines that exceed the width of the window. When `Soft Wrap At Preferred Line Length` is set, it will wrap to the number of characters defined by the `Preferred Line Length` setting.'
517        },
518        softTabs: {
519          type: 'boolean',
520          default: true,
521          description:
522            'If the `Tab Type` config setting is set to "auto" and autodetection of tab type from buffer content fails, then this config setting determines whether a soft tab or a hard tab will be inserted when the Tab key is pressed.'
523        },
524        tabType: {
525          type: 'string',
526          default: 'auto',
527          enum: ['auto', 'soft', 'hard'],
528          description:
529            'Determine character inserted when Tab key is pressed. Possible values: "auto", "soft" and "hard". When set to "soft" or "hard", soft tabs (spaces) or hard tabs (tab characters) are used. When set to "auto", the editor auto-detects the tab type based on the contents of the buffer (it uses the first leading whitespace on a non-comment line), or uses the value of the Soft Tabs config setting if auto-detection fails.'
530        },
531        softWrapAtPreferredLineLength: {
532          type: 'boolean',
533          default: false,
534          description:
535            "Instead of wrapping lines to the window's width, wrap lines to the number of characters defined by the `Preferred Line Length` setting. This will only take effect when the soft wrap config setting is enabled globally or for the current language. **Note:** If you want to hide the wrap guide (the vertical line) you can disable the `wrap-guide` package."
536        },
537        softWrapHangingIndent: {
538          type: 'integer',
539          default: 0,
540          minimum: 0,
541          description:
542            'When soft wrap is enabled, defines length of additional indentation applied to wrapped lines, in number of characters.'
543        },
544        scrollSensitivity: {
545          type: 'integer',
546          default: 40,
547          minimum: 10,
548          maximum: 200,
549          description:
550            'Determines how fast the editor scrolls when using a mouse or trackpad.'
551        },
552        scrollPastEnd: {
553          type: 'boolean',
554          default: false,
555          description:
556            'Allow the editor to be scrolled past the end of the last line.'
557        },
558        undoGroupingInterval: {
559          type: 'integer',
560          default: 300,
561          minimum: 0,
562          description:
563            'Time interval in milliseconds within which text editing operations will be grouped together in the undo history.'
564        },
565        confirmCheckoutHeadRevision: {
566          type: 'boolean',
567          default: true,
568          title: 'Confirm Checkout HEAD Revision',
569          description:
570            'Show confirmation dialog when checking out the HEAD revision and discarding changes to current file since last commit.'
571        },
572        invisibles: {
573          type: 'object',
574          description:
575            'A hash of characters Atom will use to render whitespace characters. Keys are whitespace character types, values are rendered characters (use value false to turn off individual whitespace character types).',
576          properties: {
577            eol: {
578              type: ['boolean', 'string'],
579              default: '¬',
580              maximumLength: 1,
581              description:
582                'Character used to render newline characters (\\n) when the `Show Invisibles` setting is enabled. '
583            },
584            space: {
585              type: ['boolean', 'string'],
586              default: '·',
587              maximumLength: 1,
588              description:
589                'Character used to render leading and trailing space characters when the `Show Invisibles` setting is enabled.'
590            },
591            tab: {
592              type: ['boolean', 'string'],
593              default: '»',
594              maximumLength: 1,
595              description:
596                'Character used to render hard tab characters (\\t) when the `Show Invisibles` setting is enabled.'
597            },
598            cr: {
599              type: ['boolean', 'string'],
600              default: '¤',
601              maximumLength: 1,
602              description:
603                'Character used to render carriage return characters (for Microsoft-style line endings) when the `Show Invisibles` setting is enabled.'
604            }
605          }
606        },
607        zoomFontWhenCtrlScrolling: {
608          type: 'boolean',
609          default: process.platform !== 'darwin',
610          description:
611            'Change the editor font size when pressing the Ctrl key and scrolling the mouse up/down.'
612        }
613      }
614    }
615  };
616  
617  if (['win32', 'linux'].includes(process.platform)) {
618    configSchema.core.properties.autoHideMenuBar = {
619      type: 'boolean',
620      default: false,
621      description:
622        'Automatically hide the menu bar and toggle it by pressing Alt. This is only supported on Windows & Linux.'
623    };
624  }
625  
626  if (process.platform === 'darwin') {
627    configSchema.core.properties.titleBar = {
628      type: 'string',
629      default: 'native',
630      enum: ['native', 'custom', 'custom-inset', 'hidden'],
631      description:
632        'Experimental: A `custom` title bar adapts to theme colors. Choosing `custom-inset` adds a bit more padding. The title bar can also be completely `hidden`.<br>Note: Switching to a custom or hidden title bar will compromise some functionality.<br>This setting will require a relaunch of Atom to take effect.'
633    };
634  }
635  
636  module.exports = configSchema;