Skip to content

Commit

Permalink
Use original colors
Browse files Browse the repository at this point in the history
  • Loading branch information
MaraniMatias committed Apr 30, 2018
1 parent d12a45b commit ebe2b37
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@

A tiny **ele**gant status**line** for vim, extracted from [space-vim](https://github.com/liuchengxu/space-vim).

- Normal mode
- Ordinary font

![screenshot](https://raw.githubusercontent.com/MaraniMatias/eleline.vim/mm/screenshot/normal-mode.png)

- Insert mode

![screenshot](https://raw.githubusercontent.com/MaraniMatias/eleline.vim/mm/screenshot/insert-mode.png)
![screenshot](https://github.com/liuchengxu/eleline.vim/blob/screenshots/screenshot.png?raw=true)

- Powerline font

If the powerline font is available, i.e., `let g:airline_powerline_fonts = 1` or `let g:eleline_powerline_fonts = 1`:

![screenshot](https://raw.githubusercontent.com/liuchengxu/img/master/eleline.vim/eleline-powerline-font.png)

Don't forget to `set laststatus=2` to always display statusline in vim.

Supported plugins:
Expand Down
31 changes: 15 additions & 16 deletions plugin/eleline.vim
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,10 @@ function! s:MyStatusLine()
endfunction

let s:colors = {
\ 140 : '#af87d7', 149 : '#99cc66', 171 : '#d75fd7',
\ 178 : '#ffbb7d', 184 : '#ffe920', 208 : '#ff8700',
\ 232 : '#333300', 197 : '#cc0033', 214 : '#ffff66',
\ 140 : '#af87d7', 149 : '#99cc66', 160 : '#d70000',
\ 171 : '#d75fd7', 178 : '#ffbb7d', 184 : '#ffe920',
\ 208 : '#ff8700', 232 : '#333300', 197 : '#cc0033',
\ 214 : '#ffff66',
\
\ 235 : '#262626', 236 : '#303030', 237 : '#3a3a3a',
\ 238 : '#444444', 239 : '#4e4e4e', 240 : '#585858',
Expand All @@ -145,8 +146,6 @@ let s:colors = {
\ 247 : '#9e9e9e', 248 : '#a8a8a8', 249 : '#b2b2b2',
\ 250 : '#bcbcbc', 251 : '#c6c6c6', 252 : '#d0d0d0',
\ 253 : '#dadada', 254 : '#e4e4e4', 255 : '#eeeeee',
\
\ 7 : '#c0c0c0', 196 : '#ff0000', 179 : '#d7af5f', 39 : '#00afff',
\ }

function! s:hi(group, fg, bg, ...)
Expand Down Expand Up @@ -174,13 +173,13 @@ if has('termguicolors') && &termguicolors
endif

function! s:hi_statusline()
call s:hi('User1' , 7 , s:bg+8 )
call s:hi('paste' , 232 , s:bg+1 , 'bold')
call s:hi('User2' , 178 , s:bg+6 )
call s:hi('User3' , 250 , s:bg+4 )
call s:hi('User4' , 39, s:bg+3 , 'bold' )
call s:hi('User5' , 208 , s:bg+2 )
call s:hi('User6' , 184 , s:bg+3 , 'bold' )
call s:hi('User1' , 232 , 178 )
call s:hi('paste' , 232 , 178 , 'bold')
call s:hi('User2' , 178 , s:bg+8 )
call s:hi('User3' , 250 , s:bg+6 )
call s:hi('User4' , 171 , s:bg+4 , 'bold' )
call s:hi('User5' , 208 , s:bg+3 )
call s:hi('User6' , 184 , s:bg+2 , 'bold' )

call s:hi('gutter' , 184 , s:bg+2)
call s:hi('ale_error' , 197 , s:bg+2)
Expand All @@ -195,11 +194,11 @@ endfunction

function! InsertStatuslineColor(mode)
if a:mode == 'i'
call s:hi('User1' , 239 , 179 )
call s:hi('User1' , 232 , 171 )
elseif a:mode == 'r'
call s:hi('User1' , 239 , 196 )
call s:hi('User1' , 232 , 160 )
else
call s:hi('User1' , 7 , s:bg+8 )
call s:hi('User1' , 232 , 178 )
endif
endfunction

Expand All @@ -224,7 +223,7 @@ augroup eleline
" Change colors for insert mode
autocmd InsertEnter * call InsertStatuslineColor(v:insertmode)
autocmd InsertChange * call InsertStatuslineColor(v:insertmode)
autocmd InsertLeave * call s:hi('User1' , 7 , s:bg+8 )
autocmd InsertLeave * call s:hi('User1' , 232 , 178 )
augroup END

let &cpoptions = s:save_cpo
Expand Down

0 comments on commit ebe2b37

Please sign in to comment.