• vim status 颜色配置


    修改这个文件   ~/.vimrc

    vim ~/.vimrc

    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

    效果:

     参考:

    https://stackoverflow.com/questions/5375240/a-more-useful-statusline-in-vim

  • 相关阅读:
    DVS6446教程链接
    今晚做的二值化和分割
    Sybase ETL
    QR码的结构
    cannot open file Default/configPkg/linker.cmd 错误
    QR 码的位置检测符
    QR Code
    C6000 OMAP DAVINCI的关系
    Davinci笔记 DSP子系统 VS ARM子系统
    ETL简介
  • 原文地址:https://www.cnblogs.com/lzzkz/p/14933222.html
Copyright © 2020-2023  润新知