Refactor history search keybindings