Skip to content

aghwotu/aliases

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 

Repository files navigation

aliases

My personal aliases. You will notice that sometimes there are two aliases for the same command. I do this because sometimes I remember one and forget the other so I have them both depending on whichever one I remember.

Recommendation

My personal rule for aliases is that they can be as long or as short as you want them to be as long they help you to be more efficient.

Adding aliases to your terminal

I LOVE using aliases and for Windows I use the 'cmder' terminal and on macOS I use 'iTerm' and 'zsh'. I saw a neat trick today - May, 15 2021. Add the path to your alias file as an alias.

I use VSCode and my alias file on Windows is at C:/tools/cmder/config/user_aliases.cmd. Now, create a new alias called add_alias and add it to your alias file like so:

add_alias= code /tools/cmder/config/user_aliases.cmd

Now, whenever you type add_alias in your terminal, it would open your user_aliases.cmd file in VSCode and you can add your new aliases.

NOTICE: Please take note of the differences between the syntax for the macOS and Windows aliases.

macOS alias syntax

alias cl="clear"

Windows alias syntax

cl=clear

System - macOS only

alias add_alias="code ~/.zshrc"
alias add_new_alias="code ~/.zshrc"
alias cl="clear"
alias new_alias="code ~/.zshrc"
alias show_variables="printenv"

System - Windows only

cl=clear
e.=explorer .
root=cd C:\

Aliases configuration

ref=alias /reload
add_new_alias= code /tools/cmder/config/user_aliases.cmd
add_alias= code /tools/cmder/config/user_aliases.cmd
new_alias= code /tools/cmder/config/user_aliases.cmd

Code folder navigation aliases

gocode=cd C:\code
codefiles=cd C:\code

Folder creation aliases

mkcd=mkdir "$1" && cd "$1"

Laravel - macOS

alias art="php artisan"
alias server="php artisan serve"
alias tinker="php artisan tinker"

Laravel - Windows

art=php artisan $*
server=php artisan serve
tinker=php artisan tinker

Git - macOS

alias gs="git status"
alias gc="git commit"
alias grab="git branch -a"
alias gp="git push origin master"
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias gd="git diff"
alias git_edit_origin="git remote set-url origin"
alias git_add_origin="git remote add origin"
alias grab_all_branches="git remote update"
alias grab_remote_branches="git remote update"
alias gcl="git clone"

Git - Windows

ga=git add $*
gc=git commit $*
gcl=git clone $*
gs=git status
grab=git branch -a
git_edit_origin=git remote set-url origin $*
git_add_origin=git remote add origin $*
grab_all_branches=git remote update
grab_remote_branches=git remote update

MongoDB - macOS only

alias start_mongo="brew services start [email protected]"
alias mongo_start="brew services start [email protected]"
alias stop_mongo="brew services stop [email protected]"
alias mongo_stop="brew services stop [email protected]"
alias end_mongo="brew services stop [email protected]"
alias mongo_config="code /System/Volumes/Data/opt/homebrew/etc/mongod.conf"

About

A collection of the aliases I use

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published