X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=vimrc;h=7df6365182611242b13b9de9edc4a4ad4e24b202;hb=114d0fb1fdbf4906b4a9907292746eab77d6b808;hp=41dd8124b00fe1846168383d45a8b32f7f11cad7;hpb=1d44157241bd1b310c143faa0f269e90757731cc;p=config%2Fdotfiles.git diff --git a/vimrc b/vimrc index 41dd812..7df6365 100644 --- a/vimrc +++ b/vimrc @@ -49,8 +49,11 @@ set encoding=utf-8 set runtimepath-=~/.vim set runtimepath^=~/.vim,~/.vim/runtime -" Don't store swap files in the same directory as the edited file. -set directory-=. +" Don't store swap files in the same directory as the edited file. But only if +" we have a "safe" writable directory available. +if filewritable('~/.tmp') == 2 || filewritable('~/tmp') == 2 + set directory-=. +endif " But store them in ~/.tmp or ~/tmp (already set by default) if available. set directory^=~/.tmp @@ -117,6 +120,9 @@ endif " existing files. set fileencodings=utf-8,latin1 +" Always use unix line-endings for new files. +set fileformats=unix,dos + " Wrap text after 78 characters. set textwidth=78