summaryrefslogtreecommitdiff
path: root/.config/zsh/functions.zsh
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2021-03-20 13:45:32 +0100
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2021-03-20 13:45:32 +0100
commitb8741890ec8922426ca393e181df5769cd53a0f9 (patch)
tree2e7767c72436f1ab3a2895ef085e103cee8beaf3 /.config/zsh/functions.zsh
parent325d75531153da1a317e219f2e5da85abbe7ea48 (diff)
refactor zsh
Diffstat (limited to '.config/zsh/functions.zsh')
-rw-r--r--.config/zsh/functions.zsh16
1 files changed, 16 insertions, 0 deletions
diff --git a/.config/zsh/functions.zsh b/.config/zsh/functions.zsh
index cca1d29..967a2d4 100644
--- a/.config/zsh/functions.zsh
+++ b/.config/zsh/functions.zsh
@@ -11,3 +11,19 @@ function zle-keymap-select {
echo -ne '\e[5 q'
fi
}
+
+
+# Prompt called purs
+function zle-line-init zle-keymap-select {
+ PROMPT=`$HOME/purs/target/release/purs prompt -k "$KEYMAP" -r "$?" --venv "${${VIRTUAL_ENV:t}%-*}"`
+ zle reset-prompt
+}
+zle -N zle-line-init
+zle -N zle-keymap-select
+
+autoload -Uz add-zsh-hook
+
+function _prompt_purs_precmd() {
+ /$HOME/purs/target/release/purs precmd
+}
+add-zsh-hook precmd _prompt_purs_precmd