Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I edit all highlighted instances of a word simultaneously?

In Notepad++, whenever you select any word in an HTML document (or in your CSS), similar words are automatically highlighted.

Is there a shortcut I can use to edit all of these highlighted segments at once?

All instances of 'unit' highlighted in Notepad++

like image 696
George Katsanos Avatar asked Jun 04 '12 11:06

George Katsanos


People also ask

How do I change all instances of words in Notepad++?

CTRL+H to get to the Replace dialog (or Search ==> Replace via the menu). Input the string to find and input the string to replace it with and then hit the 'replace all' button on the right.

How do you change highlighted text in Word?

To Replace the Highlight;Open the Find and Replace dialog (Ctrl H) and click the More button. Click the Replace All button and Word will replace all your highlighting.

How do you remove all occurrences of a word in Notepad++?

Edit: OP wants to remove the literal MPRINT() as per comment below. Using regex mode and searching for MPRINT\((\w+)\) will find what you've asked. The "inner" set of brackets will capture the internal text. Fill the Replace with : field with $1 will replace the entry with the inner text when you hit Replace .


2 Answers

Currently, the ability to select all similar text and edit (like the Ctrl+D functionality in Sublime, as mentioned by @George) is not built in to Notepad++ version 6.9.2. It does sound like it will work when Notepad++ updates the version of Scintilla it uses as the functionality is built in to the newer version of that.

The only way to accomplish something similar to the multi-line edit you speak of is to either use the replace function or Notepad++'s version of multi-editing.

To Find/Replace

  1. Highlight the word you would like to replace.
  2. Type Ctrl+H to bring up the Replace dialogue.
  3. Modify the "Replace with" text.
  4. Choose either "Replace" or "Replace All"

To Multi-Edit

You first need to enable this feature in Notepad++. Do this by going to SettingsPreferencesEditing and then enable Multi-Line Edit. Now when you hold Ctrl and click around your text, a cursor will be left at the location of each click. When you're done locating all of the places you'd like to edit, you can start typing. Whatever you type will now appear at each of the locations you left a cursor at.

like image 84
JoshuaTheMiller Avatar answered Sep 20 '22 08:09

JoshuaTheMiller


Ctrl + F, enter word, enter replacement. "Hit Replace all".

like image 42
LiamRyan Avatar answered Sep 19 '22 08:09

LiamRyan