Store swap and backup files in central directory

4 Points

Florian Beer Florian Beer

4 years ago

Store all .swp and ~ files in a central directory in your homedir to avoid littering your filesystem with leftover files. (Improvements by Reddit user magus424)

set directory=$HOME/.vim/swap//
if !isdirectory(&directory)
  call mkdir(&directory)

set backupdir=$HOME/.vim/backup//
if !isdirectory(&backupdir)
  call mkdir(&backupdir)

set backupcopy=yes
set backup

Martínez Ortiz Saúl Axel

Martínez Ortiz Saúl Axel 8 months ago

I like but I would still just use git