" 9 using the mouse
-set mouse=ar " Use mouse in all modes, plus hit-return
+if has('mouse')
+ set mouse=ar " Use mouse in all modes, plus hit-return
+endif
" 12 messages and info
" ' - number of files for which the marks are remembered;
" " and < - maximum number of lines saved for a register;
" s - maximum size of an item in Kbytes.
+set viminfo=!,h,'50
if version < 603
- set viminfo=!,h,'50,\"1000
+ set viminfo+=\"1000
else
- set viminfo=!,h,'50,<1000,s10
+ set viminfo+=<1000,s10
endif
" c - convert viminfo to the current encoding;
if has("iconv")
- set viminfo^=c
+ set viminfo+=c
endif
" Removable media paths
set wildmode=list:longest
set viminfo=!,h,'10,<100,s5
if has("iconv")
- set viminfo^=c
+ set viminfo+=c
endif
syntax off
highlight NonText cterm=NONE ctermfg=NONE
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