Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-Edit How-to (v8.6 new feature) #14509

Open
donho opened this issue Dec 20, 2023 · 8 comments
Open

Multi-Edit How-to (v8.6 new feature) #14509

donho opened this issue Dec 20, 2023 · 8 comments

Comments

@donho
Copy link
Member

donho commented Dec 20, 2023

Notepad++ v8.6 introduced a new feature called Multi-Edit. This feature allows users to edit text at multiple positions simultaneously.
Here's the demo of the feature published on the v8.6 release announce:

multiedit

Many users have requested a tutorial. Here is a step-by-step guide that shows you how to transform from

# var1, var2, object1, object2, object3, flag1, flag2

to

obj.var1 = param["var1"]
obj.var2 = param["var2"]
obj.object1 = param["object1"]
obj.object2 = param["object2"]
obj.object3 = param["object3"]
obj.flag1 = param["flag1"]
obj.flag2 = param["flag2"]

Once you understand how it work this part, the remain demo should be intuitive & easy to follow.

Step 1

Copy the line from var1 to flag2 and paste it, and add another comma at the end.

image

Step 2

Select the first , of var1,

image

Step 3

Run Edit->Multi-Select Next->Match Case Only command 6 times.
Note: You can always run this command via the menu, but it'll be much easier to use the shortcut (I assigned Ctlr-E to it). You can assign any available shortcut to Multi-Select Next->Match Case Only command via Shortcut Mapper.

image

Step 4

Type 2 DELETE and 1 ENTER, then ArrowUp once to move all carets up 1 line

image

Step 5

Type obj.

image

Step 6

Ctrl-ArrowRight to move the carets to the end of the words

image

Step 7

Type = param[""]

image

Step 8

Put your caret after obj. of the 1st line, the Alt-Shift-ArrowDown to the last line
(Or you can use Ctrl-ArrowLeft to move carets after obj. column )

image

Step 9

Ctrl-Shift-ArrowRight to multi-select the words, then copy them (Ctrl-C)

image

Step 10

Move all carets to right by using ArrowRight to between "", then paste (Ctrl-V)

image

@theonlypwner
Copy link

theonlypwner commented Jan 3, 2024

If we select something we don't want followed by stuff we want to keep in the multi-select, how do we remove the earlier selection from the multi-select? (#12530)

If was not the last to be selected, then "Undo the Latest Added Multi-Select" wouldn't work.

Apparently, this will be fixed in v8.6.1.

@nr1995
Copy link

nr1995 commented Jan 12, 2024

I'm just a Notepad++ noob,
but for the love of God, how do I completely disable the new multi everything introduced in v8.6 ?
Please just someone tell me how to make it go away.

@xomx
Copy link
Contributor

xomx commented Jan 12, 2024

Please just someone tell me how to make it go away.

Use empty noColumnToMultiSelect.xml config file:
https://npp-user-manual.org/docs/config-files/#other-configuration-files

@nr1995
Copy link

nr1995 commented Jan 12, 2024

Please just someone tell me how to make it go away.

Use empty noColumnToMultiSelect.xml config file: https://npp-user-manual.org/docs/config-files/#other-configuration-files

I don't want to download a non-official non-stable Notepad++ build.

@donho
Copy link
Member Author

donho commented Jan 12, 2024

Use empty noColumnToMultiSelect.xml config file: https://npp-user-manual.org/docs/config-files/#other-configuration-files
I don't want to download a non-official non-stable Notepad++ build.

For the love of God, it's not non-official non-stable Notepad++ build, it's the tutorial to guide you for disabling this usable feature you don't like.

@nr1995
Copy link

nr1995 commented Jan 12, 2024

Use empty noColumnToMultiSelect.xml config file: https://npp-user-manual.org/docs/config-files/#other-configuration-files
I don't want to download a non-official non-stable Notepad++ build.

For the love of God, it's not non-official non-stable Notepad++ build, it's the tutorial to guide you for disabling this usable feature you don't like.

For the love of God. It doesn't work on the default executable.
Did you read to the end of #14476? Did you try your own suggestion?
Before dumping your attitude on me?

@xomx
Copy link
Contributor

xomx commented Jan 13, 2024

@nr1995
To be able to use the noColumnToMultiSelect.xml, you need to upgrade to the already released v8.6.1 (check the changelog item No. 5 there). But there were some regressions found, so maybe rather wait for the upcoming v8.6.2.

As with any more complex new features implemented, there are some birth pains, but these should be addressed in a few upcoming versions.

@tobwen
Copy link

tobwen commented Jan 13, 2024

I don't want to cause any trouble now because the function itself is quite useful, but my muscle memory is also quite strained.

Wouldn't it be possible to deactivate and reactivate the function via a shortcut or menu entry "on deman" without having to restart N++? The XML file is a good work-around, but if I ever need the function, I'd have to close N++ (with lots of open files).

But sure, let's wait for v8.6.2 first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants