So after quite a lot of searching and frustration I'm here to ask how to do one of the most basic (or so I thought) things in a modern text editor. I want to set a different indentation for different files types. I almost all the time edit javascript
+HTML/XML
+python
together, and cannot have a fixed 4-spaces
or 2-spaces
indentation.
I tried setting the indentation mode for different files. However, I cannot find a way to change the number of spaces to indent for each mode. In Settings->Configure Kate->Editing->Indentation
, I can set the Default Indentation Mode
and select the number of spaces to indent. But there's no way to change the number of spaces to indent for each mode.
Temporary solution:
add,
<!-- kate: indent-width 2; -->
at the beginning of every XML file. Which is quite annoying.
Obviously I want to know if there's a easier way to do it, but if there's no way to do it from the UI, I would love if someone can help me cook up a solution.
I found this bug report (filed 5years ago), where the person mentions something like
The current workaround is to type "kate: indent-mode " into Variables under filetype properties.
I don't know where to find this filetype properties
:/ or even if it exists.
Settings → Configure Kate... → Editor Component → Open/Save → Modes & Filetypes
– ninjalj Oct 30 '13 at 15:21indentation **mode**
there, but the problem is no way to change the number of spaces to indent for each mode. – xcorat Oct 30 '13 at 16:18Markup/XML
asFiletype:
and enterkate: indent-width 2;
intoVariables:
. – ninjalj Oct 30 '13 at 17:01varibles:
GOD DAMN IT I DIDN'T SEE :)))) thx. – xcorat Oct 30 '13 at 17:17