blob: a7f806710c94bbf1272ceff1665440d3544be0d5 (
plain)
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
|
# Surround line in variable
surround_in_var() {
BUFFER=" \"\$($BUFFER)\""
zle beginning-of-line
}
zle -N surround_in_var
bindkey '\ev' surround_in_var
# Insert output from the previous command
zmodload -i zsh/parameter
insert-last-command-output() {
LBUFFER+="$(eval $history[$((HISTCMD - 1))])"
}
zle -N insert-last-command-output
bindkey "^Xl" insert-last-command-output
toggle_prompt() {
local new_prompt=' $ '
if [ "$PS1" = "$new_prompt" ]; then
eval "$(starship init zsh)"
else
PS1="$new_prompt"
fi
zle clear-screen
}
zle -N toggle_prompt
bindkey '\ep' toggle_prompt
bindkey -s '\eF' "tmux-sessionizer\n"
|