8e8a13398e71b969dc39189c0fedcc4733a911df
- Author
- Black Roland <black-roland@github.com>
- Committer
- Roland Chernov <mail@9241406380.org>
- Date
Message
Thefuck: combined with @cristim plugin. Code formating
Diff
1diff --git a/plugins/fuck/fuck.plugin.zsh b/plugins/fuck/fuck.plugin.zsh
2deleted file mode 100644
3index cbf8c09ce027bb36639e8576c55ebf7a97e697e6..0000000000000000000000000000000000000000
4--- a/plugins/fuck/fuck.plugin.zsh
5+++ /dev/null
6@@ -1,6 +0,0 @@
7-if [[ -n $commands[thefuck] ]]; then
8- alias fuck='eval $(thefuck $(fc -ln -1 | tail -n 1)); fc -R'
9- alias FUCK='fuck'
10-else
11- echo 'thefuck is not installed, you should "pip install thefuck" first'
12-fi
13diff --git a/plugins/thefuck/thefuck.plugin.zsh b/plugins/thefuck/thefuck.plugin.zsh
14index 81461d48e33e846726f16b295da47550ba431658..86ec9901b17ca0d92a012d4774dd1391b29b1e1c 100644
15--- a/plugins/thefuck/thefuck.plugin.zsh
16+++ b/plugins/thefuck/thefuck.plugin.zsh
17@@ -1,6 +1,14 @@
18+if [[ -z $commands[thefuck] ]]; then
19+ echo 'thefuck is not installed, you should "pip install thefuck" first'
20+ return -1
21+fi
22+
23+alias fuck='eval $(thefuck $(fc -ln -1 | tail -n 1)); fc -R'
24+alias FUCK='fuck'
25+
26 fuck-command-line() {
27- FUCK=$(thefuck $(fc -ln -1 | tail -n 1) 2> /dev/null)
28- [ -z $FUCK ] && echo -n -e "\a" && return
29+ FUCK="$(thefuck $(fc -ln -1 | tail -n 1) 2> /dev/null)"
30+ [[ -z $FUCK ]] && echo -n -e "\a" && return
31 BUFFER=$FUCK
32 zle end-of-line
33 }