前言
MacBook剛拿到手竭沫,相信和各位一樣有一個(gè)熟悉的過程望门,這里做下持續(xù)的更新記錄
學(xué)習(xí)使用MacBook
更新歷史
2018年10月19日 - 更新升級(jí)macOS Mojave后的各種小問題解決方法
2018年07月25日 - 補(bǔ)充細(xì)節(jié)
2018年07月05日 - 初稿
閱讀原文 - https://wsgzao.github.io/post/macbook/
擴(kuò)展閱讀
Awesome Mac - http://wangchujiang.com/awesome-mac/index.zh.html
System Preferences
在任何的操作系統(tǒng)中,首先你需要做一件事就是更新系統(tǒng)祥楣,點(diǎn)擊窗口左上角的 ? > 關(guān)于本機(jī) > 軟件更新 检访。此外眶拉,如果這是一部新的電腦罗晕,你還需要到系統(tǒng)設(shè)置進(jìn)行一些適當(dāng)調(diào)整济欢。如何調(diào)整赠堵,取決于個(gè)人喜好。
觸控板
系統(tǒng)設(shè)置 > 觸控板
光標(biāo)與點(diǎn)擊
- 輕拍來點(diǎn)按
- 輔助點(diǎn)按
- 查找
- 三指拖移
滾動(dòng)縮放
- 默認(rèn)全選
更多手勢(shì)
- 默認(rèn)全選
Dock
置于屏幕上的位置:左邊
設(shè)置 Dock 圖標(biāo)更蟹ㄈ臁(大小隨個(gè)人喜好)
? 自動(dòng)顯示和隱藏 Dock
Finder
Finder > 顯示
- 顯示標(biāo)簽頁欄
- 顯示路徑欄
- 顯示狀態(tài)欄
- 自定工具欄 > 去除所有按鈕茫叭,僅剩搜索欄
Finder > 偏好設(shè)置
通用
- 開啟新 Finder 窗口時(shí)打開:HOME「用戶名」目錄
邊欄
- 添加 HOME「用戶名」目錄 和 創(chuàng)建代碼文件目錄
- 將 共享的(shared) 和 標(biāo)記(tags) 目錄去掉
菜單欄
去掉藍(lán)牙等無需經(jīng)常使用的圖標(biāo)
將電池顯示設(shè)置為百分比
Spotlight
去掉字體和書簽與歷史記錄等不需要的內(nèi)容
設(shè)置合適的快捷鍵
互聯(lián)網(wǎng)帳戶
添加 iCloud 用戶,同步日歷半等,聯(lián)系人和 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 鍵盤快捷鍵
https://support.apple.com/zh-cn/HT201236
Command ?
Shift ?
Option ?
Control ?
Caps Lock ?
Fn
我自己常用的快捷鍵
快捷鍵 | 描述 |
---|---|
Command(?)-C | 復(fù)制 |
Command(?)-V | 粘貼 |
Command(?)-Z | 撤銷 |
Command(?)-Option-V | 剪切粘貼 |
Command(?)-A | 全選 |
Command(?)-F | 查找 |
Command(?)-S | 保存 |
Command(?)-W | 關(guān)閉當(dāng)前窗口 |
Command(?)-空格鍵 | 聚焦 |
Command(?)-方向左鍵 | 后退 |
Command(?)-方向右鍵 | 前進(jìn) |
Control-A | 移至行或段落的開頭 |
Control-E | 移至行或段落的末尾 |
Control-空格鍵 | 切換輸入法(需要手動(dòng)設(shè)置) |
Control-Command-Q | 系統(tǒng)自帶鎖屏快捷鍵 |
Mac Soft
Homebrew - Mac下必備的包管理工具
https://brew.sh/
Mounty for NTFS - 免費(fèi)的NTFS支持軟件
http://enjoygineering.com/mounty/
Sougou Input - 陪伴大家多年的搜狗輸入法
https://pinyin.sogou.com/mac/
Youdao Dict - 網(wǎng)易開發(fā)的老牌翻譯工具
http://cidian.youdao.com/index-mac.html
Jietu - 騰訊開發(fā)的截圖工具揍愁,其實(shí)可以使用QQ或者微信快捷鍵
http://jietu.qq.com/
Kantu - 騰訊開發(fā)的看圖工具
https://kantu.qq.com/
f.lux - Mac和Windows都必備的護(hù)眼亮度調(diào)整工具
https://justgetflux.com/
Foxit Reader - 國內(nèi)福昕開發(fā)的免費(fèi)PDF閱讀器
https://www.foxitsoftware.com/pdf-reader/
Clearview - 支持PDF, EPUB, CHM, MOBI 的免費(fèi)閱讀器
https://itunes.apple.com/app/clearview/id557090104?mt=12&ls=1
Evernote - 輕量級(jí)的在線筆記類應(yīng)用內(nèi)
https://evernote.com/
Dropbox - 最佳的實(shí)時(shí)同步工具之一
https://www.dropbox.com/
Keka - 國外開源的免費(fèi)壓縮解壓縮工具
https://www.keka.io/en/
Mac迅雷 - 支持協(xié)議多廣告也多
http://mac.xunlei.com/
百度網(wǎng)盤 - 國內(nèi)的網(wǎng)盤共享基本只剩下百度一家獨(dú)大了
https://pan.baidu.com/
FOLX - 用來代替迅雷的免費(fèi)下載工具
https://mac.eltima.com/download-manager.html
IINA - 國人編寫的開源視頻播放器
https://lhc70000.github.io/iina/
Clipy - 記錄多條粘貼板小公舉
https://github.com/Clipy/Clipy
Grid - 快速調(diào)整程序窗口位置的效率工具
http://mildgrind.com/
Proxyee Down - Mac下百度網(wǎng)盤下載神器
https://github.com/proxyee-down-org/proxyee-down
Sourcetree - 圖形化Git管理工具
https://www.sourcetreeapp.com/
Microsoft Remote Desktop - Mac下的微軟RDP遠(yuǎn)程桌面登錄工具
https://itunes.apple.com/us/app/microsoft-remote-desktop-10/id1295203466?mt=12
VirtualBox - 免費(fèi)的虛擬機(jī)工具
http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html
VMware OS Optimization Tool - VMware開發(fā)的Windows虛擬機(jī)優(yōu)化工具
https://labs.vmware.com/flings/vmware-os-optimization-tool
Homebrew
https://docs.brew.sh/Installation
# install xcode first
https://itunes.apple.com/us/app/xcode/id497799835
# 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
https://www.iterm2.com/
Oh My Zsh
http://ohmyz.sh/
# install latest zsh zsh-syntax-highlighting
brew install zsh zsh-syntax-highlighting
# 修改默認(rèn) shell,在 /etc/shells 文件中加入如下一行
vi /etc/shells
/usr/local/bin/zsh
# 然后運(yùn)行命令切換 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
# 刷新環(huán)境變量
source ~/.zshrc
# 安裝powerline字體
git clone https://github.com/powerline/fonts.git
cd fonts
./install.sh
配置iTerm2主題吗垮,主題可以從iterm2colorschemes下載
https://iterm2colorschemes.com/
- 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 中設(shè)置 command + i
快速顯示和隱藏 iTerm
在 Profiles -> Default -> Colors -> Load Presets 導(dǎo)入主題垛吗,作為默認(rèn)顏色凹髓,我的主題是3024 Night
在 Profiles -> Text -> Change Font 調(diào)整字體/大小/顏色等,我的字體是18pt Ubuntu Mono derivative Powerline
Others
升級(jí)macOS Mojave新版卡頓和字體發(fā)虛解決方案
1.輸入文字卡頓
如果你的 Mac 已經(jīng)更新至 macOS Mojave怯屉,在輸入文字時(shí)經(jīng)澄狄ǎ卡頓,頻繁出現(xiàn)小風(fēng)車锨络,那很有可能是搜狗輸入法造成的赌躺,只需將它升級(jí)至最新的 4.8.0 版本,即可完美解決羡儿。
2.字體發(fā)虛
升級(jí) macOS Mojave 新系統(tǒng)后礼患,蘋果默認(rèn)關(guān)閉了子像素抗鋸齒,導(dǎo)致字體變細(xì)鋸齒增多掠归。
解決字體渲染過細(xì)缅叠,打開終端,輸入:
defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO
重啟應(yīng)用比如 VS Code 后即可看到效果
解決Command+Q經(jīng)常誤按
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.
https://github.com/dteoh/SlowQuitApps
brew cask install slowquitapps
運(yùn)行程序按照提示授權(quán)后重啟應(yīng)用并設(shè)置開機(jī)自啟動(dòng)即可享受1s延遲關(guān)閉提醒虏冻,如果覺得時(shí)間不夠長可以自己設(shè)定
提示應(yīng)用程序被破壞無法打開
SOLVED: "Application" is damaged and can't be opened in macOS Sierra
sudo spctl --master-disable
輸入密碼重新打開 System Preferences > Security & Privacy > General 即可看到之前隱藏的“Anywhere”
https://www.santoshsrinivas.com/disable-gatekeeper-in-macos-sierra/
更改 Apple ID 國家或地區(qū)
區(qū)域在國內(nèi)即使身在國外也看不到你需要的很多東東肤粱,建議修改
https://support.apple.com/zh-cn/ht201389
USB Type-C 耳機(jī)
- 插入耳機(jī)至任意USB Type-C 接口
- System Preferences -> Sound -> Output -> 選擇識(shí)別到的耳機(jī)設(shè)備即可
Macbook外置鍵盤如何更改設(shè)置
option改成command(win 版鍵盤下的四個(gè)方塊圖標(biāo)按鍵)
command改成option
https://jingyan.baidu.com/article/363872ec2185346e4aa16f61.html
配置從命令提示行啟動(dòng)vscode
安裝Visual Studio Code,打開命令面板(按F1 或 command + shift + p)輸入Shell 命令找到Shell 命令: 在PATH中安裝“code”命令厨相。命令執(zhí)行完成之后领曼,重啟終端工具使新的$PATH可用。現(xiàn)在蛮穿,您可以簡單地在終端中任意文件夾下輸入‘code .’來編輯該文件夾下的文件了庶骄。
Git Ignore
# 創(chuàng)建一個(gè)新文件 ~/.gitignore ,并將以下內(nèi)容添加進(jìn)去践磅,這樣全部 git 倉庫將會(huì)忽略以下內(nèi)容所提及的文件单刁。
# 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 生成,打開“終端”音诈,復(fù)制黏貼下面的命令幻碱,回車執(zhí)行绎狭,重啟 Mac 即可生效。
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE
# 恢復(fù) .DS_store 生成
defaults delete com.apple.desktopservices DSDontWriteNetworkStores
# 刪除已存在的.DS_Store
sudo find . -name ".DS_Store" -depth -exec rm {} \;
ssh相關(guān)
# -bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
# 禁止OpenSSH客戶端從OS X/Linux/Unix桌面發(fā)送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