# 配置全局忽略文件
git config --global core.excludesfile ~/.gitignore_global
# 添加 .DS_Store 文件到全局忽略文件
echo .DS_Store >> ~/.gitignore_global
echo ._.DS_Store >> ~/.gitignore_global
echo **/.DS_Store >> ~/.gitignore_global
echo **/._.DS_Store >> ~/.gitignore_global
在终端使用 export
命令设置 PATH
并不能全局生效,如果你想设置全局 PATH
,可以使用以下这个方法:
sudo mkdir /etc/paths.d/mypath
vim /etc/paths.d/mypath
/your/path
有时候使用 VSCode 调试或运行程序后,无法成功推出程序,端口一直占用。
查看端口占用:
# [port] 替换成你想查看的端口号,例如:sudo lsof -i tcp:8080
sudo lsof -i tcp:[port]
上述命令可以得到程序的进程 PID,退出进程:
# [PID] 替换成程序的进程 PID
sudo kill -9 [PID]
rm -rfv ~/Library/Containers/com.charliemonroe.Downie-4/Data/Library/Application\ Support/Downie\ 4
配置快捷命令:
vim ~/.zsh
alias reset-downie-trial='rm -rfv ~/Library/Containers/com.charliemonroe.Downie-4/Data/Library/Application\ Support/Downie\ 4'
mkdir -p ~/.dev/bin
echo "export PATH=$PATH:~/.dev/bin"
/Applications/Python\ 3.6/Install\ Certificates.command
go clean -cache
npm cache clean --force
sudo npm cache clean --force
yarn cache clean
# install cargo-cache
cargo install cargo-cache
# clean cache
cargo cache --autoclean
解决 iTerm2 下使用 Solarized Dark 主题时,zsh-autosuggestions 显示问题:
vim .oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
找到并配置:ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10'
exec zsh
如果遇到 Failed to launch: could not launch process: can not run under Rosetta, check that the installed build of Go is right for your CPU architecture
问题,尝试以下解决方案:
安装最新版本的 delve
:
go install github.com/go-delve/delve/cmd/dlv@latest