Every Julia user has typed exit at the REPL, been shown exit (generic function with 2 methods), sighed, and typed exit(). ReplExit.jl is the small package that ends the sigh:
julia> exit
$
quit works the same way.
How it works. The REPL runs every parsed input through a list of AST transforms before evaluating it. ReplExit adds one: a line consisting of nothing but the bare symbol exit or quit is rewritten to exit(). Nothing else is touched, so exit stays an ordinary function value everywhere: f = exit, exit in a script, exit inside an included file all behave exactly as before. In particular it is not the oft-posted Base.show(io, ::MIME"text/plain", ::typeof(exit)) = exit() trick, which is type piracy and quits whenever the function object happens to get displayed.
Install. Add it to your default environment, then let it wire itself into startup.jl:
(@v1.11) pkg> add ReplExit
julia> using ReplExit
julia> ReplExit.install()
From the next session on, bare exit quits. install() adds a guarded try using ReplExit catch ... end block to ~/.julia/config/startup.jl, backs up the previous file, is idempotent, and can never keep Julia from starting; uninstall() takes the block out again. Within a session, disable!() and enable!() turn the rewrite off and on.
Caveats. REPL only; no effect on scripts, julia -e, or editors and notebooks that bypass the REPL. It relies on REPL.repl_ast_transforms and Base.active_repl_backend, which are internals; tested on Julia 1.10 and up against a real REPL on a pseudo-terminal, and if a future release renames them, enable! warns and does nothing rather than breaking your REPL.
Repo and docs: GitHub - NittanyLion/ReplExit.jl: Type exit at the Julia REPL, without parentheses, and it quits · GitHub
Feedback and PRs welcome.