X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/d4d0708511d184ab3211ac72a33bee1e7fedeca0..c2c256b7c6b49be7c2084ba6028539f3f8640684:/dot/ipython-config.py diff --git a/dot/ipython-config.py b/dot/ipython-config.py index 63e7de4..9db7f6b 100644 --- a/dot/ipython-config.py +++ b/dot/ipython-config.py @@ -1,7 +1,11 @@ ### -*-python -*- +import pygments as PYG +import prompt_toolkit as PTK + c = get_config() +## Simple stuff. c.InteractiveShell.autocall = 0 c.InteractiveShell.autoindent = True c.InteractiveShell.automagic = False @@ -12,3 +16,36 @@ c.InteractiveShell.colors = 'Linux' c.TerminalIPythonApp.display_banner = False c.TerminalInteractiveShell.confirm_exit = False c.TerminalInteractiveShell.display_completions = 'readlinelike' + +## Syntax colouring. +T = PYG.token +c.TerminalInteractiveShell.highlighting_style = 'emacs' +c.TerminalInteractiveShell.highlighting_style_overrides = { + T.Keyword: 'bold #fff', + T.Comment: 'italic #54ff9f', + T.Literal.Number: '#ffff00', + T.Literal.String: '#87ceff', + T.Literal.String.Escape: '#87ceff', + T.Literal.String.Interpol: '#87ceff', + T.Name: '#fff', + T.Name.Builtin: '#fff', + T.Name.Class: '#fff', + T.Name.Constant: 'italic #fff', + T.Name.Decorator: '#fff', + T.Name.Exception: '#fff', + T.Name.Function: '#fff', + T.Name.Function.Magic: '#fff', + T.Name.Label: '#fff', + T.Name.Namespace: '#fff', + T.Name.Variable: '#fff', + T.Name.Variable.Class: '#fff', + T.Name.Variable.Global: '#fff', + T.Name.Variable.Instance: '#fff', + T.Name.Variable.Magic: '#fff', + T.Operator: '#eec591', + T.Operator.Word: 'bold #fff', + T.Punctuation: '#eec591', + PTK.token.Token.MatchingBracket: '', + PTK.token.Token.MatchingBracket.Cursor: '', + PTK.token.Token.MatchingBracket.Other: 'bg:#006400' +}