{"_path":"/knowledge-base/ohmyzsh-cheatsheet","_draft":false,"_partial":false,"_empty":false,"title":"Oh my ZSH: Cheatsheet","description":"","excerpt":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"oh-my-zsh-cheatsheet"},"children":[{"type":"text","value":"Oh my ZSH: Cheatsheet"}]},{"type":"element","tag":"h2","props":{"id":"open-config-in-vscode"},"children":[{"type":"text","value":"Open config in vscode"}]},{"type":"element","tag":"code","props":{"code":"code ~/.zshrc\n"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"code ~/.zshrc\n"}]}]}]},{"type":"element","tag":"h2","props":{"id":"useful-aliases"},"children":[{"type":"text","value":"Useful aliases"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Switch to home folder"}]},{"type":"element","tag":"code","props":{"code":"alias home=\"cd /Users/USERNAME/\"\n","language":"sh"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"alias home=\"cd /Users/USERNAME/\"\n"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Open zsh config within VSCode"}]},{"type":"element","tag":"code","props":{"code":"alias zshconfig=\"code ~/.zshrc\"\n","language":"sh"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"alias zshconfig=\"code ~/.zshrc\"\n"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Reload zsh config without closing terminal"}]},{"type":"element","tag":"code","props":{"code":"alias zshreload=\"source ~/.zshrc\"\n","language":"sh"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"alias zshreload=\"source ~/.zshrc\"\n"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Copy SSH key to clipboard"}]},{"type":"element","tag":"code","props":{"code":"alias sshkey=\"cat ~/.ssh/id_rsa.pub | pbcopy\"\n","language":"sh"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"alias sshkey=\"cat ~/.ssh/id_rsa.pub | pbcopy\"\n"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Artisan shortcut"}]},{"type":"element","tag":"code","props":{"code":"alias pa=\"php artisan\"\n","language":"sh"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"alias pa=\"php artisan\"\n"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Git shortcuts"}]},{"type":"element","tag":"code","props":{"code":"alias ga=\"git add .\"\nalias gc=\"git commit -m\"\n","language":"sh"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"alias ga=\"git add .\"\nalias gc=\"git commit -m\"\n"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"npm watcher shortcut"}]},{"type":"element","tag":"code","props":{"code":"alias nrw=\"npm run watch\"\n","language":"sh"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"alias nrw=\"npm run watch\"\n"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Copies the .env.example to .env:"}]},{"type":"element","tag":"code","props":{"code":"alias cpenv=\"cp .env.example .env\"\n","language":"sh"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"alias cpenv=\"cp .env.example .env\"\n"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Shorthand to create a new mysql database based on input:"}]},{"type":"element","tag":"code","props":{"code":"db:new(){\n  mysql --user=YOURROOTUSER --password=ROOTUSERPASSWORD -e \"create database $1\"\n}\n","language":"sh"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"db:new(){\n  mysql --user=YOURROOTUSER --password=ROOTUSERPASSWORD -e \"create database $1\"\n}\n"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Shorthand to create a new laravel project, setup a dabtase with the same name and open the project in VS Code."}]},{"type":"element","tag":"ul","props":{},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"requires the "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"code"}]},{"type":"text","value":" command from VS Code"}]}]},{"type":"element","tag":"code","props":{"code":"aw:new(){\n  laravel new $1 && mysql --user=YOURROOTUSER --password=ROOTUSERPASSWORD -e \"create database $1\" && code $1\n}\n","language":"sh"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"aw:new(){\n  laravel new $1 && mysql --user=YOURROOTUSER --password=ROOTUSERPASSWORD -e \"create database $1\" && code $1\n}\n"}]}]}]}]},"public":true,"body":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"oh-my-zsh-cheatsheet"},"children":[{"type":"text","value":"Oh my ZSH: Cheatsheet"}]},{"type":"element","tag":"h2","props":{"id":"open-config-in-vscode"},"children":[{"type":"text","value":"Open config in vscode"}]},{"type":"element","tag":"code","props":{"code":"code ~/.zshrc\n"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{}},"children":[{"type":"text","value":"code ~/.zshrc"}]}]}]}]}]},{"type":"element","tag":"h2","props":{"id":"useful-aliases"},"children":[{"type":"text","value":"Useful aliases"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Switch to home folder"}]},{"type":"element","tag":"code","props":{"code":"alias home=\"cd /Users/USERNAME/\"\n","language":"sh"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#79C0FF"}},"children":[{"type":"text","value":"alias"}]},{"type":"element","tag":"span","props":{"style":{"color":"#C9D1D9"}},"children":[{"type":"text","value":" home="}]},{"type":"element","tag":"span","props":{"style":{"color":"#A5D6FF"}},"children":[{"type":"text","value":"\"cd /Users/USERNAME/\""}]}]}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Open zsh config within VSCode"}]},{"type":"element","tag":"code","props":{"code":"alias zshconfig=\"code ~/.zshrc\"\n","language":"sh"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#79C0FF"}},"children":[{"type":"text","value":"alias"}]},{"type":"element","tag":"span","props":{"style":{"color":"#C9D1D9"}},"children":[{"type":"text","value":" zshconfig="}]},{"type":"element","tag":"span","props":{"style":{"color":"#A5D6FF"}},"children":[{"type":"text","value":"\"code ~/.zshrc\""}]}]}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Reload zsh config without closing terminal"}]},{"type":"element","tag":"code","props":{"code":"alias zshreload=\"source ~/.zshrc\"\n","language":"sh"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#79C0FF"}},"children":[{"type":"text","value":"alias"}]},{"type":"element","tag":"span","props":{"style":{"color":"#C9D1D9"}},"children":[{"type":"text","value":" zshreload="}]},{"type":"element","tag":"span","props":{"style":{"color":"#A5D6FF"}},"children":[{"type":"text","value":"\"source ~/.zshrc\""}]}]}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Copy SSH key to clipboard"}]},{"type":"element","tag":"code","props":{"code":"alias sshkey=\"cat ~/.ssh/id_rsa.pub | pbcopy\"\n","language":"sh"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#79C0FF"}},"children":[{"type":"text","value":"alias"}]},{"type":"element","tag":"span","props":{"style":{"color":"#C9D1D9"}},"children":[{"type":"text","value":" sshkey="}]},{"type":"element","tag":"span","props":{"style":{"color":"#A5D6FF"}},"children":[{"type":"text","value":"\"cat ~/.ssh/id_rsa.pub | pbcopy\""}]}]}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Artisan shortcut"}]},{"type":"element","tag":"code","props":{"code":"alias pa=\"php artisan\"\n","language":"sh"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#79C0FF"}},"children":[{"type":"text","value":"alias"}]},{"type":"element","tag":"span","props":{"style":{"color":"#C9D1D9"}},"children":[{"type":"text","value":" pa="}]},{"type":"element","tag":"span","props":{"style":{"color":"#A5D6FF"}},"children":[{"type":"text","value":"\"php artisan\""}]}]}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Git shortcuts"}]},{"type":"element","tag":"code","props":{"code":"alias ga=\"git add .\"\nalias gc=\"git commit -m\"\n","language":"sh"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#79C0FF"}},"children":[{"type":"text","value":"alias"}]},{"type":"element","tag":"span","props":{"style":{"color":"#C9D1D9"}},"children":[{"type":"text","value":" ga="}]},{"type":"element","tag":"span","props":{"style":{"color":"#A5D6FF"}},"children":[{"type":"text","value":"\"git add .\""}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#79C0FF"}},"children":[{"type":"text","value":"alias"}]},{"type":"element","tag":"span","props":{"style":{"color":"#C9D1D9"}},"children":[{"type":"text","value":" gc="}]},{"type":"element","tag":"span","props":{"style":{"color":"#A5D6FF"}},"children":[{"type":"text","value":"\"git commit -m\""}]}]}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"npm watcher shortcut"}]},{"type":"element","tag":"code","props":{"code":"alias nrw=\"npm run watch\"\n","language":"sh"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#79C0FF"}},"children":[{"type":"text","value":"alias"}]},{"type":"element","tag":"span","props":{"style":{"color":"#C9D1D9"}},"children":[{"type":"text","value":" nrw="}]},{"type":"element","tag":"span","props":{"style":{"color":"#A5D6FF"}},"children":[{"type":"text","value":"\"npm run watch\""}]}]}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Copies the .env.example to .env:"}]},{"type":"element","tag":"code","props":{"code":"alias cpenv=\"cp .env.example .env\"\n","language":"sh"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#79C0FF"}},"children":[{"type":"text","value":"alias"}]},{"type":"element","tag":"span","props":{"style":{"color":"#C9D1D9"}},"children":[{"type":"text","value":" cpenv="}]},{"type":"element","tag":"span","props":{"style":{"color":"#A5D6FF"}},"children":[{"type":"text","value":"\"cp .env.example .env\""}]}]}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Shorthand to create a new mysql database based on input:"}]},{"type":"element","tag":"code","props":{"code":"db:new(){\n  mysql --user=YOURROOTUSER --password=ROOTUSERPASSWORD -e \"create database $1\"\n}\n","language":"sh"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#D2A8FF"}},"children":[{"type":"text","value":"db:new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#C9D1D9"}},"children":[{"type":"text","value":"(){"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#C9D1D9"}},"children":[{"type":"text","value":"  mysql --user=YOURROOTUSER --password=ROOTUSERPASSWORD -e "}]},{"type":"element","tag":"span","props":{"style":{"color":"#A5D6FF"}},"children":[{"type":"text","value":"\"create database "}]},{"type":"element","tag":"span","props":{"style":{"color":"#C9D1D9"}},"children":[{"type":"text","value":"$1"}]},{"type":"element","tag":"span","props":{"style":{"color":"#A5D6FF"}},"children":[{"type":"text","value":"\""}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#C9D1D9"}},"children":[{"type":"text","value":"}"}]}]}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Shorthand to create a new laravel project, setup a dabtase with the same name and open the project in VS Code."}]},{"type":"element","tag":"ul","props":{},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"requires the "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"code"}]},{"type":"text","value":" command from VS Code"}]}]},{"type":"element","tag":"code","props":{"code":"aw:new(){\n  laravel new $1 && mysql --user=YOURROOTUSER --password=ROOTUSERPASSWORD -e \"create database $1\" && code $1\n}\n","language":"sh"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#D2A8FF"}},"children":[{"type":"text","value":"aw:new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#C9D1D9"}},"children":[{"type":"text","value":"(){"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#C9D1D9"}},"children":[{"type":"text","value":"  laravel new $1 "}]},{"type":"element","tag":"span","props":{"style":{"color":"#FF7B72"}},"children":[{"type":"text","value":"&&"}]},{"type":"element","tag":"span","props":{"style":{"color":"#C9D1D9"}},"children":[{"type":"text","value":" mysql --user=YOURROOTUSER --password=ROOTUSERPASSWORD -e "}]},{"type":"element","tag":"span","props":{"style":{"color":"#A5D6FF"}},"children":[{"type":"text","value":"\"create database "}]},{"type":"element","tag":"span","props":{"style":{"color":"#C9D1D9"}},"children":[{"type":"text","value":"$1"}]},{"type":"element","tag":"span","props":{"style":{"color":"#A5D6FF"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#C9D1D9"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#FF7B72"}},"children":[{"type":"text","value":"&&"}]},{"type":"element","tag":"span","props":{"style":{"color":"#C9D1D9"}},"children":[{"type":"text","value":" code $1"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#C9D1D9"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}],"toc":{"title":"","searchDepth":2,"depth":2,"links":[{"id":"open-config-in-vscode","depth":2,"text":"Open config in vscode"},{"id":"useful-aliases","depth":2,"text":"Useful aliases"}]}},"_type":"markdown","_id":"content:04.knowledge-base:ohmyzsh-cheatsheet.md","_source":"content","_file":"04.knowledge-base/ohmyzsh-cheatsheet.md","_extension":"md"}