Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
editorconfig-format(5)	       File Formats Manual	  editorconfig-format(5)

NAME
     editorconfig-format - EditorConfig File Format

EditorConfig File Format
     EditorConfig  files  use  an  INI format that is compatible with the format
     used by Python ConfigParser Library, but [ and ] are allowed in the section
     names. The section names are filepath globs, similar to the format accepted
     by gitignore. Forward slashes (/) are used as  path  separators  and  semi-
     colons (;) or octothorpes (#) are used for comments. Comments should go in-
     dividual  lines.  EditorConfig  files  should be UTF-8 encoded, with either
     CRLF or LF line separators.

     Filename globs containing path separators (/) match filepaths in  the  same
     way as the filename globs used by .gitignore files. Backslashes (\) are not
     allowed as path separators.

     A	semicolon character (;) starts a line comment that terminates at the end
     of the line. Line comments and blank lines are ignored when  parsing.  Com-
     ments  may be added to the ends of non-empty lines. An octothorpe character
     (#) may be used instead of a semicolon to denote the start of a comment.

Filename and Location
     When a filename is given to EditorConfig a search is performed in	the  di-
     rectory  of  the  given file and all parent directories for an EditorConfig
     file (named '.editorconfig' by default). All found EditorConfig  files  are
     searched  for  sections with section names matching the given filename. The
     search will stop if an EditorConfig file is found with  the  root	property
     set to true or when reaching the root filesystem directory.

     Files  are  read  top to bottom and the most recent rules found take prece-
     dence. If multiple EditorConfig files have  matching  sections,  the  rules
     from  the	closer	EditorConfig file are read last, so properties in closer
     files take precedence.

Wildcard Patterns
     Section names in EditorConfig files are filename globs that support pattern
     matching through Unix shell-style wildcards. These filename globs recognize
     the following as special characters for wildcard matching:

     *		  Matches any string of characters, except path separators (/)

     ** 	  Matches any string of characters

     ?		  Matches any single character

     [seq]	  Matches any single character in seq

     [!seq]	  Matches any single character not in seq

     {s1,s2,s3}   Matches any of the strings given (separated by commas, can  be
     nested)

     {num1..num2}  Matches any integer numbers between num1 and num2, where num1
     and num2 can be either positive or negative

     The backslash character () can be used to escape a character so it  is  not
     interpreted as a special character.

     The  maximum  length of a section name is 4096 characters. All sections ex-
     ceeding this limit are ignored.

Supported Properties
     EditorConfig file sections contain properties, which are  name-value  pairs
     separated	by  an equal sign (=). EditorConfig plugins will ignore unrecog-
     nized property names and properties with invalid values.

     Here is the list of all property names understood by EditorConfig	and  all
     valid values for these properties:

     * indent_style:  set  to 'tab' or 'space' to use hard tabs or soft tabs re-
       spectively. The values are case insensitive.
     * indent_size: a whole number defining the number of columns used for  each
       indentation  level  and	the width of soft tabs (when supported). If this
       equals to 'tab', the indent_size will be  set  to  the  tab  size,  which
       should be tab_width if tab_width is specified, or the tab size set by ed-
       itor if tab_width is not specified. The values are case insensitive.
     * tab_width:  a  whole number defining the number of columns used to repre-
       sent a tab character. This defaults  to	the  value  of	indent_size  and
       should not usually need to be specified.
     * end_of_line:  set to 'lf', 'cr', or 'crlf' to control how line breaks are
       represented. The values are case insensitive.
     * charset: set to 'latin1', 'utf-8', 'utf-8-bom', 'utf-16be' or  'utf-16le'
       to control the character set. Use of 'utf-8-bom' is discouraged.
     * trim_trailing_whitespace:  set to 'true' to remove any whitespace charac-
       ters preceding newline characters and 'false' to ensure it doesn't.
     * insert_final_newline: set to 'true' ensure file ends with a newline  when
       saving and 'false' to ensure it doesn't.
     * root:  special  property  that should be specified at the top of the file
       outside of any sections. Set to 'true' to stop .editorconfig files search
       on current file. The value is case insensitive.
     For any property, a value of 'unset' is to remove the effect of that  prop-
     erty,  even  if it has been set before. For example, add 'indent_size = un-
     set' to undefine indent_size property (and use editor default).
     Property names are case insensitive and all property names  are  lowercased
     when  parsing.  The  maximum length of a property name is 50 characters and
     the maximum length of a property value is 255 characters. Any property  be-
     yond these limits would be ignored.

EditorConfig			 Thu Jul 30 2026	  editorconfig-format(5)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=editorconfig-format&sektion=5&manpath=FreeBSD+Ports+15.1.quarterly>

home | help