1 if [[ -z $commands[thefuck] ]]; then
2 echo 'thefuck is not installed, you should "pip install thefuck" or "brew install thefuck" first.'
3 echo 'See https://github.com/nvbn/thefuck#installation'
8 [[ ! -a $ZSH_CACHE_DIR/thefuck ]] && thefuck --alias > $ZSH_CACHE_DIR/thefuck
9 source $ZSH_CACHE_DIR/thefuck
12 local FUCK="$(THEFUCK_REQUIRE_CONFIRMATION=0 thefuck $(fc -ln -1 | tail -n 1) 2> /dev/null)"
13 [[ -z $FUCK ]] && echo -n -e "\a" && return
17 zle -N fuck-command-line
18 # Defined shortcut keys: [Esc] [Esc]
19 bindkey -M emacs '\e\e' fuck-command-line
20 bindkey -M vicmd '\e\e' fuck-command-line
21 bindkey -M viins '\e\e' fuck-command-line