Saturday, April 22, 2017

Re: Swap directory changes when opening files under /media [Fedora]

2017-04-21 13:16 GMT+03:00 Ian <ian.cross@gmail.com>:
> Perfect, thanks. Here's what I get:
>
> --- Auto-Commands ---
> fedora BufReadPre
> /media/* set directory=~/tmp,/var/tmp,/tmp
> Last set from /etc/vimrc
> /run/media/*
> set directory=~/tmp,/var/tmp,/tmp
> Last set from /etc/vimrc
> /mnt/* set directory=~/tmp,/var/tmp,/tmp
> Last set from /etc/vimrc
> ...
>
> This lead me to /etc/vimrc which has a line:
>
> " don't write swapfile on most commonly used directories for NFS mounts or USB sticks
> autocmd BufNewFile,BufReadPre /media/*,/run/media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp
>
> Which confuses me. The aim appears to be to NOT write swap files but all it does is change the location of swap files. And I do want swap files for my mounts in case of recovery.
>
> I am tempted to remove this line though it feels a bit hacky to change this in /etc/vimrc. I will see if I can work out how to override this autocmd in my own profile perhaps.

Files in /etc are editable, it is OK to modify them if you are system
administrator, correct package manager must not overwrite edited files
in /etc. I would suggest to file a bug report to fedora Vim package
maintainers: these autocommands serve no purpose if &directory option
contains no `.`. Additionally they change a global option so if you
open file in /media and another file you will find out that swap files
for that another file are also put into ~/tmp, or /var/tmp, or /tmp.

>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: