Search code examples
geany

How to set multiple indentation widths in Geany?


I use Geany mainly for Python, so I've set Indent Type to Spaces and Indent Width to 4. But when working with HTML, I'd like to use 2 spaces.

Is there any way to tell Geany to automatically switch to 2 spaces when working with HTML documents instead of being changing this manually all the time?


Solution

  • You can set indention by filetype or by project. To configure it via filetype copy the filetypes.filetypename from data folder of your Geany installation into your ~/.config/geany/filedefs folder and change

    [indentation]
    width=4
    type=1
    

    to what you like. Please check manual for details.

    To start configuration based on a project, start here.