Skip to content

nathanchapman/bash-functions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”ฎ bash-functions

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.

Usage

๐Ÿ“ฆ Open a module on npmjs.com

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>

๐Ÿค– Clone any repo and ๐Ÿšš cd into it

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

๐Ÿด Fork a GitHub repo

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

๐Ÿ™ Open GitHub

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

๐Ÿ”ƒ Open the pull requests for a repo

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

โœ๏ธ Create a pull request for a 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>

๐Ÿ”ฌ Review and test a pull request for a repo

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

๐Ÿ’ป iTerm2 Touch Bar Support

iTerm2 Touch Bar

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 ๐Ÿ˜Ž.

Npm

Label: ๐Ÿ“ฆ

Action: Send Text with "vim" Special Chars

npmjs\r

Clone

Label: ๐Ÿค–

Action: Send Text

clone YourOrg

VS Code / Atom / Sublime

Label: ๐Ÿšง or ๐Ÿ”ญ or ๐Ÿ‘ฉโ€๐Ÿ’ป or ๐Ÿ‘จโ€๐Ÿ’ป or โš›๏ธ

Action: Send Text with "vim" Special Chars

code .\r or atom .\r or subl .\r

Git Pull

Label: ๐Ÿ‘‡

Action: Send Text with "vim" Special Chars

git pull\r

Git Push

Label: ๐Ÿ‘†

Action: Send Text

git push

GitHub

Label: ๐Ÿ™

Action: Send Text with "vim" Special Chars

github\r

Git Status

Label: ๐Ÿ“Ÿ

Action: Send Text with "vim" Special Chars

gst\r

Npm Install

Label: ๐Ÿ“€

Action: Send Text with "vim" Special Chars

npm i\r

Npm Start

Label: โšก๏ธ or ๐Ÿ

Action: Send Text with "vim" Special Chars

npm start\r

Npm Test

Label: ๐Ÿ”ฌ

Action: Send Text with "vim" Special Chars

npm t\r

Draft PR

Label: โœ๏ธ

Action: Send Text with "vim" Special Chars

pr\r

View PRs

Label: ๐Ÿ”ƒ

Action: Send Text with "vim" Special Chars

pulls\r

Spotify Play/Pause

NOTE: Requires shpotify.

Label: ๐ŸŽธ or ๐ŸŽง or ๐ŸŽต or ๐ŸŽท

Action: Send Text with "vim" Special Chars

spotify pause\r

Sponsorship ๐ŸŽ—

If you found this project useful, please consider becoming a sponsor on GitHub.

Releases

No releases published

Packages

No packages published

Languages