From 4a50822e293974fc86d3c668cfc5da5c348e7b1e Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 30 Apr 2014 20:58:52 -0400 Subject: vimrc: store backup/swap files in ~/.vim Instead of dropping .swp etc. files all over the filesystem, put them in the `~/.vim/backup/` directory. Here we have three directories, one for each of backups, swap, and undo. --- vimrc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'vimrc') diff --git a/vimrc b/vimrc index 8614fd5..7807541 100644 --- a/vimrc +++ b/vimrc @@ -90,6 +90,10 @@ " * Add autocmd to set .json files to use JavaScript syntax highlighting " and have a json filetype " +" 2014.04.30: +" * Set backupdir, directory, and undodir to be within ~/.vim so that my +" filesystem doesn't clutter with *.swp files and the like +" " Pathogen @@ -138,6 +142,12 @@ set grepprg=ack " Use ack instead of grep set ignorecase " Case insensitive set smartcase " Case insensitive unless an uppercase character is entered +" Store swap files in .vim/ directory +" http://stackoverflow.com/a/15317146 +set backupdir=~/.vim/backup/backup// +set directory=~/.vim/backup/swap// +set undodir=~/.vim/backup/undo// + set laststatus=2 " Always show the status line " Statusline -- cgit v1.2.3