2023-04-01 22:20:34 +02:00
|
|
|
# Do not freeze terminal on Ctrl-S
|
|
|
|
stty -ixon
|
|
|
|
|
|
|
|
# Disable annoying correction prompt
|
|
|
|
unsetopt correct_all
|
|
|
|
|
|
|
|
# Additional keybinds
|
|
|
|
bindkey '^H' backward-kill-word
|
|
|
|
|
|
|
|
allow-any-ptrace() {
|
2023-06-15 15:37:18 +02:00
|
|
|
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope >/dev/null
|
2023-04-01 22:20:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
deny-any-ptrace() {
|
2023-06-15 15:37:18 +02:00
|
|
|
echo 1 | sudo tee /proc/sys/kernel/yama/ptrace_scope >/dev/null
|
2023-04-01 22:20:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
curl-time() {
|
2023-06-15 15:37:18 +02:00
|
|
|
curl -w @- -o /dev/null -s "$@" <<'EOF'
|
|
|
|
time_namelookup: %{time_namelookup} s\n
|
|
|
|
time_connect: %{time_connect} s\n
|
|
|
|
time_appconnect: %{time_appconnect} s\n
|
|
|
|
time_pretransfer: %{time_pretransfer} s\n
|
|
|
|
time_redirect: %{time_redirect} s\n
|
|
|
|
time_starttransfer: %{time_starttransfer} s\n
|
|
|
|
----------\n
|
|
|
|
time_total: %{time_total} s\n
|
2023-04-01 22:20:34 +02:00
|
|
|
EOF
|
|
|
|
}
|
2023-07-04 16:07:43 +02:00
|
|
|
|
|
|
|
__fzf_history_search() {
|
2023-07-05 18:35:55 +02:00
|
|
|
local res="$(fc -l -n 0 | tac | uniq | fzf +s +m -x -e --preview-window=hidden)"
|
2023-07-04 16:07:43 +02:00
|
|
|
|
|
|
|
if [[ $? -eq 0 ]] && [[ ! -z "${res// }" ]]; then
|
|
|
|
BUFFER=$res
|
|
|
|
zle end-of-line
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
autoload __fzf_history_search
|
|
|
|
zle -N __fzf_history_search
|
|
|
|
bindkey '^R' __fzf_history_search
|
2024-08-19 23:25:16 +02:00
|
|
|
|
|
|
|
autoload zmv
|