From 7a13a407e92dc6780355f67018bb03da81a73b8f Mon Sep 17 00:00:00 2001 From: Roland Chernov Date: Sat, 18 Jul 2015 21:10:56 +0900 Subject: 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 (limited to 'plugins/thefuck') diff --git a/plugins/thefuck/thefuck.plugin.zsh b/plugins/thefuck/thefuck.plugin.zsh new file mode 100644 index 000000000..81461d48e --- /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 -- cgit v1.2.3-70-g09d2 From cd2213a0304e7f0b8fdfbb02be96f57042e2744a Mon Sep 17 00:00:00 2001 From: Roland Chernov Date: Sat, 18 Jul 2015 21:17:51 +0900 Subject: Thefuck plugin README --- plugins/thefuck/README.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 plugins/thefuck/README.md (limited to 'plugins/thefuck') diff --git a/plugins/thefuck/README.md b/plugins/thefuck/README.md new file mode 100644 index 000000000..981b5513e --- /dev/null +++ b/plugins/thefuck/README.md @@ -0,0 +1,6 @@ +# The Fuck + +[The Fuck](https://github.com/nvbn/thefuck) plugin — magnificent app which corrects your previous console command. + +## Usage +Press `ESC` twice to correct previous console command. -- cgit v1.2.3-70-g09d2 From e38455bf4f9b247d3e51298d39d18a90a7294438 Mon Sep 17 00:00:00 2001 From: Roland Chernov Date: Sun, 19 Jul 2015 12:57:50 +0900 Subject: Added conflict note (thefuck plugin) --- plugins/thefuck/README.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugins/thefuck') diff --git a/plugins/thefuck/README.md b/plugins/thefuck/README.md index 981b5513e..a9b7550d7 100644 --- a/plugins/thefuck/README.md +++ b/plugins/thefuck/README.md @@ -4,3 +4,6 @@ ## Usage Press `ESC` twice to correct previous console command. + +## Notes +`Esc`-`Esc` key binding conflicts with [sudo](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/sudo) plugin. -- cgit v1.2.3-70-g09d2 From 8e8a13398e71b969dc39189c0fedcc4733a911df Mon Sep 17 00:00:00 2001 From: Black Roland Date: Wed, 22 Jul 2015 17:20:52 +0900 Subject: Thefuck: combined with @cristim plugin. Code formating --- plugins/fuck/fuck.plugin.zsh | 6 ------ plugins/thefuck/thefuck.plugin.zsh | 12 ++++++++++-- 2 files changed, 10 insertions(+), 8 deletions(-) delete mode 100644 plugins/fuck/fuck.plugin.zsh (limited to 'plugins/thefuck') diff --git a/plugins/fuck/fuck.plugin.zsh b/plugins/fuck/fuck.plugin.zsh deleted file mode 100644 index cbf8c09ce..000000000 --- a/plugins/fuck/fuck.plugin.zsh +++ /dev/null @@ -1,6 +0,0 @@ -if [[ -n $commands[thefuck] ]]; then - alias fuck='eval $(thefuck $(fc -ln -1 | tail -n 1)); fc -R' - alias FUCK='fuck' -else - echo 'thefuck is not installed, you should "pip install thefuck" first' -fi diff --git a/plugins/thefuck/thefuck.plugin.zsh b/plugins/thefuck/thefuck.plugin.zsh index 81461d48e..86ec9901b 100644 --- a/plugins/thefuck/thefuck.plugin.zsh +++ b/plugins/thefuck/thefuck.plugin.zsh @@ -1,6 +1,14 @@ +if [[ -z $commands[thefuck] ]]; then + echo 'thefuck is not installed, you should "pip install thefuck" first' + return -1 +fi + +alias fuck='eval $(thefuck $(fc -ln -1 | tail -n 1)); fc -R' +alias FUCK='fuck' + fuck-command-line() { - FUCK=$(thefuck $(fc -ln -1 | tail -n 1) 2> /dev/null) - [ -z $FUCK ] && echo -n -e "\a" && return + FUCK="$(thefuck $(fc -ln -1 | tail -n 1) 2> /dev/null)" + [[ -z $FUCK ]] && echo -n -e "\a" && return BUFFER=$FUCK zle end-of-line } -- cgit v1.2.3-70-g09d2 From 54e27406dcc2fea55432595f9ec01502da8e4468 Mon Sep 17 00:00:00 2001 From: Roland Chernov Date: Thu, 23 Jul 2015 20:10:31 +0900 Subject: Thefuck: replaced static alias with `eval "$(thefuck-alias)"` --- plugins/thefuck/thefuck.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/thefuck') diff --git a/plugins/thefuck/thefuck.plugin.zsh b/plugins/thefuck/thefuck.plugin.zsh index 86ec9901b..10467d337 100644 --- a/plugins/thefuck/thefuck.plugin.zsh +++ b/plugins/thefuck/thefuck.plugin.zsh @@ -3,8 +3,8 @@ if [[ -z $commands[thefuck] ]]; then return -1 fi -alias fuck='eval $(thefuck $(fc -ln -1 | tail -n 1)); fc -R' -alias FUCK='fuck' +# Register alias +eval "$(thefuck-alias)" fuck-command-line() { FUCK="$(thefuck $(fc -ln -1 | tail -n 1) 2> /dev/null)" -- cgit v1.2.3-70-g09d2 From f534b4b321d5db4b3d42d3e2cf1f2b2af5bd3c64 Mon Sep 17 00:00:00 2001 From: Roland Chernov Date: Thu, 23 Jul 2015 20:54:51 +0900 Subject: Thefuck: fixed compability with latest version --- plugins/thefuck/thefuck.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/thefuck') diff --git a/plugins/thefuck/thefuck.plugin.zsh b/plugins/thefuck/thefuck.plugin.zsh index 10467d337..739bb0b9a 100644 --- a/plugins/thefuck/thefuck.plugin.zsh +++ b/plugins/thefuck/thefuck.plugin.zsh @@ -7,7 +7,7 @@ fi eval "$(thefuck-alias)" fuck-command-line() { - FUCK="$(thefuck $(fc -ln -1 | tail -n 1) 2> /dev/null)" + FUCK="$(THEFUCK_REQUIRE_CONFIRMATION=0 thefuck $(fc -ln -1 | tail -n 1) 2> /dev/null)" [[ -z $FUCK ]] && echo -n -e "\a" && return BUFFER=$FUCK zle end-of-line -- cgit v1.2.3-70-g09d2 From fb8c446ea4317c391321a29dc97677bc6fdeb0cf Mon Sep 17 00:00:00 2001 From: Roland Chernov Date: Thu, 30 Jul 2015 21:04:58 +0900 Subject: Thefuck: fix global variable assignment --- plugins/thefuck/thefuck.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/thefuck') diff --git a/plugins/thefuck/thefuck.plugin.zsh b/plugins/thefuck/thefuck.plugin.zsh index 739bb0b9a..8b1746e85 100644 --- a/plugins/thefuck/thefuck.plugin.zsh +++ b/plugins/thefuck/thefuck.plugin.zsh @@ -7,7 +7,7 @@ fi eval "$(thefuck-alias)" fuck-command-line() { - FUCK="$(THEFUCK_REQUIRE_CONFIRMATION=0 thefuck $(fc -ln -1 | tail -n 1) 2> /dev/null)" + local FUCK="$(THEFUCK_REQUIRE_CONFIRMATION=0 thefuck $(fc -ln -1 | tail -n 1) 2> /dev/null)" [[ -z $FUCK ]] && echo -n -e "\a" && return BUFFER=$FUCK zle end-of-line -- cgit v1.2.3-70-g09d2 From 022a060ec754f3ed54cb62acc3370310bfe71a50 Mon Sep 17 00:00:00 2001 From: kyleheyne Date: Mon, 31 Aug 2015 17:36:41 -0400 Subject: thefuck-alias -> thefuck --alias Per warning message. --- plugins/thefuck/thefuck.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/thefuck') diff --git a/plugins/thefuck/thefuck.plugin.zsh b/plugins/thefuck/thefuck.plugin.zsh index 8b1746e85..765e2b9a5 100644 --- a/plugins/thefuck/thefuck.plugin.zsh +++ b/plugins/thefuck/thefuck.plugin.zsh @@ -4,7 +4,7 @@ if [[ -z $commands[thefuck] ]]; then fi # Register alias -eval "$(thefuck-alias)" +eval "$(thefuck --alias)" fuck-command-line() { local FUCK="$(THEFUCK_REQUIRE_CONFIRMATION=0 thefuck $(fc -ln -1 | tail -n 1) 2> /dev/null)" -- cgit v1.2.3-70-g09d2