MacBook 使用指北

前言

image

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/

  1. Download iTerm2 color you like
  2. Open iTerm2 that we already downloaded at the first section
  3. Go to iTerm2 > Preferences > Profiles > Colors Tab
  4. Click Color Presets at the bottom right
  5. Click Import
  6. Select the *.itermcolors file
  7. 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ī)

  1. 插入耳機(jī)至任意USB Type-C 接口
  2. 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



最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末褥傍,一起剝皮案震驚了整個(gè)濱河市儡嘶,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌恍风,老刑警劉巖蹦狂,帶你破解...
    沈念sama閱讀 212,080評(píng)論 6 493
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異朋贬,居然都是意外死亡凯楔,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,422評(píng)論 3 385
  • 文/潘曉璐 我一進(jìn)店門锦募,熙熙樓的掌柜王于貴愁眉苦臉地迎上來摆屯,“玉大人,你說我怎么就攤上這事糠亩∨捌铮” “怎么了?”我有些...
    開封第一講書人閱讀 157,630評(píng)論 0 348
  • 文/不壞的土叔 我叫張陵赎线,是天一觀的道長廷没。 經(jīng)常有香客問我,道長垂寥,這世上最難降的妖魔是什么颠黎? 我笑而不...
    開封第一講書人閱讀 56,554評(píng)論 1 284
  • 正文 為了忘掉前任,我火速辦了婚禮滞项,結(jié)果婚禮上狭归,老公的妹妹穿的比我還像新娘。我一直安慰自己蓖扑,他們只是感情好唉铜,可當(dāng)我...
    茶點(diǎn)故事閱讀 65,662評(píng)論 6 386
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著律杠,像睡著了一般潭流。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上柜去,一...
    開封第一講書人閱讀 49,856評(píng)論 1 290
  • 那天灰嫉,我揣著相機(jī)與錄音,去河邊找鬼嗓奢。 笑死讼撒,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播根盒,決...
    沈念sama閱讀 39,014評(píng)論 3 408
  • 文/蒼蘭香墨 我猛地睜開眼钳幅,長吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來了炎滞?” 一聲冷哼從身側(cè)響起敢艰,我...
    開封第一講書人閱讀 37,752評(píng)論 0 268
  • 序言:老撾萬榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎册赛,沒想到半個(gè)月后钠导,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 44,212評(píng)論 1 303
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡森瘪,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,541評(píng)論 2 327
  • 正文 我和宋清朗相戀三年牡属,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片扼睬。...
    茶點(diǎn)故事閱讀 38,687評(píng)論 1 341
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡逮栅,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出痰驱,到底是詐尸還是另有隱情证芭,我是刑警寧澤,帶...
    沈念sama閱讀 34,347評(píng)論 4 331
  • 正文 年R本政府宣布担映,位于F島的核電站,受9級(jí)特大地震影響叫潦,放射性物質(zhì)發(fā)生泄漏蝇完。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,973評(píng)論 3 315
  • 文/蒙蒙 一矗蕊、第九天 我趴在偏房一處隱蔽的房頂上張望短蜕。 院中可真熱鬧,春花似錦傻咖、人聲如沸朋魔。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,777評(píng)論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽警检。三九已至,卻和暖如春害淤,著一層夾襖步出監(jiān)牢的瞬間扇雕,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,006評(píng)論 1 266
  • 我被黑心中介騙來泰國打工窥摄, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留镶奉,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 46,406評(píng)論 2 360
  • 正文 我出身青樓,卻偏偏與公主長得像哨苛,于是被迫代替她去往敵國和親鸽凶。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 43,576評(píng)論 2 349