Lazarus IDE Extension - skalogryz/editorConfig GitHub Wiki

In lazideext directory, there's Lazarus IDE plugin that provides support for ".editorconfig" files.

The plugin adds a code in Lazarus IDE to be applied every time a source editor is activated. On activation, the plugin searchers for ".editorconfig" file and applies the settings to the editor.

The following settings are supported:

  • indent_style - via SynEdit tabToSpaces option
  • indent_size, tab_width - via SynEdit TabWidth property
  • end_of_line - via CodeTools TCodeBuffer DiskLineEnding
  • charset - via CodeTools DiskEncoding proeprty
  • trim_trailing_whitespace - via SynEdit TrimTrailingWhitespaces property
  • insert_final_newline - not supported yet

Installation

1. Start Lazarus IDE.
2. Select Package -> Open Package File (.lpk), select editorconfigruntime.lpk.
2.1 compile the package
3. Select Package -> Open Package File (.lpk), select lazideext/editorconfiglazext.lpk
3.1 compile and install the package. (this required Lazarus IDE to be rebuilt)
4 you're done.

Use

Each time a source editor is activated, .editorconfig file would be searched for. If the corresponding file is found, the plugin would automatically adjust the editor setting towards the record in the file.

As an example. With .editorconfig file written like this:

 [*.cs]
 indent_style=space
 indent_size=2
 end_of_line=lf

a .cs file would open in the following manner

while the same file opened, but with a different extension, would look a bit different (using IDE defaults)

⚠️ **GitHub.com Fallback** ⚠️