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

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

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

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

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

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.

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.

I have Notepad++ 5.3.1 (UNICODE). I haven't done any magic and it works fine for me as described by you.
Maybe it depends on the (programming/markup/...) "Language"?

Just install the NppAutoIndent plug-in, select Plugins > NppAutoIndent > Ignore Language and then Plugins > NppAutoIndent > Smart Indent.

Notepad++ will only auto-insert subsequent indents if you manually indent the first line in a block; otherwise you can re-indent your code after the fact using TextFX > TextFX Edit > Reindent C++ code.

in Notepad++v6.1.8 (Unicode) it works after removing the QuickText plugin.

To increase indent - Press and hold TAB
To decrease indent - Press and hold TAB + SHIFT

Related

Make VS code stop adding and inserting characters

VS code likes thinking for me, which is the number 1 sin a text editor can
do. To "help" it will auto type [] and {}, when deleting it will also delete [] instead of just ]. When typing HTML it also tries to auto add </div> at the wrong time...
99% of the time when it adds a character I didn't add myself it creates issues. How can I turn that feature off? i.e if I didn't explicitly press a key to modify a character, VS code has no business touching that character.
Open the Settings menu (Ctrl , on Windows or File -> Preferences -> Settings).
Select Text Editor.
You can selectively disable Auto Closing Brackets, Auto Closing Quotes, and other editor options.

Intellij: how to convert indents for all files

I know how to convert indent for a single file. I go to edit -> convert indent -> space/tab.
But I want to do this for all files under a directory.
I try click on a directory and then go to edit -> convert indent, but the options are grayed out.
You can use the shortcut Ctrl+ALT+L (Windows/Linux) or ⌥⌘+L (MAC OS X) and select the Rearrange entries option to reformat the code in the current file or reformat a module or directory.
You can also Right-click a module, file, or directory from the context menu and select Reformat Code and also select the Rearrange entries option.
This will convert the indents for all files/directories selected:
This works on most of the Jetbrains IDES (iDea, PyCharm, WebStorm, RubyMine, and so on.)
It seems there is no such dedicated option in IntelliJ, but you could just work around it using a "low-level" Replace All action.
Open the Edit → Find → Replace in Files... dialog
In case you want to convert spaces to tabs, you should
Enter in the Find field (i.e. four spaces (or whatever number of spaces the project is currently indented with))
Press the Regex search modifier (Alt + X)
Enter \t in the Replace field
NB: In case you have valid strings with 4+ spaces in them, they will get replaced too. In most use cases, however, this is not happening.
In case you want to convert tabs to spaces, you should do the same as above, but swap the Find and Replace field contents
NB: Again, if you have valid strings with tabs in them, they will get replaced too. I haven't had this use case, because I've only needed to convert in the opposite direction.
You will probably also want to set a File mask in order not to replace spaces in code-irrelevant files

WebStorm wrapper text with square brackets

When I select some text, for example form-col and press [ I want to get [form-col] but WebStorm replace selected text with [. Is there a way to configure it?
I don't think that functionality exist. However you can use the Live template functionality. It's very useful and it does pretty much the same thing.
To do this, go on : [File]->[Settings]->[Editor]->[Live Templates]->user, Click button + and add a live template like:
In you html file when you write the abbreviation what you are added, press Tab and it generate you [] and place the cursor after the first [and now you can write your html tag [form-col]
Settings/Preferences
Editor | General | Smart Keys
Ensure that Surround selection on typing quote or brace option is enabled

IntelliJ force code formatter to join lines based on wrap settings

How can i reformat file(s) in IntelliJ and join all lines that are split.
I know that I can do that individually by selecting lines and "join lines" with CTRL + SHIFT + J
Since we changed our code formatting wrap policy recently I want to be able to join lines in all files based on the updated wrap setting. (Settings > Code Style > General > Right margin)
The only thing is that IntelliJ seems happy to split lines based on wrap setting, but will silently deny to join lines based on that setting.
Unlike the question Force code formatter in IntelliJ to join lines, I am not satisfied by splitting lines or joining manually (as the accepted answer suggests). I want IntelliJ to join lines automatically.
Bonus question: Which other editors can do this?
Disable the following code style option - Project Settings - Code Style - Wrapping and Braces - Keep when reformatting - Line breaks
IntelliJ IDEA 15
File > Settings... > Editor > Code Style > Java > Wrapping and Braces > Keep when reformatting > uncheck Line breaks
(if you want to have the same setting for another type of file, choose it from Code Style)
Go to Code > Reformat Code (Ctrl + Alt + L).

IntelliJ IDEA shortcut keymap for matching brace

What is the keymap for navigating to the matching brace in IntelliJ IDEA?
public void blah() {|
...
}
If | is my cursor, I would like to jump to the closing brace with this keymap.
I've only verified this with IntelliJ 9 but:
On Windows:
Ctrl+} will move to the close
bracket.
Ctrl+{ will move to the open bracket.
On Mac:
Use cmd instead of Ctrl.
As an alternative to Ctrl+} and Ctrl+{ you can by default use Ctrl+Alt+Shift+9 and Ctrl+Alt+Shift+8 respectively. I haven't even tried to remember that yet. ;)
Also in Settings -> (IDE Settings ->) Keymap -> Editor Actions there's an entry called "Move Caret to Matched Brace" that doesn't have a default key mapping. I mapped it to Ctrl+< because the key combination was unmapped and the keys are close to each other on a german keyboard.
This applies to IDEA 12.
Its ^M (control + M) on my Mac using IDEA v15 and keeping the default keymap for MacOSX 10.5+
If you are not sure go to prefs and search for "Move Caret to Matching Brace". That's the name of the command and you can set your own shortcut!
On some keyboards, including Swedish ones, it's not practical to use Ctrl-} or Ctrl-{. The best approach I've found under those circumstances is to double-click the bracket in view, which highlights everything between the brackets, then use left-arrow or right-arrow to move to the appropriate end of the highlighted region.
Ctrl+} and Ctrl+{ only moves the cursor to the closes corresponding brace that embraces ( with its counterpart) the place where you called the shortcut.
Ctrl+Shift+} and Ctrl+Shift+{ moves the cursor to the same brace as the first mentioned shortcut and highlights all the area between start point and the result brace.
Ctrl+Shift+M moves the cursor to the opposite or nearest embracing brace or bracket of any sort ( ), { }, < >, [ ].
The last one can be changed in the settings.
#dhable is also right but you can also do this mouse
place the cursor with braces and double click so this will select or
highlight the code bw braces