Ubuntu&Mac 常用配置

186 阅读1分钟

概览

  • Homebrew
  • WSL
  • oh-my-zsh
  • nvm

Homebrew

# 安装软件
brew install xxx

# 搜索软件
brew search xxx

# 查看软件信息
brew info xxx

# 卸载软件并删除与之关联的所有文件
brew uninstall --zap xxx

# 列出可更新的包
brew outdated

# 更新所有
brew upgrade

# 更新指定包
brew upgrade xxx

WSL

# 使用windows的clash配置
alias setp='export https_proxy="http://host.docker.internal:7897";export http_proxy="http://host.docker.internal:7897";export all_proxy="socks5://host.docker.internal:7897";'
alias unsetp='unset https_proxy; unset http_proxy; unset all_proxy; unset ALL_PROXY;'

oh-my-zsh

  • 查看系统shell cat /etc/shells
  • 设置zsh为默认shell chsh -s /bin/zsh
  • 安装 oh-my-zsh
# 配置
ZSH_THEME="half-life"

# you-should-use
git clone https://github.com/MichaelAquilina/zsh-you-should-use.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/you-should-use

plugins=(
    git
    sudo
    common-aliases
    colored-man-pages
    z
    you-should-use
    my-custom-commands
)

micro

# 安装
sudo apt install micro

# 设置系统级的默认编辑器
sudo update-alternatives --config editor

nvm