From cf1fcbf3b80158230383b27776ca768899b3a52b Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 9 May 2019 20:38:46 +0300 Subject: [PATCH] .vimrc: Set universal encoding for .viminfo Set encoding in autocmd `VimLeavePre` for `.viminfo`. --- .vimrc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.vimrc b/.vimrc index d06404d..b25ff63 100644 --- a/.vimrc +++ b/.vimrc @@ -785,5 +785,15 @@ command! UName Uname endif " ---------- +if has("iconv") +function! SetViminfoEncoding() + " Set universal encoding for .viminfo + if &encoding != 'utf-8' + set encoding=utf-8 + endif +endfunction +autocmd VimLeavePre * call SetViminfoEncoding() +endif + " This has to go to the very end of ~/.vimrc to allow reading the .vimrc set secure " safer working with script files in the current directory -- 2.39.5