Line Indent 2 spaces

  • Hi,

    I am using the “Edit -> Indent -> Increase Line Indent (TAB)” to increase the indent of my code.
    The problem is that I do not want it to be increased by 4 spaces (a tab) but only by 2 spaces.
    I can’t find anything about changing this so it only indents the selected lines by 2 spaces.
    Does anyone know how to do that? Or else some other way to indent all selected lines by 1 space or 2 spaces?

    Much appreciated!

  • @Joey-de-Keizer



  • @Claudia-Frank

    Do you mean this?
    I already have it so that all my tabs are spaces and they are already set to 2 spaces.
    But the increase indent still increases all the lines by 4 spaces.

    I just tried this in a normal .txt file and it worked exactly like it should and only increases the space by 2 but my code is written in .yml files and it seems that in those files the “increase indent” always increases it by 4 spaces.

    Could there be some other way to increase it for yml files? It really sucks if I have to change my code to a .txt file just to increase the indent.

  • @Joey-de-Keizer

    Yes, that is it.
    If yaml is still using 4, check in the same window if yaml is not using the default setting.


  • Strange, I can’t figure out why in a YAML type file it doesn’t work but I found that if I go to Language and change it from YAML to User-defined then the indent’s are only 2 spaces too so I can quickly switch between the two of them to set the correct indents.

    Thanks for all the help!

  • @Joey-de-Keizer

    FWIW, if I wanted to insert a blank column(s) throughout a range (especially a large range) of lines–without relying on the tab settings in effect, here’s what I’d do:

    • move the caret to the first position of the first line to affect
    • invoke Edit (menu) -> Begin/End Select (sadly, this useful feature has no default shortcut key!)
    • move the caret to the first position of the last line to affect
    • press Shift+Alt+RightArrow
    • press Shift+Alt+LeftArrow
    • invoke Edit (menu) -> Begin/End Select again

    This should get you a “thin caret” in front of the first column over the span of lines. From there it is easy to insert spaces on each and every line by pressing the spacebar the appropriate number of times.

    Of course, if you range is small, then simply:

    • move the caret to the first position of the first line to affect
    • press Shift+Alt+DownArrow repeatedly to define the “thin caret” over the desired line range.

Log in to reply