You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: stdlib/REPL/docs/src/index.md
+177Lines changed: 177 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -533,6 +533,183 @@ mmap(file::AbstractString, ::Type{T}, len::Integer) where T<:BitArray in Mmap at
533
533
mmap(file::AbstractString, ::Type{T}, len::Integer, offset::Integer; grow, shared) where T<:BitArray in Mmap at Mmap/src/Mmap.jl:322
534
534
```
535
535
536
+
## Syntax Highlighting
537
+
538
+
The REPL provides syntax highlighting for input as you type.
539
+
Syntax highlighting is enabled by default but can be disabled in your `~/.julia/config/startup.jl`:
540
+
541
+
```julia
542
+
atreplinit() do repl
543
+
repl.options.style_input =false
544
+
end
545
+
```
546
+
547
+
### Customizing Syntax Highlighting Colors
548
+
549
+
The default syntax highlighting theme is quite conservative but can be customized using a TOML file `faces.toml` (https://julialang.github.io/StyledStrings.jl/dev/#stdlib-styledstrings-face-toml) in `.julia/config` (or by explicitly loading the faces from a face toml file).
550
+
551
+
552
+
<details>
553
+
<summary>Example: Monokai color theme (click to expand)</summary>
554
+
555
+
```toml
556
+
# Monokai color theme for Julia syntax highlighting
557
+
558
+
[julia_macro]
559
+
foreground = "#A6E22E"
560
+
561
+
[julia_symbol]
562
+
foreground = "#AE81FF"
563
+
564
+
[julia_singleton_identifier]
565
+
inherit = "julia_symbol"
566
+
567
+
[julia_type]
568
+
foreground = "#66D9EF"
569
+
570
+
[julia_typedec]
571
+
foreground = "#66D9EF"
572
+
weight = "bold"
573
+
574
+
[julia_comment]
575
+
foreground = "#75715E"
576
+
italic = true
577
+
578
+
[julia_string]
579
+
foreground = "#E6DB74"
580
+
581
+
[julia_regex]
582
+
inherit = "julia_string"
583
+
584
+
[julia_backslash_literal]
585
+
foreground = "#FD971F"
586
+
inherit = "julia_string"
587
+
588
+
[julia_string_delim]
589
+
foreground = "#E6DB74"
590
+
weight = "bold"
591
+
592
+
[julia_cmdstring]
593
+
inherit = "julia_string"
594
+
595
+
[julia_char]
596
+
inherit = "julia_string"
597
+
598
+
[julia_char_delim]
599
+
inherit = "julia_string_delim"
600
+
601
+
[julia_number]
602
+
foreground = "#AE81FF"
603
+
604
+
[julia_bool]
605
+
foreground = "#AE81FF"
606
+
weight = "bold"
607
+
608
+
[julia_funcall]
609
+
foreground = "#A6E22E"
610
+
611
+
[julia_broadcast]
612
+
foreground = "#F92672"
613
+
weight = "bold"
614
+
615
+
[julia_builtin]
616
+
foreground = "#66D9EF"
617
+
weight = "bold"
618
+
619
+
[julia_operator]
620
+
foreground = "#F92672"
621
+
622
+
[julia_comparator]
623
+
inherit = "julia_operator"
624
+
625
+
[julia_assignment]
626
+
foreground = "#F92672"
627
+
weight = "bold"
628
+
629
+
[julia_keyword]
630
+
foreground = "#F92672"
631
+
weight = "bold"
632
+
633
+
[julia_parentheses]
634
+
foreground = "#F8F8F2"
635
+
636
+
[julia_unpaired_parentheses]
637
+
background = "#F92672"
638
+
foreground = "#F8F8F0"
639
+
weight = "bold"
640
+
641
+
[julia_error]
642
+
background = "#F92672"
643
+
foreground = "#F8F8F0"
644
+
645
+
[julia_rainbow_paren_1]
646
+
foreground = "#A6E22E"
647
+
inherit = "julia_parentheses"
648
+
649
+
[julia_rainbow_paren_2]
650
+
foreground = "#66D9EF"
651
+
inherit = "julia_parentheses"
652
+
653
+
[julia_rainbow_paren_3]
654
+
foreground = "#FD971F"
655
+
inherit = "julia_parentheses"
656
+
657
+
[julia_rainbow_paren_4]
658
+
inherit = "julia_rainbow_paren_1"
659
+
660
+
[julia_rainbow_paren_5]
661
+
inherit = "julia_rainbow_paren_2"
662
+
663
+
[julia_rainbow_paren_6]
664
+
inherit = "julia_rainbow_paren_3"
665
+
666
+
# Rainbow brackets
667
+
[julia_rainbow_bracket_1]
668
+
foreground = "#AE81FF"
669
+
inherit = "julia_parentheses"
670
+
671
+
[julia_rainbow_bracket_2]
672
+
foreground = "#E6DB74"
673
+
inherit = "julia_parentheses"
674
+
675
+
[julia_rainbow_bracket_3]
676
+
inherit = "julia_rainbow_bracket_1"
677
+
678
+
[julia_rainbow_bracket_4]
679
+
inherit = "julia_rainbow_bracket_2"
680
+
681
+
[julia_rainbow_bracket_5]
682
+
inherit = "julia_rainbow_bracket_1"
683
+
684
+
[julia_rainbow_bracket_6]
685
+
inherit = "julia_rainbow_bracket_2"
686
+
687
+
# Rainbow curlies
688
+
[julia_rainbow_curly_1]
689
+
foreground = "#F92672"
690
+
inherit = "julia_parentheses"
691
+
692
+
[julia_rainbow_curly_2]
693
+
foreground = "#A6E22E"
694
+
inherit = "julia_parentheses"
695
+
696
+
[julia_rainbow_curly_3]
697
+
inherit = "julia_rainbow_curly_1"
698
+
699
+
[julia_rainbow_curly_4]
700
+
inherit = "julia_rainbow_curly_2"
701
+
702
+
[julia_rainbow_curly_5]
703
+
inherit = "julia_rainbow_curly_1"
704
+
705
+
[julia_rainbow_curly_6]
706
+
inherit = "julia_rainbow_curly_2"
707
+
```
708
+
709
+
</details>
710
+
711
+
For a complete list of customizable faces, see the [JuliaSyntaxHighlighting package documentation](https://julialang.github.io/JuliaSyntaxHighlighting.jl/dev/).
712
+
536
713
## Customizing Colors
537
714
538
715
The colors used by Julia and the REPL can be customized, as well. To change the
0 commit comments