Skip to content

Terminal aliases for faster and more convenient work with the terminal. Mainly focused on git and terraform work.

License

Notifications You must be signed in to change notification settings

dvir-levy/terminal-aliases

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

terminal-aliases

Terminal aliases for faster and more convenient work with the terminal. Mainly focused on git and terraform work.

Installation

ZSH

Using Oh-my-zsh:

  1. Clone this repository in oh-my-zsh's plugins directory:
git clone https://github.com/dvir-levy/terminal-aliases.git ~/.oh-my-zsh/custom/plugins/terminal-aliases
  1. Activate the plugin in ~/.zshrc
    NOTE: add the plugin last in order so it could overwrite other aliases if any.
plugins=(
  plugin1
  plugin2
  ...
  teminal-aliases
)
  1. Set the WORKSPACE_PATH environment variable to your own workspace directory that include your repos.
    NOTE: The environment variable must be set before the plugins call in ~/.zshrc
export WORKSPACE_PATH=<MY_WORKSPACE>

The following script adds it to the beginning of ~/.zshrc. Make sure to change <MY_WORKSPACE> to your workspaces path.

echo "export WORKSPACE_PATH=<MY_WORKSPACE>" > ~/.zshrc.tmp
echo "" >> ~/.zshrc.tmp
cat ~/.zshrc >> ~/.zshrc.tmp
mv ~/.zshrc.tmp ~/.zshrc

echo "# terminal-aliases plugin" > ~/.zshrc.tmp
echo "" >> ~/.zshrc.tmp
cat ~/.zshrc >> ~/.zshrc.tmp
mv ~/.zshrc.tmp ~/.zshrc

NOTE: the folders structure should be single workspace with several repos in it. for example:

.my-workspace
├──repo1
├──repo2
├──repo3
├──terraform-repo1
└──terraform-repo2
  1. Run exec zsh to take changes into account:
exec zsh

Using zplug:

  1. Add this repo to ~/.zshrc:
zplug "dvir-levy/terminal-aliases", as: plugin

Usage Examples

color picker
  1. git checkout to main/master and pull
gcm
  1. git status
gst
  1. Create new GitHub Pull Request
newpr my_new_pr_name SECURITY-357

NOTE: the branch should be main/master and commit changes should be made locally on master. the alias will makes sure to create new branch and pull request.

  1. 'git add' to all changes, 'git commit' with your custom comment and 'git push' - all together
gam "added debugging methods"
  1. change directory to a repo and show its content
repo1
  1. terraform apply
ta
  1. terraform init + terraform plan
tip

License

This repo is licensed under the terms of the MIT Open Source license and is available for free. Feel free to open pull request and help improve it

About

Terminal aliases for faster and more convenient work with the terminal. Mainly focused on git and terraform work.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages