How do I indent multiple lines at once in Notepad++?

163,695

Solution 1

The problem was with the QuickText plugin. After removing it, indent worked as normal.

Solution 2

The problem with the new version of QuickText seems to be that it is set to react to the TAB key. Previously it was set to use CTRL-ENTER. If you change the key combination in the shortcut mapper then your TAB key should start working again, and QuickText should also work (with whatever new key you've assigned).

Solution 3

Capslock + Tab to indent multiple lines at once. Highlight the text first.

Solution 4

It works fine for my v. 5.4.5 of Notepad++. I just select multiple lines and press TAB.

If you want TAB to be replaced by SPACE than you need to go Settings > Preferences and select Edit Components tab. Next check Replace by spaces check box in Tab Setting section.

Update: In a newer version of Notepad++ this option is in Settings > Preferences > Language section.

Solution 5

If you're using QuickText and like pressing Tab for it, you can otherwise change the indentation key.

Go Settings > Shortcup Mapper > Scintilla Command. Look at the number 10.

  • I changed 10 to : CTRL + ALT + RIGHT and
  • 11 to : CTRL+ ALT+ LEFT.

Now I think it's even better than the TABL / SHIFT + TAB as default.

Share:
163,695

Related videos on Youtube

cdeszaq
Author by

cdeszaq

Currently working with: Fili REST Druid Java Groovy Spock RxJava SOreadytohelp

Updated on August 26, 2021

Comments

  • cdeszaq
    cdeszaq over 2 years

    In many text editors that are aimed at programmers, if the user has a selection that spans more than 1 line and presses the TAB key, those lines are indented by 1 TAB (or a number of spaces, depending on how the editor is configured).

    However, this does not seem to be the default behavior of Notepad++. Is there a way I can do this in Notepad++, or is there a plugin that I can get to allow me to do this?

    Edit: Upon additional testing, SHIFT-TAB correctly un-indents the lines as expected, but only a tab simply inserts a tab wherever the carat is. This is in version 5.4.5 Unicode

  • Rich
    Rich over 14 years
    5.1.1 (Unicode) here and works too. Independent of the selected syntax highlighting language.
  • Helen
    Helen almost 14 years
    Hi Anshi, welcome to Stack Overflow. Please note that writing in ALL CAPS is difficult to read and looks like shouting.
  • old-monk
    old-monk about 4 years
    it appears to be not applicable to version 7.8.1, can not find 'replace by spaces'.
  • Vadim
    Vadim about 4 years
    @old-monk You right. It looks that 'Replace by space' checkbox is in the Language section now.
  • old-monk
    old-monk about 4 years
    Precisely Settings->Preferences...->Language .. look for checkbox
  • bballdave025
    bballdave025 about 4 years
    Thanks for the details of how to actually find the block indent. That allowed me to actually get what I wanted done. Also, I really like your mappings, I also think it's better than <kbd>TAB</kbd> / <kbd>SHIFT</kbd> + <kbd>TAB</kbd>. Kudos.
  • AdrianHHH
    AdrianHHH almost 3 years
    Welcome to Stack Overflow. Answering questions here is good but new answers to old questions that already have good answers should give new insights and new information. Just repeating information already in other answers is not useful.