diff --git a/home/.zshrc b/home/.zshrc index e22912a..1c8abb3 100644 --- a/home/.zshrc +++ b/home/.zshrc @@ -130,6 +130,7 @@ fi alias pilot="gh copilot" alias ps="gh copilot suggest" alias pe="gh copilot explain" +alias fzfd="fd --type d --hidden --follow --exclude .git | fzf" # Alias functions vif() { @@ -148,6 +149,42 @@ catc() { cat "$1" | wlc } +cdf() { + cd "$(fzfd)" +} + +cpf() { + if [ -z "$1" ]; then + cp "$(fzf)" "$(fzfd)" + else + cp "$(fzf)" "$1" + fi +} + +mvf() { + if [ -z "$1" ]; then + mv "$(fzf)" "$(fzfd)" + else + mv "$(fzf)" "$1" + fi +} + +rmf() { + if [ -z "$1" ]; then + mv "$(fzf)" "$(fzfd)" + else + mv "$(fzf)" "$1" + fi +} + +rmdf() { + if [ -z "$1" ]; then + mv "$(fzf)" "$(fzfd)" + else + mv "$(fzf)" "$1" + fi +} + # Check if tmux is already running or if the session is interactive if [[ -z "$TMUX" ]] && [[ $- == *i* ]]; then # Create a new tmux session, if one doesnt exist, give it the main name, never attach to a session