# How to run OhMyREPL.jl with startup.jl?

**URL:** <https://discourse.julialang.org/t/how-to-run-ohmyrepl-jl-with-startup-jl/101002>\
**Category:** General Usage\
**Tags:** repl, startup\
**Created:** [June 29, 2023, 10:31pm UTC](https://discourse.julialang.org/t/how-to-run-ohmyrepl-jl-with-startup-jl/101002 "2023-06-29T22:31:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hugo](https://avatars.discourse-cdn.com/v4/letter/h/b38774/32.png) [@Hugo](https://discourse.julialang.org/u/Hugo)\
**Post date:** [June 29, 2023, 10:31pm UTC](https://discourse.julialang.org/t/how-to-run-ohmyrepl-jl-with-startup-jl/101002/1 "2023-06-29T22:31:54Z")

</div>

Hello, all

I decided to add the following piece of code to my `startup.jl` file to have `Revise.jl` and `OhMyREPL.jl` run from the get-go as I open the application

```julia
import Pkg
let
    pkgs = ["Revise", "OhMyREPL"]
    for pkg in pkgs
        if Base.find_package(pkg) === nothing
            Pkg.add(pkg)
        end
    end
end

using Revise
using OhMyREPL
colorscheme!("BoxyMonokai256")

```

In a nutshell, the code is meant to check if the packages are installed. If not, then they’ll be installed. I have checked and the packages are installed and up-to-date.

Despite this addition to the `startup.jl` file, `OhMyREPL.jl` isn’t loaded when the application opens. I’m testing this in the actual Julia REPL as opposed to the Julia REPL in VSCode.

Does anyone know if I’ve made a mistake? If so, how do I fix it?  
Thank you.

---

<div class="post-metadata">

**Author:** ![mbaz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbaz/32/17295_2.png) [@mbaz](https://discourse.julialang.org/u/mbaz)\
**Post date:** [June 29, 2023, 10:58pm UTC](https://discourse.julialang.org/t/how-to-run-ohmyrepl-jl-with-startup-jl/101002/2 "2023-06-29T22:58:34Z")

</div>

I think OhMyREPL must be loaded only after the REPL is initialized; something like:

```julia
atreplinit() do repl
    @eval using OhMyREPL
end

```

---

<div class="post-metadata">

**Author:** ![singularitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/singularitti/32/17678_2.png) [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Post date:** [June 29, 2023, 11:26pm UTC](https://discourse.julialang.org/t/how-to-run-ohmyrepl-jl-with-startup-jl/101002/3 "2023-06-29T23:26:19Z")

</div>

Here’s an example: [Cool and fast REPL · JuliaNotes.jl](https://m3g.github.io/JuliaNotes.jl/stable/fastrepl/)

But my config is like this and it also works (since I am using OhMyREPL.jl & Revise.jl all the time, I just install them all them time and don’t bother checking everytime):

```julia
using OhMyREPL
colorscheme!("BoxyMonokai256")

if isfile("Project.toml")
    using Pkg
    Pkg.activate(".")
    @async @eval using Revise
end

```

Or, you can use what they suggested in their [docs](https://timholy.github.io/Revise.jl/stable/config/#Using-Revise-by-default-1) and [this](https://kristofferc.github.io/OhMyREPL.jl/latest/installation/#Automatically-start-with-Julia.):

```julia
try
    using Revise
catch e
    @warn "Error initializing Revise" exception=(e, catch_backtrace())
end
atreplinit() do repl
    try
        @eval using OhMyREPL
    catch e
        @warn "error while importing OhMyREPL" e
    end
end

```

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [June 29, 2023, 11:39pm UTC](https://discourse.julialang.org/t/how-to-run-ohmyrepl-jl-with-startup-jl/101002/4 "2023-06-29T23:39:29Z")

</div>

if you know OhMyREPL is installed, you can just have

```julia
using OhMyREPL
colorscheme!("GruvboxDark") # whatever you want

```

---

<div class="post-metadata">

**Author:** ![Hugo](https://avatars.discourse-cdn.com/v4/letter/h/b38774/32.png) [@Hugo](https://discourse.julialang.org/u/Hugo)\
**Post date:** [June 30, 2023, 5:54pm UTC](https://discourse.julialang.org/t/how-to-run-ohmyrepl-jl-with-startup-jl/101002/5 "2023-06-30T17:54:13Z")

</div>

Strangely enough, I added the docs suggestion to the `startup.jl` file, but it still does not work. =/  
Thank you for your contribution, though.
