How do I edit all highlighted instances of a word

2020-05-22 15:37发布

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++

6条回答
够拽才男人
2楼-- · 2020-05-22 16:19

See the answer here https://superuser.com/questions/621986/editing-all-instances-of-a-string-in-notepad

Which is:

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.

查看更多
一纸荒年 Trace。
3楼-- · 2020-05-22 16:26

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

查看更多
你好瞎i
4楼-- · 2020-05-22 16:26

This might be a bit late though...

  1. Move your cursor to the start of the the word "unit" in one of your ul block. Just next to " character. Make sure this is the first or last item.
  2. Press 'Alt' key on your keyword.
  3. Move up (if you have selected the last line) or down (if you have selected the first line) the cursor vertically within its spot (will show just a tiny vertical highlighted line).
  4. Type: cool- You will see "cool-unit"

If you want to override the word "unit" then: At the 1-st step select the entire word unit then follow next steps.

查看更多
Emotional °昔
5楼-- · 2020-05-22 16:30

There used to be a way that you could just highlight and do something to edit all of the highlighted parts. I know you can click, but there was a way previous you didn't need to do this for everything (and had nothing to do with the find/replace command!)

I should add that the Ctrl+Click option doesn't have to be matching words, so its not really related to the highlighting of similar words

查看更多
贼婆χ
6楼-- · 2020-05-22 16:33

There is a way, but I used a different editor. Sublime lets you select multiple areas by highlighting one and hitting CTRL+D, then you get many cursors and you can edit them in parallel.

查看更多
7楼-- · 2020-05-22 16:39

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.

查看更多
登录 后发表回答