Multi selection and multi edit
-
Perhaps the simplest way would be to add the NppExec plugin to your Notepad++ and used the scripts by @bitagoras directly above?
-
yes i was watching
I already installed the NppExec script to the notepad++
but now the problem is how do I add the scripts by @bitagoras to the notepad ++? -
It feels a bit like spoon-feeding, but…
- Select Plugins from the N++ menus
- Select NppExec
- Select Execute (default key assignment is F6)
- Paste in ONE of the short “scripts” above in the Execute… box that appears
- Optionally (but recommended) test run it by pressing the OK button
- Press F6 again; “script” from before was retained and shows in the box
- Press Save… , give it a name (suggested above the “scripts” above), press OK
- Assign a keycombo (again; suggested ones are above the “scripts” above)
-
@michaelfernandez98 said:
but now the problem is how do I add the scripts by @bitagoras to the notepad ++?
@Alan-Kilborn replied:
…
Assign a keycombo (again; suggested ones are above the “scripts” above)If saving and naming a script wasn’t obvious, then assigning a keycombo is going to be less intuitive. Just saying. ;-)
@michaelfernandez98,
Once you have one or more scripts named and saved as Alan described, then go to Plugins > NppExec > Advanced Options. In the lower left, use the Associated Script pulldown to select the script; click Add/Modify button to add it to the list of Menu Items in the upper left; note whether or not ☑ Place in the Macros Submenu is enabled (you will need this later). Repeat as necessary for all of the above scripts. When you hit OK to apply those changes, a popup will tell you that you should restart Notepad++: save any open files, then restart Notepad++.After the restart, then either the Macros menu (if the checkbox was enabled) or the Plugins > NppExec submenu (if the checkbox was disabled) will list your new NppExec scripts.
To assign a keycombo to each, go to Macros > Modify Shortcut/Delete Macro (or, equivalently, Settings > Shortcut Mapper), and go to the Plugin Commands tab. Filter by
NppExec
and scroll down until you see the new script names. Click on the script you want a keycombo for, hit Modify, and pick the appropriate combination of Ctrl, Alt, Shift, and the selected key. Repeat the Modify procedure for all the scripts that you want a keycombo for. -
Thanks for filling in those details Peter!
As I was walking thru the steps on my setup, I didn’t do that part, so I’d forgotten that it was maybe not the most obvious thing.Is there a way to delete scripts that just isn’t obvious to me at the moment?
For example, during my experimentation I named my script “junk”.
Now I want to get rid of it, but don’t see a way to in the NppExec UI.
Or do I have to resort to hand-editing the config file for the plugin? -
@Alan-Kilborn said in Multi selection and multi edit:
Now I want to get rid of it, but don’t see a way to in the NppExec UI.
No obvious way, that’s for sure.
The … > Advanced Options > Delete button removes it from the menu, but not from the saved scripts.
Oh, right, there it is.
F6
, selectjunk
, counter-intuitively hit Save…, then click the Delete button. -
I could already install the plugin and assign the keycombo to it
thanks @PeterJones @Alan-Kilborn
They were very helpful -
sorry if my english is bad
I speak Spanish -
@bitagoras
@Claudia-Frank
@dinkumoil
i got the plugin and could multi select finally, thanks
but i tried to replace 6 words by another corresponding 6 words
it worked in vscode that the first selected word replaced by the first word in clipboard and the second word replaced by second word and so on
but her in notepad++ every word replaced by the 6 words that in clipboard that makes me crazy
please, any one can help? any idea ?any script ? -
I’d help with a PythonScript, but maybe you want an NppExec script?
Can’t tell from the above… -
Hello, @don-bhai, @alan-kilborn and All,
I may misunderstand what you want but are you looking for this kind of manipulations, below, which seems to work nicely ?
I assume that the
BetterMultiSelection
plugin is installed, with its last1.4
version ( IMPORTANT )I personally tested with N++ portable
v7.9.2
(32 bits
)
So :
- Paste the text, below, beginning with a blank line, in a new tab
Little 123 test Little 456 test Little 789 test Little 012 test Little 345 test Little 678 test 678 345 012 789 456 123
-
Move the caret at beginning of line
9
-
Hold down the
Alt
andShift
keys and hit5
times on theDown
arrow key -
Hit the
Shift
+End
shortcut, once -
Hit the
Ctrl + C
shortcut -
Hit,
7
times, on theUp
arrow key -
Hit,
4
times, on theRight
arrow key -
Hold down the
Shift
key and hit3
times on theRight
arrow key -
Hit the
Ctrl + V
shortcut -
Hit the
Esc
key to cancel the multi-selection !
As you can see, in the picture, below, each number, from line
27
to32
, have been pasted, accordingly, in lines20
to25
;-))Best Regards
guy038
-
I presume OP has this, where the inverted text is the product of “multi-select”:
and then has this in the clipboard:
Peter Guy Claudia Scott Alan Terry Michael
And wants to end up with this text after replacement:
Note that I styled the text in the cyan color myself, just so the replacements could be easier to see.
Of course I could be totally wrong about what the OP has and wants. :-)
-
Oops, it appears I’ve turned Guy into a philandering filmmaker, Scott into an infidel, and Michael into an encourager of adultery. Sorry, all! :-)
-
@Alan-Kilborn
i can install paython plugin if this is not available in NPPEXec script -
@Don-Bhai said in Multi selection and multi edit:
but her in notepad++ every word replaced by the 6 words that in clipboard that makes me crazy
As I understand you comment, I think you missed an important condition to get what you want - in order to distribute replacements over a multiselection, you must copy the replacement strings as a rectangular selection, not a normal one.
Hope this helps.
-
@guy038 you are amazing, thank you very much
i was selecting the 6 word by ctrl+A
thats why it replace every word by the 6 words i have selected and copied in clipboard
thanks @Alan-Kilborn , @guy038 , @astrosofista , and to every one tried to help -
@astrosofista you are right, i selected them as normal one that’s my fault
-
I released a Notepad++ bundle where the multi selection is already installed, so you can simply test it:
https://github.com/bitagoras/PyPadPlusPlus/releases
It’s actually a portable version that includes a Python environment. But you don’t need this for mult selection.Below you can see how this looks like. The only non-standard edit command I used here is
<Strg> + <D>
. -
@bitagoras said in Multi selection and multi edit:
The only non-standard edit command I used here is <Strg> + <D>.
<Strg> + <D>
??
What does that mean? -
@Alan-Kilborn
Sorry, I use a German keyboard. I wanted to write<Ctrl> + <D>
;-)