个人Mac环境配置

记录一下个人Mac电脑环境,可能对他人有帮助.

终端

oh-my-zsh 配置

必要依赖

1
2
brew install git zsh
chsh -s /bin/zsh # 设置默认shell为zsh

官方oh-my-zsh安装命令中进行安装。

1
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

如果没有科学上网,可以直接访问上面网页,把运行脚本到copy到本地的 install.sh,然后运行:

1
cat install.sh | bash

安装插件

1
2
3
4
# 自动提示插件
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
# 语法高亮插件
git clone git://github.com/zsh-users/zsh-syntax-highlighting $ZSH_CUSTOM/plugins/zsh-syntax-highlighting

更新~/.zshrc

1
plugins=( git extract autojump docker docker-compose zsh-autosuggestions zsh-syntax-highlighting )

个人终端自定义注意-> ryan.zsh-theme

1
2
3
4
5
6
7
8
9
10
if [[ -z $ZSH_THEME_RYAN_PREFIX ]]; then
ZSH_THEME_RYAN_PREFIX='🤣'
fi

PROMPT='%{$fg_bold[cyan]%}$ZSH_THEME_RYAN_PREFIX %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'

ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}🌹"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
1
ZSH_THEME="ryan"

Rust 环境

~/.gitconfig 替换加速

1
2
3
4
5
6
7
8
9
#[url "https://github.com.cnpmjs.org/"]
[url "https://hub.fastgit.org/"]
insteadOf = https://github.com/

[http]
sslVerify = false
postBuffer = 1048576000
[submodule]
recurse = true

~/.cargo/config crates国内源

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
# 指定镜像
replace-with = 'rsproxy' # 如:tuna、sjtu、ustc,或者 rustcc


# 字节跳动
[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"

# 中国科学技术大学
[source.ustc]
registry = "https://mirrors.ustc.edu.cn/crates.io-index"
# >>> 或者 <<<
# registry = "git://mirrors.ustc.edu.cn/crates.io-index"

# 上海交通大学
[source.sjtu]
registry = "https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index/"

# 清华大学
[source.tuna]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"

# rustcc社区
[source.rustcc]
registry = "https://code.aliyun.com/rustcc/crates.io-index.git"
作者

Ryan

发布于

2021-07-25

更新于

2021-08-19

许可协议

评论