Comment/uncomment selection in notebook
I think this would be a nice addition.
a = 1
<start selection>
print some debug information
print some other that i do not want any more
<end selection>
b =2
I know the shortcut like ctrl+/ would be hard to implement cross platform. But for simple case that's often used, when we select a block of code(say more than 1 line) and press "#" it should do comment/uncomment those lines (like a block tab). This would cover the cases where this type of thing is most useful.
We definitely want to have this.
I'm not sure if bfbe5a8f4c43444a1b2b83c8ea71fac320bfe872 is already part of a release, but ctrl+/ (german key layout means that it's actually ctrl+7 or ctrl+shift+7) or selction+<#> don't work in my notebook. It would also be nice if such things (i.e < tab > as well! For me code compeltition was ctrl+space) could be documented in the shortcut help.
It would also be nice if such an action could be added to a icon...
Agree, we want this for sure. While in 1.0dev I still don't see this functionality, let us hope it will be implemented in 1.0.
This is now a codemirror addon but one should decide wether or not we bind a key shortcut to it, or only a menu entry...
I think it would be great to have a key binding for this...
standard binding is C-/, any objection?
C-/need shift on some keyboard...just saying
I am fine with ctrl-/, but let's also include command on mac...
On Fri, Jul 5, 2013 at 11:38 AM, Matthias Bussonnier < [email protected]> wrote:
C-/need shift on some keyboard...just saying
— Reply to this email directly or view it on GitHubhttps://github.com/ipython/ipython/issues/1540#issuecomment-20533204 .
Brian E. Granger Cal Poly State University, San Luis Obispo [email protected] and [email protected]
we could also wait for the refactoring of the keybindings....
Yes, I generally mean C=ctrl one others, command on OS X for shortcuts.
sure, I'll hold off.
I think the hotkey stuff is a mess (not IPython's fault). Could you elaborate on the refactoring of the keybindings ?
For my personal use, I have created a few notebook extensions with my favourite hotkeys for Firefox: https://github.com/juhasch/IPython-nb-extensions
Unfortunately, it needs patching of IPython, to notify the extension when new codecells are added. It then extends the codemirror hotkeys using setOption().
Anyway, for me commenting/uncommenting works, but not too well. It gets confused by my coding style. Codefolding can be easily added this way, too. I did not find it too useful for now.
For 1.0 we are changing the notebook to be a dual mode editor like VIM...The keyboard shortcuts in the notebook command mode will possibly extensible and configurable. The keyboard shortcuts in edit mode and for mode changes won't be allowed to change.
On Fri, Jul 5, 2013 at 12:00 PM, juhasch [email protected] wrote:
I think the hotkey stuff is a mess (not IPython's fault). Could you elaborate on the refactoring of the keybindings ?
For my personal use, I have created a few notebook extensions with my favourite hotkeys for Firefox: https://github.com/juhasch/IPython-nb-extensions
Unfortunately, it needs patching of IPython, to notify the extension when new codecells are added. It then extends the codemirror hotkeys using setOption().
Anyway, for me commenting/uncommenting works, but not too well. It gets confused by my coding style. Codefolding can be easily added this way, too. I did not find it too useful for now.
— Reply to this email directly or view it on GitHubhttps://github.com/ipython/ipython/issues/1540#issuecomment-20534088 .
Brian E. Granger Cal Poly State University, San Luis Obispo [email protected] and [email protected]
That's a big change for a release scheduled for ten days from now. We should have flipped the 'no new features' switch a month ago. Like the other big-ish recent changes, this is a 'hopefully', not a 'definitely' 1.0 change.
Agreed with @minrk I though we said vim/emacs mode will be only through custom.js if doable for 1.0
Sorry, I wasn't clear - at best I might be able to get the vim/emacs mode
working through custom.js for 1.0.
On Fri, Jul 5, 2013 at 12:22 PM, Matthias Bussonnier < [email protected]> wrote:
Agreed with @minrk https://github.com/minrk I though we said vim/emacs mode will be only through custom.js if doable for 1.0
— Reply to this email directly or view it on GitHubhttps://github.com/ipython/ipython/issues/1540#issuecomment-20534992 .
Brian E. Granger Cal Poly State University, San Luis Obispo [email protected] and [email protected]
Aside: for publicity, I think we should come up with a more appealing way to describe the new interaction than 'a dual mode editor like VIM'. There's nothing wrong with VIM, but I don't think being like VIM is the best selling point for our target audience.
On 5 July 2013 21:15, Brian E. Granger [email protected] wrote:
Sorry, I wasn't clear - at best I might be able to get the vim/emacs mode working through
custom.jsfor 1.0.On Fri, Jul 5, 2013 at 12:22 PM, Matthias Bussonnier < [email protected]> wrote:
Agreed with @minrk https://github.com/minrk I though we said vim/emacs mode will be only through custom.js if doable for 1.0
— Reply to this email directly or view it on GitHub< https://github.com/ipython/ipython/issues/1540#issuecomment-20534992> .
Brian E. Granger Cal Poly State University, San Luis Obispo [email protected] and [email protected]
— Reply to this email directly or view it on GitHubhttps://github.com/ipython/ipython/issues/1540#issuecomment-20537071 .
Agreed with @takluyver, despite being a vim addict myself. How about just "modal editor". Emacs also has the concept of modes - the same shortcuts have different meaning depending on which mode one is in
The dual-mode that we are considering is actually closest to that of Gmail / Greader, etc. (which, of course, is derived from vim but is a bit more friendly as a reference).
I'd introduce it as something like "you can now navigate cell-by-cell with the keyboard, then hit enter to edit the current cell". Then refer to the modes as 'navigating' and 'editing'.
On 5 July 2013 22:20, Min RK [email protected] wrote:
The dual-mode that we are considering is actually closest to that of Gmail / Greader, etc. (which, of course, is derived from vim but is a bit more friendly as a reference).
— Reply to this email directly or view it on GitHubhttps://github.com/ipython/ipython/issues/1540#issuecomment-20539498 .