Compare commits

...

3 Commits

2 changed files with 13 additions and 3 deletions

View File

@ -84,14 +84,16 @@ EOF
integer index=0
if [[ ${#local_build_dirs} -eq 0 ]]; then
error "no build directories found"; return 1
elif [[ ${#local_build_dirs} -eq 1 ]]; then
local_build_dir=${local_build_dirs[1]}
elif [[ ${#local_build_dirs} -gt 1 ]]; then
if command -v fzf &> /dev/null; then
# Use fzf to select a build directory
local max=$(( $( tput lines ) / 2 ))
local best=$(( ${#local_build_dirs} + 5 ))
local best=$(( ${#local_build_dirs} + 3 ))
local_build_dir=$(
printf '%s\n' "${local_build_dir[@]}" $local_build_dirs |
fzf --layout=reverse --info=hidden --border=rounded \
printf '%s\n' "${local_build_dirs[@]}" |
fzf --layout=reverse --info=hidden --border=rounded --tac \
--height=$(( $best < $max ? $best : $max ))
)
if [[ $? -ne 0 ]]; then

8
zshenv
View File

@ -62,6 +62,14 @@ elif command -v vim &> /dev/null; then
fi
export GIT_EDITOR=$EDITOR
if command -v fzf &> /dev/null; then
export FZF_DEFAULT_OPTS='--no-bold
--color=fg:#c5c9c5,fg+:#c5c9c5,bg:#000000,bg+:#393836
--color=hl:#8ea4a2,hl+:#8ea4a2,info:#afaf87,marker:#C8C093
--color=prompt:#C8C093,spinner:#8992a7,pointer:#FF9E3B,header:#87afaf
--color=gutter:#000000,border:#54546D,label:#aeaeae,query:#c5c9c5'
fi
# Use ~/.local for pip installs on macOS
[ "`uname`" = "Darwin" ] && export PYTHONUSERBASE=$HOME/.local