Nvim: hide EndOfBuffer markers
This commit is contained in:
parent
d663f4db7a
commit
f20cef34ba
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue