I'm editing HTML files. I use this keymap to launch firefox to preview the page:
map <F6> :update<CR>:silent !xdg-open %:p<CR>
But after this command, the Vim window becomes completely black. I need to scroll every line to make it appear again.
So I want to write a function to fresh the buffer. Here's what i did:
function! Refresh()
" code
set noconfirm
bufdo e!
set confirm
endfunction
nmap <F5> :call Refresh()<CR>
I got the idea from this post. But it doesn't work.