Created
June 25, 2022 08:38
-
-
Save derekschrock/faa9663dce2ec0fd4853494a8f8f8479 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Check_readonly() | |
if &readonly | |
highlight Normal ctermfg=white ctermbg=gray | |
else | |
highlight Normal ctermfg=white ctermbg=black | |
endif | |
endfunction | |
autocmd BufEnter * :call Check_readonly() | |
autocmd BufReadPost * :call Check_readonly() | |
autocmd OptionSet readonly highlight Normal ctermfg=grey ctermbg=gray |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment