Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Helpful Development Tools

Kevin Chien edited this page Oct 5, 2017 · 2 revisions

Some tools that might be useful for development (mainly for OSX).

Open files from command line using your favorite text editor

  • Atom command line (atom file.js or atom folder_name opens in atom)
    • Note: can also run open -a “Atom” file.js, -a tells your OS which application to use to open, might be a useful command to know that already works on your OS. Same for Sublime Text, but have to type open -a "Sublime Text 2/3" file.js which is kind of a chore, hence...
  • Sublime text command line (same as atom command line, but subl file.js or subl folder_name)

Customize Terminal Look (Macs)

It might be helpful if you customize your terminal to show the current git branch and have colors (which can be themed using Preferences)

Alternative which I have not personally tried: oh my zsh, pre-installs everything for you, just need to run one command to install and don’t need to do the following steps

But if you are interested in my way, here’s how:

Primer:

  • This involves editing your .bash_profile, which you might remember doing for Ruby installation. If you have the command line tools installed, you can run atom ~/.bash_profile to open the file and make edits to it.
  • Basically .bash_profile (. makes it a hidden file) is a bash script that terminal runs everytime it starts up, basically preloading commands and PATH variables (which are essentially variables like where to find installed packages)
  • Every time you make changes to the file, you need to run source ~/.bash_profile so Terminal uses the new updated version.

Copy and paste the following lines to the end of your .bash_profile. Not really going to explain them as I don’t understand it myself that much lol. Remember to run source ~/.bash_profile when you’re done editing.

Git branch in terminal

# Git branch in prompt.
parse_git_branch() {
    git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "

Colors in terminal

# Color
#export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
export PS1="\[\033[33;1m\]\w\[\033[m\]\$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GFh'

Useful for Bash (Macs / Ubuntu Subsystem on Windows)

Shortcuts. Basically, you can use alias to make a shortcut command that stands for something else that takes much longer to type, such as perhaps the PiE website folder, if it's nested in many directories.

# For PiE Website
alias website='cd ~/Documents/Berkeley/PiE/website'