Please add information so that this serves as a vim turd file reference.
Moving my vim setup over from Windows XP to Windows 10, I ran a few
experiments today trying to figure out how best to set up vim on Windows 10
so that the turd files it leaves (a) don't jump around, and (b) don't
clutter up the current directory.
0.
https://s12.postimg.org/nezeiaxi5/00_gvim_setup.jpg
1.
https://s13.postimg.org/heacohyfr/01_gvim_setup.jpg
2.
https://s1.postimg.org/etb4r7nbj/02_gvim_setup.jpg
3.
https://s24.postimg.org/4ubjqqo91/03_gvim_setup.jpg
4.
https://s2.postimg.org/mxku3cuy1/04_gvim_setup.jpg
5.
https://s18.postimg.org/6a1wh5t55/05_gvim_setup.jpg
6.
https://s18.postimg.org/j11l1p4x5/06_gvim_setup.jpg
7.
https://s29.postimg.org/auknub1uf/07_gvim_setup.jpg
0. Here are my _vimrc turd-file settings (also included below).
C:\apps\editor\txt\gvim\_vimrc
set directory=C:\\tmp\vim\directory//,%TMP%,C:\WINDOWS\Temp//,$HOME,.
set backupdir=C:\\tmp\vim\backupdir//,%TMP%,C:\WINDOWS\Temp//,$HOME,.
set undodir=C:\\tmp\vim\undodir//,%TMP%,C:\WINDOWS\Temp//,$HOME,.
https://s12.postimg.org/nezeiaxi5/00_gvim_setup.jpg
1. The file simply exists (there are no turd files)
FILE = C:\data\test\foo.txt
swap turd = C:\tmp\vim\directory\{empty}
backup turd = C:\tmp\vim\backupdir\{empty}
undo turd = C:\tmp\vim\undodir\{empty}
https://s13.postimg.org/heacohyfr/01_gvim_setup.jpg
2. The file is opened for edit
A swap file is created in "directory", named C:%%data%test%foo.txt.swp
FILE = C:\data\test\foo.txt
swap turd = C:\tmp\vim\directory\C:%%data%test%foo.txt.swp
backup turd = C:\tmp\vim\backupdir\{empty}
undo turd = C:\tmp\vim\undodir\{empty}
https://s1.postimg.org/etb4r7nbj/02_gvim_setup.jpg
3. The swap file is a lock turd that contains crash-recovery information:
https://s24.postimg.org/4ubjqqo91/03_gvim_setup.jpg
4. The file is saved
A backup file is created in "backupdir", named foo.txt~
FILE = C:\data\test\foo.txt
swap turd = C:\tmp\vim\directory\C:%%data%test%foo.txt.swp
backup turd = C:\tmp\vim\backupdir\foo.txt~
undo turd = C:\tmp\vim\undodir\{empty}
https://s2.postimg.org/mxku3cuy1/04_gvim_setup.jpg
5. This backup is just a copy of the original file before any edits
https://s18.postimg.org/6a1wh5t55/05_gvim_setup.jpg
6. An edit is introduced
This creates an undo file in "undodir", named C%%data%test%foo.txt
FILE = C:\data\test\foo.txt
swap turd = C:\tmp\vim\directory\C:%%data%test%foo.txt.swp
backup turd = C:\tmp\vim\backupdir\foo.txt~
undo turd = C:\tmp\vim\undodir\C%%data%test%foo.txt
https://s18.postimg.org/j11l1p4x5/06_gvim_setup.jpg
7. The undo file contains undo changes
https://s29.postimg.org/auknub1uf/07_gvim_setup.jpg
Please improve so that this thread serves as a vim turd file reference.
(Note: Linux added as their users know vim rather well so they can help!)
" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "
" My user edits are below this line (where doublequote starts a comment)
" The default vimrc is located at: " C:\Program Files (x86)\Vim\_vimrc
" Typing the ":version" command lists rc file locations.
" Vim settings are in _givmrc (which is always sourced)
" GVim settings are in _gvmrc (which is also sourced if the GUI is invoked)
" Using separate _vimrc & _gvimrc files avoids if-then-else clutter:
" if has("win32") || has("win64")
" set directory=$TEMP,. " swap filescurrent dir
" set backupdir=C:\temp,$HOME,. " backup files
" set undodir=C:\temp,$HOME,. " undo files
" endif
" if has("gui_win32") || has("gui_win64")
" syntax on
" colo desert
" set guifont=Consolas:h12
" endif
" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "
" Given a file being edited that is named foo.txt, the defaults are:
" .foo.txt.swap is a temporary swap file while editing (& lock/undo file)
" .foo.txt~ is a temporary backup of the original file before editing
" .foo.txt.un~ is a temporary undo file after editing
" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "
" Default Windows temporary directories are:
" Start > Run > %TMP% is C:\Users\usr1\AppData\Local\Temp
" Start > Run > %TEMP% is C:\Users\usr1\AppData\Local\Temp
" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "
" Double trailing slashes make the otherwise centralized swap files use
" filenames that are based on the full pathname of the edited file
" (this prevents swap file name collisions when editing two files of the
" same name at the same time, e.g., README files)
" EXAMPLE: set directory=c:\\tmp//,c:\\temp//
" Comma-separated values sequence in case directories don't exist
" A dot (.) means the current directory of the file being edited
" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "
" The "backupdir" is for backup files .foo.txt~
" The backup file is the last copy of the file as opened before new edits.
" Default vim behavior upon writing with "backup" turned on, is to "jump":
" a. Write the buffer to a new file name
" b. Delete the original file
" c. Rename the new file to the original file name
" With "nobackup", vim writes the buffer directly to the original file.
" set backup
" set nobackup
" set nowritebackup
set backupdir=C:\\tmp\vim\backupdir//,%TMP%,C:\WINDOWS\Temp//,$HOME,.
" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "
" The "directory" is for temporary swap files .foo.txt.swp
" Temporary swap files only exist during edits.
" The swap file is a lock file & a crash-recovery file.
" set swapfile
" set noswapfile
" set directory-=. (removes the directory from the sequence list)
set directory=C:\\tmp\vim\directory//,%TMP%,C:\WINDOWS\Temp//,$HOME,.
" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "
" The "undodir" is for undo files .foo.txt.un~
" set undofile
" set noundofile
set undodir=C:\\tmp\vim\undodir//,%TMP%,C:\WINDOWS\Temp//,$HOME,.
" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "