mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-18 08:13:40 -05:00
Updated Examples (markdown)
27
Examples.md
27
Examples.md
@@ -142,31 +142,20 @@ builtin bind '"\C-r": "\C-x1\e^\er"'
|
||||
# Toggle bash options (set and shopt)
|
||||
|
||||
BOLD=$(tput bold || tput md)
|
||||
#RESET=$(tput sgr0 || tput me)
|
||||
RESET=$(tput sgr0 || tput me)
|
||||
GREEN=$(tput setaf 2 || tput AF 2)
|
||||
RED=$(tput setaf 1)
|
||||
RED=$(tput setaf 1 || tput AF 1)
|
||||
#WHITE=$(tput setaf 7 || tput AF 7)
|
||||
|
||||
while read -r b o n _
|
||||
do
|
||||
case $b in
|
||||
shopt)
|
||||
if [[ $o == -u ]]
|
||||
then
|
||||
shopt -s "$n"
|
||||
else
|
||||
shopt -u "$n"
|
||||
fi
|
||||
;;
|
||||
set)
|
||||
if [[ $o == \+o ]]
|
||||
then
|
||||
set -o "$n"
|
||||
else
|
||||
set +o "$n"
|
||||
fi
|
||||
;;
|
||||
case "${b}${o}" in
|
||||
"set+o") set -o "$n" ;;
|
||||
"set-o") set +o "$n" ;;
|
||||
"shopt-s") shopt -u "$n" ;;
|
||||
"shopt-u") shopt -s "$n" ;;
|
||||
esac
|
||||
printf ${RESET}
|
||||
done < <(
|
||||
< <(shopt -p ; shopt -op) sed "
|
||||
/ -[so] / {
|
||||
|
||||
Reference in New Issue
Block a user