From 7a13a407e92dc6780355f67018bb03da81a73b8f Mon Sep 17 00:00:00 2001 From: Roland Chernov Date: Sat, 18 Jul 2015 21:10:56 +0900 Subject: [PATCH] Added thefuck plugin https://github.com/nvbn/thefuck --- plugins/thefuck/thefuck.plugin.zsh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/thefuck/thefuck.plugin.zsh diff --git a/plugins/thefuck/thefuck.plugin.zsh b/plugins/thefuck/thefuck.plugin.zsh new file mode 100644 index 00000000..81461d48 --- /dev/null +++ b/plugins/thefuck/thefuck.plugin.zsh @@ -0,0 +1,9 @@ +fuck-command-line() { + FUCK=$(thefuck $(fc -ln -1 | tail -n 1) 2> /dev/null) + [ -z $FUCK ] && echo -n -e "\a" && return + BUFFER=$FUCK + zle end-of-line +} +zle -N fuck-command-line +# Defined shortcut keys: [Esc] [Esc] +bindkey "\e\e" fuck-command-line