X-Git-Url: https://git.phdru.name/?p=dotfiles.git;a=blobdiff_plain;f=.vimrc;h=f30bb3991f16349fa1028cb9b8e9e83b072a7671;hp=6f6a46296ce8f56bbaa0dfaf72c4db902bb611f2;hb=9d51a77fa59c2b93d0f07054c765ceac98372ea7;hpb=164fe482fb8720ccca04c0cf2a696e867cbece67 diff --git a/.vimrc b/.vimrc index 6f6a462..f30bb39 100644 --- a/.vimrc +++ b/.vimrc @@ -38,6 +38,7 @@ behave xterm " 2 moving around, searching and patterns set ignorecase " Ignore case in search patterns +set noincsearch " No incremental searching set smartcase " Match 'word' case-insensitive and 'Word' case-sensitive set nostartofline " Keep cursor's column @@ -86,7 +87,9 @@ set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:p:h\")})%)%(\ %a%)\ -\ [%{$USER}@%{h " 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 @@ -182,15 +185,16 @@ set fileencodings=ucs-bom,us-ascii,utf-8,koi8-r,cp1251,cp866,latin1 " ' - 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 @@ -569,6 +573,9 @@ function! SlowTerm() set nowildmenu set wildmode=list:longest set viminfo=!,h,'10,<100,s5 + if has("iconv") + set viminfo+=c + endif syntax off highlight NonText cterm=NONE ctermfg=NONE endfunction @@ -588,7 +595,7 @@ endif " From Tip 212: -" http://vim.wikia.com/wiki/Setting_file_attributes_without_reloading_a_buffer +" http://vim.fandom.com/wiki/Setting_file_attributes_without_reloading_a_buffer if executable('chmod') function! SetExecutableBit(x) @@ -605,6 +612,7 @@ if executable('chmod') echoerr 'Error running chmod: ' . v:shell_error endif checktime + autocmd! FileChangedShell endfunction function! _BufChangedCB() autocmd! FileChangedShell @@ -655,7 +663,7 @@ endif " Called automagically after every buffer read, enables fileencoding " setting from modeline (see Tip #911: -" http://vim.wikia.com/wiki/How_to_make_fileencoding_work_in_the_modeline) +" http://vim.fandom.com/wiki/How_to_make_fileencoding_work_in_the_modeline) function! AutoEncoding() if &modified && &fileencoding != "" call SetupEncoding(&fileencoding) @@ -778,5 +786,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