Skip to content

Instantly share code, notes, and snippets.

@eduardoarandah
Last active December 5, 2020 01:01
Show Gist options
  • Save eduardoarandah/c0196e936b219dda208a9cd9e3f5fb21 to your computer and use it in GitHub Desktop.
Save eduardoarandah/c0196e936b219dda208a9cd9e3f5fb21 to your computer and use it in GitHub Desktop.
Linux shortcuts, navigate to favorite directories with fuzzy search (requires fzf)
#####################
# 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