aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-10-28 21:24:00 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-28 21:24:46 +1300
commit974df16c51b86252fa0b53f4052d7c7369f48fed (patch)
treefd399d7d5d7191fd2b2b36aa7d3aa51405c2f220
parentSet up .d-style vimrc subdir for config breakup (diff)
downloaddotfiles-974df16c51b86252fa0b53f4052d7c7369f48fed.tar.gz
dotfiles-974df16c51b86252fa0b53f4052d7c7369f48fed.zip
Move backup .vimrc config into subfile
Replace the test.vim file placed by 19f6f3 to do this.
-rw-r--r--vim/config/backup.vim26
-rw-r--r--vim/config/test.vim2
-rw-r--r--vim/vimrc27
3 files changed, 26 insertions, 29 deletions
diff --git a/vim/config/backup.vim b/vim/config/backup.vim
new file mode 100644
index 00000000..718647fc
--- /dev/null
+++ b/vim/config/backup.vim
@@ -0,0 +1,26 @@
+" Use backup features if on a UNIX-like system and not using sudo(8)
+if !strlen($SUDO_USER) && has('unix')
+
+ " Keep backups with a .bak extension in ~/.vim/backup; the double-slash at
+ " the end of the directory is supposed to prod Vim into keeping the full
+ " path to the file in its backup filename to avoid collisions, but I don't
+ " think it actually works for backups, just undo and swap files
+ set backup
+ set backupext=.bak
+ set backupdir^=~/.vim/backup//
+
+ " This option already includes various temporary directories, but we
+ " append to it so that we don't back up anything in a shared memory
+ " filesystem either
+ set backupskip+=*/shm/*
+
+ " Create the backup directory if necessary and possible
+ if !isdirectory($HOME . '/.vim/backup') && exists('*mkdir')
+ call mkdir($HOME . '/.vim/backup', 'p', 0700)
+ endif
+
+" Don't use backups at all otherwise
+else
+ set nobackup
+ set nowritebackup
+endif
diff --git a/vim/config/test.vim b/vim/config/test.vim
deleted file mode 100644
index b92ea09e..00000000
--- a/vim/config/test.vim
+++ /dev/null
@@ -1,2 +0,0 @@
-" Confirm that config subfiles are loading correctly
-echo "Config subfiles loading!"
diff --git a/vim/vimrc b/vim/vimrc
index a6a67dc7..9cbf309d 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -23,33 +23,6 @@ if has('autocmd')
filetype indent plugin on
endif
-" Use backup features if on a UNIX-like system and not using sudo(8)
-if !strlen($SUDO_USER) && has('unix')
-
- " Keep backups with a .bak extension in ~/.vim/backup; the double-slash at
- " the end of the directory is supposed to prod Vim into keeping the full
- " path to the file in its backup filename to avoid collisions, but I don't
- " think it actually works for backups, just undo and swap files
- set backup
- set backupext=.bak
- set backupdir^=~/.vim/backup//
-
- " This option already includes various temporary directories, but we
- " append to it so that we don't back up anything in a shared memory
- " filesystem either
- set backupskip+=*/shm/*
-
- " Create the backup directory if necessary and possible
- if !isdirectory($HOME . '/.vim/backup') && exists('*mkdir')
- call mkdir($HOME . '/.vim/backup', 'p', 0700)
- endif
-
-" Don't use backups at all otherwise
-else
- set nobackup
- set nowritebackup
-endif
-
" Options dependent on the syntax feature
if has('syntax')