# Keybindings: type something in REPL and loop in history through commands that have this prefix

**URL:** <https://discourse.julialang.org/t/keybindings-type-something-in-repl-and-loop-in-history-through-commands-that-have-this-prefix/16913>\
**Category:** New to Julia\
**Created:** [October 29, 2018, 8:05am UTC](https://discourse.julialang.org/t/keybindings-type-something-in-repl-and-loop-in-history-through-commands-that-have-this-prefix/16913 "2018-10-29T08:05:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dapz](https://avatars.discourse-cdn.com/v4/letter/d/a4c791/32.png) [@dapz](https://discourse.julialang.org/u/dapz)\
**Post date:** [October 29, 2018, 8:05am UTC](https://discourse.julialang.org/t/keybindings-type-something-in-repl-and-loop-in-history-through-commands-that-have-this-prefix/16913/1 "2018-10-29T08:05:52Z")

</div>

Hi, I’m trying to map in the REPL a custom key to the same behavior than the “up arrow” key. As suggested in the documentation, I tried something like that:

```julia
const mykeys = Dict{Any,Any}(
    "^s" => (s,o...)->(LineEdit.edit_move_up(s) || LineEdit.history_prev(s, LineEdit.mode(s).hist))
)
function customize_keys(repl)
    repl.interface = REPL.setup_interface(repl; extra_repl_keymap = mykeys)
end

```

But history\_prev actually loops through all the previous commands, while typing “up arrow” in the REPL loops through commands in the history that have as a prefix what has already been typed. Which function should I call to get this behavior? I had a look at LineEdit.jl, but I got a bit confused between the different keymaps: default\_keymap, history\_keymap, prefix\_history\_keymap…  
Is there a function that already does exactly what I need 🙂 ? Thanks.
