summaryrefslogtreecommitdiff
path: root/rc/prelude.sh
blob: 1e9c4b55f1c60bda385ffc3159de5d4819319dd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
kak_escape() {
  for text do
    printf "'"
    while true; do
      case "$text" in
        *"'"*)
          head=${text%%"'"*}
          tail=${text#*"'"}
          printf "%s''" "$head"
          text=$tail
          ;;
        *)
          printf "%s' " "$text"
          break
          ;;
      esac
    done
  done
  printf "${KAK_ESCAPE_EOF:-\n}"
}