morhetz / gruvbox

Retro groove color scheme for Vim
13.63k stars 1.11k forks source link

Lightline color scheme not work on terminal but work on VimR #308

Closed lihsai0 closed 4 years ago

lihsai0 commented 4 years ago

macOS 10.15.2 (19C57)

iTerm2 Build 3.3.7

NeoVim v0.4.3

image

" ~/.config/nvim/init.vim
" Specify a directory for plugins
" - For Neovim: stdpath('data') . '/plugged'
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')

" Make sure you use single quotes

" Color Scheme
Plug 'morhetz/gruvbox'

" Welcome plugin
Plug 'mhinz/vim-startify'

" Status Bar
" Plug 'vim-airline/vim-airline'
Plug 'itchyny/lightline.vim'

" Show Indent Line
Plug 'yggdroot/indentline'

" [Best At Last] Add Icons To Other Plugins
Plug 'ryanoasis/vim-devicons'

" Initialize plugin system
call plug#end()

"=====================================================
"===================== SETTINGS ======================

" SetTheme
colorscheme gruvbox

" General Setting
set number
" disable show mode because of *line
set noshowmode

" Map
" normal map
nnoremap <space> viw

" Insert Map

" Visaul Map

"=====================================================
"================== PLUG SETTINGS ===================

" lightline
let g:lightline = {
      \ 'colorscheme': 'gruvbox',
      \ 'component_function': {
      \   'filetype': 'MyFiletype',
      \   'fileformat': 'MyFileformat',
      \ }
\ }

function! MyFiletype()
  return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype . ' ' . WebDevIconsGetFileTypeSymbol() : 'no ft') : ''
endfunction

function! MyFileformat()
  return winwidth(0) > 70 ? (&fileformat . ' ' . WebDevIconsGetFileFormatSymbol()) : ''
endfunction
lihsai0 commented 4 years ago

My Bad

set termguicolors