New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The `'backupdir'` option doesn't support full paths. #2501

Open
ghost opened this Issue Apr 25, 2015 · 5 comments

Comments

Projects
None yet
5 participants
@ghost

ghost commented Apr 25, 2015

The 'directory' and 'undodir' options support saving backup files based on the files full path. This functionality is missing from 'backupdir' and this functionality has been sitting in vim's todo list for over 4 years:

7 The 'directory' option supports changing path separators to "%" to make
file names unique, also support this for 'backupdir'. (Mikolaj Machowski)
Patch by Christian Brabandt, 2010 Oct 21.

Here's the forgotten patch.

@robertmeta

This comment has been minimized.

Show comment
Hide comment
@robertmeta

robertmeta May 25, 2015

Glad to see this already sitting here with a patch! I was coming to request this unification of expectations.

robertmeta commented May 25, 2015

Glad to see this already sitting here with a patch! I was coming to request this unification of expectations.

@Shougo

This comment has been minimized.

Show comment
Hide comment
@Shougo

Shougo May 25, 2015

Contributor

Unfortunatelly, @ghost is removed account. And it seems already merged.
It should be closed?

Contributor

Shougo commented May 25, 2015

Unfortunatelly, @ghost is removed account. And it seems already merged.
It should be closed?

@splinterofchaos

This comment has been minimized.

Show comment
Hide comment
@splinterofchaos

splinterofchaos May 25, 2015

Member

If you're refering to "Implement saving full paths for 'backupdir'. #2501", it is not on the master branch, and I don't see a PR attached to the commit.

Member

splinterofchaos commented May 25, 2015

If you're refering to "Implement saving full paths for 'backupdir'. #2501", it is not on the master branch, and I don't see a PR attached to the commit.

@Shougo

This comment has been minimized.

Show comment
Hide comment
@Shougo

Shougo May 25, 2015

Contributor

OH....

Contributor

Shougo commented May 25, 2015

OH....

@justinmk justinmk added this to the 0.3 milestone Aug 17, 2015

@mkoskar

This comment has been minimized.

Show comment
Hide comment
@mkoskar

mkoskar Mar 15, 2017

Since I've come across this, I'll offer kind of workaround I'm using successfully for quiet a long time:

autocmd BufWritePre * let &backupext = substitute(expand('%:p:h'), '/', '%', 'g')

mkoskar commented Mar 15, 2017

Since I've come across this, I'll offer kind of workaround I'm using successfully for quiet a long time:

autocmd BufWritePre * let &backupext = substitute(expand('%:p:h'), '/', '%', 'g')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment