0. 基础安装
- java >= 1.8
- xcode
1 | $ xcode-select --install |
1. Homebrew https://brew.sh/
The missing package manager for macOS (or Linux)
1 | $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
brew install
安装的程序:
calc
命令行下的计算器curl
http网页内容请求wget
The non-interactive network downloader. 支持续传rename
renames multiple filesunar
命令行下解压缩。可指定字符集解压zip内文件名带中文。
关闭brew的自动更新,设置环境变量
1 | HOMEBREW_NO_AUTO_UPDATE=1 |
这样可以避免每次brew install时都执行update,太慢。
需要自己定期执行brew update获得最新的程序列表及版本。
2. iTerm2 https://www.iterm2.com/
iTerm2 is a replacement for Terminal and the successor to iTerm. It works on Macs with macOS 10.12 or newer. iTerm2 brings the terminal into the modern age with features you never knew you always wanted.
自定义设置
- Preferences -> Profiles -> Keys
- Load Preset…
- 选择:Nextural Text Editing
- 这样就可以支持用
CTRL + <
和CTRL + >
跳转字符串了
- Preferences -> Keys -> Hotkey
- Show/hide iTerm2 with a system-wide hotkey 快捷键设置为:”command+.”
3. zsh
zsh可以作为bash的替代品。相比mac默认的bash,zsh有很多更强大更方便的功能。
1 | $ brew install zsh zplug zsh-completions |
oh-my-zsh https://github.com/robbyrussell/oh-my-zsh
Oh My Zsh is an open source, community-driven framework for managing your zsh configuration.
1 | $ sh -c "$(wget -O- https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" |
上边启用了一些非常有用的插件:
- adb、brew、docker、mvn 命令的提示与补全(按TAB TAB)
- git、git-flow-avh、jira(git与jira的自动关联) 命令的提示与补全
- jira:注意要修改上述的JIRA_NAME配置,改成你的账号
4. git
修改 ~/.gitconfig 配置:一些UI颜色的设置,一些别名的配置。
1 | [user] |
配置git的SSH Key
1 | $ ssh-keygen -t rsa -C "your.email@crazy1984.com" -b 4096 |
打开git web控制台:
- 个人设置 => SSH Keys ,添加SSH Key,粘贴、保存。
- 配置好SSH Key后,git clone使用ssh地址,pull和push的时候就不需要输入账户密码了
- ssh地址形如:git@github.com:changyuheng/fz.git
5. SDKMAN https://sdkman.io
SDKMAN! is a tool for managing parallel versions of multiple Software Development Kits on most Unix based systems. It provides a convenient Command Line Interface (CLI) and API for installing, switching, removing and listing Candidates. Formerly known as GVM the Groovy enVironment Manager, it was inspired by the very useful RVM and rbenv tools, used at large by the Ruby community.
1 | $ curl -s "https://get.sdkman.io" | bash |