A collection of useful Bash/ZSH functions. Just drop the functions from .bashrc at the end of your .bashrc
or .zshrc
. These work great with the MacBook touch bar and iTerm2.
From anywhere:
npmjs # opens npmjs.com
npmjs <module> # opens npmjs.com for npm module <module>
From a git repo:
npmjs # opens npmjs.com for npm module <git-repo>
From anywhere:
clone url # clone a repo from any git URL and cd into it
clone org repo # clone a repo from GitHub and cd into it
clone org/repo # clone a repo from GitHub and cd into it
From anywhere:
ghfork url # fork a repo from any GitHub URL and cd into it
ghfork org repo # fork from GitHub and cd into it
ghfork org/repo # fork from GitHub and cd into it
From anywhere:
github # opens GitHub
github org # opens GitHub for org
github org/repo # opens GitHub for org/repo
github org repo # opens GitHub for org/repo
From a git repo:
github # opens this repo in GitHub for current branch
github <branch> # opens this repo in GitHub for specified branch
From anywhere:
pulls # opens GitHub for all pull requests for user
pulls org repo # opens GitHub for all pull requests for org/repo
From a git repo:
pulls # opens GitHub for all pull requests for this repo
From anywhere:
pr <org> <repo> <base> <branch> # opens GitHub to draft a pull request in org/repo to merge <branch> into <base>
From a git repo:
pr # opens GitHub to draft a pull request in this repo to merge the current branch into master
pr <base> # opens GitHub to draft a pull request in this repo to merge the current branch into <base>
pr <base> <branch> # opens GitHub to draft a pull request in this repo to merge <branch> into <base>
From a git repo:
review <number> # checks out PR #<number> into a local branch named <number> for review/testing
review <number> <branch> # checks out PR #<number> into a local branch named <branch> for review/testing
In iTerm2, navigate to Preferences
> Keys
and Add Touch Bar Item
for each of the following items. After, navigate to the View
dropdown > Customize Touch Bar...
and drag them where you'd like ๐.
Label: ๐ฆ
Action: Send Text with "vim" Special Chars
npmjs\r
Label: ๐ค
Action: Send Text
clone YourOrg
Label: ๐ง
or ๐ญ
or ๐ฉโ๐ป
or ๐จโ๐ป
or โ๏ธ
Action: Send Text with "vim" Special Chars
code .\r
or atom .\r
or subl .\r
Label: ๐
Action: Send Text with "vim" Special Chars
git pull\r
Label: ๐
Action: Send Text
git push
Label: ๐
Action: Send Text with "vim" Special Chars
github\r
Label: ๐
Action: Send Text with "vim" Special Chars
gst\r
Label: ๐
Action: Send Text with "vim" Special Chars
npm i\r
Label: โก๏ธ
or ๐
Action: Send Text with "vim" Special Chars
npm start\r
Label: ๐ฌ
Action: Send Text with "vim" Special Chars
npm t\r
Label: โ๏ธ
Action: Send Text with "vim" Special Chars
pr\r
Label: ๐
Action: Send Text with "vim" Special Chars
pulls\r
NOTE: Requires shpotify.
Label: ๐ธ
or ๐ง
or ๐ต
or ๐ท
Action: Send Text with "vim" Special Chars
spotify pause\r
If you found this project useful, please consider becoming a sponsor on GitHub.