macVim statusline没有颜色,直到我调用“:so~ / .vimrc”

时间:2014-10-01 04:36:34

标签: vim macvim

我试图在macvim中格式化我的状态行。 格式化工作正常,状态行反映以下代码(存储在~/.vimrc),但与颜色设置无关。它显示为默认颜色,直到i :so ~/.vimrc之后,一切都应该如此。

问题是什么?

set laststatus=2

hi statusline       guibg=#ffaa00   guifg=#000000

hi StatusLineLeft   guibg=#ffaa00   guifg=#000000
hi StatusLineRight  guibg=#000000   guifg=#ffaa00
hi StatusLineWrap   guibg=#000000   guifg=#ff4400
hi StatusLineGrey   guibg=#000000   guifg=#444444

set statusline=
set statusline+=%#StatusLineLeft#
set statusline+=%.28F      " Path to the file
set statusline+=\           " just a space
set statusline+=%#StatusLineRight#
set statusline+=%=        " Switch to the right side
set statusline+=%#StatusLineGrey#
set statusline+=\ [%b][0x%B]\   " byte under the curror
set statusline+=%#StatusLineRight#
set statusline+=%l        " Current line
set statusline+=/         " Separator
set statusline+=%L        " Total lines

1 个答案:

答案 0 :(得分:-1)

colorscheme会重置所有现有的突出显示定义,因此任何其他突出显示定义(如自定义状态行的:hi命令)必须在<{strong> :colorscheme命令后