【TIPS】修改Mac OS中ls命令结果颜色和vim编辑器配色

1. 修改命令提示颜色

vim ~/.bash_profile

添加配置:

export TERM="xterm-color"
export PS1='[\u@\h:\W]$ '

说明:

\u  表示计算机用户名

\h  表示计算机名

\W  表示当前目录

然后保存并退出。并执行:

sh ~/.bash_profile

2.修改ls命令和ps命令结果颜色

vim ~/.bash_profile

添加配置: 

# Tell ls to be colourful
export CLICOLOR=1
export LSCOLORS=Exfxcxdxbxegedabagacad

# Tell grep to highlight matches
export GREP_OPTIONS='--color=auto'

然后保存并退出。

3. 修改vim编辑器配色方案

vim ~/.vimrc

添加配置:

colorscheme desert
syntax on

说明:这里的“desert”只是众多颜色方案中的一种,可以在目录“/usr/share/vim/vim80/colors”下查看所有的颜色方案(目录中的vim80可能是其他的数字)

扫描二维码关注公众号,回复: 2519429 查看本文章

然后保存并退出。

猜你喜欢

转载自blog.csdn.net/weixin_42534940/article/details/81252153