summaryrefslogtreecommitdiff
path: root/plugins/thefuck
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/thefuck')
-rw-r--r--plugins/thefuck/README.md4
-rw-r--r--plugins/thefuck/thefuck.plugin.zsh3
2 files changed, 6 insertions, 1 deletions
diff --git a/plugins/thefuck/README.md b/plugins/thefuck/README.md
index bd407b316..84f7255ce 100644
--- a/plugins/thefuck/README.md
+++ b/plugins/thefuck/README.md
@@ -2,6 +2,10 @@
[The Fuck](https://github.com/nvbn/thefuck) plugin — magnificent app which corrects your previous console command.
+To use it, add thefuck to the plugins array of your zshrc file:
+
+plugins=(... thefuck)
+
## Usage
Press `ESC` twice to correct previous console command.
diff --git a/plugins/thefuck/thefuck.plugin.zsh b/plugins/thefuck/thefuck.plugin.zsh
index b8586c70d..2ab4eb6e2 100644
--- a/plugins/thefuck/thefuck.plugin.zsh
+++ b/plugins/thefuck/thefuck.plugin.zsh
@@ -5,7 +5,8 @@ if [[ -z $commands[thefuck] ]]; then
fi
# Register alias
-eval "$(thefuck --alias)"
+[[ ! -a $ZSH_CACHE_DIR/thefuck ]] && thefuck --alias > $ZSH_CACHE_DIR/thefuck
+source $ZSH_CACHE_DIR/thefuck
fuck-command-line() {
local FUCK="$(THEFUCK_REQUIRE_CONFIRMATION=0 thefuck $(fc -ln -1 | tail -n 1) 2> /dev/null)"