Created
May 22, 2011 17:22
-
-
Save frangio/985684 to your computer and use it in GitHub Desktop.
Vim - Don't create swap files for files in the Dropbox folder (useful for folders shared with Windows people)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autocmd BufNewFile,BufRead * | |
\ if expand('%:~') =~ '^\~/Dropbox' | | |
\ set noswapfile | | |
\ else | | |
\ set swapfile | | |
\ endif |
swapfile
is local to the buffer, so I don't think re-enabling it is necessary. I am using this for now:
autocmd BufNewFile,BufRead {$HOME/Dropbox/*} setlocal noswapfile | let b:NoSwapSuck_NoSwapfile = 1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://vim.wikia.com/wiki/Remove_swap_and_backup_files_from_your_working_directory seems to have an alternative for storing the swap file in a different directory.