Nvim: hide EndOfBuffer markers

This commit is contained in:
Marco Hinz 2021-03-31 19:37:48 +02:00
parent d663f4db7a
commit f20cef34ba
No known key found for this signature in database
GPG key ID: 1C980A1B657B4A4F

View file

@ -152,6 +152,8 @@ function! startify#insane_in_the_membrane(on_vimenter) abort
setlocal nomodifiable nomodified
call s:hide_endofbuffer_markers()
call s:set_mappings()
call cursor(b:startify.firstline, 5)
autocmd startify CursorMoved <buffer> call s:set_cursor()
@ -1111,6 +1113,24 @@ function s:transform(absolute_path)
return ''
endfunction
" Function: s:hide_endofbuffer_markers {{{1
" Use the bg color of Normal to set the fg color of EndOfBuffer, effectively
" hiding it.
function! s:hide_endofbuffer_markers()
if !exists('+winhl')
return
endif
let val = synIDattr(hlID('Normal'), 'bg')
if empty(val)
return
elseif val =~ '^\d*$'
execute 'highlight StartifyEndOfBuffer ctermfg='. val
else
execute 'highlight StartifyEndOfBuffer guifg='. val
endif
setlocal winhighlight=EndOfBuffer:StartifyEndOfBuffer
endfunction
" Function: s:warn {{{1
function! s:warn(msg) abort
echohl WarningMsg