Sorry but I’m not talking about space-separated words. Please see the example.
In most terminal environments such as in macOS and Ubuntu (with zsh in my case), <C-W> removes a word at once like this: qwer/asdf → qwer/.
So I hope that <C-W> in JuliaREPL changes include("test/runtests to include("test/.
We are simply modifying the keymaps originally stated in julia/LineEdit.jl at master · JuliaLang/julia · GitHub . In this case, we just borrowed the the function for Alt-Backspace ("\e\b") to be used for Ctrl-W ("^W", aka '\x17').
Is it also possible to add it to startup.jl?
Cuz I’ve tried it but this error occurs:
ERROR: LoadError: UndefVarError: active_repl not defined
Stacktrace:
[1] getproperty(::Module, ::Symbol) at ./Base.jl:26
[2] top-level scope at /Applications/Julia-1.5.app/Contents/Resources/julia/etc/julia/startup.jl:22
[3] include(::Function, ::Module, ::String) at ./Base.jl:380
[4] include at ./Base.jl:368 [inlined]
[5] load_julia_startup() at ./client.jl:324
[6] exec_options(::Base.JLOptions) at ./client.jl:267
[7] _start() at ./client.jl:506
in expression starting at /Applications/Julia-1.5.app/Contents/Resources/julia/etc/julia/startup.jl:22
I found that keymapping “after” OhMyREPL does not properly work.
So I moved lines about keymapping at the beginning of startup.jl as follows, and it works.
import REPL
import REPL.LineEdit: MIState, edit_delete_prev_word, ModeState
atreplinit() do repl
repl.interface = REPL.setup_interface(repl; extra_repl_keymap = Dict("^W" => "\e\b"))
end