Created
March 3, 2019 10:55
-
-
Save azak-azkaran/bca70493d926bce3ce3ac4452ebf0d8b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup fzf | |
# --------- | |
if [[ ! "$PATH" == */home/azak/.fzf/bin* ]]; then | |
export PATH="$PATH:/home/azak/.fzf/bin" | |
fi | |
# Auto-completion | |
# --------------- | |
[[ $- == *i* ]] && source "/home/azak/.fzf/shell/completion.zsh" 2> /dev/null | |
# Key bindings | |
# ------------ | |
source "/home/azak/.fzf/shell/key-bindings.zsh" | |
_gen_fzf_default_opts() { | |
local base03="234" | |
local base02="235" | |
local base01="240" | |
local base00="241" | |
local base0="244" | |
local base1="245" | |
local base2="254" | |
local base3="230" | |
local yellow="136" | |
local orange="166" | |
local red="160" | |
local magenta="125" | |
local violet="61" | |
local blue="33" | |
local cyan="37" | |
local green="64" | |
#Comment and uncomment below for the light theme. | |
# Solarized Dark color scheme for fzf | |
export FZF_DEFAULT_OPTS=" | |
--color fg:-1,bg:-1,hl:$blue,fg+:$base2,bg+:$base02,hl+:$blue | |
--color info:$yellow,prompt:$yellow,pointer:$base3,marker:$base3,spinner:$yellow | |
" | |
## Solarized Light color scheme for fzf | |
#export FZF_DEFAULT_OPTS=" | |
# --color fg:-1,bg:-1,hl:$blue,fg+:$base02,bg+:$base2,hl+:$blue | |
# --color info:$yellow,prompt:$yellow,pointer:$base03,marker:$base03,spinner:$yellow | |
#" | |
} | |
_gen_fzf_default_opts | |
# --files: List files that would be searched but do not search | |
# --no-ignore: Do not respect .gitignore, etc... | |
# --hidden: Search hidden files and folders | |
# --follow: Follow symlinks | |
# --glob: Additional conditions for search (in this case ignore everything in the .git/ folder) | |
export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow --glob "!.git/*"' | |
# Setting fd as the default source for fzf | |
#export FZF_DEFAULT_COMMAND='fd --type f' | |
#export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" | |
#export FZF_ALT_C_COMMAND="$FZF_DEFAULT_COMMAND" | |
export FZF_CTRL_T_COMMAND='fd --type f' | |
export FZF_ALT_C_COMMAND='fd --type f' | |
export FZF_DEFAULT_OPTS='--preview "head -100 {}"' | |
#--color fg:242,bg:236,hl:65,fg:15,bg:239,hl+:108 | |
#--color info:108,prompt:109,spinner:108,pointer:168,marker:168' | |
# To apply the command to CTRL-T as well | |
#export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment