I would like to disable the default copy on empty selection in the Jupyter notebook. A corresponding problem in the Sublime text editor can be solved easily as explained in an answer to the Sublime: how to disable empty copy question (similarly for VSCode as in How to stop copying the white space, on a blank line, in Visual Studio Code?).
Jupyter scenario: whilst the text selection is empty, press the copy keyboard shortcut (ctrl+c / command+c).
Current behavior: copies the current line to clipboard, overwriting its content.
Expected behavior: do nothing and keep the clipboard content intact.
Please avoid flame wars: I realize this is a feature for some people and I don't ask for changing the defaults. However, I find it useful not to lose the copied selection by mistake while hitting ctrl+c / command+c instead of ctrl+v / command+v and having to go through ctrl+z stack popping. Peace!
Related
I'm having trouble soft wrapping .R source files in the text editor in Rstudio Version 1.4.1717. I have tried to follow advice given online but it dosn't seem to change anything on my screen. It seems it should be fairly simple using the advice here:
Disable horizontal scroll in the Source of RStudio
and here:
wrap code in R Studio text editor
I have tried various things like ticking and unticking "soft wrap R source files check box", selecting all text in the text editor before re-trying, closing and restarting Rstudio etc...but still doesn't seem to work. I'm not sure if I'm missing something really obvious?!
Update: I managed to get it working if I start a new file (File > New File > R script). Please see here:
R studio image
However, this does not seem to work for R scripts that I had already created. The bottom right of the source window, does indeed say "R Script".
Update 2
I managed to get this working if I copy pasted the entire R script to a new file ((File > New File > R script), as opposed to re-saving the current file as a newer version (using File > Save As...")
When I went to save the file, a pop-up box appeared which asked me "Choose Encoding" for which I selected the default. I wonder if the previous file had a different encoding which meant the text wrapping could not work properly? Strangely, much earlier versions of the file did NOT have any problems when when using the wrap text functionality. So it seems that something happened to one of the recent versions that is causing the issue.
Do you remember to click apply before the ok button after checking the box?
You need not restart RStudio to get the change effected.
VS code recently added the ability to work with jupyter notebooks (.ipynb files), this is to say it renders them as notebooks and not the underlying text.
The problem I'm running into is I want to make some edits on the raw text rather than the "notebook" but I can't figure out how to show it as a text file the way any other editor would.
Is there a way to toggle between the views?
Disable automatically opening *.ipynb files in Notebook Editor
To make sure the Jupyter notebooks don't open in the Notebook Editor automatically, make sure to disable this settings. (Command Palette -> Settings)
OR
In the User or Workspace settings.json, add the following the root json - "jupyter.useNotebookEditor": false
To toggle between the Notebook Editor and Raw Text Mode Editing
There is an option/command called Reopen Editor with..., which will provide you options to open the *.ipynb file in text mode.
You trigger this by performing a Right Click on the Editor Tab (Editor Title Bar) or Command Palette -> Reopen Editor with...
PS: I have the Jupyter extension (v2020.12.414227025)
Open: File > Preferences > Settings
Search ipynb and deselect the following:
Other answers didn't work for me recently. I found no "use notebook editor" option under preferences, perhaps vs code has reorganized recently. Instead I found the following solution. Right click on an *.ipynb file tab to get the context menu, and click "Reopen Editor With..." as pictured below.
Then on the following popup click "configure default editor for .ipynb", and then click on the text editor as seen below:
And viola. The default settings have been changed.
I think the fastest way is to rename the file.
Just press F2 (or return for mac) while selecting the file in the vscode explorer, then rename from my-notebook.ipynb to my-notebook.json, because jupyter ipynb files are regular json files
Create .json file and paste the notebook json in there, save the file and then rename the extension to .ipynb and it will open in the jupyter editor
(Similar to aquirdturtle's answer)
What about
On the left side explorer
Right Click on file -> Open With -> Text Editor
Set the setting
"files.associations": {
"*.ipynb": "text"
}
Or try click on the Status Bar field that shows the Language Mode of the file in the lower right.
Use the command: Change Language Mode
For markdown there is a shortcut like typing a number(1,2,3,4..) in command mode (Esc) and then giving an Enter
The thing is that your cursor gets before the "###" (if you used 3) where you also need to click the End key to be able to write.
Is there a way to overcome the last action as it is very annoying.
What you already have is a one click solution, which is going to be hard to beat. The only improvement I can think of is to override the functionality that's inserting the markdown headings for you. You could extend it to also place the cell in edit mode and move the cursor to the end. This would be placed in your custom.js file, which you place here: ~/.jupyter/custom/custom.js.
Jupyter notebook has a new feature of cell tags since version 5.0 as described in the changelog.
I activated the cell tags going to View > Cell Toolbar as described on their page.
How can I deactivate this little panel on the cells?
Pressing the same button again doesn't help.
Do the same process but this time just click None
If last answer did not help, you also can edit .ipynb file code. in Jupyter - Home-running- stop your file, after that go to the explorer- click right bottom on your_file.ipynb open with notebook(just like .txt) - scroll down, find raw with "celltoolbar": "None", and delete this and save file, after run file in jupyter.
I'm interested in switching to the Atom text editor, but one thing that's keeping me with Vim is vim-notes, a plugin that automatically highlights names of your notes and allows you to jump to them by positioning your cursor over them and pressing gf (go to file under cursor). Is there a way to make Atom:
Read all the filenames in my ~/Notes directory
Highlight or underline any text in any .note file that's the name of a file in the ~/Notes directory, even if that note title has spaces.
Allow me to jump to the highlighted note by pressing some kind of key combination while the cursor is over it
I don't think there's a plugin for this, but if it's possible, I might be able to make one.