From 825d2824f382053cb877056a057bf0699ee0cea7 Mon Sep 17 00:00:00 2001 From: Michael Campagnaro Date: Wed, 6 Dec 2017 18:47:39 -0500 Subject: [PATCH] Fix vim swap error when opening files with build errors The double slash is needed apparently. This will set the swap name to the path of the file. --- vimrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vimrc b/vimrc index 3fa1f34..4ebdedf 100644 --- a/vimrc +++ b/vimrc @@ -232,9 +232,10 @@ set scrolloff=3 " Store temporary files in a central spot set backup -set directory=$HOME/tmp " For swap files -set backupdir=$HOME/tmp +set directory=$HOME/tmp// " For swap files +set backupdir=$HOME/tmp// :au BufWritePre * let &bex = '.' . strftime("%Y-%m-%d-%T") . '.bak' +set writebackup " allow backspacing over everything in insert mode set backspace=indent,eol,start @@ -311,6 +312,7 @@ augroup campoCmds " Jump to last cursor position unless it's invalid or in an event handler autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif + " Language identation autocmd FileType ruby,haml,eruby,yaml,html,javascript,rust,go set ai sw=2 sts=2 et autocmd FileType python,qml set sw=4 sts=4 et