Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
a7aed69d
Commit
a7aed69d
authored
Aug 30, 2015
by
Robby Russell
Browse files
Merge pull request #4170 from black-roland/master
The Fuck plugin (
https://github.com/nvbn/thefuck
)
parents
b1d57fad
fb8c446e
Changes
2
Hide whitespace changes
Inline
Side-by-side
plugins/thefuck/README.md
0 → 100644
View file @
a7aed69d
# 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.
## Notes
`Esc`
-
`Esc`
key binding conflicts with
[
sudo
](
https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/sudo
)
plugin.
plugins/thefuck/thefuck.plugin.zsh
0 → 100644
View file @
a7aed69d
if
[[
-z
$commands
[
thefuck]
]]
;
then
echo
'thefuck is not installed, you should "pip install thefuck" first'
return
-1
fi
# Register alias
eval
"
$(
thefuck-alias
)
"
fuck-command-line
()
{
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
}
zle
-N
fuck-command-line
# Defined shortcut keys: [Esc] [Esc]
bindkey
"
\e\e
"
fuck-command-line
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment