Skip to content

Commit f20cef3

Browse files
committed
Nvim: hide EndOfBuffer markers
1 parent d663f4d commit f20cef3

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

autoload/startify.vim

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ function! startify#insane_in_the_membrane(on_vimenter) abort
152152

153153
setlocal nomodifiable nomodified
154154

155+
call s:hide_endofbuffer_markers()
156+
155157
call s:set_mappings()
156158
call cursor(b:startify.firstline, 5)
157159
autocmd startify CursorMoved <buffer> call s:set_cursor()
@@ -1111,6 +1113,24 @@ function s:transform(absolute_path)
11111113
return ''
11121114
endfunction
11131115

1116+
" Function: s:hide_endofbuffer_markers {{{1
1117+
" Use the bg color of Normal to set the fg color of EndOfBuffer, effectively
1118+
" hiding it.
1119+
function! s:hide_endofbuffer_markers()
1120+
if !exists('+winhl')
1121+
return
1122+
endif
1123+
let val = synIDattr(hlID('Normal'), 'bg')
1124+
if empty(val)
1125+
return
1126+
elseif val =~ '^\d*$'
1127+
execute 'highlight StartifyEndOfBuffer ctermfg='. val
1128+
else
1129+
execute 'highlight StartifyEndOfBuffer guifg='. val
1130+
endif
1131+
setlocal winhighlight=EndOfBuffer:StartifyEndOfBuffer
1132+
endfunction
1133+
11141134
" Function: s:warn {{{1
11151135
function! s:warn(msg) abort
11161136
echohl WarningMsg

0 commit comments

Comments
 (0)