程序员的Mac有哪些好用的工具:一
本文作者:cjinhuo,未经授权禁止转载。
概要
“工欲善其事,必先利其器”,颜值高且好用的工具往往能让我们事半功倍
来到正文,本文分成三个部分
- 背景
- 工具
- 结尾
背景
对程序猿👨🏻💻而言,除了部分大佬喜欢用linux外,Mac拥有着高分辨率、超好用的Touch Bar和MacOS无疑是最佳选择,下面来介绍一些个人觉得好用的工具
工具
brew
brew是MacOS上的包管理工具,可以简化 macOS 和 Linux 操作系统上软件的安装,具体使用且看官网
安装完在终端中输入brew -v,可以输出版本就证明安装成功
现在比如说安装mysql,只需一句简单的命令:
brew install mysql
安装redis等等其他的也是一样的操作
注意:正常情况下需要科学上网安装会快点
iterm2 & oh-my-zsh & spaceship
一个好看又好用的终端,往往可以节省很多工作时间,还能给你的同事show一下,下图是我目前的终端:

那么就开始下载和配置:
- 下载iterm2
打开偏好设置Preference,设置最小化主题:

设置背景图片

设置状态栏

-
安装[spaceship]主题(https://spaceship-prompt.sh/zh/getting-started/) 装完
spaceship需要在终端启用powerline font,此时你需要在选择下载某些字体,比如如下:- FiraCode: https://github.com/tonsky/FiraCode
- source-code-pro: https://github.com/adobe-fonts/source-code-pro
plugins
终端快捷键
-
将光标移动到行首:ctrl + a
-
将光标移动到行尾:ctrl + e
-
清除屏幕:ctrl + l
-
搜索以前使用命令:ctrl + r
-
清除当前行:ctrl + u
-
清除至当前行尾:ctrl + k
-
单词为单位移动:option + 方向键
-
CTRL+W:删除光标前一个单词(根据空格识别单词分隔)
-
CTRL+Y:粘贴之前(CTRL+U/K/W)删除的内容
-
ESC+B:光标向左移动一个单词
-
ESC+F:光标向右移动一个单词
Nginx反向代理
brew nginx
vi /usr/local/etc/nginx/nginx.config进行配置更改,也可以在/usr/local/etc/nginx/servers里面添加配置
server{
listen 80;
server_name *.qa.91jkys.com;
access_log /var/log/nginx/zhiyun_access.log;
error_log /var/log/nginx/zhiyun_error.log;
if ($http_host ~* "^(.*?)\.qa\.91jkys\.com$") {
set $domain $1;
}
location / {
if ($domain ~* "trycatch") {
proxy_pass http://127.0.0.1:3000;
}
if ($domain ~* "operate-admin") {
proxy_pass http://127.0.0.1:1024;
}
if ($domain ~* "metabase-admin") {
proxy_pass http://127.0.0.1:1025;
}
if ($domain ~* "supply"){
proxy_pass http://127.0.0.1:9999;
}
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
启动Nginx brew services start nginx
重启Nginx brew services restart nginx
暂停Nginx brew services stop nginx