Mac App 設定與使用

VSCode

快捷鍵

option + Up/Down : 行前後移
Cmd + X : 剪下
Cmd + C : 複製
Cmd + V : 貼上
Cmd + Z : 取消

Cmd + S : 存檔
Cmd + / : 註釋設定或取消
Cmd + Left/Right : 跳至行最前/最後
Cmd + F : 搜尋
Cmd + Up/Down : 跳至檔案最前/最後
Cmd + ]/[ : 縮排加/減
control + G : 跳至指定行
Cmd + K : 清除終端機
control + Cmd + F : 全螢幕
shift + Cmd + P : 命令列

截圖

Shift + Cmd + 3 : 截圖螢幕
Shift + Cmd + 4 : 截圖選取
Shift + Cmd + 4 + Sapce : 截圖視窗
Shift + Cmd + 5 : 截圖選擇功能

Command line tools

install

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# install
xcode-select --install
# test
xcode-select -p
# or belower command
xcode-select --print-path
# 是一條在 macOS 上配置 Xcode 命令行工具(Command Line Tools)使用路徑的命令
# 若有需要再執行
# sudo xcode-select --switch /Library/Developer/CommandLineTools


# if not success, check below
ls /Library/Developer
# if need, check macOS update
softwareupdate --list
softwareupdate --install -a

remove Command line tools(if need for reinstall)

1
2
sudo xcode-select --reset
sudo rm -rf /Library/Developer/CommandLineTools

Homebrew

install

1
2
3
4
5
6
7
8
9
10
11
12
# install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Apple Silicon (M1/M2 芯片),將以下內容添加到 ~/.zshrc 文件中:
export PATH="/opt/homebrew/bin:$PATH"
# 更新配置
source ~/.zshrc
# check path
ls /opt/homebrew/bin/brew
# check
brew --version
# can check path setting
echo $PATH

basic command

1
2
3
4
5
6
7
8
9
10
11
12
13
# search
brew search package_name

# install
brew install package_name

# upgrade Homebrew
brew update
# upgrade package
brew upgrade

# 列出已安裝的包
brew list

maintain

1
2
3
4
5
6
7
8
# check brew
brwe doctor

# check package information
brew info package_name

# clear don't need template
brew cleanup

git

install

1
brew install git

command

1
2
# change brecnch
git checkout brecnch_name

node.js

install

1
2
3
4
# down mac version the install
# check instelled complete
node --version
npm --version

hexo

install

1
2
3
npm install -g hexo-cli
# check
hex version

python

install

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# install pyenv
brew install pyenv
pyenv --version
# check support version
pyenv install --list
# install/uninstall python
pyenv install 3.10.12
pyenv uninstall 3.10.12
# check version
python --version
Python 3.10.12
pyenv version
3.10.12 (set by /Users/gaoyiping/.pyenv/version)
# show all install
pyenv versions
system
* 3.10.12 (set by /Users/gaoyiping/.pyenv/version)
3.11.6
3.11.6/envs/my3116
my3116 --> /Users/gaoyiping/.pyenv/versions/3.11.6/envs/my3116
# change python's version
pyenv global 3.11.6
pyenv versions
system
3.10.12
* 3.11.6 (set by /Users/gaoyiping/.pyenv/version)
3.11.6/envs/my3116
my3116 --> /Users/gaoyiping/.pyenv/versions/3.11.6/envs/my3116
python --version
Python 3.11.6
# install pyenv-virtualenv
brew install pyenv-virtualenv
# add env
pyenv virtualenv 3.1.16 my3116
# switch env
gaoyiping@gaoyipingdeMacBook-Pro ~ % pyenv activate my3116
(my3116) gaoyiping@gaoyipingdeMacBook-Pro ~ % pyenv versions
system
3.10.12
3.11.6
3.11.6/envs/my3116
* my3116 --> /Users/gaoyiping/.pyenv/versions/3.11.6/envs/my3116 (set by PYENV_VERSION environment variable)
(my3116) gaoyiping@gaoyipingdeMacBook-Pro ~ % python --version
Python 3.11.6

set VS Code python version

Shift + Cmd + P

nano

  • control + O : 儲存
  • control + X : 離開程式

滑鼠運行(修正滑鼠滑動方向)

marta(檔案總管)

1
2
# install 
brew install --cask marta

參考資料