X-Git-Url: https://git.phdru.name/?p=dotfiles.git;a=blobdiff_plain;f=.vimrc;h=ab92bd46f9f0723c51a09c5c6d7c376509098253;hp=bcc859b9871c29e94f3125c3805d7a24ca65c5a6;hb=c4ff18c37a5d7c6f0418e547fbf4aacc4537da3d;hpb=f2641bfb9be0514a54abd0872304182fa307160f diff --git a/.vimrc b/.vimrc index bcc859b..ab92bd4 100644 --- a/.vimrc +++ b/.vimrc @@ -185,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 @@ -573,7 +574,7 @@ function! SlowTerm() 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 @@ -611,6 +612,7 @@ if executable('chmod') echoerr 'Error running chmod: ' . v:shell_error endif checktime + autocmd! FileChangedShell endfunction function! _BufChangedCB() autocmd! FileChangedShell @@ -618,6 +620,15 @@ if executable('chmod') command! ToggleXbit if executable(expand("%:p")) | call SetExecutableBit(0) | else | call SetExecutableBit(1) | endif endif +function! Code() + setlocal tabstop=8 softtabstop=4 shiftwidth=4 expandtab +endfunction +command! Code call Code() + +function! Text() + setlocal tabstop=8 softtabstop=3 shiftwidth=3 expandtab +endfunction +command! Text call Text() " ---------- " From http://slobin.pp.ru/vim/_vimrc.html @@ -784,5 +795,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