• 0 Posts
  • 7 Comments
Joined 11 months ago
cake
Cake day: August 9th, 2023

help-circle





  • Agreed, fzf (and similar fuzzy finders) have been a game-changer with regards to the way in which I navigate the shell. Add in a couple of one-liners and I’m never more than a second away from any nested directory

    Here are some of the most used aliases in my configs if anyone would like to try it out

    Note that they use fd and exa but they can easily be swapped out for find and ls if those aren’t available on your system (which would allow for shorter aliases since they’re the fzf defaults IIRC)

    alias update-cdd='fd -Ha -td -d1 -E "\.config" -E "\.local" "^\." ~ > ~/.cddignore'
    
    alias cdd='cd "$(fd -H -td --ignore-file ~/.cddignore . ~ | fzf --preview "exa -lF --no-permissions {}" --tiebreak=length,end,begin --preview-window=up,20%)"'
    
    alias cdf='cd "$(fd -H -tf --ignore-file ~/.cddignore . ~ | fzf --preview "bat --style=header-filename,header-filesize -r 40: --color=always {}" --tiebreak=length,end,begin --preview-window=up,20% | xargs dirname)"'