mirror of
				https://github.com/nvbn/thefuck.git
				synced 2025-11-04 00:52:04 +00:00 
			
		
		
		
	Created Shell aliases (markdown)
							
								
								
									
										29
									
								
								Shell-aliases.md
									
									
									
									
									
										Normal file
									
								
							
							
								
								
								
								
								
									
									
										
											
											
										
										
									
								
							
						
						
									
										29
									
								
								Shell-aliases.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,29 @@
 | 
			
		||||
# Bash and Zsh
 | 
			
		||||
 | 
			
		||||
Add this alias to `.bashrc` or `.zshrc` or `.bash_profile` (for OSX):
 | 
			
		||||
```bash
 | 
			
		||||
alias fuck='eval $(thefuck $(fc -ln -1))'
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
# Fish
 | 
			
		||||
 | 
			
		||||
Add this function to `config.fish`:
 | 
			
		||||
```fish
 | 
			
		||||
function fuck
 | 
			
		||||
    eval (thefuck $history[1])
 | 
			
		||||
end
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
# Powershell
 | 
			
		||||
 | 
			
		||||
Put this in your Powershell `$PROFILE` on Windows:
 | 
			
		||||
 | 
			
		||||
```powershell
 | 
			
		||||
function fuck {
 | 
			
		||||
    $fuck = $(thefuck (get-history -count 1).commandline)
 | 
			
		||||
    if($fuck.startswith("echo")) {
 | 
			
		||||
        $fuck.substring(5)
 | 
			
		||||
    }
 | 
			
		||||
    else { iex "$fuck" }
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
		Reference in New Issue
	
	Block a user