将以下内容添加到~/.vimrc文件中:
- set statusline=
- set statusline+=%7*\[%n] "buffernr
- set statusline+=%1*\ %<%F\ "文件路径
- set statusline+=%2*\ %y\ "文件类型
- set statusline+=%3*\ %{‘‘.(&fenc!=‘‘?&fenc:&enc).‘‘} "编码1
- set statusline+=%3*\ %{(&bomb?\",BOM\":\"\")}\ "编码2
- set statusline+=%4*\ %{&ff}\ "文件系统(dos/unix..)
- set statusline+=%5*\ %{&spelllang}\%{HighlightSearch()}\ "语言 & 是否高亮,H表示高亮?
- set statusline+=%8*\ %=\ row:%l/%L\ (%03p%%)\ "光标所在行号/总行数 (百分比)
- set statusline+=%9*\ col:%03c\ "光标所在列
- set statusline+=%0*\ \ %m%r%w\ %P\ \ "Modified? Read only? Top/bottom
如果需要设置颜色看这里
时间: 2024-10-05 12:42:06