mirror of
https://github.com/kazhala/dotbare
synced 2024-11-08 07:10:24 +00:00
34 lines
852 B
Bash
34 lines
852 B
Bash
#!/bin/bash
|
|
#
|
|
# check env variables and set default variables
|
|
#
|
|
# @params
|
|
# Globals
|
|
# ${DOTBARE_DIR}: string, location of the bare repo
|
|
# ${DOTBARE_TREE}: string, which folder is the bare repo tracking
|
|
# ${DOTBARE_KEY}: string, defualt key bindings
|
|
# ${FZF_DEFAULT_OPTS}: string, update FZF_DEFAULT_OPTS to reflect dotbare changes
|
|
# ${DOTBARE_FZF_DEFAULT_OPTS}: string, user custom setting for dotbare
|
|
|
|
[[ -z "${DOTBARE_DIR}" ]] && DOTBARE_DIR="$HOME/.cfg/"
|
|
[[ -z "${DOTBARE_TREE}" ]] && DOTBARE_TREE="$HOME"
|
|
if [[ -z "${DOTBARE_KEY}" ]]; then
|
|
DOTBARE_KEY="
|
|
--bind=alt-a:toggle-all
|
|
--bind=alt-w:jump
|
|
--bind=alt-0:top
|
|
--bind=alt-o:clear-query
|
|
--bind=alt-s:toggle-sort
|
|
--bind=alt-t:toggle-preview
|
|
"
|
|
fi
|
|
|
|
FZF_DEFAULT_OPTS="
|
|
$FZF_DEFAULT_OPTS
|
|
--ansi
|
|
--cycle
|
|
--exit-0
|
|
$DOTBARE_FZF_DEFAULT_OPTS
|
|
$DOTBARE_KEY
|
|
"
|