Last active
December 5, 2020 01:01
-
-
Save eduardoarandah/c0196e936b219dda208a9cd9e3f5fb21 to your computer and use it in GitHub Desktop.
Linux shortcuts, navigate to favorite directories with fuzzy search (requires fzf)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##################### | |
# Directory shortcuts | |
##################### | |
# | |
# Navigate to favorite directories with fuzzy search | |
# Requires fzf | |
# | |
# `sc` mark current dir | |
# `s` go to mark | |
# `scr` remove mark | |
mkdir -p ~/shortcuts | |
alias sc='ln -s $(pwd) ~/shortcuts/${$(pwd)//[\/]/_}' | |
alias scr='SHORTCUT=$(ls ~/shortcuts | fzf) && rm ~/shortcuts/$SHORTCUT && echo "$SHORTCUT removed"' | |
alias s='SHORTCUT=$(ls ~/shortcuts | fzf) && cd -P ~/shortcuts/$SHORTCUT && echo $(pwd)' | |
# shorter version: alias sc='ln -s $(pwd) ~/shortcuts/$(basename "$(pwd)")' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment