-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartup.jl
More file actions
70 lines (62 loc) · 3.13 KB
/
startup.jl
File metadata and controls
70 lines (62 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
ENV["EDITOR"] = "nvim"
if isinteractive()
using Revise
using BenchmarkTools
using Pkg
if isfile("Project.toml")
Pkg.activate(".")
end
function usePlots(backend::Symbol = :interactive)
deps = Pkg.dependencies()
if any(info -> info.name == "juliaPlottingKit" || info.name == "Makie", values(deps))
println("juliaPlottingKit or Makie is already an explicit dependency of the current project. Returning without doing anything")
return nothing
end
if !any(path -> path == "@plotting", LOAD_PATH)
push!(LOAD_PATH, "@plotting")
@info "Added @plotting environment to LOAD_PATH."
end
@eval using juliaPlottingKit
@eval import Makie
if backend in (:interactive, :gl)
@eval import GLMakie
Base.invokelatest(GLMakie.activate!)
println("Plotting enabled with GLMakie... Use `usePlots(:cairo)` for svg")
elseif backend in (:publication, :cairo)
@eval import CairoMakie
# Set CairoMakie to produce vector graphics (svg) or raster (png)
Base.invokelatest(CairoMakie.activate!, type = "svg")
println("Plotting enabled with CairoMakie... Use `usePlots(:gl)` for GLMakie")
else
@error "Unknown backend: `$backend`. Use `:interactive` or `:publication`."
return
end
end
end
# atreplinit() do repl
# @eval using Revise
# @eval using BenchmarkTools
# @eval using JET
# end
# if isinteractive() # use PackageCompiler to precompile this into a system image
# using OhMyREPL
# using Crayons
# import OhMyREPL: Passes.SyntaxHighlighter
# #https://github.com/rebelot/kanagawa.nvim, but with macros linking to a special
# kanagawaScheme = SyntaxHighlighter.ColorScheme()
# SyntaxHighlighter.keyword!(kanagawaScheme, Crayon(foreground = 0x957FB8, background = 0x1F1F28))
# SyntaxHighlighter.macro!(kanagawaScheme, Crayon(foreground = 0xE46876, background = 0x1F1F28))
# SyntaxHighlighter.comment!(kanagawaScheme, Crayon(foreground = 0x727169, background = 0x1F1F28))
# SyntaxHighlighter.call!(kanagawaScheme, Crayon(foreground = 0x7E9CD8, background = 0x1F1F28))
# SyntaxHighlighter.string!(kanagawaScheme, Crayon(foreground = 0x98BB6C, background = 0x1F1F28))
# SyntaxHighlighter.error!(kanagawaScheme, Crayon(foreground = 0xE82424, background = 0x1F1F28))
# SyntaxHighlighter.number!(kanagawaScheme, Crayon(foreground = 0xD27E99, background = 0x1F1F28))
# SyntaxHighlighter.op!(kanagawaScheme, Crayon(foreground = 0xC0A36E, background = 0x1F1F28))
# SyntaxHighlighter.function_def!(kanagawaScheme, Crayon(foreground = 0x7E9CD8, background = 0x1F1F28))
# SyntaxHighlighter.text!(kanagawaScheme, Crayon(foreground = 0xDCD7BA, background = 0x1F1F28))
# SyntaxHighlighter.symbol!(kanagawaScheme,Crayon(foreground = 0xE6C384, background = 0x1F1F28))
# SyntaxHighlighter.argdef!(kanagawaScheme, Crayon(foreground = 0x7AA89F, background = 0x1F1F28))
# SyntaxHighlighter.add!("kanagawa",kanagawaScheme)
# colorscheme!("kanagawa")
# @info "Using OhMyREPL"
# end