Using tabs in Jupyter notebook cells (re-open #10423)
See original GitHub issue%%file Makefile
hello: hello.c
cc -o hello hello.c
is why we need TABs instead of spaces: make assumes tabs, and ONLY tabs, as valid separators and crashes out if this is not done.
I use workaround
%%bash
echo "hello: hello.c" > Makefile
echo -e "\tcc -o hello hello.c" >> Makefile
but in a teaching environment - where I use jupyter notebook, this is inadequate.
I added editor-tabs nbextension to the Home, and disabled “disable configuration for nbextensions without explicit compatibility” check mark in the console, but it did not change the behaviour of the notebook, even after a kernel restart. This functionality is desperately needed in %%file cells, and TAB-as-completion is unnecessary in those.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Using tabs in Jupyter notebook cells #10423 - GitHub
I would like to be able to use tabs in Jupyter Notebook cells. It is currently not possible as far as I know...
Read more >How to reopen Jupyter notebook if I closed the tab?
Select the Running Tab (as mentioned by @Quang Hoang). ... in the Jupyter terminal window (also providing you with the direct notebook url):....
Read more >Optimizing Jupyter Notebook: Tips, Tricks, and nbextensions
Shortcuts · Esc take you into command mode · Tab code completion or indent · Shift + Tab tooltip · Ctrl + ]...
Read more >Jupyter Notebook Quick Guide
In the Jupyter notebook window, under the “Files” tab you'll see a file structure. You will navigate through this to get to the...
Read more >Jupyter Notebook 6.5.2 documentation - Read the Docs
Code cells . A code cell allows you to edit and write new code, with full syntax highlighting and tab completion. The programming...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I did not realize ipython is still a thing, I assumed jupyter was a rebrand/replacement.
But I also see that your comment betrays a continuous misunderstanding, so perhaps I better elaborate. Every time an issue of tabs comes up, everyone assumes it’s about the automatic indentation style. It is not! - and in fact I personally prefer and always use spaces, not tabs, to indent code. But the ability to enter a TAB character when desired must be available, as other programs and environments may require it (Makefile being one example).
So, for example, including somewhere in the notebook this:
converts ALL cells to tabs. This is a poor solution, distracts from the flow of the notebook, and not at all what I am asking for.
I would like to have, say, Alt-TAB or Ctl-TAB generate a raw tab and not be replaced with 4 spaces, but only when I need that. It’s not even a per-cell control, it’s just one special character.
Is there an equivalent to vi’s Ctl-v entry mode in ipython/Jupyter/jupyterlab (what is that? and how is it different from jupyter?).
This reminds me: I never thanked @Carreau for a detailed and thoughtful workaround, a tour de force. Thank you!
But lust like @dturaev I adopted the two-click (left button select, middle button paste) solution to entering the TAB characters, for those rare occasions I need them.
I would still welcome the vi-inspired Ctl-V option (for verbatim) one-keystroke prefix (no mode switching, just one composite character), if it ever makes it into the interface. There is no way I can suggest any of the approaches discussed here to a class of novice users, where I use jupyter notebooks, they would be overwhelmed.