MacBook 使用指北

2018-10-25 11:15:23 0点赞 15收藏 0评论

这里做下 MacBook 从小白到入门的持续更新记录

学习使用 MacBook

更新历史

2018 年 10 月 19 日 - 更新升级 macOS Mojave 后的各种小问题解决方法
2018 年 07 月 25 日 - 补充细节
2018 年 07 月 05 日 - 初稿

扩展阅读

Awesome Mac

System Preferences

在任何的操作系统中,首先你需要做一件事就是更新系统,点击窗口左上角的  > 关于本机 > 软件更新 。此外,如果这是一部新的电脑,你还需要到系统设置进行一些适当调整。如何调整,取决于个人喜好。

触控板

系统设置 > 触控板

光标与点击

- 轻拍来点按

- 辅助点按

- 查找

- 三指拖移

滚动缩放

- 默认全选

更多手势

- 默认全选

Dock

置于屏幕上的位置:左边

设置 Dock 图标更小(大小随个人喜好)

- 自动显示和隐藏 Dock

Finder

Finder > 显示

- 显示标签页栏

- 显示路径栏

- 显示状态栏

- 自定工具栏 > 去除所有按钮,仅剩搜索栏

Finder > 偏好设置

通用

- 开启新 Finder 窗口时打开:HOME「用户名」目录

边栏

- 添加 HOME「用户名」目录 和 创建代码文件目录

- 将 共享的(shared) 和 标记(tags) 目录去掉

菜单栏

- 去掉蓝牙等无需经常使用的图标

- 将电池显示设置为百分比

Spotlight

- 去掉字体和书签与历史记录等不需要的内容

- 设置合适的快捷键

互联网帐户

- 添加 iCloud 用户,同步日历,联系人和 Find my mac 等等

English

Trackpad

- Tap to click

Accessibility -> Mouse & Trackpad -> Trackpad Options

- Enable dragging | three finger drag

Language & Region

- Time format | 24-Hour Time

- click add button | Chinese, Simplified

Language & Region -> Keyboard Preferences -> Shortcuts -> Input Sources

- Select the previous input source

Display -> Arrangement

- Drag the graphics and just make what you want

- if the display rotates 90 degrees then change Rotation to 90° or 270° and click confirm button to save

Mac 键盘快捷键

官方文档

Command ⌘
Shift ⇧
Option ⌥
Control ⌃
Caps Lock ⇪
Fn

我自己常用的快捷键

快捷键 | 描述

--- | ---

Command(⌘)-C | 复制

Command(⌘)-V | 粘贴

Command(⌘)-Z | 撤销

Command(⌘)-Option-V | 剪切粘贴

Command(⌘)-A | 全选

Command(⌘)-F | 查找

Command(⌘)-S | 保存

Command(⌘)-W | 关闭当前窗口

Command(⌘)-空格键 | 聚焦

Command(⌘)-方向左键 | 后退

Command(⌘)-方向右键 | 前进

Control-A | 移至行或段落的开头

Control-E | 移至行或段落的末尾

Control-空格键 | 切换输入法(需要手动设置)

Control-Command-Q | 系统自带锁屏快捷键

Option-Command-C | 复制文件路径,当然也可以直接拖拽到命令行

Mac Soft

Homebrew - Mac 下必备的包管理工具

Alfred - Mac下被无数人安利的效率工具,虽然我觉得Spotlight暂时够用了


Mounty for NTFS - 免费的 NTFS 支持软件

Sougou Input - 陪伴大家多年的搜狗输入法

Youdao Dict - 网易开发的老牌翻译工具

Jietu - 腾讯开发的截图工具,其实可以使用 QQ 或者微信快捷键

Kantu - 腾讯开发的看图工具

f.lux - Mac 和 Windows 都必备的护眼亮度调整工具

Foxit Reader - 国内福昕开发的免费 PDF 阅读器

Clearview - 支持 PDF, EPUB, CHM, MOBI 的免费阅读器

Evernote - 轻量级的在线笔记类应用内

Dropbox - 最佳的实时同步工具之一

Keka - 国外开源的免费压缩解压缩工具

Mac 迅雷 - 支持协议多广告也多

百度网盘 - 国内的网盘共享基本只剩下百度一家独大了

FOLX - 用来代替迅雷的免费下载工具

IINA - 国人编写的开源视频播放器

Clipy - 记录多条粘贴板小工具

Grid - 快速调整程序窗口位置的效率工具

Proxyee Down - Mac 下百度网盘下载神器

Sourcetree - 图形化 Git 管理工具

Microsoft Remote Desktop - Mac 下的微软 RDP 远程桌面登录工具

VirtualBox - 免费的虚拟机工具

VMware OS Optimization Tool - VMware 开发的 Windows 虚拟机优化工具

Homebrew

# install xcode first

xcode

# install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# install packages
brew tap dteoh/sqa
brew install zsh
brew install wget
brew install git
# default install is python3 now, if you need python2 just run `brew install python2`
brew install python

iTerm2 + zsh + Oh My Zsh

iTerm2

Oh My Zsh

# install latest zsh zsh-syntax-highlighting
brew install zsh zsh-syntax-highlighting
# 修改默认 shell,在 /etc/shells 文件中加入如下一行
vi /etc/shells

/usr/local/bin/zsh
# 然后运行命令切换 shell
chsh -s /usr/local/bin/zsh

# install oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

# 修改主题为 agnoster,增加一行 zsh-syntax-highlighting
vi ~/.zshrc

ZSH_THEME="agnoster"
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

# 可选增加 visual studio code 命令行 code 支持 zsh
function code {
if [[ $# = 0 ]]
then
open -a "Visual Studio Code"
else
local argPath="$1"
[[ $1 = /* ]] && argPath="$1" || argPath="$PWD/${1#./}"
open -a "Visual Studio Code" "$argPath"
fi
}

# 解决 Too many files open error
ulimit -n 10000
ulimit -u 2048

# 刷新环境变量
source ~/.zshrc

# 安装 powerline 字体
git clone https://github.com/powerline/fonts.git
cd fonts
./install.sh

配置 iTerm2 主题,主题可以从 iterm2colorschemes 下载

Download iTerm2 color you like

Open iTerm2 that we already downloaded at the first section

Go to iTerm2 > Preferences > Profiles > Colors Tab

Click Color Presets at the bottom right

Click Import

Select the *.itermcolors file

Select the * from Load Presets

在 Keys -> Hotkey 中设置 command + i 快速显示和隐藏 iTerm
在 Profiles -> Default -> Colors -> Load Presets 导入主题,作为默认颜色,我的主题是 3024 Night
在 Profiles -> Text -> Change Font 调整字体 / 大小 / 颜色等,我的字体是 18pt Ubuntu Mono derivative Powerline

MacBook 使用指北

Others

升级 macOS Mojave 新版卡顿和字体发虚解决方案

输入文字卡顿

如果你的 Mac 已经更新至 macOS Mojave,在输入文字时经常卡顿,频繁出现小风车,那很有可能是搜狗输入法造成的,只需将它升级至最新的 4.8.0 版本,即可完美解决。

字体发虚

升级 macOS Mojave 新系统后,苹果默认关闭了子像素抗锯齿,导致字体变细锯齿增多。
解决字体渲染过细,打开终端,输入:

defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO

重启应用比如 VS Code 后即可看到效果

解决 Command+Q 经常误按

Slow Quit Apps

A macOS app that adds a global delay of 1 second to the Cmd-Q shortcut. In other words, you have to hold down Cmd-Q for 1 second before an application will quit.

When the delay is active, an overlay is drawn at the center of the screen.

brew cask install slowquitapps

运行程序按照提示授权后重启应用并设置开机自启动即可享受 1s 延迟关闭提醒,如果觉得时间不够长可以自己设定

提示应用程序被破坏无法打开

SOLVED: “Application” is damaged and can’t be opened in macOS Sierra

sudo spctl --master-disable

输入密码重新打开 System Preferences > Security & Privacy > General 即可看到之前隐藏的 “Anywhere”

更改 Apple ID 国家或地区

区域在国内即使身在国外也看不到你需要的很多东东,建议修改

苹果官方文档

USB Type-C 耳机

插入耳机至任意 USB Type-C 接口

System Preferences -> Sound -> Output -> 选择识别到的耳机设备即可

Macbook 外置键盘如何更改设置

option 改成 command(win 版键盘下的四个方块图标按键)
command 改成 option

百度经验

配置从命令提示行启动 vscode

安装 Visual Studio Code,打开命令面板(按 F1 或 command + shift + p)输入 Shell 命令找到 Shell 命令: 在 PATH 中安装 “code” 命令。命令执行完成之后,重启终端工具使新的 $PATH 可用。现在,您可以简单地在终端中任意文件夹下输入‘code .’来编辑该文件夹下的文件了。

Git Ignore

# 创建一个新文件 ~/.gitignore ,并将以下内容添加进去,这样全部 git 仓库将会忽略以下内容所提及的文件。

# Folder view configuration files
.DS_Store
Desktop.ini

# Thumbnail cache files
._*
Thumbs.db

# Files that might appear on external disks
.Spotlight-V100
.Trashes

# Compiled Python files
*.pyc

# Compiled C++ files
*.out

# Application specific files
venv
node_modules
.sass-cache

禁止. DS_store 生成

# 禁止 .DS_store 生成,打开“终端”,复制黏贴下面的命令,回车执行,重启 Mac 即可生效。
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE
# 恢复 .DS_store 生成
defaults delete com.apple.desktopservices DSDontWriteNetworkStores
# 刪除已存在的. DS_Store
sudo find . -name ".DS_Store" -depth -exec rm {} ;

ssh 相关

# -bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
# 禁止 OpenSSH 客户端从 OS X/Linux/Unix 桌面发送 LC_* 变量
vi /etc/ssh/ssh_config
#SendEnv LANG LC_*

# port forwarding
ssh -p 22202 wangao@127.0.0.1
ssh -p 22202 wangao@127.0.0.1 -X
scp -P 22202 -r sysctl.sh sysctl.d/ wangao@127.0.0.1:/tmp

# ssh tunnel for one-time
ssh -t -A wangao@xx.xx.xx.xx ssh wangao@10.65.32.60

# config ssh tunnel to make easy connect everyday
vim ~/.ssh/config

StrictHostKeyChecking=no

Host 10.65.32.*
HostName %h
ProxyCommand ssh bastion_GOP_SG_NC_MAIN -W %h:%p
Host bastion_GOP_SG_NC_MAIN
HostName 8.8.8.8
port 22
User wangao

# test
ssh 10.65.32.60


展开 收起
0评论

当前文章无评论,是时候发表评论了
提示信息

取消
确认
评论举报

相关文章推荐

更多精彩文章
更多精彩文章
最新文章 热门文章
目录
15
扫一下,分享更方便,购买更轻松