liuchengxu / eleline.vim

:herb: Another elegant statusline for vim
MIT License
311 stars 79 forks source link

中间显示有问题,一长条的粉色 #2

Closed dalutou closed 7 years ago

dalutou commented 7 years ago

环境是 macOS 10.12,VIM 7.4。 vim-gitgutter,vim-fugitive 这两个插件已安装。 中间显示有问题,一长条的粉色,对比如下:

jietu20170324-200034
liuchengxu commented 7 years ago

你使用的 vim 主题是什么?terminal vim 与 MacVim 都是这个情况?一打开 vim 就是这样?

关于那两个颜色不同的 0,我已经提交修复了,请进行更新看是否解决。另外,要支持 ale 的话,还需要在 .vimrc 中添加额外两个函数 ALEGetError()ALEGetWarning(),并设置 let g:ale_statusline_format = ['E•%d', 'W•%d', 'OK'], https://github.com/liuchengxu/space-vim/blob/master/layers/%2Bcheckers/syntax-checking/config.vim#L23-L50

dalutou commented 7 years ago

我用的是mac自带的 vim 7.4,因为 ale 需要 NeoVim 或 Vim 8 以上,所以装不上这个插件。

主题的话,无论是ZSH_THEME="robbyrussell",或者自带的 Terminal里启用 zsh 或 bash 后不用任何主题,都是这种效果。

希望可以解决不启用 ale 的显示问题。 以下是,刚更新后,:PlugStatus 的截图,可以看到, 右边窗口不是粉色,是灰色。

jietu20170324-205543
liuchengxu commented 7 years ago

0 消失的话,说明 ale 的显示问题已经解决了。

我的意思是 vim colorscheme 是什么?:echo g:colors_name.

看一下 :verbose hi statusline 是什么。另外,注释掉 eleline.vim 看状态栏是什么样。现在的问题只剩状态栏的颜色显示了。

dalutou commented 7 years ago

没有定义过 vim 的 colorscheme ,:echo g:colors_name 会报错

以下是我的 .vimrc

set nocompatible
syntax on
" filetype plugin indent on
set encoding=utf-8
set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936
set fileencodings=utf-8,ucs-bom,chinese
"set paste

set ambiwidth=double
set noswapfile
set nobackup
set nowritebackup
set history=20          " keep 20 lines of command line history
set laststatus=2

" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
" Make sure you use single quotes
" Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
Plug 'liuchengxu/eleline.vim'
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-fugitive'

" Plug 'mattn/emmet-vim'

call plug#end()
jietu20170324-211958
liuchengxu commented 7 years ago

mac 下使用 brew 安装 vim8 是非常方便的....

:verbose hi statusline 看是什么。

dalutou commented 7 years ago

:verbose hi statusline 输出如下

StatusLine     xxx term=bold,reverse cterm=bold,reverse ctermfg=140 ctermbg=237 gui=bold,reverse
                   guifg=#af87d7 guibg=#3a3a3a
        Last set from ~/.vim/plugged/eleline.vim/plugin/eleline.vim

或许晚点可以尝试下 vim8。

liuchengxu commented 7 years ago

大概知道了, :hi statusline ctermfg=None 试一下。

dalutou commented 7 years ago

:hi statusline ctermfg=None 然后粉色就变成灰白了。配色还是不大协调,不知道该怎么改。

jietu20170324-214038

另外,希望能增加简单的使用文档,我这种小白,刚开始一直看不到插件的效果,直到加了 set laststatus=2

liuchengxu commented 7 years ago

这是 vim 的一个 bug, https://github.com/liuchengxu/space-vim-dark/blob/master/colors/space-vim-dark.vim#L330:hi statueline ctermfg=237 颜色就正常了,不过这“治标不治本”。其实随便添加一个主题插件就可以了,比如 Plug 'liuchengxu/space-vim-dark', 应该就没问题了。

这个插件因为比较简单,也没有什么配置项,基本不用什么文档。set laststatus=2 这一点我会在 README 中添加说明。

新手的话,其实可以用一下 space-vim, 有中文文档。我一开始也是用的别人的配置,熟悉以后,可以自己配置一套。

dalutou commented 7 years ago

原来如此,居然有这么个 bug,终于好了。非常感谢你的耐心解答。