-
Notifications
You must be signed in to change notification settings - Fork 3
Mac_Terminal
bootstraponline edited this page Jan 8, 2019
·
38 revisions
-
Install iTerm2 stable
-
Install solarized dark iTerm colors.
wget https://raw.github.com/altercation/solarized/master/iterm2-colors-solarized/Solarized%20Dark.itermcolors-
iTerm2→Preferences...→Profiles→Colors→Color Presets...→Import - After importing, manually select
Solarized Darkfrom the drop down list.
-
Instead of ZSH, alternatively use agnoster on bash.
-
Install Oh My ZSH
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
-
Edit
~/.zshrcand update:ZSH_THEME="agnoster"DEFAULT_USER="your_username"plugins=(git)
-
Install powerline font
git clone https://github.com/powerline/fonts.gitcd fonts; ./install.sh-
iTerm2→Preferences...→Profiles→Text→Change Font→Meslo LG M DZ Regular for Powerline- Make sure to uncheck
Use a different font for non-ASCII text. If this is checked, the Git symbols won't render correctly.
- Make sure to uncheck
-
Set default terminal
-
Login shellshould launch zsh with no changes required. - If zsh isn't launched by default, change the value of
commandto/bin/zsh
-
--
Open the Command Palette in visual studio code then type shell command and click Shell Command: Install 'code' command in PATH
$ code ~/.oh-my-zsh/custom/custom.zsh
alias c="$HOME/code"
alias o="code --disable-extensions --reuse-window"
alias zshconfig="o \"$HOME/.zshrc\""
alias zshcustom="o \"$HOME/.oh-my-zsh/custom/custom.zsh\""
alias zshreload=". ~/.zshrc"
alias dd="rm -rf \"$HOME/Library/Developer/Xcode/DerivedData\""
alias ddo="open \"$HOME/Library/Developer/Xcode/DerivedData\""
mc() {
mkdir "$@"
cd "$@"
}
Set any custom exports in zshrc.
$ code ~/.zshrc
# Add brew bins to PATH
export PATH="/usr/local/bin:$PATH"
export PATH="/usr/local/sbin:$PATH"
export GOPATH="$HOME/go"
export PATH="$PATH:$GOPATH/bin"
export PATH="$PATH:`yarn global bin`"
export ANDROID_HOME="$HOME/Library/Android/sdk"
export PATH="$ANDROID_HOME/tools:$PATH"
export PATH="$ANDROID_HOME/tools/bin:$PATH"
export PATH="$ANDROID_HOME/platform-tools:$PATH"
export PATH="$ANDROID_HOME/build-tools/23.0.2:$PATH"
export GRADLE_OPTS="-Dorg.gradle.daemon=true"
export GRADLE_HOME="/usr/local/opt/gradle/libexec"
export JAVA_HOME=$(/usr/libexec/java_home)
brew tap caskroom/versions
brew cask install java8
macOS CI servers may require a symlink
sudo ln -sf $(/usr/libexec/java_home)/bin/java /usr/bin/java
brew install ruby
PATH="$(brew --prefix ruby)/bin:$PATH"
gem update --system --no-document
gem install --no-document bundler fastlane cocoapods
--
ZSH shortcuts:
- Ctrl + U = Clear
- Ctrl + A = Go to start
- Ctrl + E = Go to end
- ⌥← = Back one word (option + left arrow)
- ⌥→ = Forward one word (option + right arrow)
Configure left ⌥ to act as +Esc then add Escape codes for ⌥← and ⌥→
--
Set working directory
Preferences → Profile → General → Working directory.... → Advanced Configuration
-
Working Directory for New Windows→~/code -
Working Directory for New Tabs→ Reuse previous session's directory
--
General usage tip
- Store code in
~/code.Make Aliason desktop so it's easy to reach via Finder.
--
Jump directly to a location in a path
Option + Click
--
History info
cat ~/.zsh_historyhistory