I run this command in my zsh: bindkey -s ' ' 'ls\n' and it was working nicely, when I press space twice, the ls command is executed. But when I add the exact same line to my .zshrc it does not recognice the two spaces as a key binding. What am I doing wrong? I also use oh-my-zsh.

  • 1
    Can you confirm that the key binding is in fact defined in the shell after adding it to ~/.zshrc? That is, what does bindkey ' ' return? – Adaephon Jul 24 '17 at 18:23
  • I figured out the problem, I sourced oh-my-zsh.sh after the bindkey command. After doing this before my bindkey commands, everything works. – Jonas Jul 24 '17 at 19:09

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.