Use vim-colorschemes and configure statusline to work

pull/1/head
Ensar Sarajčić 2021-01-16 19:24:47 +01:00
parent d634473980
commit 4e844a01a4
3 changed files with 72 additions and 1441 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2,12 +2,48 @@
" - Statusline setup - " - Statusline setup -
" ----------------------------------------------------------------------------- " -----------------------------------------------------------------------------
" Configure user colors for proper focus management function s:UpdateColors()
hi! link User1 StatusLineGreenFg let ctermbg = synIDattr(synIDtrans(hlID('StatusLine')), 'bg', 'cterm')
hi! link User2 StatusLineRedFg let guibg = synIDattr(synIDtrans(hlID('StatusLine')), 'bg', 'gui')
hi! link User3 StatusLineYellowFg let idguifg1 = synIDattr(synIDtrans(hlID('Function')), 'fg', 'gui')
hi! link User4 StatusLineBlueFg let idctermfg1 = synIDattr(synIDtrans(hlID('Function')), 'fg', 'cterm')
hi! link User5 StatusLinePurpleFg " Green in gruvbox
exec 'hi User1 guifg=' . l:idguifg1 .
\' ctermfg=' . l:idctermfg1 .
\' cterm=bold,reverse gui=bold,reverse'
let idguifg2 = synIDattr(synIDtrans(hlID('WarningMsg')), 'fg', 'gui')
let idctermfg2 = synIDattr(synIDtrans(hlID('WarningMsg')), 'fg', 'cterm')
" Red in gruvbox
exec 'hi User2 guifg=' . l:idguifg2 .
\' ctermfg=' . l:idctermfg2 .
\' cterm=bold,reverse gui=bold,reverse'
let idguifg3 = synIDattr(synIDtrans(hlID('MoreMsg')), 'fg', 'gui')
let idctermfg3 = synIDattr(synIDtrans(hlID('MoreMsg')), 'fg', 'cterm')
" Yellow in gruvbox
exec 'hi User3 guifg=' . l:idguifg3 .
\' ctermfg=' . l:idctermfg3 .
\' cterm=bold,reverse gui=bold,reverse'
let idguifg4 = synIDattr(synIDtrans(hlID('Identifier')), 'fg', 'gui')
let idctermfg4 = synIDattr(synIDtrans(hlID('Identifier')), 'fg', 'cterm')
" Blue in gruvbox
exec 'hi User4 guifg=' . l:idguifg4 .
\' ctermfg=' . l:idctermfg4 .
\' cterm=bold,reverse gui=bold,reverse'
let idguifg5 = synIDattr(synIDtrans(hlID('Number')), 'fg', 'gui')
let idctermfg5 = synIDattr(synIDtrans(hlID('Number')), 'fg', 'cterm')
" Blue in gruvbox
exec 'hi User5 guifg=' . l:idguifg5 .
\' ctermfg=' . l:idctermfg5 .
\' cterm=bold,reverse gui=bold,reverse'
endfunction
augroup statuslineconf
autocmd!
autocmd ColorScheme * call s:UpdateColors()
augroup END
call s:UpdateColors()
" Checks file type to add a pretty glyph if available " Checks file type to add a pretty glyph if available
function s:GetFileType() function s:GetFileType()
@ -95,14 +131,20 @@ endfunction
function GetStatusLine() function GetStatusLine()
let l:status_line_left = s:GetMode() let l:status_line_left = s:GetMode()
if exists('g:loaded_fugitive') if exists('g:loaded_fugitive')
let l:status_line_left .= "%4* " . FugitiveHead() . "%*" let l:fugitive_head = FugitiveHead()
if strlen(l:fugitive_head)
let l:status_line_left .= "%4*  " . l:fugitive_head . " %*"
endif
endif endif
let l:status_line_left .= " %f" " Filename let l:status_line_left .= " %f" " Filename
let l:status_line_left .= " %1*%M%*" " Modified let l:status_line_left .= " %1*%M%*" " Modified
let l:status_line_left .= " %2*%r%*" " Read only let l:status_line_left .= " %2*%r%*" " Read only
let l:status_line_left .= s:PasteForStatusline() let l:status_line_left .= s:PasteForStatusline()
if exists('g:did_coc_loaded') if exists('g:did_coc_loaded')
let l:status_line_left .= "%2*" . coc#status() . "%*" let l:coc_status = coc#status()
if strlen(l:coc_status)
let l:status_line_left .= "%2* " . l:coc_status . " %*"
endif
endif endif
let l:status_line_right = "%= " " Align right statusline let l:status_line_right = "%= " " Align right statusline
if exists('g:loaded_ale') if exists('g:loaded_ale')

View File

@ -45,6 +45,8 @@ Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim' Plug 'junegunn/fzf.vim'
Plug 'mhinz/vim-grepper' Plug 'mhinz/vim-grepper'
Plug 'direnv/direnv.vim' Plug 'direnv/direnv.vim'
Plug 'flazz/vim-colorschemes'
Plug 'tpope/vim-speeddating'
" ----------------------------------------------------------------------------- " -----------------------------------------------------------------------------
" - Autocompletion - " - Autocompletion -
@ -85,11 +87,6 @@ Plug 'tpope/vim-rails'
Plug 'mattn/emmet-vim' Plug 'mattn/emmet-vim'
Plug 'vimwiki/vimwiki' Plug 'vimwiki/vimwiki'
" -----------------------------------------------------------------------------
" - Other Improvements -
" -----------------------------------------------------------------------------
Plug 'tpope/vim-speeddating'
call plug#end() call plug#end()
filetype plugin indent on filetype plugin indent on