From f6c8b8d8fac57e473e66a2fd061a564d72d66252 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Thu, 23 Apr 2020 10:17:54 +0530 Subject: [PATCH] nvim: Fix color scheme setting point It seems since we are using hard coded colors, so we do not need the auto command at all. Getting rid of it gives the right results. Signed-off-by: Sanchayan Maity --- nvim/.config/nvim/init.vim | 2 ++ nvim/.config/nvim/plugin/statusline.vim | 24 ++++++++---------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index dd68e3a..9ff85eb 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -185,6 +185,8 @@ set completeopt=menu,noselect,preview,noinsert set sessionoptions-=blank set grepprg=rg\ --vimgrep +colorscheme gruvbox8_hard + " --------------------------- Key Bindings ----------------------------------- " Allow saving of files as sudo when I forgot to start vim using sudo cmap w!! w !sudo tee > /dev/null % diff --git a/nvim/.config/nvim/plugin/statusline.vim b/nvim/.config/nvim/plugin/statusline.vim index 74d333f..cc14881 100644 --- a/nvim/.config/nvim/plugin/statusline.vim +++ b/nvim/.config/nvim/plugin/statusline.vim @@ -4,18 +4,14 @@ augroup UserStatusline autocmd WinLeave * setlocal statusline=%!PassiveStatus() augroup END -augroup UserStatusLineColors - autocmd! - autocmd ColorScheme * - \ hi User1 guifg=DarkRed guibg=Black | - \ hi User2 guifg=White guibg=Black | - \ hi User3 guifg=Cyan guibg=Black | - \ hi User4 guifg=Orange guibg=Black | - \ hi User5 guifg=Red guibg=Black | - \ hi User6 guifg=Gray guibg=Black | - \ hi User7 guifg=Gray guibg=Black | - \ hi User8 guifg=DarkYellow guibg=Black -augroup END +hi User1 guifg=DarkRed guibg=Black +hi User2 guifg=White guibg=Black +hi User3 guifg=Cyan guibg=Black +hi User4 guifg=Orange guibg=Black +hi User5 guifg=Red guibg=Black +hi User6 guifg=Gray guibg=Black +hi User7 guifg=Gray guibg=Black +hi User8 guifg=DarkYellow guibg=Black function! GitInfo() let git = fugitive#head() @@ -77,7 +73,3 @@ function! PassiveStatus() abort endfunction set statusline=%!ActiveStatus() -" The colorscheme needs to be set here as it seems the autocmd group handling -" color scheme must always be defined before the colorscheme is set else the -" custom highlighting color groups for status line do not seem to take effect. -colorscheme gruvbox8_hard