X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=etc%2Fvim%2Fvimrc;h=6b5121d833903f7927e6ac8945e6e1fac048b6c3;hb=a9a0a823c8c0c5c297afa7c4307adf9cf4644628;hp=79c7ab692f1354718406661a94e1ec82c6e86c1a;hpb=e158c40bcae1d2553d0ed9ac7d8fb85562915372;p=grml-etc-core.git diff --git a/etc/vim/vimrc b/etc/vim/vimrc index 79c7ab6..6b5121d 100644 --- a/etc/vim/vimrc +++ b/etc/vim/vimrc @@ -34,8 +34,6 @@ " set linebreak " Don't wrap words by default set textwidth=0 " Don't wrap lines by default set nobackup " Don't keep a backup file - set backupcopy=no " grml: Overwrite files/links with w! -" set backupcopy=yes " Keep a backup file set viminfo='20,\"50 " read/write a .viminfo file, don't store more than " 50 lines of registers set history=50 " keep 50 lines of command line history @@ -246,6 +244,20 @@ if version >= 700 " highlight PmenuThumb cterm=reverse gui=reverse guifg=Black guibg=#AAAAAA " thumb of the scrollbar endif +if version >= 703 + " enable persistent-undo + set undofile + + " store the persistent undo file in ~/.cache/vim + set undodir=~/.cache/vim/ + + " create undodir directory if possible and does not exist yet + let targetdir=$HOME . "/.cache/vim" + if isdirectory(targetdir) != 1 && getftype(targetdir) == "" && exists("*mkdir") + call mkdir(targetdir, "p", 0700) + endif +endif + " Source a global configuration file if available " Deprecated by Debian but still supported by grml if filereadable("/etc/vim/vimrc.local")