Skip to content

Instantly share code, notes, and snippets.

@erickpatrick
Created November 10, 2018 00:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erickpatrick/eaf41cd252f82cdc13a6f4413cfea764 to your computer and use it in GitHub Desktop.
Save erickpatrick/eaf41cd252f82cdc13a6f4413cfea764 to your computer and use it in GitHub Desktop.
my ZSHCONFIG
export PATH=/usr/local/bin:$PATH
# If you come from bash you might have to change your $PATH.
export ZSH="/Users/<user>/.oh-my-zsh"
ZSH_THEME="agnoster"
export UPDATE_ZSH_DAYS=7
plugins=(
git
)
source $ZSH/oh-my-zsh.sh
export LANG=en_US.UTF-8
export EDITOR='nvim'
export SSH_KEY_PATH="~/.ssh/rsa_id"
alias zshconfig="nvim ~/.zshrc"
alias ohmyzsh="nvim ~/.oh-my-zsh"
prompt_context() {}
prompt_dir() {
prompt_segment blue black '%c'
}
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
function ffz() {
fzf --preview '[[ $(file --mime {}) =~ binary ]] &&
echo {} is a binary file ||
(highlight -O ansi -l {} ||
coderay {} ||
rougify {} ||
cat {}) 2> /dev/null | head -500'
}
@erickpatrick
Copy link
Author

The ffz function creates a preview page to the right side of the window so we can see the contents of the file. It also pipes the results through one of three code highlighters: highlight, code ray or rougify, which allows the previews to have Code highlighting as well. Pretty neat!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment