Skip to content

Instantly share code, notes, and snippets.

@scarolan
Created August 7, 2020 18:59
Show Gist options
  • Save scarolan/520a91f39817383b3d6614e7a2fb99cd to your computer and use it in GitHub Desktop.
Save scarolan/520a91f39817383b3d6614e7a2fb99cd to your computer and use it in GitHub Desktop.
zsh_stuff
# Aliases
alias ls='lsd'
alias l='ls -l'
alias la='ls -a'
alias lla='ls -la'
alias lt='ls --tree'
alias e='explorer.exe'
# Useful cd paths
setopt auto_cd
cdpath=(/mnt/c/Users/sean $HOME/git_repos)
# Set executable path
export PATH=$HOME/bin:/usr/local/bin:$PATH
# Functions
# Saves the last command as a function
slc() {
last_command=$(fc -nl | tail -1)
command_name="$1"
read -r -d '' new_fun <<EOF
${command_name}() {
$last_command
}
EOF
eval "$new_fun"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment