aboutsummaryrefslogtreecommitdiff
path: root/notes.txt
blob: f254d39360762f1a65f47c47306d8f3bfba9cd19 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function _p9k_on_widget() {
  zle _p9k_orig_$1 "${@:2}"
}

time ( repeat 1000 ( () {
  local tmp=${TMPDIR:-/tmp}/p10k.bindings.$sysparams[pid]
  {
    bindkey >$tmp
    local widget
    for widget in ${(u)${${(f)"$(<$tmp)"}:#*\"}##* }; do
      functions[_p9k_widget_$widget]='_p9k_on_widget '${(q)widget}' "$@"'
      zle -A $widget _p9k_orig_$widget
      zle -N $widget _p9k_widget_$widget
    done
  } always {
    zf_rm -f $tmp
  }
} ) )  # 2.774s

time ( repeat 1000 ( () {} ) )  # 0.960s

Hooks:

  p10k-on-init
  p10k-on-pre-prompt
  p10k-on-post-prompt
  p10k-on-buffer-change

Parameters accessible from hooks:

  P9K_PROMPT=regular|instant
  P9K_TTY=old|new
  P9K_COMMAND (only in p10k-on-post-prompt)