diff --git a/.config/zsh/functions.zsh b/.config/zsh/functions.zsh index beaf727..d76b1dc 100755 --- a/.config/zsh/functions.zsh +++ b/.config/zsh/functions.zsh @@ -1,31 +1,4 @@ #!/bin/sh - -# Cd into a directory using fzf -fcd () { - dir=$(fd -a --type d --hidden --exclude ".git|.github" --color=never | fzf --prompt "Choose directory: ") - [ -z $dir ] && return 1 - cd $dir -} - -# Cd into specific repo -fr () { - dir=$(fd . ~/repos --maxdepth 1 -a --type d --hidden --exclude ".git|.github" --color=never | fzf --prompt "Choose directory: ") - [ -z $dir ] && return 1 - cd $dir -} - -# Remove choosed stuff -frm () { - remove=$(fd --hidden --maxdepth 1 --color=never | fzf -m --prompt "Choose to delete: ") - [ -z $remove ] && return 1 - rm -rf $(printf '%s' $remove) -} - -# Quicly choose stuff to add using fzf -fga () { - git add $(git status -s | awk '{ print $2 }' | fzf -m) -} - # Open a script in path with vim quicly vish () { nvim $(which $1) @@ -67,11 +40,6 @@ vf(){ --preview 'bat --color=always --style=plain --pager=never {}' | xargs -r $EDITOR } -# history search -h() { - print -z $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac | sed -E 's/ *[0-9]*\*? *//' | sed -E 's/\\/\\\\/g') -} - # Copy current working directory cpdir() { pwd | tr -d "\r\n" | xclip -sel c @@ -82,11 +50,6 @@ cf() { cat $1 | xclip -sel c } -# Open a bookmark from buku in browser -fb() { - buku --nostdin -p -f5 | fzf | cut -f1 | xargs -r buku --nostdin -o -} - # Extract all archive in current path and remove the archive erm() { for file in *.zip; do