Open spyder-bot opened 9 years ago
From ccordoba12 on 2015-01-13T04:31:20Z
Nop, it hasn't been considered so far. It seems cool but I don't know how hard it will be to implement it.
Summary: Add multiline editing to the Editor (was: Feature Request)
Labels: Cat-Editor
I think with what Qt offers by default there is no (easy and clean) way to do this, so I would considered a wont fix
for this one
Does QtCreator have this functionality? Because if it does, then we should be able to implement it too ;-)
I SOO want to switch to Sypder from sublime text / pycharm but multiple select/editing has become ingrained in my workflow and I find myself unable to remain for long in an editor that can't do this. PLEASE consider this.
Ok, we'll explore it for 3.1 :-)
I will look into it for 3.1
Does QtCreator have this functionality? Because if it does, then we should be able to implement it too ;-)
Alt + drag works in qtcreator 3.5.0. Now get to work !
So, here is a proof of concept :smiley:
It is doable but it is a bit hackish:
Ctrl+MouseClick
for convenience)Looks good!
Oh dear god thank you. SOO excited for this.
That's amazing!! I think this feature is very very very pratical!
Nice ! It looks like the cursors are a bit out of sync at the end, but I'm not 100% sure. Also a nice feature for adding a column of cursors is to use Ctrl+drag. It can be extended to a rectangular selection feature which can be very useful. It exists on geany as a plugin, I don't know if it's present in any other editor.
@Nodd, yes you are correct, the main cursor is out of sync with the rest, even though I am also manually drawing it.... but it was a 60 minute work.. so don't expect much at this point :-p
Looking forward to this! Also if ctrl-d, ctrl-u workflow could be included! :) (select next occurrence, skip select next)
@Twizzledrizzle want to give me a hand?, and also can you explain a bit more on the Ctrl+D, Ctrl+U, is that sublime-like?
Aye, sublime and atom like. I added the documenation below from sublime text. I would very much like to give you a hand, please let me know what I can do.
To add the line above or below to the selection, use Ctl+Alt+Up and Ctrl+Alt+down (OS X: Ctrl+Shift+Up and Ctrl+Shift+Down).
If you go too far, use Undo Selection (Ctrl+U, or Command+U on OS X) to step backwards.
Select a block of lines, and then split it into many selections, one per line, using Ctrl+Shift+L, or Command+Shift+L on OS X.
To add the next occurrence of the current word to the selection, use Quick Add Next, which is bound to Ctrl+D on Windows and Linux, or Command+D on OS X.
Again, if you go too far, use Undo Selection (Ctrl+U, or Command+U on OS X) to step backwards.
To add all occurrences of the current word to the selection, use Find All: Alt+F3 on Windows and Linux, or Ctrl+Command+G on OS X.
To go from multiple selections to a single selection, press Escape.
This is also one of the primary things keeping me from using spyder as my main IDE. I love spyder for the variable explorer, but without multi cursor support the editing experience is not as fluent as something like sublime. For example, Using Ctrl-D to highlight next occurrence of the highlighted word and editing all selections in one go is a massive time saver
Just a remark, but is Ctrl+D really better than Replace All ? It looks cooler but the functionality looks the same. (Also Ctrl+D is currently set as delete current line).
Having used both Replace All and multiple cursors, for me multiple cursors is much faster in most cases. And it also opens up possibilities that are not as easy with regex & replace all.
There is a good discussion in a NeoVim issue that I took this screenshot from
Hi, I was just wondering if the multiple cursor functionality is available in Spyder currently. I really like Spyder and it would be super nice to have this functionality. Thanks!
No, it's not available currently. You can see it as an opportunity to become a spyder contributor !
+1 for multiple cursors!
Hello,
I was wondering, what part of the code would need to be modified?
Because, I wanted to have a look whether I could try to do it (although I am quite a newbie in software programming), but I did not find explanations on the code structure :/ and I found myself a bit lost. Maybe that could help potential coders to explain where and maybe roughly how it could be done.
Thank you!
@Nodragem thanks for the help. I will ping you back with some details later today or tomorrow.
Cheers :-)
Bumping this. Would be such a great feature.
I think it would be nice to have this implemented in the same way Kate does it. Just press ctrl+shift+b and you are on column editing mode, press it again and you are back to line editing.
This is really a must have feature for Spyder. I'm actually impressed that Spyder lacks this feature.
We are working on major improvements to the code editor and this would be one of such improvements
Is anyone developing this? I checked up the QtCreator source. In the file "texteditor.cpp", there is a "BlockSelection Mode" implemented for "TextEditorWidgetPrivate". I think it might take some time to find out which parts are relevant to take over and which not, but I think it is doable in principle from Qt based TextEdit widgets. At least we have the basic logic implemented there. However, this is different from the Sublime text version described by @Twizzledrizzle .
@rlaverde would you like me to work on this one? I think it is something I could do and that I would like to have in Spyder as well.
@jnsebgosselin yes, go ahead, I'm not currently working on this
Actually a related question is whether it is possible to set an external editor? In Matlab's preferences you can set an external editor command so that double clicking files in the File Explorer (or via 'edit') opens them externally (e.g. in Sublime Text or Atom etc.) rather than in Matlab's own editor. I imagine there are plenty of users who already have familiar text workflows and could be easier for users to use them where they are rather than re-implementing within Spyder?
I don't think this is a good idea. Multiline editing is a basic feature for any modern editor.
Ariel WerleGrupo de Astrofísica - UFSC
On Thu, Aug 10, 2017 at 7:37 AM, Romesh Abeysuriya <notifications@github.com
wrote:
Actually a related question is whether it is possible to set an external editor? In Matlab's preferences you can set an external editor command so that double clicking files in the File Explorer (or via 'edit') opens them externally (e.g. in Sublime Text or Atom etc.) rather than in Matlab's own editor. I imagine there are plenty of users who already have familiar text workflows and could be easier for users to use them where they are rather than re-implementing within Spyder?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/spyder-ide/spyder/issues/2112#issuecomment-321515573, or mute the thread https://github.com/notifications/unsubscribe-auth/ASbKRd1j4XhjHLFPm5zH8A9c43QhKtu2ks5sWt1NgaJpZM4DhxiD .
@RomeshA, that's not related to this issue.
Of course, this is a work in progress. @ccordoba12 and @rlaverde Could you take a look at it and tell me what you think and how and if this could be incorporated to the Spyder framework? Thank you. (https://github.com/jnsebgosselin/PySide-Custom-Widgets/blob/master/multicursor_editor.py).
@jnsebgosselin, really cool! @rlaverde, please point him to the right place to integrate this in Spyder.
This is not ready @andfoy :-)
Sorry, I pushed that button from my phone! :-)
you should modify CodeEditor
https://github.com/spyder-ide/spyder/blob/master/spyder/widgets/sourcecode/codeeditor.py#L206
I think will be enough to add that code to the corresponding methods, although I'm not sure if that will be easy in some complex complex methods like the keyPressEvent()
@ccordoba12 Or should we try to modularize the already complex CodeEditor? I'm not sure how, maybe mixings.
@jnsebgosselin Looks really good! Promising to see that it's possible with Qt.
+1 for multi-line editing
:+1: This will be indeed a killer feature
Any updates on this? Pretty please? With a cherry on top? =)
What should the shortcuts be for this feature? @ccordoba12 ?
I really don't know. Please check what the default shortcut is in Sublime, Atom and VSCode and use the most common one. Thanks!
I really don't know. Please check what the default shortcut is in Sublime, Atom and VSCode and use the most common one. Thanks!
The problem is that we do not have a lot of options that are not already taken in Spyder... I think I will go with :
Ctrl + Shift + Up /Down /Click
to add cursors one by one, and with :
Ctrl + Shift + L
to add one cursor per line of a selected text block.
Ok, thanks!
Holding down Alt to engage multi-line selection is common; if you start typing, after a multiline selection, it becomes editing. Textmate2 does it like this, I think SublimeText3 does too (both hotkey and sequence).
I think this is an important feature. It's really annoying to have to copy paste to NotePad++ every time I need multi-line editing. Would be really nice if this gets to stable. Thanks for the hard work.
Sorry this has not received as much attention as it should. I cannot resume working on this before some issues I am working on with keyboard shortcuts are resolved first. I am confident though that we will be able to make this feature part of Spyder4.
Brilliant news! Looking forward to it
On Thu, 18 Oct 2018, 20:42 Jean-Sébastien Gosselin, < notifications@github.com> wrote:
Sorry this has not received as much attention as it should. I cannot resume working on this before some issues I am working on with keyboard shortcuts are resolved first. I am confident though that we will be able to make this feature part of Spyder4.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/spyder-ide/spyder/issues/2112#issuecomment-431135284, or mute the thread https://github.com/notifications/unsubscribe-auth/AGKa_jdEwlQ3eAyQhlBs91dcMct5FPhaks5umNmIgaJpZM4DhxiD .
From geoffrey...@gmail.com on 2015-01-13T04:28:43Z
Is a feature of multi-editing / multi-selection planned?
Basically the idea is to be able to set multiple cursors to edit at different places of the code at the same time.
Link with the ability to select several occurrence of the same word, it can be used as a very quick "find and replace" for instance.
Here an example: http://blog.jetbrains.com/ruby/2014/03/whats-mining-multiple-cursors-and-selection/
Original issue: http://code.google.com/p/spyderlib/issues/detail?id=2112