vim status 颜色配置

2021/6/26 6:28:11

本文主要是介绍vim status 颜色配置,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

------------恢复内容开始------------

mac terminal 里的颜色要使用 ctermfgctermbg ,(guifg guibg 都是无效的)

颜色值 只有部分 颜色名称 和 0-255 数字有效

颜色从这里选

https://jonasjacek.github.io/colors/

256 种颜色部分截图

 

 

 

 .vimrc 配置代码

" vim comments start with "

" Turn on syntax highlighting.
syntax on

" Show line numbers.
set numnr

" Show status bar
set laststatus=2

set statusline=
set statusline+=%0*\[%n]                                  "buffernr
set statusline+=%1*\ %<%F\                                "File+path
set statusline+=%2*\ %y\                                  "FileType
set statusline+=%3*\ %{''.(&fenc!=''?&fenc:&enc).''}      "Encoding
set statusline+=%3*\ %{(&bomb?\",BOM\":\"\")}\            "Encoding2
set statusline+=%4*\ %{&ff}\                              "FileFormat (dos/unix..)
set statusline+=%5*\ %{&spelllang}\%{HighlightSearch()}\  "Spellanguage & Highlight on?
set statusline+=%6*\ %=\ row:%l/%L\ (%03p%%)\             "Rownumber/total (%)
set statusline+=%7*\ col:%03c\                            "Colnr
set statusline+=%8*\ \ %m%r%w\ %P\ \                      "Modified? Readonly? Top/bot.


function! HighlightSearch()
  if &hls
    return 'H'
  else
    return ''
  endif
endfunction

hi User0 ctermfg=white  ctermbg=160 " Red3
hi User1 ctermfg=white  ctermbg=160 " Red3
hi User2 ctermfg=white  ctermbg=161
hi User3 ctermfg=white  ctermbg=162
hi User4 ctermfg=white  ctermbg=163
hi User5 ctermfg=white  ctermbg=164
hi User6 ctermfg=white  ctermbg=168

 

效果:

 

 

 

------------恢复内容结束------------

------------恢复内容开始------------

------------恢复内容开始------------

mac terminal 里的颜色要使用 ctermfgctermbg ,(guifg guibg 都是无效的)

颜色值 只有部分 颜色名称 和 0-255 数字有效

颜色从这里选

https://jonasjacek.github.io/colors/

256 种颜色部分截图

 

 

 

 .vimrc 配置代码

" vim comments start with "

" Turn on syntax highlighting.
syntax on

" Show line numbers.
set numnr

" Show status bar
set laststatus=2

set statusline=
set statusline+=%0*\[%n]                                  "buffernr
set statusline+=%1*\ %<%F\                                "File+path
set statusline+=%2*\ %y\                                  "FileType
set statusline+=%3*\ %{''.(&fenc!=''?&fenc:&enc).''}      "Encoding
set statusline+=%3*\ %{(&bomb?\",BOM\":\"\")}\            "Encoding2
set statusline+=%4*\ %{&ff}\                              "FileFormat (dos/unix..)
set statusline+=%5*\ %{&spelllang}\%{HighlightSearch()}\  "Spellanguage & Highlight on?
set statusline+=%6*\ %=\ row:%l/%L\ (%03p%%)\             "Rownumber/total (%)
set statusline+=%7*\ col:%03c\                            "Colnr
set statusline+=%8*\ \ %m%r%w\ %P\ \                      "Modified? Readonly? Top/bot.


function! HighlightSearch()
  if &hls
    return 'H'
  else
    return ''
  endif
endfunction

hi User0 ctermfg=white  ctermbg=160 " Red3
hi User1 ctermfg=white  ctermbg=160 " Red3
hi User2 ctermfg=white  ctermbg=161
hi User3 ctermfg=white  ctermbg=162
hi User4 ctermfg=white  ctermbg=163
hi User5 ctermfg=white  ctermbg=164
hi User6 ctermfg=white  ctermbg=168

 

效果:

 

 

 

------------恢复内容结束------------

------------恢复内容结束------------

------------恢复内容开始------------

------------恢复内容开始------------

mac terminal 里的颜色要使用 ctermfgctermbg ,(guifg guibg 都是无效的)

颜色值 只有部分 颜色名称 和 0-255 数字有效

颜色从这里选

https://jonasjacek.github.io/colors/

256 种颜色部分截图

 

 

 

 .vimrc 配置代码

" vim comments start with "

" Turn on syntax highlighting.
syntax on

" Show line numbers.
set numnr

" Show status bar
set laststatus=2

set statusline=
set statusline+=%0*\[%n]                                  "buffernr
set statusline+=%1*\ %<%F\                                "File+path
set statusline+=%2*\ %y\                                  "FileType
set statusline+=%3*\ %{''.(&fenc!=''?&fenc:&enc).''}      "Encoding
set statusline+=%3*\ %{(&bomb?\",BOM\":\"\")}\            "Encoding2
set statusline+=%4*\ %{&ff}\                              "FileFormat (dos/unix..)
set statusline+=%5*\ %{&spelllang}\%{HighlightSearch()}\  "Spellanguage & Highlight on?
set statusline+=%6*\ %=\ row:%l/%L\ (%03p%%)\             "Rownumber/total (%)
set statusline+=%7*\ col:%03c\                            "Colnr
set statusline+=%8*\ \ %m%r%w\ %P\ \                      "Modified? Readonly? Top/bot.


function! HighlightSearch()
  if &hls
    return 'H'
  else
    return ''
  endif
endfunction

hi User0 ctermfg=white  ctermbg=160 " Red3
hi User1 ctermfg=white  ctermbg=160 " Red3
hi User2 ctermfg=white  ctermbg=161
hi User3 ctermfg=white  ctermbg=162
hi User4 ctermfg=white  ctermbg=163
hi User5 ctermfg=white  ctermbg=164
hi User6 ctermfg=white  ctermbg=168

 

效果:

 

 

 

------------恢复内容结束------------

------------恢复内容开始------------

------------恢复内容开始------------

mac terminal 里的颜色要使用 ctermfgctermbg ,(guifg guibg 都是无效的)

颜色值 只有部分 颜色名称 和 0-255 数字有效

颜色从这里选

https://jonasjacek.github.io/colors/

256 种颜色部分截图

 

 

 

 .vimrc 配置代码

" vim comments start with "

" Turn on syntax highlighting.
syntax on

" Show line numbers.
set numnr

" Show status bar
set laststatus=2

set statusline=
set statusline+=%0*\[%n]                                  "buffernr
set statusline+=%1*\ %<%F\                                "File+path
set statusline+=%2*\ %y\                                  "FileType
set statusline+=%3*\ %{''.(&fenc!=''?&fenc:&enc).''}      "Encoding
set statusline+=%3*\ %{(&bomb?\",BOM\":\"\")}\            "Encoding2
set statusline+=%4*\ %{&ff}\                              "FileFormat (dos/unix..)
set statusline+=%5*\ %{&spelllang}\%{HighlightSearch()}\  "Spellanguage & Highlight on?
set statusline+=%6*\ %=\ row:%l/%L\ (%03p%%)\             "Rownumber/total (%)
set statusline+=%7*\ col:%03c\                            "Colnr
set statusline+=%8*\ \ %m%r%w\ %P\ \                      "Modified? Readonly? Top/bot.


function! HighlightSearch()
  if &hls
    return 'H'
  else
    return ''
  endif
endfunction

hi User0 ctermfg=white  ctermbg=160 " Red3
hi User1 ctermfg=white  ctermbg=160 " Red3
hi User2 ctermfg=white  ctermbg=161
hi User3 ctermfg=white  ctermbg=162
hi User4 ctermfg=white  ctermbg=163
hi User5 ctermfg=white  ctermbg=164
hi User6 ctermfg=white  ctermbg=168

 

效果:

 

 

 

------------恢复内容结束------------

------------恢复内容结束------------

------------恢复内容结束------------



这篇关于vim status 颜色配置的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程