| 1 | ### -*-python -*- |
| 2 | |
| 3 | try: import pygments as PYG |
| 4 | except: PYG = None |
| 5 | try: import prompt_toolkit as PTK |
| 6 | except: PTK = None |
| 7 | |
| 8 | c = get_config() |
| 9 | |
| 10 | ## Simple stuff. |
| 11 | c.InteractiveShell.autocall = 0 |
| 12 | c.InteractiveShell.autoindent = True |
| 13 | c.InteractiveShell.automagic = False |
| 14 | |
| 15 | c.InteractiveShell.color_info = True |
| 16 | c.InteractiveShell.colors = 'Linux' |
| 17 | |
| 18 | c.TerminalIPythonApp.display_banner = False |
| 19 | c.TerminalInteractiveShell.confirm_exit = False |
| 20 | c.TerminalInteractiveShell.display_completions = 'readlinelike' |
| 21 | c.TerminalInteractiveShell.term_title = False |
| 22 | |
| 23 | ## Syntax colouring. |
| 24 | if PYG and getattr(PYG, 'token', None): |
| 25 | T = PYG.token |
| 26 | c.TerminalInteractiveShell.highlighting_style = 'emacs' |
| 27 | c.TerminalInteractiveShell.highlighting_style_overrides = { |
| 28 | T.Keyword: 'bold #fff', |
| 29 | T.Comment: 'italic #54ff9f', |
| 30 | T.Literal.Number: '#ffff00', |
| 31 | T.Literal.String: '#87ceff', |
| 32 | T.Literal.String.Escape: '#87ceff', |
| 33 | T.Literal.String.Interpol: '#87ceff', |
| 34 | T.Name: '#fff', |
| 35 | T.Name.Builtin: '#fff', |
| 36 | T.Name.Class: '#fff', |
| 37 | T.Name.Constant: 'italic #fff', |
| 38 | T.Name.Decorator: '#fff', |
| 39 | T.Name.Exception: '#fff', |
| 40 | T.Name.Function: '#fff', |
| 41 | T.Name.Function.Magic: '#fff', |
| 42 | T.Name.Label: '#fff', |
| 43 | T.Name.Namespace: '#fff', |
| 44 | T.Name.Variable: '#fff', |
| 45 | T.Name.Variable.Class: '#fff', |
| 46 | T.Name.Variable.Global: '#fff', |
| 47 | T.Name.Variable.Instance: '#fff', |
| 48 | T.Name.Variable.Magic: '#fff', |
| 49 | T.Operator: '#eec591', |
| 50 | T.Operator.Word: 'bold #fff', |
| 51 | T.Punctuation: '#eec591', |
| 52 | } |
| 53 | |
| 54 | if PYG and PTK: |
| 55 | d = { |
| 56 | PTK.token.Token.MatchingBracket: '', |
| 57 | PTK.token.Token.MatchingBracket.Cursor: '', |
| 58 | PTK.token.Token.MatchingBracket.Other: 'bg:#006400' |
| 59 | } |
| 60 | c.TerminalInteractiveShell.highlighting_style_overrides.update(d) |