0%

mac自己的装机操作配置

记录一下自己常用的 Mac 操作配置。

1. 下载软件

  1. clashX https://github.com/clash-verge-rev/clash-verge-rev
  2. chrome
  3. 百度输入法
  4. Dropbox
  5. Typora
  6. Obsidian

1.1 常用软件

参考:https://www.liuvv.com/p/2e385ebc.html

  • 微信
  • bob
  • ishot pro
  • xmind
  • 1password
  • alfred
  • wps
  • charles

1.2 终端下载

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 下载终端软件
https://github.com/alacritty/alacritty

# 安装brew
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

# 垃圾
brew install trash

# rg
brew install rg

# rclone
brew install rclone

# 显示隐藏文件
defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder

# 安装git commit 的 cz
npm i -g czg
npx czg --api-key=sk-P1xxxxxxx
npx czg --api-endpoint="https://xxxxx.deno.dev/v1"

1.3 软件设置

  • chrome tab,Infinity 使用谷歌账号登录,使用云端数据

  • typora

    image-20240518100101093

2. 终端配置

2.1 设置ssh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 1. 打开链接
https://github.com/unix2dos/LevonConfig/tree/main/Config

# 2. 只下载ssh文件夹,并放到家目录下,命名为 .ssh

# 3. 修改权限
sudo chmod 755 ~/.ssh
sudo chmod 600 ~/.ssh/*
sudo chown $USER ~/.ssh/*

# 4. 下载项目
cd workspace
git clone git@github.com:unix2dos/LevonConfig.git

# 5. 修改回去
rm -rf ~/.ssh
ln -s ~/workspace/LevonConfig/Config/ssh ~/.ssh


# 6. 再次修改权限
sudo chmod 755 ~/.ssh
sudo chmod 600 ~/.ssh/*
sudo chown $USER ~/.ssh/*

2.2 配置软链

1
2
3
4
5
6
7
8
9
10
11
12
13
# 1. vimrc
ln -s ~/workspace/LevonConfig/Config/vim/.vimrc ~/.vimrc

# 2. 终端alacritty
ln -s ~/workspace/LevonConfig/Config/alacritty/.alacritty.toml ~/.alacritty.toml

# 3. git
ln -s ~/workspace/LevonConfig/Config/git/.gitconfig ~/.gitconfig
ln -s ~/workspace/LevonConfig/Config/git/.gitconfig-work ~/.gitconfig-work

# 4. rclone
mkdir -p ~/config/rclone
ln -s ~/workspace/LevonConfig/Config/rclone/rclone.conf ~/.config/rclone/rclone.conf

2.3 tmux

1
2
3
4
5
6
7
8
9
10
11
# 安装tmux
brew install tmux

# 安装oh my tmux配置
cd ~
git clone https://github.com/gpakosz/.tmux.git
ln -s -f .tmux/.tmux.conf

# 用自己的配置
ln -s ~/workspace/LevonConfig/Config/tmux/.tmux.conf.local ~/.tmux.conf.local
tmux source-file ~/.tmux.conf

2.4 zsh+plugin

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# oh my zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# 主题
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

# 插件
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

# 下载安装特殊字体(必须下载,终端使用)
https://github.com/romkatv/powerlevel10k#meslo-nerd-font-patched-for-powerlevel10k

# 配置
ln -s ~/workspace/LevonConfig/Config/zsh/.zshrc ~/.zshrc

2.5 vim

1
2
3
4
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

:PlugInstall

2.6 fzf

1
2
3
4
5
6
7
# 安装 fzf
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
source ~/.zshrc

# fzf-tab
git clone https://github.com/Aloxaf/fzf-tab ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fzf-tab

3. Mac 操作

3.1 触发角

1

3.2 密码修改为1位数

1
pwpolicy -clearaccountpolicies

然后去系统偏好设置->用户与群组->修改密码

3.3 固定F1-F12

系统偏好设置->键盘->触控栏显示

3.4 最小化程序到应用图标

系统偏好设置->Dock->Mini windows into application icon

3.5 访达配置

iShot_2022-06-25_15.16.46

4. 项目

4.1 blogs

1
2
3
4
5
6
7
8
9
# blog
cd ~ && mkdir workspace && cd workspace
git clone git@github.com:unix2dos/blog-readwrite.git
git clone git@github.com:unix2dos/blog-liuvv.git


# goods 配置
ln -s ~/workspace/LevonRecord/Config/goods-notify/.env ~/workspace/goods-notify/.env
ln -s ~/workspace/LevonRecord/Config/goods-notify/build.sh ~/workspace/goods-notify/build.sh

4.2 obsidian

1
2
3
4
5
6
7
8
9
10
#1. 设置软链接
ln -s ~/Dropbox/_Obsidian_ ~/workspace/Obsidian

#2. 下载整个 git 项目,把项目全部删除干净,只留下 .git 文件夹。
cd workspace
git clone git@github.com:unix2dos/Obsidian.git --depth=1 a.git

#3. 然后把 .git 文件夹,重命名为第一台机器设置的文件夹和路径,然后 git status 查看。
mv a.git/.git /Users/liuwei/workspace/.gitdir_Obsidian
rm -rf a.git

4.3 多重备份

1
2
3
4
5
6
7
8
9
10
11
# 1. 设置软链接
ln -s ~/Dropbox/_backups_ ~/workspace/backups


# 2. 下载整个 git 项目,把项目全部删除干净,只留下 .git 文件夹。
cd workspace
git clone git@github.com:unix2dos/_backups_.git --depth=1 b.git

# 3. 然后把 .git 文件夹,重命名为第一台机器设置的文件夹和路径,然后 git status 查看。
mv b.git/.git /Users/liuwei/workspace/.gitdir_backups
rm -rf b.git
可以加首页作者微信,咨询相关问题!