Changing Jupyter's Matching Parenthesis Color

ipython: change syntax highlighting color for matching parenthesis

You can create ipython profile if not exists and override style

check if ipython_config.py presents under ~/.ipython/profile_default/ if not then you can run this command to create it

ipython profile create

open ipython_config.py file in any editor of your like and uncomment and update this option

from pygments.token import Token
c.TerminalInteractiveShell.highlighting_style_overrides = {
Token.MatchingBrackets.Other : '#FF00FF', # nested brackets color
Token.MatchingBracket.Other : '#FF00FF', # bracket color
Token.MatchingBracket.Cursor : '#4b3588', # on cursor over bracket color
Token.MatchingBrackets.Cursor : '#4b3588', # on cursor over nested matching brackets color
}

For Build in token check here, for Styling info check here

For how i get to know ipython uses pygments for customization check here

Replace / remove highlighting in Jupyter Notebook with custom theme

The CSS selector for matching brackets is div.CodeMirror span.CodeMirror-matchingbracket

So, you can change the colour of the bracket itself and the background colour of the bracket by putting the following code into your custom.css file (~/.jupyter/custom/custom.css)

div.CodeMirror span.CodeMirror-matchingbracket {
color: #INSERT-YOUR-DESIRED-BRACKET-COLOUR-HERE ;
background-color: #INSERT-YOUR-DESIRED-BRACKET-BACKGROUND-COLOUR-HERE ;
}

How to disable auto-quotes and auto-brackets in Jupyter 5.0

It looks like it can be done by running in a notebook:

from notebook.services.config import ConfigManager
c = ConfigManager()
c.update('notebook', {"CodeCell": {"cm_config": {"autoCloseBrackets": False}}})

This creates a file ~/.jupyter/nbconfig/notebook.json with the content:

{
"CodeCell": {
"cm_config": {
"autoCloseBrackets": false
}
}
}

After executing the Python command, or manually creating the file, restart your Jupyter notebook, and it should stop auto-closing quotes and brackets.

Turned off JupyterLab's auto encapsulation

The changelog of JupyterLab for 3.1 version, specifically the user-facing changes section, describes that:

The closing bracket is no longer automatically added by default; the old behaviour can be re-enabled from the menu bar (Settings -> Auto Close Brackets) or from the Advanced Settings Editor.

Sample Image

This is the seventh option in default JupyterLab 3.1 installations, and second from the bottom on the picture above. For more discussion and to provide constructive feedback please go to jupyterlab issue #5741.

How to set the default background/text color scheme in QtConsole for iPython?

This is a bug in 0.12, and has been fixed in master. So the only way to get what you want is to update to master, or wait for 0.13 (soonish).

How do I set custom CSS for my IPython/IHaskell/Jupyter Notebook?

I think the path to your custom.css should be:

~/.ipython/profile_default/static/custom/custom.css

custom folder instead of css folder.



Related Topics



Leave a reply



Submit