• Login
Community
  • Login

Line Indent 2 spaces

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
6 Posts 3 Posters 16.1k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J
    Joey de Keizer
    last edited by Nov 12, 2017, 3:22 PM

    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!

    C 1 Reply Last reply Nov 12, 2017, 3:26 PM Reply Quote 1
    • C
      Claudia Frank @Joey de Keizer
      last edited by Nov 12, 2017, 3:26 PM

      @Joey-de-Keizer

      Settings->Preferences->Language->TabSize

      Cheers
      Claudia

      J 1 Reply Last reply Nov 12, 2017, 3:44 PM Reply Quote 0
      • J
        Joey de Keizer @Claudia Frank
        last edited by Nov 12, 2017, 3:44 PM

        @Claudia-Frank

        Do you mean this? http://prntscr.com/h9h3zn
        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.

        C 1 Reply Last reply Nov 12, 2017, 3:48 PM Reply Quote 1
        • C
          Claudia Frank @Joey de Keizer
          last edited by Nov 12, 2017, 3:48 PM

          @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.

          Cheers
          Claudia

          1 Reply Last reply Reply Quote 0
          • J
            Joey de Keizer
            last edited by Nov 12, 2017, 4:01 PM

            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!

            S 1 Reply Last reply Nov 12, 2017, 5:59 PM Reply Quote 0
            • S
              Scott Sumner @Joey de Keizer
              last edited by Nov 12, 2017, 5:59 PM

              @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.
              1 Reply Last reply Reply Quote 0
              1 out of 6
              • First post
                1/6
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors