Improve performance of emacs-like key bindings