How do I indent multiple lines at once in Notepad++?
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.
Related videos on Youtube
cdeszaq
Currently working with: Fili REST Druid Java Groovy Spock RxJava SOreadytohelp
Updated on August 26, 2021Comments
-
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 over 14 years5.1.1 (Unicode) here and works too. Independent of the selected syntax highlighting language.
-
Helen almost 14 yearsHi Anshi, welcome to Stack Overflow. Please note that writing in ALL CAPS is difficult to read and looks like shouting.
-
old-monk about 4 yearsit appears to be not applicable to version 7.8.1, can not find 'replace by spaces'.
-
Vadim about 4 years@old-monk You right. It looks that 'Replace by space' checkbox is in the Language section now.
-
old-monk about 4 yearsPrecisely
Settings->Preferences...->Language
.. look for checkbox -
bballdave025 about 4 yearsThanks 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 almost 3 yearsWelcome 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.