add gdf magic to zshrc
This commit is contained in:
		
							parent
							
								
									298032e572
								
							
						
					
					
						commit
						0839c647e6
					
				
					 1 changed files with 15 additions and 7 deletions
				
			
		
							
								
								
									
										22
									
								
								zshrc
									
										
									
									
									
								
							
							
						
						
									
										22
									
								
								zshrc
									
										
									
									
									
								
							| 
						 | 
					@ -112,6 +112,21 @@ bindkey '^R'      history-incremental-search-backward # ctrl + r
 | 
				
			||||||
bindkey '^[m'     copy-prev-shell-word                # alt + m
 | 
					bindkey '^[m'     copy-prev-shell-word                # alt + m
 | 
				
			||||||
bindkey -s '^j'   '^atime ^m'                         # ctrl + j
 | 
					bindkey -s '^j'   '^atime ^m'                         # ctrl + j
 | 
				
			||||||
# }}}
 | 
					# }}}
 | 
				
			||||||
 | 
					# {{{ functions
 | 
				
			||||||
 | 
					gdiff() { /usr/bin/git diff --color "$@"; }
 | 
				
			||||||
 | 
					gdf()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    local fancydiff='/usr/bin/diff-so-fancy'
 | 
				
			||||||
 | 
					    local githighlight='/usr/share/git/diff-highlight/diff-highlight'
 | 
				
			||||||
 | 
					    if [[ -x ${fancydiff} ]]; then
 | 
				
			||||||
 | 
					        gdiff "$@" | ${fancydiff} | less --tabs=4 -RSFX
 | 
				
			||||||
 | 
					    elif [[ -x ${githighlight} ]]; then
 | 
				
			||||||
 | 
					        gdiff "$@" | ${githighlight} | less --tabs=4 -RSFX
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        gdiff "$@"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					# }}}
 | 
				
			||||||
# {{{ aliases
 | 
					# {{{ aliases
 | 
				
			||||||
alias less='command less -R'
 | 
					alias less='command less -R'
 | 
				
			||||||
alias ltail='command less -R +F'
 | 
					alias ltail='command less -R +F'
 | 
				
			||||||
| 
						 | 
					@ -181,13 +196,6 @@ fi
 | 
				
			||||||
alias rscreen='command screen -Dr'
 | 
					alias rscreen='command screen -Dr'
 | 
				
			||||||
alias scr='command screen sudo -Es'
 | 
					alias scr='command screen sudo -Es'
 | 
				
			||||||
# }}}
 | 
					# }}}
 | 
				
			||||||
# {{{ plugins and traps
 | 
					 | 
				
			||||||
#plugins="${HOME}/.bashplugins"
 | 
					 | 
				
			||||||
#[[ -r "${plugins}" && "$BASH_VERSINFO" -ge 4 ]] && . "${plugins}"
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
## we want to see exit code on error (it also has to be the last entry here)
 | 
					 | 
				
			||||||
#trap 'printf "${red}>>${reset} ${bold}exit${reset} ${red}%s${reset}\n" "$?" >&2' ERR
 | 
					 | 
				
			||||||
# }}}
 | 
					 | 
				
			||||||
# {{{ global aliases
 | 
					# {{{ global aliases
 | 
				
			||||||
alias -g L='| less -R'
 | 
					alias -g L='| less -R'
 | 
				
			||||||
alias -g H='| head'
 | 
					alias -g H='| head'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue