- vim 拥有语法高亮显示
vim ~/.vimrc
syntax on "進行語法檢驗,顏色顯示
set hlsearch "高亮度反白
set backspace=2 "可隨時用倒退鍵刪除
set autoindent "自動縮排
set ruler "可顯示最後一列的狀態
set showmode "左下角那一列的狀態
set tabstop=4 "一个tab是4个字符
set ambiwidth=double "显示中文引号
- ll 命令在 macOS 下无法使用
vim ~/.bash_profile
alias ls='ls -G'
alias ll='ls -al'
alias grep='grep --color'
- Mac终端ls显示不同文件类型的颜色
在.bash_profile里添加下面两个语句:
export CLICOLOR=1
export LSCOLORS=1212121212121212121212
LSCOLORS的具体设置看下面:
LSCOLORS的1对应前景色,2对应背景色。LSCOLORS共有11组”12”设置,每组"12"对应文件类型如下:
1. directory
2. symbolic link
3. socket
4. pipe
5. executable (可执行文件,x权限)
6. block special
7. character special
8. executable with setuid bit set (setuid=Set User ID,属主身份)
9. executable without setgid bit set
10. directory writable to others, with sticky bit
11. directory writable to others, without sticky bit
字母代表的颜色如下:
a black
b red
c green
d brown
e blue
f magenta
g cyan
h light grey
A bold black, usually shows up as dark grey
B bold red
C bold green
D bold brown, usually shows up as yellow
E bold blue
F bold magenta
G bold cyan
H bold light grey; looks like bright white
x default foreground or background (透明)
例如: export LSCOLORS=bxfxhxhxgxhxhxgxgxbxbx
x代表不设置背景色,所以上述设置第一组的bx表示,目录不设置背景色,目录的前景色设置为红色