add tmux plugin copycat

This commit is contained in:
2016-07-11 19:51:41 +02:00
parent b4b2ccf447
commit 18a2a14e1d
14 changed files with 947 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
stored_search_not_defined() {
local key="$1"
local search_value="$(tmux show-option -gqv "${COPYCAT_VAR_PREFIX}_${key}")"
[ -z $search_value ]
}
stored_search_vars() {
tmux show-options -g |
\grep -i "^${COPYCAT_VAR_PREFIX}_" |
cut -d ' ' -f1 | # cut just variable names
xargs # splat var names in one line
}
# get the search key from the variable name
get_stored_search_key() {
local search_var="$1"
echo "$(echo "$search_var" | sed "s/^${COPYCAT_VAR_PREFIX}_//")"
}
get_stored_search_pattern() {
local search_var="$1"
echo "$(get_tmux_option "$search_var" "")"
}