Skip to content
Browse files

Fixed how directory/viewdir/backupdir are set in .vimrc -- quoting th…

…e value causes it not to work on at least Ubuntu and Mac OS X.

The quotes were added along with comments about making things work on Windows, so I assume they are needed there and have wrapped them in a check for win32 or win64
  • Loading branch information...
1 parent c84cbf1 commit 0f15a70e648ad53ce84d35b2a030b90cdda8494f @bloveridge bloveridge committed Jan 23, 2011
Showing with 9 additions and 4 deletions.
  1. +9 −4 .vimrc
View
13 .vimrc
@@ -350,10 +350,15 @@ function! InitializeDirectories()
echo "Warning: Unable to create backup directory: " . directory
echo "Try: mkdir -p " . directory
else
- " Adding an extra trailing slash so it stores the path and not just the
- " filename so there aren't collisions for backups
- " Windows Vista / 7 has UAC issues, so setting $temp as fallback
- exec "set " . settingname . "=\"" . directory . "\""
+ if has('win32') || has('win64')
+ " Adding an extra trailing slash so it stores the path and not just the
+ " filename so there aren't collisions for backups
+ " Windows Vista / 7 has UAC issues, so setting $temp as fallback
+ exec "set " . settingname . "=\"" . directory . "\""
+ else
+ " For Linux/Mac OS (others?) these directives must not be quoted
+ exec "set " . settingname . "=" . directory
+ endif
endif
endfor
endfunction

0 comments on commit 0f15a70

Please sign in to comment.
Something went wrong with that request. Please try again.