1
Fork 0
dots/zsh/zsh-functions

27 lines
547 B
Text
Raw Normal View History

2023-08-21 09:56:16 +00:00
function cc() python -c "from math import *; print($*)"
2024-11-11 21:43:32 +00:00
alias cc='noglob cc'
2023-08-21 09:56:16 +00:00
2023-08-22 23:42:42 +00:00
function save-ssh-key() {
2024-04-14 03:02:45 +00:00
mkdir -p "$HOME/.ssh"
chmod 700 "$HOME/.ssh"
2023-08-22 23:42:42 +00:00
mv "$1" "$HOME/.ssh/${1}_${2}"
2024-04-14 03:02:45 +00:00
if [ -e "$1.pub" ]; then
mv -n "$1.pub" "$HOME/.ssh/${1}_${2}.pub"
fi
2023-08-22 23:42:42 +00:00
}
2023-08-30 02:00:57 +00:00
function find-directory() {
2024-05-05 00:57:59 +00:00
FOLDER=$(fd -t d --hidden | fzf --height="~50%" --reverse)
2023-08-30 02:00:57 +00:00
if [ -n "$FOLDER" ]; then
2023-11-10 10:58:01 +00:00
BUFFER="cd $FOLDER; l"
2023-08-30 02:00:57 +00:00
zle .accept-line
else
zle reset-prompt
fi
}
zle -N find-directory
2023-08-21 09:56:16 +00:00
# vim: filetype=zsh