MacBook 使用指北

作者: 王奥OX | 来源:发表于2018-07-30 18:20 被阅读99次
image

前言

MacBook刚拿到手,相信和各位一样有一个熟悉的过程,这里做下持续的更新记录

学习使用MacBook

更新历史

2018年07月25日 - 补充细节
2018年07月05日 - 初稿

阅读原文 - https://wsgzao.github.io/post/macbook/

扩展阅读

Awesome Mac - http://wangchujiang.com/awesome-mac/index.zh.html


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 键盘快捷键

https://support.apple.com/zh-cn/HT201236

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 系统自带锁屏快捷键

Mac Soft

Homebrew
https://brew.sh/

Mounty for NTFS
http://enjoygineering.com/mounty/

Sougou Input - Sogou
https://pinyin.sogou.com/mac/

Youdao Dict - Netesse
http://cidian.youdao.com/index-mac.html

Jietu - Tencent
http://jietu.qq.com/

Kantu - Tencent
https://kantu.qq.com/

f.lux
https://justgetflux.com/

Foxit Reader
https://www.foxitsoftware.com/pdf-reader/

Evernote
https://evernote.com/

Dropbox
https://www.dropbox.com/

Keka
https://www.keka.io/en/

FOLX
https://mac.eltima.com/download-manager.html

IINA
https://lhc70000.github.io/iina/

Sourcetree
https://www.sourcetreeapp.com/

Microsoft Remote Desktop
https://itunes.apple.com/us/app/microsoft-remote-desktop-10/id1295203466?mt=12

VirtualBox
http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html

VMware OS Optimization Tool
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 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
# 修改默认 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下载

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

Others

更改 Apple ID 国家或地区

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

https://support.apple.com/zh-cn/ht201389

USB Type-C 耳机

  1. 插入耳机至任意USB Type-C 接口
  2. System Preferences -> Sound -> Output -> 选择识别到的耳机设备即可

配置从命令提示行启动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



相关文章

网友评论

    本文标题:MacBook 使用指北

    本文链接:https://www.haomeiwen.com/subject/tcxqvftx.html