关于macos:Mac电脑配置

7次阅读

共计 1943 个字符,预计需要花费 5 分钟才能阅读完成。

记录用于集体的 Mac 电脑配置

brew

Mac 罕用的终端下载工具,位置等同于 Linux 中的 apt、yum,非常好用

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

iTerm

间接官网下载:https://iterm2.com/
配置:
仅扭转下 terminal 的透明度和背景图片

zsh

1. 切换 zsh

# 查看零碎有几个 shell
cat /etc/shells

# 切换默认 shell,从新关上 terminal 失效
chsh -s /bin/zsh

2. 装置 oh-my-zsh

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

此时只有运行下面装置命令的用户能够应用 oh-my-zsh,如果其余用户想应用,就须要在以后用户下,将 $HOME 目录下的 .oh-my-zsh 拷贝到其余用户的 $HOME 目录,并批改 $HOME/.zshrc 中的 zsh 门路:export ZSH="/xxx/yyy"。批改实现后,运行 source $HOME/.zshrc 就能够应用了。

3. 装置语法高亮

# 下载 zsh-syntax-highlighting 插件
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

# 在 ~/.zshrc 应用 zsh-syntax-highlighting 插件
plugins=([plugins...] zsh-syntax-highlighting)

# 批改配置失效
source ~/.zshrc

4. 主动提醒命令

# 下载 zsh-autosuggestions 插件
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

# 在 ~/.zshrc 应用 zsh-autosuggestions 插件
plugins=([plugins...] zsh-autosuggestions)

# 批改配置失效
source ~/.zshrc

vim

简略配置:
将 basic.vim 文件内容拷贝到 ~/.vimrc

tmux

1. 装置

brew install tmux

2. 配置
Requirements:

  • tmux >= 2.3 (soon >= 2.4) running inside Linux, Mac, OpenBSD, Cygwin or WSL
  • awk, perl and sed
  • outside of tmux, $TERM must be set to xterm-256color

To install, run the following from your terminal: (you may want to backup your existing ~/.tmux.conf first)

$ cd ~
$ git clone https://github.com/gpakosz/.tmux.git
$ ln -s -f .tmux/.tmux.conf
$ cp .tmux/.tmux.conf.local .

简化命令

写入 .zshrc 文件开端

alias ll='ls -lA'

# tmux alias
alias tn='tmux new -s'
alias tl='tmux ls'
alias tk='tmux kill-session -t'
alias ta='tmux attach -t'

# git alias(借鉴于大佬)alias gg="git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue) <%an>%Creset'--abbrev-commit"
alias ggs="gg --stat"
alias ggp="gg -p"
alias gb="git branch"
alias gba="gb -a"
alias gbd="gb -d"
alias gbm="gb --merged"
alias gbnm="gb --no-merged"
alias gco="git checkout"
alias gcb="gco -b"
alias gct="gco --track"
alias gt="git tag"
alias gtd="gt -d"
alias grs="git reset --soft"
正文完
 0