Basically, I'm looking for something equivalent to Sublime's Ctrl-D. Pressing that shortcut key in Sublime will select the current word at cursor location. Pressing Ctrl-D repeatedly will select the next occurrence of that word AND place a new multi-cursor position at that next occurrence.
Typing anything at this point will be reflected in all those selected occurrences. Additionally, undo'ing any typing with Ctrl-Z will not remove the currently enabled multi-cursors. To cancel multi-cursor mode you hit esc.
How can the above feature be emulated in notepad++?
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't think this is directly supported, but you can always record a macro (and assign some shortcut to it), or write a small python script (through Python plugin) and also assign a desired shortcut to it.
BR,
Loreia
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
say I want to rename the local variable 'pix' to something else. The way I want to do it is to put cursor under where 'pix' first occurred. Hit Ctrl-D(or some assigned shortcut) to select it. Hit Ctrl-D 4xmore times to select the bottom 4 occurrences. Type the new variable name I want. Done.
How would you guys perform the same action above in notepad++ with minimal finger and hand movement?
How can recording a macro work any general use case of the above presented scenario? Doesn't the macro just record the literal keystrokes + mouse movement and actions verbatim?
Last edit: greatwolf 2013-02-20
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I misunderstood how Ctrl+D works in other editor. This is what you can do in N++.
Your code is nicely vertically aligned, so lets take advantage of that.
Put cursor in front of first "pix" occurrence. Use SHIFT+ALT+DOWN ARROW to vertically select multiline. Press DELETE three times, and start typing a new word.
In Settings / Preferences / Editing enable multi-editing.
Record a macro for CTRL+mouse click and assign a macro to it. For testing just use mouse. Position cursor in front of first "pix", then CTRL+mouse click in front of each "pix". Edit text as desired. Advantage of this method is that you can multi-edit any pisition in text, not just vertically aligned stuff.
Use Find and Replace.
Position cursor anywhere in first "pix", or right in front of it. You don't need to select a word just have cursor in it. CTRL+H to open replace dialog, your word (pix) is already copied into Find field, just press TAB to go to Replace field and type your replacement word. Now, either hit ALT+A to replace every occurrence, or keep hitting, ALT+R until you replace as many as you wish.
Personally, I use mouse to make a selection of part of code, and than I hit Replace All with "In selection" ticked.
BR,
Loreia
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Basically, I'm looking for something equivalent to Sublime's Ctrl-D. Pressing that shortcut key in Sublime will select the current word at cursor location. Pressing Ctrl-D repeatedly will select the next occurrence of that word AND place a new multi-cursor position at that next occurrence.
Typing anything at this point will be reflected in all those selected occurrences. Additionally, undo'ing any typing with Ctrl-Z will not remove the currently enabled multi-cursors. To cancel multi-cursor mode you hit esc.
How can the above feature be emulated in notepad++?
Thanks
No one has any suggestions or input on this? I can't be the only one looking for this. Coding workflow is negatively impacted without this feature.
Hi greatwolf,
I don't think this is directly supported, but you can always record a macro (and assign some shortcut to it), or write a small python script (through Python plugin) and also assign a desired shortcut to it.
BR,
Loreia
I fail to see how a macro can emulate this feature. Take this code snippet for example:
say I want to rename the local variable 'pix' to something else. The way I want to do it is to put cursor under where 'pix' first occurred. Hit Ctrl-D(or some assigned shortcut) to select it. Hit Ctrl-D 4xmore times to select the bottom 4 occurrences. Type the new variable name I want. Done.
How would you guys perform the same action above in notepad++ with minimal finger and hand movement?
How can recording a macro work any general use case of the above presented scenario? Doesn't the macro just record the literal keystrokes + mouse movement and actions verbatim?
Last edit: greatwolf 2013-02-20
Hi,
I misunderstood how Ctrl+D works in other editor. This is what you can do in N++.
Your code is nicely vertically aligned, so lets take advantage of that.
Put cursor in front of first "pix" occurrence. Use SHIFT+ALT+DOWN ARROW to vertically select multiline. Press DELETE three times, and start typing a new word.
In Settings / Preferences / Editing enable multi-editing.
Record a macro for CTRL+mouse click and assign a macro to it. For testing just use mouse. Position cursor in front of first "pix", then CTRL+mouse click in front of each "pix". Edit text as desired. Advantage of this method is that you can multi-edit any pisition in text, not just vertically aligned stuff.
Use Find and Replace.
Position cursor anywhere in first "pix", or right in front of it. You don't need to select a word just have cursor in it. CTRL+H to open replace dialog, your word (pix) is already copied into Find field, just press TAB to go to Replace field and type your replacement word. Now, either hit ALT+A to replace every occurrence, or keep hitting, ALT+R until you replace as many as you wish.
Personally, I use mouse to make a selection of part of code, and than I hit Replace All with "In selection" ticked.
BR,
Loreia