diff --git a/doc/katepart/configuring.docbook b/doc/katepart/configuring.docbook --- a/doc/katepart/configuring.docbook +++ b/doc/katepart/configuring.docbook @@ -1239,7 +1239,7 @@ Configuring With Document Variables -&kappname; variables is katepart's implementation of document variables, similar +&kappname; variables is &kappname;'s implementation of document variables, similar to &Emacs; and vi modelines. In katepart, the lines have the following format: kate: VARIABLENAME VALUE; [ VARIABLENAME VALUE; ... ] @@ -1259,12 +1259,10 @@ Additionally, document variables can be placed in a file called .kateconfig in any directory, and the configured settings will be applied as if the modelines were entered on every file in the directory and its -subdirectories, as far down as the -configured search depth. -Document variables in .kateconfig use the same syntax as -in modelines. +subdirectories. Document variables in .kateconfig use the same syntax as +in modelines, but with extended options. -There are variables to support almost all configurations in katepart, and +There are variables to support almost all configurations in &kappname;, and additionally plugins can use variables, in which case it should be documented in the plugin's documentation. @@ -1557,6 +1555,39 @@ + +Extended Options in <filename>.kateconfig</filename> files + +&kappname; always search for a .kateconfig file for local files (not remote files). +In addition, it is possible to set options based on wildcards (file extensions) as follows: + +kate: tab-width 4; indent-width 4; replace-tabs on; +kate-wildcard(*.xml): indent-width 2; +kate-wildcard(Makefile): replace-tabs off; + + +In this example, all files use a tab-width of 4 spaces, an indent-width of 4 spaces, +and tabs are replaced expanded to spaces. However, for all *.xml +files, the indent width is set to 2 spaces. +And Makefiles use tabs, &ie; tabs are not replaced with spaces. + +Wildcards are semicolon separated, &ie; you can also specify multiple file extensions as follows: + + +kate-wildcard(*.json;*.xml): indent-width 2; + +Further, you can also use the mimetype to match certain files, ⪚ to indent +all C++ source files with 4 spaces, you can write: + + +kate-mimetype(text/x-c++src): indent-width 4; + +Next to the support in .kateconfig files, wildcard and mimetype +dependent document variables are also supported in the files itself as comments. + + + +