mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-20 01:28:56 +00:00
Merge d708ce984a5261dc126d4a34ba8689055361a9a9 into b4b599df805270017c8460baaa8bca430ca6bef3
This commit is contained in:
commit
8c63bea408
14
README.md
14
README.md
@ -112,6 +112,8 @@ And add to `.bashrc` or `.zshrc` or `.bash_profile`(for OSX):
|
|||||||
alias fuck='$(thefuck $(fc -ln -1))'
|
alias fuck='$(thefuck $(fc -ln -1))'
|
||||||
# You can use whatever you want as an alias, like for mondays:
|
# You can use whatever you want as an alias, like for mondays:
|
||||||
alias FUCK='fuck'
|
alias FUCK='fuck'
|
||||||
|
# Confirm before execute if you have scruple:
|
||||||
|
alias shit='cmd=$(thefuck $(fc -ln -1)); if [[ "$cmd" =~ "^echo .+" ]]; then eval $cmd; else printf "Sure? press Enter to continue..."; read -n 1 confirm; if [[ "$confirm" -eq "" ]]; then echo ''; eval $cmd; fi; fi'
|
||||||
```
|
```
|
||||||
|
|
||||||
Or in `config.fish`:
|
Or in `config.fish`:
|
||||||
@ -125,12 +127,12 @@ end
|
|||||||
Or in your Powershell `$PROFILE` on Windows:
|
Or in your Powershell `$PROFILE` on Windows:
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
function fuck {
|
function fuck {
|
||||||
$fuck = $(thefuck (get-history -count 1).commandline)
|
$fuck = $(thefuck (get-history -count 1).commandline)
|
||||||
if($fuck.startswith("echo")) {
|
if($fuck.startswith("echo")) {
|
||||||
$fuck.substring(5)
|
$fuck.substring(5)
|
||||||
}
|
}
|
||||||
else { iex "$fuck" }
|
else { iex "$fuck" }
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -197,7 +199,7 @@ def get_new_command(command, settings):
|
|||||||
The Fuck has a few settings parameters, they can be changed in `~/.thefuck/settings.py`:
|
The Fuck has a few settings parameters, they can be changed in `~/.thefuck/settings.py`:
|
||||||
|
|
||||||
* `rules` – list of enabled rules, by default all;
|
* `rules` – list of enabled rules, by default all;
|
||||||
* `require_confirmation` – require confirmation before running new command, by default `False`;
|
* `require_confirmation` – require confirmation before running new command, by default `False`;
|
||||||
* `wait_command` – max amount of time in seconds for getting previous command output;
|
* `wait_command` – max amount of time in seconds for getting previous command output;
|
||||||
* `no_colors` – disable colored output.
|
* `no_colors` – disable colored output.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user