Jupyter notebook markdown without mouse click - jupyter-notebook

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.

Related

Preventing markdown cells from un-rendering (Jupyter): showEditorForReadOnlyMarkdow

following this post and the issues tab regarding this problem I have found that to make a cell that is set to "editable":false not be able to be un-rendered I need to set showEditorForReadOnlyMarkdown to false.
It is not clear to me how to actualy do this, and how to make it permanant.
This is what I have tried so far:
I have found that throught Jupyter-Lab I can go to settings->advanced settings editor->JSON Settings Editor and change this setting, but the change is permanant only for My Jupyter-Lab environment -- opening up the notebook elsewhere will not save this setting.
Setting "showEditorForReadOnlyMarkdown":false in the cell or notebook metadata via a local jupyter notebook doesnt do anything.
Ultimatley, as the notebooks I am making are for learning purposes, I would like all cells that are uneditable to be permanantly rendered as to minimize issues and/or confusion.
Any help will be appreciated. Thank you.
For any others looking for the currently available per-Jupyter-lab setting that Iddo mentions above, to do it through the GUI it's "Settings" -> "JSON Settings Editor" (icon at top-right of initial Settings tab), then it's found in "Notebook" near the bottom (this is in JupyterLab 3.6.0). I couldn't edit it in place, not sure if that was just me, but could add to the User Preferences box on the right, e.g.:
{
"showEditorForReadOnlyMarkdown" : false
}
One way it can be done programmatically is by creating/modifying this overrides json file to hold:
{
"#jupyterlab/notebook-extension:tracker": {
"showEditorForReadOnlyMarkdown" : false
}
}
(This not an answer to the question, but I can't "comment" due to not having enough reputation points, so had to put this here as an "Answer" ¯\_(ツ)_/¯)

Copy to clipboard on empty selection in the Jupyter notebook

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!

Automatically link filenames with Atom?

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.

Brackets Code Complete Not working

I have installed Brackets with Tern Intelligence.
Inside my file Main.js, I type the following thing
Math.
And press ctrl-enter. I imagine I should see pow,max,etc, show up. What am I missing?
Code hints should appear automatically - no need to press anything. (If you do want to trigger them manually though, it's Ctrl-Space, not Ctrl-Enter).
What's in the rest of your Main.js file? If you make a new, blank JS file does it work? When I type Math. in an empty .js file, I see a list of code hints both while I'm typing Math and the appropriate list of options after typing the .
Also, try using Debug > Reload Without Extensions to make sure you don't have an extension installed that could be causing a problem.

How to bookmark code in XCode 4?

I couldn't find a way to put a bookmark inside the code in XCode 4. I know about the #pragma mark thing but it's not what I'm looking for. What I need is something that I can put and remove with a mouse click and navigate amongst with next and previous, like in VS.
Is there anything that I'm missing?
Bookmarks seem to have gone the way of the dinosaur in Xcode 4. This wouldn't have been so bad had the jump-to-bookmark popup above the editor in previous versions not also disappeared. The best replacement currently seems to be to use breakpoints (disabled individually, of course) and navigate with the Breakpoint Navigator.
Shortcut to breakpoints is Cmd + 8. Once there use arrow keys
File a bug report at http://bugreporter.apple.com if you feel something like this should be brought back.
Write below comment in your source file that you want bookmarked.
//<##>
And you can navigate to next / previous with: '^/' or '^?'
<##> means "placeholder of code snippet"
^/ means "jump to next placeholder"
^? means "jump to previous placeholder"
thanks
Another option, if anyone is still interested. The following directives will both produce a compiler warning that you can use as a bookmark:
#pragma message "<# message #>"
or
#warning <# message #>
If you want to place bookmarks using your mouse: create a code snippet with one of the 2 directives above. Drag & drop it to the line in your source file that you want bookmarked.
Navigate to next/previous with: Cmd-' and Cmd-Shift-'
In Xcode 4.4, if you leave a comment with this format:
// TODO: Your text here
it will be added as a listing in the jump bar alongside the list of methods in your current file, and then you can jump straight to that comment from that menu.
The simplest technique is to use a comment prepended by // TODO and then search, which allows you to jump through the issues from the navigator. Pretty hard to beat that technique.
I personally don't like using break points for bookmarks because it is not easy to enter notes. I use breakpoints as breakpoints, and prefer not to mix them up with bookmarks.
Anyhow, if you want to get a bit fancier you could get xcode to generate warnings // TODO: some message or // FIXME: some message that can be navigated in the issue navigator. I took the instructions below from this site:
Instructions
Head over to your project's item in the Project Navigator (usually at the very top)
Find your target in the list of targets on the left, select it
Head over to the "Build Phases" tab.
Click the "Add Build Phase" in the bottom right of this screen.
In the editor that appears insert the bash script shown below.
Now just build and you'll see all your //TODO: and //FIXME: comments have become warnings. I love this technique, it might not be right for everyone, but hope it helps someone.
Bash Script For "Run Script" Build Phase
KEYWORDS="TODO:|FIXME:|\?\?\?:|!!!:"
find "${SRCROOT}" ( -name ".h" -or -name ".m" ) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/ warning: \$1/"
You'll also be able to click on each of the warnings in the issue navigator to go right to the file and point in your code where you left the original //TODO: or //FIXME:
Extra pro tip: Make sure you're using phrases to describe your //TODO: comments like //TODO: Handle this error gracefully, and things like that. The phrases will show up in the issues list beside each warning.
Credit for the little tidbit should go to "Tim" on the Cocos2D forums, (found after Googling for a bit), I believe his solution originally was intended for Xcode 3 and didn't work if you had spaces in your path name, my script here doesn't have those restrictions, still he should get full credit here's his original post.
Like npellow's answer to this question of mine, appCode by JetBrains has also made this possible. So, this may be another reason to use appCode instead of Xcode4, except that it won't be free later in time.
My method:
type in grammar error code in the previous line.....
After changing something in other place, I can go back to the previous place because the grammer error line will show a red line in the right side scroll bar. It indicate the place.
It is not elegant but unless there is a bookmark feature, this is the way i am using at the moment
You can install an Xcode plugin called "XBookmark".
This plugin provide features below :
Toggle Bookmark
Show Bookmarks
Next Bookmark
Previous Bookmark
How to install XBookmark:
Install Alcatraz.
Search XBookmark from Window->Package Manager and click Install.
Restart Xcode.
Now, you can see menus about bookmarks in the Edit Menu.
PS : This plugin is open source.

Resources