Vim swapfile location #18

Closed
opened 2025-12-08 17:59:46 +01:00 by yestax · 2 comments
Owner

Vim swapfile can be useful but is annoying when in the same directory (git detection for instance)

:help swapfile give information on how to change the directory
:help directory

set-= is preferred

Vim swapfile can be useful but is annoying when in the same directory (git detection for instance) :help swapfile give information on how to change the directory :help directory set-= is preferred
yestax self-assigned this 2025-12-08 17:59:46 +01:00
Author
Owner

see :h directory

set-= is preferred but here we override the entire list so i think classic set is preferred.

use // at the end to use the file fullname so if 2 files of the same name are edited there is no conflict

To create the directories
call mkdir($HOME.'/.vim/swap', 'p', 0700)
call mkdir($HOME.'/.vim/backup', 'p', 0700)
call mkdir($HOME.'/.vim/undo', 'p', 0700)

Also possible to set

  • undofile/undodir
  • backupfile/backupdir

writebackup option seems on. It backups only just before write.

see :h directory set-= is preferred but here we override the entire list so i think classic set is preferred. use // at the end to use the file fullname so if 2 files of the same name are edited there is no conflict To create the directories call mkdir($HOME.'/.vim/swap', 'p', 0700) call mkdir($HOME.'/.vim/backup', 'p', 0700) call mkdir($HOME.'/.vim/undo', 'p', 0700) Also possible to set - undofile/undodir - backupfile/backupdir writebackup option seems on. It backups only just before write.
yestax added this to the Setup v1.2.X milestone 2026-04-21 23:16:06 +02:00
Author
Owner

Implemented

Implemented
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
yestax/setup#18
No description provided.